Upgrade deps, add tests, improve CI and docs#36
Conversation
- Upgrade all dependencies to latest versions - Update biome.json with stricter linting rules (noFloatingPromises, noUnusedImports) - Fix floating promise warnings by adding void to async IIFEs - Fix confirm --help exiting with code 1 when no message provided - Fix select/checkbox not detecting missing choices when no -c flag given - Add integration tests for all packages using node:test - Add example script tests with local npx stub - Add lint and test steps to CD workflow before publish - Remove NPM_TOKEN from CD (switched to trusted publishing) - Add pnpm catalogMode: strict and cleanupUnusedCatalogs settings - Rewrite README with clearer structure, option tables, and full example Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR modernizes the repo by updating Inquirer dependencies, tightening Biome linting rules, and adding automated tests + CI steps to validate the CLI prompt packages.
Changes:
- Upgrade
@inquirer/*catalog versions and update Biome configuration (includingnoFloatingPromises) and CI workflow to run lint + tests. - Add a
@inquirer-cli/test-helperworkspace package and newnode:testsuites for the prompt CLIs. - Refresh README with quick start, prompt docs, and examples; bump package versions to
1.0.9.
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
README.md |
Rewritten usage/docs and requirements section. |
pnpm-workspace.yaml |
Adds pnpm catalog settings and bumps @inquirer/* versions. |
pnpm-lock.yaml |
Lockfile updates for upgraded deps + new workspace devDependency. |
packages/test-helper/package.json |
New private workspace package for test utilities. |
packages/test-helper/index.js |
Implements helpers to run CLIs/scripts in tests with an npx stub. |
packages/test-helper/npx-stub.sh |
Shell stub intended to map @inquirer-cli/* to local packages. |
packages/*/package.json |
Version bumps to 1.0.9. |
packages/*/index.test.js |
New node:test suites for input/number/confirm/select/checkbox/password. |
packages/{select,checkbox}/*.js |
Filters undefined choices; marks async IIFEs with void. |
packages/{input,number,password,confirm}/*.js |
Marks async IIFEs with void; confirm help/error ordering adjusted. |
packages/editor/prompt.js |
Marks async IIFE with void. |
package.json |
Sets root to ESM and adds pnpm test script + test-helper devDependency. |
biome.json |
Enables VCS integration and adds stricter lint rules (unused imports, no floating promises). |
.github/workflows/cd.yml |
Adds lint + test steps before publishing. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| - name: Publish to npm | ||
| run: pnpm -r publish --access public | ||
| env: |
| ## Requirements | ||
|
|
||
| For a full list of options and detailed usage, refer to the documentation of the respective `@inquirer-cli` package. | ||
| - Node.js >= 16 |
| '@inquirer/checkbox': ^5.1.0 | ||
| '@inquirer/confirm': ^6.0.8 | ||
| '@inquirer/editor': ^5.0.8 | ||
| '@inquirer/input': ^5.0.8 | ||
| '@inquirer/number': ^4.0.8 | ||
| '@inquirer/password': ^5.0.8 | ||
| '@inquirer/select': ^5.1.0 |
| env: { | ||
| ...process.env, | ||
| PATH: `${dirname(NPX_STUB)}:${process.env.PATH}`, | ||
| INQUIRER_CLI_ROOT: ROOT, |
| args="" | ||
| pkg="" | ||
| for arg in "$@"; do | ||
| case "$arg" in | ||
| -y) ;; | ||
| @inquirer-cli/*) | ||
| pkg=$(echo "$arg" | sed 's|@inquirer-cli/||' | tr -d '"') | ||
| ;; | ||
| *) | ||
| args="$args \"$arg\"" | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| if [ -n "$pkg" ]; then | ||
| eval exec node "$INQUIRER_CLI_ROOT/packages/$pkg/index.js" $args | ||
| else | ||
| # Fall through to real npx for non-inquirer-cli packages | ||
| eval exec "$(which -a npx | grep -v "$0" | head -1)" "$@" |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04c987d288
ℹ️ 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".
| cwd: ROOT, | ||
| env: { | ||
| ...process.env, | ||
| PATH: `${dirname(NPX_STUB)}:${process.env.PATH}`, |
There was a problem hiding this comment.
Expose the stub as
npx in example-script test runs
runScript prepends dirname(NPX_STUB) to PATH, but that directory contains npx-stub.sh rather than an executable named npx, so shell resolution still picks the system npx. In the example.sh tests, this means commands can run/download published packages instead of the local workspace binaries, making these tests network-dependent and unable to reliably catch regressions in the current commit.
Useful? React with 👍 / 👎.
| '@inquirer/checkbox': ^5.1.0 | ||
| '@inquirer/confirm': ^6.0.8 | ||
| '@inquirer/editor': ^5.0.8 | ||
| '@inquirer/input': ^5.0.8 | ||
| '@inquirer/number': ^4.0.8 |
There was a problem hiding this comment.
Align supported Node range with upgraded @InQuirer majors
These catalog bumps move prompts to @inquirer/* major versions that now require Node >=20.12 (as reflected in the updated lockfile engine metadata), which drops Node 18/19 compatibility compared to the prior set. Because package metadata/docs still present older support and package versions were only patch-bumped, users on Node 18/19 can hit install/runtime failures unexpectedly; this needs an explicit engine/support update or dependency rollback.
Useful? React with 👍 / 👎.
Summary
node:testWhat's New
Tests: 24 new tests covering all 6 packages plus example shell scripts using a local npx stub.
Quality: Stricter biome rules (noFloatingPromises, noUnusedImports), fixed bugs in confirm and select packages.
CI/CD: Lint and tests now run before publish, using OIDC trusted publishing instead of tokens.
Docs: Improved README with option tables, full examples, and clearer integration guidance.
🤖 Generated with Claude Code