Skip to content

Commit bcb6f38

Browse files
committed
fix(cli): inline webviewer version for published builds
1 parent 6d0901a commit bcb6f38

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

packages/cli/src/globals.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
declare const __FMDAPI_VERSION__: string;
22
declare const __BETTER_AUTH_VERSION__: string;
3+
declare const __WEBVIEWER_VERSION__: string;

packages/cli/src/utils/getProofKitVersion.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export const getProofkitBetterAuthVersion = () => {
3030
};
3131

3232
export const getProofkitWebviewerVersion = () => {
33-
const packageJsonPath = path.join(PKG_ROOT, "../webviewer/package.json");
34-
const packageJsonContent = fs.readJSONSync(packageJsonPath) as PackageJson;
35-
return packageJsonContent.version ?? "beta";
33+
// biome-ignore lint/correctness/noUndeclaredVariables: replaced at build time via tsdown
34+
return __WEBVIEWER_VERSION__;
3635
};

packages/cli/tsdown.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const readPackageVersion = (packagePath: string) => {
2323

2424
const FMDAPI_VERSION = readPackageVersion("fmdapi");
2525
const BETTER_AUTH_VERSION = readPackageVersion("better-auth");
26+
const WEBVIEWER_VERSION = readPackageVersion("webviewer");
2627

2728
export default defineConfig({
2829
clean: true,
@@ -42,6 +43,7 @@ export default defineConfig({
4243
values: {
4344
__FMDAPI_VERSION__: JSON.stringify(FMDAPI_VERSION),
4445
__BETTER_AUTH_VERSION__: JSON.stringify(BETTER_AUTH_VERSION),
46+
__WEBVIEWER_VERSION__: JSON.stringify(WEBVIEWER_VERSION),
4547
__REGISTRY_URL__: JSON.stringify(isDev ? "http://localhost:3005" : "https://proofkit.dev"),
4648
},
4749
}),

0 commit comments

Comments
 (0)