Skip to content

Commit 18cba77

Browse files
committed
docs: update CONTRIBUTING
1 parent 964e617 commit 18cba77

2 files changed

Lines changed: 31 additions & 33 deletions

File tree

CONTRIBUTING.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,40 @@ As artificial intelligence evolves, AI-generated code is becoming valuable for m
4646

4747
Please see our [guideline for AI-generated code contributions to SAP Open Source Software Projects](https://github.com/SAP/.github/blob/main/CONTRIBUTING_USING_GENAI.md) for these requirements.
4848

49+
## Development Setup
50+
51+
> **Before you start, read the [Development Conventions and Guidelines](/docs/Guidelines.md)** for commit message format, naming conventions, and coding standards.
52+
53+
### Prerequisites
54+
55+
- [Node.js](https://nodejs.org/) (see `.nvmrc` for the required version)
56+
- [Yarn](https://yarnpkg.com/) v4 (managed via corepack, see `packageManager` in `package.json`)
57+
58+
### Getting Started
59+
60+
```bash
61+
git clone https://github.com/UI5/webcomponents-react.git
62+
cd webcomponents-react
63+
yarn install # installs dependencies and runs postinstall setup (husky + build:i18n/css/version-info)
64+
```
65+
66+
### Common Commands
67+
68+
```bash
69+
yarn start # Storybook at localhost:6006 (includes CSS watcher)
70+
yarn build # Full build (setup + tsc + client/wrapper builds)
71+
yarn test # Cypress component tests (all packages)
72+
yarn test:open # Cypress interactive mode
73+
yarn lint # ESLint
74+
```
75+
4976
### How to contribute - the Process
5077

5178
1. Please let us know, that you want to work on the issue you've filed in the [issue tracker](https://github.com/UI5/webcomponents-react/issues).
5279
2. If the issue is marked with the `contribution welcome` tag, we'll assign you right away, otherwise we will check if some more information our guidance is needed and only then assign you to it.
5380
3. Once you are assigned to the issue, you are ready to go.
5481
4. Fork the `ui5-webcomponents-react` repository into your GitHub account, create a branch and apply your change. Please don't work directly on the `main` branch of your fork. This will help to update your fork in the future more easily.
5582
5. Commit and push your change on that branch.
56-
Please follow our [Development Conventions and Guidelines](/docs/Guidelines.md).
5783
6. Create a pull request from your branch into `ui5-webcomponents-react`-`main` branch.
5884
7. Follow the link posted by the CLA assistant to your pull request and accept it, as described above.
5985
8. Wait for our code review and approval, possibly enhancing your change on request.

docs/Guidelines.md

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,8 @@
11
# Development Conventions and Guidelines
22

3-
## Requirements
4-
5-
- [Yarn](https://yarnpkg.com)
6-
- [Node.js](https://nodejs.org/) (**[LTS](https://github.com/nodejs/release?tab=readme-ov-file#release-schedule) version** ⚠️)
7-
8-
## Setup your local development environment
9-
10-
Please make sure you have installed a [LTS](https://github.com/nodejs/release?tab=readme-ov-file#release-schedule) `node` version (check by running `node -v`) and yarn v1 (check by running `yarn -v`).
11-
12-
First, you need to clone the git repository by running
13-
14-
```sh
15-
# this git url points to the original repository, you can exchange it with the address of your fork
16-
git clone https://github.com/UI5/webcomponents-react.git
17-
```
18-
19-
Then, go into that cloned directory and run `yarn install`. At this point, you are ready to start local development. You can now run:
20-
21-
- `yarn start` <br />
22-
This starts the local storybook, so you can check if your components are rendered correctly. _If the storybook doesn't open automatically after executing the command, you can use this link: http://localhost:6006/_
23-
- `yarn test` <br />
24-
This command is running all tests in the project.
25-
- `yarn test:open` <br />
26-
This command is opening all cypress tests in Chrome.
27-
- `yarn build` <br />
28-
This command executes the full build of the project.
29-
303
## TypeScript
314

32-
Please use TypeScript to write your components. A good introduction to TypeScript in React can be found [here](https://levelup.gitconnected.com/ultimate-react-component-patterns-with-typescript-2-8-82990c516935).
5+
All components must be written in TypeScript.
336

347
## Naming Convention for Props
358

@@ -38,12 +11,11 @@ Please use TypeScript to write your components. A good introduction to TypeScrip
3811
All Events must pass an instance of the `Event`-Class as single parameter.
3912
- When passing additional elements into a component, a slot should be used. This prop should contain a `ReactNode` or an array of ReactNodes (`ReactNode[]`)
4013

41-
You must follow the coding style as best you can when submitting code. Take note of naming conventions, separation of concerns, and formatting rules. You can use the code formatter [Prettier](https://prettier.io/) to handle some of this for you automatically.
42-
When you are finished with your implementation please run `yarn prettier:all`, this will auto format all files for you.
14+
Follow the coding style as best you can when submitting code. Take note of naming conventions, separation of concerns, and formatting rules. Prettier runs automatically as a pre-commit hook.
4315

44-
## Unit testing
16+
## Testing
4517

46-
All components should have associated unit tests created with a code coverage score of at least 80%. Be an overachiever and shoot for 100% :)
18+
All components should have associated Cypress component tests with a code coverage score of at least 80%.
4719

4820
## Git Guidelines
4921

0 commit comments

Comments
 (0)