Skip to content

Migrate from npm to pnpm#91

Open
Wendy Fouchter (Wendystraite) wants to merge 3 commits intosaasquatch:mainfrom
Wendystraite:npm_to_pnpm
Open

Migrate from npm to pnpm#91
Wendy Fouchter (Wendystraite) wants to merge 3 commits intosaasquatch:mainfrom
Wendystraite:npm_to_pnpm

Conversation

@Wendystraite
Copy link
Contributor

@Wendystraite Wendy Fouchter (Wendystraite) commented Oct 11, 2025

Description of the change

Npm is really a pain when working with multiple projects.

This PR migrates from npm to pnpm with the following changes mades :

Code changes

  • Remove all package-lock.json by pnpm-lock.yaml.
  • Add "packageManager" field to package.json
  • Replace "npm-run-all" by "pnpm --parallel". Also don't launch multiple times browsers tests by not launching "test:browsers" and "test:browsers-suite" from "test" script.
  • Replace jotai-vue by @nanostores/vue inside example-vue since jotai-vue is not published anymore on npm.
  • Fix website's packages versions since it did not build when installed.

This also indirectly fixes #84 without typescript config changes.

CI changes

Update github workflows from npm to pnpm

Tested all workflows locally using act :

act -l
act pull_request -W .github/workflows/validate-pr.yml
act push -W .github/workflows/website.yml
act push -W .github/workflows/merge-to-main.yml

The first workflow passes, the second and third don't due to invalid credentials (expected).

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation or Development tools (readme, specs, tests, code formatting)

Copilot AI review requested due to automatic review settings October 11, 2025 11:07
@changeset-bot
Copy link

changeset-bot bot commented Oct 11, 2025

⚠️ No Changeset found

Latest commit: 201d721

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

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

This PR migrates the project from npm to pnpm package manager to improve multi-project workflow efficiency. The migration includes replacing package lock files, updating scripts to use pnpm commands, and fixing package version inconsistencies that prevented builds.

  • Replace npm with pnpm throughout the project, including lock files and package manager configuration
  • Update all npm scripts to use pnpm equivalents with proper parallel/sequential execution patterns
  • Replace jotai-vue with @nanostores/vue in Vue example due to package availability issues

Reviewed Changes

Copilot reviewed 9 out of 21 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
package.json Main package configuration with pnpm scripts and packageManager field
website/package.json Website dependencies with fixed versions for build compatibility
website/pnpm-workspace.yaml PNPM workspace configuration for website
website/README.md Updated documentation to reference pnpm commands
examples/old-typescript/package.json Added missing dependencies for TypeScript example
examples/example-vue/package.json Migrated from jotai-vue to @nanostores/vue
examples/example-vue/src/components/HelloWorld.vue Updated Vue component to use nanostores API
examples/example-vue/src/Molecules.ts Updated molecule definition to use nanostores
CONTRIBUTING.md Updated contributor documentation with pnpm commands
Files not reviewed (7)
  • examples/example-react/pnpm-lock.yaml: Language not supported
  • examples/example-vanilla/package-lock.json: Language not supported
  • examples/example-vanilla/pnpm-lock.yaml: Language not supported
  • examples/example-vue/package-lock.json: Language not supported
  • examples/example-vue/pnpm-lock.yaml: Language not supported
  • examples/old-typescript/package-lock.json: Language not supported
  • examples/old-typescript/pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Wendystraite Wendy Fouchter (Wendystraite) marked this pull request as draft October 11, 2025 11:08
Copilot AI review requested due to automatic review settings October 11, 2025 11:39
Copy link
Contributor

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

Copilot reviewed 12 out of 24 changed files in this pull request and generated no new comments.

Files not reviewed (7)
  • examples/example-react/pnpm-lock.yaml: Language not supported
  • examples/example-vanilla/package-lock.json: Language not supported
  • examples/example-vanilla/pnpm-lock.yaml: Language not supported
  • examples/example-vue/package-lock.json: Language not supported
  • examples/example-vue/pnpm-lock.yaml: Language not supported
  • examples/old-typescript/package-lock.json: Language not supported
  • examples/old-typescript/pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Wendystraite Wendy Fouchter (Wendystraite) marked this pull request as ready for review October 11, 2025 11:41
Copy link
Contributor

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

Copilot reviewed 12 out of 24 changed files in this pull request and generated 1 comment.

Files not reviewed (7)
  • examples/example-react/pnpm-lock.yaml: Language not supported
  • examples/example-vanilla/package-lock.json: Language not supported
  • examples/example-vanilla/pnpm-lock.yaml: Language not supported
  • examples/example-vue/package-lock.json: Language not supported
  • examples/example-vue/pnpm-lock.yaml: Language not supported
  • examples/old-typescript/package-lock.json: Language not supported
  • examples/old-typescript/pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@loganvolkers
Copy link
Member

Wendy Fouchter (@Wendystraite) please update your PR on top of main to resolve merge conflicts.

- Remove all `package-lock.json` by `pnpm-lock.yaml`.
- Add "packageManager" field to package.json
- Replace "npm-run-all" by "pnpm --parallel". Also don't launch multiple times browsers tests by not launching "test:browsers" and "test:browsers-suite" from "test" script.
- Replace `jotai-vue` by `@nanostores/vue` inside example-vue since jotai-vue is not published anymore on npm.
- Fix website's packages versions since it did not build when installed.
- Update actions/checkout@v3 to v4
- Add pnpm/action-setup@v4
- Update actions/setup-node@v3 to v4
- Use pnpm cache
- Replace all "npm" calls to "pnpm"
- Replace all "npx" calls to "pnpm exec"
- Test all workflows locally using "act"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants