@storybook/angular-vite 10.6.0-alpha.5 → 10.6.0-alpha.7
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/build-schema.json +33 -5
- package/dist/_browser-chunks/{chunk-XXAOQLNU.js → chunk-AL7GEPYM.js} +98 -60
- package/dist/_browser-chunks/{chunk-GVH2OCSY.js → chunk-THQDNKQS.js} +3 -3
- package/dist/_browser-chunks/{chunk-6DVGZIOB.js → chunk-UJ3I56EP.js} +79 -90
- package/dist/_browser-chunks/{chunk-THKACJYB.js → chunk-VP3W5GY3.js} +6 -6
- package/dist/_node-chunks/chunk-GWJVWZ3H.js +42 -0
- package/dist/_node-chunks/{chunk-RC6UIUJ4.js → chunk-QNPJ2GGJ.js} +6 -6
- package/dist/_node-chunks/{chunk-35U7AODH.js → chunk-V7GJH7LA.js} +7 -7
- package/dist/_node-chunks/story-docs-template-analysis-6YH7XNRB.js +163 -0
- package/dist/builders/build-storybook/index.js +8 -8
- package/dist/builders/start-storybook/index.js +8 -8
- package/dist/chunk-Bv2XDHY-.d.ts +64 -0
- package/dist/client/config.js +2 -2
- package/dist/client/docs/config.js +2 -2
- package/dist/client/index.js +4 -4
- package/dist/docgen/docgen-worker.js +1526 -565
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.js +6 -6
- package/dist/node/vitest.js +6 -6
- package/dist/preset.js +1078 -46
- package/package.json +6 -5
- package/start-schema.json +33 -5
- package/dist/_node-chunks/chunk-77BJXJPD.js +0 -195
- package/dist/chunk-D8_SR6hI.d.ts +0 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/angular-vite",
|
|
3
|
-
"version": "10.6.0-alpha.
|
|
3
|
+
"version": "10.6.0-alpha.7",
|
|
4
4
|
"description": "Storybook for Angular: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"!src/**/*"
|
|
64
64
|
],
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@storybook/builder-vite": "10.6.0-alpha.
|
|
66
|
+
"@storybook/builder-vite": "10.6.0-alpha.7",
|
|
67
67
|
"@storybook/global": "^5.0.0",
|
|
68
68
|
"telejson": "8.0.0",
|
|
69
69
|
"ts-dedent": "^2.0.0",
|
|
@@ -83,7 +83,8 @@
|
|
|
83
83
|
"@angular/platform-browser": "^21.2.14",
|
|
84
84
|
"@angular/platform-browser-dynamic": "^21.2.14",
|
|
85
85
|
"@babel/types": "^7.28.5",
|
|
86
|
-
"@storybook/angular-
|
|
86
|
+
"@storybook/angular-cm": "10.6.0-alpha.7",
|
|
87
|
+
"@storybook/angular-compodoc": "10.6.0-alpha.7",
|
|
87
88
|
"@types/node": "^22.19.1",
|
|
88
89
|
"empathic": "^2.0.0",
|
|
89
90
|
"memfs": "^4.11.1",
|
|
@@ -104,10 +105,10 @@
|
|
|
104
105
|
"@angular/core": ">=21.0.0 < 23.0.0",
|
|
105
106
|
"@angular/platform-browser": ">=21.0.0 < 23.0.0",
|
|
106
107
|
"rxjs": "^7.4.0",
|
|
107
|
-
"storybook": "^10.6.0-alpha.
|
|
108
|
+
"storybook": "^10.6.0-alpha.7",
|
|
108
109
|
"typescript": ">= 5.9.x",
|
|
109
110
|
"vite": ">=8.0.0",
|
|
110
|
-
"zone.js": ">=0.
|
|
111
|
+
"zone.js": ">=0.14.0"
|
|
111
112
|
},
|
|
112
113
|
"peerDependenciesMeta": {
|
|
113
114
|
"@angular/cli": {
|
package/start-schema.json
CHANGED
|
@@ -82,16 +82,16 @@
|
|
|
82
82
|
},
|
|
83
83
|
"compodoc": {
|
|
84
84
|
"type": "boolean",
|
|
85
|
-
"description": "
|
|
86
|
-
"
|
|
85
|
+
"description": "Deprecated. Compodoc no longer runs.",
|
|
86
|
+
"x-deprecated": "Compodoc no longer runs. @storybook/angular-vite extracts Angular metadata in-process, so this option does nothing. Remove it from angular.json."
|
|
87
87
|
},
|
|
88
88
|
"compodocArgs": {
|
|
89
89
|
"type": "array",
|
|
90
|
-
"description": "
|
|
91
|
-
"default": ["-e", "json"],
|
|
90
|
+
"description": "Deprecated. Compodoc no longer runs.",
|
|
92
91
|
"items": {
|
|
93
92
|
"type": "string"
|
|
94
|
-
}
|
|
93
|
+
},
|
|
94
|
+
"x-deprecated": "Compodoc no longer runs. @storybook/angular-vite extracts Angular metadata in-process, so this option does nothing. Remove it from angular.json."
|
|
95
95
|
},
|
|
96
96
|
"styles": {
|
|
97
97
|
"type": "array",
|
|
@@ -117,6 +117,34 @@
|
|
|
117
117
|
"items": {
|
|
118
118
|
"type": "string"
|
|
119
119
|
}
|
|
120
|
+
},
|
|
121
|
+
"sass": {
|
|
122
|
+
"description": "Options to pass to the sass preprocessor.",
|
|
123
|
+
"type": "object",
|
|
124
|
+
"properties": {
|
|
125
|
+
"fatalDeprecations": {
|
|
126
|
+
"description": "A set of deprecations to treat as fatal. If a deprecation warning of any provided type is encountered during compilation, the compiler will error instead. If a Version is provided, then all deprecations that were active in that compiler version will be treated as fatal.",
|
|
127
|
+
"type": "array",
|
|
128
|
+
"items": {
|
|
129
|
+
"type": "string"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"silenceDeprecations": {
|
|
133
|
+
"description": "A set of active deprecations to ignore. If a deprecation warning of any provided type is encountered during compilation, the compiler will ignore it instead.",
|
|
134
|
+
"type": "array",
|
|
135
|
+
"items": {
|
|
136
|
+
"type": "string"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"futureDeprecations": {
|
|
140
|
+
"description": "A set of future deprecations to opt into early. Future deprecations passed here will be treated as active by the compiler, emitting warnings as necessary.",
|
|
141
|
+
"type": "array",
|
|
142
|
+
"items": {
|
|
143
|
+
"type": "string"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"additionalProperties": false
|
|
120
148
|
}
|
|
121
149
|
},
|
|
122
150
|
"additionalProperties": false
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_1pj9uj7yzpf from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_1pj9uj7yzpf from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_1pj9uj7yzpf from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_1pj9uj7yzpf.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_1pj9uj7yzpf.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_1pj9uj7yzpf.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
findTsconfigUp
|
|
14
|
-
} from "./chunk-RC6UIUJ4.js";
|
|
15
|
-
|
|
16
|
-
// src/compodoc-config.ts
|
|
17
|
-
import { resolve } from "node:path";
|
|
18
|
-
var DEFAULT_COMPODOC_ARGS = ["-e", "json", "-d", "."], DOCUMENTATION_JSON = "documentation.json", readCompodocOutputDir = (compodocArgs) => {
|
|
19
|
-
for (let index = compodocArgs.length - 1; index >= 0; index--) {
|
|
20
|
-
let arg = compodocArgs[index];
|
|
21
|
-
if (arg.startsWith("--output="))
|
|
22
|
-
return arg.slice(9) || void 0;
|
|
23
|
-
if (arg === "-d" || arg === "--output") {
|
|
24
|
-
let value = compodocArgs[index + 1];
|
|
25
|
-
if (typeof value == "string" && !value.startsWith("-"))
|
|
26
|
-
return value;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}, resolveCompodocConfig = async (options, extra = {}) => {
|
|
30
|
-
let framework = await options?.presets?.apply("framework"), frameworkOptions = typeof framework == "string" ? {} : framework?.options ?? {}, workspaceRoot = options?.angularBuilderContext?.workspaceRoot ?? extra.viteRoot ?? // Mirrors what builder-vite does with Vite's root, which only `viteFinal` can pass along. Without
|
|
31
|
-
// it the docgen reader falls back to cwd and looks in a different directory than the writer.
|
|
32
|
-
(options?.configDir ? resolve(options.configDir, "..") : void 0) ?? process.cwd(), compodocArgs = frameworkOptions.compodocArgs ?? DEFAULT_COMPODOC_ARGS;
|
|
33
|
-
return {
|
|
34
|
-
/** `framework.options.compodoc`: `false` means the user opted out of Compodoc entirely. */
|
|
35
|
-
enabled: frameworkOptions.compodoc !== !1,
|
|
36
|
-
compodocArgs,
|
|
37
|
-
tsconfig: frameworkOptions.tsconfig ?? options?.tsConfig ?? options?.angularBuilderOptions?.tsConfig ?? // The same walk the builders use, so Compodoc is pointed at the tsconfig the Angular build
|
|
38
|
-
// would have picked rather than a different guess.
|
|
39
|
-
(options?.configDir ? findTsconfigUp(options.configDir) : void 0) ?? resolve(workspaceRoot, "tsconfig.json"),
|
|
40
|
-
/** Directory Compodoc runs in, and the base its relative `file` paths are written against. */
|
|
41
|
-
workspaceRoot,
|
|
42
|
-
/** Absolute directory Compodoc writes {@link DOCUMENTATION_JSON} into. */
|
|
43
|
-
outputDir: resolve(workspaceRoot, readCompodocOutputDir(compodocArgs) ?? ".")
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// src/compodoc/ensure-documentation.ts
|
|
48
|
-
import { withFileLock } from "storybook/internal/common";
|
|
49
|
-
import { logger as logger2 } from "storybook/internal/node-logger";
|
|
50
|
-
import { randomUUID } from "node:crypto";
|
|
51
|
-
import { readFileSync as readFileSync2, writeFileSync } from "node:fs";
|
|
52
|
-
import { join as join2 } from "node:path";
|
|
53
|
-
|
|
54
|
-
// src/compodoc/generate-documentation.ts
|
|
55
|
-
import { executeNodeCommand } from "storybook/internal/common";
|
|
56
|
-
import { logger } from "storybook/internal/node-logger";
|
|
57
|
-
import {
|
|
58
|
-
existsSync,
|
|
59
|
-
mkdirSync,
|
|
60
|
-
mkdtempSync,
|
|
61
|
-
readFileSync,
|
|
62
|
-
readdirSync,
|
|
63
|
-
renameSync,
|
|
64
|
-
rmSync,
|
|
65
|
-
statSync
|
|
66
|
-
} from "node:fs";
|
|
67
|
-
import { createRequire } from "node:module";
|
|
68
|
-
import { dirname, isAbsolute, join, relative, resolve as resolve2 } from "node:path";
|
|
69
|
-
import { pathToFileURL } from "node:url";
|
|
70
|
-
var COMPODOC_TIMEOUT_MS = 600 * 1e3, OUTPUT_TAIL_BYTES = 4e3, SCRATCH_PREFIX = ".compodoc-", resolveCompodocCli = (workspaceRoot) => {
|
|
71
|
-
let searchFrom = [pathToFileURL(join(resolve2(workspaceRoot), "noop.js")).href, import.meta.url];
|
|
72
|
-
for (let from of searchFrom)
|
|
73
|
-
try {
|
|
74
|
-
let packageJsonPath = createRequire(from).resolve("@compodoc/compodoc/package.json"), { bin } = JSON.parse(readFileSync(packageJsonPath, "utf8")), entry = typeof bin == "string" ? bin : bin?.compodoc;
|
|
75
|
-
if (entry)
|
|
76
|
-
return join(dirname(packageJsonPath), entry);
|
|
77
|
-
} catch {
|
|
78
|
-
}
|
|
79
|
-
}, hasTsconfigArg = (args) => args.includes("-p"), toChildRelativePath = (path, cwd) => isAbsolute(path) ? relative(cwd, path) : path, runCli = async (cli, args, cwd, timeoutMs) => {
|
|
80
|
-
let result = await executeNodeCommand({
|
|
81
|
-
scriptPath: cli,
|
|
82
|
-
args,
|
|
83
|
-
options: {
|
|
84
|
-
cwd,
|
|
85
|
-
// Interleaved into one stream, so the failure message reads in the order Compodoc printed it.
|
|
86
|
-
all: !0,
|
|
87
|
-
encoding: "utf8",
|
|
88
|
-
// Failures come back as a result rather than a throw, so a timeout and a non-zero exit are
|
|
89
|
-
// told apart by inspecting one object.
|
|
90
|
-
reject: !1,
|
|
91
|
-
timeout: timeoutMs,
|
|
92
|
-
// Compodoc does not shut down promptly on SIGTERM, and a hung scan would otherwise keep the
|
|
93
|
-
// docgen worker waiting for it.
|
|
94
|
-
killSignal: "SIGKILL"
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
if (!result.failed)
|
|
98
|
-
return;
|
|
99
|
-
let output = String(result.all ?? "").trim().slice(-OUTPUT_TAIL_BYTES);
|
|
100
|
-
throw new Error(
|
|
101
|
-
result.timedOut ? `Compodoc did not finish within ${timeoutMs}ms.
|
|
102
|
-
${output}` : `Compodoc exited with code ${result.exitCode}.
|
|
103
|
-
${output}`
|
|
104
|
-
);
|
|
105
|
-
}, removeAbandonedScratchDirs = (outputDir, olderThanMs) => {
|
|
106
|
-
let cutoff = Date.now() - olderThanMs;
|
|
107
|
-
for (let entry of readdirSync(outputDir, { withFileTypes: !0 })) {
|
|
108
|
-
if (!entry.isDirectory() || !entry.name.startsWith(SCRATCH_PREFIX))
|
|
109
|
-
continue;
|
|
110
|
-
let path = join(outputDir, entry.name);
|
|
111
|
-
try {
|
|
112
|
-
statSync(path).mtimeMs < cutoff && rmSync(path, { recursive: !0, force: !0 });
|
|
113
|
-
} catch {
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}, generateDocumentation = async ({
|
|
117
|
-
compodocArgs,
|
|
118
|
-
tsconfig,
|
|
119
|
-
workspaceRoot,
|
|
120
|
-
outputDir,
|
|
121
|
-
timeoutMs = COMPODOC_TIMEOUT_MS
|
|
122
|
-
}) => {
|
|
123
|
-
let cli = resolveCompodocCli(workspaceRoot);
|
|
124
|
-
if (!cli)
|
|
125
|
-
throw new Error(
|
|
126
|
-
"@compodoc/compodoc could not be resolved. Install it as a devDependency, or set framework.options.compodoc to false to turn Angular docgen off."
|
|
127
|
-
);
|
|
128
|
-
mkdirSync(outputDir, { recursive: !0 }), removeAbandonedScratchDirs(outputDir, timeoutMs);
|
|
129
|
-
let scratchDir = mkdtempSync(join(outputDir, SCRATCH_PREFIX)), startedAt = Date.now();
|
|
130
|
-
logger.info("[storybook-angular-vite] Generating Angular documentation with Compodoc...");
|
|
131
|
-
try {
|
|
132
|
-
await runCli(
|
|
133
|
-
cli,
|
|
134
|
-
[
|
|
135
|
-
...hasTsconfigArg(compodocArgs) ? [] : ["-p", toChildRelativePath(tsconfig, workspaceRoot)],
|
|
136
|
-
...compodocArgs,
|
|
137
|
-
// Last occurrence wins on Compodoc's command line, so this overrides any `-d`/`--output` the
|
|
138
|
-
// user configured. Their directory is where the finished file lands, not where it is built.
|
|
139
|
-
"-d",
|
|
140
|
-
scratchDir
|
|
141
|
-
],
|
|
142
|
-
workspaceRoot,
|
|
143
|
-
timeoutMs
|
|
144
|
-
);
|
|
145
|
-
let produced = join(scratchDir, DOCUMENTATION_JSON);
|
|
146
|
-
if (!existsSync(produced))
|
|
147
|
-
throw new Error(
|
|
148
|
-
`Compodoc finished without writing ${DOCUMENTATION_JSON}. Check that its arguments still export JSON: ${compodocArgs.join(" ")}`
|
|
149
|
-
);
|
|
150
|
-
renameSync(produced, join(outputDir, DOCUMENTATION_JSON)), logger.debug(
|
|
151
|
-
`[storybook-angular-vite] generated ${DOCUMENTATION_JSON} in ${Date.now() - startedAt}ms`
|
|
152
|
-
);
|
|
153
|
-
} finally {
|
|
154
|
-
rmSync(scratchDir, { recursive: !0, force: !0 });
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
// src/compodoc/ensure-documentation.ts
|
|
159
|
-
var COMPODOC_LOCK = ".compodoc.lock", COMPODOC_RUN_MARKER = ".compodoc.run", RUN_ID_ENV = "STORYBOOK_COMPODOC_RUN_ID", currentRunId = () => process.env[RUN_ID_ENV] ??= randomUUID(), markerRunId = (markerPath) => {
|
|
160
|
-
try {
|
|
161
|
-
return readFileSync2(markerPath, "utf8").trim();
|
|
162
|
-
} catch {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
}, ensureCompodocDocumentation = async ({
|
|
166
|
-
compodocArgs,
|
|
167
|
-
tsconfig,
|
|
168
|
-
workspaceRoot,
|
|
169
|
-
outputDir,
|
|
170
|
-
waitBudgetMs
|
|
171
|
-
}) => {
|
|
172
|
-
let markerPath = join2(outputDir, COMPODOC_RUN_MARKER), runId = currentRunId();
|
|
173
|
-
if (markerRunId(markerPath) !== runId)
|
|
174
|
-
try {
|
|
175
|
-
await withFileLock(
|
|
176
|
-
join2(outputDir, COMPODOC_LOCK),
|
|
177
|
-
async () => {
|
|
178
|
-
markerRunId(markerPath) !== runId && (await generateDocumentation({ compodocArgs, tsconfig, workspaceRoot, outputDir }), writeFileSync(markerPath, runId));
|
|
179
|
-
},
|
|
180
|
-
{ waitBudgetMs }
|
|
181
|
-
) === "busy" && logger2.debug(
|
|
182
|
-
`[storybook-angular-vite] another process is still generating ${DOCUMENTATION_JSON}; continuing with what is on disk`
|
|
183
|
-
);
|
|
184
|
-
} catch (error) {
|
|
185
|
-
logger2.warn(
|
|
186
|
-
`[storybook-angular-vite] Compodoc generation failed: ${error instanceof Error ? error.message : String(error)}`
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
export {
|
|
192
|
-
DOCUMENTATION_JSON,
|
|
193
|
-
resolveCompodocConfig,
|
|
194
|
-
ensureCompodocDocumentation
|
|
195
|
-
};
|
package/dist/chunk-D8_SR6hI.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { CompatibleString, StorybookConfig } from "storybook/internal/types";
|
|
2
|
-
import { BuilderOptions, StorybookConfigVite } from "@storybook/builder-vite";
|
|
3
|
-
|
|
4
|
-
//#region code/frameworks/angular-vite/.dts-emit/code/frameworks/angular-vite/src/types.d.ts
|
|
5
|
-
type FrameworkName = CompatibleString<'@storybook/angular-vite'>;
|
|
6
|
-
type BuilderName = CompatibleString<'@storybook/builder-vite'>;
|
|
7
|
-
type FrameworkOptions = {
|
|
8
|
-
builder?: BuilderOptions;
|
|
9
|
-
jit?: boolean;
|
|
10
|
-
liveReload?: boolean;
|
|
11
|
-
inlineStylesExtension?: string;
|
|
12
|
-
tsconfig?: string;
|
|
13
|
-
compodoc?: boolean;
|
|
14
|
-
compodocArgs?: string[];
|
|
15
|
-
};
|
|
16
|
-
type StorybookConfigFramework = {
|
|
17
|
-
framework: FrameworkName | {
|
|
18
|
-
name: FrameworkName;
|
|
19
|
-
options: FrameworkOptions;
|
|
20
|
-
};
|
|
21
|
-
core?: StorybookConfig['core'] & {
|
|
22
|
-
builder?: BuilderName | {
|
|
23
|
-
name: BuilderName;
|
|
24
|
-
options: BuilderOptions;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
/** The interface for Storybook configuration in `main.ts` files. */
|
|
29
|
-
type StorybookConfig$1 = Omit<StorybookConfig, keyof StorybookConfigVite | keyof StorybookConfigFramework> & StorybookConfigVite & StorybookConfigFramework;
|
|
30
|
-
//#endregion
|
|
31
|
-
export { StorybookConfig$1 as n, FrameworkOptions as t };
|