Skip to content

Commit 64a867c

Browse files
committed
add docs
1 parent 9cf8ada commit 64a867c

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

packages/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# RMW Packages
2+
3+
### How to develop
4+
5+
To start developing any of the three `base-shell`, `material-ui-shell` or `rmw-shell` packages, you can go to any of the package directories and run:
6+
7+
```
8+
npm run dev
9+
```
10+
11+
You can then work on the `src/` folder or the `create-[package]-shell/template` folder to make changes. The `src/` folder contains the package logic, and the `template/` contains an App website to be displayed in the browser.
12+
13+
The `template` folder is also used for creating templates that are used to bootstrap new projects, like `npm create @ecronix/base-shell@latest`.
14+
15+
### Building and publishing the project
16+
17+
You can build a single package by running `npm run build`, update the version in the `package.json` file, and then publish it to npm by running `npm publish`.
18+
19+
But you should do this using Lerna, which will update the version of all packages, build them, and publish them to npm. To do this, run:
20+
21+
```
22+
npx lerna version --since master
23+
npx lerna run build --since master
24+
npx lerna publish from-package
25+
```
26+
27+
Usually these commands are run by the CI/CD pipeline, but you can run them locally if you want to test them.
28+
29+
#### Notes
30+
31+
- The `--since master` flag is used to only update the packages that have changed since the last commit on the `master` branch.
32+
33+
- When running `npx lerna publish from-package`, **DO NOT** commit the changes to the `package.json` files where the `gitHead` section is added. Remove all these changes by running:
34+
35+
```
36+
git checkout -- .
37+
```
38+
39+
### Testing templates
40+
41+
To test how the template is used in a new project, you can run:
42+
43+
```
44+
npx create @ecronix/[package]-shell@latest
45+
```
46+
47+
Do not do this if you want to change the visual appearance of the template. Instead, you should work on the `packages/[package]` folder directly as described in the first section.

0 commit comments

Comments
 (0)