Skip to content

Commit 19e5c92

Browse files
committed
build: update storybook config
1 parent 5a1a2cf commit 19e5c92

40 files changed

+12992
-19680
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ testem.log
4747
# System Files
4848
.DS_Store
4949
Thumbs.db
50+
51+
*storybook.log

.storybook/main.js

-12
This file was deleted.

.storybook/main.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { StorybookConfig } from '@storybook/angular';
2+
3+
const config: StorybookConfig = {
4+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5+
addons: [
6+
'@storybook/addon-onboarding',
7+
'@storybook/addon-essentials',
8+
'@chromatic-com/storybook',
9+
'@storybook/addon-interactions',
10+
],
11+
framework: {
12+
name: '@storybook/angular',
13+
options: {},
14+
},
15+
};
16+
export default config;

.storybook/preview.js

-14
This file was deleted.

.storybook/preview.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { Preview } from '@storybook/angular';
2+
import { setCompodocJson } from '@storybook/addon-docs/angular';
3+
import docJson from '../documentation.json';
4+
setCompodocJson(docJson);
5+
6+
const preview: Preview = {
7+
parameters: {
8+
controls: {
9+
matchers: {
10+
color: /(background|color)$/i,
11+
date: /Date$/i,
12+
},
13+
},
14+
},
15+
};
16+
17+
export default preview;

.storybook/tsconfig.doc.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// This tsconfig is used by Compodoc to generate the documentation for the project.
2+
// If Compodoc is not used, this file can be deleted.
3+
{
4+
"extends": "./tsconfig.json",
5+
// Exclude all files that are not needed for documentation generation.
6+
"exclude": [
7+
"../src/test.ts",
8+
"../src/**/*.spec.ts",
9+
"../src/**/*.stories.ts"
10+
],
11+
// Please make sure to include all files from which Compodoc should generate documentation.
12+
"include": ["../src/**/*"],
13+
"files": ["./typings.d.ts"]
14+
}

.storybook/tsconfig.json

+5-8
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22
"extends": "../tsconfig.app.json",
33
"compilerOptions": {
44
"types": ["node"],
5-
"allowSyntheticDefaultImports": true
5+
"allowSyntheticDefaultImports": true,
6+
"resolveJsonModule": true
67
},
7-
"exclude": [
8-
"../src/test.ts",
9-
"../src/**/*.spec.ts",
10-
"../projects/**/*.spec.ts"
11-
],
12-
"include": ["../src/**/*", "../projects/**/*"],
13-
"files": ["./typings.d.ts"]
8+
"exclude": ["../src/test.ts", "../src/**/*.spec.ts"],
9+
"include": ["../src/**/*.stories.*", "./preview.ts"],
10+
"files": ["./typings.d.ts", "../src/polyfills.ts"]
1411
}

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ https://hub.docker.com/r/wlucha/angular-starter
7777
- `npm run version` - Generate changelog
7878
- `npm run prettier` - Format the whole project
7979
- `npm run audit` - Audit this application using Sonatype OSS Index
80+
- `npm run storybook` - Run Storybook
8081

8182
## License
8283

angular.json

+22-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"buildOptimizer": false,
3030
"sourceMap": true,
3131
"optimization": false,
32-
"namedChunks": true
32+
"namedChunks": true,
33+
"preserveSymlinks": true
3334
},
3435
"configurations": {
3536
"production": {
@@ -129,6 +130,26 @@
129130
"devServerTarget": "angular-starter:serve:production"
130131
}
131132
}
133+
},
134+
"storybook": {
135+
"builder": "@storybook/angular:start-storybook",
136+
"options": {
137+
"configDir": ".storybook",
138+
"browserTarget": "angular-starter:build",
139+
"compodoc": true,
140+
"compodocArgs": ["-e", "json", "-d", "."],
141+
"port": 6006
142+
}
143+
},
144+
"build-storybook": {
145+
"builder": "@storybook/angular:build-storybook",
146+
"options": {
147+
"configDir": ".storybook",
148+
"browserTarget": "angular-starter:build",
149+
"compodoc": true,
150+
"compodocArgs": ["-e", "json", "-d", "."],
151+
"outputDir": "storybook-static"
152+
}
132153
}
133154
}
134155
}

documentation.json

+416-52
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)