Skip to content

Commit 80c3164

Browse files
authored
Merge pull request #5446 from Tyriar/tyriar/npm
Migrate from yarn to npm, node 18 -> 22, use npm workspaces
2 parents 637231e + 236004c commit 80c3164

File tree

36 files changed

+11434
-4817
lines changed

36 files changed

+11434
-4817
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"forwardPorts": [
1010
3000
1111
],
12-
"postCreateCommand": "yarn install && yarn setup",
12+
"postCreateCommand": "npm install && npm run setup",
1313
"customizations": {
1414
"vscode": {
1515
"extensions": [

.github/workflows/ci.yml

Lines changed: 41 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ jobs:
1212
timeout-minutes: 10
1313
steps:
1414
- uses: actions/checkout@v3
15-
- name: Use Node.js 18.x
15+
- name: Use Node.js 22.x
1616
uses: actions/setup-node@v3
1717
with:
18-
node-version: 18.x
19-
cache: 'yarn'
18+
node-version: 22.x
19+
cache: 'npm'
2020
- name: Install dependencies
21-
run: yarn --frozen-lockfile
21+
run: npm ci
2222
- name: Setup and run tsc
23-
run: yarn setup
23+
run: npm run setup
2424
- name: Esbuild
25-
run: yarn esbuild
25+
run: npm run esbuild
2626
- name: Zip artifacts
2727
run: |
2828
zip -r compressed-build \
@@ -77,37 +77,35 @@ jobs:
7777
timeout-minutes: 10
7878
steps:
7979
- uses: actions/checkout@v3
80-
- name: Use Node.js 18.x
80+
- name: Use Node.js 22.x
8181
uses: actions/setup-node@v3
8282
with:
83-
node-version: 18.x
84-
cache: 'yarn'
83+
node-version: 22.x
84+
cache: 'npm'
8585
- name: Install dependencies
8686
run: |
87-
yarn --frozen-lockfile
88-
yarn install-addons
87+
npm ci
8988
- name: Lint code
9089
env:
9190
NODE_OPTIONS: --max_old_space_size=4096
92-
run: yarn lint
91+
run: npm run lint
9392
- name: Lint API
94-
run: yarn lint-api
93+
run: npm run lint-api
9594

9695
test-unit-coverage:
9796
needs: build
9897
runs-on: ubuntu-latest
9998
timeout-minutes: 10
10099
steps:
101100
- uses: actions/checkout@v3
102-
- name: Use Node.js 18.x
101+
- name: Use Node.js 22.x
103102
uses: actions/setup-node@v3
104103
with:
105-
node-version: 18.x
106-
cache: 'yarn'
104+
node-version: 22.x
105+
cache: 'npm'
107106
- name: Install dependencies
108107
run: |
109-
yarn --frozen-lockfile
110-
yarn install-addons
108+
npm ci
111109
- uses: actions/download-artifact@v4
112110
with:
113111
name: build-artifacts
@@ -122,7 +120,7 @@ jobs:
122120
ls -R
123121
- name: Unit test coverage
124122
run: |
125-
yarn test-unit-coverage --forbid-only
123+
npm run test-unit-coverage --forbid-only
126124
EXIT_CODE=$?
127125
./node_modules/.bin/nyc report --reporter=cobertura
128126
exit $EXIT_CODE
@@ -131,7 +129,7 @@ jobs:
131129
timeout-minutes: 20
132130
strategy:
133131
matrix:
134-
node-version: [18]
132+
node-version: [22]
135133
runs-on: [ubuntu, macos, windows]
136134
runs-on: ${{ matrix.runs-on }}-latest
137135
steps:
@@ -140,11 +138,10 @@ jobs:
140138
uses: actions/setup-node@v3
141139
with:
142140
node-version: ${{ matrix.node-version }}.x
143-
cache: 'yarn'
141+
cache: 'npm'
144142
- name: Install dependencies
145143
run: |
146-
yarn --frozen-lockfile
147-
yarn install-addons
144+
npm ci
148145
- name: Wait for build job
149146
uses: NathanFirmo/[email protected]
150147
with:
@@ -163,13 +160,13 @@ jobs:
163160
fi
164161
ls -R
165162
- name: Unit tests
166-
run: yarn test-unit --forbid-only
163+
run: npm run test-unit --forbid-only
167164

168165
test-integration:
169166
timeout-minutes: 20
170167
strategy:
171168
matrix:
172-
node-version: [18] # just one as integration tests are about testing in browser
169+
node-version: [22] # just one as integration tests are about testing in browser
173170
runs-on: [ubuntu-22.04] # macos is flaky
174171
browser: [chromium, firefox, webkit]
175172
runs-on: ${{ matrix.runs-on }}
@@ -179,11 +176,10 @@ jobs:
179176
uses: actions/setup-node@v3
180177
with:
181178
node-version: ${{ matrix.node-version }}.x
182-
cache: 'yarn'
179+
cache: 'npm'
183180
- name: Install dependencies
184181
run: |
185-
yarn --frozen-lockfile
186-
yarn install-addons
182+
npm ci
187183
- name: Install playwright
188184
run: npx playwright install --with-deps ${{ matrix.browser }}
189185
- name: Wait for build job
@@ -204,49 +200,48 @@ jobs:
204200
fi
205201
ls -R
206202
- name: Build demo
207-
run: yarn esbuild-demo
203+
run: npm run esbuild-demo
208204
- name: Integration tests (core) # Tests use 50% workers to reduce flakiness
209-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=core
205+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=core
210206
- name: Integration tests (addon-attach)
211-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-attach
207+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-attach
212208
- name: Integration tests (addon-clipboard)
213-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-clipboard
209+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-clipboard
214210
- name: Integration tests (addon-fit)
215-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-fit
211+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-fit
216212
- name: Integration tests (addon-image)
217-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-image
213+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-image
218214
- name: Integration tests (addon-progress)
219-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-progress
215+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-progress
220216
- name: Integration tests (addon-search)
221-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-search
217+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-search
222218
- name: Integration tests (addon-serialize)
223-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-serialize
219+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-serialize
224220
- name: Integration tests (addon-unicode-graphemes)
225-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-unicode-graphemes
221+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-unicode-graphemes
226222
- name: Integration tests (addon-unicode11)
227-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-unicode11
223+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-unicode11
228224
- name: Integration tests (addon-web-links)
229-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-web-links
225+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-web-links
230226
- name: Integration tests (addon-webgl)
231-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-webgl
227+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-webgl
232228

233229
release-dry-run:
234230
needs: build
235231
runs-on: ubuntu-latest
236232
strategy:
237233
matrix:
238-
node-version: [18]
234+
node-version: [22]
239235
steps:
240236
- uses: actions/checkout@v3
241237
- name: Use Node.js ${{ matrix.node-version }}.x
242238
uses: actions/setup-node@v3
243239
with:
244240
node-version: ${{ matrix.node-version }}.x
245-
cache: 'yarn'
241+
cache: 'npm'
246242
- name: Install dependencies
247243
run: |
248-
yarn --frozen-lockfile
249-
yarn install-addons
244+
npm ci
250245
- name: Install playwright
251246
run: npx playwright install
252247
- uses: actions/download-artifact@v4
@@ -263,7 +258,7 @@ jobs:
263258
ls -R
264259
- name: Package headless
265260
run: |
266-
yarn package-headless
261+
npm run package-headless
267262
node ./bin/package_headless.js
268263
- name: Publish to npm (dry run)
269264
run: node ./bin/publish.js --dry

.github/workflows/copilot-setup-steps.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,14 @@ jobs:
1919
steps:
2020
- name: Checkout code
2121
uses: actions/checkout@v4
22-
23-
- name: Use Node.js 20.x
22+
- name: Use Node.js 22.x
2423
uses: actions/setup-node@v3
2524
with:
26-
node-version: 20.x
27-
cache: 'yarn'
28-
25+
node-version: 22.x
26+
cache: 'npm'
2927
- name: Install dependencies
30-
run: yarn --frozen-lockfile
31-
28+
run: npm ci
3229
- name: Setup and run tsc
33-
run: yarn setup
34-
30+
run: npm run setup
3531
- name: Esbuild
36-
run: yarn esbuild
32+
run: npm run esbuild

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v3
14-
- name: Use Node.js 18.x
14+
- name: Use Node.js 22.x
1515
uses: actions/setup-node@v3
1616
with:
17-
node-version: 18.x
18-
cache: 'yarn'
17+
node-version: 22.x
18+
cache: 'npm'
1919
- name: Install dependencies
20-
run: yarn --frozen-lockfile
20+
run: npm ci
2121
- name: Build
22-
run: yarn setup
22+
run: npm run setup
2323
- name: Package headless
2424
run: |
25-
yarn package-headless
25+
npm run package-headless
2626
node ./bin/package_headless.js
2727
- name: Publish to npm
2828
env:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ npm-debug.log
1818
.env
1919
build/
2020
.DS_Store
21-
package-lock.json
21+
yarn.lock
2222

2323
# Keep bundled code out of Git
2424
dist/

CONTRIBUTING.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,40 +65,40 @@ One area that always needs attention is improving out unit test coverage, you ca
6565

6666
### Unit tests
6767

68-
Unit tests are run with `yarn test-unit`:
68+
Unit tests are run with `npm run test-unit`:
6969

7070
```sh
7171
# All unit tests
72-
yarn test-unit
72+
npm run test-unit
7373

7474
# Absolute file path
75-
yarn test-unit out-esbuild/browser/Terminal.test.js
75+
npm run test-unit out-esbuild/browser/Terminal.test.js
7676

7777
# Filter by wildcard
78-
yarn test-unit out-esbuild/**/Terminal.test.js
78+
npm run test-unit out-esbuild/**/Terminal.test.js
7979

8080
# Specific addon unit tests tests
81-
yarn test-unit addons/addon-image/out-esbuild/*.test.js
81+
npm run test-unit addons/addon-image/out-esbuild/*.test.js
8282

8383
# Multiple files
84-
yarn test-unit out-esbuild/**/Terminal.test.js out-esbuild/**/InputHandler.test.js
84+
npm run test-unit out-esbuild/**/Terminal.test.js out-esbuild/**/InputHandler.test.js
8585
```
8686

8787
These use mocha to run all `.test.js` files within the esbuild output (`out-esbuild/`).
8888

8989
### Integration tests
9090

91-
Integration tests are run with `yarn test-integration`:
91+
Integration tests are run with `npm run test-integration`:
9292

9393
```sh
9494
# All integration tests
95-
yarn test-integration
95+
npm run test-integration
9696

9797
# Core integration tests
98-
yarn test-integration --suite=core
98+
npm run test-integration --suite=core
9999

100100
# Specific addon integration tests
101-
yarn test-integration --suite=addon-search
101+
npm run test-integration --suite=addon-search
102102
```
103103

104104
These use `@playwright/test` to run all tests within the esbuild test output (`out-esbuild-test/`).

addons/addon-attach/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,5 @@
2121
"package": "../../node_modules/.bin/webpack",
2222
"prepublishOnly": "npm run package",
2323
"start": "node ../../demo/start"
24-
},
25-
"peerDependencies": {
26-
"@xterm/xterm": "^5.0.0"
2724
}
2825
}

addons/addon-clipboard/package-lock.json

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

addons/addon-clipboard/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
"prepublishOnly": "npm run package",
2323
"start": "node ../../demo/start"
2424
},
25-
"peerDependencies": {
26-
"@xterm/xterm": "^5.4.0"
27-
},
2825
"dependencies": {
2926
"js-base64": "^3.7.5"
3027
}

addons/addon-clipboard/yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
js-base64@^3.7.5:
66
version "3.7.7"
7-
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.7.tgz#e51b84bf78fbf5702b9541e2cb7bfcb893b43e79"
7+
resolved "https://registry.npmjs.org/js-base64/-/js-base64-3.7.7.tgz"
88
integrity sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==

0 commit comments

Comments
 (0)