Skip to content

chore: migrate toolchain to Vite+ and pnpm#20

Merged
jimmyn merged 1 commit intomasterfrom
chore/migrate-to-vite-plus
Mar 30, 2026
Merged

chore: migrate toolchain to Vite+ and pnpm#20
jimmyn merged 1 commit intomasterfrom
chore/migrate-to-vite-plus

Conversation

@jimmyn
Copy link
Copy Markdown
Collaborator

@jimmyn jimmyn commented Mar 30, 2026

Summary

  • Migrate from Yarn Berry to pnpm
  • Replace microbundle, ESLint, Prettier, Husky, lint-staged with Vite+ unified toolchain
  • Update to Node 24

Implementation

  • Package manager: Yarn 4 → pnpm 10, lockfile imported and reconciled
  • Build: microbundle → vp pack (tsdown) — outputs ESM (.mjs), CJS (.cjs), DTS (.d.mts/.d.cts)
  • Lint/Format: ESLint + Prettier → vp check (Oxlint + Oxfmt)
  • Test: standalone Vitest → vp test (vite-plus/test)
  • Hooks: Husky + lint-staged → vp config + vp staged
  • CI: Replaced actions/setup-node + pnpm/action-setup with voidzero-dev/setup-vp@v1
  • tsconfig: removed importHelpers (tsdown bundles helpers), added skipLibCheck (vite-plus types need TS 5), removed tsconfig.build.json
  • Test fixes: from '..'from '../index' (Vite resolves bare parent import to dist/ not source, breaking mock adapter); resetHandlers() instead of reset()

Test plan

  • pnpm typecheck passes
  • vp check — 0 errors
  • vp test — 53/53 tests pass
  • vp pack — ESM + CJS + DTS build succeeds
  • pnpm build — full pipeline (generate → replace → format → compile)
  • Pre-commit hooks work (staged lint + test + commitlint)
  • CI workflow runs on PR

Summary by CodeRabbit

  • New Features

    • Added POS authentication token API for point-of-sale integrations.
  • Chores

    • Updated OpenAPI specification to version 1.8.7.
    • Migrated package manager and development toolchain.
    • Updated Node.js version requirement.
    • Normalized code formatting and styling.
  • Documentation

    • Updated installation instructions in README.

- Replace Yarn Berry with pnpm (packageManager, lockfile, CI)
- Replace microbundle with vp pack (tsdown) for library builds
- Replace ESLint/Prettier with vp check (Oxlint/Oxfmt)
- Replace standalone Vitest with vp test
- Replace Husky/lint-staged with vp config/vp staged
- Update CI to use voidzero-dev/setup-vp@v1
- Update package.json exports for tsdown output (.mjs/.cjs/.d.mts/.d.cts)
- Update .nvmrc to Node 24
- Fix test imports: from '..' → from '../index' (Vite resolves bare
  parent to dist/ not source, breaking axios mock adapter)
- Fix mock reset: resetHandlers() instead of reset() to preserve
  mock adapter across test lifecycle

Consolidates 6 separate tools (Vite, Vitest, ESLint, Prettier,
Husky, microbundle) into a single Vite+ toolchain.
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions
Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 85.71% 96 / 112
🔵 Statements 85.21% 98 / 115
🔵 Functions 84.61% 22 / 26
🔵 Branches 62.92% 56 / 89
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
index.ts 94% 87.5% 100% 93.87% 125, 154, 203
src/api.ts 100% 100% 100% 100%
src/axios.ts 100% 100% 100% 100%
src/base.ts 72.72% 83.33% 50% 72.72% 75-76
src/common.ts 75% 49.09% 76.92% 76.19% 37-40, 67-68, 77-82, 96-101, 110, 125
src/configuration.ts 100% 75% 100% 100%
src/index.ts 100% 100% 100% 100%
src/model/index.ts 100% 100% 100% 100%
Generated in workflow #88 for commit c28da68 by the Vitest Coverage Report Action

@jimmyn jimmyn merged commit 5611811 into master Mar 30, 2026
4 of 5 checks passed
@jimmyn jimmyn deleted the chore/migrate-to-vite-plus branch March 30, 2026 10:12
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 93cf47bd-c0a8-468b-b698-8c5fffc037e6

📥 Commits

Reviewing files that changed from the base of the PR and between 3b06bce and c28da68.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (138)
  • .github/workflows/test.yml
  • .gitignore
  • .husky/commit-msg
  • .nvmrc
  • .prettierrc
  • .vite-hooks/commit-msg
  • .vite-hooks/pre-commit
  • .yarnrc.yml
  • CHANGELOG.md
  • README.md
  • commitlint.config.js
  • eslint.config.js
  • index.ts
  • package.json
  • scripts/replace.js
  • src/.openapi-generator/FILES
  • src/api.ts
  • src/api/apple-pay-certificate-api.ts
  • src/api/apple-pay-domain-api.ts
  • src/api/bizum-api.ts
  • src/api/payment-methods-api.ts
  • src/api/payments-api.ts
  • src/api/posauth-token-api.ts
  • src/api/subscriptions-api.ts
  • src/axios.ts
  • src/base.ts
  • src/common.ts
  • src/configuration.ts
  • src/index.ts
  • src/model/activate-apple-pay-certificate-request.ts
  • src/model/activate-subscription-request.ts
  • src/model/address.ts
  • src/model/api-exception.ts
  • src/model/apple-pay-certificate.ts
  • src/model/apple-pay-certificates-remove200-response.ts
  • src/model/bad-request-error.ts
  • src/model/bizum-validate-phone200-response.ts
  • src/model/cancel-payment-request.ts
  • src/model/cancel-subscription-request.ts
  • src/model/capture-payment-request.ts
  • src/model/confirm-payment-request-payment-method-card.ts
  • src/model/confirm-payment-request-payment-method.ts
  • src/model/confirm-payment-request.ts
  • src/model/create-payment-request.ts
  • src/model/create-pos-auth-token-request.ts
  • src/model/create-subscription-request.ts
  • src/model/index.ts
  • src/model/internal-server-error.ts
  • src/model/not-found-error.ts
  • src/model/pause-subscription-request.ts
  • src/model/payment-billing-details.ts
  • src/model/payment-cancellation-reason.ts
  • src/model/payment-customer.ts
  • src/model/payment-last-refund-reason.ts
  • src/model/payment-message-channel.ts
  • src/model/payment-message-language.ts
  • src/model/payment-methods-metadata-alipay.ts
  • src/model/payment-methods-metadata-apple-pay.ts
  • src/model/payment-methods-metadata-bancontact.ts
  • src/model/payment-methods-metadata-bizum.ts
  • src/model/payment-methods-metadata-blik.ts
  • src/model/payment-methods-metadata-card.ts
  • src/model/payment-methods-metadata-click-to-pay-discover.ts
  • src/model/payment-methods-metadata-click-to-pay-mastercard.ts
  • src/model/payment-methods-metadata-click-to-pay-visa.ts
  • src/model/payment-methods-metadata-click-to-pay.ts
  • src/model/payment-methods-metadata-eps.ts
  • src/model/payment-methods-metadata-giropay.ts
  • src/model/payment-methods-metadata-google-pay.ts
  • src/model/payment-methods-metadata-ideal.ts
  • src/model/payment-methods-metadata-klarna.ts
  • src/model/payment-methods-metadata-mbway.ts
  • src/model/payment-methods-metadata-sepa.ts
  • src/model/payment-methods-metadata-sofort.ts
  • src/model/payment-methods-metadata-trustly.ts
  • src/model/payment-methods-metadata.ts
  • src/model/payment-methods-methods.ts
  • src/model/payment-methods.ts
  • src/model/payment-next-action.ts
  • src/model/payment-payment-method-bizum-input.ts
  • src/model/payment-payment-method-bizum.ts
  • src/model/payment-payment-method-card-input.ts
  • src/model/payment-payment-method-card.ts
  • src/model/payment-payment-method-input.ts
  • src/model/payment-payment-method-klarna.ts
  • src/model/payment-payment-method-mbway.ts
  • src/model/payment-payment-method-paypal.ts
  • src/model/payment-payment-method-sepa.ts
  • src/model/payment-payment-method-trustly.ts
  • src/model/payment-payment-method.ts
  • src/model/payment-payment-methods.ts
  • src/model/payment-refund-reason.ts
  • src/model/payment-sequence-recurring.ts
  • src/model/payment-sequence.ts
  • src/model/payment-session-details.ts
  • src/model/payment-shipping-details.ts
  • src/model/payment-shop.ts
  • src/model/payment-status.ts
  • src/model/payment-trace-details.ts
  • src/model/payment-transaction-type.ts
  • src/model/payment.ts
  • src/model/pos-auth-token-create200-response.ts
  • src/model/recurring-payment-request.ts
  • src/model/refund-payment-request.ts
  • src/model/register-apple-pay-domain-request.ts
  • src/model/send-payment-link-request.ts
  • src/model/send-payment-receipt-request.ts
  • src/model/send-payment-request-request.ts
  • src/model/send-subscription-link-request.ts
  • src/model/send-subscription-status-request.ts
  • src/model/service-unavailable-error.ts
  • src/model/subscription-interval.ts
  • src/model/subscription-last-payment.ts
  • src/model/subscription-payment-method-card.ts
  • src/model/subscription-payment-method.ts
  • src/model/subscription-payment-methods.ts
  • src/model/subscription-retry-schedule-inner.ts
  • src/model/subscription-retry-schedule.ts
  • src/model/subscription-status.ts
  • src/model/subscription.ts
  • src/model/unauthorized-error.ts
  • src/model/unprocessable-entity-error.ts
  • src/model/update-apple-pay-certificate-request.ts
  • src/model/update-subscription-request.ts
  • src/model/validate-bizum-phone-request.ts
  • tests/api-exception.test.ts
  • tests/apple-pay-certificate-api.test.ts
  • tests/apple-pay-domain-api.test.ts
  • tests/bizum-api.test.ts
  • tests/monei-sdk.test.ts
  • tests/payment-methods-api.test.ts
  • tests/payments-api.test.ts
  • tests/subscriptions-api.test.ts
  • tests/test-utils.ts
  • tsconfig.build.json
  • tsconfig.json
  • vite.config.ts
  • vitest.config.ts

📝 Walkthrough

Walkthrough

Migration from Yarn/ESLint/Prettier/Husky toolchain to pnpm/vite-plus, updating OpenAPI spec version from 1.8.3 to 1.8.7, adding POS auth token API endpoints, and standardizing code formatting to double-quotes with trailing commas.

Changes

Cohort / File(s) Summary
Build & Package Management
package.json, .nvmrc, vite.config.ts, tsconfig.json
Migrated from Yarn to pnpm, switched build tool from microbundle to vite-plus, added vite.config.ts with pack/test/coverage config, updated Node.js 22→24, removed unused build scripts/dependencies (prettier, eslint, husky, lint-staged, microbundle), added vite-plus and @voidzero-dev/vite-plus-test aliases.
Configuration Files
.github/workflows/test.yml, .prettierrc, eslint.config.js, tsconfig.build.json, vitest.config.ts, .yarnrc.yml, .husky/commit-msg
Removed ESLint, Prettier, and Husky configurations; deleted tsconfig.build.json and vitest.config.ts (now consolidated into vite.config.ts); switched GitHub Actions from setup-node to voidzero-dev/setup-vp; migrated git hooks to .vite-hooks/.
Git Hooks & Ignore Files
.vite-hooks/commit-msg, .vite-hooks/pre-commit, .gitignore
Added vite-hooks directory with updated commit-msg and pre-commit hooks using vp/pnpm; updated .gitignore to ignore .yarn/ directory, yarn.lock, and .pnpm-store/.
Test Files
tests/*.test.ts, tests/test-utils.ts
Updated all test imports from vitest to vite-plus/test; converted single-quoted strings to double-quoted; changed mockAxios.reset() to mockAxios.resetHandlers(); added trailing commas in object literals.
OpenAPI Generated API Files
src/api/*.ts
Updated embedded OpenAPI spec version 1.8.3→1.8.7; added new POSAuthTokenApi with create method; normalized formatting (double-quotes, trailing commas, spaced imports); updated PaymentsApi capture documentation for partial captures and method-dependent expiry.
OpenAPI Generated Model Files
src/model/*.ts
Updated OpenAPI spec version across all models; added CreatePosAuthTokenRequest and PosAuthTokenCreate200Response interfaces; converted enum string literals from single to double quotes; normalized import spacing; added trailing commas.
Core SDK Files
index.ts, src/api.ts, src/common.ts, src/configuration.ts, src/base.ts, src/axios.ts
Updated OpenAPI version references; standardized code formatting (double-quotes, trailing commas, spaced imports); added new POSAuthTokenApi export; updated helper function signatures with trailing commas; no functional logic changes.
Documentation & Scripts
README.md, CHANGELOG.md, scripts/replace.js, commitlint.config.js
Updated README to recommend pnpm over yarn with double-quoted formatting; reformatted CHANGELOG bullet style; updated commitlint config and replace.js script formatting with double quotes.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant SDK as MONEI SDK
    participant AuthAPI as POS Auth Token API
    participant Config as Configuration

    Client->>SDK: Initialize with account ID
    SDK->>Config: Set headers (API key, Account ID)
    
    Client->>SDK: Request POS auth token
    SDK->>AuthAPI: POST /pos/auth-token<br/>(createPosAuthTokenRequest)
    AuthAPI->>AuthAPI: Validate request<br/>(pointOfSaleId, storeId)
    AuthAPI->>AuthAPI: Generate RS256 JWT<br/>(24-hour validity)
    AuthAPI-->>SDK: Return 200 response<br/>(token: string)
    SDK-->>Client: Return PosAuthTokenCreate200Response
Loading

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~45 minutes

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch chore/migrate-to-vite-plus

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

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