chore: migrate from Yarn v1 to npm and update Node to v24#1535
chore: migrate from Yarn v1 to npm and update Node to v24#1535
Conversation
There was a problem hiding this comment.
Pull request overview
Migrates the repo from Yarn v1 to npm (workspaces + lockfile) and bumps the Node.js version used in Docker and GitHub Actions to v24 to keep local/dev/CI aligned.
Changes:
- Replaced Yarn workspace commands with npm workspace equivalents across scripts, docs, and CI.
- Switched dependency locking to
package-lock.jsonand updated install/build/test commands (notably tonpm ci). - Updated Dockerfiles and GitHub Actions workflows to use Node 24.
Reviewed changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Replaces Yarn workspace scripts with npm workspace commands. |
| example/vite.config.mts | Updates workspace symlink comment to npm wording. |
| example/src/init.sh | Switches build step from Yarn to npm (with forwarded args). |
| example/package.json | Updates helper script to build packages using npm instead of Yarn. |
| example/README.md | Updates setup/run instructions from Yarn to npm; documents Node v24+. |
| example/Dockerfile | Switches base image to Node 24 and replaces Yarn install/start with npm. |
| example/.gitignore | Removes Yarn log ignores (example). |
| e2e/README.md | Updates how to start the app for Playwright from Yarn to npm. |
| README.md | Updates install command example from Yarn to npm. |
| Dockerfile | Switches base image to Node 24 and replaces Yarn install/build/start with npm. |
| .pre-commit-config.yaml | Replaces Yarn workspace typecheck hooks with npx tsc in package dirs. |
| .gitignore | Stops ignoring package-lock.json (so it can be committed). |
| .github/workflows/tests.yaml | Updates Node version + swaps Yarn install/build/test for npm equivalents. |
| .github/workflows/reset-production.yaml | Updates Node version + switches example install to npm. |
| .github/workflows/on-main-push.yaml | Updates Node version + switches publish workflow to npm workspaces. |
| .github/workflows/integration-tests.yaml | Updates Node version + swaps Yarn steps for npm equivalents. |
| .github/workflows/deploy-to-radix.yaml | Updates Node version + switches example install to npm. |
Comments suppressed due to low confidence (1)
.github/workflows/integration-tests.yaml:137
- The e2e dependency cache key is currently based on the repo root
package.json, so changes toe2e/package.json(or a generated/committede2e/package-lock.json) won't invalidate the cache. Consider hashinge2e/package.json(and ideallye2e/package-lock.json) for this cache key.
- name: Cache e2e dependencies
uses: actions/cache@v5
id: cache-e2e
env:
cache-name: cache-e2e-deps-modules
with:
path: |
~/.cache/ms-playwright
./e2e/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./package.json')}}
- name: Install dependencies
run: |
npm install --package-lock-only
npm ci
working-directory: e2e/
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| @@ -50,14 +50,13 @@ jobs: | |||
| ./example/node_modules | |||
| ./packages/dm-core/node_modules | |||
| ./packages/dm-core-plugins/node_modules | |||
| ./yarn.lock | |||
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./packages/dm-core/package.json')}}-${{ hashFiles('./packages/dm-core-plugins/package.json') }} | |||
|
|
|||
| - name: "Install dependencies" | |||
| run: yarn install | |||
| run: npm ci | |||
There was a problem hiding this comment.
With npm ci, caching node_modules is typically ineffective because npm ci removes node_modules before installing. Consider switching to caching the npm cache directory (or actions/setup-node's built-in cache: 'npm') and include package-lock.json in the cache key so dependency changes correctly bust the cache.
| - name: Cache node modules | ||
| id: cache-npm | ||
| uses: actions/cache@v5 | ||
| env: | ||
| cache-name: cache-node-modules | ||
| with: | ||
| path: | | ||
| ./example/node_modules | ||
| ./node_modules | ||
| ./yarn.lock | ||
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./packages/dm-core/package.json')}}-${{ hashFiles('./packages/dm-core-plugins/package.json') }} | ||
|
|
||
| - name: Install dependencies | ||
| run: yarn install | ||
| run: npm ci | ||
|
|
There was a problem hiding this comment.
The cache key is based on package.json files only, so lockfile changes won't invalidate the cache. Also, caching node_modules provides little/no benefit with npm ci (it deletes node_modules). Consider keying off package-lock.json and caching npm's cache directory (or using actions/setup-node cache: 'npm').
| WORKDIR /code/ | ||
| COPY jest.config.base.js package.json yarn.lock jest.config.js tsconfig.json .eslintignore .eslintrc.json ./ | ||
| COPY jest.config.base.js package.json package-lock.json jest.config.js tsconfig.json .eslintignore .eslintrc.json ./ | ||
| COPY --chown=1000 web/packages ./packages |
There was a problem hiding this comment.
This Docker build copies web/packages, but there is no web/ directory in the repository checkout, so docker build from the repo root will fail at this step. If the intention is to build from this repo, update the COPY source to the actual packages/ path (or adjust the build context accordingly).
| COPY --chown=1000 web/packages ./packages | |
| COPY --chown=1000 packages ./packages |
| path: ./example/node_modules | ||
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./example/package.json')}} | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: ./example | ||
| run: yarn install | ||
| run: npm ci |
There was a problem hiding this comment.
working-directory: ./example + npm ci will fail unless example/package-lock.json exists. Since example is an npm workspace (root lockfile), run npm ci at the repo root instead, or add an example-specific lockfile and stop treating it as a workspace.
| entry: bash -c "cd packages/dm-core && npx tsc --noEmit" | ||
|
|
There was a problem hiding this comment.
npx tsc may download TypeScript at runtime if dependencies aren't installed, which can make pre-commit behavior non-reproducible/offline-unfriendly. Consider using npx --no-install tsc --noEmit (or npm exec --no -- tsc --noEmit) so the hook fails fast if node_modules is missing.
| entry: bash -c "cd packages/dm-core-plugins && npx tsc --noEmit" | ||
|
|
There was a problem hiding this comment.
npx tsc may download TypeScript at runtime if dependencies aren't installed, which can make pre-commit behavior non-reproducible/offline-unfriendly. Consider using npx --no-install tsc --noEmit (or npm exec --no -- tsc --noEmit) so the hook fails fast if node_modules is missing.
| COPY package.json package-lock.json ./ | ||
| RUN npm ci |
There was a problem hiding this comment.
npm ci requires a package-lock.json in the working directory. The example/ folder currently does not contain a lockfile (the repo lockfile is at the workspace root), so this Docker build will fail at COPY package-lock.json/npm ci. Consider either (a) building the example image from the repo root and running npm ci once for workspaces, or (b) committing/maintaining an example/package-lock.json and keeping the example app out of the root workspace install flow.
| COPY package.json package-lock.json ./ | |
| RUN npm ci | |
| COPY package*.json ./ | |
| RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi |
| - name: Install dm-cli | ||
| working-directory: ./example | ||
| run: pip install dm-cli | ||
|
|
||
| - uses: actions/setup-node@v6 | ||
| with: |
There was a problem hiding this comment.
working-directory: ./example + npm ci will fail unless example/package-lock.json exists. Since example is configured as an npm workspace in the root package.json (single root lockfile), run npm ci from the repo root instead (and then run example scripts via npm -w example ...), or add an example-specific lockfile and stop treating it as a workspace.
This pull request migrates the project from Yarn to npm as the primary package manager and updates the Node.js version to 24 throughout the codebase and CI/CD workflows. The changes ensure consistent dependency management, update Dockerfiles, and adjust scripts and configuration files for npm compatibility.
Dependency management migration:
yarn installtonpm ciand updating related build and test commands. (package.json,example/package.json,example/Dockerfile,Dockerfile,.github/workflows/*.yaml, [1] [2] [3] [4] [5] [6] [7]yarn.lockfiles withpackage-lock.jsonfor dependency locking and caching in Dockerfiles and CI workflows. (Dockerfile,example/Dockerfile,.github/workflows/*.yaml, [1] [2] [3] [4] [5] [6]CI/CD and workflow updates:
.github/workflows/*.yaml,Dockerfile,example/Dockerfile, [1] [2] [3] [4] [5] [6] [7].github/workflows/on-main-push.yaml, .github/workflows/on-main-push.yamlL39-R65)Miscellaneous updates:
example/vite.config.mts, example/vite.config.mtsL30-R30).gitignore. (example/.gitignore, example/.gitignoreL18-L19)