Skip to content

Commit 2cfa348

Browse files
LFDanLudannifysnowystinger
authored
Adding section to Contribute explaining plop (#2082)
* adding section explaining plop * addressing review comments Co-authored-by: Danni <[email protected]> Co-authored-by: Robert Snow <[email protected]>
1 parent 7df3bcb commit 2cfa348

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

CONTRIBUTING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,32 @@ Or run the documentation and browse to [http://localhost:1234/](http://localhost
7777
yarn start:docs
7878
```
7979

80+
### Component/Hook scaffolding
81+
If you are looking to contribute a brand new component or Hook in a package that does not exist yet, please run the following command.
82+
```bash
83+
yarn plop
84+
```
85+
This will start a series of cli prompts to determine what template files and folders should be generated to help quick start your contribution.
86+
The prompts are as follows:
87+
88+
1. What type of project are you setting up?
89+
- Select "React Spectrum v3"
90+
91+
2. Scope name(s)
92+
- Select the package scopes that make sense for your contribution (e.g. react-spectrum if you are contributing a component, react-aria for an aria Hook, etc)
93+
94+
3. Package name, all lowercase (e.g. textfield)
95+
96+
4. Component name, please use appropriate uppercase (e.g. TextField)
97+
- If you are contributing a non-component Hook, just enter the name of your Hook.
98+
99+
5. Component css module name, blank if N/A. If unsure, check @adobe/spectrum-css-temp/components for a module containing the desired css (e.g. textfield)
100+
- If you cannot find the component CSS module name in @adobe/spectrum-css-temp/components, feel free to reach out to a team member via GitHub Issues or Discussions.
101+
102+
Upon answering all the prompts, the appropriate package(s) should be generated and ready for modification.
103+
104+
**Note:** With regards to the generated docs files, please feel free to remove them if you won't be contributing docs. If you are contributing docs for a new component or Hook, please submit them in a separate pull request so that we can decide when to deploy them to our docs site.
105+
80106
### Tests
81107
We use [jest](https://jestjs.io/) for unit tests and [react-testing-library](https://testing-library.com/docs/react-testing-library/intro) for rendering and writing assertions. Please make sure you include tests with your pull requests. Our CI will run the tests on PRs as well as the linter and type checker. You can see on each PR whether you have passed all our checks. We split the tests into 2 groups.
82108

0 commit comments

Comments
 (0)