refactor: extract postpublish verification to separate script#147
refactor: extract postpublish verification to separate script#147royosherove wants to merge 1 commit into
Conversation
- Created scripts/verify-publish.mjs with absolute path resolution - Updated package.json postpublish to call node scripts/verify-publish.mjs - Added trailing newline to package.json - Improved maintainability and readability over inline node -e The postpublish script spawns a background agent to verify npm publish succeeded.
61a15df to
9e9aff1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 61a15dfdaf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| try { | ||
| execSync( | ||
| `roundhouse subagent spawn --role review --task "Verify npm publish succeeded for @inceptionstack/roundhouse. Check registry, version, and dist tags." --cwd "${repoRoot}" --timeout 120000`, |
There was a problem hiding this comment.
Call local CLI script instead of package bin name
Replace the shell command's roundhouse executable with a directly-invoked local entrypoint (for example node bin/roundhouse.mjs), because npm lifecycle scripts do not expose the current package's own bin name on PATH unless it is installed separately. In a normal npm publish from this repo, roundhouse subagent spawn ... resolves to command not found, so the verification step is skipped every time and this postpublish check never actually runs.
Useful? React with 👍 / 👎.
|
@codex approve |
|
@codex approve if no critical issues found |
|
@codex review |
|
@codex address this feedback |
|
To use Codex here, create an environment for this repo. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e9aff14ac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| try { | ||
| const child = spawn(roundhouseCmd, [ | ||
| 'subagent', 'spawn', | ||
| '--role', 'review', | ||
| '--task', 'Verify npm publish succeeded for @inceptionstack/roundhouse. Check registry, version, and dist tags.', |
There was a problem hiding this comment.
Handle spawn failures via error event
When roundhouse is not available on PATH (which is common in this repo checkout), spawn() does not throw synchronously; it emits an asynchronous 'error' event. Because no 'error' listener is attached, this becomes an unhandled error and exits with code 1, so the new postpublish hook can make npm publish report failure instead of gracefully warning and skipping verification as intended.
Useful? React with 👍 / 👎.
Extract inline node command to maintainable scripts/verify-publish.mjs.
Changes:
Why: Inline node -e with nested escapes is hard to maintain. Extract to separate file for clarity, testability, and readability.