Skip to content

Migrate vercel-node-mongo to pnpm with supply-chain safe configs#37

Merged
Gabrielpanga merged 2 commits into
masterfrom
feat/vercel-mongo-pnpm
May 14, 2026
Merged

Migrate vercel-node-mongo to pnpm with supply-chain safe configs#37
Gabrielpanga merged 2 commits into
masterfrom
feat/vercel-mongo-pnpm

Conversation

@Gabrielpanga
Copy link
Copy Markdown
Member

Summary

Same pattern as #35 applied to examples/vercel-node-mongo.

  • package-lock.jsonpnpm-lock.yaml
  • Add pnpm-workspace.yaml (minimumReleaseAge: 10080, autoInstallPeers: true)
  • .npmrc reduced to npm-compatible safe configs
  • package.json: engines.node >=22.11.0, packageManager: pnpm@11.1.1
  • No allowBuilds entries needed
  • No vercel.json present — Vercel auto-detects pnpm from lock + packageManager

Verification

  • pnpm install succeeds with no warnings

Test plan

  • Vercel deploy succeeds
  • Functions still work at runtime

Same template as #35: pnpm 11.1.1, default-deny postinstall scripts,
7-day minimum release age. No allowBuilds needed - no native deps
with postinstall.

Project has no vercel.json - Vercel auto-detects pnpm-lock.yaml.
@Gabrielpanga Gabrielpanga requested a review from a team as a code owner May 14, 2026 10:44
@Gabrielpanga Gabrielpanga merged commit 1fffe2b into master May 14, 2026
@Gabrielpanga Gabrielpanga deleted the feat/vercel-mongo-pnpm branch May 14, 2026 10:55
Gabrielpanga added a commit that referenced this pull request May 17, 2026
)

PR #37 landed the initial pnpm migration for this project with a
minimal config (no preinstall audit, no full safety stack). This
PR brings it in line with the same hardening every other migrated
project ships with, then adds CI.

pnpm setup brought up to standard:

  package.json
  - engines.node >=22.11.0 -> >=24.0.0
  - engines.pnpm >=11.0.0 added
  - devEngines.runtime with onFail: error
  - scripts.preinstall: pnpm audit && pnpm audit signatures
  - scripts.lint:lockfile: pnpm install --frozen-lockfile

  pnpm-workspace.yaml - full safety stack:
  - minimumReleaseAge 10080 -> 20160 (7d -> 14d)
  - minimumReleaseAgeIgnoreMissingTime: true
  - engineStrict: true
  - trustPolicy: no-downgrade + trustPolicyIgnoreAfter 90d
  - blockExoticSubdeps: true
  - savePrefix: ""
  - resolutionMode: highest
  - minimumReleaseAgeExclude: '@pluggyai/*'
  - allowBuilds: {}
  - overrides: {}

  .gitignore - block package-lock.json and yarn.lock
  .npmrc removed (workspace.yaml is the single source of truth)

Dependency bump required to make preinstall audit pass:
- mongodb 3.6.6 -> 3.6.10 (same minor, patches GHSA-vxvm-qww3-2fh7:
  driver may publish events containing auth data)

Source fixes surfaced by tsc --noEmit in strict mode:
- api/notifications.ts now lazy-constructs PluggyClient inside the
  handler and guards both env vars (was throwing at module import
  time when env was missing, and passing string | undefined into
  PluggyClient which strictly requires string).
- lib/db.ts now guards MONGO_URI before passing it to MongoClient.

Plumbing for CI:
- new tsconfig.json (ES2022, NodeNext, strict, isolatedModules,
  noEmit; includes api/** and lib/**)
- typescript 5.9.3 devDependency
- typecheck / lint / test / build scripts (all -> tsc --noEmit)

CI workflow (.github/workflows/vercel-mongo-ci.yml):
- path-filtered on examples/vercel-node-mongo/** + the workflow
- concurrency-cancels older runs on the same ref
- Node 24, pnpm 11.1.1, install --frozen-lockfile, then lint /
  test / build
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