Skip to content

Commit fe1f24f

Browse files
starryeyez024kylebuch8
authored andcommitted
Suggested updates to documentation (#115)
1 parent 9a1dab9 commit fe1f24f

File tree

1 file changed

+45
-21
lines changed

1 file changed

+45
-21
lines changed

README.md

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,71 @@
11
# RHElements
22

3-
These are all the RHElements.
3+
Welcome to the RHElements project! Let's get started.
44

55
## Quick-start
66

7-
git clone [email protected]:RHElements/rhelements.git
8-
cd rhelements
9-
npm install # this will take a while due to lerna bootstrap
10-
npm start
7+
*Notice: You will need to use [Node](https://nodejs.org/en/) v.7 or higher. These components are written in [ES6](http://es6-features.org/).*
8+
9+
```
10+
$ git clone [email protected]:RHElements/rhelements.git
11+
$ cd rhelements
12+
$ npm install # this will take a while due to lerna bootstrap
13+
$ npm rebuild node-sass # this may be necessary
14+
$ npm start
15+
```
1116

1217
## Workflow
1318

14-
- **npm start** <br> launch a demo server
15-
- **npm test** <br> run tests on ALL rhelements
16-
- **npm run build** <br> run build on ALL rhelements
17-
- **npm run bootstrap** <br> update ALL rhelements' dependencies and interlink them with [lerna bootstrap][lerna-bs]
19+
- `$ npm start`
20+
- Launch a demo server. This should be continuously running as you develop.
21+
- `$ npm run dev`
22+
- Build a component.
23+
- `$ npm test`
24+
- Run tests on ALL rhelements.
25+
- `$ npm run build`
26+
- Run build on ALL rhelements.
27+
- `$ npm run bootstrap`
28+
- Update ALL rhelements' dependencies and interlink them with [lerna bootstrap][lerna-bs].
29+
- `$ npm run storybook`
30+
- Run storybook
1831

1932
[lerna]: https://github.com/lerna/lerna
2033
[lerna-bs]: https://github.com/lerna/lerna#bootstrap
2134

22-
## Component Development
35+
## Component development
2336

24-
Each component that you work on will need to be built for you to see the changes. Every component has a gulpfile and an npm script, `npm run dev`, that you can run on each component that you're working on. The `npm run dev` command will watch the files in the component's directory and will run the build command when you make changes to the component.
37+
Because this is a monorepo, each component will need to be independently built in order to actively work on and preview the changes. Every component has its own Gulp file and NPM script.
2538

26-
### Example Development on a component
39+
While still running `npm start` in one terminal window (which runs the local server), you will need to open another terminal window, drill into the directory of the component you'd like to work on, and execute the `npm run dev` command. This command will use gulp tasks to watch the files within that component directory and will automatically re-run the build command and refresh the browser when you make changes to the component.
40+
41+
### Example development on a component
2742

2843
```
29-
cd elements/rh-card
30-
npm run dev
44+
$ cd /Sites/rhelement
45+
$ npm start
46+
47+
# SHIFT + CTRL + T to open a new tab in Terminal
48+
49+
$ cd elements/rh-card # or any other component
50+
$ npm run dev
3151
```
3252

33-
Make any changes you need and the gulpfile will handle transpiling the element down to ES5 and will bring in the HTML template and Sass file into the template in the component.
53+
Make a change to the component and save. The gulpfile will handle transpiling the element down to ES5 and will bring in the HTML and Sass into the template in the component.
3454

35-
If you started the dev server at the root of RHElements, then you should be able to navigate to the demo page for the component, refresh the page, and see your changes.
55+
## Test
3656

3757
To test all RHElements, run `npm test` from the root of the repo. If you only want to test the component you're working on:
3858

39-
cd elements/rh-card
40-
npm test
59+
```
60+
$ cd elements/rh-card
61+
$ npm test # DOESN'T WORK
62+
```
4163

4264
Also, if your tests are failing and you want access to a live browser to investigate why, the following flag will keep the browser open.
4365

44-
npm test -- -p
66+
```
67+
$ npm test -- -p
68+
```
4569

4670
Then open the URL that will be printed in the terminal. It looks something like this: `http://localhost:8081/components/@rhelements/rhelements/generated-index.html?cli_browser_id=0`.
4771

@@ -52,15 +76,15 @@ We've added [Storybook](https://storybook.js.org/) to RHElements as a way to pre
5276
To run storybook
5377

5478
```
55-
npm run storybook
79+
$ npm run storybook
5680
```
5781

5882
This will start a web server on port 9001. Navigate in your browser to `http://localhost:9001` to see Storybook in action. Storybook will watch for file changes and reload the browser automatically for you. This is a little slow at the moment, but we'll look into speeding this up.
5983

6084
To export the storybook static site
6185

6286
```
63-
npm run build-storybook
87+
$ npm run build-storybook
6488
```
6589

6690
This places a build of the storybook site in the .storybook_out directory.

0 commit comments

Comments
 (0)