You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,9 +44,9 @@ You can find [tasks with the "Good first issue" label in the issue tracker :pray
44
44
45
45
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/`.
46
46
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/).
48
48
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.
50
50
51
51
### Documentation Guide
52
52
@@ -84,13 +84,13 @@ To name the example file:
84
84
- For interactive example, begin with either `interactive_` or `selection_`.
85
85
- For examples that are only for regression test, begin with `test_`.
86
86
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.
88
88
89
89
**Notes:**
90
90
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`.)
94
94
95
95
# Development Guide
96
96
@@ -102,12 +102,12 @@ After you push a new branch to GitHub, the CI will automatically run `yarn build
102
102
brew install node
103
103
```
104
104
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:
106
106
107
107
```sh
108
108
git clone https://github.com/vega/vega-lite.git
109
109
cd vega-lite
110
-
yarn
110
+
npm install
111
111
```
112
112
113
113
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
176
176
177
177
### Build
178
178
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`.
180
180
181
181
### Basic Lint & Test & Test Coverage
182
182
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.
184
184
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.
186
186
187
187
### Watch tasks
188
188
189
189
During development, it can be convenient to rebuild automatically or to run tests in the background. You can use:
190
190
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.
192
192
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/`.
194
194
195
195
### Website
196
196
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).
198
198
199
199
### Publishing
200
200
@@ -213,11 +213,11 @@ We use the [Visual Studio Code](https://code.visualstudio.com/) editor.
213
213
214
214
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).
215
215
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.
217
217
218
218
## Pull Requests and Continuous Integration (CI)
219
219
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.
0 commit comments