From 83fca354102a2bd6a5628ae5dc4e51f3e6479e9d Mon Sep 17 00:00:00 2001 From: John Brecht Date: Sat, 13 Jun 2026 14:02:34 -0700 Subject: [PATCH] chore: fix CLI --version drift + drop dead source maps (release prep) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Release-reviewer findings before the 0.10.0 publish: - CLI --version was hardcoded to 0.9.0 (missed in the version bump). Now read from package.json at runtime so it can never drift again. - sourceMap was on, shipping .js.map files that point at sources not included in the tarball (files: ["dist"]) — dead weight + a minor source-path leak. Turned off in tsconfig.base; example-app is unaffected (it builds --noEmit). Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/cli/src/main.ts | 13 ++++++++++--- tsconfig.base.json | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/main.ts b/packages/cli/src/main.ts index 5b40836..9a34ec4 100644 --- a/packages/cli/src/main.ts +++ b/packages/cli/src/main.ts @@ -1,6 +1,7 @@ #!/usr/bin/env node -import { existsSync } from 'node:fs'; -import { join } from 'node:path'; +import { existsSync, readFileSync } from 'node:fs'; +import { join, dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { Command } from 'commander'; import { renderCommand } from './render.js'; import { previewCommand } from './preview.js'; @@ -19,9 +20,15 @@ if (existsSync(envFile)) { } } +// Read the version from package.json so it can't drift from the published +// version (resolves to the package root in both dist and tsx-run dev). +const pkg = JSON.parse( + readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json'), 'utf8'), +) as { version: string }; + const program = new Command('tutorial-forge') .description('tutorial-forge — scripted Playwright walkthroughs to narrated tutorial videos') - .version('0.9.0'); + .version(pkg.version); program .command('render') diff --git a/tsconfig.base.json b/tsconfig.base.json index be6f110..43dd78e 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -6,7 +6,7 @@ "lib": ["ES2022", "DOM"], "strict": true, "declaration": true, - "sourceMap": true, + "sourceMap": false, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "verbatimModuleSyntax": true,