Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

Commit ada0d77

Browse files
ryanwilsonperkinjesstelford
authored andcommitted
Use pnpm instead of yarn
1 parent a89e614 commit ada0d77

File tree

48 files changed

+24008
-25389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+24008
-25389
lines changed

.changeset/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Hello and welcome! To manage our change log and releases, we use [Changesets](https://github.com/changesets/changesets) to [version](https://semver.org/) and publish code.
44

5-
To add an entry to the change log for your pull request, from your feature branch run `yarn changeset` in your terminal. Use the arrow, spacebar, and return keys to answer the following Changesets CLI questions:
5+
To add an entry to the change log for your pull request, from your feature branch run `pnpm changeset` in your terminal. Use the arrow, spacebar, and return keys to answer the following Changesets CLI questions:
66

77
`🦋 Which packages would you like to include?`
88

.changeset/flat-cougars-look.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'polaris-for-vscode': major
3+
'@shopify/polaris-icons': major
4+
'@shopify/polaris-migrator': major
5+
'@shopify/polaris': major
6+
'polaris.shopify.com': major
7+
'@shopify/stylelint-polaris': major
8+
---
9+
10+
[Internal] Migrate repo from yarn to pnpm. No action required.

.changeset/wise-vans-notice.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/polaris-icons': major
3+
---
4+
5+
`react` is now a required peerDependency (even when importing non-React SVG assets). [More info](https://github.com/Shopify/polaris/pull/11825#pullrequestreview-1974881032)

.eslintrc.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
const fs = require('fs');
12
const path = require('path');
3+
const yaml = require('js-yaml');
24

3-
const packages = require('./package.json').workspaces.packages;
5+
const pnpmWorkspace = path.join(__dirname, './pnpm-workspace.yaml');
6+
const {packages} = yaml.load(fs.readFileSync(pnpmWorkspace, 'utf8'));
47

58
module.exports = {
69
root: true,

.github/CONTRIBUTING.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ We’ll review your pull request and either merge it, request changes to it, or
8585
**Before submitting a pull request**, please:
8686

8787
1. Fork the repository and create your branch from `main`
88-
1. Run `yarn` in the repository root
88+
1. Run `pnpm` in the repository root
8989
1. If you’ve fixed a bug or added code, make sure to add tests
90-
1. Ensure the test suite passes with `yarn test` (protip: `yarn test:watch TestName` is helpful in development)
91-
1. Format your code with `yarn format`
92-
1. Make sure your code lints with `yarn lint`
93-
1. Run the TypeScript compiler with `yarn type-check`
94-
1. [Tophat 🎩](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md) your changes locally in Storybook with `yarn dev`
95-
1. Create a changeset by running `yarn changeset`. [More info](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#adding-a-changeset).
90+
1. Ensure the test suite passes with `pnpm test` (protip: `pnpm test:watch TestName` is helpful in development)
91+
1. Format your code with `pnpm format`
92+
1. Make sure your code lints with `pnpm lint`
93+
1. Run the TypeScript compiler with `pnpm type-check`
94+
1. [Tophat 🎩](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md) your changes locally in Storybook with `pnpm dev`
95+
1. Create a changeset by running `pnpm changeset`. [More info](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#adding-a-changeset).
9696
1. If you haven’t already, [sign a CLA](https://cla.shopify.com/)
9797

9898
### Changelog
@@ -109,14 +109,14 @@ A changeset describes changes made in a branch or commit. It holds three bits of
109109

110110
Add a changeset if you have made any changes that will require a package version bump and release:
111111

112-
1. Run `yarn changeset`.
112+
1. Run `pnpm changeset`.
113113
2. Select the packages you want to include using ↑ and ↓ to navigate to packages, and space to select a package. Hit enter when all desired packages are selected.
114114
3. Select a [bump type](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#semantic-versioning) for each selected package.
115115
4. Provide a message to be written into the changelog on the next release.
116116

117117
#### Writing a changelog message
118118

119-
Keep the following in mind when authoring your changelog entry (final prompt after running `yarn changeset`):
119+
Keep the following in mind when authoring your changelog entry (final prompt after running `pnpm changeset`):
120120

121121
- Use a positive, conversational tone (for example, use “support” over “allow” and other authoritative verbs)
122122
- Avoid redundancy when possible (try to phrase a bug fix entry without the word “bug”)
@@ -137,7 +137,7 @@ Each contributor is required to [sign a CLA](https://cla.shopify.com/). This pro
137137

138138
### Contribution prerequisites
139139

140-
- You have Node installed at v20.11.1+ and Yarn at v1.22.18+
140+
- You have Node installed at v20.11.1+ and Pnpm at v8+
141141

142142
### Best practices
143143

@@ -153,8 +153,8 @@ See the [README.md file](https://github.com/Shopify/polaris/blob/main/README.md#
153153

154154
We recommend running tests as well as trying your build of a package in a real project, to make sure you don’t introduce any regressions as you work on your change.
155155

156-
- `yarn test` will run tests for all packages
157-
- `yarn turbo run test --filter="[HEAD^1]"` will test any package that has changed in the last commit
156+
- `pnpm test` will run tests for all packages
157+
- `pnpm turbo run test --filter="[HEAD^1]"` will test any package that has changed in the last commit
158158

159159
You can test your changes in another project locally by creating a [snapshot release](https://github.com/Shopify/polaris/blob/main/documentation/Releasing.md#snapshot-release).
160160

@@ -163,16 +163,16 @@ On your feature branch PR, ensure you have a [changeset](https://github.com/Shop
163163
Once the snapshot is ready, there will be a new comment in your feature PR with the newly released versions. In your external project, add the snapshot package or packages. An example snapshot package should have the following format:
164164

165165
```sh
166-
yarn add @shopify/polaris@0.0.0-snapshot-release-20220525184558
166+
pnpm add @shopify/polaris@0.0.0-snapshot-release-20220525184558
167167
```
168168

169169
Run the project as usual to tophat local changes. If you need to make updates, push new package changes to your feature PR and create a new snapshot release.
170170

171171
### Code style
172172

173-
We use an automatic code formatter called [Prettier](https://prettier.io/). Run `yarn format` after making any changes to the code.
173+
We use an automatic code formatter called [Prettier](https://prettier.io/). Run `pnpm format` after making any changes to the code.
174174

175-
Linting will catch common issues that may exist in your code. You can check the status of your code styling by running `yarn lint`.
175+
Linting will catch common issues that may exist in your code. You can check the status of your code styling by running `pnpm lint`.
176176

177177
Our code editor of choice is [VS Code](https://code.visualstudio.com/) which has [integrations with Prettier](https://github.com/prettier/prettier-vscode) and our linting tools which make this automatic. If you choose to use VS Code, these integrations will be listed as recommended extensions (or search for `@recommended`) in the extensions panel.
178178

.github/workflows/changelog.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323

24+
- name: Setup pnpm
25+
uses: pnpm/action-setup@v3
26+
2427
- name: Setup Node from .nvmrc
2528
uses: actions/setup-node@v4
2629
with:

.github/workflows/ci-a11y-vrt.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ jobs:
3434
sudo rm -rf "/usr/local/share/boost"
3535
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
3636
37+
- name: Setup pnpm
38+
uses: pnpm/action-setup@v3
39+
3740
- name: Setup Node from .nvmrc
3841
uses: actions/setup-node@v4
3942
with:
4043
node-version-file: '.nvmrc'
41-
cache: yarn
44+
cache: pnpm
4245

4346
- name: Restore cache
4447
uses: actions/cache@v3
@@ -52,13 +55,13 @@ jobs:
5255
${{ runner.os }}-accessibility-test-v2-
5356
5457
- name: Install dependencies
55-
run: yarn --frozen-lockfile
58+
run: pnpm install --frozen-lockfile
5659

5760
- name: Build packages
58-
run: yarn build --filter=@shopify/polaris
61+
run: pnpm build --filter=@shopify/polaris
5962

6063
- name: Build Storybook
61-
run: yarn workspace @shopify/polaris run storybook:build --quiet
64+
run: pnpm --filter=@shopify/polaris run storybook:build --quiet
6265

6366
- name: Run accessibility test
6467
run: node ./polaris-react/scripts/accessibility-check.js
@@ -74,11 +77,14 @@ jobs:
7477
with:
7578
fetch-depth: 0 # Chromatic git history to track changes
7679

80+
- name: Setup pnpm
81+
uses: pnpm/action-setup@v3
82+
7783
- name: Setup Node from .nvmrc
7884
uses: actions/setup-node@v4
7985
with:
8086
node-version-file: '.nvmrc'
81-
cache: yarn
87+
cache: pnpm
8288

8389
- name: Restore cache
8490
uses: actions/cache@v3
@@ -92,13 +98,13 @@ jobs:
9298
${{ runner.os }}-visual-regression-test-v2-
9399
94100
- name: Install dependencies
95-
run: yarn --frozen-lockfile
101+
run: pnpm install --frozen-lockfile
96102

97103
- name: Build packages
98-
run: yarn build --filter=@shopify/polaris
104+
run: pnpm build --filter=@shopify/polaris
99105

100106
- name: Build Storybook
101-
run: yarn workspace @shopify/polaris run storybook:build --quiet
107+
run: pnpm --filter=@shopify/polaris run storybook:build --quiet
102108
env:
103109
STORYBOOK_GITHUB_SHA: ${{ github.sha }}
104110
STORYBOOK_GITHUB_REPO_URL: ${{ github.server_url }}/${{ github.repository }}

.github/workflows/ci-lint.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ jobs:
2626
sudo rm -rf "/usr/local/share/boost"
2727
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
2828
29+
- name: Setup pnpm
30+
uses: pnpm/action-setup@v3
31+
2932
- name: Setup Node from .nvmrc
3033
uses: actions/setup-node@v4
3134
with:
3235
node-version-file: '.nvmrc'
33-
cache: yarn
36+
cache: pnpm
3437

3538
- name: Restore cache
3639
uses: actions/cache@v3
@@ -45,13 +48,13 @@ jobs:
4548
${{ runner.os }}-lint-v3-
4649
4750
- name: Install dependencies
48-
run: yarn --frozen-lockfile
51+
run: pnpm install --frozen-lockfile
4952

5053
- name: Build packages
51-
run: yarn build
54+
run: pnpm build
5255

5356
- name: Lint
54-
run: yarn lint
57+
run: pnpm lint
5558

5659
- name: Type check
57-
run: yarn type-check
60+
run: pnpm type-check

.github/workflows/ci-test.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@ jobs:
3434
sudo rm -rf "/usr/local/share/boost"
3535
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
3636
37+
- name: Setup pnpm
38+
uses: pnpm/action-setup@v3
39+
3740
- name: Setup Node with v${{ matrix.node-version }}
3841
uses: actions/setup-node@v4
3942
id: setup_node
4043
with:
4144
node-version: ${{ matrix.node-version }}
42-
cache: yarn
45+
cache: pnpm
4346

4447
- name: Restore cache
4548
uses: actions/cache@v3
@@ -54,10 +57,10 @@ jobs:
5457
${{ runner.os }}-node${{ steps.setup_node.outputs.node-version }}-test-v4-
5558
5659
- name: Install dependencies
57-
run: yarn --frozen-lockfile
60+
run: pnpm install --frozen-lockfile
5861

5962
- name: Build packages
60-
run: yarn build
63+
run: pnpm build
6164

6265
- name: Test
63-
run: yarn test
66+
run: pnpm test

.github/workflows/publish-polaris-for-vscode.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,22 @@ jobs:
2525
sudo rm -rf "/usr/local/share/boost"
2626
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
2727
28+
- name: Setup pnpm
29+
uses: pnpm/action-setup@v3
30+
2831
- name: Setup Node from .nvmrc
2932
uses: actions/setup-node@v4
3033
with:
3134
node-version-file: '.nvmrc'
32-
cache: yarn
35+
cache: pnpm
3336

3437
- name: Install dependencies
35-
run: yarn
38+
run: pnpm
3639

3740
- name: Build extension
38-
run: yarn build --filter=polaris-for-vscode
41+
run: pnpm build --filter=polaris-for-vscode
3942

4043
- name: Publish extension in the marketplace
41-
run: yarn workspace polaris-for-vscode vsce publish
44+
run: pnpm --filter=polaris-for-vscode vsce publish
4245
env:
4346
VSCE_PAT: ${{ secrets.VSCE_PAT }}

0 commit comments

Comments
 (0)