Reusable UI components for ARGO projects.
UIKit:
- Install dependencies:
npm ci
- Start watching:
npm run watch
Consumer project:
npm i <root_path_to_uikit>/dist --legacy-peer-deps
Notes:
- make sure to run
watch
first asdist
folder is used - assets will require a restart of watcher
- typescript changes often need vscode to restart the TS server
- avoid default exports for anything that needs to be used by 3rd party
react-testing-lib with Jest test runner see Button.test.tsx for example
npm run storybook
npm run build-storybook
creates static storybook build in./storybook-static
- creating a new component:
npm run create-component
npm run type-check
: trigger TypeScript type check for whole reponpm run type-check -- --watch
: runs the above with watch mode- Any
npm run type-check
triggerstsc
, so any flag layed out here can be used
- Any
- If using vscode (recommended),
tsc
can also be run as a task in the editor:Cmd+Shift+B
, then selecttsc:build - tsconfig.json
- This will report errors in vscode's
PROBLEMS
tab
- Increase
version
underuikit/package.release.json
-
Automated process (recommended)
- Merge that change to
develop
, and let the Jenkins pipeline handle it
- Merge that change to
-
Manual process (discouraged, but available)
- Run
npm run build-uikit
which performs the following: - Run
npm run publish-uikit
to publish latest version to npm
- Run
react/react-dom are needed as dependencies for storybook project does not work if they are just defined as peerDeps
Stories are written in the older storiesOf
style
https://github.com/storybookjs/storybook/blob/master/lib/core/docs/storiesOf.md
- No explicit export from module required
- Use a constant string for story name
- Stories can break easily when you use dynamic vars as story name
${__dirname}
(too many '/', diff OS)
- Stories can break easily when you use dynamic vars as story name