@storybook/angular-vite 0.0.0-canary-test
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/README.md +5 -0
- package/build-schema.json +192 -0
- package/builders.json +14 -0
- package/dist/_browser-chunks/chunk-4WZEHS2U.js +47 -0
- package/dist/_browser-chunks/chunk-6U6AH4EH.js +723 -0
- package/dist/_browser-chunks/chunk-CIJX6X7B.js +246 -0
- package/dist/_browser-chunks/chunk-TARB3NLN.js +93 -0
- package/dist/_node-chunks/chunk-R2RNJVE7.js +90 -0
- package/dist/builders/build-storybook/index.js +123 -0
- package/dist/builders/start-storybook/index.js +155 -0
- package/dist/client/config.js +16 -0
- package/dist/client/docs/config.js +9 -0
- package/dist/client/index.js +19 -0
- package/dist/client/preview-prod.js +3 -0
- package/dist/index.d.ts +1343 -0
- package/dist/index.js +20 -0
- package/dist/node/index.d.ts +31 -0
- package/dist/node/index.js +19 -0
- package/dist/preset.js +235 -0
- package/package.json +116 -0
- package/preset.js +1 -0
- package/start-schema.json +227 -0
- package/template/cli/button.component.ts +50 -0
- package/template/cli/button.stories.ts +49 -0
- package/template/cli/header.component.ts +78 -0
- package/template/cli/header.stories.ts +33 -0
- package/template/cli/page.component.ts +84 -0
- package/template/cli/page.stories.ts +32 -0
- package/template/cli/user.ts +3 -0
package/README.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Storybook for Angular
|
|
2
|
+
|
|
3
|
+
See [documentation](https://storybook.js.org/docs/get-started/frameworks/angular?renderer=angular&ref=readme) for installation instructions, usage examples, APIs, and more.
|
|
4
|
+
|
|
5
|
+
Learn more about Storybook at [storybook.js.org](https://storybook.js.org/?ref=readme).
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"title": "Build Storybook",
|
|
4
|
+
"description": "Serve up storybook in development mode.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"browserTarget": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Build target to be served in project-name:builder:config format. Should generally target on the builder: '@angular-devkit/build-angular:browser'. Useful for Storybook to use options (styles, assets, ...).",
|
|
10
|
+
"pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$",
|
|
11
|
+
"default": null
|
|
12
|
+
},
|
|
13
|
+
"tsConfig": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "The full path for the TypeScript configuration file, relative to the current workspace."
|
|
16
|
+
},
|
|
17
|
+
"outputDir": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Directory where to store built files.",
|
|
20
|
+
"default": "storybook-static"
|
|
21
|
+
},
|
|
22
|
+
"preserveSymlinks": {
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"description": "Do not use the real path when resolving modules. If true, symlinks are resolved to their real path, if false, symlinks are resolved to their symlinked path.",
|
|
25
|
+
"default": false
|
|
26
|
+
},
|
|
27
|
+
"configDir": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "Directory where to load Storybook configurations from.",
|
|
30
|
+
"default": ".storybook"
|
|
31
|
+
},
|
|
32
|
+
"loglevel": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "Controls level of logging during build. Can be one of: [trace, debug, info (default), warn, error, silent].",
|
|
35
|
+
"pattern": "(trace|debug|info|warn|error|silent)"
|
|
36
|
+
},
|
|
37
|
+
"logfile": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "If provided, the log output will be written to the specified file path."
|
|
40
|
+
},
|
|
41
|
+
"enableProdMode": {
|
|
42
|
+
"type": "boolean",
|
|
43
|
+
"description": "Disable Angular's development mode, which turns off assertions and other checks within the framework.",
|
|
44
|
+
"default": true
|
|
45
|
+
},
|
|
46
|
+
"quiet": {
|
|
47
|
+
"type": "boolean",
|
|
48
|
+
"description": "Suppress verbose build output.",
|
|
49
|
+
"default": false
|
|
50
|
+
},
|
|
51
|
+
"docs": {
|
|
52
|
+
"type": "boolean",
|
|
53
|
+
"description": "Starts Storybook in documentation mode. Learn more about it : https://storybook.js.org/docs/writing-docs/build-documentation#preview-storybooks-documentation.",
|
|
54
|
+
"default": false
|
|
55
|
+
},
|
|
56
|
+
"test": {
|
|
57
|
+
"type": "boolean",
|
|
58
|
+
"description": "Build the static version of the sandbox optimized for testing purposes",
|
|
59
|
+
"default": false
|
|
60
|
+
},
|
|
61
|
+
"compodoc": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"description": "Execute compodoc before.",
|
|
64
|
+
"default": true
|
|
65
|
+
},
|
|
66
|
+
"compodocArgs": {
|
|
67
|
+
"type": "array",
|
|
68
|
+
"description": "Compodoc options : https://compodoc.app/guides/options.html. Options `-p` with tsconfig path and `-d` with workspace root is always given.",
|
|
69
|
+
"default": ["-e", "json"],
|
|
70
|
+
"items": {
|
|
71
|
+
"type": "string"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"statsJson": {
|
|
75
|
+
"type": ["boolean", "string"],
|
|
76
|
+
"description": "Write stats JSON to disk",
|
|
77
|
+
"default": false
|
|
78
|
+
},
|
|
79
|
+
"previewUrl": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"description": "Disables the default storybook preview and lets you use your own"
|
|
82
|
+
},
|
|
83
|
+
"styles": {
|
|
84
|
+
"type": "array",
|
|
85
|
+
"description": "Global styles to be included in the build.",
|
|
86
|
+
"items": {
|
|
87
|
+
"$ref": "#/definitions/styleElement"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"stylePreprocessorOptions": {
|
|
91
|
+
"description": "Options to pass to style preprocessors.",
|
|
92
|
+
"type": "object",
|
|
93
|
+
"properties": {
|
|
94
|
+
"includePaths": {
|
|
95
|
+
"description": "Paths to include. Paths will be resolved to workspace root.",
|
|
96
|
+
"type": "array",
|
|
97
|
+
"items": {
|
|
98
|
+
"type": "string"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"additionalProperties": false
|
|
103
|
+
},
|
|
104
|
+
"assets": {
|
|
105
|
+
"type": "array",
|
|
106
|
+
"description": "List of static application assets.",
|
|
107
|
+
"default": [],
|
|
108
|
+
"items": {
|
|
109
|
+
"$ref": "#/definitions/assetPattern"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"sourceMap": {
|
|
113
|
+
"type": ["boolean", "object"],
|
|
114
|
+
"description": "Configure sourcemaps. See: https://angular.io/guide/workspace-config#source-map-configuration",
|
|
115
|
+
"default": false
|
|
116
|
+
},
|
|
117
|
+
"experimentalZoneless": {
|
|
118
|
+
"type": "boolean",
|
|
119
|
+
"description": "Experimental: Use zoneless change detection."
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"additionalProperties": false,
|
|
123
|
+
"definitions": {
|
|
124
|
+
"assetPattern": {
|
|
125
|
+
"oneOf": [
|
|
126
|
+
{
|
|
127
|
+
"type": "object",
|
|
128
|
+
"properties": {
|
|
129
|
+
"followSymlinks": {
|
|
130
|
+
"type": "boolean",
|
|
131
|
+
"default": false,
|
|
132
|
+
"description": "Allow glob patterns to follow symlink directories. This allows subdirectories of the symlink to be searched."
|
|
133
|
+
},
|
|
134
|
+
"glob": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"description": "The pattern to match."
|
|
137
|
+
},
|
|
138
|
+
"input": {
|
|
139
|
+
"type": "string",
|
|
140
|
+
"description": "The input directory path in which to apply 'glob'. Defaults to the project root."
|
|
141
|
+
},
|
|
142
|
+
"ignore": {
|
|
143
|
+
"description": "An array of globs to ignore.",
|
|
144
|
+
"type": "array",
|
|
145
|
+
"items": {
|
|
146
|
+
"type": "string"
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"output": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"description": "Absolute path within the output."
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"additionalProperties": false,
|
|
155
|
+
"required": ["glob", "input", "output"]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"type": "string"
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
"styleElement": {
|
|
163
|
+
"oneOf": [
|
|
164
|
+
{
|
|
165
|
+
"type": "object",
|
|
166
|
+
"properties": {
|
|
167
|
+
"input": {
|
|
168
|
+
"type": "string",
|
|
169
|
+
"description": "The file to include."
|
|
170
|
+
},
|
|
171
|
+
"bundleName": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"pattern": "^[\\w\\-.]*$",
|
|
174
|
+
"description": "The bundle name for this extra entry point."
|
|
175
|
+
},
|
|
176
|
+
"inject": {
|
|
177
|
+
"type": "boolean",
|
|
178
|
+
"description": "If the bundle will be referenced in the HTML file.",
|
|
179
|
+
"default": true
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"additionalProperties": false,
|
|
183
|
+
"required": ["input"]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"type": "string",
|
|
187
|
+
"description": "The file to include."
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
package/builders.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"builders": {
|
|
3
|
+
"build-storybook": {
|
|
4
|
+
"implementation": "./dist/builders/build-storybook/index.js",
|
|
5
|
+
"schema": "./build-schema.json",
|
|
6
|
+
"description": "Build storybook"
|
|
7
|
+
},
|
|
8
|
+
"start-storybook": {
|
|
9
|
+
"implementation": "./dist/builders/start-storybook/index.js",
|
|
10
|
+
"schema": "./start-schema.json",
|
|
11
|
+
"description": "Start storybook"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export,
|
|
3
|
+
computesTemplateSourceFromComponent
|
|
4
|
+
} from "./chunk-6U6AH4EH.js";
|
|
5
|
+
|
|
6
|
+
// src/client/docs/config.ts
|
|
7
|
+
var config_exports = {};
|
|
8
|
+
__export(config_exports, {
|
|
9
|
+
decorators: () => decorators,
|
|
10
|
+
parameters: () => parameters
|
|
11
|
+
});
|
|
12
|
+
import { SourceType as SourceType2 } from "storybook/internal/docs-tools";
|
|
13
|
+
|
|
14
|
+
// src/client/docs/sourceDecorator.ts
|
|
15
|
+
import { SourceType } from "storybook/internal/docs-tools";
|
|
16
|
+
import { useRef, emitTransformCode, useEffect } from "storybook/preview-api";
|
|
17
|
+
var skipSourceRender = (context) => {
|
|
18
|
+
let sourceParams = context?.parameters.docs?.source;
|
|
19
|
+
return sourceParams?.type === SourceType.DYNAMIC ? !1 : sourceParams?.code || sourceParams?.type === SourceType.CODE;
|
|
20
|
+
}, sourceDecorator = (storyFn, context) => {
|
|
21
|
+
let story = storyFn(), source = useRef(void 0);
|
|
22
|
+
return useEffect(() => {
|
|
23
|
+
if (skipSourceRender(context))
|
|
24
|
+
return;
|
|
25
|
+
let { props, userDefinedTemplate } = story, { component, argTypes, parameters: parameters2 } = context, template = parameters2.docs?.source?.excludeDecorators ? context.originalStoryFn(context.args, context).template : story.template;
|
|
26
|
+
if (component && !userDefinedTemplate) {
|
|
27
|
+
let newSource = computesTemplateSourceFromComponent(component, props, argTypes) || template;
|
|
28
|
+
newSource && newSource !== source.current && (emitTransformCode(newSource, context), source.current = newSource);
|
|
29
|
+
} else template && template !== source.current && (emitTransformCode(template, context), source.current = template);
|
|
30
|
+
}), story;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/client/docs/config.ts
|
|
34
|
+
var parameters = {
|
|
35
|
+
docs: {
|
|
36
|
+
source: {
|
|
37
|
+
type: SourceType2.DYNAMIC,
|
|
38
|
+
language: "html"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}, decorators = [sourceDecorator];
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
parameters,
|
|
45
|
+
decorators,
|
|
46
|
+
config_exports
|
|
47
|
+
};
|