Skip to content
This repository was archived by the owner on Aug 19, 2026. It is now read-only.

chore: migrate to Node v20 - #372

Merged
NicoSerranoP merged 3 commits into
stagingfrom
dev
Mar 29, 2026
Merged

chore: migrate to Node v20#372
NicoSerranoP merged 3 commits into
stagingfrom
dev

Conversation

@NicoSerranoP

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Migrates the monorepo tooling and CI configuration toward Node.js v20, primarily by aligning TypeScript/ts-node settings with modern Node ESM semantics and updating build tooling (Rollup) accordingly.

Changes:

  • Update TS configs (root + packages) to use nodenext where appropriate and adjust ts-node module mode.
  • Migrate Rollup TypeScript integration from rollup-plugin-typescript2 to @rollup/plugin-typescript.
  • Update GitHub Actions workflows to run with Node 20 and adjust package/runtime scripts (e.g., phase2cli start).

Reviewed changes

Copilot reviewed 26 out of 28 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
tsconfig.json Switch root moduleResolution to nodenext; formatting updates.
packages/phase2cli/tsconfig.json Move package TS module settings to nodenext.
packages/phase2cli/build.tsconfig.json Align build TS moduleResolution to nodenext; formatting.
packages/phase2cli/rollup.config.ts Swap to @rollup/plugin-typescript; tweak plugin options.
packages/phase2cli/package.json Update start command to Node loader; add @rollup/plugin-typescript; remove old plugin.
packages/backend/tsconfig.json Adjust TS module/moduleResolution for backend package.
packages/backend/build.tsconfig.json Set module/moduleResolution for build output.
packages/backend/rollup.config.ts Swap to @rollup/plugin-typescript; remove useTsconfigDeclarationDir.
packages/backend/package.json Update Node engine to 20; adjust Rollup invocation; switch TS Rollup plugin dep.
packages/actions/tsconfig.json Align Actions package TS module/moduleResolution to nodenext.
packages/actions/build.tsconfig.json Change extends target and set build output options.
packages/actions/rollup.config.ts Swap to @rollup/plugin-typescript; adjust export shape and plugin options.
packages/actions/package.json Bump engines to Node >=20; adjust Rollup invocation; switch TS Rollup plugin dep.
packages/actions/README.md Update stated Node prerequisite to 20+.
packages/actions/src/helpers/crypto.ts Handle stream chunk typing differences (`string
packages/actions/src/helpers/utils.ts Cast winston log.message to string for formatter typing.
packages/actions/test/utils/storage.ts Use typed S3 canned ACL enum (ObjectCannedACL.public_read).
packages/actions/test/unit/verification.test.ts Refactor proof inputs reuse; fix invalid-vkey test invocation.
.github/workflows/website.yaml Set Node version to 20 for docs site workflow.
.github/workflows/test-firebase-emulator.yaml Set Node version to 20 for emulator tests.
.github/workflows/publish-staging-packages.yaml Set Node version to 20 for staging publish.
.github/workflows/publish-production-packages.yaml Set Node version to 20 for production publish.
.github/workflows/publish-on-tag-push.yaml Set Node version to 20 for tag-based publish.
.github/workflows/publish-dev-packages.yaml Set Node version to 20 for dev publish.
.github/workflows/firebase-deploy-staging.yaml Set Node version to 20 for staging deploy.
.github/workflows/firebase-deploy-production.yaml Set Node version to 20 for production deploy.
.github/workflows/firebase-deploy-dev.yaml Set Node version to 20 for dev deploy.
Comments suppressed due to low confidence (1)

packages/actions/rollup.config.ts:21

  • @rollup/plugin-typescript emits declarations based on build.tsconfig.json (which sets declarationDir). With declarations enabled, this plugin requires Rollup to use output.dir (not output.file), otherwise the build can fail with "Rollup 'dir' option must be used when Typescript compiler option 'declarationDir' is specified". Consider switching outputs to dir and configuring entryFileNames/chunkFileNames (or generate .d.ts in a separate tsc step).
    input: "src/index.ts",
    output: [
        { file: pkg.exports.require, format: "cjs", banner, exports: "auto" },
        { file: pkg.exports.import, format: "es", banner }
    ],

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 47 to 50
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

This workflow still uses Node16-based actions (actions/checkout@v3, actions/setup-node@v3, actions/setup-java@v3, actions/cache@v3, and aws-actions/configure-aws-credentials@v2). Node16 actions are no longer supported on GitHub-hosted runners, so these should be updated to their Node20 variants (e.g., checkout@v4, setup-node@v4, setup-java@v4, cache@v4, configure-aws-credentials@v4).

Copilot uses AI. Check for mistakes.
Comment on lines +16 to 21
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
registry-url: "https://registry.npmjs.org"
cache: yarn

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

This workflow still uses Node16-based actions (actions/checkout@v3 and actions/setup-node@v3). Please bump to Node20 variants (checkout@v4, setup-node@v4) to keep publishing working.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to 35
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
registry-url: "https://registry.npmjs.org"

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

This workflow still uses Node16-based actions (actions/checkout@v3 and actions/setup-node@v3). Please bump to checkout@v4 and setup-node@v4 to avoid failures on current GitHub Actions runners.

Copilot uses AI. Check for mistakes.
Comment on lines 20 to 27
input: "src/index.ts",
output: [{ file: pkg.main, format: "es", banner }],
plugins: [
autoExternal(),
(typescript as any)({
tsconfig: "./build.tsconfig.json",
useTsconfigDeclarationDir: true
sourceMap: true
}),

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

@rollup/plugin-typescript + TypeScript declarations (build.tsconfig.json has declarationDir) typically requires Rollup to use output.dir instead of output.file; otherwise builds can fail with an error requiring the Rollup dir option when declarationDir is set. Consider switching to output.dir (and set entryFileNames if you need a specific filename like index.js) or generate declarations in a separate tsc step.

Copilot uses AI. Check for mistakes.
Comment on lines 33 to 36
"build": "rimraf dist && rollup -c rollup.config.ts --configPlugin typescript",
"build:watch": "rollup -c rollup.config.ts -w --configPlugin typescript",
"start": "ts-node --esm ./src/index.ts",
"start": "node --loader ts-node/esm ./src/index.ts",
"auth": "yarn start auth",

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

The package engines.node still allows Node >=16.14.0, but this PR migrates execution to Node 20 (and the start script now relies on the Node loader workflow). To avoid publishing misleading engine constraints (and mismatches with CI), bump engines.node here to a Node 20 range (e.g., >=20.0.0) to match the migration.

Copilot uses AI. Check for mistakes.
Comment on lines +14 to 19
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
registry-url: "https://registry.npmjs.org"
cache: yarn

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

This workflow still uses Node16-based actions (actions/checkout@v3 and actions/setup-node@v3). Node16 actions are no longer supported on GitHub-hosted runners, so please bump to checkout@v4 and setup-node@v4.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to 35
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
registry-url: "https://registry.npmjs.org"

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

This workflow still references Node16-based actions (actions/checkout@v3 and actions/setup-node@v3). Since Node16 actions are no longer supported on GitHub-hosted runners, bump to checkout@v4 and setup-node@v4.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to 35
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
registry-url: "https://registry.npmjs.org"

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

This workflow still uses Node16-based actions (actions/checkout@v3 and actions/setup-node@v3). Node16 actions are no longer supported on GitHub-hosted runners, so bump to checkout@v4 and setup-node@v4.

Copilot uses AI. Check for mistakes.
Comment on lines 23 to 26
autoExternal(),
(typescript as any)({
tsconfig: "./build.tsconfig.json",
useTsconfigDeclarationDir: true
}),

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

@rollup/plugin-typescript emits declarations per build.tsconfig.json (declarationDir is set). With declarations enabled, this plugin requires using Rollup output.dir (not output.file), otherwise the build can fail with an error about needing the dir option when declarationDir is specified. Consider switching outputs to dir + entryFileNames/chunkFileNames, or generate .d.ts via a separate tsc step.

Copilot uses AI. Check for mistakes.
Comment on lines 37 to 40
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
cache: yarn

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

This workflow still references multiple Node16-based actions (actions/checkout@v3, actions/configure-pages@v3, actions/setup-node@v3, actions/upload-pages-artifact@v1, actions/deploy-pages@v2). Since Node16 actions are no longer supported on GitHub-hosted runners, these should be bumped to their Node20 variants (e.g., checkout@v4, configure-pages@v4, setup-node@v4, upload-pages-artifact@v3, deploy-pages@v3).

Copilot uses AI. Check for mistakes.
@NicoSerranoP
NicoSerranoP merged commit 9b80f7f into staging Mar 29, 2026
2 of 4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants