@aurelia/storybook 0.1.0 → 1.0.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 (95) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +31 -3
  3. package/__tests__/preset.test.ts +49 -0
  4. package/__tests__/preview.test.ts +139 -0
  5. package/__tests__/render.test.ts +0 -1
  6. package/__tests__/webpack.test.ts +21 -0
  7. package/apps/hello-world/.storybook/main.ts +30 -0
  8. package/apps/hello-world/.storybook/preview.ts +1 -0
  9. package/apps/hello-world/.stylelintrc.json +5 -0
  10. package/apps/hello-world/.yarnrc.yml +2 -0
  11. package/apps/hello-world/README.md +28 -0
  12. package/apps/hello-world/eslint.config.mjs +25 -0
  13. package/apps/hello-world/favicon.ico +0 -0
  14. package/apps/hello-world/index.html +17 -0
  15. package/apps/hello-world/package.json +65 -0
  16. package/apps/hello-world/src/hello-world.html +6 -0
  17. package/apps/hello-world/src/hello-world.ts +17 -0
  18. package/apps/hello-world/src/main.ts +6 -0
  19. package/apps/hello-world/src/my-app.html +1 -0
  20. package/apps/hello-world/src/my-app.ts +3 -0
  21. package/apps/hello-world/src/resource.d.ts +15 -0
  22. package/apps/hello-world/src/stories/hello-world.stories.ts +53 -0
  23. package/apps/hello-world/test/my-app.spec.ts +15 -0
  24. package/apps/hello-world/test/setup.ts +29 -0
  25. package/apps/hello-world/tsconfig.json +18 -0
  26. package/apps/hello-world/tsconfig.vitest.json +11 -0
  27. package/apps/hello-world/vite.config.ts +19 -0
  28. package/apps/hello-world/vitest.config.ts +15 -0
  29. package/apps/hello-world-webpack/.storybook/main.ts +18 -0
  30. package/apps/hello-world-webpack/.storybook/preview.ts +3 -0
  31. package/apps/hello-world-webpack/.stylelintrc.json +5 -0
  32. package/apps/hello-world-webpack/.yarnrc.yml +2 -0
  33. package/apps/hello-world-webpack/README.md +29 -0
  34. package/apps/hello-world-webpack/eslint.config.mjs +25 -0
  35. package/apps/hello-world-webpack/favicon.ico +0 -0
  36. package/apps/hello-world-webpack/index.html +15 -0
  37. package/apps/hello-world-webpack/package-lock.json +10178 -0
  38. package/apps/hello-world-webpack/package.json +55 -0
  39. package/apps/hello-world-webpack/src/main.ts +6 -0
  40. package/apps/hello-world-webpack/src/my-app.css +3 -0
  41. package/apps/hello-world-webpack/src/my-app.html +1 -0
  42. package/apps/hello-world-webpack/src/my-app.stories.ts +12 -0
  43. package/apps/hello-world-webpack/src/my-app.ts +3 -0
  44. package/apps/hello-world-webpack/src/resource.d.ts +13 -0
  45. package/apps/hello-world-webpack/tsconfig.json +18 -0
  46. package/apps/hello-world-webpack/webpack.config.js +111 -0
  47. package/dist/index.js +112 -3
  48. package/dist/index.js.map +1 -0
  49. package/dist/index.mjs +109 -0
  50. package/dist/index.mjs.map +1 -0
  51. package/dist/preset.js +44 -2
  52. package/dist/preset.js.map +1 -0
  53. package/dist/preset.mjs +46 -0
  54. package/dist/preset.mjs.map +1 -0
  55. package/dist/preview/render.js +26 -14
  56. package/dist/preview/render.js.map +1 -0
  57. package/dist/{src/preview/render.js → preview/render.mjs} +8 -4
  58. package/dist/preview/render.mjs.map +1 -0
  59. package/dist/preview/types.js +3 -1
  60. package/dist/preview/types.js.map +1 -0
  61. package/dist/preview/types.mjs +2 -0
  62. package/dist/preview/types.mjs.map +1 -0
  63. package/dist/preview.js +75 -0
  64. package/dist/preview.js.map +1 -0
  65. package/dist/preview.mjs +73 -0
  66. package/dist/preview.mjs.map +1 -0
  67. package/dist/webpack.js +23 -0
  68. package/dist/webpack.js.map +1 -0
  69. package/dist/webpack.mjs +21 -0
  70. package/dist/webpack.mjs.map +1 -0
  71. package/jest.config.js +1 -1
  72. package/package.json +40 -20
  73. package/rollup.config.mjs +51 -0
  74. package/src/preset.ts +22 -5
  75. package/src/preview.ts +50 -0
  76. package/src/webpack.ts +21 -0
  77. package/tsconfig.build.json +5 -0
  78. package/tsconfig.json +1 -0
  79. package/dist/__tests__/example.test.js +0 -6
  80. package/dist/__tests__/render.test.d.ts +0 -1
  81. package/dist/__tests__/render.test.js +0 -156
  82. package/dist/index.d.ts +0 -3
  83. package/dist/preset.d.ts +0 -8
  84. package/dist/preview/render.d.ts +0 -17
  85. package/dist/preview/render.test.d.ts +0 -1
  86. package/dist/preview/render.test.js +0 -126
  87. package/dist/preview/types.d.ts +0 -5
  88. package/dist/src/index.d.ts +0 -3
  89. package/dist/src/index.js +0 -3
  90. package/dist/src/preset.d.ts +0 -8
  91. package/dist/src/preset.js +0 -11
  92. package/dist/src/preview/render.d.ts +0 -17
  93. package/dist/src/preview/types.d.ts +0 -5
  94. package/dist/src/preview/types.js +0 -1
  95. /package/{dist/__tests__/example.test.d.ts → apps/hello-world-webpack/.env.development} +0 -0
@@ -0,0 +1,15 @@
1
+ import { fileURLToPath } from "node:url";
2
+ import { mergeConfig, defineConfig } from "vitest/config";
3
+ import viteConfig from "./vite.config";
4
+
5
+ export default mergeConfig(
6
+ viteConfig,
7
+ defineConfig({
8
+ test: {
9
+ environment: "jsdom",
10
+ watch: false,
11
+ root: fileURLToPath(new URL("./", import.meta.url)),
12
+ setupFiles: ["./test/setup.ts"]
13
+ },
14
+ }),
15
+ );
@@ -0,0 +1,18 @@
1
+ /** @type { import('@storybook/core-common').StorybookConfig } */
2
+ const config = {
3
+ stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
4
+ addons: [
5
+ "@storybook/addon-webpack5-compiler-swc",
6
+ "@storybook/addon-links",
7
+ "@storybook/addon-essentials"
8
+ ],
9
+ framework: {
10
+ name: '@aurelia/storybook',
11
+ options: {},
12
+ },
13
+ core: {
14
+ builder: '@storybook/builder-webpack5',
15
+ },
16
+ docs: {},
17
+ };
18
+ export default config;
@@ -0,0 +1,3 @@
1
+ // .storybook/preview.ts
2
+ // Import the render function from the plugin package.
3
+ export { render, renderToCanvas } from '@aurelia/storybook';
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": [
3
+ "stylelint-config-standard"
4
+ ]
5
+ }
@@ -0,0 +1,2 @@
1
+ # For compatibility in yarn 2+
2
+ nodeLinker: node-modules
@@ -0,0 +1,29 @@
1
+ # examples
2
+
3
+ This project is bootstrapped by [aurelia/new](https://github.com/aurelia/new).
4
+
5
+ ## Start dev web server
6
+
7
+ npm start
8
+
9
+ ## Build the app in production mode
10
+
11
+ npm run build
12
+
13
+ It builds all files to dist folder. To deploy to production server, copy all the `dist/*` files to production root folder.
14
+
15
+ For example
16
+ ```
17
+ dist/index.html
18
+ dist/foo.12345.js
19
+ ```
20
+ Copy to production root folder
21
+ ```
22
+ root_folder/index.html
23
+ root_folder/foo.12345.js
24
+ ```
25
+
26
+
27
+ ## Analyze webpack bundle
28
+
29
+ npm run analyze
@@ -0,0 +1,25 @@
1
+ import eslint from "@eslint/js";
2
+ import tseslint from 'typescript-eslint';
3
+ import tsParser from "@typescript-eslint/parser";
4
+ import globals from "globals";
5
+
6
+ export default [
7
+ eslint.configs.recommended,
8
+ ...tseslint.configs.recommended,
9
+ {
10
+ files: ["**/*.ts"],
11
+
12
+ languageOptions: {
13
+ globals: {
14
+ ...globals.builtin,
15
+ ...globals.nodeBuiltin,
16
+ ...globals.browser,
17
+ ...globals.node,
18
+ },
19
+
20
+ parser: tsParser,
21
+ ecmaVersion: 2019,
22
+ sourceType: "module",
23
+ },
24
+ }
25
+ ];
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <title>Aurelia</title>
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+ <base href="/">
9
+ </head>
10
+
11
+ <body>
12
+ <my-app></my-app>
13
+ </body>
14
+
15
+ </html>