package.json is now the only place the version is written. src/index.ts imports it (with { type: "json" }) for VERSION, and bin/quak.ts passes VERSION to commander. The version stays 0.0.0.
Things the diff does not show:
tsc copies an imported package.json into dist/package.json (because rootDir is the repo root), so ../package.json resolves from dist/src/index.js as it does from src/index.ts. That copy is inside dist/, which is already in the files list, and npm always packs the root package.json as well; npm pack --dry-run lists both.
script/build now runs the built dist/bin/quak.js --version and fails if it differs from package.json, so every make build proves the import resolves from the built output.
test/smoke.test.ts replaces the non-empty check: it compares VERSION with package.json, and runs bin/quak.ts in-process with --version (stdout and process.exit stubbed) to compare what the CLI prints. Changing the CLI's version alone makes it fail.
Judgement call: dist/package.json is a full copy of the manifest; Node only reads its type field there, so it does not change how the package resolves.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/quak/issues/5.
`package.json` is now the only place the version is written. `src/index.ts` imports it (`with { type: "json" }`) for `VERSION`, and `bin/quak.ts` passes `VERSION` to commander. The version stays `0.0.0`.
Things the diff does not show:
- tsc copies an imported `package.json` into `dist/package.json` (because `rootDir` is the repo root), so `../package.json` resolves from `dist/src/index.js` as it does from `src/index.ts`. That copy is inside `dist/`, which is already in the `files` list, and npm always packs the root `package.json` as well; `npm pack --dry-run` lists both.
- `script/build` now runs the built `dist/bin/quak.js --version` and fails if it differs from `package.json`, so every `make build` proves the import resolves from the built output.
- `test/smoke.test.ts` replaces the non-empty check: it compares `VERSION` with `package.json`, and runs `bin/quak.ts` in-process with `--version` (stdout and `process.exit` stubbed) to compare what the CLI prints. Changing the CLI's version alone makes it fail.
Judgement call: `dist/package.json` is a full copy of the manifest; Node only reads its `type` field there, so it does not change how the package resolves.
Model: opus-5-5
src/index.ts imports package.json for VERSION and bin/quak.ts passes
VERSION to commander, so package.json is the only place the version is
written. tsc copies package.json to dist/package.json, so the import
resolves from the built output; script/build runs the built CLI with
--version to prove it. A test checks VERSION and quak --version against
package.json.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #5.
package.jsonis now the only place the version is written.src/index.tsimports it (with { type: "json" }) forVERSION, andbin/quak.tspassesVERSIONto commander. The version stays0.0.0.Things the diff does not show:
package.jsonintodist/package.json(becauserootDiris the repo root), so../package.jsonresolves fromdist/src/index.jsas it does fromsrc/index.ts. That copy is insidedist/, which is already in thefileslist, and npm always packs the rootpackage.jsonas well;npm pack --dry-runlists both.script/buildnow runs the builtdist/bin/quak.js --versionand fails if it differs frompackage.json, so everymake buildproves the import resolves from the built output.test/smoke.test.tsreplaces the non-empty check: it comparesVERSIONwithpackage.json, and runsbin/quak.tsin-process with--version(stdout andprocess.exitstubbed) to compare what the CLI prints. Changing the CLI's version alone makes it fail.Judgement call:
dist/package.jsonis a full copy of the manifest; Node only reads itstypefield there, so it does not change how the package resolves.Model: opus-5-5
PASS on
3354446rebased ontonext20ca8887.Model: opus-5-5