Skip to content

Add CI/publish workflows and strengthen tests for 1.2.0 - #4

Merged
devinpearson merged 3 commits into
mainfrom
chore/ci-vitest-publish-1.2.0
Aug 4, 2026
Merged

Add CI/publish workflows and strengthen tests for 1.2.0#4
devinpearson merged 3 commits into
mainfrom
chore/ci-vitest-publish-1.2.0

Conversation

@devinpearson

@devinpearson devinpearson commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add GitHub Actions CI (format, exports, tests on Node 20/22/24) and npm publish workflow with trusted publishing
  • Rewrite CLI tests for Vitest/ESM with stronger coverage of run args, approve/decline templates, and error paths
  • Bump to 1.2.0 and upgrade programmable-card-code-emulator / Vitest

Test plan

  • Confirm CI passes on this PR across Node matrix
  • Locally: npm ci && npm test
  • After merge: tag v1.2.0 and verify publish workflow (or run via workflow_dispatch)

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Released version 1.2.0.
    • Added automated package publishing for new version tags and manual releases.
  • Bug Fixes

    • Improved validation of transaction amounts, merchant limits, approvals, declines, and missing configuration files.
    • Improved command-line help behavior.
  • Tests

    • Expanded automated coverage for default and custom transaction scenarios.
    • Added compatibility checks across supported Node.js versions.

Migrate tests off Jest to Vitest against the current CLI, upgrade the emulator and Vitest deps, and add GitHub Actions for PR checks and npm publish.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@devinpearson, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 15f649f6-7b18-4627-a8a0-c2eace366936

📥 Commits

Reviewing files that changed from the base of the PR and between 3856dcd and 49ea3ef.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (18)
  • .devcontainer/devcontainer.json
  • .devcontainer/docker-compose.yml
  • .github/workflows/ci.yml
  • .github/workflows/publish.yml
  • .prettierignore
  • README.md
  • package.json
  • prettier.config.cjs
  • src/api.ts
  • src/index.ts
  • templates/limit-amount/README.md
  • templates/limit-amount/env.json
  • templates/limit-amount/main.js
  • templates/limit-merchants/README.md
  • templates/limit-merchants/env.json
  • templates/limit-merchants/main.js
  • tests/index.test.js
  • tsconfig.json
📝 Walkthrough

Walkthrough

The package version and development dependencies were updated. CLI tests now run in subprocesses and cover transaction, limit, error, and help flows. GitHub Actions workflows were added for multi-version CI and npm publishing.

Changes

CLI testing and release automation

Layer / File(s) Summary
CLI validation and package tooling
package.json, tests/index.test.js
The package version, test command, emulator dependency, and Vitest version were updated. CLI integration tests now cover default and custom transactions, approval and decline rules, missing files, and help output.
Continuous integration workflow
.github/workflows/ci.yml
CI runs on pushes and pull requests. It tests Node.js 20, 22, and 24 with formatting, export validation, installation, and test commands.
npm publishing workflow
.github/workflows/publish.yml
Publishing runs on version-tag pushes or manual dispatch. It installs dependencies, runs tests, and publishes the package with npm registry and OIDC configuration.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: adding CI and publishing workflows and expanding tests for version 1.2.0.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/ci-vitest-publish-1.2.0

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Rename prettier.config.js to .cjs for type:module, ignore template submodules, add TypeScript/@types/node so tsc succeeds, and build in CI/publish since bin is gitignored.

Co-authored-by: Cursor <cursoragent@cursor.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/index.test.js`:
- Around line 178-203: Update the “reports when the template file does not
exist” and “reports when the environment file does not exist” tests to expect a
consistent nonzero exit status and validate the error output on stderr. In the
CLI path used by runCli, handle the environment-file read failure from
fs.readFileSync so it reports the missing file through stderr and exits with the
same nonzero status as the missing-template case.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1a541b6c-b0ca-4927-a666-6b15dcf62b4d

📥 Commits

Reviewing files that changed from the base of the PR and between 3520fa3 and 3856dcd.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • .github/workflows/publish.yml
  • package.json
  • tests/index.test.js

Comment thread tests/index.test.js Outdated
Align error handling so both missing-file cases report on stderr and exit nonzero, and update the CLI tests to assert that behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
@devinpearson
devinpearson merged commit c490ea6 into main Aug 4, 2026
5 checks passed
@devinpearson
devinpearson deleted the chore/ci-vitest-publish-1.2.0 branch August 4, 2026 07:14
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