Repository navigation
fix(recipe): quote values that would read back as a comment or sheet close - #427
Open
rudycelekli wants to merge 1 commit into
Open
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
…close Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
formatRecipeValueleaves a string unquoted when it has no whitespace,;,,, brackets, braces or quotes. Two such strings do not parse back:The SVS parser reads a bare
/*as the start of a comment, and a bare</sheet>as the end of the sheet. Glob-style asset patterns contain/*, and Studio writes edited SVS parameter values through this function (studio/src/parameter-values.ts). A value like these produces a sheet that no longer loads.Strings containing
/*or</sheet>are now written quoted, as JSON strings, which the parser already reads back exactly, including a quoted</sheet>(#377). Every other value is formatted as before.The new test formats and re-parses
assets/*.png,</sheet>, a bare word and a spaced string, and checks that the bare word stays unquoted. It fails on main and passes with the change. It sits in a different part ofsource-closure.test.tsfrom #396.Checks run:
node --import tsx --test packages/recipe/test/*.test.ts packages/studio/test/parameter-values.test.ts packages/text/test/*.test.ts(22 passed)