Skip to content

Commit 3bb187f

Browse files
yyx990803zhangzhonghe
authored andcommitted
docs: add notes on more scripts in contribution guide
1 parent 7ee76a6 commit 3bb187f

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/contributing.md

+15-4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before
4747
- Consider the performance / size impact of the changes, and whether the bug being fixes justifies the cost. If the bug being fixed is a very niche edge case, we should try to minimize the size / perf cost to make it worthwhile.
4848

4949
- Is the code perf-sensitive (e.g. in "hot paths" like component updates or the vdom patch function?)
50+
5051
- If the branch is dev-only, performance is less of a concern.
5152

5253
- Check how much extra bundle size the change introduces.
@@ -77,6 +78,8 @@ A high level overview of tools used:
7778

7879
**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`.
7980

81+
The `run-s` and `run-p` commands found in some scripts are from [npm-run-all](https://github.com/mysticatea/npm-run-all) for orchestrating multiple scripts. `run-s` means "run in sequence" while `run-p` means "run in parallel".
82+
8083
### `nr build`
8184

8285
The `build` script builds all public packages (packages without `private: true` in their `package.json`).
@@ -152,9 +155,17 @@ $ nr dev
152155

153156
- The `dev` script supports the `-i` flag for inlining all deps. This is useful when debugging `esm-bundler` builds which externalizes deps by default.
154157

158+
### `nr dev-sfc`
159+
160+
Shortcut for starting the SFC Playground in local dev mode. This provides the fastest feedback loop when debugging issues that can be reproduced in the SFC Playground.
161+
162+
### `nr dev-esm`
163+
164+
Builds and watches `vue/dist/vue-runtime.esm-bundler.js` with all deps inlined using esbuild. This is useful when debugging the ESM build in a reproductions that require real build setups: link `packages/vue` globally, then link it into the project being debugged.
165+
155166
### `nr dev-compiler`
156167

157-
The `dev-compiler` script builds, watches and serves the [Template Explorer](https://github.com/vuejs/core/tree/main/packages/template-explorer) at `http://localhost:5000`. This is extremely useful when working on the compiler.
168+
The `dev-compiler` script builds, watches and serves the [Template Explorer](https://github.com/vuejs/core/tree/main/packages/template-explorer) at `http://localhost:5000`. This is useful when working on pure compiler issues.
158169

159170
### `nr test`
160171

@@ -231,18 +242,18 @@ This is made possible via several configurations:
231242
runtime-dom["@vue/runtime-dom"]
232243
runtime-core["@vue/runtime-core"]
233244
reactivity["@vue/reactivity"]
234-
245+
235246
subgraph "Runtime Packages"
236247
runtime-dom --> runtime-core
237248
runtime-core --> reactivity
238249
end
239-
250+
240251
subgraph "Compiler Packages"
241252
compiler-sfc --> compiler-core
242253
compiler-sfc --> compiler-dom
243254
compiler-dom --> compiler-core
244255
end
245-
256+
246257
vue ---> compiler-dom
247258
vue --> runtime-dom
248259
```

0 commit comments

Comments
 (0)