@storybook/angular 9.2.0-alpha.3 → 10.0.0-beta.1
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 +3 -1
- package/dist/_browser-chunks/chunk-CV6HSYTZ.js +92 -0
- package/dist/_browser-chunks/chunk-DAHG2CDK.js +3 -0
- package/dist/_browser-chunks/chunk-L4GU2V72.js +939 -0
- package/dist/_node-chunks/chunk-2MYYSDON.js +17 -0
- package/dist/_node-chunks/chunk-QEVN44EN.js +330 -0
- package/dist/_node-chunks/chunk-Z7HIDXSI.js +135 -0
- package/dist/builders/build-storybook/index.js +137 -28
- package/dist/builders/start-storybook/index.js +161 -28
- package/dist/client/config.js +304 -46
- package/dist/client/docs/config.js +54 -15
- package/dist/client/index.js +16 -47
- package/dist/client/preview-prod.js +3 -5
- package/dist/index.d.ts +177 -6
- package/dist/index.js +16 -47
- package/dist/node/index.d.ts +56 -0
- package/dist/node/index.js +23 -0
- package/dist/preset.js +54 -7
- package/dist/server/framework-preset-angular-cli.js +312 -18
- package/dist/server/framework-preset-angular-ivy.js +57 -5
- package/package.json +24 -70
- package/preset.js +1 -1
- package/dist/chunk-CUDJAP6K.mjs +0 -3
- package/dist/chunk-KMSSK3DZ.mjs +0 -6
- package/dist/chunk-LXSTVAFF.mjs +0 -40
- package/dist/client/config.d.ts +0 -20
- package/dist/client/config.mjs +0 -11
- package/dist/client/docs/config.d.ts +0 -6
- package/dist/client/docs/config.mjs +0 -7
- package/dist/client/index.d.ts +0 -144
- package/dist/client/index.mjs +0 -3
- package/dist/client/preview-prod.d.ts +0 -2
- package/dist/client/preview-prod.mjs +0 -3
- package/dist/index.mjs +0 -3
- package/dist/types-3b0b7107.d.ts +0 -42
- package/renderer.d.ts +0 -1
- package/renderer.js +0 -1
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
import CJS_COMPAT_NODE_URL_x1uj59add6 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_x1uj59add6 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_x1uj59add6 from "node:module";
|
|
2
4
|
|
|
3
|
-
var
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_x1uj59add6.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_x1uj59add6.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_x1uj59add6.createRequire(import.meta.url);
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
__name
|
|
14
|
+
} from "./_node-chunks/chunk-2MYYSDON.js";
|
|
6
15
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
16
|
+
// src/preset.ts
|
|
17
|
+
var addons = [
|
|
18
|
+
import.meta.resolve("@storybook/angular/server/framework-preset-angular-cli"),
|
|
19
|
+
import.meta.resolve("@storybook/angular/server/framework-preset-angular-ivy")
|
|
20
|
+
];
|
|
21
|
+
var previewAnnotations = /* @__PURE__ */ __name(async (entries = [], options) => {
|
|
22
|
+
const config = import.meta.resolve("@storybook/angular/client/config");
|
|
23
|
+
const annotations = [...entries, config];
|
|
24
|
+
if (options.enableProdMode) {
|
|
25
|
+
const previewProdPath = import.meta.resolve("@storybook/angular/client/preview-prod");
|
|
26
|
+
annotations.unshift(previewProdPath);
|
|
27
|
+
}
|
|
28
|
+
const docsConfig = await options.presets.apply("docs", {}, options);
|
|
29
|
+
const docsEnabled = Object.keys(docsConfig).length > 0;
|
|
30
|
+
if (docsEnabled) {
|
|
31
|
+
const docsConfigPath = import.meta.resolve("@storybook/angular/client/docs/config");
|
|
32
|
+
annotations.push(docsConfigPath);
|
|
33
|
+
}
|
|
34
|
+
return annotations;
|
|
35
|
+
}, "previewAnnotations");
|
|
36
|
+
var core = /* @__PURE__ */ __name(async (config, options) => {
|
|
37
|
+
const framework = await options.presets.apply("framework");
|
|
38
|
+
return {
|
|
39
|
+
...config,
|
|
40
|
+
builder: {
|
|
41
|
+
name: import.meta.resolve("@storybook/builder-webpack5"),
|
|
42
|
+
options: typeof framework === "string" ? {} : framework.options.builder || {}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}, "core");
|
|
46
|
+
var typescript = /* @__PURE__ */ __name(async (config) => {
|
|
47
|
+
return {
|
|
48
|
+
...config,
|
|
49
|
+
skipCompiler: true
|
|
50
|
+
};
|
|
51
|
+
}, "typescript");
|
|
52
|
+
export {
|
|
53
|
+
addons,
|
|
54
|
+
core,
|
|
55
|
+
previewAnnotations,
|
|
56
|
+
typescript
|
|
57
|
+
};
|
|
@@ -1,23 +1,317 @@
|
|
|
1
|
-
|
|
1
|
+
import CJS_COMPAT_NODE_URL_x1uj59add6 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_x1uj59add6 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_x1uj59add6 from "node:module";
|
|
2
4
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var architect = require('@angular-devkit/architect');
|
|
7
|
-
var core = require('@angular-devkit/core');
|
|
8
|
-
var path2 = require('path');
|
|
9
|
-
var process2 = require('process');
|
|
10
|
-
var fs = require('fs');
|
|
11
|
-
var url = require('url');
|
|
12
|
-
var common = require('storybook/internal/common');
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_x1uj59add6.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_x1uj59add6.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_x1uj59add6.createRequire(import.meta.url);
|
|
13
8
|
|
|
14
|
-
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
findUp
|
|
14
|
+
} from "../_node-chunks/chunk-QEVN44EN.js";
|
|
15
|
+
import {
|
|
16
|
+
__name
|
|
17
|
+
} from "../_node-chunks/chunk-2MYYSDON.js";
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
// src/server/framework-preset-angular-cli.ts
|
|
20
|
+
import { logger } from "storybook/internal/node-logger";
|
|
21
|
+
import { AngularLegacyBuildOptionsError } from "storybook/internal/server-errors";
|
|
22
|
+
import { WebpackDefinePlugin, WebpackIgnorePlugin } from "@storybook/builder-webpack5";
|
|
23
|
+
import { targetFromTargetString } from "@angular-devkit/architect";
|
|
24
|
+
import { logging } from "@angular-devkit/core";
|
|
18
25
|
|
|
19
|
-
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __require=(x=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(x,{get:(a,b)=>(typeof require<"u"?require:a)[b]}):x)(function(x){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+x+'" is not supported')});var __esm=(fn,res)=>function(){return fn&&(res=(0, fn[__getOwnPropNames(fn)[0]])(fn=0)),res};var __commonJS=(cb,mod)=>function(){return mod||(0, cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0});},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var filter_out_styling_rules_exports={};__export(filter_out_styling_rules_exports,{filterOutStylingRules:()=>filterOutStylingRules});var isStylingRule,filterOutStylingRules,init_filter_out_styling_rules=__esm({"src/server/utils/filter-out-styling-rules.ts"(){isStylingRule=rule=>{let{test}=rule;return !test||!(test instanceof RegExp)?!1:test.test(".css")||test.test(".scss")||test.test(".sass")},filterOutStylingRules=config=>config.module.rules.filter(rule=>!isStylingRule(rule));}});var storybook_normalize_angular_entry_plugin_exports={};__export(storybook_normalize_angular_entry_plugin_exports,{default:()=>StorybookNormalizeAngularEntryPlugin});var PLUGIN_NAME,StorybookNormalizeAngularEntryPlugin,init_storybook_normalize_angular_entry_plugin=__esm({"src/server/plugins/storybook-normalize-angular-entry-plugin.js"(){PLUGIN_NAME="storybook-normalize-angular-entry-plugin",StorybookNormalizeAngularEntryPlugin=class{constructor(options){this.options=options;}apply(compiler){compiler.hooks.environment.tap(PLUGIN_NAME,()=>{let originalEntry=compiler.options.entry;compiler.options.entry=async()=>{let entryResult;if(typeof originalEntry=="function")try{entryResult=await originalEntry();}catch(error){throw console.error("Failed to execute the entry function:",error),error}else entryResult=originalEntry;return entryResult&&entryResult.main&&entryResult.styles?{main:{import:Array.from(new Set([...entryResult.main.import,...entryResult.styles.import]))}}:entryResult};}),compiler.hooks.thisCompilation.tap(PLUGIN_NAME,compilation=>{this.compilation=compilation;});}};}});var require_angular_cli_webpack=__commonJS({"src/server/angular-cli-webpack.js"(exports){var{generateI18nBrowserWebpackConfigFromContext}=__require("@angular-devkit/build-angular/src/utils/webpack-browser-config"),TsconfigPathsPlugin=__require("tsconfig-paths-webpack-plugin"),{filterOutStylingRules:filterOutStylingRules2}=(init_filter_out_styling_rules(),__toCommonJS(filter_out_styling_rules_exports)),{default:StorybookNormalizeAngularEntryPlugin2}=(init_storybook_normalize_angular_entry_plugin(),__toCommonJS(storybook_normalize_angular_entry_plugin_exports)),{getCommonConfig,getStylesConfig,getDevServerConfig,getTypeScriptConfig}=__require("@angular-devkit/build-angular/src/tools/webpack/configs");exports.getWebpackConfig=async(baseConfig,{builderOptions,builderContext})=>{async function getCustomStylesConfig(wco){let{root}=wco;if((()=>{try{return __require.resolve("@tailwindcss/postcss",{paths:[root]}),!0}catch{return !1}})()){let fs3=__require("fs/promises"),originalReaddir=fs3.readdir;fs3.readdir=async function(path3,options){let results=await originalReaddir.call(this,path3,options),tailwindFiles=["tailwind.config.js","tailwind.config.cjs","tailwind.config.mjs","tailwind.config.ts"];return results.filter(file=>!tailwindFiles.includes(file))};let styleConfig=await getStylesConfig(wco);fs3.readdir=originalReaddir;let tailwindPackagePath=__require.resolve("@tailwindcss/postcss",{paths:[root]}),extraPostcssPlugins=[__require(tailwindPackagePath)()];return styleConfig.module.rules.map(rule=>rule.rules).forEach(rule=>{rule.forEach(r=>{r.oneOf?.forEach?.(oneOfRule=>oneOfRule.use.forEach(use=>{if(use.loader.includes("postcss-loader")&&use.options.postcssOptions){let originalOptionsFn=use.options.postcssOptions;use.options.postcssOptions=loaderOptions=>{let originalOptions=originalOptionsFn(loaderOptions);return {...originalOptions,plugins:[...originalOptions.plugins,...extraPostcssPlugins]}};}}));});}),styleConfig}else return getStylesConfig(wco)}let{config:cliConfig}=await generateI18nBrowserWebpackConfigFromContext({index:"noop-index",main:"noop-main",...builderOptions,styles:builderOptions.styles?.map(style=>typeof style=="string"?style:style.input).filter(style=>typeof style=="string"||style.inject!==!1),outputPath:typeof builderOptions.outputPath=="string"?builderOptions.outputPath:builderOptions.outputPath?.base??"noop-out",optimization:!1,namedChunks:!1,progress:!1,buildOptimizer:!1,aot:!1},builderContext,wco=>[getCommonConfig(wco),getCustomStylesConfig(wco),getTypeScriptConfig?getTypeScriptConfig(wco):getDevServerConfig(wco)]);!builderOptions.experimentalZoneless&&!cliConfig.entry.polyfills?.includes("zone.js")&&(cliConfig.entry.polyfills??=[],cliConfig.entry.polyfills.push("zone.js"));let entry=[...cliConfig.entry.polyfills??[],...baseConfig.entry,...cliConfig.entry.styles??[]],rulesExcludingStyles=filterOutStylingRules2(baseConfig),module2={...baseConfig.module,rules:[...cliConfig.module.rules,...rulesExcludingStyles]},plugins=[...cliConfig.plugins??[],...baseConfig.plugins,new StorybookNormalizeAngularEntryPlugin2],resolve={...baseConfig.resolve,modules:Array.from(new Set([...baseConfig.resolve.modules,...cliConfig.resolve.modules])),plugins:[new TsconfigPathsPlugin({configFile:builderOptions.tsConfig,mainFields:["browser","module","main"]})]};return {...baseConfig,entry,module:module2,plugins,resolve,resolveLoader:cliConfig.resolveLoader}};}});var Node=class{value;next;constructor(value){this.value=value;}},Queue=class{#head;#tail;#size;constructor(){this.clear();}enqueue(value){let node=new Node(value);this.#head?(this.#tail.next=node,this.#tail=node):(this.#head=node,this.#tail=node),this.#size++;}dequeue(){let current=this.#head;if(current)return this.#head=this.#head.next,this.#size--,current.value}peek(){if(this.#head)return this.#head.value}clear(){this.#head=void 0,this.#tail=void 0,this.#size=0;}get size(){return this.#size}*[Symbol.iterator](){let current=this.#head;for(;current;)yield current.value,current=current.next;}*drain(){for(;this.#head;)yield this.dequeue();}};function pLimit(concurrency){if(!((Number.isInteger(concurrency)||concurrency===Number.POSITIVE_INFINITY)&&concurrency>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let queue=new Queue,activeCount=0,next=()=>{activeCount--,queue.size>0&&queue.dequeue()();},run=async(fn,resolve,args)=>{activeCount++;let result=(async()=>fn(...args))();resolve(result);try{await result;}catch{}next();},enqueue=(fn,resolve,args)=>{queue.enqueue(run.bind(void 0,fn,resolve,args)),(async()=>(await Promise.resolve(),activeCount<concurrency&&queue.size>0&&queue.dequeue()()))();},generator=(fn,...args)=>new Promise(resolve=>{enqueue(fn,resolve,args);});return Object.defineProperties(generator,{activeCount:{get:()=>activeCount},pendingCount:{get:()=>queue.size},clearQueue:{value:()=>{queue.clear();}}}),generator}var EndError=class extends Error{constructor(value){super(),this.value=value;}},testElement=async(element,tester)=>tester(await element),finder=async element=>{let values=await Promise.all(element);if(values[1]===!0)throw new EndError(values[0]);return !1};async function pLocate(iterable,tester,{concurrency=Number.POSITIVE_INFINITY,preserveOrder=!0}={}){let limit=pLimit(concurrency),items=[...iterable].map(element=>[element,limit(testElement,element,tester)]),checkLimit=pLimit(preserveOrder?1:Number.POSITIVE_INFINITY);try{await Promise.all(items.map(element=>checkLimit(finder,element)));}catch(error){if(error instanceof EndError)return error.value;throw error}}var typeMappings={directory:"isDirectory",file:"isFile"};function checkType(type){if(!Object.hasOwnProperty.call(typeMappings,type))throw new Error(`Invalid type specified: ${type}`)}var matchType=(type,stat)=>stat[typeMappings[type]](),toPath=urlOrPath=>urlOrPath instanceof URL?url.fileURLToPath(urlOrPath):urlOrPath;async function locatePath(paths,{cwd=process2__default.default.cwd(),type="file",allowSymlinks=!0,concurrency,preserveOrder}={}){checkType(type),cwd=toPath(cwd);let statFunction=allowSymlinks?fs.promises.stat:fs.promises.lstat;return pLocate(paths,async path_=>{try{let stat=await statFunction(path2__default.default.resolve(cwd,path_));return matchType(type,stat)}catch{return !1}},{concurrency,preserveOrder})}function toPath2(urlOrPath){return urlOrPath instanceof URL?url.fileURLToPath(urlOrPath):urlOrPath}var findUpStop=Symbol("findUpStop");async function findUpMultiple(name,options={}){let directory=path2__default.default.resolve(toPath2(options.cwd)??""),{root}=path2__default.default.parse(directory),stopAt=path2__default.default.resolve(directory,toPath2(options.stopAt??root)),limit=options.limit??Number.POSITIVE_INFINITY,paths=[name].flat(),runMatcher=async locateOptions=>{if(typeof name!="function")return locatePath(paths,locateOptions);let foundPath=await name(locateOptions.cwd);return typeof foundPath=="string"?locatePath([foundPath],locateOptions):foundPath},matches=[];for(;;){let foundPath=await runMatcher({...options,cwd:directory});if(foundPath===findUpStop||(foundPath&&matches.push(path2__default.default.resolve(directory,foundPath)),directory===stopAt||matches.length>=limit))break;directory=path2__default.default.dirname(directory);}return matches}async function findUp(name,options={}){return (await findUpMultiple(name,{...options,limit:1}))[0]}var import_angular_cli_webpack=__toESM(require_angular_cli_webpack());var moduleIsAvailable=moduleName=>{try{return __require.resolve(moduleName),!0}catch{return !1}};async function webpackFinal(baseConfig,options){if(!moduleIsAvailable("@angular-devkit/build-angular"))return nodeLogger.logger.info('=> Using base config because "@angular-devkit/build-angular" is not installed'),baseConfig;checkForLegacyBuildOptions(options);let builderContext=getBuilderContext(options),builderOptions=await getBuilderOptions(options,builderContext),webpackConfig=await(0, import_angular_cli_webpack.getWebpackConfig)(baseConfig,{builderOptions:{watch:options.configType==="DEVELOPMENT",...builderOptions},builderContext});webpackConfig.plugins=webpackConfig.plugins??[];let miniCssPlugin=webpackConfig?.plugins?.find(plugin=>plugin?.constructor?.name==="MiniCssExtractPlugin");miniCssPlugin&&"options"in miniCssPlugin&&(miniCssPlugin.options.filename="[name].[contenthash].css",miniCssPlugin.options.chunkFilename="[name].iframe.[contenthash].css"),webpackConfig.plugins.push(new builderWebpack5.WebpackDefinePlugin({STORYBOOK_ANGULAR_OPTIONS:JSON.stringify({experimentalZoneless:builderOptions.experimentalZoneless})}));try{__require.resolve("@angular/animations");}catch{webpackConfig.plugins.push(new builderWebpack5.WebpackIgnorePlugin({resourceRegExp:/@angular\/platform-browser\/animations$/}));}return webpackConfig}function getBuilderContext(options){return options.angularBuilderContext??{target:{project:"noop-project",builder:"",options:{}},workspaceRoot:process.cwd(),getProjectMetadata:()=>({}),getTargetOptions:()=>({}),logger:new core.logging.Logger("Storybook")}}function deepMerge(target,source){let result={...target};for(let key in source)source[key]!==void 0&&source[key]!==null&&(typeof source[key]=="object"&&!Array.isArray(source[key])&&typeof target[key]=="object"&&!Array.isArray(target[key])&&target[key]!==null?result[key]=deepMerge(target[key],source[key]):result[key]=source[key]);return result}async function getBuilderOptions(options,builderContext){let browserTargetOptions={};if(options.angularBrowserTarget){let browserTarget=architect.targetFromTargetString(options.angularBrowserTarget);nodeLogger.logger.info(`=> Using angular browser target options from "${browserTarget.project}:${browserTarget.target}${browserTarget.configuration?`:${browserTarget.configuration}`:""}"`),browserTargetOptions=await builderContext.getTargetOptions(browserTarget);}let builderOptions=deepMerge(browserTargetOptions,options.angularBuilderOptions||{});return builderOptions.tsConfig=options.tsConfig??await findUp("tsconfig.json",{cwd:options.configDir,stopAt:common.getProjectRoot()})??browserTargetOptions.tsConfig,nodeLogger.logger.info(`=> Using angular project with "tsConfig:${builderOptions.tsConfig}"`),builderOptions}function checkForLegacyBuildOptions(options){if(options.angularBrowserTarget===void 0)throw new serverErrors.AngularLegacyBuildOptionsError}
|
|
26
|
+
// src/server/angular-cli-webpack.js
|
|
27
|
+
import { createRequire } from "node:module";
|
|
20
28
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
// src/server/plugins/storybook-normalize-angular-entry-plugin.js
|
|
30
|
+
var PLUGIN_NAME = "storybook-normalize-angular-entry-plugin";
|
|
31
|
+
var StorybookNormalizeAngularEntryPlugin = class {
|
|
32
|
+
static {
|
|
33
|
+
__name(this, "StorybookNormalizeAngularEntryPlugin");
|
|
34
|
+
}
|
|
35
|
+
constructor(options) {
|
|
36
|
+
this.options = options;
|
|
37
|
+
}
|
|
38
|
+
apply(compiler) {
|
|
39
|
+
compiler.hooks.environment.tap(PLUGIN_NAME, () => {
|
|
40
|
+
const originalEntry = compiler.options.entry;
|
|
41
|
+
compiler.options.entry = async () => {
|
|
42
|
+
let entryResult;
|
|
43
|
+
if (typeof originalEntry === "function") {
|
|
44
|
+
try {
|
|
45
|
+
entryResult = await originalEntry();
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.error("Failed to execute the entry function:", error);
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
entryResult = originalEntry;
|
|
52
|
+
}
|
|
53
|
+
if (entryResult && entryResult.main && entryResult.styles) {
|
|
54
|
+
return {
|
|
55
|
+
main: {
|
|
56
|
+
import: Array.from(
|
|
57
|
+
/* @__PURE__ */ new Set([...entryResult.main.import, ...entryResult.styles.import])
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return entryResult;
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
|
|
66
|
+
this.compilation = compilation;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// src/server/utils/filter-out-styling-rules.ts
|
|
72
|
+
var isStylingRule = /* @__PURE__ */ __name((rule) => {
|
|
73
|
+
const { test } = rule;
|
|
74
|
+
if (!test) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
if (!(test instanceof RegExp)) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
return test.test(".css") || test.test(".scss") || test.test(".sass");
|
|
81
|
+
}, "isStylingRule");
|
|
82
|
+
var filterOutStylingRules = /* @__PURE__ */ __name((config) => {
|
|
83
|
+
return config.module.rules.filter((rule) => !isStylingRule(rule));
|
|
84
|
+
}, "filterOutStylingRules");
|
|
85
|
+
|
|
86
|
+
// src/server/angular-cli-webpack.js
|
|
87
|
+
var require2 = createRequire(import.meta.url);
|
|
88
|
+
var {
|
|
89
|
+
generateI18nBrowserWebpackConfigFromContext
|
|
90
|
+
} = require2("@angular-devkit/build-angular/src/utils/webpack-browser-config");
|
|
91
|
+
var TsconfigPathsPlugin = require2("tsconfig-paths-webpack-plugin");
|
|
92
|
+
var {
|
|
93
|
+
getCommonConfig,
|
|
94
|
+
getStylesConfig,
|
|
95
|
+
getDevServerConfig,
|
|
96
|
+
getTypeScriptConfig
|
|
97
|
+
} = require2("@angular-devkit/build-angular/src/tools/webpack/configs");
|
|
98
|
+
var getWebpackConfig = /* @__PURE__ */ __name(async (baseConfig, { builderOptions, builderContext }) => {
|
|
99
|
+
async function getCustomStylesConfig(wco) {
|
|
100
|
+
const { root } = wco;
|
|
101
|
+
const isTailwind4 = /* @__PURE__ */ __name(() => {
|
|
102
|
+
try {
|
|
103
|
+
const output = import.meta.resolve("@tailwindcss/postcss", root);
|
|
104
|
+
return isAbsolute(output);
|
|
105
|
+
} catch {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
}, "isTailwind4");
|
|
109
|
+
if (isTailwind4()) {
|
|
110
|
+
const fs = require2("node:fs/promises");
|
|
111
|
+
const originalReaddir = fs.readdir;
|
|
112
|
+
fs.readdir = async function(path, options) {
|
|
113
|
+
const results = await originalReaddir.call(this, path, options);
|
|
114
|
+
const tailwindFiles = [
|
|
115
|
+
"tailwind.config.js",
|
|
116
|
+
"tailwind.config.cjs",
|
|
117
|
+
"tailwind.config.mjs",
|
|
118
|
+
"tailwind.config.ts"
|
|
119
|
+
];
|
|
120
|
+
return results.filter((file) => !tailwindFiles.includes(file));
|
|
121
|
+
};
|
|
122
|
+
const styleConfig = await getStylesConfig(wco);
|
|
123
|
+
fs.readdir = originalReaddir;
|
|
124
|
+
const tailwindPackagePath = import.meta.resolve("@tailwindcss/postcss", root);
|
|
125
|
+
const tailwindPackage = await import(tailwindPackagePath);
|
|
126
|
+
const extraPostcssPlugins = [
|
|
127
|
+
typeof tailwindPackage === "function" ? tailwindPackage() : tailwindPackage.default()
|
|
128
|
+
];
|
|
129
|
+
styleConfig.module.rules.map((rule) => rule.rules).forEach((rule) => {
|
|
130
|
+
rule.forEach((r) => {
|
|
131
|
+
r.oneOf?.forEach?.((oneOfRule) => {
|
|
132
|
+
return oneOfRule.use.forEach((use) => {
|
|
133
|
+
if (use.loader.includes("postcss-loader") && use.options.postcssOptions) {
|
|
134
|
+
const originalOptionsFn = use.options.postcssOptions;
|
|
135
|
+
use.options.postcssOptions = (loaderOptions) => {
|
|
136
|
+
const originalOptions = originalOptionsFn(loaderOptions);
|
|
137
|
+
return {
|
|
138
|
+
...originalOptions,
|
|
139
|
+
plugins: [...originalOptions.plugins, ...extraPostcssPlugins]
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
return styleConfig;
|
|
148
|
+
} else {
|
|
149
|
+
return getStylesConfig(wco);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
__name(getCustomStylesConfig, "getCustomStylesConfig");
|
|
153
|
+
const { config: cliConfig } = await generateI18nBrowserWebpackConfigFromContext(
|
|
154
|
+
{
|
|
155
|
+
// Default options
|
|
156
|
+
index: "noop-index",
|
|
157
|
+
main: "noop-main",
|
|
158
|
+
// Options provided by user
|
|
159
|
+
...builderOptions,
|
|
160
|
+
styles: builderOptions.styles?.map((style) => typeof style === "string" ? style : style.input).filter((style) => typeof style === "string" || style.inject !== false),
|
|
161
|
+
outputPath: typeof builderOptions.outputPath === "string" ? builderOptions.outputPath : builderOptions.outputPath?.base ?? "noop-out",
|
|
162
|
+
// Fixed options
|
|
163
|
+
optimization: false,
|
|
164
|
+
namedChunks: false,
|
|
165
|
+
progress: false,
|
|
166
|
+
buildOptimizer: false,
|
|
167
|
+
aot: false
|
|
168
|
+
},
|
|
169
|
+
builderContext,
|
|
170
|
+
(wco) => [
|
|
171
|
+
getCommonConfig(wco),
|
|
172
|
+
getCustomStylesConfig(wco),
|
|
173
|
+
getTypeScriptConfig ? getTypeScriptConfig(wco) : getDevServerConfig(wco)
|
|
174
|
+
]
|
|
175
|
+
);
|
|
176
|
+
if (!builderOptions.experimentalZoneless && !cliConfig.entry.polyfills?.includes("zone.js")) {
|
|
177
|
+
cliConfig.entry.polyfills ??= [];
|
|
178
|
+
cliConfig.entry.polyfills.push("zone.js");
|
|
179
|
+
}
|
|
180
|
+
const entry = [
|
|
181
|
+
...cliConfig.entry.polyfills ?? [],
|
|
182
|
+
...baseConfig.entry,
|
|
183
|
+
...cliConfig.entry.styles ?? []
|
|
184
|
+
];
|
|
185
|
+
const rulesExcludingStyles = filterOutStylingRules(baseConfig);
|
|
186
|
+
const module = {
|
|
187
|
+
...baseConfig.module,
|
|
188
|
+
rules: [...cliConfig.module.rules, ...rulesExcludingStyles]
|
|
189
|
+
};
|
|
190
|
+
const plugins = [
|
|
191
|
+
...cliConfig.plugins ?? [],
|
|
192
|
+
...baseConfig.plugins,
|
|
193
|
+
new StorybookNormalizeAngularEntryPlugin()
|
|
194
|
+
];
|
|
195
|
+
const resolve = {
|
|
196
|
+
...baseConfig.resolve,
|
|
197
|
+
modules: Array.from(/* @__PURE__ */ new Set([...baseConfig.resolve.modules, ...cliConfig.resolve.modules])),
|
|
198
|
+
plugins: [
|
|
199
|
+
new TsconfigPathsPlugin({
|
|
200
|
+
configFile: builderOptions.tsConfig,
|
|
201
|
+
mainFields: ["browser", "module", "main"]
|
|
202
|
+
})
|
|
203
|
+
]
|
|
204
|
+
};
|
|
205
|
+
return {
|
|
206
|
+
...baseConfig,
|
|
207
|
+
entry,
|
|
208
|
+
module,
|
|
209
|
+
plugins,
|
|
210
|
+
resolve,
|
|
211
|
+
resolveLoader: cliConfig.resolveLoader
|
|
212
|
+
};
|
|
213
|
+
}, "getWebpackConfig");
|
|
214
|
+
|
|
215
|
+
// src/server/framework-preset-angular-cli.ts
|
|
216
|
+
import { getProjectRoot, resolvePackageDir } from "storybook/internal/common";
|
|
217
|
+
async function webpackFinal(baseConfig, options) {
|
|
218
|
+
if (!resolvePackageDir("@angular-devkit/build-angular")) {
|
|
219
|
+
logger.info('=> Using base config because "@angular-devkit/build-angular" is not installed');
|
|
220
|
+
return baseConfig;
|
|
221
|
+
}
|
|
222
|
+
checkForLegacyBuildOptions(options);
|
|
223
|
+
const builderContext = getBuilderContext(options);
|
|
224
|
+
const builderOptions = await getBuilderOptions(options, builderContext);
|
|
225
|
+
const webpackConfig = await getWebpackConfig(baseConfig, {
|
|
226
|
+
builderOptions: {
|
|
227
|
+
watch: options.configType === "DEVELOPMENT",
|
|
228
|
+
...builderOptions
|
|
229
|
+
},
|
|
230
|
+
builderContext
|
|
231
|
+
});
|
|
232
|
+
webpackConfig.plugins = webpackConfig.plugins ?? [];
|
|
233
|
+
const miniCssPlugin = webpackConfig?.plugins?.find(
|
|
234
|
+
(plugin) => plugin?.constructor?.name === "MiniCssExtractPlugin"
|
|
235
|
+
);
|
|
236
|
+
if (miniCssPlugin && "options" in miniCssPlugin) {
|
|
237
|
+
miniCssPlugin.options.filename = "[name].[contenthash].css";
|
|
238
|
+
miniCssPlugin.options.chunkFilename = "[name].iframe.[contenthash].css";
|
|
239
|
+
}
|
|
240
|
+
webpackConfig.plugins.push(
|
|
241
|
+
new WebpackDefinePlugin({
|
|
242
|
+
STORYBOOK_ANGULAR_OPTIONS: JSON.stringify({
|
|
243
|
+
experimentalZoneless: builderOptions.experimentalZoneless
|
|
244
|
+
})
|
|
245
|
+
})
|
|
246
|
+
);
|
|
247
|
+
try {
|
|
248
|
+
resolvePackageDir("@angular/animations");
|
|
249
|
+
} catch (e) {
|
|
250
|
+
webpackConfig.plugins.push(
|
|
251
|
+
new WebpackIgnorePlugin({
|
|
252
|
+
resourceRegExp: /@angular\/platform-browser\/animations$/
|
|
253
|
+
})
|
|
254
|
+
);
|
|
255
|
+
webpackConfig.plugins.push(
|
|
256
|
+
new WebpackIgnorePlugin({
|
|
257
|
+
resourceRegExp: /@angular\/animations\/browser$/
|
|
258
|
+
})
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
return webpackConfig;
|
|
262
|
+
}
|
|
263
|
+
__name(webpackFinal, "webpackFinal");
|
|
264
|
+
function getBuilderContext(options) {
|
|
265
|
+
return options.angularBuilderContext ?? {
|
|
266
|
+
target: { project: "noop-project", builder: "", options: {} },
|
|
267
|
+
workspaceRoot: process.cwd(),
|
|
268
|
+
getProjectMetadata: /* @__PURE__ */ __name(() => ({}), "getProjectMetadata"),
|
|
269
|
+
getTargetOptions: /* @__PURE__ */ __name(() => ({}), "getTargetOptions"),
|
|
270
|
+
logger: new logging.Logger("Storybook")
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
__name(getBuilderContext, "getBuilderContext");
|
|
274
|
+
function deepMerge(target, source) {
|
|
275
|
+
const result = { ...target };
|
|
276
|
+
for (const key in source) {
|
|
277
|
+
if (source[key] !== void 0 && source[key] !== null) {
|
|
278
|
+
if (typeof source[key] === "object" && !Array.isArray(source[key]) && typeof target[key] === "object" && !Array.isArray(target[key]) && target[key] !== null) {
|
|
279
|
+
result[key] = deepMerge(target[key], source[key]);
|
|
280
|
+
} else {
|
|
281
|
+
result[key] = source[key];
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return result;
|
|
286
|
+
}
|
|
287
|
+
__name(deepMerge, "deepMerge");
|
|
288
|
+
async function getBuilderOptions(options, builderContext) {
|
|
289
|
+
let browserTargetOptions = {};
|
|
290
|
+
if (options.angularBrowserTarget) {
|
|
291
|
+
const browserTarget = targetFromTargetString(options.angularBrowserTarget);
|
|
292
|
+
logger.info(
|
|
293
|
+
`=> Using angular browser target options from "${browserTarget.project}:${browserTarget.target}${browserTarget.configuration ? `:${browserTarget.configuration}` : ""}"`
|
|
294
|
+
);
|
|
295
|
+
browserTargetOptions = await builderContext.getTargetOptions(browserTarget);
|
|
296
|
+
}
|
|
297
|
+
const explicitAngularBuilderOptions = await builderContext.getTargetOptions(
|
|
298
|
+
builderContext.target
|
|
299
|
+
);
|
|
300
|
+
const builderOptions = deepMerge(browserTargetOptions, explicitAngularBuilderOptions || {});
|
|
301
|
+
builderOptions.tsConfig = options.tsConfig ?? await findUp("tsconfig.json", { cwd: options.configDir, stopAt: getProjectRoot() }) ?? browserTargetOptions.tsConfig;
|
|
302
|
+
logger.info(`=> Using angular project with "tsConfig:${builderOptions.tsConfig}"`);
|
|
303
|
+
return builderOptions;
|
|
304
|
+
}
|
|
305
|
+
__name(getBuilderOptions, "getBuilderOptions");
|
|
306
|
+
function checkForLegacyBuildOptions(options) {
|
|
307
|
+
if (options.angularBrowserTarget !== void 0) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
throw new AngularLegacyBuildOptionsError();
|
|
311
|
+
}
|
|
312
|
+
__name(checkForLegacyBuildOptions, "checkForLegacyBuildOptions");
|
|
313
|
+
export {
|
|
314
|
+
deepMerge,
|
|
315
|
+
getBuilderOptions,
|
|
316
|
+
webpackFinal
|
|
317
|
+
};
|
|
@@ -1,8 +1,60 @@
|
|
|
1
|
-
|
|
1
|
+
import CJS_COMPAT_NODE_URL_x1uj59add6 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_x1uj59add6 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_x1uj59add6 from "node:module";
|
|
2
4
|
|
|
3
|
-
var
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_x1uj59add6.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_x1uj59add6.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_x1uj59add6.createRequire(import.meta.url);
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
__name
|
|
14
|
+
} from "../_node-chunks/chunk-2MYYSDON.js";
|
|
6
15
|
|
|
7
|
-
|
|
8
|
-
|
|
16
|
+
// src/server/framework-preset-angular-ivy.ts
|
|
17
|
+
import { join } from "node:path";
|
|
18
|
+
import { createRequire } from "node:module";
|
|
19
|
+
var require2 = createRequire(import.meta.url);
|
|
20
|
+
function loadEsmModule(modulePath) {
|
|
21
|
+
return new Function("modulePath", `return import(modulePath);`)(modulePath);
|
|
22
|
+
}
|
|
23
|
+
__name(loadEsmModule, "loadEsmModule");
|
|
24
|
+
var runNgcc = /* @__PURE__ */ __name(async () => {
|
|
25
|
+
let ngcc;
|
|
26
|
+
try {
|
|
27
|
+
ngcc = require2("@angular/compiler-cli/ngcc");
|
|
28
|
+
} catch (error) {
|
|
29
|
+
ngcc = await loadEsmModule("@angular/compiler-cli/ngcc");
|
|
30
|
+
}
|
|
31
|
+
ngcc.process({
|
|
32
|
+
// should be async: true but does not work due to
|
|
33
|
+
// https://github.com/storybookjs/storybook/pull/11157/files#r615413803
|
|
34
|
+
async: false,
|
|
35
|
+
basePath: join(process.cwd(), "node_modules"),
|
|
36
|
+
// absolute path to node_modules
|
|
37
|
+
createNewEntryPointFormats: true,
|
|
38
|
+
// --create-ivy-entry-points
|
|
39
|
+
compileAllFormats: false
|
|
40
|
+
// --first-only
|
|
41
|
+
});
|
|
42
|
+
}, "runNgcc");
|
|
43
|
+
var webpack = /* @__PURE__ */ __name(async (webpackConfig, options) => {
|
|
44
|
+
const framework = await options.presets.apply("framework");
|
|
45
|
+
const angularOptions = typeof framework === "object" ? framework.options : {};
|
|
46
|
+
if (angularOptions.enableIvy === false) {
|
|
47
|
+
return webpackConfig;
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
...webpackConfig,
|
|
51
|
+
resolve: {
|
|
52
|
+
...webpackConfig.resolve,
|
|
53
|
+
mainFields: ["browser", "module", "main"]
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}, "webpack");
|
|
57
|
+
export {
|
|
58
|
+
runNgcc,
|
|
59
|
+
webpack
|
|
60
|
+
};
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/angular",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Storybook for Angular: Develop
|
|
3
|
+
"version": "10.0.0-beta.1",
|
|
4
|
+
"description": "Storybook for Angular: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
7
|
-
"
|
|
7
|
+
"storybook-framework",
|
|
8
|
+
"angular",
|
|
9
|
+
"component",
|
|
10
|
+
"components"
|
|
8
11
|
],
|
|
9
12
|
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/angular",
|
|
10
13
|
"bugs": {
|
|
@@ -20,56 +23,26 @@
|
|
|
20
23
|
"url": "https://opencollective.com/storybook"
|
|
21
24
|
},
|
|
22
25
|
"license": "MIT",
|
|
26
|
+
"type": "module",
|
|
23
27
|
"exports": {
|
|
24
28
|
".": {
|
|
25
29
|
"types": "./dist/index.d.ts",
|
|
26
|
-
"
|
|
27
|
-
"require": "./dist/index.js"
|
|
28
|
-
},
|
|
29
|
-
"./preset": "./preset.js",
|
|
30
|
-
"./server/framework-preset-angular-ivy": "./server/framework-preset-angular-ivy.js",
|
|
31
|
-
"./server/framework-preset-angular-cli": "./server/framework-preset-angular-cli.js",
|
|
32
|
-
"./client/config": {
|
|
33
|
-
"types": "./dist/client/config.d.ts",
|
|
34
|
-
"import": "./dist/client/config.mjs",
|
|
35
|
-
"require": "./dist/client/config.js"
|
|
36
|
-
},
|
|
37
|
-
"./client/preview-prod": {
|
|
38
|
-
"types": "./dist/client/preview-prod.d.ts",
|
|
39
|
-
"import": "./dist/client/preview-prod.mjs",
|
|
40
|
-
"require": "./dist/client/preview-prod.js"
|
|
41
|
-
},
|
|
42
|
-
"./client/docs/config": {
|
|
43
|
-
"types": "./dist/client/docs/config.d.ts",
|
|
44
|
-
"import": "./dist/client/docs/config.mjs",
|
|
45
|
-
"require": "./dist/client/docs/config.js"
|
|
30
|
+
"default": "./dist/index.js"
|
|
46
31
|
},
|
|
32
|
+
"./builders/build-storybook": "./dist/builders/build-storybook/index.js",
|
|
33
|
+
"./builders/start-storybook": "./dist/builders/start-storybook/index.js",
|
|
34
|
+
"./client": "./dist/client/index.js",
|
|
35
|
+
"./client/config": "./dist/client/config.js",
|
|
36
|
+
"./client/docs/config": "./dist/client/docs/config.js",
|
|
37
|
+
"./client/preview-prod": "./dist/client/preview-prod.js",
|
|
47
38
|
"./node": {
|
|
48
39
|
"types": "./dist/node/index.d.ts",
|
|
49
|
-
"
|
|
50
|
-
"require": "./dist/node/index.js"
|
|
40
|
+
"default": "./dist/node/index.js"
|
|
51
41
|
},
|
|
52
42
|
"./package.json": "./package.json",
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"module": "dist/index.mjs",
|
|
57
|
-
"types": "dist/index.d.ts",
|
|
58
|
-
"typesVersions": {
|
|
59
|
-
"*": {
|
|
60
|
-
"*": [
|
|
61
|
-
"dist/index.d.ts"
|
|
62
|
-
],
|
|
63
|
-
"client/config": [
|
|
64
|
-
"dist/client/config.d.ts"
|
|
65
|
-
],
|
|
66
|
-
"client/preview-prod": [
|
|
67
|
-
"dist/client/preview-prod.d.ts"
|
|
68
|
-
],
|
|
69
|
-
"client/docs/config": [
|
|
70
|
-
"dist/client/docs/config.d.ts"
|
|
71
|
-
]
|
|
72
|
-
}
|
|
43
|
+
"./preset": "./dist/preset.js",
|
|
44
|
+
"./server/framework-preset-angular-cli": "./dist/server/framework-preset-angular-cli.js",
|
|
45
|
+
"./server/framework-preset-angular-ivy": "./dist/server/framework-preset-angular-ivy.js"
|
|
73
46
|
},
|
|
74
47
|
"files": [
|
|
75
48
|
"builders.json",
|
|
@@ -84,11 +57,11 @@
|
|
|
84
57
|
"!src/**/*"
|
|
85
58
|
],
|
|
86
59
|
"scripts": {
|
|
87
|
-
"check": "jiti ../../../scripts/
|
|
88
|
-
"prep": "jiti ../../../scripts/
|
|
60
|
+
"check": "jiti ../../../scripts/check/check-package.ts",
|
|
61
|
+
"prep": "jiti ../../../scripts/build/build-package.ts"
|
|
89
62
|
},
|
|
90
63
|
"dependencies": {
|
|
91
|
-
"@storybook/builder-webpack5": "
|
|
64
|
+
"@storybook/builder-webpack5": "10.0.0-beta.1",
|
|
92
65
|
"@storybook/global": "^5.0.0",
|
|
93
66
|
"telejson": "8.0.0",
|
|
94
67
|
"ts-dedent": "^2.0.0",
|
|
@@ -108,7 +81,7 @@
|
|
|
108
81
|
"@angular/forms": "^19.1.1",
|
|
109
82
|
"@angular/platform-browser": "^19.1.1",
|
|
110
83
|
"@angular/platform-browser-dynamic": "^19.1.1",
|
|
111
|
-
"@storybook/core-webpack": "
|
|
84
|
+
"@storybook/core-webpack": "10.0.0-beta.1",
|
|
112
85
|
"@types/node": "^22.0.0",
|
|
113
86
|
"fd-package-json": "^1.2.0",
|
|
114
87
|
"find-up": "^7.0.0",
|
|
@@ -131,7 +104,7 @@
|
|
|
131
104
|
"@angular/platform-browser": ">=18.0.0 < 21.0.0",
|
|
132
105
|
"@angular/platform-browser-dynamic": ">=18.0.0 < 21.0.0",
|
|
133
106
|
"rxjs": "^6.5.3 || ^7.4.0",
|
|
134
|
-
"storybook": "^
|
|
107
|
+
"storybook": "^10.0.0-beta.1",
|
|
135
108
|
"typescript": "^4.9.0 || ^5.0.0",
|
|
136
109
|
"zone.js": ">=0.14.0"
|
|
137
110
|
},
|
|
@@ -146,28 +119,9 @@
|
|
|
146
119
|
"optional": true
|
|
147
120
|
}
|
|
148
121
|
},
|
|
149
|
-
"engines": {
|
|
150
|
-
"node": ">=20.0.0"
|
|
151
|
-
},
|
|
152
122
|
"publishConfig": {
|
|
153
123
|
"access": "public"
|
|
154
124
|
},
|
|
155
125
|
"builders": "builders.json",
|
|
156
|
-
"
|
|
157
|
-
"previewEntries": [
|
|
158
|
-
"./src/index.ts",
|
|
159
|
-
"./src/client/index.ts",
|
|
160
|
-
"./src/client/config.ts",
|
|
161
|
-
"./src/client/preview-prod.ts",
|
|
162
|
-
"./src/client/docs/config.ts"
|
|
163
|
-
],
|
|
164
|
-
"nodeEntries": [
|
|
165
|
-
"./src/preset.ts",
|
|
166
|
-
"./src/server/framework-preset-angular-ivy.ts",
|
|
167
|
-
"./src/server/framework-preset-angular-cli.ts",
|
|
168
|
-
"./src/builders/start-storybook/index.ts",
|
|
169
|
-
"./src/builders/build-storybook/index.ts"
|
|
170
|
-
]
|
|
171
|
-
},
|
|
172
|
-
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
|
|
126
|
+
"gitHead": "a8e7fd8a655c69780bc20b9749d2699e45beae16"
|
|
173
127
|
}
|
package/preset.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export * from './dist/preset.js';
|
package/dist/chunk-CUDJAP6K.mjs
DELETED
package/dist/chunk-KMSSK3DZ.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { render_exports, isComponent, computesTemplateFromComponent, formatPropInTemplate } from './chunk-LXSTVAFF.mjs';
|
|
2
|
-
import { setDefaultProjectAnnotations, setProjectAnnotations as setProjectAnnotations$1 } from 'storybook/preview-api';
|
|
3
|
-
|
|
4
|
-
function setProjectAnnotations(projectAnnotations){return setDefaultProjectAnnotations(render_exports),setProjectAnnotations$1(projectAnnotations)}var moduleMetadata=metadata=>storyFn=>{let story=storyFn(),storyMetadata=story.moduleMetadata||{};return metadata=metadata||{},{...story,moduleMetadata:{declarations:[...metadata.declarations||[],...storyMetadata.declarations||[]],entryComponents:[...metadata.entryComponents||[],...storyMetadata.entryComponents||[]],imports:[...metadata.imports||[],...storyMetadata.imports||[]],schemas:[...metadata.schemas||[],...storyMetadata.schemas||[]],providers:[...metadata.providers||[],...storyMetadata.providers||[]]}}};function applicationConfig(config){return storyFn=>{let story=storyFn(),storyConfig=story.applicationConfig;return {...story,applicationConfig:storyConfig||config?{...config,...storyConfig,providers:[...config?.providers||[],...storyConfig?.providers||[]]}:void 0}}}var componentWrapperDecorator=(element,props)=>(storyFn,storyContext)=>{let story=storyFn(),currentProps=typeof props=="function"?props(storyContext):props,template=isComponent(element)?computesTemplateFromComponent(element,currentProps??{},story.template):element(story.template);return {...story,template,...currentProps||story.props?{props:{...currentProps,...story.props}}:{}}};function argsToTemplate(args,options={}){let includeSet=options.include?new Set(options.include):null,excludeSet=options.exclude?new Set(options.exclude):null;return Object.entries(args).filter(([key])=>args[key]!==void 0).filter(([key])=>includeSet?includeSet.has(key):excludeSet?!excludeSet.has(key):!0).map(([key,value])=>typeof value=="function"?`(${key})="${formatPropInTemplate(key)}($event)"`:`[${key}]="${formatPropInTemplate(key)}"`).join(" ")}
|
|
5
|
-
|
|
6
|
-
export { applicationConfig, argsToTemplate, componentWrapperDecorator, moduleMetadata, setProjectAnnotations };
|