Skip to content

Commit 1855a7f

Browse files
chore: fixes a small typo and prettifies the document (#778)
1 parent e828d0b commit 1855a7f

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

.github/contributing.md

+17-11
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before
1919
- Checkout a topic branch from a base branch, e.g. `master`, and merge back against that branch.
2020

2121
- If adding a new feature:
22+
2223
- Add accompanying test case.
2324
- Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it.
2425

2526
- If fixing bug:
27+
2628
- 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)`.
2729
- Provide a detailed description of the bug in the PR. Live demo preferred.
2830
- Add appropriate test coverage if applicable. You can check the coverage of your code addition by running `yarn test --coverage`.
@@ -41,7 +43,7 @@ You will need [Node.js](http://nodejs.org) **version 10+**, and [Yarn](https://y
4143

4244
After cloning the repo, run:
4345

44-
``` bash
46+
```bash
4547
$ yarn # install the dependencies of the project
4648
```
4749

@@ -60,7 +62,7 @@ The `build` script builds all public packages (packages without `private: true`
6062

6163
Packages to build can be specified with fuzzy matching:
6264

63-
``` bash
65+
```bash
6466
# build runtime-core only
6567
yarn build runtime-core
6668

@@ -73,10 +75,12 @@ yarn build runtime --all
7375
By default, each package will be built in multiple distribution formats as specified in the `buildOptions.formats` field in its `package.json`. These can be overwritten via the `-f` flag. The following formats are supported:
7476

7577
- **`global`**:
78+
7679
- For direct use via `<script>` in the browser. The global variable exposed is specified via the `buildOptions.name` field in a package's `package.json`.
7780
- Note: global builds are not [UMD](https://github.com/umdjs/umd) builds. Instead they are built as [IIFEs](https://developer.mozilla.org/en-US/docs/Glossary/IIFE).
7881

7982
- **`esm-bundler`**:
83+
8084
- Leaves prod/dev branches with `process.env.NODE_ENV` guards (to be replaced by bundler)
8185
- Does not ship a minified build (to be done together with the rest of the code after bundling)
8286
- For use with bundlers like `webpack`, `rollup` and `parcel`.
@@ -85,6 +89,7 @@ By default, each package will be built in multiple distribution formats as speci
8589
- This means you **can** install/import these deps without ending up with different instances of these dependencies
8690

8791
- **`esm`**:
92+
8893
- For usage via native ES modules imports (in browser via `<script type="module">`, or via Node.js native ES modules support in the future)
8994
- Inlines all dependencies - i.e. it's a single ES module with no imports from other files
9095
- This means you **must** import everything from this file and this file only to ensure you are getting the same instance of code.
@@ -96,13 +101,13 @@ By default, each package will be built in multiple distribution formats as speci
96101

97102
For example, to build `runtime-core` with the global build only:
98103

99-
``` bash
104+
```bash
100105
yarn build runtime-core -f global
101106
```
102107

103108
Multiple formats can be specified as a comma-separated list:
104109

105-
``` bash
110+
```bash
106111
yarn build runtime-core -f esm,cjs
107112
```
108113

@@ -114,15 +119,15 @@ Use the `--sourcemap` or `-s` flag to build with source maps. Note this will mak
114119

115120
The `--types` or `-t` flag will generate type declarations during the build and in addition:
116121

117-
- Roll the declarations into a single `.dts` file for each package;
122+
- Roll the declarations into a single `.d.ts` file for each package;
118123
- Generate an API report in `<projectRoot>/temp/<packageName>.api.md`. This report contains potential warnings emitted by [api-extractor](https://api-extractor.com/).
119124
- 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.
120125

121126
### `yarn dev`
122127

123128
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:
124129

125-
``` bash
130+
```bash
126131
$ yarn dev
127132

128133
> rollup v1.19.4
@@ -139,7 +144,7 @@ $ yarn dev
139144

140145
The `yarn test` script simply calls the `jest` binary, so all [Jest CLI Options](https://jestjs.io/docs/en/cli) can be used. Some examples:
141146

142-
``` bash
147+
```bash
143148
# run all tests
144149
$ yarn test
145150

@@ -184,9 +189,11 @@ This repository employs a [monorepo](https://en.wikipedia.org/wiki/Monorepo) set
184189

185190
- **Note:** if re-exporting a function from `@vue/shared` as a public API, it is necessary to re-define its type before exporting so that the final `d.ts` doesn't attempt to import `@vue/shared`, e.g.:
186191

187-
``` ts
192+
```ts
188193
import { foo } from '@vue/shared'
189-
export const publicFoo = foo as { /* re-define type */ }
194+
export const publicFoo = foo as {
195+
/* re-define type */
196+
}
190197
```
191198

192199
- `vue`: The public facing "full build" which includes both the runtime AND the compiler.
@@ -195,7 +202,7 @@ This repository employs a [monorepo](https://en.wikipedia.org/wiki/Monorepo) set
195202

196203
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:
197204

198-
``` js
205+
```js
199206
import { h } from '@vue/runtime-core'
200207
```
201208

@@ -208,7 +215,6 @@ This is made possible via several configurations:
208215
### Package Dependencies
209216

210217
```
211-
212218
+---------------------+
213219
| |
214220
| @vue/compiler-sfc |

0 commit comments

Comments
 (0)