Skip to content

Commit 3b597a6

Browse files
[LG-5610] pnpm 10 (#3236)
* Update package.json * Create .tool-versions * Create nvm-to-asdf.sh * update workflows to pnpm10.18.3 * Update .tool-versions Co-authored-by: Copilot <[email protected]> * shebang * replace xml2json * Update pnpm-lock.yaml * Update README.md * Update README.md --------- Co-authored-by: Copilot <[email protected]>
1 parent 2463aa4 commit 3b597a6

File tree

11 files changed

+119
-56
lines changed

11 files changed

+119
-56
lines changed

.github/workflows/pr.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: pnpm
2323
uses: pnpm/action-setup@v4
2424
with:
25-
version: 9.15.0
25+
version: 10.18.3
2626

2727
- uses: actions/cache/restore@v4
2828
name: Check for build cache
@@ -95,7 +95,7 @@ jobs:
9595
- name: pnpm
9696
uses: pnpm/action-setup@v4
9797
with:
98-
version: 9.15.0
98+
version: 10.18.3
9999

100100
- name: Use Node 18
101101
uses: actions/setup-node@v4
@@ -134,7 +134,7 @@ jobs:
134134
- name: pnpm
135135
uses: pnpm/action-setup@v4
136136
with:
137-
version: 9.15.0
137+
version: 10.18.3
138138

139139
- name: Use Node 18
140140
uses: actions/setup-node@v4
@@ -182,7 +182,7 @@ jobs:
182182
- name: pnpm
183183
uses: pnpm/action-setup@v4
184184
with:
185-
version: 9.15.0
185+
version: 10.18.3
186186

187187
- name: Use Node 18
188188
uses: actions/setup-node@v4
@@ -227,7 +227,7 @@ jobs:
227227
- name: pnpm
228228
uses: pnpm/action-setup@v4
229229
with:
230-
version: 9.15.0
230+
version: 10.18.3
231231

232232
- name: Use Node 18
233233
uses: actions/setup-node@v4

.github/workflows/react17.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: pnpm
2222
uses: pnpm/action-setup@v4
2323
with:
24-
version: 9.15.0
24+
version: 10.18.3
2525
cache: false
2626

2727
- uses: actions/cache/restore@v4
@@ -75,7 +75,7 @@ jobs:
7575
- name: Install pnpm
7676
uses: pnpm/action-setup@v4
7777
with:
78-
version: 9.15.0
78+
version: 10.18.3
7979
cache: false
8080

8181
- uses: actions/cache/restore@v4

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: pnpm
1919
uses: pnpm/action-setup@v4
2020
with:
21-
version: 9.15.0
21+
version: 10.18.3
2222

2323
# Needed following Github's transition from Node 16 to 20
2424
- name: Install node-gyp
@@ -95,7 +95,7 @@ jobs:
9595
- name: pnpm
9696
uses: pnpm/action-setup@v4
9797
with:
98-
version: 9.15.0
98+
version: 10.18.3
9999

100100
- name: Use Node 18
101101
uses: actions/setup-node@v4
@@ -148,7 +148,7 @@ jobs:
148148
- name: pnpm
149149
uses: pnpm/action-setup@v4
150150
with:
151-
version: 9.15.0
151+
version: 10.18.3
152152

153153
- name: Use Node 18
154154
uses: actions/setup-node@v4
@@ -209,7 +209,7 @@ jobs:
209209
- name: pnpm
210210
uses: pnpm/action-setup@v4
211211
with:
212-
version: 9.15.0
212+
version: 10.18.3
213213

214214
- name: Use Node 18
215215
uses: actions/setup-node@v4
@@ -264,7 +264,7 @@ jobs:
264264
- name: pnpm
265265
uses: pnpm/action-setup@v4
266266
with:
267-
version: 9.15.0
267+
version: 10.18.3
268268

269269
# Needed following Github's transition from Node 16 to 20
270270
- name: Install node-gyp
@@ -309,7 +309,7 @@ jobs:
309309
- name: pnpm
310310
uses: pnpm/action-setup@v4
311311
with:
312-
version: 9.15.0
312+
version: 10.18.3
313313

314314
- name: Dispatch to Website repo
315315
uses: peter-evans/repository-dispatch@v2

.github/workflows/sizeDiff.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: pnpm
1515
uses: pnpm/action-setup@v4
1616
with:
17-
version: 9.15.0
17+
version: 10.18.3
1818

1919
- name: Use Node.js 18
2020
uses: actions/setup-node@v4

.tool-versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
nodejs 18.20.8
2+
pnpm 10.18.3

README.md

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,18 @@ import Button from '@leafygreen-ui/button';
183183

184184
### Setup
185185

186-
1. Node >= 18.0.0 required.
186+
1. Install [`asdf`](https://asdf-vm.com/guide/getting-started.html)
187187

188-
via [homebrew](https://brew.sh/) with `brew install node`
189-
190-
via [nodejs installer](https://nodejs.org/en/)
188+
```zsh
189+
brew install asdf;
190+
echo 'export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"' >> ~/.zshrc
191+
```
191192

192-
2. Install PNPM >= 9.15.0.
193+
2. Install Node & pnpm
193194

194-
[PNPM Installation documentation](https://pnpm.io/installation)
195+
```zsh
196+
asdf install
197+
```
195198

196199
3. Clone the repository.
197200

@@ -360,19 +363,6 @@ To publish a new pre-release version, pull the changes from `new-feature` into b
360363

361364
When `new-feature` is merged into `main`, you can safely delete the `pre-release` branch
362365

363-
## Deploy gh-pages
364-
365-
You can deploy a static build of our Storybook site to gh-pages from the `main` branch.
366-
367-
1. First be sure you've built a static version of Storybook with the script: `build-storybook`
368-
2. Then deploy to gh-pages: `pnpm release:site`
369-
370-
### To deploy to your own mirror of leafygreen-ui
371-
372-
1. Run `pnpm demo:site [your_github_username]`.
373-
2. If you haven't built a static version of Storybook yet, you will be prompted to do so.
374-
3. You will be asked for confirmation before Storybook is published.
375-
376366
## License
377367

378368
The source files in this repository are made available under the terms of the Apache License, version 2.0.

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
"private": true,
77
"engines": {
88
"node": ">= 18.20.8",
9-
"pnpm": ">= 9.15.0"
9+
"pnpm": ">= 10.18.3"
1010
},
11+
"packageManager": "[email protected]",
1112
"scripts": {
1213
"init": "pnpm install && pnpm build",
1314
"init:react17": "pnpm clean; npx node ./scripts/react17/init.mjs; pnpm run init",
@@ -83,7 +84,11 @@
8384
"caniuse-lite": "^1.0.30001585",
8485
"jackspeak": "2.1.1",
8586
"typescript": "$typescript"
86-
}
87+
},
88+
"onlyBuiltDependencies": [
89+
"core-js",
90+
"esbuild"
91+
]
8792
},
8893
"lg": {
8994
"scopes": {
@@ -108,7 +113,5 @@
108113
},
109114
"bugs": {
110115
"url": "https://github.com/mongodb/leafygreen-ui/issues"
111-
},
112-
"packageManager": "[email protected]",
113-
"typesVersions": {}
116+
}
114117
}

packages/icon/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@
4747
"@lg-tools/storybook-utils": "workspace:^",
4848
"@rollup/plugin-node-resolve": "15.1.0",
4949
"@svgr/core": "^5.3.1",
50-
"@types/xml2json": "^0.11.0",
5150
"commander": "^11.0.0",
51+
"fast-xml-parser": "^5.3.0",
5252
"fs-extra": "11.1.1",
5353
"p-queue": "^8.1.0",
5454
"rollup": "4.16.1",
55-
"rollup-plugin-node-externals": "7.1.1",
5655
"ts-node": "^10.9.2",
56+
"rollup-plugin-node-externals": "7.1.1",
5757
"xml2json": "^0.12.0"
5858
},
5959
"gitHead": "dd71a2d404218ccec2e657df9c0263dc1c15b9e0",

packages/icon/src/Icon.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react';
22
import { render, screen } from '@testing-library/react';
3+
import { XMLParser } from 'fast-xml-parser';
34
import fs from 'fs';
45
import { axe } from 'jest-axe';
56
import path from 'path';
6-
import { toJson } from 'xml2json';
77

88
import { typeIs } from '@leafygreen-ui/lib';
99

@@ -108,8 +108,8 @@ describe('packages/Icon/glyphs/', () => {
108108
readonly [K in string]: string | SVGNodeObject;
109109
};
110110

111-
//@ts-expect-error
112-
const rootGlyphObject: SVGNodeObject = toJson(svg, { object: true });
111+
const parser = new XMLParser({ ignoreAttributes: false });
112+
const rootGlyphObject: SVGNodeObject = parser.parse(svg);
113113

114114
function validateGlyphObject(obj: SVGNodeObject) {
115115
Object.keys(obj).forEach(key => {

pnpm-lock.yaml

Lines changed: 19 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)