Skip to content

Commit 4c6beb0

Browse files
authored
[chore] Replace yarn package manager with pnpm (#7598)
1 parent 4a2efa0 commit 4c6beb0

File tree

32 files changed

+17084
-17912
lines changed

32 files changed

+17084
-17912
lines changed

.circleci/config.yml

Lines changed: 31 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -12,60 +12,49 @@ aliases:
1212
environment:
1313
CHROME_BIN: "/usr/bin/google-chrome"
1414

15-
- &restore-node-modules-cache
16-
name: Restore node_modules cache
17-
key: v1-node-modules-{{ checksum "yarn.lock" }}
15+
- &restore-pnpm-cache
16+
name: Restore pnpm store cache
17+
key: v1-pnpm-store-{{ checksum "pnpm-lock.yaml" }}
1818

19-
- &restore-yarn-cache
20-
name: Restore Yarn global cache
21-
key: v1-yarn-global
22-
23-
- &save-node-modules-cache
24-
name: Save node_modules cache
25-
paths:
26-
- node_modules
27-
key: v1-node-modules-{{ checksum "yarn.lock" }}
28-
29-
- &save-yarn-cache
30-
name: Save Yarn global cache
19+
- &save-pnpm-cache
20+
name: Save pnpm store cache
3121
paths:
32-
# see https://yarnpkg.com/configuration/yarnrc#globalFolder
33-
- /.yarn/berry/global
34-
key: v1-yarn-global
22+
- ~/.local/share/pnpm/store
23+
key: v1-pnpm-store-{{ checksum "pnpm-lock.yaml" }}
3524

3625
jobs:
3726
checkout-code:
3827
docker: *docker-node-image
3928
steps:
4029
- checkout
41-
- restore_cache: *restore-yarn-cache
42-
- restore_cache: *restore-node-modules-cache
30+
- restore_cache: *restore-pnpm-cache
4331
- run: sudo corepack enable
44-
- run: yarn install --immutable
45-
- run: yarn constraints
46-
- save_cache: *save-node-modules-cache
47-
- save_cache: *save-yarn-cache
32+
- run: pnpm install --frozen-lockfile
33+
- run: pnpm store prune
34+
- save_cache: *save-pnpm-cache
4835
- persist_to_workspace:
4936
root: "."
50-
paths: [packages/*/node_modules]
37+
paths:
38+
- node_modules
39+
- packages/*/node_modules
5140

5241
clean-lockfile:
5342
docker: *docker-node-image
5443
steps:
5544
- checkout
56-
- restore_cache: *restore-node-modules-cache
45+
- restore_cache: *restore-pnpm-cache
5746
- run: sudo corepack enable
58-
- run: yarn dedupe --check
47+
- run: pnpm install --frozen-lockfile
48+
- run: pnpm dedupe --check
5949

6050
compile:
6151
docker: *docker-node-image
6252
resource_class: xlarge
6353
steps:
6454
- checkout
65-
- restore_cache: *restore-node-modules-cache
6655
- attach_workspace: { at: "." }
6756
- run: sudo corepack enable
68-
- run: yarn compile --parallel=7
57+
- run: pnpm compile --parallel=7
6958
- persist_to_workspace:
7059
root: "."
7160
paths:
@@ -79,10 +68,9 @@ jobs:
7968
NODE_ENV: test
8069
steps:
8170
- checkout
82-
- restore_cache: *restore-node-modules-cache
8371
- attach_workspace: { at: "." }
8472
- run: sudo corepack enable
85-
- run: yarn format-check
73+
- run: pnpm format-check
8674

8775
lint:
8876
docker: *docker-node-image
@@ -92,12 +80,13 @@ jobs:
9280
NODE_ENV: test
9381
steps:
9482
- checkout
95-
- restore_cache: *restore-node-modules-cache
9683
- attach_workspace: { at: "." }
9784
- run: sudo corepack enable
9885
- run: mkdir -p ./reports/eslint ./reports/stylelint
9986
# types and lint rules should already be compiled since this job depends on the 'compile' job
100-
- run: yarn lint
87+
- run:
88+
command: pnpm lint
89+
no_output_timeout: 20m
10190
- store_test_results: { path: ./reports }
10291
- store_artifacts: { path: ./reports }
10392

@@ -108,10 +97,9 @@ jobs:
10897
NODE_ENV: test
10998
steps:
11099
- checkout
111-
- restore_cache: *restore-node-modules-cache
112100
- attach_workspace: { at: "." }
113101
- run: sudo corepack enable
114-
- run: yarn dist --parallel=7
102+
- run: pnpm dist --parallel=7
115103
- persist_to_workspace:
116104
root: "."
117105
paths: [packages/*/lib, packages/*/dist]
@@ -123,15 +111,14 @@ jobs:
123111
parallelism: 2
124112
steps:
125113
- checkout
126-
- restore_cache: *restore-node-modules-cache
127114
- attach_workspace: { at: "." }
128115
- run: sudo corepack enable
129116
- run: mkdir -p ./reports
130117
- run:
131118
command: |
132119
case $CIRCLE_NODE_INDEX in \
133-
0) yarn nx test @blueprintjs/eslint-plugin ;; \
134-
1) yarn nx test @blueprintjs/stylelint-plugin ;; \
120+
0) pnpm nx test @blueprintjs/eslint-plugin ;; \
121+
1) pnpm nx test @blueprintjs/stylelint-plugin ;; \
135122
esac
136123
when: always
137124
- store_test_results: { path: ./reports }
@@ -145,7 +132,6 @@ jobs:
145132
parallelism: 6
146133
steps:
147134
- checkout
148-
- restore_cache: *restore-node-modules-cache
149135
- attach_workspace: { at: "." }
150136
- run: sudo corepack enable
151137
# Use an explicit version of Chrome for better test reproducibility.
@@ -166,11 +152,11 @@ jobs:
166152
# see https://github.com/palantir/blueprint/issues/3616
167153
command: |
168154
case $CIRCLE_NODE_INDEX in \
169-
0) yarn nx run-many -t test:typeCheck ;; \
170-
1) yarn nx test:karma @blueprintjs/core ;; \
171-
2) yarn nx test:karma @blueprintjs/datetime ;; \
172-
4) yarn nx test:karma @blueprintjs/select ;; \
173-
5) yarn nx test:karma @blueprintjs/table
155+
0) pnpm nx run-many -t test:typeCheck ;; \
156+
1) pnpm nx test:karma @blueprintjs/core ;; \
157+
2) pnpm nx test:karma @blueprintjs/datetime ;; \
158+
4) pnpm nx test:karma @blueprintjs/select ;; \
159+
5) pnpm nx test:karma @blueprintjs/table
174160
esac
175161
when: always
176162
- store_test_results: { path: ./reports }
@@ -182,19 +168,17 @@ jobs:
182168
JUNIT_REPORT_PATH: reports
183169
steps:
184170
- checkout
185-
- restore_cache: *restore-node-modules-cache
186171
- attach_workspace: { at: "." }
187172
- run: sudo corepack enable
188173
- run: mkdir ./reports
189-
- run: yarn nx run-many -t test:iso
174+
- run: pnpm nx run-many -t test:iso
190175
- store_test_results: { path: ./reports }
191176
- store_artifacts: { path: ./reports }
192177

193178
deploy-preview:
194179
docker: *docker-node-image
195180
steps:
196181
- checkout
197-
- restore_cache: *restore-node-modules-cache
198182
- attach_workspace: { at: "." }
199183
- store_artifacts: { path: packages/docs-app/dist }
200184
- store_artifacts: { path: packages/landing-app/dist }
@@ -206,7 +190,6 @@ jobs:
206190
docker: *docker-node-image
207191
steps:
208192
- checkout
209-
- restore_cache: *restore-node-modules-cache
210193
- attach_workspace: { at: "." }
211194
- run: sudo corepack enable
212195
- run: mkdir ./artifacts
@@ -217,7 +200,6 @@ jobs:
217200
docker: *docker-node-image
218201
steps:
219202
- checkout
220-
- restore_cache: *restore-node-modules-cache
221203
- attach_workspace: { at: "." }
222204
- run: sudo corepack enable
223205
- run: ./scripts/publish-npm-semver-tagged

.gitattributes

Lines changed: 0 additions & 4 deletions
This file was deleted.

.gitignore

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,10 @@ lerna-debug.log
1515
# Nx
1616
.nx/cache
1717

18-
# Yarn
19-
# see https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
20-
yarn-error.log
21-
.pnp.*
22-
.yarn/*
23-
!.yarn/patches
24-
!.yarn/plugins
25-
!.yarn/releases
26-
!.yarn/sdks
27-
!.yarn/versions
18+
# pnpm
19+
# pnpm-lock.yaml should be committed
20+
# see https://pnpm.io/git#lockfiles
21+
.pnpm-debug.log*
2822

2923
# Sass
3024
.sass-cache/

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ generated/
33
lib/
44
dist/
55
/site/
6-
yarn.lock
6+
pnpm-lock.yaml
77
changelog/

.yarn/patches/README.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

.yarnrc.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

AGENTS.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
## Build/Test Commands
44

5-
- **Build**: `yarn compile` (all packages), `yarn nx compile @blueprintjs/core` (single package)
6-
- **Test all**: `yarn test`, `nx run-many -t test`
7-
- **Test single package**: `yarn nx test:karma @blueprintjs/core` or `cd packages/core && yarn test:karma`
8-
- **Distribute**: `yarn dist`, `yarn nx dist @blueprintjs/core` (single package)
9-
- **Lint**: `yarn lint`, `yarn lint-fix` (auto-fix), `yarn nx lint @blueprintjs/core` (single package)
10-
- **Format**: `yarn format`, `yarn format-check`
11-
- **Verify all**: `yarn verify` (compile + dist + test + lint + format-check)
5+
- **Build**: `pnpm compile` (all packages), `pnpm nx compile @blueprintjs/core` (single package)
6+
- **Test all**: `pnpm test`, `pnpm nx run-many -t test`
7+
- **Test single package**: `pnpm nx test:karma @blueprintjs/core` or `cd packages/core && pnpm test:karma`
8+
- **Distribute**: `pnpm dist`, `pnpm nx dist @blueprintjs/core` (single package)
9+
- **Lint**: `pnpm lint`, `pnpm lint-fix` (auto-fix), `pnpm nx lint @blueprintjs/core` (single package)
10+
- **Format**: `pnpm format`, `pnpm format-check`
11+
- **Verify all**: `pnpm verify` (compile + dist + test + lint + format-check)
1212

1313
## Architecture
1414

15-
- **Monorepo** using Yarn workspaces + Nx task runner
15+
- **Monorepo** using pnpm workspaces + Nx task runner
16+
- **Package manager**: pnpm v10.18.3 (strict dependency resolution)
1617
- **Packages**: Core UI components in `packages/` - core, datetime, select, table, icons, colors
1718
- **Apps**: docs-app (blueprintjs.com), demo-app, table-dev-app for development
1819
- **Build tools**: karma-build-scripts, node-build-scripts, webpack-build-scripts

CONTRIBUTING.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Looking for places to contribute to the codebase? Check out the
99

1010
### Installation
1111

12-
First, ensure you have a compatible version of [Node.js](https://nodejs.org/) and [Yarn](https://yarnpkg.com)
12+
First, ensure you have a compatible version of [Node.js](https://nodejs.org/) and [pnpm](https://pnpm.io)
1313
installed on your machine. We recommend using [nvm](https://github.com/nvm-sh/nvm) and running `nvm use` in
1414
the repo to switch to right version of Node.
1515

@@ -25,9 +25,9 @@ build. Make sure you have an [SSH key set up with your Github account](https://d
2525
```sh
2626
git clone [email protected]:<username>/blueprint.git
2727
cd blueprint
28-
yarn
29-
yarn compile
30-
yarn dist
28+
pnpm install
29+
pnpm compile
30+
pnpm dist
3131
```
3232

3333
## Developing
@@ -43,12 +43,12 @@ A typical contributor workflow looks like this:
4343
- [Coding guidelines](https://github.com/palantir/blueprint/wiki/Coding-guidelines)
4444
- [Editor integration](https://github.com/palantir/blueprint/wiki/Editor-integration)
4545
5. Ensure your code **compiles properly** and is **tested**, **linted**, and **formatted**.
46-
- Run `yarn compile` at the repo root to build all libraries.
47-
- Run `yarn bundle` at the repo root to build the Blueprint documentation and other bundles.
48-
- Add unit tests as necessary when fixing bugs or adding features; run them with `yarn test` in the relevant package directory.
49-
- Linting is best handled by your editor for real-time feedback (see [Editor integration](https://github.com/palantir/blueprint/wiki/Editor-integration)). Run `yarn lint` to be 100% safe.
50-
- TypeScript lint errors can often be automatically fixed by ESLint. Run lint fixes with `yarn lint-fix`.
51-
- Code formatting is enforced using [Prettier](https://prettier.io/). These errors can be fixed in your editor through the Prettier extension (make sure you have set up the editor integrations linked above). **Formatting checks will not run** during the `yarn lint` package script. Instead, when using the CLI or in a CI environment you should run the `yarn format` script to fix all formatting issues across the Blueprint monorepo.
46+
- Run `pnpm compile` at the repo root to build all libraries.
47+
- Run `pnpm bundle` at the repo root to build the Blueprint documentation and other bundles.
48+
- Add unit tests as necessary when fixing bugs or adding features; run them with `pnpm test` in the relevant package directory.
49+
- Linting is best handled by your editor for real-time feedback (see [Editor integration](https://github.com/palantir/blueprint/wiki/Editor-integration)). Run `pnpm lint` to be 100% safe.
50+
- TypeScript lint errors can often be automatically fixed by ESLint. Run lint fixes with `pnpm lint-fix`.
51+
- Code formatting is enforced using [Prettier](https://prettier.io/). These errors can be fixed in your editor through the Prettier extension (make sure you have set up the editor integrations linked above). **Formatting checks will not run** during the `pnpm lint` package script. Instead, when using the CLI or in a CI environment you should run the `pnpm format` script to fix all formatting issues across the Blueprint monorepo.
5252
6. Submit a Pull Request on GitHub and fill out the template.
5353
- ⚠️ **DO NOT enable CircleCI for your fork of Blueprint.** When you open a PR, your branch will be checked out and built in palantir's CI pipeline automatically. There is no need to enable the CI build for your fork's pipeline. If you do, this may cause problems in the CI build.
5454
- If you have already opened a PR where CircleCI built the code in your own personal or organization pipeline, you will likely have to disable the project from building at app.circleci.com/settings/project/github/\<your-username\>/website and open a new PR.

0 commit comments

Comments
 (0)