Skip to content

Commit 66f065a

Browse files
committed
-
1 parent 80cf2c8 commit 66f065a

4 files changed

Lines changed: 12 additions & 5 deletions

File tree

apps/cli/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ if (isProduction && process.env.POSTHOG_API_KEY) {
3737
import { Command } from "commander";
3838
import { getDefaultUserDataPath } from "./paths";
3939

40-
// Resolve version from package.json with fallbacks for production
41-
let version = "0.0.0";
40+
// Resolve version from injected env or package.json with fallbacks for production
41+
let version = process.env.CLI_VERSION || "0.0.0";
4242
if (isDev) {
4343
version = "workspace";
44-
} else {
44+
} else if (version === "0.0.0") {
4545
try {
4646
const packageJsonPath = existsSync(join(__dirname, "package.json"))
4747
? join(__dirname, "package.json")

apps/cli/tsdown.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { defineConfig } from "tsdown";
22
import { resolve } from "path";
3-
import { existsSync } from "node:fs";
3+
import { existsSync, readFileSync } from "node:fs";
44
import { config } from "dotenv";
55

66
const envFile = resolve(import.meta.dirname, "../../.env");
77

88
config({ path: envFile });
99

10+
const pkgPath = resolve(import.meta.dirname, "./package.json");
11+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
12+
1013
export default defineConfig({
1114
entry: ["src/index.ts"],
1215
shims: true,
@@ -15,9 +18,10 @@ export default defineConfig({
1518
SUPABASE_URL: process.env.SUPABASE_URL || "",
1619
SUPABASE_ANON_KEY: process.env.SUPABASE_ANON_KEY || "",
1720
POSTHOG_API_KEY: process.env.POSTHOG_API_KEY || "",
21+
CLI_VERSION: pkg.version,
1822
},
1923
envFile: existsSync(envFile) ? envFile : undefined,
20-
envPrefix: ["SUPABASE_", "POSTHOG_", "NODE_ENV"],
24+
envPrefix: ["SUPABASE_", "POSTHOG_", "NODE_ENV", "CLI_VERSION"],
2125
deps: {
2226
alwaysBundle: [/.*/],
2327
},

packages/core-node/src/runner.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ export async function runPipelineCommand(file: string, options: RunOptions, vers
5858
console.log(`Executing pipeline: ${effectiveProjectName} (${effectivePipelineId})`);
5959

6060
if (!options.userData) throw new Error("userDataPath is required for runPipelineCommand");
61+
const releaseTag = version.includes("beta") ? "beta" : "latest";
6162
const context = new PipelabContext({
6263
userDataPath: options.userData,
64+
releaseTag,
6365
});
6466

6567
await registerAllHandlers({ version, context });

packages/tsconfig/base.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"declaration": true,
55
"declarationMap": true,
66
"emitDeclarationOnly": true,
7+
"tsBuildInfoFile": "${configDir}/dist/tsconfig.tsbuildinfo",
78
"target": "ESNext",
89
"module": "ESNext",
910
"esModuleInterop": true,

0 commit comments

Comments
 (0)