|
1 | 1 | # Contributing Guide
|
| 2 | + |
| 3 | +## General |
2 | 4 | 1. Make sure you have read and understand the **Goals** section to be aligned with project goals.
|
3 | 5 | 2. Before submitting a PR please comment in the relevant issue (or create a new one if it doesn't exist yet) to discuss all the requirements (this will prevent rejecting the PR and wasting your work).
|
4 |
| -3. All workflow scripts (prettier, linter, tests) must pass successfully. |
5 |
| -4. Don't edit `README.md` directly - it is built using `sh ./generate.sh` script to inject code snippets from the sources in the `/playground` folder (this will make sure all code examples are nicely formatted and working) |
6 |
| - - To make changes in `README.md` edit `.md` files that are located in the `/docs/markdown` folder |
7 |
| - - To make changes in code snippets edit source files in `/playground` folder |
8 |
| - - include directives look like this: `::[example|usage]='../../playground/src/components/sfc-counter.tsx'::` |
9 |
| -5. When submitting a PR please make sure that you run the following: |
10 |
| -```bash |
11 |
| -# run linter in `/playground` folder |
12 |
| -npm run lint |
| 6 | +3. All workflow scripts (prettier, linter, tests) must pass successfully (it is run automatically on CI and will fail on github checks). |
| 7 | + |
| 8 | +## PR Checklist |
| 9 | +- generate a new `README.md` from `README_SOURCE.md` using command: |
| 10 | +``` |
| 11 | +sh ./generate-readme.sh |
13 | 12 |
|
14 |
| -# run type-checking in `/playground` folder |
15 |
| -npm run tsc |
| 13 | +# or if you don't like bash, simply use node.js |
| 14 | +# node ./generate-readme.js |
| 15 | +``` |
| 16 | + |
| 17 | +## `README.md` and `README_SOURCE.md` |
| 18 | +Don't edit `README.md` directly - it is generated automatically from `README_SOURCE.md` using script. |
| 19 | + - Use `sh ./generate-readme.sh` script to generate updated `README.md` (this will inject code examples using type-checked source files from the `/playground` folder) |
| 20 | + - So to make changes in code examples edit source files in `/playground` folder |
| 21 | + |
| 22 | +**Source code inject directives:** |
| 23 | +``` |
| 24 | +# Inject code block with highlighter |
| 25 | +::codeblock='playground/src/components/sfc-counter.tsx':: |
16 | 26 |
|
17 |
| -# always re-generate `README.md` from root folder |
18 |
| -sh ./generate.sh |
19 |
| -# don't like bash scripts? simply use node.js script |
20 |
| -# node ./generator/bin/generate-readme.js |
| 27 | +# Inject code block with highlighter and expander |
| 28 | +::expander='playground/src/components/sfc-counter.usage.tsx':: |
21 | 29 | ```
|
0 commit comments