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,31 @@
|
||||
// Lura, mid beat. After the player's 4th harvest (CONTEXT D-14).
|
||||
//
|
||||
// See lura-arrival.ink for variable contract + tone notes. Lura is the
|
||||
// warmth anchor: specific, slightly funny, never sentimental. She knows
|
||||
// something is happening to the world and she is choosing to be useful
|
||||
// about it instead of mournful.
|
||||
|
||||
VAR fragment_count = 0
|
||||
VAR last_plant_type = ""
|
||||
|
||||
== mid ==
|
||||
|
||||
Four. That's a real number.
|
||||
|
||||
I tried to do this once, you know. The garden, I mean. Not — not at this scale. A balcony. Three pots, one of them already broken when I bought it. The basil died first. The rosemary survived. The rosemary survives most things.
|
||||
|
||||
You're keeping at it. Most people don't.
|
||||
|
||||
{ last_plant_type == "winter-rose":
|
||||
A winter-rose this time. They're harder. You can tell, can't you. They want a particular kind of attention.
|
||||
- else:
|
||||
{ last_plant_type == "yarrow":
|
||||
Yarrow keeps giving you yarrow. There's a lesson in that and I'm not going to spell it out, that's the kind of thing you ruin by saying.
|
||||
- else:
|
||||
I'm going to be honest, I lost track of which one it was this time. They look different in the wall.
|
||||
}
|
||||
}
|
||||
|
||||
There's something I should be doing. I'll be back when there's more to bring you.
|
||||
|
||||
-> END
|
||||
Reference in New Issue
Block a user