feat(package.json): add contributor-friendly lifecycle scripts (#27825)
## Feature
I was struggling to get my local dev build working as a local package.json override, and types do not seem to be generated by `yarn dev`, so I had to figure out a cohesive way to build the project start-to-finish (and also clean the project).
Building the project and all types ended up just being `yarn prepublish`, here aliased as `yarn build`, and I added a `yarn clean` script. These two together should make it very difficult for any contributor to be confused how to generate a final build including all type declarations.
- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`
## Documentation / Examples
b2a888c144/contributing.md (building)
This commit is contained in:
parent
b60c943750
commit
c9ff4c7989
2 changed files with 16 additions and 1 deletions
|
@ -12,7 +12,20 @@ Read about our [Commitment to Open Source](https://vercel.com/oss).
|
|||
|
||||
> You may need to run `yarn types` again if your types get outdated.
|
||||
|
||||
To contribute to [our examples](examples), take a look at the [“Adding examples” section](#adding-examples).
|
||||
To contribute to [our examples](examples), take a look at the [“Adding examples”
|
||||
section](#adding-examples).
|
||||
|
||||
## Building
|
||||
|
||||
You can build the project, including all type definitions, with:
|
||||
|
||||
```bash
|
||||
yarn build
|
||||
# - or -
|
||||
yarn prepublish
|
||||
```
|
||||
|
||||
If you need to clean the project for any reason, use `yarn clean`.
|
||||
|
||||
## Adding warning/error descriptions
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
"packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"clean": "yarn lerna clean -y && yarn lerna bootstrap && yarn lerna exec 'rm -rf ./dist'",
|
||||
"build": "yarn prepublish",
|
||||
"lerna": "lerna",
|
||||
"dev": "lerna run dev --stream --parallel",
|
||||
"dev2": "while true; do yarn --check-files && yarn dev; done",
|
||||
|
|
Loading…
Reference in a new issue