Single-source the version string #5
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The version is hardcoded in three independent places:
package.json:3—"version": "0.0.0"src/index.ts:1—export const VERSION = "0.0.0";bin/quak.ts:58—.version("0.0.0")Nothing derives one from another, and
test/smoke.test.tsonly asserts thatVERSIONis anon-empty string. A partial bump therefore passes
make checkand ships a CLI that reports adifferent version from the package it came from. This has to be fixed before the v1.0.0 bump,
not during it.
Definition of done
package.jsonis thenatural home for it —
resolveJsonModuleis already enabled intsconfig.json.VERSIONexported fromsrc/index.tsand the string reported byquak --versionbothderive from that single source at build time or run time.
VERSION, the CLI's reported version, andpackage.json'sversionfield are all equal. This test must fail if any one of them is changed alone.
package.jsondoes not break the published package layout — if the build emitsto
dist/, the relative path topackage.jsonmust resolve both from source (vitest) andfrom the built output. Verify both.
make checkgreen;make buildgreen.TODO.mdupdated in the same commit.Notes
Do not bump the version to 1.0.0 here. That happens in the tagging issue, once every other
1.0.0 blocker is closed.
Depends on
The build fix issue, since the resolution strategy depends on the final
dist/layout.