@aurelia/storybook 1.0.2 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/CONTINUITY.md +22 -0
  2. package/README.md +209 -162
  3. package/apps/hello-world/.storybook/main.ts +0 -1
  4. package/apps/hello-world/package-lock.json +4591 -2732
  5. package/apps/hello-world/package.json +12 -22
  6. package/apps/hello-world/src/components/feedback-form.html +111 -0
  7. package/apps/hello-world/src/components/feedback-form.ts +45 -0
  8. package/apps/hello-world/src/components/notification-center.html +119 -0
  9. package/apps/hello-world/src/components/notification-center.ts +27 -0
  10. package/apps/hello-world/src/components/stat-card.html +107 -0
  11. package/apps/hello-world/src/components/stat-card.ts +33 -0
  12. package/apps/hello-world/src/components/weather-widget.html +89 -0
  13. package/apps/hello-world/src/components/weather-widget.ts +30 -0
  14. package/apps/hello-world/src/hello-world.html +44 -2
  15. package/apps/hello-world/src/services/weather-service.ts +15 -0
  16. package/apps/hello-world/src/stories/feedback-form.stories.ts +52 -0
  17. package/apps/hello-world/src/stories/hello-world.stories.ts +4 -5
  18. package/apps/hello-world/src/stories/notification-center.stories.ts +81 -0
  19. package/apps/hello-world/src/stories/stat-card.stories.ts +65 -0
  20. package/apps/hello-world/src/stories/weather-widget.stories.ts +57 -0
  21. package/apps/hello-world/tsconfig.json +4 -3
  22. package/apps/hello-world/vite.config.ts +0 -2
  23. package/apps/hello-world-webpack/.storybook/main.ts +0 -1
  24. package/apps/hello-world-webpack/package-lock.json +3723 -913
  25. package/apps/hello-world-webpack/package.json +6 -9
  26. package/apps/hello-world-webpack/src/components/feedback-form.html +111 -0
  27. package/apps/hello-world-webpack/src/components/feedback-form.ts +45 -0
  28. package/apps/hello-world-webpack/src/components/notification-center.html +119 -0
  29. package/apps/hello-world-webpack/src/components/notification-center.ts +27 -0
  30. package/apps/hello-world-webpack/src/components/stat-card.html +107 -0
  31. package/apps/hello-world-webpack/src/components/stat-card.ts +33 -0
  32. package/apps/hello-world-webpack/src/components/weather-widget.html +89 -0
  33. package/apps/hello-world-webpack/src/components/weather-widget.ts +30 -0
  34. package/apps/hello-world-webpack/src/hello-world.html +44 -2
  35. package/apps/hello-world-webpack/src/services/weather-service.ts +15 -0
  36. package/apps/hello-world-webpack/src/stories/feedback-form.stories.ts +52 -0
  37. package/apps/hello-world-webpack/src/stories/hello-world.stories.ts +5 -6
  38. package/apps/hello-world-webpack/src/stories/notification-center.stories.ts +81 -0
  39. package/apps/hello-world-webpack/src/stories/stat-card.stories.ts +65 -0
  40. package/apps/hello-world-webpack/src/stories/weather-widget.stories.ts +57 -0
  41. package/apps/hello-world-webpack/tsconfig.json +1 -1
  42. package/dist/index.js +4 -11
  43. package/dist/index.js.map +1 -1
  44. package/dist/preset.js +2 -9
  45. package/dist/preset.js.map +1 -1
  46. package/dist/preview/render.js +4 -9
  47. package/dist/preview/render.js.map +1 -1
  48. package/dist/preview/types.js +0 -1
  49. package/dist/preview/types.js.map +1 -1
  50. package/dist/preview.js +4 -7
  51. package/dist/preview.js.map +1 -1
  52. package/dist/webpack.js +1 -3
  53. package/dist/webpack.js.map +1 -1
  54. package/package.json +16 -19
  55. package/rollup.config.mjs +4 -7
  56. package/src/preset.ts +1 -1
  57. package/tsconfig.json +1 -1
  58. package/apps/hello-world/.yarnrc.yml +0 -2
  59. package/apps/hello-world-webpack/.yarnrc.yml +0 -2
  60. package/dist/index.mjs +0 -132
  61. package/dist/index.mjs.map +0 -1
  62. package/dist/preset.mjs +0 -60
  63. package/dist/preset.mjs.map +0 -1
  64. package/dist/preview/render.mjs +0 -114
  65. package/dist/preview/render.mjs.map +0 -1
  66. package/dist/preview/types.mjs +0 -2
  67. package/dist/preview/types.mjs.map +0 -1
  68. package/dist/preview.mjs +0 -114
  69. package/dist/preview.mjs.map +0 -1
  70. package/dist/webpack.mjs +0 -21
  71. package/dist/webpack.mjs.map +0 -1
package/CONTINUITY.md ADDED
@@ -0,0 +1,22 @@
1
+ Goal (incl. success criteria):
2
+ - Address question about empty chunk generation during build; explain whether outputs are unnecessary and options.
3
+ Constraints/Assumptions:
4
+ - Use repo instructions in AGENTS.md; maintain this ledger.
5
+ - Build uses Rollup per-file entries from globbed src/**/*.ts.
6
+ Key decisions:
7
+ - None yet for empty chunk handling.
8
+ State:
9
+ - Identified empty chunk comes from type-only file src/preview/types.ts.
10
+ Done:
11
+ - Inspected rollup config and types file to confirm empty output cause.
12
+ Now:
13
+ - Provide explanation and possible ways to avoid generating empty JS file.
14
+ Next:
15
+ - If requested, change rollup config or file layout to suppress empty chunk.
16
+ Open questions (UNCONFIRMED if needed):
17
+ - Should we change build config to avoid empty chunk? UNCONFIRMED.
18
+ - Remove the untracked .DS_Store file? UNCONFIRMED.
19
+ Working set (files/ids/commands):
20
+ - CONTINUITY.md
21
+ - /Users/dwayne/Code/aurelia2-storybook/rollup.config.mjs
22
+ - /Users/dwayne/Code/aurelia2-storybook/src/preview/types.ts
package/README.md CHANGED
@@ -1,141 +1,136 @@
1
1
  # @aurelia/storybook
2
2
 
3
- > **Note:** Storybook support is currently in an early stage, and there may be bugs, issues, or unsupported features in this plugin. The intention is to make this plugin more production-ready when Aurelia 2 reaches stable release.
3
+ > **Note:** Storybook support is still early-stage. Expect a few rough edges while Aurelia 2 finishes its beta cycle, and please report anything that feels off.
4
4
 
5
- This package provides an integration between Aurelia 2 and Storybook 9 using Vite or Webpack. It lets you write and render Aurelia 2 components as Storybook stories with full support for Storybook controls, actions, and interactive testing.
5
+ `@aurelia/storybook` is the glue between Aurelia 2 components and Storybook 10. It wires Aurelia's `enhance()` API into Storybook's rendering pipeline so you can preview, test, and document your components with either the Vite or Webpack builders.
6
6
 
7
- ## Features
7
+ ## Compatibility at a Glance
8
8
 
9
- - **Vite & Webpack Support**: Works with both Vite (via `@storybook/builder-vite`) and Webpack 5 (via `@storybook/builder-webpack5`).
10
- - **Aurelia Enhancement**: Renders Aurelia 2 components using Aurelia's `enhance()` API.
11
- - **Storybook 9 Compatibility**: Fully compatible with Storybook 9's new rendering API.
12
- - **Arg & Action Support**: Use story args and actions as you would with any Storybook story.
9
+ | Item | Supported versions | Notes |
10
+ | --- | --- | --- |
11
+ | Storybook | 10.x (ESM) | Tested with 10.0.5+; works with `storybook dev`/`storybook build` commands. |
12
+ | Aurelia | 2.0.0-beta.25+ | Uses Aurelia's `enhance()` APIs under the hood. |
13
+ | Bundlers | `@storybook/builder-vite` (Vite 5) · `@storybook/builder-webpack5` | Pick whichever matches your app; both share the same Aurelia preview runtime. |
14
+ | Node.js | ≥ 20.19.0 or ≥ 22.12.0 | Matches the engines field in `package.json` and Storybook 10's baseline.
13
15
 
14
- ## Installation
16
+ ## Requirements
17
+
18
+ - An Aurelia 2 application (TypeScript or JavaScript) already set up with either Vite or Webpack.
19
+ - Storybook 10.x installed in the project. (Run `npx storybook@latest init` if you are starting fresh.)
20
+ - The peer dependencies listed in [`package.json`](package.json) that align with the Aurelia 2 beta train you are targeting.
15
21
 
16
- Install the plugin as a dev dependency:
22
+ ## Installation
17
23
 
18
24
  ```bash
19
- npm install --save-dev @aurelia/storybook
25
+ npm install --save-dev @aurelia/storybook storybook @storybook/builder-vite
26
+ # or, for Webpack builds:
27
+ npm install --save-dev @aurelia/storybook storybook @storybook/builder-webpack5
20
28
  ```
21
29
 
22
- Also, make sure to have the required dependencies installed in your project:
30
+ Add whichever addons you need (`@storybook/addon-links`, `@storybook/addon-actions`, etc.). Essentials functionality now ships with Storybook 10 core, so most projects only add optional extras.
31
+
32
+ ---
33
+
34
+ ## Quick Start (Vite Builder)
35
+
36
+ 1. **Install** the dev dependencies as shown above (or with `pnpm`/`yarn`).
37
+ 2. **Create `.storybook/main.ts`:**
38
+
39
+ ```ts
40
+ // .storybook/main.ts
41
+ import { mergeConfig, type InlineConfig } from 'vite';
42
+ import type { StorybookConfig } from 'storybook/internal/types';
43
+
44
+ const config: StorybookConfig & { viteFinal?: (config: InlineConfig) => InlineConfig | Promise<InlineConfig> } = {
45
+ stories: ['../src/stories/**/*.stories.@(ts|tsx|js|jsx|mdx)'],
46
+ addons: ['@storybook/addon-links'],
47
+ framework: {
48
+ name: '@aurelia/storybook',
49
+ options: {},
50
+ },
51
+ core: {
52
+ builder: '@storybook/builder-vite',
53
+ },
54
+ viteFinal: async (viteConfig) => {
55
+ // Ensure problematic Aurelia deps are excluded from pre-bundling.
56
+ viteConfig.optimizeDeps = viteConfig.optimizeDeps ?? {};
57
+ viteConfig.optimizeDeps.exclude = Array.from(new Set([...(viteConfig.optimizeDeps.exclude ?? []), '@aurelia/runtime-html']));
58
+
59
+ return mergeConfig(viteConfig, {
60
+ define: {
61
+ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV ?? 'development'),
62
+ },
63
+ });
64
+ },
65
+ };
66
+
67
+ export default config;
68
+ ```
23
69
 
24
- ```bash
25
- npm install --save-dev storybook @storybook/builder-vite
26
- ```
70
+ - Excluding `@aurelia/runtime-html` keeps Vite from trying to pre-bundle Aurelia's DOM runtime, which is already ESM friendly.
71
+ - The `define` shim avoids `process is not defined` errors when Storybook code (or Aurelia plugins) look for `process.env.NODE_ENV` in the preview iframe.
27
72
 
28
- For testing functionality, you may also want to install:
73
+ 3. **Create `.storybook/preview.ts`:**
29
74
 
30
- ```bash
31
- npm install --save-dev @storybook/test @storybook/addon-actions
32
- ```
75
+ ```ts
76
+ // .storybook/preview.ts
77
+ export { render, renderToCanvas } from '@aurelia/storybook';
78
+ ```
79
+
80
+ 4. **Add `storybook` scripts** to `package.json`:
81
+
82
+ ```json
83
+ {
84
+ "scripts": {
85
+ "storybook": "storybook dev -p 6006",
86
+ "build-storybook": "storybook build"
87
+ }
88
+ }
89
+ ```
90
+
91
+ 5. **Run Storybook:** `npm run storybook` starts the dev server at http://localhost:6006.
33
92
 
34
- > **Tip:** Check your existing Aurelia 2 app for already installed versions. The peer dependencies are expected to be compatible with Aurelia 2 beta releases (see `package.json` for version details).
35
-
36
- ## Getting Started
37
-
38
- ### Storybook Configuration
39
-
40
- To integrate Aurelia 2 with your Storybook instance, follow these steps:
41
-
42
- 1. **Preset Setup**:
43
- The package comes with a minimal Storybook preset (see [src/preset.ts](src/preset.ts)) that allows you to adjust Vite's configuration if needed. Storybook will use this preset to set up the build system for your Aurelia stories.
44
-
45
- 2. **Framework Setup**:
46
- For a full Aurelia 2 integration with Vite and a TypeScript configuration, ensure that your Storybook configuration files are set up as follows:
47
-
48
- - **.storybook/main.ts**
49
- Create or update your `.storybook/main.ts` file with the following contents:
50
-
51
- ```typescript
52
- import type { StorybookConfig } from 'storybook/internal/types';
53
- import { mergeConfig, type InlineConfig } from 'vite';
54
-
55
- const config: StorybookConfig & { viteFinal?: (config: InlineConfig, options: { configType: string }) => InlineConfig | Promise<InlineConfig> } = {
56
- stories: ['../src/stories/**/*.stories.@(ts|tsx|js|jsx|mdx)'],
57
- addons: [
58
- // Additional addons (essentials are now built into Storybook 9 core):
59
- '@storybook/addon-links'
60
- ],
61
- framework: {
62
- name: '@aurelia/storybook',
63
- options: {},
64
- },
65
- core: {
66
- builder: '@storybook/builder-vite',
67
- },
68
- viteFinal: async (viteConfig) => {
69
- viteConfig.optimizeDeps = viteConfig.optimizeDeps || {};
70
- viteConfig.optimizeDeps.exclude = viteConfig.optimizeDeps.exclude || [];
71
- if (!viteConfig.optimizeDeps.exclude.includes('@aurelia/runtime-html')) {
72
- viteConfig.optimizeDeps.exclude.push('@aurelia/runtime-html');
73
- }
74
- return mergeConfig(viteConfig, {
75
- // ...any additional Vite configuration
76
- });
77
- },
78
- };
79
-
80
- export default config;
81
- ```
82
-
83
- - **.storybook/preview.ts**
84
- Next, update or create your `.storybook/preview.ts` file with the following code to import the render functions from the Aurelia Storybook plugin:
85
-
86
- ```typescript
87
- // .storybook/preview.ts
88
- // Import the render function from the plugin package.
89
- export { render, renderToCanvas } from '@aurelia/storybook';
90
- ```
91
-
92
- > **Note:** Essential features like actions, controls, backgrounds, and viewport are now built into Storybook 9 core and don't need to be installed separately. However, if you need to use the `action()` function in your stories (for programmatic actions), you may still need to install `@storybook/addon-actions`. Additional addons like `@storybook/addon-links` can be installed and added to the `addons` array in your configuration.
93
-
94
- ### Using with Webpack
95
-
96
- If you prefer to use Webpack instead of Vite, update your `.storybook/main.ts` configuration:
97
-
98
- ```typescript
99
- import type { StorybookConfig } from 'storybook/internal/types';
100
-
101
- const config: StorybookConfig = {
102
- stories: ['../src/**/*.stories.@(ts|tsx|js|jsx|mdx)'],
103
- addons: [
104
- '@storybook/addon-links'
105
- ],
106
- framework: {
107
- name: '@aurelia/storybook',
108
- options: {},
109
- },
110
- core: {
111
- builder: '@storybook/builder-webpack5',
112
- },
113
- };
114
-
115
- export default config;
116
- ```
117
-
118
- The `.storybook/preview.ts` file remains the same for both Vite and Webpack configurations.
119
-
120
- 3. **Add scripts to your package.json**:
121
- Add the following scripts to your `package.json` file to work with Storybook:
122
-
123
- ```json
124
- "scripts": {
125
- "storybook": "storybook dev -p 6006",
126
- "build-storybook": "storybook build"
127
- }
128
- ```
129
- These scripts will allow you to start Storybook in development mode and build it for production.
130
-
131
- ### Writing Stories
132
-
133
- Aurelia 2 stories are written similarly to standard Storybook stories, with a few Aurelia-specific details. Below is an example story file (`hello-world.stories.ts`) that demonstrates various scenarios:
134
-
135
- ```typescript
93
+ ## Quick Start (Webpack Builder)
94
+
95
+ 1. Install `@storybook/builder-webpack5` instead of the Vite builder.
96
+ 2. Create `.storybook/main.ts`:
97
+
98
+ ```ts
99
+ import type { StorybookConfig } from 'storybook/internal/types';
100
+
101
+ const config: StorybookConfig = {
102
+ stories: ['../src/**/*.stories.@(ts|tsx|js|jsx|mdx)'],
103
+ addons: ['@storybook/addon-links'],
104
+ framework: {
105
+ name: '@aurelia/storybook',
106
+ options: {},
107
+ },
108
+ core: {
109
+ builder: '@storybook/builder-webpack5',
110
+ },
111
+ };
112
+
113
+ export default config;
114
+ ```
115
+
116
+ The preset embedded in this package injects the `ts-loader` + `@aurelia/webpack-loader` rules so you typically do not need extra config, but `webpackFinal` is available if you need to extend it further.
117
+
118
+ 3. Reuse the same `.storybook/preview.ts` and `package.json` scripts as in the Vite quick start.
119
+
120
+ ---
121
+
122
+ ## Writing Aurelia Stories
123
+
124
+ Story files look exactly like standard Storybook CSF stories. The framework export automatically:
125
+
126
+ - Registers the component you set on the default export.
127
+ - Uses `renderToCanvas` to bootstrap an Aurelia app inside Storybook's preview iframe.
128
+ - Generates a template for you if you omit the `render` function (it binds every declared `bindable`).
129
+
130
+ ```ts
131
+ // src/stories/hello-world.stories.ts
136
132
  import { HelloWorld } from '../hello-world';
137
- import { fn } from '@storybook/test';
138
- import { userEvent, within } from '@storybook/test';
133
+ import { fn, userEvent, within } from 'storybook/test';
139
134
 
140
135
  const meta = {
141
136
  title: 'Example/HelloWorld',
@@ -145,82 +140,134 @@ const meta = {
145
140
  }),
146
141
  argTypes: {
147
142
  message: { control: 'text' },
148
- onIncrement: { action: 'increment' }
149
- }
143
+ onIncrement: { action: 'increment' },
144
+ },
150
145
  };
151
146
 
152
147
  export default meta;
153
148
 
154
149
  export const DefaultHelloWorld = {
155
150
  args: {
156
- message: "Hello from Storybook!",
157
- onIncrement: fn()
158
- }
151
+ message: 'Hello from Storybook!',
152
+ onIncrement: fn(),
153
+ },
159
154
  };
160
155
 
161
156
  export const InteractiveHelloWorld = {
162
157
  args: {
163
- message: "Try clicking the button!",
164
- onIncrement: fn()
158
+ message: 'Try clicking the button!',
159
+ onIncrement: fn(),
165
160
  },
166
- play: async ({ canvasElement }: { canvasElement: HTMLElement }) => {
161
+ async play({ canvasElement }: { canvasElement: HTMLElement }) {
167
162
  const canvas = within(canvasElement);
168
- const button = canvas.getByRole('button');
169
- // Simulate three button clicks
170
- await userEvent.click(button);
171
- await userEvent.click(button);
172
- await userEvent.click(button);
173
- }
163
+ await userEvent.click(canvas.getByRole('button'));
164
+ },
174
165
  };
175
166
 
176
167
  export const NoArgs = {
177
- render: () => ({
178
- template: `<hello-world></hello-world>`
179
- })
168
+ render: () => ({ template: `<hello-world></hello-world>` }),
180
169
  };
181
170
 
182
171
  export const WithCustomTemplate = {
183
172
  render: () => ({
184
- template: `<hello-world message.bind="message">Click me!</hello-world>`
173
+ template: `<hello-world message.bind="message">Click me!</hello-world>`,
185
174
  }),
186
175
  args: {
187
- message: "This is a custom message"
188
- }
176
+ message: 'This is a custom message',
177
+ },
189
178
  };
190
179
  ```
191
180
 
192
- ### How It Works
181
+ ### Story Result Contract
193
182
 
194
- - **Render Function**:
195
- The integration exports a render function (`renderToCanvas`) that Storybook calls to mount your Aurelia component on the preview canvas. It clears the canvas, enhances it with Aurelia, and notifies Storybook when rendering is complete.
183
+ When you provide a custom `render` function, return an object with any of the following fields. The Aurelia runtime consumes them while creating the preview app:
196
184
 
197
- - **Aurelia Enhancement**:
198
- Once the canvas is cleared, the integration instantiates a new Aurelia instance, registers your component (and any additional Aurelia modules you may specify), and calls the Aurelia `enhance()` API to bind your component's view to the DOM.
185
+ | Field | Type | Purpose |
186
+ | --- | --- | --- |
187
+ | `template` | `string` | Markup that will be enhanced inside Storybook's canvas. Required when you do not rely on the auto-generated template. |
188
+ | `components` | `unknown[]` | Additional custom elements, value converters, etc. to register via `aurelia.register(...)`. |
189
+ | `items` | `unknown[]` | Any DI registrations (e.g., `Registration.instance(...)`, services, or Aurelia plugins). |
190
+ | `container` | `IContainer` | Supply a pre-configured Aurelia DI container if you need full control. |
191
+ | `innerHtml` | `string` | Optional projection content used when a component template is auto-generated from the `component` export. |
192
+ | `props` | `Record<string, any>` | Story-specific props that merge with Storybook `args`. Useful when you need defaults that should not surface as controls.
199
193
 
200
- - **Arg Integration and Interactions**:
201
- Just like with other Storybook frameworks, you can make your stories interactive by defining args and using the testing library's `play` function to simulate user interactions.
194
+ ## Registering Aurelia Dependencies & DI
202
195
 
203
- ## Development
196
+ Use the `components`, `items`, or `container` fields to bring along everything your component needs:
204
197
 
205
- If you wish to contribute or modify the integration:
198
+ ```ts
199
+ import { DI, Registration } from 'aurelia';
200
+ import { HttpClient } from '@aurelia/fetch-client';
201
+ import { OrdersPanel } from '../orders-panel';
206
202
 
207
- 1. **Build the package** using TypeScript:
203
+ const container = DI.createContainer();
204
+ container.register(
205
+ HttpClient,
206
+ Registration.instance('apiBaseUrl', 'https://api.example.com')
207
+ );
208
208
 
209
- ```bash
210
- npm run build
211
- ```
209
+ export const WithServices = {
210
+ render: () => ({
211
+ template: `<orders-panel api-base-url.bind="apiBaseUrl"></orders-panel>`,
212
+ components: [OrdersPanel],
213
+ container,
214
+ props: {
215
+ apiBaseUrl: 'https://api.example.com',
216
+ },
217
+ }),
218
+ };
219
+ ```
212
220
 
213
- 2. **Watch for changes** during development:
221
+ Because the Aurelia app lives for the lifetime of the story iframe, DI registrations persist until the story is torn down or Storybook forces a remount. If you need a clean state between stories, set `parameters: { forceRemount: true }` on the story or click the *Remount component* toolbar button in Storybook.
214
222
 
215
- ```bash
216
- npm run watch
217
- ```
223
+ ## Example Apps Inside This Repo
224
+
225
+ - `apps/hello-world` – Vite-based Aurelia starter that consumes `@aurelia/storybook`.
226
+ - `apps/hello-world-webpack` – Equivalent Webpack example.
227
+
228
+ To try them out:
229
+
230
+ ```bash
231
+ cd apps/hello-world
232
+ npm install
233
+ npm run storybook
234
+
235
+ cd ../hello-world-webpack
236
+ npm install
237
+ npm run storybook
238
+ ```
239
+
240
+ Each sample project now includes a small library of showcase stories you can open in Storybook to see different aspects of the integration:
241
+
242
+ - `HelloWorld` – the minimal counter example wired to Storybook controls and actions.
243
+ - `StatCard` – demonstrates args-driven styling and wiring the `onRefresh` action.
244
+ - `NotificationCenter` – renders repeating templates and exercises dismissal actions + play functions.
245
+ - `FeedbackForm` – shows two-way bindings, form state, and Storybook interaction tests that fill and submit inputs.
246
+ - `WeatherWidget` – uses Aurelia's DI plus `items` registration in the story to provide a mock `WeatherService` implementation.
247
+
248
+ These are great references when you want to compare your configuration against a working baseline or copy/paste patterns into your own component library.
249
+
250
+ ## Troubleshooting & Tips
251
+
252
+ - **`process is not defined` inside the preview iframe** – Add `define: { 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV ?? 'development') }` in your `viteFinal` merge (shown above).
253
+ - **Vite fails while pre-bundling Aurelia packages** – Ensure `@aurelia/runtime-html` (and any other Aurelia libs that re-export DOM globals) are listed in `optimizeDeps.exclude`.
254
+ - **State leaks between stories** – By default we reuse the Aurelia app instance for performance. Pass `parameters: { forceRemount: true }` to stories that must start fresh.
255
+ - **Need additional Storybook addons?** – Add them to the `addons` array as usual. The Aurelia framework only controls rendering, so controls, actions, interactions, and testing addons all work normally.
256
+
257
+ ## Development
258
+
259
+ This repository publishes the Storybook framework itself. Helpful scripts:
260
+
261
+ - `npm run build` – bundle the framework with Rollup.
262
+ - `npm run build:types` – emit `.d.ts` files via `tsc`.
263
+ - `npm run watch` – development build with Rollup watch mode.
264
+ - `npm run test` – run the Jest suite (uses the JSDOM environment).
218
265
 
219
- 3. **Run Storybook** in your local application to see the integration in action.
266
+ While developing, you can link the package into one of the sample apps in `apps/` to manual-test Storybook changes end to end.
220
267
 
221
268
  ## Contributing
222
269
 
223
- Contributions, bug reports, and feature requests are welcome. Please open an issue or submit a pull request on the project repository.
270
+ Bug reports, docs tweaks, and feature PRs are all welcome. Please open an issue to discuss significant changes, and spin up one of the example apps to verify the behavior you are touching.
224
271
 
225
272
  ## License
226
273
 
@@ -228,4 +275,4 @@ Contributions, bug reports, and feature requests are welcome. Please open an iss
228
275
 
229
276
  ## Acknowledgements
230
277
 
231
- Special shout out to Dmitry (@ekzobrain on GitHub) for the work he did on Storybook support for earlier versions of Storybook, which helped lay some of the groundwork for this implementation [https://github.com/ekzobrain/storybook](https://github.com/ekzobrain/storybook).
278
+ Special shout out to Dmitry (@ekzobrain on GitHub) for the work he did on Storybook support for earlier versions of Storybook, which helped lay the groundwork for this implementation: [https://github.com/ekzobrain/storybook](https://github.com/ekzobrain/storybook).
@@ -4,7 +4,6 @@ import { mergeConfig, type InlineConfig } from 'vite';
4
4
  const config: StorybookConfig & { viteFinal?: (config: InlineConfig, options: { configType: string }) => InlineConfig | Promise<InlineConfig> } = {
5
5
  stories: ['../src/stories/**/*.stories.@(ts|tsx|js|jsx|mdx)'],
6
6
  addons: [
7
- '@storybook/addon-links'
8
7
  ],
9
8
  framework: {
10
9
  name: '@aurelia/storybook',