-
Notifications
You must be signed in to change notification settings - Fork 35
fix: remaining fixes from PR 1025 #1027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add prebuild hook and generate-packages.mjs script to ensure template packages are generated before CLI build runs - Always copy cli.js to dist directory (required for dist/index.js to work) - Add Node.js CLI flags whitelist to prevent --help, --version, etc from being forwarded to Python CLI - Remove unused --prod flag from build script - Simplify cli.js copy to use copyFileSync directly instead of spawning node
- Add isDebug mock to npm-base.test.mts and install.test.mts to ensure --loglevel args are consistently added (isDebug() was returning true in CI due to environment variables) - Use hoisted mocks for whichRealSync in path-resolve.test.mts to ensure reliable mock behavior in CI (dynamic import pattern was failing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment @cursor review or bugbot run to trigger another review on this PR
- Handle --flag=value syntax in nodeCliFlags whitelist by extracting base flag name - Use nullish coalescing for process.exit in generate-packages.mjs to handle signal-killed processes (code is null, which coerces to 0)
The test was mocking `resolveBinPathSync` but the actual function is `resolveRealBinSync`. This caused tests to use the real implementation in CI, which resolved to the actual npm path on the runner.
The CI workflow was using `lookup-only: true` for cache restore, which only checks if the cache exists but doesn't actually restore files. This caused test jobs to skip the build step when cache existed, but the build artifacts weren't actually present on disk. Remove `lookup-only` and always run the build step. The build script already has its own caching logic and will skip unnecessary work.
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no bugs!
Comment @cursor review or bugbot run to trigger another review on this PR
Summary
Applies the remaining fixes from the closed PR #1025 that were not related to the @socketsecurity/lib update:
prebuildhook andgenerate-packages.mjsscript to ensure template packages are generated before CLI build runscli.jsto dist directory (required fordist/index.jsto work)--help,--version, etc from being forwarded to Python CLI--prodflag from build scriptcopyFileSyncdirectly instead of spawning nodeRelated
Test plan
Note
Focuses on reliable builds and correct flag handling.
prebuildhook runningscripts/generate-packages.mjsto generate template packages beforebuildbuild/cli.jstodist/cli.jsviacopyFileSync; removes unused--prodpath and simplifies build script--help,--version,--config, etc.) and supports--flag=valueparsing when deciding Python forwardingWritten by Cursor Bugbot for commit 9521bcf. Configure here.