Skip to content

Commit 92eddf8

Browse files
committed
Move to npm
1 parent e1023d7 commit 92eddf8

18 files changed

Lines changed: 8987 additions & 4666 deletions

File tree

.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: 46 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,37 @@ 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
88+
npm run install-addons
8989
- name: Lint code
9090
env:
9191
NODE_OPTIONS: --max_old_space_size=4096
92-
run: yarn lint
92+
run: npm run lint
9393
- name: Lint API
94-
run: yarn lint-api
94+
run: npm run lint-api
9595

9696
test-unit-coverage:
9797
needs: build
9898
runs-on: ubuntu-latest
9999
timeout-minutes: 10
100100
steps:
101101
- uses: actions/checkout@v3
102-
- name: Use Node.js 18.x
102+
- name: Use Node.js 22.x
103103
uses: actions/setup-node@v3
104104
with:
105-
node-version: 18.x
106-
cache: 'yarn'
105+
node-version: 22.x
106+
cache: 'npm'
107107
- name: Install dependencies
108108
run: |
109-
yarn --frozen-lockfile
110-
yarn install-addons
109+
npm ci
110+
npm run install-addons
111111
- uses: actions/download-artifact@v4
112112
with:
113113
name: build-artifacts
@@ -122,7 +122,7 @@ jobs:
122122
ls -R
123123
- name: Unit test coverage
124124
run: |
125-
yarn test-unit-coverage --forbid-only
125+
npm run test-unit-coverage --forbid-only
126126
EXIT_CODE=$?
127127
./node_modules/.bin/nyc report --reporter=cobertura
128128
exit $EXIT_CODE
@@ -131,7 +131,7 @@ jobs:
131131
timeout-minutes: 20
132132
strategy:
133133
matrix:
134-
node-version: [18]
134+
node-version: [22]
135135
runs-on: [ubuntu, macos, windows]
136136
runs-on: ${{ matrix.runs-on }}-latest
137137
steps:
@@ -140,11 +140,11 @@ jobs:
140140
uses: actions/setup-node@v3
141141
with:
142142
node-version: ${{ matrix.node-version }}.x
143-
cache: 'yarn'
143+
cache: 'npm'
144144
- name: Install dependencies
145145
run: |
146-
yarn --frozen-lockfile
147-
yarn install-addons
146+
npm ci
147+
npm run install-addons
148148
- name: Wait for build job
149149
uses: NathanFirmo/wait-for-other-job@v1.1.1
150150
with:
@@ -163,13 +163,13 @@ jobs:
163163
fi
164164
ls -R
165165
- name: Unit tests
166-
run: yarn test-unit --forbid-only
166+
run: npm run test-unit --forbid-only
167167

168168
test-integration:
169169
timeout-minutes: 20
170170
strategy:
171171
matrix:
172-
node-version: [18] # just one as integration tests are about testing in browser
172+
node-version: [22] # just one as integration tests are about testing in browser
173173
runs-on: [ubuntu-22.04] # macos is flaky
174174
browser: [chromium, firefox, webkit]
175175
runs-on: ${{ matrix.runs-on }}
@@ -179,11 +179,11 @@ jobs:
179179
uses: actions/setup-node@v3
180180
with:
181181
node-version: ${{ matrix.node-version }}.x
182-
cache: 'yarn'
182+
cache: 'npm'
183183
- name: Install dependencies
184184
run: |
185-
yarn --frozen-lockfile
186-
yarn install-addons
185+
npm ci
186+
npm run install-addons
187187
- name: Install playwright
188188
run: npx playwright install --with-deps ${{ matrix.browser }}
189189
- name: Wait for build job
@@ -204,49 +204,49 @@ jobs:
204204
fi
205205
ls -R
206206
- name: Build demo
207-
run: yarn esbuild-demo
207+
run: npm run esbuild-demo
208208
- name: Integration tests (core) # Tests use 50% workers to reduce flakiness
209-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=core
209+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=core
210210
- name: Integration tests (addon-attach)
211-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-attach
211+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-attach
212212
- name: Integration tests (addon-clipboard)
213-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-clipboard
213+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-clipboard
214214
- name: Integration tests (addon-fit)
215-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-fit
215+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-fit
216216
- name: Integration tests (addon-image)
217-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-image
217+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-image
218218
- name: Integration tests (addon-progress)
219-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-progress
219+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-progress
220220
- name: Integration tests (addon-search)
221-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-search
221+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-search
222222
- name: Integration tests (addon-serialize)
223-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-serialize
223+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-serialize
224224
- name: Integration tests (addon-unicode-graphemes)
225-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-unicode-graphemes
225+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-unicode-graphemes
226226
- name: Integration tests (addon-unicode11)
227-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-unicode11
227+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-unicode11
228228
- name: Integration tests (addon-web-links)
229-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-web-links
229+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-web-links
230230
- name: Integration tests (addon-webgl)
231-
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-webgl
231+
run: npm run test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-webgl
232232

233233
release-dry-run:
234234
needs: build
235235
runs-on: ubuntu-latest
236236
strategy:
237237
matrix:
238-
node-version: [18]
238+
node-version: [22]
239239
steps:
240240
- uses: actions/checkout@v3
241241
- name: Use Node.js ${{ matrix.node-version }}.x
242242
uses: actions/setup-node@v3
243243
with:
244244
node-version: ${{ matrix.node-version }}.x
245-
cache: 'yarn'
245+
cache: 'npm'
246246
- name: Install dependencies
247247
run: |
248-
yarn --frozen-lockfile
249-
yarn install-addons
248+
npm ci
249+
npm run install-addons
250250
- name: Install playwright
251251
run: npx playwright install
252252
- uses: actions/download-artifact@v4
@@ -263,7 +263,7 @@ jobs:
263263
ls -R
264264
- name: Package headless
265265
run: |
266-
yarn package-headless
266+
npm run package-headless
267267
node ./bin/package_headless.js
268268
- name: Publish to npm (dry run)
269269
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-image/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ npm-debug.log
1717
.env
1818
build/
1919
.DS_Store
20-
package-lock.json
2120
yarn.lock
2221

2322
# Keep bundled code out of Git

addons/addon-ligatures/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ fonts/
1010
*.swp
1111
*.tgz
1212
npm-debug.log*
13-
yarn-error.log*

addons/addon-serialize/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ See the full [API](https://github.com/xtermjs/xterm.js/blob/master/addons/addon-
3434
```shell
3535
$ git clone https://github.com/xtermjs/xterm.js.git
3636
$ cd xterm.js
37-
$ yarn
37+
$ npm ci
3838
$ cd addons/addon-serialize
39-
$ yarn benchmark && yarn benchmark-baseline
39+
$ npm run benchmark && npm run benchmark-baseline
4040
$ # change some code in `@xterm/addon-serialize`
41-
$ yarn benchmark-eval
41+
$ npm run benchmark-eval
4242
```

bin/install-addons.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ const addonsPath = path.join(PACKAGE_ROOT, 'addons');
1616
if (fs.existsSync(addonsPath)) {
1717
console.log('pulling addon dependencies...');
1818

19-
// whether to use yarn or npm
20-
let hasYarn = false;
21-
try {
22-
cp.execSync('yarn --version').toString();
23-
hasYarn = true;
24-
} catch(e) {}
25-
2619
// walk all addon folders
2720
fs.readdir(addonsPath, (err, files) => {
2821
for (const folder of files) {
@@ -43,11 +36,7 @@ if (fs.existsSync(addonsPath)) {
4336
)
4437
{
4538
console.log('Preparing', folder);
46-
if (hasYarn) {
47-
cp.execSync('yarn', {cwd: addonPath});
48-
} else {
49-
cp.execSync('npm install', {cwd: addonPath});
50-
}
39+
cp.execSync('npm ci', {cwd: addonPath});
5140
} else {
5241
console.log('Skipped', folder);
5342
}

0 commit comments

Comments
 (0)