@aurelia/storybook 0.1.1 → 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.
- package/LICENSE +1 -1
- package/README.md +31 -3
- package/__tests__/preset.test.ts +49 -0
- package/__tests__/preview.test.ts +139 -0
- package/__tests__/render.test.ts +0 -1
- package/__tests__/webpack.test.ts +21 -0
- package/apps/hello-world/.storybook/main.ts +30 -0
- package/apps/hello-world/.storybook/preview.ts +1 -0
- package/apps/hello-world/.stylelintrc.json +5 -0
- package/apps/hello-world/.yarnrc.yml +2 -0
- package/apps/hello-world/README.md +28 -0
- package/apps/hello-world/eslint.config.mjs +25 -0
- package/apps/hello-world/favicon.ico +0 -0
- package/apps/hello-world/index.html +17 -0
- package/apps/hello-world/package.json +65 -0
- package/apps/hello-world/src/hello-world.html +6 -0
- package/apps/hello-world/src/hello-world.ts +17 -0
- package/apps/hello-world/src/main.ts +6 -0
- package/apps/hello-world/src/my-app.html +1 -0
- package/apps/hello-world/src/my-app.ts +3 -0
- package/apps/hello-world/src/resource.d.ts +15 -0
- package/apps/hello-world/src/stories/hello-world.stories.ts +53 -0
- package/apps/hello-world/test/my-app.spec.ts +15 -0
- package/apps/hello-world/test/setup.ts +29 -0
- package/apps/hello-world/tsconfig.json +18 -0
- package/apps/hello-world/tsconfig.vitest.json +11 -0
- package/apps/hello-world/vite.config.ts +19 -0
- package/apps/hello-world/vitest.config.ts +15 -0
- package/apps/hello-world-webpack/.env.development +0 -0
- package/apps/hello-world-webpack/.storybook/main.ts +18 -0
- package/apps/hello-world-webpack/.storybook/preview.ts +3 -0
- package/apps/hello-world-webpack/.stylelintrc.json +5 -0
- package/apps/hello-world-webpack/.yarnrc.yml +2 -0
- package/apps/hello-world-webpack/README.md +29 -0
- package/apps/hello-world-webpack/eslint.config.mjs +25 -0
- package/apps/hello-world-webpack/favicon.ico +0 -0
- package/apps/hello-world-webpack/index.html +15 -0
- package/apps/hello-world-webpack/package-lock.json +10178 -0
- package/apps/hello-world-webpack/package.json +55 -0
- package/apps/hello-world-webpack/src/main.ts +6 -0
- package/apps/hello-world-webpack/src/my-app.css +3 -0
- package/apps/hello-world-webpack/src/my-app.html +1 -0
- package/apps/hello-world-webpack/src/my-app.stories.ts +12 -0
- package/apps/hello-world-webpack/src/my-app.ts +3 -0
- package/apps/hello-world-webpack/src/resource.d.ts +13 -0
- package/apps/hello-world-webpack/tsconfig.json +18 -0
- package/apps/hello-world-webpack/webpack.config.js +111 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/preset.js +35 -1
- package/dist/preset.js.map +1 -1
- package/dist/preset.mjs +34 -2
- package/dist/preset.mjs.map +1 -1
- package/dist/preview/render.js.map +1 -1
- package/dist/preview/render.mjs.map +1 -1
- package/dist/preview.js +75 -0
- package/dist/preview.js.map +1 -0
- package/dist/preview.mjs +73 -0
- package/dist/preview.mjs.map +1 -0
- package/dist/webpack.js +23 -0
- package/dist/webpack.js.map +1 -0
- package/dist/webpack.mjs +21 -0
- package/dist/webpack.mjs.map +1 -0
- package/jest.config.js +1 -1
- package/package.json +26 -23
- package/src/preset.ts +22 -5
- package/src/preview.ts +50 -0
- package/src/webpack.ts +21 -0
- package/__tests__/render.test.d.ts +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/preset.d.ts +0 -8
- package/dist/preview/render.d.ts +0 -17
- package/dist/preview/types.d.ts +0 -5
|
@@ -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
|
+
);
|
|
File without changes
|
|
@@ -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,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
|
+
];
|
|
Binary file
|