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: .github/contributing.md
+25-22
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before
28
28
29
29
- If you are resolving a special issue, add `(fix #xxxx[,#xxxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `update entities encoding/decoding (fix #3899)`.
30
30
- Provide a detailed description of the bug in the PR. Live demo preferred.
31
-
- Add appropriate test coverage if applicable. You can check the coverage of your code addition by running `yarn test --coverage`.
31
+
- Add appropriate test coverage if applicable. You can check the coverage of your code addition by running `npm test -- --coverage`.
32
32
33
33
- It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging.
34
34
@@ -40,12 +40,14 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before
40
40
41
41
## Development Setup
42
42
43
-
You will need [Node.js](https://nodejs.org)**version 10+**, and [Yarn 1.x](https://yarnpkg.com/en/docs/install).
43
+
You will need [Node.js](https://nodejs.org)**version 10+**, and [PNPM](https://pnpm.io).
44
+
45
+
We also recommend installing [ni](https://github.com/antfu/ni) to help switching between repos using different package managers. `ni` also provides the handy `nr` command which running npm scripts easier.
44
46
45
47
After cloning the repo, run:
46
48
47
49
```bash
48
-
$ yarn# install the dependencies of the project
50
+
$ pnpm i# install the dependencies of the project
49
51
```
50
52
51
53
A high level overview of tools used:
@@ -57,18 +59,20 @@ A high level overview of tools used:
57
59
58
60
## Scripts
59
61
60
-
### `yarn build`
62
+
**The examples below will be using the `nr` command from the [ni](https://github.com/antfu/ni) package.** You can also use plain `npm run`, but you will need to pass all additional arguments after the command after an extra `--`. For example, `nr build runtime --all` is equivalent to `npm run build -- runtime --all`.
63
+
64
+
### `nr build`
61
65
62
66
The `build` script builds all public packages (packages without `private: true` in their `package.json`).
63
67
64
68
Packages to build can be specified with fuzzy matching:
65
69
66
70
```bash
67
71
# build runtime-core only
68
-
yarn build runtime-core
72
+
nr build runtime-core
69
73
70
74
# build all packages matching "runtime"
71
-
yarn build runtime --all
75
+
nr build runtime --all
72
76
```
73
77
74
78
#### Build Formats
@@ -91,13 +95,13 @@ More details about each of these formats can be found in the [`vue` package READ
91
95
For example, to build `runtime-core` with the global build only:
92
96
93
97
```bash
94
-
yarn build runtime-core -f global
98
+
nr build runtime-core -f global
95
99
```
96
100
97
101
Multiple formats can be specified as a comma-separated list:
98
102
99
103
```bash
100
-
yarn build runtime-core -f esm-browser,cjs
104
+
nr build runtime-core -f esm-browser,cjs
101
105
```
102
106
103
107
#### Build with Source Maps
@@ -112,12 +116,12 @@ The `--types` or `-t` flag will generate type declarations during the build and
112
116
- Generate an API report in `<projectRoot>/temp/<packageName>.api.md`. This report contains potential warnings emitted by [api-extractor](https://api-extractor.com/).
113
117
- Generate an API model json in `<projectRoot>/temp/<packageName>.api.json`. This file can be used to generate a Markdown version of the exported APIs.
114
118
115
-
### `yarn dev`
119
+
### `nr dev`
116
120
117
121
The `dev` script bundles a target package (default: `vue`) in a specified format (default: `global`) in dev mode and watches for changes. This is useful when you want to load up a build in an HTML page for quick debugging:
- The `dev` script also supports the `-s` flag for generating source maps, but it will make rebuilds slower.
131
135
132
-
### `yarn dev-compiler`
136
+
### `nr dev-compiler`
133
137
134
138
The `dev-compiler` script builds, watches and serves the [Template Explorer](https://github.com/vuejs/vue-next/tree/master/packages/template-explorer) at `http://localhost:5000`. This is extremely useful when working on the compiler.
135
139
136
-
### `yarn test`
140
+
### `nr test`
137
141
138
142
The `test` script simply calls the `jest` binary, so all [Jest CLI Options](https://jestjs.io/docs/en/cli) can be used. Some examples:
139
143
140
144
```bash
141
145
# run all tests
142
-
$ yarn test
143
-
144
-
# run tests in watch mode
145
-
$ yarn test --watch
146
+
$ nr test
146
147
147
148
# run all tests under the runtime-core package
148
-
$ yarntest runtime-core
149
+
$ nrtest runtime-core
149
150
150
151
# run tests in a specific file
151
-
$ yarntest fileName
152
+
$ nrtest fileName
152
153
153
154
# run a specific test in a specific file
154
-
$ yarntest fileName -t 'test name'
155
+
$ nrtest fileName -t 'test name'
155
156
```
156
157
158
+
The default `test` script includes the `--runInBand` jest flag to improve test stability, especially for the CSS transition related tests. When you are testing specific test specs, you can also run `npx jest` with flags directly to speed up tests (jest runs them in parallel by default).
159
+
157
160
## Project Structure
158
161
159
162
This repository employs a [monorepo](https://en.wikipedia.org/wiki/Monorepo) setup which hosts a number of associated packages under the `packages` directory:
@@ -174,7 +177,7 @@ This repository employs a [monorepo](https://en.wikipedia.org/wiki/Monorepo) set
174
177
175
178
-`compiler-ssr`: Compiler that produces render functions optimized for server-side rendering.
176
179
177
-
-`template-explorer`: A development tool for debugging compiler output. You can run `yarn dev template-explorer` and open its `index.html` to get a repl of template compilation based on current source code.
180
+
-`template-explorer`: A development tool for debugging compiler output. You can run `nr dev template-explorer` and open its `index.html` to get a repl of template compilation based on current source code.
178
181
179
182
A [live version](https://vue-next-template-explorer.netlify.com) of the template explorer is also available, which can be used for providing reproductions for compiler bugs. You can also pick the deployment for a specific commit from the [deploy logs](https://app.netlify.com/sites/vue-next-template-explorer/deploys).
180
183
@@ -194,7 +197,7 @@ This is made possible via several configurations:
194
197
195
198
- For TypeScript, `compilerOptions.path` in `tsconfig.json`
196
199
- For Jest, `moduleNameMapper` in `jest.config.js`
197
-
- For plain Node.js, they are linked using [Yarn Workspaces](https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/).
200
+
- For plain Node.js, they are linked using [PNPM Workspaces](https://pnpm.io/workspaces).
198
201
199
202
### Package Dependencies
200
203
@@ -245,7 +248,7 @@ Test coverage is continuously deployed at https://vue-next-coverage.netlify.app/
245
248
246
249
This project uses [tsd](https://github.com/SamVerschueren/tsd) to test the built definition files (`*.d.ts`).
247
250
248
-
Type tests are located in the `test-dts` directory. To run the dts tests, run `yarn test-dts`. Note that the type test requires all relevant `*.d.ts` files to be built first (and the script does it for you). Once the `d.ts` files are built and up-to-date, the tests can be re-run by simply running `yarn test-dts`.
251
+
Type tests are located in the `test-dts` directory. To run the dts tests, run `nr test-dts`. Note that the type test requires all relevant `*.d.ts` files to be built first (and the script does it for you). Once the `d.ts` files are built and up-to-date, the tests can be re-run by simply running `nr test-dts`.
Copy file name to clipboardexpand all lines: packages/template-explorer/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Live explorer for template compilation output.
4
4
5
5
To run:
6
6
7
-
-`yarn dev-compiler`
8
-
- When the compilation is done, in another terminal run `yarn open`
7
+
-`npm run dev-compiler` in repo root
8
+
- When the compilation is done, in another terminal run `npm run open`
9
9
10
10
Note: `index.html` uses CDN for dependencies and is continuously deployed at [https://vue-next-template-explorer.netlify.com/](https://vue-next-template-explorer.netlify.com/). For local development, use the scripts above.
0 commit comments