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
+32-9Lines changed: 32 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,32 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before
17
17
18
18
## Pull Request Guidelines
19
19
20
-
- Checkout a topic branch from a base branch, e.g. `main`, and merge back against that branch.
20
+
### What kinds of Pull Requests are accepted?
21
+
22
+
- Bug fix that addresses a clearly identified bug. **"Clearly identified bug"** means the bug has a proper reproduction either from a related open issue, or is included in the PR itself. Avoid submitting PRs that claim to fix something but do not sufficiently explain what is being fixed.
23
+
24
+
- New feature that addresses a clearly explained and widely applicable use case. **"Widely applicable"** means the new feature should provide non-trivial improvements to the majority of the user base. Vue already has a large API surface so we are quite cautious about adding new features - if the use case is niche and can be addressed via userland implementations, it likely isn't suitable to go into core.
25
+
26
+
The feature implementation should also consider the trade-off between the added complexity vs. the benefits gained. For example, if a small feature requires significant changes that spreads across the codebase, it is likely not worth it, or the approach should be reconsidered.
27
+
28
+
If the feature has a non-trivial API surface addition, or significantly affects the way a common use case is approached by the users, it should go through a discussion first in the [RFC repo](https://github.com/vuejs/rfcs/discussions). PRs of such features without prior discussion make it really difficult to steer / adjust the API design due to coupling with concrete implementations, and can lead to wasted work.
29
+
30
+
- Chore: typos, comment improvements, build config, CI config, etc. For typos and comment changes, try to combine multiple of them into a single PR.
31
+
32
+
-**It should be noted that we discourage contributors from submitting code refactors that are largely stylistic.** Code refactors are only accepted if it improves performance, or comes with sufficient explanations on why it objectively improves the code quality (e.g. makes a related feature implementation easier).
33
+
34
+
The reason is that code readability is subjective. The maintainers of this project have chosen to write the code in its current style based on our preferences, and we do not want to spend time explaining our stylistic preferences. Contributors should just respect the established conventions when contributing code.
35
+
36
+
Another aspect of it is that large scale stylistic changes result in massive diffs that touch multiple files, adding noise to the git history and makes tracing behavior changes across commits more cumbersome.
37
+
38
+
39
+
### Pull Request Checklist
40
+
41
+
- Vue core has two primary work branches: `main` and `minor`.
42
+
43
+
- If your pull request is a feature that adds new API surface, it should be submitted against the `minor` branch.
44
+
45
+
- Otherwise, it should be submitted against the `main` branch.
21
46
22
47
-[Make sure to tick the "Allow edits from maintainers" box](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork). This allows us to directly make minor edits / refactors and saves a lot of time.
23
48
@@ -57,9 +82,9 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before
57
82
58
83
## Development Setup
59
84
60
-
You will need [Node.js](https://nodejs.org)**version 16+**, and [PNPM](https://pnpm.io)**version 7+**.
85
+
You will need [Node.js](https://nodejs.org)**version 18.12+**, and [PNPM](https://pnpm.io)**version 8+**.
61
86
62
-
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.
87
+
We also recommend installing [@antfu/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.
63
88
64
89
After cloning the repo, run:
65
90
@@ -82,11 +107,11 @@ The project uses [simple-git-hooks](https://github.com/toplenboren/simple-git-ho
82
107
83
108
- Type check the entire project
84
109
- Automatically format changed files using Prettier
85
-
- Verify commit message format (logic in `scripts/verifyCommit.js`)
110
+
- Verify commit message format (logic in `scripts/verify-commit.js`)
86
111
87
112
## Scripts
88
113
89
-
**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`.
114
+
**The examples below will be using the `nr` command from the [@antfu/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`.
90
115
91
116
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".
92
117
@@ -181,11 +206,11 @@ Shortcut for starting the SFC Playground in local dev mode. This provides the fa
181
206
182
207
### `nr dev-esm`
183
208
184
-
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.
209
+
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 reproduction that requires real build setups: link `packages/vue` globally, then link it into the project being debugged.
185
210
186
211
### `nr dev-compiler`
187
212
188
-
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.
213
+
The `dev-compiler` script builds, watches and serves the [Template Explorer](https://github.com/vuejs/core/tree/main/packages/template-explorer) at `http://localhost:3000`. This is useful when working on pure compiler issues.
189
214
190
215
### `nr test`
191
216
@@ -248,8 +273,6 @@ This repository employs a [monorepo](https://en.wikipedia.org/wiki/Monorepo) set
248
273
249
274
-`template-explorer`: A development tool for debugging compiler output, continuously deployed at https://template-explorer.vuejs.org/. To run it locally, run [`nr dev-compiler`](#nr-dev-compiler).
250
275
251
-
-`size-check`: Used for checking built bundle sizes on CI.
252
-
253
276
### Importing Packages
254
277
255
278
The packages can import each other directly using their package names. Note that when importing a package, the name listed in its `package.json` should be used. Most of the time the `@vue/` prefix is needed:
0 commit comments