|
3 | 3 | ### Checkin
|
4 | 4 |
|
5 | 5 | - Do checkin source (src)
|
6 |
| -- Do checkin build output (lib) |
7 |
| -- Do checkin runtime node_modules |
8 |
| -- Do not checkin devDependency node_modules (husky can help see below) |
| 6 | +- Do checkin a single index.js file after running `ncc` |
| 7 | +- Do not checking node_modules |
9 | 8 |
|
10 |
| -### devDependencies |
| 9 | +### NCC |
11 | 10 |
|
12 |
| -In order to handle correctly checking in node_modules without devDependencies, we run [Husky](https://github.com/typicode/husky) before each commit. |
13 |
| -This step ensures that formatting and checkin rules are followed and that devDependencies are excluded. To make sure Husky runs correctly, please use the following workflow: |
| 11 | +In order to avoid uploading `node_modules` to the repository, we use [zeit/ncc](https://github.com/zeit/ncc) to create a single `index.js` file that gets saved in `dist/`. |
14 | 12 |
|
| 13 | +If you're developing locally you can run |
15 | 14 | ```
|
16 |
| -npm install # installs all devDependencies including Husky |
17 |
| -git add abc.ext # Add the files you've changed. This should include files in src, lib, and node_modules (see above) |
18 |
| -git commit -m "Informative commit message" # Commit. This will run Husky |
| 15 | +npm install |
| 16 | +tsc |
| 17 | +ncc build |
19 | 18 | ```
|
| 19 | +You can also do |
| 20 | +``` |
| 21 | +npm run-script build # runs tsc |
| 22 | +npm run-script format # runs prettier --write |
| 23 | +npm run-script format-check # runs prettier --check |
| 24 | +npm run-script test # runs jest |
| 25 | +npm run-script release # runs ncc build |
| 26 | +``` |
| 27 | + |
| 28 | +Any files generated using `tsc` will be added to `lib/*`, however those files also are not uploaded to the repository and are excluded using `.gitignore`. |
| 29 | + |
| 30 | +### Testing |
| 31 | + |
| 32 | +Tests are included under `_tests_/*` and can be run using `npm run-script test`. |
20 | 33 |
|
21 |
| -During the commit step, Husky will take care of formatting all files with [Prettier](https://github.com/prettier/prettier) as well as pruning out devDependencies using `npm prune --production`. |
22 |
| -It will also make sure these changes are appropriately included in your commit (no further work is needed) |
| 34 | +We ask that you include a link to a successful run that utilizes the changes you are working on. For example, if your changes are in the branch `newAwesomeFeature`, then show an example run that uses `setup-python@newAwesomeFeature` or `my-fork@newAwesomeFeature`. This will help speed up testing and help us confirm that there are no breaking changes or bugs. |
0 commit comments