Repository navigation
feat(story-author): fixes for script problems, line pacing, and a public contract check - #26
Merged
Merged
Conversation
A script's problems now say how to fix them, not only what is wrong, and the renderer reports how long each line takes. Every problem whose fix is known carries it as JSON Patch operations on the script document: an unknown key is renamed to the nearest key of the format (when the object does not hold that key already), an unknown name is replaced by the nearest one the site has, a repeated beat id takes the first free suffix, and two characters on one position put the later one on the nearest free position. `--fix <file>` on `check` and `render` writes the script with those fixes applied (later beats first, so the beats a fix adds do not move the ones after it) and checks the written script again, reporting which fixes went in and where the fixed script stands. A line that overflows the talk window is measured in the browser, laid out again with TextMeshPro's word wrapping (the breaks the game's text engine takes, CJK line breaking rules included), and comes with a fix that breaks the text where the game breaks it and, where the window holds fewer lines, spreads it over beats of the same speaker after it. `render` frames also carry the line's pacing in story seconds: the characters the typewriter types, the time until its text is fully shown, and the hold auto mode adds from the base story's talk timings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The entry points table of docs/story.md now lists everything `ournotes-player/story` exports: SimpleStorySession, parseStorySpeed, the command registry (unregisteredCommands, StoryPlayerCore, StoryCommandError), the story UI interface (checkStoryUI, StoryUILayer, createStoryUILayers), STORY_LANGUAGES, storyLines, advViewport, the control labels (STORY_STRINGS, storyStrings) and ADV_PLAYBACK_SPEEDS. docs/api.md lists cameraProjection for `ournotes-player/ui`. The story author's documentation names the --timeout option of the picture commands, and its usage text names render's --columns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`npm run contract:check` (scripts/check-contracts.mjs) compares what package.json, the modules, the type declarations, the schemas and the documents say about the same things, and fails on any disagreement: - package: main, module and types are the "." entry's, and every files entry, exports target and sideEffects pattern names files that exist inside `files`; - entries: each entry point's runtime exports (its bundle's ES exports) are the values its .d.ts exports and the names its row of an entry points table in docs/ lists; - schemas: each schema is draft 2020-12 with its raw URL as $id, uses only the keywords the validator implements, is loaded by validate-data and named in docs/; - formats: the ournotes.* format ids of the code, types and schemas and those of the documents are the same; - links: relative Markdown links and their #fragments resolve; - story-author: the CLI's commands, options and problem codes are the ones its usage text and docs/story-author.md describe; - workflows: the CI job and the release verification job run the same commands in the same order. CI and the release verification job run it after the build check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The story author reports how to fix a script's problems and how each line is paced, and the package's public contracts are checked in CI.
_<n>, and the later of two characters on one position moves to the nearest free position.--fix <file>oncheckandrenderwrites the script with the fixes applied (later beats first) and checks the written script again.renderlays an overflowing line out again with TextMeshPro's word wrapping (the game's breaks, CJK line breaking rules included) and attaches a fix that breaks the text there and, where the window holds fewer lines, spreads it over beats of the same speaker after it.timing: the characters the typewriter types, the story seconds until the text is fully shown, and the hold auto mode adds from the base story's talk timings.npm run contract:check.scripts/check-contracts.mjschecks that package.json (main, module, types, files, exports, sideEffects), each entry point's runtime exports, its type declarations and its row in the documents' entry points tables, the schemas ($schema, $id, keywords, validate-data and docs references), theournotes.*format ids, the Markdown links and anchors, the story author's commands, options and problem codes, and the CI and release verification steps agree. CI and the release verification job run it after the build check.cameraProjectionmissing); docs/story-author.md describes fixes,--fix,timingand--timeout.Validation:
npm test(669 pass, 2 skipped, with new tests for the fixes, the wrap and split of a line, applying fixes andcheck --fixon the synthetic site),npm run typecheck,npm run lint,node scripts/build.mjs --check,npm run contract:checkandnpm pack --dry-run(278 files) pass locally on Node.js 22.