You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
View the component documentation on Chromatic (URL available after setup).
78
80
79
-
The ui-library is bootstrapped with Vite and TS. To modify the configuration, edit `vite.config.ts` in the root directory; To modify TypeScript rules, refer to `tsconfig.app.json`
81
+
### Storybook Composition
80
82
81
-
## Linting and bundling
83
+
To include UI library stories in your project's Storybook, add to your `.storybook/main.ts`:
The linter is configured for both JS and TypeScript files. It runs during the build step but can also be ran during development by `npmrunlint`.
88
+
const config:StorybookConfig= {
89
+
// ... your existing config
90
+
refs: {
91
+
'ui-library': {
92
+
title: 'Lagoon UI Library',
93
+
url: 'https://<branch>--<app-id>.chromatic.com/', // Get URL from Chromatic dashboard
94
+
},
95
+
},
96
+
};
86
97
87
-
To adhere to formatting rules, run `npmrunformat`.
98
+
exportdefaultconfig;
99
+
```
88
100
89
-
To configure the linter config, refer to eslint.config.js at the root of the project.
101
+
## CI/CD
90
102
91
-
### Bundling 📦
103
+
### Automated Workflows
92
104
93
-
After making changes to the source files, make sure to run `npmrunbundle` command which empties the dist folder and generates updated code for components.
105
+
| Workflow | Trigger | Actions |
106
+
|----------|---------|---------|
107
+
|**CI**| Push to main, PRs | Type check, lint, format check, build, build Storybook |
108
+
|**Publish**| GitHub Release published | All CI checks + publish to NPM |
109
+
|**Chromatic**| Push to main, PRs | Deploy Storybook to Chromatic (when token configured) |
94
110
95
-
## Viewing storybook 👀
111
+
### Publishing a New Version
96
112
97
-
- Clone this repo
98
-
- Run `npmi&&npmrunstorybook`
99
-
- Visit `http://localhost:6006/`
113
+
1. Update version in `package.json`
114
+
2. Commit and push to main
115
+
3. Create a GitHub Release with a new tag (e.g., `v2.1.0`)
116
+
4. The publish workflow automatically builds and publishes to NPM
It is recommended to build components in isolation with the help of storybook (currently V 9.0).
@@ -127,18 +145,20 @@ The project structure is as follows:
127
145
128
146
Given that there's a storybook instance running, navigate to the `src` directory and modify/create new components with their respective `stories.tsx` files.
0 commit comments