feat(02-04): ink compilation pipeline + 4 authored Season-1 Ink files + runtime loader
- scripts/compile-ink.mjs: build-time inklecate runner using bundled binary (BLOCKER 4 — uses node_modules/inklecate/bin, not stale -windows/-mac path strings). Assumption A6 verified first-try on Windows; the same binary path resolution works on macOS + Linux per the wrapper's own getInklecatePath convention. - scripts/compile-ink.test.mjs: 3 Vitest cases proving the compiler runs + emits valid JSON with inkVersion. wipe=false for the test path so it can run in parallel with the ink-loader test without racing on the wipe step. - 4 Season-1 .ink files authored in voice (Lura warmth-anchor, gardener-keeper for compost): lura-arrival.ink, lura-mid.ink, lura-farewell.ink, compost-acknowledgements.ink (rewrite of Plan 02-03 scaffolded version into VAR-driven branch shape consumable by the runtime). - src/content/ink-loader.ts: loadInkStory + bindGardenStateToInk + INK_VARIABLE_MAP. Centralized snake_case slot mapping per Pitfall 4. UTF-8 BOM stripped before Story instantiation. - src/content/ink-loader.test.ts: 8 cases — Story instantiation for all 4 beats, fragment_count binding, Pitfall 4 snake_case enforcement, silent skip for stories missing declared vars. - package.json: build now runs compile:ink first; ci chain runs compile:ink before test so ink-loader.test.ts's precondition check passes. - .gitignore: src/content/compiled-ink/ excluded (regenerated on every build). npm run ci exits 0; 11 new tests green (228 total). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
// Lura, arrival beat. After the player's first harvest.
|
||||
//
|
||||
// Variables read from sim (set via story.variablesState before the first
|
||||
// Continue() — see src/content/ink-loader.ts INK_VARIABLE_MAP):
|
||||
// fragment_count - number of harvested fragments at the moment Lura arrives
|
||||
// last_plant_type - 'rosemary' | 'yarrow' | 'winter-rose'
|
||||
//
|
||||
// Per Pitfall 4: Ink VAR names MUST be snake_case AND match INK_VARIABLE_MAP
|
||||
// keys exactly. Typos do NOT throw — the variable silently keeps its
|
||||
// declared default.
|
||||
//
|
||||
// Per CLAUDE.md Tone — Lura is the warmth anchor for the arc, not a
|
||||
// co-griever. Specific. Intermittent. Sometimes funny. She is the contrast
|
||||
// to the gardener-keeper voice; she does not lament with the player.
|
||||
// She brings news from outside the wall, on her own time.
|
||||
|
||||
VAR fragment_count = 0
|
||||
VAR last_plant_type = ""
|
||||
|
||||
== arrival ==
|
||||
|
||||
Oh. You're already here.
|
||||
|
||||
I thought it'd take longer. The wall held, then. Good.
|
||||
|
||||
{ last_plant_type == "rosemary":
|
||||
Rosemary. Of course rosemary. My grandmother kept some in a coffee can on the porch and it outlived two of her dogs.
|
||||
- else:
|
||||
{ last_plant_type == "yarrow":
|
||||
Yarrow. There's an old saying about yarrow and I cannot for the life of me remember what it is. The forgetting is the joke, I think.
|
||||
- else:
|
||||
{ last_plant_type == "winter-rose":
|
||||
Winter-rose, on the first try. You don't mess around. Most people start small.
|
||||
- else:
|
||||
Something grew. That's a start. That's not nothing.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
I won't keep you. I just wanted to see it for myself.
|
||||
|
||||
I'll come back when there's more to come back for.
|
||||
|
||||
-> END
|
||||
Reference in New Issue
Block a user