|
| 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. |
0 commit comments