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
You may need to authenticate with GitHub Packages. See [GitHub Packages authentication](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages).
View the component documentation on Chromatic (URL available after setup).
57
61
58
-
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`
62
+
### Storybook Composition
59
63
60
-
## Linting and bundling
64
+
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`.
69
+
const config:StorybookConfig= {
70
+
// ... your existing config
71
+
refs: {
72
+
'ui-library': {
73
+
title: 'Lagoon UI Library',
74
+
url: 'https://<branch>--<app-id>.chromatic.com/', // Get URL from Chromatic dashboard
75
+
},
76
+
},
77
+
};
65
78
66
-
To adhere to formatting rules, run `npmrunformat`.
79
+
exportdefaultconfig;
80
+
```
67
81
68
-
To configure the linter config, refer to eslint.config.js at the root of the project.
82
+
## CI/CD
69
83
70
-
### Bundling 📦
84
+
### Automated Workflows
71
85
72
-
After making changes to the source files, make sure to run `npmrunbundle` command which empties the dist folder and generates updated code for components.
86
+
| Workflow | Trigger | Actions |
87
+
|----------|---------|---------|
88
+
|**CI**| Push to main, PRs | Type check, lint, format check, build, build Storybook |
89
+
|**Publish**| GitHub Release published | All CI checks + publish to GitHub Packages |
90
+
|**Chromatic**| Push to main, PRs | Deploy Storybook to Chromatic (when token configured) |
73
91
74
-
## Viewing storybook 👀
92
+
### Publishing a New Version
75
93
76
-
- Clone this repo
77
-
- Run `npmi&&npmrunstorybook`
78
-
- Visit `http://localhost:6006/`
94
+
1. Update version in `package.json`
95
+
2. Commit and push to main
96
+
3. Create a GitHub Release with a new tag (e.g., `v2.1.0`)
97
+
4. The publish workflow automatically builds and publishes to GitHub Packages
It is recommended to build components in isolation with the help of storybook (currently V 9.0).
@@ -106,18 +126,20 @@ The project structure is as follows:
106
126
107
127
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