Skip to content

Commit fe6d10b

Browse files
authored
Merge pull request #701 from TheMcnafaha/fix-contributing-file
Fix contributing file
2 parents ff605ff + 5100f82 commit fe6d10b

File tree

1 file changed

+48
-6
lines changed

1 file changed

+48
-6
lines changed

CONTRIBUTING.md

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Discussing the design up front helps to ensure that we're ready to accept your w
2727

2828
### 3. Fork this repo and create a branch.
2929

30-
- Hit the "Fork" button (top-right of the github repository).
30+
- Hit the "Fork" button (top-right of the GitHub repository).
3131

3232
![image](https://user-images.githubusercontent.com/1430726/95460679-ec014400-097d-11eb-9a7a-93e0262d37d9.png)
3333

@@ -65,6 +65,40 @@ pnpm dev
6565

6666
- Once you made some changes in either package (`headless` or `styled`) or the documentation website (`apps/website`), you will see them immediately reflected on the page.
6767

68+
Alternatively, if your only goal is to add a new component, or add new tests to an already existing component, you can run the component test server for significant speed improvements:
69+
70+
```shell
71+
pnpm dev.ct
72+
```
73+
74+
This mode is a lot more bare bones and requires more background knowledge to use effectively, so keep the following things in mind:
75+
76+
- Familiarize yourself with the following directory structure:
77+
78+
```shell
79+
apps/website/src/routes/docs/[KIT]/[COMPONENT]/examples/
80+
```
81+
82+
- This is the _only place_ where you can add files. So if you wanted to add an example called 'hero' to the headless select component, that file needs to have the following structure:
83+
84+
```shell
85+
apps/website/src/routes/docs/headless/select/examples/hero.tsx
86+
```
87+
88+
- Remember to follow the component test server's URL structure. The default message on the "home page" of the dev server is a reminder of how to use the address bar to view the file you want. By default it would have this structure:
89+
90+
```shell
91+
http://localhost:5173/[KIT]/[COMPONENT]/[FILE]
92+
```
93+
94+
- So if you wanted to see the hero example for the headless select you would go here:
95+
96+
```shell
97+
http://localhost:5173/headless/select/hero
98+
```
99+
100+
- TLDR: any file in 'apps/website/src/routes/docs/[KIT]/[COMPONENT]/examples/[FILE]' is served on '/[KIT]/[COMPONENT]/[FILE]'
101+
68102
Below is a list of other commands that you might find useful:
69103

70104
- Build the qwik-ui documentation:
@@ -93,13 +127,21 @@ pnpm preview.cloudflare
93127

94128
### 5. Make sure you add / modify tests
95129

96-
Run either command to make sure there aren't any errors.
130+
Run either command to make sure there aren't any errors. Both commands run the Playwright tests, but the second one will open Playwright in [UI mode](https://playwright.dev/docs/test-ui-mode)
97131

98132
```shell
99-
pnpm test.headless --skip-nx-cache
133+
pnpm test.pw.headless --skip-nx-cache
100134
```
101135

102-
This will set up the Cypress component testing GUI. Please refer to official Cypress [documentation](https://docs.cypress.io/guides/overview/why-cypress) for further assistance.
136+
```shell
137+
pnpm test.pw.headless --skip-nx-cache --ui
138+
```
139+
140+
Keep in mind that currently all tests use Playwright and use the following naming convention:
141+
142+
```shell
143+
component.test.ts
144+
```
103145

104146
### 6. Added a "changeset"
105147

@@ -128,7 +170,7 @@ pnpm change
128170
**6.5.** Modify the created MD file
129171

130172
After the `change` command runs, a new MD file will be created under the `.changeset` folder.
131-
ד
173+
132174
Please modify this file to include a descriptive message of the changes you made.
133175

134176
You can even add code examples if you need do, to describe a new feature for example. (pun intended 😉)
@@ -166,7 +208,7 @@ Make sure you check the following checkbox "Allow edits from maintainers" -
166208
- Re-run the tests to ensure tests are still passing:
167209

168210
```shell
169-
pnpm test.headless --skip-nx-cache
211+
pnpm test.pw.headless --skip-nx-cache
170212
```
171213

172214
- Merge the `main` branch if your branch is out of date

0 commit comments

Comments
 (0)