Summary
packages/stx-native/src/cli/index.ts does not parse. Any invocation of the CLI — compile, build, run, dev, init — fails before it does anything, which means the package's entry point has never once been executed.
Evidence
$ bun src/cli/index.ts compile Screen.stx --platform ios
695 | id: `init_${Date.now()}`,
^
error: Expected ";" but found "init_$"src/cli/index.ts:695 sits inside a template literal that generates JavaScript, and emits another backtick without escaping it. The outer literal ends early and the rest is parsed as code.
// Render initial UI
bridge.postMessage(JSON.stringify({
id: `init_${Date.now()}`, // ← this backtick closes the generator's own literalEvery other module in the package imports cleanly — compiler/parser.ts, compiler/ir.ts, compiler/headwind-to-style.ts, bridge/protocol.ts, components/primitives.ts, runtime/index.ts, hot-reload/client.ts, index.ts. The CLI is the only one that does not load.
This is the failure mode CLAUDE.md note 41 documents for the client runtimes ("the client runtimes are TEMPLATE LITERALS — no backticks, not even in comments"), in a file that generates code rather than one that ships it.
Ask
- Escape the nested backticks (
\`) in the generated-code literals, or build that string with concatenation so a backtick in the output cannot terminate the generator. - Add a smoke test that runs the CLI with
--helpand asserts exit 0. The bug survived because nothing ever invoked the binary.