Skip to content

refactor: extract postpublish verification to separate script#147

Open
royosherove wants to merge 1 commit into
mainfrom
chore/postpublish-verification
Open

refactor: extract postpublish verification to separate script#147
royosherove wants to merge 1 commit into
mainfrom
chore/postpublish-verification

Conversation

@royosherove
Copy link
Copy Markdown
Member

Extract inline node command to maintainable scripts/verify-publish.mjs.

Changes:

  • New: scripts/verify-publish.mjs (absolute path resolution, clear purpose)
  • Updated: package.json postpublish script (cleaner, maintainable)
  • Fixed: trailing newline in package.json

Why: Inline node -e with nested escapes is hard to maintain. Extract to separate file for clarity, testability, and readability.

- 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.
@royosherove royosherove force-pushed the chore/postpublish-verification branch from 61a15df to 9e9aff1 Compare May 16, 2026 21:30
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread scripts/verify-publish.mjs Outdated

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`,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@royosherove
Copy link
Copy Markdown
Member Author

@codex approve

@royosherove
Copy link
Copy Markdown
Member Author

@codex approve if no critical issues found

@royosherove
Copy link
Copy Markdown
Member Author

@codex review

@royosherove
Copy link
Copy Markdown
Member Author

@codex address this feedback

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +31 to +35
try {
const child = spawn(roundhouseCmd, [
'subagent', 'spawn',
'--role', 'review',
'--task', 'Verify npm publish succeeded for @inceptionstack/roundhouse. Check registry, version, and dist tags.',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant