@aurelia/storybook 2.0.0 → 2.2.1

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 (140) hide show
  1. package/.github/workflows/ci.yml +61 -0
  2. package/.github/workflows/publish.yml +82 -0
  3. package/.github/workflows/storybook-preview.yml +62 -0
  4. package/CHANGELOG.md +5 -0
  5. package/README.md +381 -148
  6. package/__tests__/create-aurelia-app.test.ts +94 -0
  7. package/__tests__/preset.test.ts +32 -3
  8. package/__tests__/preview.test.ts +9 -131
  9. package/__tests__/render.test.ts +15 -26
  10. package/apps/hello-world/.storybook/main.ts +0 -1
  11. package/apps/hello-world/package-lock.json +4585 -2609
  12. package/apps/hello-world/package.json +13 -23
  13. package/apps/hello-world/src/components/feedback-form.html +111 -0
  14. package/apps/hello-world/src/components/feedback-form.ts +45 -0
  15. package/apps/hello-world/src/components/notification-center.html +119 -0
  16. package/apps/hello-world/src/components/notification-center.ts +27 -0
  17. package/apps/hello-world/src/components/stat-card.html +107 -0
  18. package/apps/hello-world/src/components/stat-card.ts +41 -0
  19. package/apps/hello-world/src/components/weather-widget.html +89 -0
  20. package/apps/hello-world/src/components/weather-widget.ts +31 -0
  21. package/apps/hello-world/src/hello-world.html +44 -2
  22. package/apps/hello-world/src/services/weather-service.ts +15 -0
  23. package/apps/hello-world/src/stories/feedback-form.stories.ts +58 -0
  24. package/apps/hello-world/src/stories/hello-world.stories.ts +24 -14
  25. package/apps/hello-world/src/stories/notification-center.stories.ts +88 -0
  26. package/apps/hello-world/src/stories/stat-card.stories.ts +75 -0
  27. package/apps/hello-world/src/stories/weather-widget.stories.ts +62 -0
  28. package/apps/hello-world/tsconfig.json +4 -3
  29. package/apps/hello-world/vite.config.ts +0 -2
  30. package/apps/hello-world-rsbuild/.storybook/main.ts +16 -0
  31. package/apps/hello-world-rsbuild/.storybook/preview.ts +1 -0
  32. package/apps/hello-world-rsbuild/.stylelintrc.json +5 -0
  33. package/apps/hello-world-rsbuild/README.md +28 -0
  34. package/apps/hello-world-rsbuild/eslint.config.mjs +25 -0
  35. package/apps/hello-world-rsbuild/favicon.ico +0 -0
  36. package/apps/hello-world-rsbuild/index.html +17 -0
  37. package/apps/hello-world-rsbuild/package-lock.json +11131 -0
  38. package/apps/hello-world-rsbuild/package.json +56 -0
  39. package/apps/hello-world-rsbuild/src/components/feedback-form.html +111 -0
  40. package/apps/hello-world-rsbuild/src/components/feedback-form.ts +45 -0
  41. package/apps/hello-world-rsbuild/src/components/notification-center.html +119 -0
  42. package/apps/hello-world-rsbuild/src/components/notification-center.ts +27 -0
  43. package/apps/hello-world-rsbuild/src/components/stat-card.html +107 -0
  44. package/apps/hello-world-rsbuild/src/components/stat-card.ts +41 -0
  45. package/apps/hello-world-rsbuild/src/components/weather-widget.html +89 -0
  46. package/apps/hello-world-rsbuild/src/components/weather-widget.ts +31 -0
  47. package/apps/hello-world-rsbuild/src/hello-world.html +48 -0
  48. package/apps/hello-world-rsbuild/src/hello-world.ts +17 -0
  49. package/apps/hello-world-rsbuild/src/main.ts +6 -0
  50. package/apps/hello-world-rsbuild/src/my-app.html +1 -0
  51. package/apps/hello-world-rsbuild/src/my-app.ts +3 -0
  52. package/apps/hello-world-rsbuild/src/resource.d.ts +15 -0
  53. package/apps/hello-world-rsbuild/src/services/weather-service.ts +15 -0
  54. package/apps/hello-world-rsbuild/src/stories/feedback-form.stories.ts +58 -0
  55. package/apps/hello-world-rsbuild/src/stories/hello-world.stories.ts +64 -0
  56. package/apps/hello-world-rsbuild/src/stories/notification-center.stories.ts +88 -0
  57. package/apps/hello-world-rsbuild/src/stories/stat-card.stories.ts +75 -0
  58. package/apps/hello-world-rsbuild/src/stories/weather-widget.stories.ts +62 -0
  59. package/apps/hello-world-rsbuild/test/my-app.spec.ts +15 -0
  60. package/apps/hello-world-rsbuild/test/setup.ts +29 -0
  61. package/apps/hello-world-rsbuild/tsconfig.json +19 -0
  62. package/apps/hello-world-rsbuild/tsconfig.vitest.json +11 -0
  63. package/apps/hello-world-rsbuild/vite.config.ts +17 -0
  64. package/apps/hello-world-rsbuild/vitest.config.ts +15 -0
  65. package/apps/hello-world-webpack/.storybook/main.ts +0 -1
  66. package/apps/hello-world-webpack/package-lock.json +3553 -768
  67. package/apps/hello-world-webpack/package.json +8 -10
  68. package/apps/hello-world-webpack/src/components/feedback-form.html +111 -0
  69. package/apps/hello-world-webpack/src/components/feedback-form.ts +45 -0
  70. package/apps/hello-world-webpack/src/components/notification-center.html +119 -0
  71. package/apps/hello-world-webpack/src/components/notification-center.ts +27 -0
  72. package/apps/hello-world-webpack/src/components/stat-card.html +107 -0
  73. package/apps/hello-world-webpack/src/components/stat-card.ts +41 -0
  74. package/apps/hello-world-webpack/src/components/weather-widget.html +89 -0
  75. package/apps/hello-world-webpack/src/components/weather-widget.ts +31 -0
  76. package/apps/hello-world-webpack/src/hello-world.html +44 -2
  77. package/apps/hello-world-webpack/src/my-app.stories.ts +6 -4
  78. package/apps/hello-world-webpack/src/services/weather-service.ts +15 -0
  79. package/apps/hello-world-webpack/src/stories/feedback-form.stories.ts +58 -0
  80. package/apps/hello-world-webpack/src/stories/hello-world.stories.ts +25 -15
  81. package/apps/hello-world-webpack/src/stories/notification-center.stories.ts +88 -0
  82. package/apps/hello-world-webpack/src/stories/stat-card.stories.ts +75 -0
  83. package/apps/hello-world-webpack/src/stories/weather-widget.stories.ts +62 -0
  84. package/apps/hello-world-webpack/tsconfig.json +1 -1
  85. package/dist/index.d.ts +25 -0
  86. package/dist/index.js +68 -14
  87. package/dist/index.js.map +1 -1
  88. package/dist/preset.d.ts +21 -0
  89. package/dist/preset.js +46 -2
  90. package/dist/preset.js.map +1 -1
  91. package/dist/preview/helpers.d.ts +2 -0
  92. package/dist/preview/helpers.js +6 -0
  93. package/dist/preview/helpers.js.map +1 -0
  94. package/dist/preview/render.d.ts +7 -0
  95. package/dist/preview/render.js +66 -15
  96. package/dist/preview/render.js.map +1 -1
  97. package/dist/preview/storybook-types-runtime.d.ts +1 -0
  98. package/dist/preview/storybook-types-runtime.js +5 -0
  99. package/dist/preview/storybook-types-runtime.js.map +1 -0
  100. package/dist/preview/storybook-types.d.ts +27 -0
  101. package/dist/preview/types-runtime.d.ts +1 -0
  102. package/dist/preview/types-runtime.js +5 -0
  103. package/dist/preview/types-runtime.js.map +1 -0
  104. package/dist/preview/types.d.ts +44 -0
  105. package/dist/preview.d.ts +3 -0
  106. package/dist/preview.js +71 -16
  107. package/dist/preview.js.map +1 -1
  108. package/dist/webpack.d.ts +10 -0
  109. package/dist/webpack.js +19 -1
  110. package/dist/webpack.js.map +1 -1
  111. package/package.json +58 -13
  112. package/rollup.config.mjs +5 -3
  113. package/scripts/sync-versions.cjs +55 -0
  114. package/src/index.ts +11 -1
  115. package/src/preset.ts +32 -2
  116. package/src/preview/helpers.ts +7 -0
  117. package/src/preview/render.ts +98 -30
  118. package/src/preview/storybook-types-runtime.ts +2 -0
  119. package/src/preview/storybook-types.ts +34 -0
  120. package/src/preview/types-runtime.ts +2 -0
  121. package/src/preview/types.ts +57 -2
  122. package/src/preview.ts +11 -1
  123. package/src/webpack.ts +19 -0
  124. package/apps/hello-world/.yarnrc.yml +0 -2
  125. package/apps/hello-world-webpack/.yarnrc.yml +0 -2
  126. package/dist/index.mjs +0 -132
  127. package/dist/index.mjs.map +0 -1
  128. package/dist/preset.mjs +0 -60
  129. package/dist/preset.mjs.map +0 -1
  130. package/dist/preview/render.mjs +0 -114
  131. package/dist/preview/render.mjs.map +0 -1
  132. package/dist/preview/types.js +0 -2
  133. package/dist/preview/types.js.map +0 -1
  134. package/dist/preview/types.mjs +0 -2
  135. package/dist/preview/types.mjs.map +0 -1
  136. package/dist/preview.mjs +0 -114
  137. package/dist/preview.mjs.map +0 -1
  138. package/dist/webpack.mjs +0 -21
  139. package/dist/webpack.mjs.map +0 -1
  140. /package/{jest.config.js → jest.config.cjs} +0 -0
@@ -0,0 +1,61 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - name: Checkout
13
+ uses: actions/checkout@v4
14
+
15
+ - name: Setup Node
16
+ uses: actions/setup-node@v4
17
+ with:
18
+ node-version: 20.19.0
19
+ cache: npm
20
+
21
+ - name: Install root deps
22
+ run: npm install
23
+
24
+ - name: Verify example versions are aligned
25
+ run: npm run sync:versions:check
26
+
27
+ - name: Build package
28
+ run: npm run build
29
+
30
+ - name: Build types
31
+ run: npm run build:types
32
+
33
+ - name: Test package
34
+ run: npm test
35
+
36
+ - name: Build hello-world (Vite)
37
+ working-directory: apps/hello-world
38
+ run: |
39
+ npm pkg set "devDependencies.@aurelia/storybook=file:../.."
40
+ npm install
41
+ npx tsc --noEmit -p tsconfig.json
42
+ npm run build
43
+ npm run build-storybook
44
+
45
+ - name: Build hello-world-webpack
46
+ working-directory: apps/hello-world-webpack
47
+ run: |
48
+ npm pkg set "devDependencies.@aurelia/storybook=file:../.."
49
+ npm install
50
+ npx tsc --noEmit -p tsconfig.json
51
+ npm run build
52
+ npm run build-storybook
53
+
54
+ - name: Build hello-world-rsbuild
55
+ working-directory: apps/hello-world-rsbuild
56
+ run: |
57
+ npm pkg set "devDependencies.@aurelia/storybook=file:../.."
58
+ npm install
59
+ npx tsc --noEmit -p tsconfig.json
60
+ npm run build
61
+ npm run build-storybook
@@ -0,0 +1,82 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch:
8
+ inputs:
9
+ tag:
10
+ description: 'Tag to publish (e.g., v2.2.1)'
11
+ required: true
12
+ type: string
13
+
14
+ jobs:
15
+ publish:
16
+ runs-on: ubuntu-latest
17
+ permissions:
18
+ contents: read
19
+ id-token: write
20
+
21
+ steps:
22
+ - name: Checkout
23
+ uses: actions/checkout@v4
24
+ with:
25
+ ref: ${{ inputs.tag || github.ref }}
26
+
27
+ - name: Setup Node
28
+ uses: actions/setup-node@v4
29
+ with:
30
+ node-version: 20.19.0
31
+ registry-url: https://registry.npmjs.org
32
+ cache: npm
33
+
34
+ - name: Install deps
35
+ run: npm install
36
+
37
+ - name: Verify versions aligned
38
+ run: npm run sync:versions:check
39
+
40
+ - name: Verify tag matches package version
41
+ run: |
42
+ TAG_INPUT="${{ inputs.tag }}"
43
+ if [ -n "$TAG_INPUT" ]; then
44
+ TAG="${TAG_INPUT#v}"
45
+ else
46
+ TAG="${GITHUB_REF_NAME#v}"
47
+ fi
48
+ VERSION="$(node -p "require('./package.json').version")"
49
+ if [ "$TAG" != "$VERSION" ]; then
50
+ echo "Tag ($TAG) does not match package.json version ($VERSION)"
51
+ exit 1
52
+ fi
53
+
54
+ - name: Build package
55
+ run: npm run build
56
+
57
+ - name: Build types
58
+ run: npm run build:types
59
+
60
+ - name: Test package
61
+ run: npm test
62
+
63
+ - name: Verify changelog exists
64
+ run: |
65
+ if [ ! -s CHANGELOG.md ]; then
66
+ echo "CHANGELOG.md is empty. Run npm run changelog before tagging."
67
+ exit 1
68
+ fi
69
+
70
+ - name: Verify changelog version matches package
71
+ run: |
72
+ VERSION="$(node -p "require('./package.json').version")"
73
+ CHANGELOG_VERSION="$(node -e "const fs=require('fs');const m=fs.readFileSync('CHANGELOG.md','utf8').match(/## \\[(\\d+\\.\\d+\\.\\d+(?:-[^\\]]+)?)\\]/);console.log(m?m[1]:'')")"
74
+ if [ "$VERSION" != "$CHANGELOG_VERSION" ]; then
75
+ echo "CHANGELOG.md latest version ($CHANGELOG_VERSION) does not match package.json ($VERSION)"
76
+ exit 1
77
+ fi
78
+
79
+ - name: Publish to npm
80
+ run: npm publish --access public
81
+ env:
82
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,62 @@
1
+ name: Storybook Preview
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+ pages: write
12
+ id-token: write
13
+
14
+ concurrency:
15
+ group: pages
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ build:
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - name: Checkout
24
+ uses: actions/checkout@v4
25
+
26
+ - name: Setup Node
27
+ uses: actions/setup-node@v4
28
+ with:
29
+ node-version: 20.19.0
30
+ cache: npm
31
+
32
+ - name: Install root deps
33
+ run: npm install
34
+
35
+ - name: Build package
36
+ run: npm run build
37
+
38
+ - name: Build Storybook (hello-world)
39
+ working-directory: apps/hello-world
40
+ run: |
41
+ npm pkg set "devDependencies.@aurelia/storybook=file:../.."
42
+ npm install
43
+ npm run build-storybook
44
+
45
+ - name: Configure Pages
46
+ uses: actions/configure-pages@v5
47
+
48
+ - name: Upload Pages artifact
49
+ uses: actions/upload-pages-artifact@v3
50
+ with:
51
+ path: apps/hello-world/storybook-static
52
+
53
+ deploy:
54
+ runs-on: ubuntu-latest
55
+ needs: build
56
+ environment:
57
+ name: github-pages
58
+ url: ${{ steps.deployment.outputs.page_url }}
59
+ steps:
60
+ - name: Deploy to GitHub Pages
61
+ id: deployment
62
+ uses: actions/deploy-pages@v4
package/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [2.2.1](https://github.com/aurelia/storybook/compare/2.1.0...2.2.1) (2026-01-23)
2
+
3
+ ### Features
4
+
5
+ * **storybook:** update packages, tooling, rsbuild support ([3a97a99](https://github.com/aurelia/storybook/commit/3a97a9950693183b5880756a943e620895f9457b))