@storybook/angular 7.0.0-rc.2 → 7.0.0-rc.4
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/builders/build-storybook/index.d.ts +2 -1
- package/dist/builders/build-storybook/index.js +2 -1
- package/dist/builders/build-storybook/schema.json +49 -11
- package/dist/builders/start-storybook/index.d.ts +2 -1
- package/dist/builders/start-storybook/index.js +2 -1
- package/dist/builders/start-storybook/schema.json +48 -7
- package/dist/builders/utils/standalone-options.d.ts +4 -2
- package/dist/preset.js +3 -5
- package/dist/preset.mjs +3 -2
- package/package.json +15 -15
|
@@ -2,7 +2,7 @@ import { BuilderOutput } from '@angular-devkit/architect';
|
|
|
2
2
|
import { JsonObject } from '@angular-devkit/core';
|
|
3
3
|
import { CLIOptions } from '@storybook/types';
|
|
4
4
|
import { StylePreprocessorOptions } from '@angular-devkit/build-angular';
|
|
5
|
-
import { StyleElement } from '@angular-devkit/build-angular/src/builders/browser/schema';
|
|
5
|
+
import { AssetPattern, StyleElement } from '@angular-devkit/build-angular/src/builders/browser/schema';
|
|
6
6
|
export type StorybookBuilderOptions = JsonObject & {
|
|
7
7
|
browserTarget?: string | null;
|
|
8
8
|
tsConfig?: string;
|
|
@@ -11,6 +11,7 @@ export type StorybookBuilderOptions = JsonObject & {
|
|
|
11
11
|
compodocArgs: string[];
|
|
12
12
|
styles?: StyleElement[];
|
|
13
13
|
stylePreprocessorOptions?: StylePreprocessorOptions;
|
|
14
|
+
assets?: AssetPattern[];
|
|
14
15
|
} & Pick<CLIOptions, 'outputDir' | 'configDir' | 'loglevel' | 'quiet' | 'webpackStatsJson' | 'disableTelemetry'>;
|
|
15
16
|
export type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
|
|
16
17
|
declare const _default: import("@angular-devkit/architect/src/internal").Builder<any>;
|
|
@@ -16,7 +16,7 @@ function commandBuilder(options, context) {
|
|
|
16
16
|
: (0, rxjs_1.of)({});
|
|
17
17
|
return runCompodoc$.pipe((0, operators_1.mapTo)({ tsConfig }));
|
|
18
18
|
}), (0, operators_1.map)(({ tsConfig }) => {
|
|
19
|
-
const { browserTarget, stylePreprocessorOptions, styles, configDir, docs, loglevel, outputDir, quiet, webpackStatsJson, disableTelemetry, } = options;
|
|
19
|
+
const { browserTarget, stylePreprocessorOptions, styles, configDir, docs, loglevel, outputDir, quiet, webpackStatsJson, disableTelemetry, assets, } = options;
|
|
20
20
|
const standaloneOptions = {
|
|
21
21
|
packageJson: (0, read_pkg_up_1.sync)({ cwd: __dirname }).packageJson,
|
|
22
22
|
configDir,
|
|
@@ -30,6 +30,7 @@ function commandBuilder(options, context) {
|
|
|
30
30
|
angularBuilderOptions: {
|
|
31
31
|
...(stylePreprocessorOptions ? { stylePreprocessorOptions } : {}),
|
|
32
32
|
...(styles ? { styles } : {}),
|
|
33
|
+
...(assets ? { assets } : {}),
|
|
33
34
|
},
|
|
34
35
|
tsConfig,
|
|
35
36
|
webpackStatsJson,
|
|
@@ -47,19 +47,13 @@
|
|
|
47
47
|
"compodocArgs": {
|
|
48
48
|
"type": "array",
|
|
49
49
|
"description": "Compodoc options : https://compodoc.app/guides/options.html. Options `-p` with tsconfig path and `-d` with workspace root is always given.",
|
|
50
|
-
"default": [
|
|
51
|
-
"-e",
|
|
52
|
-
"json"
|
|
53
|
-
],
|
|
50
|
+
"default": ["-e", "json"],
|
|
54
51
|
"items": {
|
|
55
52
|
"type": "string"
|
|
56
53
|
}
|
|
57
54
|
},
|
|
58
55
|
"webpackStatsJson": {
|
|
59
|
-
"type": [
|
|
60
|
-
"boolean",
|
|
61
|
-
"string"
|
|
62
|
-
],
|
|
56
|
+
"type": ["boolean", "string"],
|
|
63
57
|
"description": "Write Webpack Stats JSON to disk",
|
|
64
58
|
"default": false
|
|
65
59
|
},
|
|
@@ -85,10 +79,56 @@
|
|
|
85
79
|
},
|
|
86
80
|
"additionalProperties": false,
|
|
87
81
|
"default": ""
|
|
82
|
+
},
|
|
83
|
+
"assets": {
|
|
84
|
+
"type": "array",
|
|
85
|
+
"description": "List of static application assets.",
|
|
86
|
+
"default": [],
|
|
87
|
+
"items": {
|
|
88
|
+
"$ref": "#/definitions/assetPattern"
|
|
89
|
+
}
|
|
88
90
|
}
|
|
89
91
|
},
|
|
90
92
|
"additionalProperties": false,
|
|
91
93
|
"definitions": {
|
|
94
|
+
"assetPattern": {
|
|
95
|
+
"oneOf": [
|
|
96
|
+
{
|
|
97
|
+
"type": "object",
|
|
98
|
+
"properties": {
|
|
99
|
+
"followSymlinks": {
|
|
100
|
+
"type": "boolean",
|
|
101
|
+
"default": false,
|
|
102
|
+
"description": "Allow glob patterns to follow symlink directories. This allows subdirectories of the symlink to be searched."
|
|
103
|
+
},
|
|
104
|
+
"glob": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"description": "The pattern to match."
|
|
107
|
+
},
|
|
108
|
+
"input": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"description": "The input directory path in which to apply 'glob'. Defaults to the project root."
|
|
111
|
+
},
|
|
112
|
+
"ignore": {
|
|
113
|
+
"description": "An array of globs to ignore.",
|
|
114
|
+
"type": "array",
|
|
115
|
+
"items": {
|
|
116
|
+
"type": "string"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"output": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"description": "Absolute path within the output."
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"additionalProperties": false,
|
|
125
|
+
"required": ["glob", "input", "output"]
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"type": "string"
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
},
|
|
92
132
|
"styleElement": {
|
|
93
133
|
"oneOf": [
|
|
94
134
|
{
|
|
@@ -110,9 +150,7 @@
|
|
|
110
150
|
}
|
|
111
151
|
},
|
|
112
152
|
"additionalProperties": false,
|
|
113
|
-
"required": [
|
|
114
|
-
"input"
|
|
115
|
-
]
|
|
153
|
+
"required": ["input"]
|
|
116
154
|
},
|
|
117
155
|
{
|
|
118
156
|
"type": "string",
|
|
@@ -2,7 +2,7 @@ import { BuilderOutput } from '@angular-devkit/architect';
|
|
|
2
2
|
import { JsonObject } from '@angular-devkit/core';
|
|
3
3
|
import { StylePreprocessorOptions } from '@angular-devkit/build-angular';
|
|
4
4
|
import { CLIOptions } from '@storybook/types';
|
|
5
|
-
import { StyleElement } from '@angular-devkit/build-angular/src/builders/browser/schema';
|
|
5
|
+
import { AssetPattern, StyleElement } from '@angular-devkit/build-angular/src/builders/browser/schema';
|
|
6
6
|
export type StorybookBuilderOptions = JsonObject & {
|
|
7
7
|
browserTarget?: string | null;
|
|
8
8
|
tsConfig?: string;
|
|
@@ -11,6 +11,7 @@ export type StorybookBuilderOptions = JsonObject & {
|
|
|
11
11
|
compodocArgs: string[];
|
|
12
12
|
styles?: StyleElement[];
|
|
13
13
|
stylePreprocessorOptions?: StylePreprocessorOptions;
|
|
14
|
+
assets?: AssetPattern[];
|
|
14
15
|
} & Pick<CLIOptions, 'port' | 'host' | 'configDir' | 'https' | 'sslCa' | 'sslCert' | 'sslKey' | 'smokeTest' | 'ci' | 'quiet' | 'disableTelemetry'>;
|
|
15
16
|
export type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
|
|
16
17
|
declare const _default: import("@angular-devkit/architect/src/internal").Builder<any>;
|
|
@@ -16,7 +16,7 @@ function commandBuilder(options, context) {
|
|
|
16
16
|
: (0, rxjs_1.of)({});
|
|
17
17
|
return runCompodoc$.pipe((0, operators_1.mapTo)({ tsConfig }));
|
|
18
18
|
}), (0, operators_1.map)(({ tsConfig }) => {
|
|
19
|
-
const { browserTarget, stylePreprocessorOptions, styles, ci, configDir, docs, host, https, port, quiet, smokeTest, sslCa, sslCert, sslKey, disableTelemetry, } = options;
|
|
19
|
+
const { browserTarget, stylePreprocessorOptions, styles, ci, configDir, docs, host, https, port, quiet, smokeTest, sslCa, sslCert, sslKey, disableTelemetry, assets, } = options;
|
|
20
20
|
const standaloneOptions = {
|
|
21
21
|
packageJson: (0, read_pkg_up_1.sync)({ cwd: __dirname }).packageJson,
|
|
22
22
|
ci,
|
|
@@ -36,6 +36,7 @@ function commandBuilder(options, context) {
|
|
|
36
36
|
angularBuilderOptions: {
|
|
37
37
|
...(stylePreprocessorOptions ? { stylePreprocessorOptions } : {}),
|
|
38
38
|
...(styles ? { styles } : {}),
|
|
39
|
+
...(assets ? { assets } : {}),
|
|
39
40
|
},
|
|
40
41
|
tsConfig,
|
|
41
42
|
};
|
|
@@ -74,10 +74,7 @@
|
|
|
74
74
|
"compodocArgs": {
|
|
75
75
|
"type": "array",
|
|
76
76
|
"description": "Compodoc options : https://compodoc.app/guides/options.html. Options `-p` with tsconfig path and `-d` with workspace root is always given.",
|
|
77
|
-
"default": [
|
|
78
|
-
"-e",
|
|
79
|
-
"json"
|
|
80
|
-
],
|
|
77
|
+
"default": ["-e", "json"],
|
|
81
78
|
"items": {
|
|
82
79
|
"type": "string"
|
|
83
80
|
}
|
|
@@ -104,10 +101,56 @@
|
|
|
104
101
|
},
|
|
105
102
|
"additionalProperties": false,
|
|
106
103
|
"default": ""
|
|
104
|
+
},
|
|
105
|
+
"assets": {
|
|
106
|
+
"type": "array",
|
|
107
|
+
"description": "List of static application assets.",
|
|
108
|
+
"default": [],
|
|
109
|
+
"items": {
|
|
110
|
+
"$ref": "#/definitions/assetPattern"
|
|
111
|
+
}
|
|
107
112
|
}
|
|
108
113
|
},
|
|
109
114
|
"additionalProperties": false,
|
|
110
115
|
"definitions": {
|
|
116
|
+
"assetPattern": {
|
|
117
|
+
"oneOf": [
|
|
118
|
+
{
|
|
119
|
+
"type": "object",
|
|
120
|
+
"properties": {
|
|
121
|
+
"followSymlinks": {
|
|
122
|
+
"type": "boolean",
|
|
123
|
+
"default": false,
|
|
124
|
+
"description": "Allow glob patterns to follow symlink directories. This allows subdirectories of the symlink to be searched."
|
|
125
|
+
},
|
|
126
|
+
"glob": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"description": "The pattern to match."
|
|
129
|
+
},
|
|
130
|
+
"input": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"description": "The input directory path in which to apply 'glob'. Defaults to the project root."
|
|
133
|
+
},
|
|
134
|
+
"ignore": {
|
|
135
|
+
"description": "An array of globs to ignore.",
|
|
136
|
+
"type": "array",
|
|
137
|
+
"items": {
|
|
138
|
+
"type": "string"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"output": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"description": "Absolute path within the output."
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"additionalProperties": false,
|
|
147
|
+
"required": ["glob", "input", "output"]
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"type": "string"
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
},
|
|
111
154
|
"styleElement": {
|
|
112
155
|
"oneOf": [
|
|
113
156
|
{
|
|
@@ -129,9 +172,7 @@
|
|
|
129
172
|
}
|
|
130
173
|
},
|
|
131
174
|
"additionalProperties": false,
|
|
132
|
-
"required": [
|
|
133
|
-
"input"
|
|
134
|
-
]
|
|
175
|
+
"required": ["input"]
|
|
135
176
|
},
|
|
136
177
|
{
|
|
137
178
|
"type": "string",
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { BuilderContext } from '@angular-devkit/architect';
|
|
2
|
+
import { AssetPattern, StyleElement, StylePreprocessorOptions } from '@angular-devkit/build-angular/src/builders/browser/schema';
|
|
2
3
|
import { LoadOptions, CLIOptions, BuilderOptions } from '@storybook/types';
|
|
3
4
|
export type StandaloneOptions = CLIOptions & LoadOptions & BuilderOptions & {
|
|
4
5
|
mode?: 'static' | 'dev';
|
|
5
6
|
angularBrowserTarget?: string | null;
|
|
6
7
|
angularBuilderOptions?: Record<string, any> & {
|
|
7
|
-
styles?:
|
|
8
|
-
stylePreprocessorOptions?:
|
|
8
|
+
styles?: StyleElement[];
|
|
9
|
+
stylePreprocessorOptions?: StylePreprocessorOptions;
|
|
10
|
+
assets?: AssetPattern[];
|
|
9
11
|
};
|
|
10
12
|
angularBuilderContext?: BuilderContext | null;
|
|
11
13
|
tsConfig?: string;
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.typescript = exports.core = exports.previewAnnotations = exports.addons = void 0;
|
|
7
|
-
const path_1 =
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const wrapForPnP = (input) => (0, path_1.dirname)(require.resolve((0, path_1.join)(input, 'package.json')));
|
|
8
6
|
exports.addons = [
|
|
9
7
|
require.resolve('./server/framework-preset-angular-cli'),
|
|
10
8
|
require.resolve('./server/framework-preset-angular-ivy'),
|
|
@@ -20,7 +18,7 @@ const core = async (config, options) => {
|
|
|
20
18
|
return {
|
|
21
19
|
...config,
|
|
22
20
|
builder: {
|
|
23
|
-
name:
|
|
21
|
+
name: wrapForPnP('@storybook/builder-webpack5'),
|
|
24
22
|
options: typeof framework === 'string' ? {} : framework.options.builder || {},
|
|
25
23
|
},
|
|
26
24
|
};
|
package/dist/preset.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { dirname, join } from 'path';
|
|
2
|
+
const wrapForPnP = (input) => dirname(require.resolve(join(input, 'package.json')));
|
|
2
3
|
export const addons = [
|
|
3
4
|
require.resolve('./server/framework-preset-angular-cli'),
|
|
4
5
|
require.resolve('./server/framework-preset-angular-ivy'),
|
|
@@ -13,7 +14,7 @@ export const core = async (config, options) => {
|
|
|
13
14
|
return {
|
|
14
15
|
...config,
|
|
15
16
|
builder: {
|
|
16
|
-
name:
|
|
17
|
+
name: wrapForPnP('@storybook/builder-webpack5'),
|
|
17
18
|
options: typeof framework === 'string' ? {} : framework.options.builder || {},
|
|
18
19
|
},
|
|
19
20
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/angular",
|
|
3
|
-
"version": "7.0.0-rc.
|
|
3
|
+
"version": "7.0.0-rc.4",
|
|
4
4
|
"description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -36,20 +36,20 @@
|
|
|
36
36
|
"prep": "../../../scripts/prepare/tsc.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@storybook/builder-webpack5": "7.0.0-rc.
|
|
40
|
-
"@storybook/cli": "7.0.0-rc.
|
|
41
|
-
"@storybook/client-logger": "7.0.0-rc.
|
|
42
|
-
"@storybook/core-client": "7.0.0-rc.
|
|
43
|
-
"@storybook/core-common": "7.0.0-rc.
|
|
44
|
-
"@storybook/core-events": "7.0.0-rc.
|
|
45
|
-
"@storybook/core-server": "7.0.0-rc.
|
|
46
|
-
"@storybook/core-webpack": "7.0.0-rc.
|
|
47
|
-
"@storybook/docs-tools": "7.0.0-rc.
|
|
39
|
+
"@storybook/builder-webpack5": "7.0.0-rc.4",
|
|
40
|
+
"@storybook/cli": "7.0.0-rc.4",
|
|
41
|
+
"@storybook/client-logger": "7.0.0-rc.4",
|
|
42
|
+
"@storybook/core-client": "7.0.0-rc.4",
|
|
43
|
+
"@storybook/core-common": "7.0.0-rc.4",
|
|
44
|
+
"@storybook/core-events": "7.0.0-rc.4",
|
|
45
|
+
"@storybook/core-server": "7.0.0-rc.4",
|
|
46
|
+
"@storybook/core-webpack": "7.0.0-rc.4",
|
|
47
|
+
"@storybook/docs-tools": "7.0.0-rc.4",
|
|
48
48
|
"@storybook/global": "^5.0.0",
|
|
49
|
-
"@storybook/manager-api": "7.0.0-rc.
|
|
50
|
-
"@storybook/node-logger": "7.0.0-rc.
|
|
51
|
-
"@storybook/preview-api": "7.0.0-rc.
|
|
52
|
-
"@storybook/types": "7.0.0-rc.
|
|
49
|
+
"@storybook/manager-api": "7.0.0-rc.4",
|
|
50
|
+
"@storybook/node-logger": "7.0.0-rc.4",
|
|
51
|
+
"@storybook/preview-api": "7.0.0-rc.4",
|
|
52
|
+
"@storybook/types": "7.0.0-rc.4",
|
|
53
53
|
"@types/node": "^16.0.0",
|
|
54
54
|
"@types/react": "^16.14.34",
|
|
55
55
|
"@types/react-dom": "^16.9.14",
|
|
@@ -123,5 +123,5 @@
|
|
|
123
123
|
"bundler": {
|
|
124
124
|
"tsConfig": "tsconfig.build.json"
|
|
125
125
|
},
|
|
126
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "6fb713a2ca980fa241f82a076579889fcdf47ecc"
|
|
127
127
|
}
|