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:
C. Lewis 2021-08-09 11:21:16 -05:00 committed by GitHub
parent b60c943750
commit c9ff4c7989
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -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

View file

@ -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",