Skip to content

Commit c3b0977

Browse files
committedNov 2, 2021
add scripts overview, move docs and components, update readme
1 parent f6a3417 commit c3b0977

File tree

5 files changed

+105
-2
lines changed

5 files changed

+105
-2
lines changed
 

‎README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ npm run test
6868
- `test` runs your test suite with Web Test Runner
6969
- `format` runs linter and autoformatter
7070

71+
See the rest of [the scripts here](docs/SCRIPTS.md).
72+
7173
## Contributions
7274

7375
- 📥 Pull requests and 🌟 Stars are always welcome.
74-
- Read our [contributing guide](CONTRIBUTING.md) to get started.
76+
- Read our [contributing guide](docs/CONTRIBUTING.md) to get started.
File renamed without changes.
File renamed without changes.

‎docs/SCRIPTS.md

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Scripts
2+
3+
## `lint:eslint`
4+
5+
Lints the projects files with esLint.
6+
7+
## `format:eslint`
8+
9+
Formats the project files with esLint.
10+
11+
## `lint:prettier`
12+
13+
Lints the project files with prettier.
14+
15+
## `format:prettier`
16+
17+
Formats the project files with prettier.
18+
19+
## `lint`
20+
21+
Lints with both esLint and prettier.
22+
23+
## `format`
24+
25+
Formats with both esLint and prettier. Runs before each commit.
26+
27+
## `storybook`
28+
29+
Serves UI Library Storybook.
30+
31+
## `storybook:build`
32+
33+
Builds the storybook.
34+
35+
## `storybook:analyze`
36+
37+
Creates or updates the custom-elements.json file. Run to update the docs in storybook after adding documentation.
38+
39+
## `test`
40+
41+
Run test.
42+
43+
## `test:watch`
44+
45+
Run tests in watch mode.
46+
47+
## `build`
48+
49+
Build each package.
50+
51+
## `build:css`
52+
53+
Run postcss on the main stylesheet
54+
55+
## `build:prod`
56+
57+
Build for production. Clean the build files, lint, run tests, build each package separately.
58+
59+
## `clean`
60+
61+
Clean build artifacts in every package.
62+
63+
## `lerna:publish`
64+
65+
For automation use only.
66+
67+
## `lerna:version`
68+
69+
Bumps the versions of all the packages that have changed before. Cleans the package-lock.json and runs npm install to update the dependencies everywhere. Package-lock.json has to be committed after this script makes it's own commit, otherwise the auto-build and publishing will fail. Before running use `npm run diff` to see all the changes in the packages. Think carefully about wether you're introducing a breaking change. When in doubt follow the [semver spec](https://semver.org/). This script is for HQ use only, PRs that bump components versions will be rejected.
70+
71+
## `diff`
72+
73+
Diff the packages with the last published version.
74+
75+
## `lerna-fix`
76+
77+
Remove the lerna artifacts (`gitHead` field) from package.json of each component if publish script fails.
78+
79+
## `lerna:modify-package`
80+
81+
Add, modify or remove a filed in each package.json. Takes following args:
82+
83+
1: action type `'add' | 'remove'`
84+
2: key
85+
3: value (mandatory if you're adding or modifying the field)
86+
87+
Running this will add a homepage field to the package.json in every component. It it is already there it will change its value.
88+
89+
```zsh
90+
npm run lerna:modify-package add homepage https://github.com
91+
```
92+
93+
This will remove the homepage field from the package.json in each package.
94+
95+
```zsh
96+
npm run lerna:modify-package remove homepage
97+
```
98+
99+
## `bootstrap`
100+
101+
Generate `tsconfig` for each package.

‎scripts/modify-pkgjson.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const args = process.argv;
99
if (args.length <= 2) {
1010
console.error(`
1111
This script needs minimum two arguments.
12-
1: action type 'add' | 'remove' | 'modify'
12+
1: action type 'add' | 'remove'
1313
2: key
1414
3: value (optional)
1515

0 commit comments

Comments
 (0)
Please sign in to comment.