Skip to content

Add CI for vercel-node-connect-token (install, lint, test, build)#44

Merged
Gabrielpanga merged 1 commit into
masterfrom
feat/vercel-connect-token-ci
May 16, 2026
Merged

Add CI for vercel-node-connect-token (install, lint, test, build)#44
Gabrielpanga merged 1 commit into
masterfrom
feat/vercel-connect-token-ci

Conversation

@Gabrielpanga
Copy link
Copy Markdown
Member

Summary

Adds a GitHub Actions workflow that validates `examples/vercel-node-connect-token` on every push to master and every PR touching its files. Same shape as #41 (`aws-sst`), #42 (`frontend/nextjs`), and #43 (`vercel-quickdeploy-nextjs`).

Workflow

`.github/workflows/vercel-connect-token-ci.yml` — path-filtered, concurrency-cancelled. Steps:

  1. `pnpm install --frozen-lockfile` — `preinstall` runs `pnpm audit && pnpm audit signatures`.
  2. Lint → `pnpm run lint` (`tsc --noEmit`)
  3. Test → `pnpm run test` (`tsc --noEmit`)
  4. Build → `pnpm run build` (`tsc --noEmit`)

This is a serverless-function project, not a Next.js app — there is no separate framework build step, so all three CI checks are TypeScript compile checks.

Plumbing changes

`examples/vercel-node-connect-token/`:

  • new `tsconfig.json` (target ES2022, NodeNext, strict, `isolatedModules`, `noEmit`, includes `api/**`)
  • `typescript@5.9.3` added to `devDependencies`
  • `typecheck`, `lint`, `test`, `build` scripts (all → `tsc --noEmit`)

Source fix surfaced by the type check

`api/token.ts` previously passed `process.env.PLUGGY_CLIENT_ID` and `PLUGGY_CLIENT_SECRET` (each `string | undefined`) directly to `new PluggyClient({...})`, whose typings require `string`. In strict mode this is a type error, and at runtime it would have silently constructed a client with `undefined` credentials.

Now the handler guards both env vars and returns a 500 with a clear message when either is missing.

Verification

  • `pnpm install --frozen-lockfile` succeeds (preinstall audit + signatures clean)
  • `pnpm run lint` / `pnpm run test` / `pnpm run build` all pass

CI workflow runs on pushes to master and PRs that touch
examples/vercel-node-connect-token/** or the workflow itself.

Steps:
1. pnpm install --frozen-lockfile - preinstall runs pnpm audit +
   pnpm audit signatures.
2. Lint / Test / Build all run `tsc --noEmit` over api/**.

Plumbing added:
- tsconfig.json (target ES2022, NodeNext, strict, isolatedModules,
  noEmit, includes api/**)
- typescript 5.9.3 devDependency
- typecheck / lint / test / build scripts (all -> tsc --noEmit)

Source fix surfaced by the type check:
- api/token.ts guards on PLUGGY_CLIENT_ID / PLUGGY_CLIENT_SECRET
  before constructing PluggyClient. Pluggy-sdk 0.7.1 types those
  as `string` (not `string | undefined`), so the previous version
  was a type error in strict mode and could ship undefined creds
  silently. Now returns 500 with a clear message when missing.

Concurrency-cancel older runs on the same ref.
@Gabrielpanga Gabrielpanga requested a review from a team as a code owner May 16, 2026 15:19
@Gabrielpanga Gabrielpanga merged commit 683c099 into master May 16, 2026
1 of 2 checks passed
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