fix: always load version from package.json at runtime

This commit is contained in:
Michael Bolin
2025-05-12 21:06:58 -07:00
parent 61b881d4e5
commit f6f1df68f2
11 changed files with 33 additions and 15 deletions
+8
View File
@@ -0,0 +1,8 @@
// Note that "../package.json" is marked external in build.mjs. This ensures
// that the contents of package.json will always be read at runtime, which is
// preferable so we do not have to make a temporary change to package.json in
// the source tree to update the version number in the code.
import pkg from "../package.json" with { type: "json" };
// Read the version directly from package.json.
export const CLI_VERSION: string = (pkg as { version: string }).version;