Skip to content

chore: migrate from Yarn v1 to npm and update Node to v24#1535

Open
Dre90 wants to merge 4 commits intomainfrom
chore/unify-node-version
Open

chore: migrate from Yarn v1 to npm and update Node to v24#1535
Dre90 wants to merge 4 commits intomainfrom
chore/unify-node-version

Conversation

@Dre90
Copy link
Contributor

@Dre90 Dre90 commented Mar 6, 2026

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:

  • Replaced all Yarn commands and references with npm equivalents in scripts, Dockerfiles, and workflow files, including switching from yarn install to npm ci and updating related build and test commands. (package.json, example/package.json, example/Dockerfile, Dockerfile, .github/workflows/*.yaml, [1] [2] [3] [4] [5] [6] [7]
  • Replaced yarn.lock files with package-lock.json for 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:

  • Updated Node.js version from 20 or 22 to 24 in all workflow files and Dockerfiles to ensure compatibility with the latest npm features. (.github/workflows/*.yaml, Dockerfile, example/Dockerfile, [1] [2] [3] [4] [5] [6] [7]
  • Modified CI/CD publishing commands to use npm workspaces instead of Yarn workspaces for package publishing. (.github/workflows/on-main-push.yaml, .github/workflows/on-main-push.yamlL39-R65)

Miscellaneous updates:

  • Updated comments and scripts to reference npm instead of Yarn where symbolic links or workspace features are used. (example/vite.config.mts, example/vite.config.mtsL30-R30)
  • Removed Yarn-specific debug log entries from .gitignore. (example/.gitignore, example/.gitignoreL18-L19)

@Dre90 Dre90 marked this pull request as ready for review March 6, 2026 13:47
@Dre90 Dre90 requested a review from a team as a code owner March 6, 2026 13:47
@Dre90 Dre90 requested a review from Copilot March 6, 2026 13:48
Copy link

Copilot AI left a comment

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 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.json and updated install/build/test commands (notably to npm 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 to e2e/package.json (or a generated/committed e2e/package-lock.json) won't invalidate the cache. Consider hashing e2e/package.json (and ideally e2e/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.

Comment on lines 42 to +56
@@ -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
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines 36 to 49
- 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

Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

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').

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

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).

Suggested change
COPY --chown=1000 web/packages ./packages
COPY --chown=1000 packages ./packages

Copilot uses AI. Check for mistakes.
Comment on lines 73 to +78
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
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +34 to 35
entry: bash -c "cd packages/dm-core && npx tsc --noEmit"

Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +40 to 41
entry: bash -c "cd packages/dm-core-plugins && npx tsc --noEmit"

Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +4
COPY package.json package-lock.json ./
RUN npm ci
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Comment on lines 73 to 78
- name: Install dm-cli
working-directory: ./example
run: pip install dm-cli

- uses: actions/setup-node@v6
with:
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
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.

2 participants