Skip to content

Commit 28764a7

Browse files
domoritzGitHub Actions Bot
andauthored
chore: switch from yarn to npm (#9575)
Yarn is confusing to newcomers and doesn't provide as much value anymore. --------- Co-authored-by: GitHub Actions Bot <[email protected]>
1 parent 380eacc commit 28764a7

File tree

15 files changed

+12131
-6068
lines changed

15 files changed

+12131
-6068
lines changed

.github/PULL_REQUEST_TEMPLATE.md

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

66
- [ ] This PR is atomic (i.e., it fixes one issue at a time).
77
- [ ] The title is a concise [semantic commit message](https://www.conventionalcommits.org/) (e.g. "fix: correctly handle undefined properties").
8-
- [ ] `yarn test` runs successfully
8+
- [ ] `npm test` runs successfully
99
- For new features:
1010
- [ ] Has unit tests.
1111
- [ ] Has documentation under `site/docs/` + examples.

.github/workflows/check-toc.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ jobs:
2323
- name: Setup Node
2424
uses: actions/setup-node@v4
2525
with:
26-
cache: 'yarn'
26+
cache: 'npm'
2727
node-version: 20
2828

2929
- name: Install Node dependencies
30-
run: yarn --frozen-lockfile
30+
run: npm ci
3131

3232
- name: Setup Ruby
3333
uses: ruby/setup-ruby@v1
3434
with:
3535
ruby-version: '3.4'
3636

3737
- name: Setup data
38-
run: yarn data
38+
run: npm run data
3939

4040
- name: Build Jekyll
4141
run: |

.github/workflows/check.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ jobs:
1818
- name: Setup Node
1919
uses: actions/setup-node@v4
2020
with:
21-
cache: 'yarn'
21+
cache: 'npm'
2222
node-version: 20
2323

2424
- name: Install Node dependencies
25-
run: yarn --frozen-lockfile
25+
run: npm ci
2626

2727
- name: Setup data
28-
run: yarn data
28+
run: npm run data
2929

3030
- name: Install Parallel
3131
run: |
@@ -36,10 +36,10 @@ jobs:
3636
sudo mv parallel sem /usr/local/bin
3737
3838
- name: Format
39-
run: yarn format
39+
run: npm run format
4040

4141
- name: Build Schema
42-
run: yarn schema
42+
run: npm run schema
4343

4444
- name: Check Schema
4545
run: scripts/check-schema.sh

.github/workflows/release-docs-and-schema.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ jobs:
2525
- name: Setup Node
2626
uses: actions/setup-node@v4
2727
with:
28-
cache: 'yarn'
28+
cache: 'npm'
2929
node-version: 20
3030

3131
- name: Install Node dependencies
32-
run: yarn --frozen-lockfile
32+
run: npm ci
3333

3434
- name: Build
35-
run: yarn schema
35+
run: npm run schema
3636

3737
- name: Setup Git remote
3838
run: scripts/setup-git-ci.sh
@@ -61,17 +61,17 @@ jobs:
6161
- name: Setup Node
6262
uses: actions/setup-node@v4
6363
with:
64-
cache: 'yarn'
64+
cache: 'npm'
6565
node-version: 20
6666

6767
- name: Setup Pages
6868
uses: actions/configure-pages@v5
6969

7070
- name: Install Node dependencies
71-
run: yarn --frozen-lockfile
71+
run: npm ci
7272

7373
- name: Prebuild website
74-
run: yarn presite
74+
run: npm run presite
7575

7676
- name: Build with Jekyll
7777
uses: actions/jekyll-build-pages@v1

.github/workflows/test-docs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
pull_request:
66
paths:
77
- 'site/**'
8-
- 'yarn.lock'
8+
- 'package-lock.json'
99
- '**prettier**'
1010

1111
jobs:
@@ -19,14 +19,14 @@ jobs:
1919
- name: Setup Node
2020
uses: actions/setup-node@v4
2121
with:
22-
cache: 'yarn'
22+
cache: 'npm'
2323
node-version: 20
2424

2525
- name: Install Node dependencies
26-
run: yarn --frozen-lockfile
26+
run: npm ci
2727

2828
- name: Lint
29-
run: yarn prettier . --check
29+
run: npx prettier . --check
3030

3131
- name: Build
32-
run: yarn build:site
32+
run: npm run build:site

.github/workflows/test.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ jobs:
1818
- name: Setup Node
1919
uses: actions/setup-node@v4
2020
with:
21-
cache: 'yarn'
21+
cache: 'npm'
2222
node-version: 20
2323

2424
- name: Install Node dependencies
25-
run: yarn --frozen-lockfile
25+
run: npm ci
2626

2727
- name: Tests
28-
run: yarn vitest run test/
28+
run: npx vitest run test/
2929

3030
- name: Example tests
31-
run: yarn vitest run examples/
31+
run: npx vitest run examples/
3232

3333
- name: Build
34-
run: yarn build
34+
run: npm run build
3535

3636
runtime-lint-coverage:
3737
name: Runtime, Linting, and Coverage
@@ -43,32 +43,32 @@ jobs:
4343
- name: Setup Node
4444
uses: actions/setup-node@v4
4545
with:
46-
cache: 'yarn'
46+
cache: 'npm'
4747
node-version: 20
4848

4949
- name: Install Node dependencies
50-
run: yarn --frozen-lockfile
50+
run: npm ci
5151

5252
- name: Copy Data
53-
run: yarn data
53+
run: npm run data
5454

5555
- name: Set up playwright
56-
run: yarn playwright install chromium
56+
run: npx playwright install chromium
5757

5858
- name: Build
59-
run: yarn build:only
59+
run: npm run build:only
6060

6161
- name: Typechecks
62-
run: yarn tsc
62+
run: npx tsc
6363

6464
- name: Lint
65-
run: yarn lint
65+
run: npm run lint
6666

6767
- name: Runtime tests
68-
run: yarn test:runtime --browser.headless
68+
run: npm run test:runtime -- --browser.headless
6969

7070
- name: Test coverage
71-
run: yarn test:cover
71+
run: npm run test:cover
7272

7373
- name: Upload coverage to Codecov
7474
uses: codecov/[email protected]
@@ -90,14 +90,14 @@ jobs:
9090
- name: Setup Node
9191
uses: actions/setup-node@v4
9292
with:
93-
cache: 'yarn'
93+
cache: 'npm'
9494
node-version: 20
9595

9696
- name: Install Node dependencies
97-
run: yarn --frozen-lockfile
97+
run: npm ci
9898

9999
- name: Build
100-
run: yarn build:only
100+
run: npm run build:only
101101

102102
- name: Compile Vega
103103
run: |

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ _site/
33
!site/examples/index.md
44
.DS_Store
55
.jekyll-metadata
6-
.yarnclean
76
build/*
87
coverage
98
examples/all-examples.json
@@ -18,5 +17,3 @@ site/static/bundle.*
1817
test/log
1918
test/log/difflist.json
2019
test-runtime/__screenshots__
21-
yarn-debug.log*
22-
yarn-error.log*

.release-it.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"release": true
99
},
1010
"hooks": {
11-
"after:bump": "yarn build"
11+
"after:bump": "npm build"
1212
},
1313
"plugins": {
1414
"@release-it/conventional-changelog": {

CONTRIBUTING.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ You can find [tasks with the "Good first issue" label in the issue tracker :pray
4444

4545
The website is under `site/` and the documentation is under `site/docs/`. We use GitHub Pages to publish our documentation when we release a new version. To contribute changes to the documentation or website, simply submit a pull request that changes the corresponding markdown files in `site/`.
4646

47-
Since we only publish the GitHub Pages when we release a new version, it might be slightly outdated compared to `main`. For development, once you have [setup the repository](#repository-setup), you can run `yarn site` to serve the GitHub page locally at [http://localhost:4000/vega-lite/](http://localhost:4000/vega-lite/).
47+
Since we only publish the GitHub Pages when we release a new version, it might be slightly outdated compared to `main`. For development, once you have [setup the repository](#repository-setup), you can run `npm run site` to serve the GitHub page locally at [http://localhost:4000/vega-lite/](http://localhost:4000/vega-lite/).
4848

49-
Note that when you checkout different branches, the compiled JavaScript for the website might be reset. You might have to run `yarn build:site` to recompile the JavaScript so that interactive examples work.
49+
Note that when you checkout different branches, the compiled JavaScript for the website might be reset. You might have to run `npm run build:site` to recompile the JavaScript so that interactive examples work.
5050

5151
### Documentation Guide
5252

@@ -84,13 +84,13 @@ To name the example file:
8484
- For interactive example, begin with either `interactive_` or `selection_`.
8585
- For examples that are only for regression test, begin with `test_`.
8686

87-
After you push a new branch to GitHub, the CI will automatically run `yarn build:examples` to recompile all examples and push the changed Vega specs and SVG files in `examples/compiled` , so that your branch includes these changes. When you add a new example or update the code, you may run `yarn build:examples` or `yarn build:example <examplename>` (e.g., `yarn build:example bar_1d`) to see the change locally. However, do **not** include these changes in your commit as different systems produce slightly different SVGs (mainly due to floating point differences). To avoid unnecessary SVG diffs, we should just let the CI generate the images. You're still encouraged to run `yarn build:examples` to make sure that your code does not cause unnecessary changes.
87+
After you push a new branch to GitHub, the CI will automatically run `npm run build:examples` to recompile all examples and push the changed Vega specs and SVG files in `examples/compiled` , so that your branch includes these changes. When you add a new example or update the code, you may run `npm run build:examples` or `npm run build:example <examplename>` (e.g., `npm run build:example bar_1d`) to see the change locally. However, do **not** include these changes in your commit as different systems produce slightly different SVGs (mainly due to floating point differences). To avoid unnecessary SVG diffs, we should just let the CI generate the images. You're still encouraged to run `npm run build:examples` to make sure that your code does not cause unnecessary changes.
8888

8989
**Notes:**
9090

91-
1. `yarn build:examples` only re-compile SVGs if the output Vega file changes (so it runs way faster). If you want to enforce re-compilation of all SVGs, use `yarn build:examples-full`.
92-
2. To make Travis run `yarn build:examples-full`, include `[SVG]` in your commit message of the last commit in your branch.
93-
3. To run `yarn build:examples`, you need to install [gnu parallel](https://www.gnu.org/software/parallel/). (For Mac, you can simply do `brew install parallel`.)
91+
1. `npm run build:examples` only re-compile SVGs if the output Vega file changes (so it runs way faster). If you want to enforce re-compilation of all SVGs, use `npm run build:examples-full`.
92+
2. To make the CI run `npm run build:examples-full`, include `[SVG]` in your commit message of the last commit in your branch.
93+
3. To run `npm run build:examples`, you need to install [gnu parallel](https://www.gnu.org/software/parallel/). (For Mac, you can simply do `brew install parallel`.)
9494

9595
# Development Guide
9696

@@ -102,12 +102,12 @@ After you push a new branch to GitHub, the CI will automatically run `yarn build
102102
brew install node
103103
```
104104

105-
2. Clone this repository and cd into your local clone of the repository, and install all the npm dependencies. We use [yarn](https://yarnpkg.com/) to have reproducible dependencies:
105+
2. Clone this repository and cd into your local clone of the repository, and install all the npm dependencies:
106106

107107
```sh
108108
git clone https://github.com/vega/vega-lite.git
109109
cd vega-lite
110-
yarn
110+
npm install
111111
```
112112

113113
Now you should be able to build and test the code.
@@ -176,25 +176,25 @@ This section lists commands that are commonly used during development. See `pack
176176

177177
### Build
178178

179-
You can run `yarn build` to compile Vega-Lite and regenerate `vega-lite-schema.json`.
179+
You can run `npm run build` to compile Vega-Lite and regenerate `vega-lite-schema.json`.
180180

181181
### Basic Lint & Test & Test Coverage
182182

183-
`yarn test` run linting and all unit-tests respectively. `yarn format` automatically fixes linting issues if possible.
183+
`npm test` run linting and all unit-tests respectively. `npm run format` automatically fixes linting issues if possible.
184184

185-
`yarn test:cover` includes test coverage and generates a report inside `coverage/index.html`. You can see if specific lines are covered in the unit test by running `open coverage/index.html` and browsing through the report.
185+
`npm run test:cover` includes test coverage and generates a report inside `coverage/index.html`. You can see if specific lines are covered in the unit test by running `open coverage/index.html` and browsing through the report.
186186

187187
### Watch tasks
188188

189189
During development, it can be convenient to rebuild automatically or to run tests in the background. You can use:
190190

191-
- `yarn watch` to start a watcher task that **re-compiles Vega-Lite** when `.ts` files related to VL change.
191+
- `npm run watch` to start a watcher task that **re-compiles Vega-Lite** when `.ts` files related to VL change.
192192

193-
To automatically run tests when files change, run `yarn vitest`. You can also run specific tests like the runtime tests with `yarn vitest test-runtime/`.
193+
To automatically run tests when files change, run `npx vitest`. You can also run specific tests like the runtime tests with `npx vitest test-runtime/`.
194194

195195
### Website
196196

197-
`yarn site`. See details in [Documentation and Website](#documentation-and-website).
197+
`npm run site`. See details in [Documentation and Website](#documentation-and-website).
198198

199199
### Publishing
200200

@@ -213,11 +213,11 @@ We use the [Visual Studio Code](https://code.visualstudio.com/) editor.
213213

214214
To manually test your changes locally, you should have a local instance of [Vega Editor](https://github.com/vega/editor) and link Vega-Lite to the editor (See [Vega Editor's README](https://github.com/vega/editor#local-testing--debugging) for instructions).
215215

216-
To update the Vega-Lite code in the editor, you need to compile TypeScript to JavaScript. The easiest way is to run `yarn watch` in the Vega-Lite directory. This command will automatically recompile the code whenever you make changes.
216+
To update the Vega-Lite code in the editor, you need to compile TypeScript to JavaScript. The easiest way is to run `npm run watch` in the Vega-Lite directory. This command will automatically recompile the code whenever you make changes.
217217

218218
## Pull Requests and Continuous Integration (CI)
219219

220-
All pull requests will be tested on [GitHub Actions](https://github.com/features/actions). If your PR does not pass the checks, your PR will not be approved. The CI will run `yarn test`, generate Vega specs and SVG files from your updated code, compare them with the existing compiled outputs in `examples/compiled/`, and check code coverage of your code. If you don't want your PR reviewed until checks pass, mark the [pull request as draft](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests#draft-pull-requests). Once you're ready for review, convert the pull request to mark it as ready for review.
220+
All pull requests will be tested on [GitHub Actions](https://github.com/features/actions). If your PR does not pass the checks, your PR will not be approved. The CI will run `npm test`, generate Vega specs and SVG files from your updated code, compare them with the existing compiled outputs in `examples/compiled/`, and check code coverage of your code. If you don't want your PR reviewed until checks pass, mark the [pull request as draft](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests#draft-pull-requests). Once you're ready for review, convert the pull request to mark it as ready for review.
221221

222222
### Code Coverage
223223

examples/compiled/vega_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
vega: 6.0.0
1+
vega: 6.1.2

0 commit comments

Comments
 (0)