@storybook/angular 6.4.0-beta.9 → 6.4.0-rc.11

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.
Files changed (44) hide show
  1. package/dist/ts3.4/builders/build-storybook/index.d.ts +4 -1
  2. package/dist/ts3.4/builders/start-storybook/index.d.ts +4 -1
  3. package/dist/ts3.4/client/preview/config.d.ts +2 -0
  4. package/dist/ts3.4/client/preview/decorateStory.d.ts +1 -0
  5. package/dist/ts3.4/server/angular-cli-webpack-12.2.x.d.ts +1 -0
  6. package/dist/ts3.4/server/angular-cli-webpack-13.x.x.d.ts +1 -0
  7. package/dist/ts3.4/server/angular-cli-webpack-older.d.ts +72 -0
  8. package/dist/ts3.4/server/angular-devkit-build-webpack.d.ts +1 -1
  9. package/dist/ts3.4/server/framework-preset-angular-cli.d.ts +2 -72
  10. package/dist/ts3.4/server/framework-preset-angular-ivy.d.ts +3 -3
  11. package/dist/ts3.4/server/options.d.ts +12 -1
  12. package/dist/ts3.4/server/preset.d.ts +3 -0
  13. package/dist/ts3.9/builders/build-storybook/index.d.ts +4 -1
  14. package/dist/ts3.9/builders/build-storybook/index.js +15 -14
  15. package/dist/ts3.9/builders/build-storybook/schema.json +54 -14
  16. package/dist/ts3.9/builders/start-storybook/index.d.ts +4 -1
  17. package/dist/ts3.9/builders/start-storybook/index.js +21 -14
  18. package/dist/ts3.9/builders/start-storybook/schema.json +54 -14
  19. package/dist/ts3.9/client/preview/config.d.ts +2 -0
  20. package/dist/ts3.9/client/preview/config.js +3 -0
  21. package/dist/ts3.9/client/preview/decorateStory.d.ts +1 -0
  22. package/dist/ts3.9/client/preview/decorateStory.js +2 -0
  23. package/dist/ts3.9/server/__mocks-ng-workspace__/with-angularBrowserTarget/angular.json +32 -0
  24. package/dist/ts3.9/server/angular-cli-webpack-12.2.x.d.ts +1 -0
  25. package/dist/ts3.9/server/angular-cli-webpack-12.2.x.js +93 -0
  26. package/dist/ts3.9/server/angular-cli-webpack-13.x.x.d.ts +1 -0
  27. package/dist/ts3.9/server/angular-cli-webpack-13.x.x.js +93 -0
  28. package/dist/ts3.9/server/angular-cli-webpack-older.d.ts +72 -0
  29. package/dist/ts3.9/server/angular-cli-webpack-older.js +156 -0
  30. package/dist/ts3.9/server/angular-devkit-build-webpack.d.ts +1 -1
  31. package/dist/ts3.9/server/angular-devkit-build-webpack.js +18 -8
  32. package/dist/ts3.9/server/framework-preset-angular-cli.d.ts +2 -72
  33. package/dist/ts3.9/server/framework-preset-angular-cli.js +119 -86
  34. package/dist/ts3.9/server/framework-preset-angular-ivy.d.ts +3 -3
  35. package/dist/ts3.9/server/framework-preset-angular-ivy.js +45 -10
  36. package/dist/ts3.9/server/options.d.ts +12 -1
  37. package/dist/ts3.9/server/options.js +1 -5
  38. package/dist/ts3.9/server/preset.d.ts +3 -0
  39. package/dist/ts3.9/server/preset.js +21 -0
  40. package/dist/ts3.9/server/utils/filter-out-styling-rules.d.ts +1 -1
  41. package/package.json +19 -12
  42. package/preset.js +1 -7
  43. package/standalone.d.ts +8 -0
  44. package/types-7-0.d.ts +1 -0
@@ -1,12 +1,15 @@
1
1
  import { BuilderOutput } from '@angular-devkit/architect';
2
2
  import { JsonObject } from '@angular-devkit/core';
3
3
  import { CLIOptions } from '@storybook/core-common';
4
+ import { ExtraEntryPoint, StylePreprocessorOptions } from '@angular-devkit/build-angular';
4
5
  export declare type StorybookBuilderOptions = JsonObject & {
5
6
  browserTarget?: string | null;
6
7
  tsConfig?: string;
7
8
  compodoc: boolean;
8
9
  compodocArgs: string[];
9
- } & Pick<CLIOptions, 'staticDir' | 'outputDir' | 'configDir' | 'loglevel' | 'quiet' | 'docs'>;
10
+ styles?: ExtraEntryPoint[];
11
+ stylePreprocessorOptions?: StylePreprocessorOptions;
12
+ } & Pick<CLIOptions, 'outputDir' | 'configDir' | 'loglevel' | 'quiet' | 'docs'>;
10
13
  export declare type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
11
14
  declare const _default: import("@angular-devkit/architect/src/internal").Builder<StorybookBuilderOptions>;
12
15
  export default _default;
@@ -1,12 +1,15 @@
1
1
  import { BuilderOutput } from '@angular-devkit/architect';
2
2
  import { JsonObject } from '@angular-devkit/core';
3
+ import { ExtraEntryPoint, StylePreprocessorOptions } from '@angular-devkit/build-angular';
3
4
  import { CLIOptions } from '@storybook/core-common';
4
5
  export declare type StorybookBuilderOptions = JsonObject & {
5
6
  browserTarget?: string | null;
6
7
  tsConfig?: string;
7
8
  compodoc: boolean;
8
9
  compodocArgs: string[];
9
- } & Pick<CLIOptions, 'port' | 'host' | 'staticDir' | 'configDir' | 'https' | 'sslCa' | 'sslCert' | 'sslKey' | 'smokeTest' | 'ci' | 'quiet' | 'docs'>;
10
+ styles?: ExtraEntryPoint[];
11
+ stylePreprocessorOptions?: StylePreprocessorOptions;
12
+ } & Pick<CLIOptions, 'port' | 'host' | 'configDir' | 'https' | 'sslCa' | 'sslCert' | 'sslKey' | 'smokeTest' | 'ci' | 'quiet' | 'docs'>;
10
13
  export declare type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
11
14
  declare const _default: import("@angular-devkit/architect/src/internal").Builder<StorybookBuilderOptions>;
12
15
  export default _default;
@@ -1,4 +1,6 @@
1
+ import './globals';
1
2
  export { render, renderToDOM } from './render';
3
+ export { decorateStory } from './decorateStory';
2
4
  export declare const parameters: {
3
5
  framework: string;
4
6
  };
@@ -1,3 +1,4 @@
1
1
  import { DecoratorFunction, LegacyStoryFn } from '@storybook/csf';
2
2
  import { AngularFramework } from './types-6-0';
3
3
  export default function decorateStory(mainStoryFn: LegacyStoryFn<AngularFramework>, decorators: DecoratorFunction<AngularFramework>[]): LegacyStoryFn<AngularFramework>;
4
+ export { decorateStory };
@@ -0,0 +1 @@
1
+ export function getWebpackConfig(baseConfig: any, { builderOptions, builderContext }: any): Promise<any>;
@@ -0,0 +1 @@
1
+ export function getWebpackConfig(baseConfig: any, { builderOptions, builderContext }: any): Promise<any>;
@@ -0,0 +1,72 @@
1
+ import webpack from 'webpack';
2
+ import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';
3
+ import { PresetOptions } from './options';
4
+ /**
5
+ * Old way currently support version lower than 12.2.x
6
+ */
7
+ export declare function getWebpackConfig(baseConfig: webpack.Configuration, options: PresetOptions): Promise<webpack.Configuration | {
8
+ entry: any[];
9
+ module: {
10
+ rules: webpack.RuleSetRule[];
11
+ noParse?: RegExp | RegExp[] | ((content: string) => boolean);
12
+ unknownContextRequest?: string;
13
+ unknownContextRecursive?: boolean;
14
+ unknownContextRegExp?: RegExp;
15
+ unknownContextCritical?: boolean;
16
+ exprContextRequest?: string;
17
+ exprContextRegExp?: RegExp;
18
+ exprContextRecursive?: boolean;
19
+ exprContextCritical?: boolean;
20
+ wrappedContextRegExp?: RegExp;
21
+ wrappedContextRecursive?: boolean;
22
+ wrappedContextCritical?: boolean;
23
+ strictExportPresence?: boolean;
24
+ };
25
+ plugins: webpack.Plugin[];
26
+ resolve: {
27
+ modules: string[];
28
+ plugins: TsconfigPathsPlugin[];
29
+ descriptionFiles?: string[];
30
+ mainFields?: string[] | string[][];
31
+ aliasFields?: string[] | string[][];
32
+ mainFiles?: string[];
33
+ extensions?: string[];
34
+ enforceExtension?: boolean;
35
+ alias?: {
36
+ [key: string]: string;
37
+ };
38
+ unsafeCache?: boolean | {};
39
+ cachePredicate?(data: {
40
+ path: string;
41
+ request: string;
42
+ }): boolean;
43
+ symlinks?: boolean;
44
+ cacheWithContext?: boolean;
45
+ roots?: string[];
46
+ };
47
+ resolveLoader: webpack.ResolveLoader;
48
+ mode?: "development" | "production" | "none";
49
+ name?: string;
50
+ context?: string;
51
+ devtool?: webpack.Options.Devtool;
52
+ output?: webpack.Output;
53
+ externals?: string | RegExp | webpack.ExternalsObjectElement | webpack.ExternalsFunctionElement | webpack.ExternalsElement[];
54
+ target?: "node" | "web" | "webworker" | "async-node" | "node-webkit" | "atom" | "electron" | "electron-renderer" | "electron-preload" | "electron-main" | ((compiler?: any) => void);
55
+ bail?: boolean;
56
+ profile?: boolean;
57
+ cache?: boolean | object;
58
+ watch?: boolean;
59
+ watchOptions?: webpack.ICompiler.WatchOptions;
60
+ node?: false | webpack.Node;
61
+ amd?: {
62
+ [moduleName: string]: boolean;
63
+ };
64
+ recordsPath?: string;
65
+ recordsInputPath?: string;
66
+ recordsOutputPath?: string;
67
+ stats?: webpack.Stats.ToStringOptions;
68
+ performance?: false | webpack.Options.Performance;
69
+ parallelism?: number;
70
+ optimization?: webpack.Options.Optimization;
71
+ devServer?: import("webpack-dev-server").Configuration;
72
+ }>;
@@ -27,4 +27,4 @@ export declare type AngularCliWebpackConfig = {
27
27
  * Uses angular cli to extract webpack configuration.
28
28
  * The `AngularCliWebpackConfig` type lists the parts used by storybook
29
29
  */
30
- export declare function extractAngularCliWebpackConfig(dirToSearch: string, project: workspaces.ProjectDefinition, target: workspaces.TargetDefinition): Promise<AngularCliWebpackConfig>;
30
+ export declare function extractAngularCliWebpackConfig(dirToSearch: string, project: workspaces.ProjectDefinition, target: workspaces.TargetDefinition, confName?: string): Promise<AngularCliWebpackConfig>;
@@ -1,73 +1,3 @@
1
1
  import webpack from 'webpack';
2
- import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';
3
- import { Options as CoreOptions } from '@storybook/core-common';
4
- export declare type Options = CoreOptions & {
5
- angularBrowserTarget?: string;
6
- tsConfig?: string;
7
- };
8
- export declare function webpackFinal(baseConfig: webpack.Configuration, options: Options): Promise<webpack.Configuration | {
9
- entry: any[];
10
- module: {
11
- rules: webpack.RuleSetRule[];
12
- noParse?: RegExp | RegExp[] | ((content: string) => boolean);
13
- unknownContextRequest?: string;
14
- unknownContextRecursive?: boolean;
15
- unknownContextRegExp?: RegExp;
16
- unknownContextCritical?: boolean;
17
- exprContextRequest?: string;
18
- exprContextRegExp?: RegExp;
19
- exprContextRecursive?: boolean;
20
- exprContextCritical?: boolean;
21
- wrappedContextRegExp?: RegExp;
22
- wrappedContextRecursive?: boolean;
23
- wrappedContextCritical?: boolean;
24
- strictExportPresence?: boolean;
25
- };
26
- plugins: webpack.Plugin[];
27
- resolve: {
28
- modules: string[];
29
- plugins: TsconfigPathsPlugin[];
30
- descriptionFiles?: string[];
31
- mainFields?: string[] | string[][];
32
- aliasFields?: string[] | string[][];
33
- mainFiles?: string[];
34
- extensions?: string[];
35
- enforceExtension?: boolean;
36
- alias?: {
37
- [key: string]: string;
38
- };
39
- unsafeCache?: boolean | {};
40
- cachePredicate?(data: {
41
- path: string;
42
- request: string;
43
- }): boolean;
44
- symlinks?: boolean;
45
- cacheWithContext?: boolean;
46
- roots?: string[];
47
- };
48
- resolveLoader: webpack.ResolveLoader;
49
- mode?: "development" | "production" | "none";
50
- name?: string;
51
- context?: string;
52
- devtool?: webpack.Options.Devtool;
53
- output?: webpack.Output;
54
- externals?: string | RegExp | webpack.ExternalsObjectElement | webpack.ExternalsFunctionElement | webpack.ExternalsElement[];
55
- target?: "node" | "web" | "webworker" | "async-node" | "node-webkit" | "atom" | "electron" | "electron-renderer" | "electron-preload" | "electron-main" | ((compiler?: any) => void);
56
- bail?: boolean;
57
- profile?: boolean;
58
- cache?: boolean | object;
59
- watch?: boolean;
60
- watchOptions?: webpack.ICompiler.WatchOptions;
61
- node?: false | webpack.Node;
62
- amd?: {
63
- [moduleName: string]: boolean;
64
- };
65
- recordsPath?: string;
66
- recordsInputPath?: string;
67
- recordsOutputPath?: string;
68
- stats?: webpack.Stats.ToStringOptions;
69
- performance?: false | webpack.Options.Performance;
70
- parallelism?: number;
71
- optimization?: webpack.Options.Optimization;
72
- devServer?: import("webpack-dev-server").Configuration;
73
- }>;
2
+ import { PresetOptions } from './options';
3
+ export declare function webpackFinal(baseConfig: webpack.Configuration, options: PresetOptions): Promise<webpack.Configuration>;
@@ -1,10 +1,10 @@
1
1
  import { Configuration } from 'webpack';
2
- import { Options } from './framework-preset-angular-cli';
2
+ import { PresetOptions } from './options';
3
3
  /**
4
4
  * Run ngcc for converting modules to ivy format before starting storybook
5
5
  * This step is needed in order to support Ivy in storybook
6
6
  *
7
7
  * Information about Ivy can be found here https://angular.io/guide/ivy
8
8
  */
9
- export declare const runNgcc: () => void;
10
- export declare const webpack: (webpackConfig: Configuration, options: Options) => Promise<Configuration>;
9
+ export declare const runNgcc: () => Promise<void>;
10
+ export declare const webpack: (webpackConfig: Configuration, options: PresetOptions) => Promise<Configuration>;
@@ -1,3 +1,14 @@
1
- import { LoadOptions } from '@storybook/core-common';
1
+ import { LoadOptions, Options as CoreOptions } from '@storybook/core-common';
2
+ import { BuilderContext } from '@angular-devkit/architect';
3
+ import { ExtraEntryPoint, StylePreprocessorOptions } from '@angular-devkit/build-angular';
4
+ export declare type PresetOptions = CoreOptions & {
5
+ angularBrowserTarget?: string | null;
6
+ angularBuilderOptions?: {
7
+ styles?: ExtraEntryPoint[];
8
+ stylePreprocessorOptions?: StylePreprocessorOptions;
9
+ };
10
+ angularBuilderContext?: BuilderContext | null;
11
+ tsConfig?: string;
12
+ };
2
13
  declare const _default: LoadOptions;
3
14
  export default _default;
@@ -0,0 +1,3 @@
1
+ import { StorybookConfig } from '@storybook/core-common';
2
+ export declare const config: StorybookConfig['config'];
3
+ export declare const addons: StorybookConfig['addons'];
@@ -1,12 +1,15 @@
1
1
  import { BuilderOutput } from '@angular-devkit/architect';
2
2
  import { JsonObject } from '@angular-devkit/core';
3
3
  import { CLIOptions } from '@storybook/core-common';
4
+ import { ExtraEntryPoint, StylePreprocessorOptions } from '@angular-devkit/build-angular';
4
5
  export declare type StorybookBuilderOptions = JsonObject & {
5
6
  browserTarget?: string | null;
6
7
  tsConfig?: string;
7
8
  compodoc: boolean;
8
9
  compodocArgs: string[];
9
- } & Pick<CLIOptions, 'staticDir' | 'outputDir' | 'configDir' | 'loglevel' | 'quiet' | 'docs'>;
10
+ styles?: ExtraEntryPoint[];
11
+ stylePreprocessorOptions?: StylePreprocessorOptions;
12
+ } & Pick<CLIOptions, 'outputDir' | 'configDir' | 'loglevel' | 'quiet' | 'docs'>;
10
13
  export declare type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
11
14
  declare const _default: import("@angular-devkit/architect/src/internal").Builder<StorybookBuilderOptions>;
12
15
  export default _default;
@@ -46,17 +46,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
46
46
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
47
  }
48
48
  };
49
- var __rest = (this && this.__rest) || function (s, e) {
50
- var t = {};
51
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
52
- t[p] = s[p];
53
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
54
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
55
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
56
- t[p[i]] = s[p[i]];
57
- }
58
- return t;
59
- };
60
49
  var __importDefault = (this && this.__importDefault) || function (mod) {
61
50
  return (mod && mod.__esModule) ? mod : { "default": mod };
62
51
  };
@@ -64,6 +53,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
64
53
  var architect_1 = require("@angular-devkit/architect");
65
54
  var rxjs_1 = require("rxjs");
66
55
  var operators_1 = require("rxjs/operators");
56
+ var find_up_1 = require("find-up");
67
57
  // eslint-disable-next-line import/no-extraneous-dependencies
68
58
  var standalone_1 = __importDefault(require("@storybook/angular/standalone"));
69
59
  var run_compodoc_1 = require("../utils/run-compodoc");
@@ -78,8 +68,19 @@ function commandBuilder(options, context) {
78
68
  return runCompodoc$.pipe(operators_1.mapTo({ tsConfig: tsConfig }));
79
69
  }), operators_1.map(function (_a) {
80
70
  var tsConfig = _a.tsConfig;
81
- var browserTarget = options.browserTarget, otherOptions = __rest(options, ["browserTarget"]);
82
- return __assign(__assign({}, otherOptions), { angularBrowserTarget: browserTarget, tsConfig: tsConfig });
71
+ var browserTarget = options.browserTarget, stylePreprocessorOptions = options.stylePreprocessorOptions, styles = options.styles, configDir = options.configDir, docs = options.docs, loglevel = options.loglevel, outputDir = options.outputDir, quiet = options.quiet;
72
+ var standaloneOptions = {
73
+ configDir: configDir,
74
+ docs: docs,
75
+ loglevel: loglevel,
76
+ outputDir: outputDir,
77
+ quiet: quiet,
78
+ angularBrowserTarget: browserTarget,
79
+ angularBuilderContext: context,
80
+ angularBuilderOptions: __assign(__assign({}, (stylePreprocessorOptions ? { stylePreprocessorOptions: stylePreprocessorOptions } : {})), (styles ? { styles: styles } : {})),
81
+ tsConfig: tsConfig,
82
+ };
83
+ return standaloneOptions;
83
84
  }), operators_1.switchMap(function (standaloneOptions) { return runInstance(__assign(__assign({}, standaloneOptions), { mode: 'static' })); }), operators_1.map(function () {
84
85
  return { success: true };
85
86
  }));
@@ -103,7 +104,7 @@ function setup(options, context) {
103
104
  browserOptions = _f.sent();
104
105
  _f.label = 4;
105
106
  case 4: return [2 /*return*/, {
106
- tsConfig: (_b = (_a = options.tsConfig) !== null && _a !== void 0 ? _a : browserOptions.tsConfig) !== null && _b !== void 0 ? _b : undefined,
107
+ tsConfig: (_b = (_a = options.tsConfig) !== null && _a !== void 0 ? _a : find_up_1.sync('tsconfig.json', { cwd: options.configDir })) !== null && _b !== void 0 ? _b : browserOptions.tsConfig,
107
108
  }];
108
109
  }
109
110
  });
@@ -14,13 +14,6 @@
14
14
  "type": "string",
15
15
  "description": "The full path for the TypeScript configuration file, relative to the current workspace."
16
16
  },
17
- "staticDir": {
18
- "type": "array",
19
- "description": "Directory where to load static files from, array of strings.",
20
- "items": {
21
- "type": "string"
22
- }
23
- },
24
17
  "outputDir": {
25
18
  "type": "string",
26
19
  "description": "Directory where to store built files.",
@@ -58,15 +51,62 @@
58
51
  "items": {
59
52
  "type": "string"
60
53
  }
54
+ },
55
+ "styles": {
56
+ "type": "array",
57
+ "description": "Global styles to be included in the build.",
58
+ "items": {
59
+ "$ref": "#/definitions/extraEntryPoint"
60
+ },
61
+ "default": ""
62
+ },
63
+ "stylePreprocessorOptions": {
64
+ "description": "Options to pass to style preprocessors.",
65
+ "type": "object",
66
+ "properties": {
67
+ "includePaths": {
68
+ "description": "Paths to include. Paths will be resolved to workspace root.",
69
+ "type": "array",
70
+ "items": {
71
+ "type": "string"
72
+ },
73
+ "default": []
74
+ }
75
+ },
76
+ "additionalProperties": false,
77
+ "default": ""
61
78
  }
62
79
  },
63
80
  "additionalProperties": false,
64
- "oneOf": [
65
- {
66
- "required": ["browserTarget"]
67
- },
68
- {
69
- "required": ["tsConfig"]
81
+ "definitions": {
82
+ "extraEntryPoint": {
83
+ "oneOf": [
84
+ {
85
+ "type": "object",
86
+ "properties": {
87
+ "input": {
88
+ "type": "string",
89
+ "description": "The file to include."
90
+ },
91
+ "bundleName": {
92
+ "type": "string",
93
+ "pattern": "^[\\w\\-.]*$",
94
+ "description": "The bundle name for this extra entry point."
95
+ },
96
+ "inject": {
97
+ "type": "boolean",
98
+ "description": "If the bundle will be referenced in the HTML file.",
99
+ "default": true
100
+ }
101
+ },
102
+ "additionalProperties": false,
103
+ "required": ["input"]
104
+ },
105
+ {
106
+ "type": "string",
107
+ "description": "The file to include."
108
+ }
109
+ ]
70
110
  }
71
- ]
111
+ }
72
112
  }
@@ -1,12 +1,15 @@
1
1
  import { BuilderOutput } from '@angular-devkit/architect';
2
2
  import { JsonObject } from '@angular-devkit/core';
3
+ import { ExtraEntryPoint, StylePreprocessorOptions } from '@angular-devkit/build-angular';
3
4
  import { CLIOptions } from '@storybook/core-common';
4
5
  export declare type StorybookBuilderOptions = JsonObject & {
5
6
  browserTarget?: string | null;
6
7
  tsConfig?: string;
7
8
  compodoc: boolean;
8
9
  compodocArgs: string[];
9
- } & Pick<CLIOptions, 'port' | 'host' | 'staticDir' | 'configDir' | 'https' | 'sslCa' | 'sslCert' | 'sslKey' | 'smokeTest' | 'ci' | 'quiet' | 'docs'>;
10
+ styles?: ExtraEntryPoint[];
11
+ stylePreprocessorOptions?: StylePreprocessorOptions;
12
+ } & Pick<CLIOptions, 'port' | 'host' | 'configDir' | 'https' | 'sslCa' | 'sslCert' | 'sslKey' | 'smokeTest' | 'ci' | 'quiet' | 'docs'>;
10
13
  export declare type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
11
14
  declare const _default: import("@angular-devkit/architect/src/internal").Builder<StorybookBuilderOptions>;
12
15
  export default _default;
@@ -46,17 +46,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
46
46
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
47
  }
48
48
  };
49
- var __rest = (this && this.__rest) || function (s, e) {
50
- var t = {};
51
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
52
- t[p] = s[p];
53
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
54
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
55
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
56
- t[p[i]] = s[p[i]];
57
- }
58
- return t;
59
- };
60
49
  var __importDefault = (this && this.__importDefault) || function (mod) {
61
50
  return (mod && mod.__esModule) ? mod : { "default": mod };
62
51
  };
@@ -64,6 +53,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
64
53
  var architect_1 = require("@angular-devkit/architect");
65
54
  var rxjs_1 = require("rxjs");
66
55
  var operators_1 = require("rxjs/operators");
56
+ var find_up_1 = require("find-up");
67
57
  // eslint-disable-next-line import/no-extraneous-dependencies
68
58
  var standalone_1 = __importDefault(require("@storybook/angular/standalone"));
69
59
  var run_compodoc_1 = require("../utils/run-compodoc");
@@ -78,8 +68,25 @@ function commandBuilder(options, context) {
78
68
  return runCompodoc$.pipe(operators_1.mapTo({ tsConfig: tsConfig }));
79
69
  }), operators_1.map(function (_a) {
80
70
  var tsConfig = _a.tsConfig;
81
- var browserTarget = options.browserTarget, otherOptions = __rest(options, ["browserTarget"]);
82
- return __assign(__assign({}, otherOptions), { angularBrowserTarget: browserTarget, tsConfig: tsConfig });
71
+ var browserTarget = options.browserTarget, stylePreprocessorOptions = options.stylePreprocessorOptions, styles = options.styles, ci = options.ci, configDir = options.configDir, docs = options.docs, host = options.host, https = options.https, port = options.port, quiet = options.quiet, smokeTest = options.smokeTest, sslCa = options.sslCa, sslCert = options.sslCert, sslKey = options.sslKey;
72
+ var standaloneOptions = {
73
+ ci: ci,
74
+ configDir: configDir,
75
+ docs: docs,
76
+ host: host,
77
+ https: https,
78
+ port: port,
79
+ quiet: quiet,
80
+ smokeTest: smokeTest,
81
+ sslCa: sslCa,
82
+ sslCert: sslCert,
83
+ sslKey: sslKey,
84
+ angularBrowserTarget: browserTarget,
85
+ angularBuilderContext: context,
86
+ angularBuilderOptions: __assign(__assign({}, (stylePreprocessorOptions ? { stylePreprocessorOptions: stylePreprocessorOptions } : {})), (styles ? { styles: styles } : {})),
87
+ tsConfig: tsConfig,
88
+ };
89
+ return standaloneOptions;
83
90
  }), operators_1.switchMap(function (standaloneOptions) { return runInstance(standaloneOptions); }), operators_1.map(function () {
84
91
  return { success: true };
85
92
  }));
@@ -103,7 +110,7 @@ function setup(options, context) {
103
110
  browserOptions = _f.sent();
104
111
  _f.label = 4;
105
112
  case 4: return [2 /*return*/, {
106
- tsConfig: (_b = (_a = options.tsConfig) !== null && _a !== void 0 ? _a : browserOptions.tsConfig) !== null && _b !== void 0 ? _b : undefined,
113
+ tsConfig: (_b = (_a = options.tsConfig) !== null && _a !== void 0 ? _a : find_up_1.sync('tsconfig.json', { cwd: options.configDir })) !== null && _b !== void 0 ? _b : browserOptions.tsConfig,
107
114
  }];
108
115
  }
109
116
  });
@@ -24,13 +24,6 @@
24
24
  "description": "Host to listen on.",
25
25
  "default": "localhost"
26
26
  },
27
- "staticDir": {
28
- "type": "array",
29
- "description": "Directory where to load static files from, array of strings.",
30
- "items": {
31
- "type": "string"
32
- }
33
- },
34
27
  "configDir": {
35
28
  "type": "string",
36
29
  "description": "Directory where to load Storybook configurations from.",
@@ -85,15 +78,62 @@
85
78
  "items": {
86
79
  "type": "string"
87
80
  }
81
+ },
82
+ "styles": {
83
+ "type": "array",
84
+ "description": "Global styles to be included in the build.",
85
+ "items": {
86
+ "$ref": "#/definitions/extraEntryPoint"
87
+ },
88
+ "default": ""
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
+ "default": []
101
+ }
102
+ },
103
+ "additionalProperties": false,
104
+ "default": ""
88
105
  }
89
106
  },
90
107
  "additionalProperties": false,
91
- "oneOf": [
92
- {
93
- "required": ["browserTarget"]
94
- },
95
- {
96
- "required": ["tsConfig"]
108
+ "definitions": {
109
+ "extraEntryPoint": {
110
+ "oneOf": [
111
+ {
112
+ "type": "object",
113
+ "properties": {
114
+ "input": {
115
+ "type": "string",
116
+ "description": "The file to include."
117
+ },
118
+ "bundleName": {
119
+ "type": "string",
120
+ "pattern": "^[\\w\\-.]*$",
121
+ "description": "The bundle name for this extra entry point."
122
+ },
123
+ "inject": {
124
+ "type": "boolean",
125
+ "description": "If the bundle will be referenced in the HTML file.",
126
+ "default": true
127
+ }
128
+ },
129
+ "additionalProperties": false,
130
+ "required": ["input"]
131
+ },
132
+ {
133
+ "type": "string",
134
+ "description": "The file to include."
135
+ }
136
+ ]
97
137
  }
98
- ]
138
+ }
99
139
  }
@@ -1,4 +1,6 @@
1
+ import './globals';
1
2
  export { render, renderToDOM } from './render';
3
+ export { decorateStory } from './decorateStory';
2
4
  export declare const parameters: {
3
5
  framework: string;
4
6
  };
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parameters = void 0;
4
+ require("./globals");
4
5
  var render_1 = require("./render");
5
6
  Object.defineProperty(exports, "render", { enumerable: true, get: function () { return render_1.render; } });
6
7
  Object.defineProperty(exports, "renderToDOM", { enumerable: true, get: function () { return render_1.renderToDOM; } });
8
+ var decorateStory_1 = require("./decorateStory");
9
+ Object.defineProperty(exports, "decorateStory", { enumerable: true, get: function () { return decorateStory_1.decorateStory; } });
7
10
  exports.parameters = { framework: 'angular' };
@@ -1,3 +1,4 @@
1
1
  import { DecoratorFunction, LegacyStoryFn } from '@storybook/csf';
2
2
  import { AngularFramework } from './types-6-0';
3
3
  export default function decorateStory(mainStoryFn: LegacyStoryFn<AngularFramework>, decorators: DecoratorFunction<AngularFramework>[]): LegacyStoryFn<AngularFramework>;
4
+ export { decorateStory };
@@ -18,6 +18,7 @@ var __spreadArrays = (this && this.__spreadArrays) || function () {
18
18
  return r;
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.decorateStory = void 0;
21
22
  var store_1 = require("@storybook/store");
22
23
  var ComputesTemplateFromComponent_1 = require("./angular-beta/ComputesTemplateFromComponent");
23
24
  function decorateStory(mainStoryFn, decorators) {
@@ -30,6 +31,7 @@ function decorateStory(mainStoryFn, decorators) {
30
31
  return returnDecorators;
31
32
  }
32
33
  exports.default = decorateStory;
34
+ exports.decorateStory = decorateStory;
33
35
  var prepareMain = function (story, context) {
34
36
  var _a;
35
37
  var template = story.template;