From 0fe367d25e29e8b150cd04141027f5fb6c414504 Mon Sep 17 00:00:00 2001 From: Yago Borba <140000816+YagoBorba@users.noreply.github.com> Date: Fri, 27 Nov 2026 12:36:28 -0300 Subject: [PATCH] fix(cli): report the package version and publish only build output stc --version printed a hard-coded 1.0.3; it now reads the version from package.json. The npm packages ship only dist, declare public access, and @stackcode/github-auth, a runtime dependency of the CLI, can be published with them. --- packages/cli/package.json | 6 ++++++ packages/cli/src/index.ts | 7 ++++++- packages/core/package.json | 6 ++++++ packages/github-auth/package.json | 8 ++++++++ packages/i18n/package.json | 6 ++++++ 5 files changed, 32 insertions(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 7c7a45b..15bbbe5 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -54,5 +54,11 @@ "@types/yargs": "^17.0.32", "typescript": "^5.8.3", "vitest": "^3.2.4" + }, + "files": [ + "dist" + ], + "publishConfig": { + "access": "public" } } diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 88083b5..147f752 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -12,6 +12,11 @@ import { getReleaseCommand } from "./commands/release.js"; import { getGitHubCommand } from "./commands/github.js"; import { initI18n, t, getLocale } from "@stackcode/i18n"; import { getErrorMessage } from "@stackcode/core"; +import { createRequire } from "module"; + +const { version } = createRequire(import.meta.url)("../package.json") as { + version: string; +}; async function main() { try { @@ -21,7 +26,7 @@ async function main() { await yargs(hideBin(process.argv)) .scriptName("stackcode") - .version("1.0.3") + .version(version) .alias("h", "help") .alias("v", "version") .strict() diff --git a/packages/core/package.json b/packages/core/package.json index 968a07b..902ebba 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -48,5 +48,11 @@ "@types/conventional-changelog-core": "^8.0.0", "@types/semver": "^7.7.0", "vitest": "^3.2.4" + }, + "files": [ + "dist" + ], + "publishConfig": { + "access": "public" } } diff --git a/packages/github-auth/package.json b/packages/github-auth/package.json index 343ac6f..9c03168 100644 --- a/packages/github-auth/package.json +++ b/packages/github-auth/package.json @@ -41,5 +41,13 @@ "@types/node": "^24.2.0", "typescript": "^5.8.3", "vitest": "^3.2.4" + }, + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/YagoBorba/StackCode.git", + "directory": "packages/github-auth" } } diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 54553e4..f820021 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -37,5 +37,11 @@ "dependencies": { "configstore": "^7.0.0", "write-file-atomic": "^3.0.3" + }, + "files": [ + "dist" + ], + "publishConfig": { + "access": "public" } }