build(app-server): auto-build on install (prepare) + executable bin#2
Merged
Conversation
Add a prepare script so npm install builds dist/ automatically — dist/ is gitignored and there was no prepare, so a fresh clone had no dist/bin.js until a manual npm run build. Also chmod +x dist/bin.js in build: tsc emits it 0644, so any rebuild after npm link reverted the bin to non-executable (Permission denied). Together these make 'clone -> npm install -> npm link' produce a working cc-codex-appserver on PATH with no manual steps.
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.
What
Makes the cc-codex-appserver bin install cleanly on a fresh machine with no manual build step.
preparescript →npm installnow auto-runs the build.dist/is gitignored and there was noprepare, so a fresh clone had nodist/bin.jsuntil a manualnpm run build.chmod +x dist/bin.jsinbuild→tscemits the entry at 0644, so any rebuild afternpm linkreverted the bin to non-executable (Permission denied). Now every build produces an executable bin.Why
Follows up the symlink-safe bin-guard fix (e72d358) that unblocked on-PATH use by the Director. With these two, the full flow is hands-off:
Verified
dist/, ran the equivalent ofnpm install's prepare →dist/bin.jsregenerated as-rwxr-xr-xwith the symlink-safe guard.cc-codex-appserver app-serverover the PATH symlink returns the initialize result.Note (still required, out of scope here)
cc-harness: file:../harnessmonorepo dep means the siblingharness/must be present (can't install app-server in isolation).CLAUDE_CODE_OAUTH_TOKENin the env.