Skip to content

fix: apply patching fixes#176

Merged
DecimalTurn merged 10 commits intolatestfrom
dev-varia
May 5, 2026
Merged

fix: apply patching fixes#176
DecimalTurn merged 10 commits intolatestfrom
dev-varia

Conversation

@DecimalTurn
Copy link
Copy Markdown
Owner

@DecimalTurn DecimalTurn commented Apr 30, 2026

  • Support table replacement with single value
  • AOT path resolution fix + nested AOT fix

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves TOML patching correctness for structurally tricky documents, specifically around (1) replacing a table section with a scalar value and (2) resolving paths under array-of-tables (AOT), including nested AOT cases.

Changes:

  • Extend patch application to use a JS snapshot (updated_js) for regenerating correct AST nodes in edge cases (table→scalar replacement, AOT regeneration).
  • Enhance findByPath to resolve nodes inside an AOT entry’s logical scope (covering nested AOT + sub-tables stored as Document siblings).
  • Add a comprehensive spec-fixture-based regression test suite for patching.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/patch.ts Adds special-case patching logic for AOT regeneration and table→scalar replacement using updated_js.
src/find-by-path.ts Adds scoped AOT path resolution logic so patch operations can locate nested AOT/sub-table nodes correctly.
src/tests/patch.spec-example.test.ts Adds regression coverage against the TOML spec example fixture for tricky patching scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/find-by-path.ts Outdated
Comment thread src/patch.ts Outdated
Comment thread src/patch.ts
Comment thread src/patch.ts
@DecimalTurn DecimalTurn force-pushed the latest branch 2 times, most recently from 8b93e35 to 9b4148b Compare May 1, 2026 01:06
@DecimalTurn DecimalTurn marked this pull request as ready for review May 5, 2026 05:09
@DecimalTurn DecimalTurn merged commit b4dfe32 into latest May 5, 2026
5 checks passed
@DecimalTurn DecimalTurn deleted the dev-varia branch May 5, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants