fix(cli): chmod +x dist/index.js so npx invocation works on Linux#23
Merged
Conversation
The published `dist/index.js` was emitted by tsc without an execute bit (`-rw-r--r--`). On macOS, npm-install side-loads +x for entries listed in `bin`. On Linux runners, the symlink at `node_modules/.bin/tokenometer` points at a non-executable target, so: $ npx --yes tokenometer@0.1.0 --version sh: 1: tokenometer: not found (Caught by the smoke-test job in the v0.1.0 release workflow.) Build script now chains `chmod +x dist/index.js` after `tsc -b`. The bit lands in the published tarball, npx invocation works on every platform. Includes a `patch` changeset so the next release workflow opens a Version Packages PR for v0.1.1. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
faraa2m
added a commit
that referenced
this pull request
May 10, 2026
PR #23 added `chmod +x dist/index.js` to the CLI's build script. That works for `npm run build --workspace=packages/cli` and local development, but CI's release job runs root `npm run build` which is just `tsc -b` and does NOT recurse into workspace npm scripts. Result: published 0.1.1 tarball still had `dist/index.js` without the execute bit, smoke test failed again with `sh: 1: tokenometer: not found`. Add `prepack` script in packages/cli/package.json. `prepack` runs right before `npm publish` packs the tarball — guaranteed to run regardless of how the build was invoked. Belt and suspenders alongside the build-script chmod. Patch changeset for v0.1.2. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
faraa2m
added a commit
that referenced
this pull request
May 11, 2026
The published `dist/index.js` was emitted by tsc without an execute bit (`-rw-r--r--`). On macOS, npm-install side-loads +x for entries listed in `bin`. On Linux runners, the symlink at `node_modules/.bin/tokenometer` points at a non-executable target, so: $ npx --yes tokenometer@0.1.0 --version sh: 1: tokenometer: not found (Caught by the smoke-test job in the v0.1.0 release workflow.) Build script now chains `chmod +x dist/index.js` after `tsc -b`. The bit lands in the published tarball, npx invocation works on every platform. Includes a `patch` changeset so the next release workflow opens a Version Packages PR for v0.1.1. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
faraa2m
added a commit
that referenced
this pull request
May 11, 2026
PR #23 added `chmod +x dist/index.js` to the CLI's build script. That works for `npm run build --workspace=packages/cli` and local development, but CI's release job runs root `npm run build` which is just `tsc -b` and does NOT recurse into workspace npm scripts. Result: published 0.1.1 tarball still had `dist/index.js` without the execute bit, smoke test failed again with `sh: 1: tokenometer: not found`. Add `prepack` script in packages/cli/package.json. `prepack` runs right before `npm publish` packs the tarball — guaranteed to run regardless of how the build was invoked. Belt and suspenders alongside the build-script chmod. Patch changeset for v0.1.2. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The v0.1.0 smoke-test job caught a real bug: published `tokenometer@0.1.0` was missing the execute bit on `dist/index.js`. npx-style invocation on Linux fails with `sh: 1: tokenometer: not found`.
`tsc -b` doesn't preserve / set +x. macOS local install side-loaded it; Linux CI didn't. Existing 0.0.x publishes had the same bug — never caught because no-one ran `npx tokenometer` on Linux until the smoke-test job did.
Fix
`packages/cli/package.json` build script:
```diff
```
Verified locally:
```
$ ls -la packages/cli/dist/index.js
-rwxr-xr-x ... dist/index.js
```
`patch` changeset included for v0.1.1.
After merge
Wait — extension version is 0.1.0 in main. We could either ship vscode at 0.1.1 too (consistent) or leave at 0.1.0. The Marketplace publish step uses whatever's in packages/vscode/package.json at workflow runtime. Recommend a follow-up to re-bump vscode to 0.1.1 so all 4 packages stay aligned, OR accept that vscode versions can drift.
🤖 Generated with Claude Code