@storybook/angular 10.3.0-alpha.14 → 10.3.0-alpha.16
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/dist/_node-chunks/angular-cli-webpack-TYBI7KLP.js +163 -0
- package/dist/_node-chunks/{chunk-KXBZI6Z3.js → chunk-HWKMNO6W.js} +6 -6
- package/dist/_node-chunks/{chunk-D4BOQI5B.js → chunk-P7XRY6AR.js} +7 -7
- package/dist/builders/build-storybook/index.js +8 -8
- package/dist/builders/start-storybook/index.js +8 -8
- package/dist/node/index.js +6 -6
- package/dist/preset.js +6 -6
- package/dist/server/framework-preset-angular-cli.js +12 -163
- package/dist/server/framework-preset-angular-ivy.js +6 -6
- package/package.json +4 -4
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_3yucm36auc1 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_3yucm36auc1 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_3yucm36auc1 from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_3yucm36auc1.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_3yucm36auc1.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_3yucm36auc1.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
// src/server/angular-cli-webpack.js
|
|
14
|
+
import { createRequire } from "node:module";
|
|
15
|
+
|
|
16
|
+
// src/server/plugins/storybook-normalize-angular-entry-plugin.js
|
|
17
|
+
var PLUGIN_NAME = "storybook-normalize-angular-entry-plugin", StorybookNormalizeAngularEntryPlugin = class {
|
|
18
|
+
constructor(options) {
|
|
19
|
+
this.options = options;
|
|
20
|
+
}
|
|
21
|
+
apply(compiler) {
|
|
22
|
+
compiler.hooks.environment.tap(PLUGIN_NAME, () => {
|
|
23
|
+
let originalEntry = compiler.options.entry;
|
|
24
|
+
compiler.options.entry = async () => {
|
|
25
|
+
let entryResult;
|
|
26
|
+
if (typeof originalEntry == "function")
|
|
27
|
+
try {
|
|
28
|
+
entryResult = await originalEntry();
|
|
29
|
+
} catch (error) {
|
|
30
|
+
throw console.error("Failed to execute the entry function:", error), error;
|
|
31
|
+
}
|
|
32
|
+
else
|
|
33
|
+
entryResult = originalEntry;
|
|
34
|
+
return entryResult && entryResult.main && entryResult.styles ? {
|
|
35
|
+
main: {
|
|
36
|
+
import: Array.from(
|
|
37
|
+
/* @__PURE__ */ new Set([...entryResult.main.import, ...entryResult.styles.import])
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
} : entryResult;
|
|
41
|
+
};
|
|
42
|
+
}), compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
|
|
43
|
+
this.compilation = compilation;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// src/server/utils/filter-out-styling-rules.ts
|
|
49
|
+
var isStylingRule = (rule) => {
|
|
50
|
+
let { test } = rule;
|
|
51
|
+
return !test || !(test instanceof RegExp) ? !1 : test.test(".css") || test.test(".scss") || test.test(".sass");
|
|
52
|
+
}, filterOutStylingRules = (config) => config.module.rules.filter((rule) => !isStylingRule(rule));
|
|
53
|
+
|
|
54
|
+
// src/server/angular-cli-webpack.js
|
|
55
|
+
var require2 = createRequire(import.meta.url), {
|
|
56
|
+
generateI18nBrowserWebpackConfigFromContext
|
|
57
|
+
} = require2("@angular-devkit/build-angular/src/utils/webpack-browser-config"), TsconfigPathsPlugin = require2("tsconfig-paths-webpack-plugin"), {
|
|
58
|
+
getCommonConfig,
|
|
59
|
+
getStylesConfig,
|
|
60
|
+
getDevServerConfig,
|
|
61
|
+
getTypeScriptConfig
|
|
62
|
+
} = require2("@angular-devkit/build-angular/src/tools/webpack/configs"), getWebpackConfig = async (baseConfig, { builderOptions, builderContext }) => {
|
|
63
|
+
async function getCustomStylesConfig(wco) {
|
|
64
|
+
let { root } = wco;
|
|
65
|
+
if ((() => {
|
|
66
|
+
try {
|
|
67
|
+
let output = import.meta.resolve("@tailwindcss/postcss", root);
|
|
68
|
+
return isAbsolute(output);
|
|
69
|
+
} catch {
|
|
70
|
+
return !1;
|
|
71
|
+
}
|
|
72
|
+
})()) {
|
|
73
|
+
let fs = require2("node:fs/promises"), originalReaddir = fs.readdir;
|
|
74
|
+
fs.readdir = async function(path, options) {
|
|
75
|
+
let results = await originalReaddir.call(this, path, options), tailwindFiles = [
|
|
76
|
+
"tailwind.config.js",
|
|
77
|
+
"tailwind.config.cjs",
|
|
78
|
+
"tailwind.config.mjs",
|
|
79
|
+
"tailwind.config.ts"
|
|
80
|
+
];
|
|
81
|
+
return results.filter((file) => !tailwindFiles.includes(file));
|
|
82
|
+
};
|
|
83
|
+
let styleConfig = await getStylesConfig(wco);
|
|
84
|
+
fs.readdir = originalReaddir;
|
|
85
|
+
let tailwindPackage = await import(import.meta.resolve("@tailwindcss/postcss", root)), extraPostcssPlugins = [
|
|
86
|
+
typeof tailwindPackage == "function" ? tailwindPackage() : tailwindPackage.default()
|
|
87
|
+
];
|
|
88
|
+
return styleConfig.module.rules.map((rule) => rule.rules).forEach((rule) => {
|
|
89
|
+
rule.forEach((r) => {
|
|
90
|
+
r.oneOf?.forEach?.((oneOfRule) => oneOfRule.use.forEach((use) => {
|
|
91
|
+
if (use.loader.includes("postcss-loader") && use.options.postcssOptions) {
|
|
92
|
+
let originalOptionsFn = use.options.postcssOptions;
|
|
93
|
+
use.options.postcssOptions = (loaderOptions) => {
|
|
94
|
+
let originalOptions = originalOptionsFn(loaderOptions);
|
|
95
|
+
return {
|
|
96
|
+
...originalOptions,
|
|
97
|
+
plugins: [...originalOptions.plugins, ...extraPostcssPlugins]
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}));
|
|
102
|
+
});
|
|
103
|
+
}), styleConfig;
|
|
104
|
+
} else
|
|
105
|
+
return getStylesConfig(wco);
|
|
106
|
+
}
|
|
107
|
+
let { config: cliConfig } = await generateI18nBrowserWebpackConfigFromContext(
|
|
108
|
+
{
|
|
109
|
+
// Default options
|
|
110
|
+
index: "noop-index",
|
|
111
|
+
main: "noop-main",
|
|
112
|
+
// Options provided by user
|
|
113
|
+
...builderOptions,
|
|
114
|
+
styles: builderOptions.styles?.map((style) => typeof style == "string" ? style : style.input).filter((style) => typeof style == "string" || style.inject !== !1),
|
|
115
|
+
outputPath: typeof builderOptions.outputPath == "string" ? builderOptions.outputPath : builderOptions.outputPath?.base ?? "noop-out",
|
|
116
|
+
// Fixed options
|
|
117
|
+
optimization: !1,
|
|
118
|
+
namedChunks: !1,
|
|
119
|
+
progress: !1,
|
|
120
|
+
buildOptimizer: !1,
|
|
121
|
+
aot: !1
|
|
122
|
+
},
|
|
123
|
+
builderContext,
|
|
124
|
+
(wco) => [
|
|
125
|
+
getCommonConfig(wco),
|
|
126
|
+
getCustomStylesConfig(wco),
|
|
127
|
+
getTypeScriptConfig ? getTypeScriptConfig(wco) : getDevServerConfig(wco)
|
|
128
|
+
]
|
|
129
|
+
);
|
|
130
|
+
!builderOptions.experimentalZoneless && !cliConfig.entry.polyfills?.includes("zone.js") && (cliConfig.entry.polyfills ??= [], cliConfig.entry.polyfills.push("zone.js"));
|
|
131
|
+
let entry = [
|
|
132
|
+
...cliConfig.entry.polyfills ?? [],
|
|
133
|
+
...baseConfig.entry,
|
|
134
|
+
...cliConfig.entry.styles ?? []
|
|
135
|
+
], rulesExcludingStyles = filterOutStylingRules(baseConfig), module = {
|
|
136
|
+
...baseConfig.module,
|
|
137
|
+
rules: [...cliConfig.module.rules, ...rulesExcludingStyles]
|
|
138
|
+
}, plugins = [
|
|
139
|
+
...cliConfig.plugins ?? [],
|
|
140
|
+
...baseConfig.plugins,
|
|
141
|
+
new StorybookNormalizeAngularEntryPlugin()
|
|
142
|
+
], resolve = {
|
|
143
|
+
...baseConfig.resolve,
|
|
144
|
+
modules: Array.from(/* @__PURE__ */ new Set([...baseConfig.resolve.modules, ...cliConfig.resolve.modules])),
|
|
145
|
+
plugins: [
|
|
146
|
+
new TsconfigPathsPlugin({
|
|
147
|
+
configFile: builderOptions.tsConfig,
|
|
148
|
+
mainFields: ["browser", "module", "main"]
|
|
149
|
+
})
|
|
150
|
+
]
|
|
151
|
+
};
|
|
152
|
+
return {
|
|
153
|
+
...baseConfig,
|
|
154
|
+
entry,
|
|
155
|
+
module,
|
|
156
|
+
plugins,
|
|
157
|
+
resolve,
|
|
158
|
+
resolveLoader: cliConfig.resolveLoader
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
export {
|
|
162
|
+
getWebpackConfig
|
|
163
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_3yucm36auc1 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_3yucm36auc1 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_3yucm36auc1 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_3yucm36auc1.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_3yucm36auc1.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_3yucm36auc1.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_3yucm36auc1 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_3yucm36auc1 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_3yucm36auc1 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_3yucm36auc1.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_3yucm36auc1.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_3yucm36auc1.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
up
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-HWKMNO6W.js";
|
|
15
15
|
|
|
16
16
|
// ../../../node_modules/empathic/package.mjs
|
|
17
17
|
function up2(options) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_3yucm36auc1 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_3yucm36auc1 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_3yucm36auc1 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_3yucm36auc1.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_3yucm36auc1.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_3yucm36auc1.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
printErrorDetails,
|
|
15
15
|
runCompodoc,
|
|
16
16
|
up as up2
|
|
17
|
-
} from "../../_node-chunks/chunk-
|
|
17
|
+
} from "../../_node-chunks/chunk-P7XRY6AR.js";
|
|
18
18
|
import {
|
|
19
19
|
up
|
|
20
|
-
} from "../../_node-chunks/chunk-
|
|
20
|
+
} from "../../_node-chunks/chunk-HWKMNO6W.js";
|
|
21
21
|
|
|
22
22
|
// src/builders/build-storybook/index.ts
|
|
23
23
|
import { readFileSync } from "node:fs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_3yucm36auc1 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_3yucm36auc1 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_3yucm36auc1 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_3yucm36auc1.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_3yucm36auc1.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_3yucm36auc1.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
printErrorDetails,
|
|
15
15
|
runCompodoc,
|
|
16
16
|
up as up2
|
|
17
|
-
} from "../../_node-chunks/chunk-
|
|
17
|
+
} from "../../_node-chunks/chunk-P7XRY6AR.js";
|
|
18
18
|
import {
|
|
19
19
|
up
|
|
20
|
-
} from "../../_node-chunks/chunk-
|
|
20
|
+
} from "../../_node-chunks/chunk-HWKMNO6W.js";
|
|
21
21
|
|
|
22
22
|
// src/builders/start-storybook/index.ts
|
|
23
23
|
import { readFileSync } from "node:fs";
|
package/dist/node/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_3yucm36auc1 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_3yucm36auc1 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_3yucm36auc1 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_3yucm36auc1.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_3yucm36auc1.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_3yucm36auc1.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_3yucm36auc1 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_3yucm36auc1 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_3yucm36auc1 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_3yucm36auc1.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_3yucm36auc1.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_3yucm36auc1.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -1,175 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_3yucm36auc1 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_3yucm36auc1 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_3yucm36auc1 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_3yucm36auc1.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_3yucm36auc1.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_3yucm36auc1.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
up
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-HWKMNO6W.js";
|
|
15
15
|
|
|
16
16
|
// src/server/framework-preset-angular-cli.ts
|
|
17
17
|
import { logger } from "storybook/internal/node-logger";
|
|
18
18
|
import { AngularLegacyBuildOptionsError } from "storybook/internal/server-errors";
|
|
19
|
-
import { WebpackDefinePlugin, WebpackIgnorePlugin } from "@storybook/builder-webpack5";
|
|
20
19
|
import { targetFromTargetString } from "@angular-devkit/architect";
|
|
21
20
|
import { logging } from "@angular-devkit/core";
|
|
22
|
-
|
|
23
|
-
// src/server/angular-cli-webpack.js
|
|
24
|
-
import { createRequire } from "node:module";
|
|
25
|
-
|
|
26
|
-
// src/server/plugins/storybook-normalize-angular-entry-plugin.js
|
|
27
|
-
var PLUGIN_NAME = "storybook-normalize-angular-entry-plugin", StorybookNormalizeAngularEntryPlugin = class {
|
|
28
|
-
constructor(options) {
|
|
29
|
-
this.options = options;
|
|
30
|
-
}
|
|
31
|
-
apply(compiler) {
|
|
32
|
-
compiler.hooks.environment.tap(PLUGIN_NAME, () => {
|
|
33
|
-
let originalEntry = compiler.options.entry;
|
|
34
|
-
compiler.options.entry = async () => {
|
|
35
|
-
let entryResult;
|
|
36
|
-
if (typeof originalEntry == "function")
|
|
37
|
-
try {
|
|
38
|
-
entryResult = await originalEntry();
|
|
39
|
-
} catch (error) {
|
|
40
|
-
throw console.error("Failed to execute the entry function:", error), error;
|
|
41
|
-
}
|
|
42
|
-
else
|
|
43
|
-
entryResult = originalEntry;
|
|
44
|
-
return entryResult && entryResult.main && entryResult.styles ? {
|
|
45
|
-
main: {
|
|
46
|
-
import: Array.from(
|
|
47
|
-
/* @__PURE__ */ new Set([...entryResult.main.import, ...entryResult.styles.import])
|
|
48
|
-
)
|
|
49
|
-
}
|
|
50
|
-
} : entryResult;
|
|
51
|
-
};
|
|
52
|
-
}), compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
|
|
53
|
-
this.compilation = compilation;
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
// src/server/utils/filter-out-styling-rules.ts
|
|
59
|
-
var isStylingRule = (rule) => {
|
|
60
|
-
let { test } = rule;
|
|
61
|
-
return !test || !(test instanceof RegExp) ? !1 : test.test(".css") || test.test(".scss") || test.test(".sass");
|
|
62
|
-
}, filterOutStylingRules = (config) => config.module.rules.filter((rule) => !isStylingRule(rule));
|
|
63
|
-
|
|
64
|
-
// src/server/angular-cli-webpack.js
|
|
65
|
-
var require2 = createRequire(import.meta.url), {
|
|
66
|
-
generateI18nBrowserWebpackConfigFromContext
|
|
67
|
-
} = require2("@angular-devkit/build-angular/src/utils/webpack-browser-config"), TsconfigPathsPlugin = require2("tsconfig-paths-webpack-plugin"), {
|
|
68
|
-
getCommonConfig,
|
|
69
|
-
getStylesConfig,
|
|
70
|
-
getDevServerConfig,
|
|
71
|
-
getTypeScriptConfig
|
|
72
|
-
} = require2("@angular-devkit/build-angular/src/tools/webpack/configs"), getWebpackConfig = async (baseConfig, { builderOptions, builderContext }) => {
|
|
73
|
-
async function getCustomStylesConfig(wco) {
|
|
74
|
-
let { root } = wco;
|
|
75
|
-
if ((() => {
|
|
76
|
-
try {
|
|
77
|
-
let output = import.meta.resolve("@tailwindcss/postcss", root);
|
|
78
|
-
return isAbsolute(output);
|
|
79
|
-
} catch {
|
|
80
|
-
return !1;
|
|
81
|
-
}
|
|
82
|
-
})()) {
|
|
83
|
-
let fs = require2("node:fs/promises"), originalReaddir = fs.readdir;
|
|
84
|
-
fs.readdir = async function(path2, options) {
|
|
85
|
-
let results = await originalReaddir.call(this, path2, options), tailwindFiles = [
|
|
86
|
-
"tailwind.config.js",
|
|
87
|
-
"tailwind.config.cjs",
|
|
88
|
-
"tailwind.config.mjs",
|
|
89
|
-
"tailwind.config.ts"
|
|
90
|
-
];
|
|
91
|
-
return results.filter((file) => !tailwindFiles.includes(file));
|
|
92
|
-
};
|
|
93
|
-
let styleConfig = await getStylesConfig(wco);
|
|
94
|
-
fs.readdir = originalReaddir;
|
|
95
|
-
let tailwindPackage = await import(import.meta.resolve("@tailwindcss/postcss", root)), extraPostcssPlugins = [
|
|
96
|
-
typeof tailwindPackage == "function" ? tailwindPackage() : tailwindPackage.default()
|
|
97
|
-
];
|
|
98
|
-
return styleConfig.module.rules.map((rule) => rule.rules).forEach((rule) => {
|
|
99
|
-
rule.forEach((r) => {
|
|
100
|
-
r.oneOf?.forEach?.((oneOfRule) => oneOfRule.use.forEach((use) => {
|
|
101
|
-
if (use.loader.includes("postcss-loader") && use.options.postcssOptions) {
|
|
102
|
-
let originalOptionsFn = use.options.postcssOptions;
|
|
103
|
-
use.options.postcssOptions = (loaderOptions) => {
|
|
104
|
-
let originalOptions = originalOptionsFn(loaderOptions);
|
|
105
|
-
return {
|
|
106
|
-
...originalOptions,
|
|
107
|
-
plugins: [...originalOptions.plugins, ...extraPostcssPlugins]
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
}));
|
|
112
|
-
});
|
|
113
|
-
}), styleConfig;
|
|
114
|
-
} else
|
|
115
|
-
return getStylesConfig(wco);
|
|
116
|
-
}
|
|
117
|
-
let { config: cliConfig } = await generateI18nBrowserWebpackConfigFromContext(
|
|
118
|
-
{
|
|
119
|
-
// Default options
|
|
120
|
-
index: "noop-index",
|
|
121
|
-
main: "noop-main",
|
|
122
|
-
// Options provided by user
|
|
123
|
-
...builderOptions,
|
|
124
|
-
styles: builderOptions.styles?.map((style) => typeof style == "string" ? style : style.input).filter((style) => typeof style == "string" || style.inject !== !1),
|
|
125
|
-
outputPath: typeof builderOptions.outputPath == "string" ? builderOptions.outputPath : builderOptions.outputPath?.base ?? "noop-out",
|
|
126
|
-
// Fixed options
|
|
127
|
-
optimization: !1,
|
|
128
|
-
namedChunks: !1,
|
|
129
|
-
progress: !1,
|
|
130
|
-
buildOptimizer: !1,
|
|
131
|
-
aot: !1
|
|
132
|
-
},
|
|
133
|
-
builderContext,
|
|
134
|
-
(wco) => [
|
|
135
|
-
getCommonConfig(wco),
|
|
136
|
-
getCustomStylesConfig(wco),
|
|
137
|
-
getTypeScriptConfig ? getTypeScriptConfig(wco) : getDevServerConfig(wco)
|
|
138
|
-
]
|
|
139
|
-
);
|
|
140
|
-
!builderOptions.experimentalZoneless && !cliConfig.entry.polyfills?.includes("zone.js") && (cliConfig.entry.polyfills ??= [], cliConfig.entry.polyfills.push("zone.js"));
|
|
141
|
-
let entry = [
|
|
142
|
-
...cliConfig.entry.polyfills ?? [],
|
|
143
|
-
...baseConfig.entry,
|
|
144
|
-
...cliConfig.entry.styles ?? []
|
|
145
|
-
], rulesExcludingStyles = filterOutStylingRules(baseConfig), module = {
|
|
146
|
-
...baseConfig.module,
|
|
147
|
-
rules: [...cliConfig.module.rules, ...rulesExcludingStyles]
|
|
148
|
-
}, plugins = [
|
|
149
|
-
...cliConfig.plugins ?? [],
|
|
150
|
-
...baseConfig.plugins,
|
|
151
|
-
new StorybookNormalizeAngularEntryPlugin()
|
|
152
|
-
], resolve2 = {
|
|
153
|
-
...baseConfig.resolve,
|
|
154
|
-
modules: Array.from(/* @__PURE__ */ new Set([...baseConfig.resolve.modules, ...cliConfig.resolve.modules])),
|
|
155
|
-
plugins: [
|
|
156
|
-
new TsconfigPathsPlugin({
|
|
157
|
-
configFile: builderOptions.tsConfig,
|
|
158
|
-
mainFields: ["browser", "module", "main"]
|
|
159
|
-
})
|
|
160
|
-
]
|
|
161
|
-
};
|
|
162
|
-
return {
|
|
163
|
-
...baseConfig,
|
|
164
|
-
entry,
|
|
165
|
-
module,
|
|
166
|
-
plugins,
|
|
167
|
-
resolve: resolve2,
|
|
168
|
-
resolveLoader: cliConfig.resolveLoader
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
// src/server/framework-preset-angular-cli.ts
|
|
173
21
|
import { getProjectRoot, resolvePackageDir } from "storybook/internal/common";
|
|
174
22
|
|
|
175
23
|
// ../../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
|
|
@@ -187,9 +35,9 @@ var resolve = function(...arguments_) {
|
|
|
187
35
|
let resolvedPath = "", resolvedAbsolute = !1;
|
|
188
36
|
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
189
37
|
let path2 = index >= 0 ? arguments_[index] : cwd();
|
|
190
|
-
!path2 || path2.length === 0 || (resolvedPath = `${path2}/${resolvedPath}`, resolvedAbsolute =
|
|
38
|
+
!path2 || path2.length === 0 || (resolvedPath = `${path2}/${resolvedPath}`, resolvedAbsolute = isAbsolute(path2));
|
|
191
39
|
}
|
|
192
|
-
return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !
|
|
40
|
+
return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
|
|
193
41
|
};
|
|
194
42
|
function normalizeString(path2, allowAboveRoot) {
|
|
195
43
|
let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
|
|
@@ -221,7 +69,7 @@ function normalizeString(path2, allowAboveRoot) {
|
|
|
221
69
|
}
|
|
222
70
|
return res;
|
|
223
71
|
}
|
|
224
|
-
var
|
|
72
|
+
var isAbsolute = function(p) {
|
|
225
73
|
return _IS_ABSOLUTE_RE.test(p);
|
|
226
74
|
};
|
|
227
75
|
var relative = function(from, to) {
|
|
@@ -241,8 +89,9 @@ var relative = function(from, to) {
|
|
|
241
89
|
async function webpackFinal(baseConfig, options) {
|
|
242
90
|
if (!resolvePackageDir("@angular-devkit/build-angular"))
|
|
243
91
|
return logger.info('Using base config because "@angular-devkit/build-angular" is not installed'), baseConfig;
|
|
92
|
+
let { WebpackDefinePlugin, WebpackIgnorePlugin } = await import("@storybook/builder-webpack5"), { getWebpackConfig: getCustomWebpackConfig } = await import("../_node-chunks/angular-cli-webpack-TYBI7KLP.js");
|
|
244
93
|
checkForLegacyBuildOptions(options);
|
|
245
|
-
let builderContext = getBuilderContext(options), builderOptions = await getBuilderOptions(options, builderContext), webpackConfig = await
|
|
94
|
+
let builderContext = getBuilderContext(options), builderOptions = await getBuilderOptions(options, builderContext), webpackConfig = await getCustomWebpackConfig(baseConfig, {
|
|
246
95
|
builderOptions: {
|
|
247
96
|
watch: options.configType === "DEVELOPMENT",
|
|
248
97
|
...builderOptions
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_3yucm36auc1 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_3yucm36auc1 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_3yucm36auc1 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_3yucm36auc1.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_3yucm36auc1.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_3yucm36auc1.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/angular",
|
|
3
|
-
"version": "10.3.0-alpha.
|
|
3
|
+
"version": "10.3.0-alpha.16",
|
|
4
4
|
"description": "Storybook for Angular: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"!src/**/*"
|
|
60
60
|
],
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@storybook/builder-webpack5": "10.3.0-alpha.
|
|
62
|
+
"@storybook/builder-webpack5": "10.3.0-alpha.16",
|
|
63
63
|
"@storybook/global": "^5.0.0",
|
|
64
64
|
"telejson": "8.0.0",
|
|
65
65
|
"ts-dedent": "^2.0.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"@angular/forms": "^19.1.1",
|
|
80
80
|
"@angular/platform-browser": "^19.1.1",
|
|
81
81
|
"@angular/platform-browser-dynamic": "^19.1.1",
|
|
82
|
-
"@storybook/core-webpack": "10.3.0-alpha.
|
|
82
|
+
"@storybook/core-webpack": "10.3.0-alpha.16",
|
|
83
83
|
"@types/node": "^22.19.1",
|
|
84
84
|
"empathic": "^2.0.0",
|
|
85
85
|
"rimraf": "^6.0.1",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"@angular/platform-browser": ">=18.0.0 < 22.0.0",
|
|
101
101
|
"@angular/platform-browser-dynamic": ">=18.0.0 < 22.0.0",
|
|
102
102
|
"rxjs": "^6.5.3 || ^7.4.0",
|
|
103
|
-
"storybook": "^10.3.0-alpha.
|
|
103
|
+
"storybook": "^10.3.0-alpha.16",
|
|
104
104
|
"typescript": "^4.9.0 || ^5.0.0",
|
|
105
105
|
"zone.js": ">=0.14.0"
|
|
106
106
|
},
|