@storybook/angular 6.5.0-alpha.29 → 6.5.0-alpha.32
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/ts3.9/builders/build-storybook/index.js +33 -84
- package/dist/ts3.9/builders/start-storybook/index.js +40 -91
- package/dist/ts3.9/builders/utils/build-standalone-errors-handler.js +13 -11
- package/dist/ts3.9/builders/utils/run-compodoc.js +19 -25
- package/dist/ts3.9/client/preview/angular/app.token.js +1 -1
- package/dist/ts3.9/client/preview/angular/components/app.component.js +55 -59
- package/dist/ts3.9/client/preview/angular/helpers.js +66 -80
- package/dist/ts3.9/client/preview/angular-beta/AbstractRenderer.js +77 -125
- package/dist/ts3.9/client/preview/angular-beta/CanvasRenderer.js +18 -81
- package/dist/ts3.9/client/preview/angular-beta/ComputesTemplateFromComponent.js +53 -73
- package/dist/ts3.9/client/preview/angular-beta/DocsRenderer.js +41 -127
- package/dist/ts3.9/client/preview/angular-beta/RendererFactory.js +30 -66
- package/dist/ts3.9/client/preview/angular-beta/StorybookModule.js +42 -46
- package/dist/ts3.9/client/preview/angular-beta/StorybookProvider.js +15 -17
- package/dist/ts3.9/client/preview/angular-beta/StorybookWrapperComponent.js +63 -92
- package/dist/ts3.9/client/preview/angular-beta/utils/NgComponentAnalyzer.js +29 -49
- package/dist/ts3.9/client/preview/angular-beta/utils/NgModulesAnalyzer.js +10 -10
- package/dist/ts3.9/client/preview/decorateStory.js +18 -40
- package/dist/ts3.9/client/preview/decorators.js +27 -46
- package/dist/ts3.9/client/preview/globals.js +2 -2
- package/dist/ts3.9/client/preview/index.js +8 -21
- package/dist/ts3.9/client/preview/render.js +17 -56
- package/dist/ts3.9/demo/button.component.js +31 -22
- package/dist/ts3.9/demo/welcome.component.js +85 -18
- package/dist/ts3.9/server/angular-cli-webpack-12.2.x.js +38 -81
- package/dist/ts3.9/server/angular-cli-webpack-13.x.x.js +42 -85
- package/dist/ts3.9/server/angular-cli-webpack-older.js +77 -123
- package/dist/ts3.9/server/angular-devkit-build-webpack.js +72 -133
- package/dist/ts3.9/server/angular-read-workspace.js +44 -78
- package/dist/ts3.9/server/build.js +10 -47
- package/dist/ts3.9/server/create-fork-ts-checker-plugin.js +2 -2
- package/dist/ts3.9/server/framework-preset-angular-cli.js +111 -186
- package/dist/ts3.9/server/framework-preset-angular-ivy.js +35 -92
- package/dist/ts3.9/server/framework-preset-angular.js +62 -115
- package/dist/ts3.9/server/index.js +2 -2
- package/dist/ts3.9/server/ngx-template-loader/index.js +15 -15
- package/dist/ts3.9/server/options.js +1 -1
- package/dist/ts3.9/server/preset.js +4 -13
- package/dist/ts3.9/server/ts_config.js +5 -5
- package/dist/ts3.9/server/utils/filter-out-styling-rules.js +4 -4
- package/dist/ts3.9/server/utils/module-is-available.js +1 -1
- package/dist/ts3.9/server/utils/normalize-asset-patterns.js +16 -31
- package/dist/ts3.9/server/utils/normalize-optimization.js +3 -3
- package/package.json +9 -9
- package/standalone.d.ts +3 -5
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
@@ -38,116 +27,74 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
38
27
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
39
28
|
});
|
|
40
29
|
};
|
|
41
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
42
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
43
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
44
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
45
|
-
function step(op) {
|
|
46
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
47
|
-
while (_) try {
|
|
48
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
49
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
50
|
-
switch (op[0]) {
|
|
51
|
-
case 0: case 1: t = op; break;
|
|
52
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
53
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
54
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
55
|
-
default:
|
|
56
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
57
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
58
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
59
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
60
|
-
if (t[2]) _.ops.pop();
|
|
61
|
-
_.trys.pop(); continue;
|
|
62
|
-
}
|
|
63
|
-
op = body.call(thisArg, _);
|
|
64
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
65
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
69
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
70
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
71
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
72
|
-
r[k] = a[j];
|
|
73
|
-
return r;
|
|
74
|
-
};
|
|
75
30
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
76
31
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
77
32
|
};
|
|
78
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
79
34
|
exports.webpack = void 0;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
function webpack(config,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return semver_1.default.coerce(m.VERSION.full);
|
|
96
|
-
})];
|
|
97
|
-
case 1:
|
|
98
|
-
angularCliVersion = _b.sent();
|
|
99
|
-
if ((semver_1.default.satisfies(angularCliVersion, '12.2.x') && angularBuilderContext) ||
|
|
100
|
-
semver_1.default.satisfies(angularCliVersion, '>=13.0.0')) {
|
|
101
|
-
return [2 /*return*/, config];
|
|
102
|
-
}
|
|
103
|
-
return [3 /*break*/, 3];
|
|
104
|
-
case 2:
|
|
105
|
-
error_1 = _b.sent();
|
|
106
|
-
return [3 /*break*/, 3];
|
|
107
|
-
case 3:
|
|
108
|
-
tsLoaderOptions = ts_config_1.default(configDir);
|
|
109
|
-
return [2 /*return*/, __assign(__assign({}, config), { module: __assign(__assign({}, config.module), { rules: __spreadArrays(config.module.rules, [
|
|
110
|
-
{
|
|
111
|
-
test: /\.tsx?$/,
|
|
112
|
-
use: [
|
|
113
|
-
{
|
|
114
|
-
loader: require.resolve('ts-loader'),
|
|
115
|
-
options: tsLoaderOptions,
|
|
116
|
-
},
|
|
117
|
-
{ loader: path_1.default.resolve(__dirname, 'ngx-template-loader') },
|
|
118
|
-
],
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
test: /[/\\]@angular[/\\]core[/\\].+\.js$/,
|
|
122
|
-
parser: { system: true },
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
test: /\.html$/,
|
|
126
|
-
loader: require.resolve('raw-loader'),
|
|
127
|
-
exclude: /\.async\.html$/,
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
test: /\.s(c|a)ss$/,
|
|
131
|
-
use: [
|
|
132
|
-
{ loader: require.resolve('raw-loader') },
|
|
133
|
-
{
|
|
134
|
-
loader: require.resolve('postcss-loader'),
|
|
135
|
-
options: {
|
|
136
|
-
postcssOptions: {
|
|
137
|
-
plugins: [autoprefixer_1.default()],
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
{ loader: require.resolve('sass-loader') },
|
|
142
|
-
],
|
|
143
|
-
},
|
|
144
|
-
]) }), resolve: __assign({}, config.resolve), plugins: __spreadArrays(config.plugins, [
|
|
145
|
-
// See https://github.com/angular/angular/issues/11580#issuecomment-401127742
|
|
146
|
-
new webpack_1.ContextReplacementPlugin(/@angular(\\|\/)core(\\|\/)(fesm5|bundles)/, path_1.default.resolve(__dirname, '..')),
|
|
147
|
-
create_fork_ts_checker_plugin_1.default(tsLoaderOptions),
|
|
148
|
-
]) })];
|
|
35
|
+
const path_1 = __importDefault(require("path"));
|
|
36
|
+
const semver_1 = __importDefault(require("@storybook/semver"));
|
|
37
|
+
const webpack_1 = require("webpack");
|
|
38
|
+
const autoprefixer_1 = __importDefault(require("autoprefixer"));
|
|
39
|
+
const ts_config_1 = __importDefault(require("./ts_config"));
|
|
40
|
+
const create_fork_ts_checker_plugin_1 = __importDefault(require("./create-fork-ts-checker-plugin"));
|
|
41
|
+
function webpack(config, { configDir, angularBuilderContext }) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
try {
|
|
44
|
+
// Disable all this webpack stuff if we use angular-cli >= 12
|
|
45
|
+
// Angular cli is in charge of doing all the necessary for angular. If there is any additional configuration to add, it must be done in the preset angular-cli versioned.
|
|
46
|
+
const angularCliVersion = yield Promise.resolve().then(() => __importStar(require('@angular/cli'))).then((m) => semver_1.default.coerce(m.VERSION.full));
|
|
47
|
+
if ((semver_1.default.satisfies(angularCliVersion, '12.2.x') && angularBuilderContext) ||
|
|
48
|
+
semver_1.default.satisfies(angularCliVersion, '>=13.0.0')) {
|
|
49
|
+
return config;
|
|
149
50
|
}
|
|
150
|
-
}
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
// do nothing, continue
|
|
54
|
+
}
|
|
55
|
+
const tsLoaderOptions = ts_config_1.default(configDir);
|
|
56
|
+
return Object.assign(Object.assign({}, config), { module: Object.assign(Object.assign({}, config.module), { rules: [
|
|
57
|
+
...config.module.rules,
|
|
58
|
+
{
|
|
59
|
+
test: /\.tsx?$/,
|
|
60
|
+
use: [
|
|
61
|
+
{
|
|
62
|
+
loader: require.resolve('ts-loader'),
|
|
63
|
+
options: tsLoaderOptions,
|
|
64
|
+
},
|
|
65
|
+
{ loader: path_1.default.resolve(__dirname, 'ngx-template-loader') },
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
test: /[/\\]@angular[/\\]core[/\\].+\.js$/,
|
|
70
|
+
parser: { system: true },
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
test: /\.html$/,
|
|
74
|
+
loader: require.resolve('raw-loader'),
|
|
75
|
+
exclude: /\.async\.html$/,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
test: /\.s(c|a)ss$/,
|
|
79
|
+
use: [
|
|
80
|
+
{ loader: require.resolve('raw-loader') },
|
|
81
|
+
{
|
|
82
|
+
loader: require.resolve('postcss-loader'),
|
|
83
|
+
options: {
|
|
84
|
+
postcssOptions: {
|
|
85
|
+
plugins: [autoprefixer_1.default()],
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{ loader: require.resolve('sass-loader') },
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
] }), resolve: Object.assign({}, config.resolve), plugins: [
|
|
93
|
+
...config.plugins,
|
|
94
|
+
// See https://github.com/angular/angular/issues/11580#issuecomment-401127742
|
|
95
|
+
new webpack_1.ContextReplacementPlugin(/@angular(\\|\/)core(\\|\/)(fesm5|bundles)/, path_1.default.resolve(__dirname, '..')),
|
|
96
|
+
create_fork_ts_checker_plugin_1.default(tsLoaderOptions),
|
|
97
|
+
] });
|
|
151
98
|
});
|
|
152
99
|
}
|
|
153
100
|
exports.webpack = webpack;
|
|
@@ -3,6 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const server_1 = require("@storybook/core/server");
|
|
7
|
+
const options_1 = __importDefault(require("./options"));
|
|
8
8
|
server_1.buildDev(options_1.default);
|
|
@@ -9,38 +9,38 @@
|
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
11
|
// using: regex, capture groups, and capture group variables.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return string.replace(stringRegex,
|
|
17
|
-
|
|
12
|
+
const templateUrlRegex = /templateUrl\s*:(\s*['"`](.*?)['"`]\s*([,}]))/gm;
|
|
13
|
+
const stylesRegex = /styleUrls *:(\s*\[[^\]]*?\])/g;
|
|
14
|
+
const stringRegex = /(['`"])((?:[^\\]\\\1|.)*?)\1/g;
|
|
15
|
+
const replaceStringsWithRequires = (string) => {
|
|
16
|
+
return string.replace(stringRegex, (match, quote, url) => {
|
|
17
|
+
let newUrl = url;
|
|
18
18
|
if (url.charAt(0) !== '.') {
|
|
19
|
-
newUrl =
|
|
19
|
+
newUrl = `./${url}`;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
const requireString = `(require('${newUrl}').default || require('${newUrl}'))`;
|
|
22
22
|
// without the length check an empty style file will throw
|
|
23
23
|
// "Expected 'styles' to be an array of strings"
|
|
24
|
-
return requireString
|
|
24
|
+
return `${requireString}.length ? ${requireString} : ''`;
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
27
|
function default_1(source) {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
const styleProperty = 'styles';
|
|
29
|
+
const templateProperty = 'template';
|
|
30
30
|
return source
|
|
31
|
-
.replace(templateUrlRegex,
|
|
31
|
+
.replace(templateUrlRegex, (_, templateUrlString) => {
|
|
32
32
|
// replace: templateUrl: './path/to/template.html'
|
|
33
33
|
// with: template: require('./path/to/template.html')
|
|
34
34
|
// or: templateUrl: require('./path/to/template.html')
|
|
35
35
|
// if `keepUrl` query parameter is set to true.
|
|
36
|
-
return templateProperty
|
|
36
|
+
return `${templateProperty}:${replaceStringsWithRequires(templateUrlString)}`;
|
|
37
37
|
})
|
|
38
|
-
.replace(stylesRegex,
|
|
38
|
+
.replace(stylesRegex, (_, styleUrlsString) => {
|
|
39
39
|
// replace: stylesUrl: ['./foo.css', "./baz.css", "./index.component.css"]
|
|
40
40
|
// with: styles: [require('./foo.css'), require("./baz.css"), require("./index.component.css")]
|
|
41
41
|
// or: styleUrls: [require('./foo.css'), require("./baz.css"), require("./index.component.css")]
|
|
42
42
|
// if `keepUrl` query parameter is set to true.
|
|
43
|
-
return styleProperty
|
|
43
|
+
return `${styleProperty}:${replaceStringsWithRequires(styleUrlsString)}`;
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
exports.default = default_1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const read_pkg_up_1 = require("read-pkg-up");
|
|
4
4
|
exports.default = {
|
|
5
5
|
packageJson: read_pkg_up_1.sync({ cwd: __dirname }).packageJson,
|
|
6
6
|
framework: 'angular',
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
3
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
4
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
5
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
6
|
-
r[k] = a[j];
|
|
7
|
-
return r;
|
|
8
|
-
};
|
|
9
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
3
|
exports.addons = exports.config = void 0;
|
|
11
|
-
exports.config =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
]);
|
|
16
|
-
};
|
|
4
|
+
exports.config = (entries = []) => [
|
|
5
|
+
...entries,
|
|
6
|
+
require.resolve('../client/preview/config'),
|
|
7
|
+
];
|
|
17
8
|
exports.addons = [
|
|
18
9
|
require.resolve('./framework-preset-angular'),
|
|
19
10
|
require.resolve('./framework-preset-angular-cli'),
|
|
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const node_logger_1 = require("@storybook/node-logger");
|
|
9
9
|
function resolveTsConfig(tsConfigPath) {
|
|
10
10
|
if (fs_1.default.existsSync(tsConfigPath)) {
|
|
11
11
|
node_logger_1.logger.info('=> Found custom tsconfig.json');
|
|
@@ -14,13 +14,13 @@ function resolveTsConfig(tsConfigPath) {
|
|
|
14
14
|
return undefined;
|
|
15
15
|
}
|
|
16
16
|
function default_1(configDir) {
|
|
17
|
-
|
|
17
|
+
const tsLoaderOptions = {
|
|
18
18
|
transpileOnly: true,
|
|
19
19
|
compilerOptions: {
|
|
20
20
|
emitDecoratorMetadata: true,
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
const configFilePath = resolveTsConfig(path_1.default.resolve(configDir, 'tsconfig.json'));
|
|
24
24
|
if (configFilePath)
|
|
25
25
|
tsLoaderOptions.configFile = configFilePath;
|
|
26
26
|
return tsLoaderOptions;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.filterOutStylingRules = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const isStylingRule = (rule) => {
|
|
5
|
+
const { test } = rule;
|
|
6
6
|
if (!test) {
|
|
7
7
|
return false;
|
|
8
8
|
}
|
|
@@ -11,6 +11,6 @@ var isStylingRule = function (rule) {
|
|
|
11
11
|
}
|
|
12
12
|
return test.test('.css') || test.test('.scss') || test.test('.sass');
|
|
13
13
|
};
|
|
14
|
-
exports.filterOutStylingRules =
|
|
15
|
-
return config.module.rules.filter(
|
|
14
|
+
exports.filterOutStylingRules = (config) => {
|
|
15
|
+
return config.module.rules.filter((rule) => !isStylingRule(rule));
|
|
16
16
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.moduleIsAvailable = void 0;
|
|
4
|
-
exports.moduleIsAvailable =
|
|
4
|
+
exports.moduleIsAvailable = (moduleName) => {
|
|
5
5
|
try {
|
|
6
6
|
require.resolve(moduleName);
|
|
7
7
|
return true;
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
3
|
exports.normalizeAssetPatterns = exports.MissingAssetSourceRootException = void 0;
|
|
17
4
|
/**
|
|
@@ -20,35 +7,33 @@ exports.normalizeAssetPatterns = exports.MissingAssetSourceRootException = void
|
|
|
20
7
|
*
|
|
21
8
|
* It is not possible to use the original because arguments have changed between version 6.1.* and 11.*.* of angular-cli
|
|
22
9
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return _super.call(this, "The " + path + " asset path must start with the project source root.") || this;
|
|
10
|
+
const fs_1 = require("fs");
|
|
11
|
+
const core_1 = require("@angular-devkit/core");
|
|
12
|
+
class MissingAssetSourceRootException extends core_1.BaseException {
|
|
13
|
+
constructor(path) {
|
|
14
|
+
super(`The ${path} asset path must start with the project source root.`);
|
|
29
15
|
}
|
|
30
|
-
|
|
31
|
-
}(core_1.BaseException));
|
|
16
|
+
}
|
|
32
17
|
exports.MissingAssetSourceRootException = MissingAssetSourceRootException;
|
|
33
18
|
function normalizeAssetPatterns(assetPatterns, root, projectRoot, maybeSourceRoot) {
|
|
34
19
|
// When sourceRoot is not available, we default to ${projectRoot}/src.
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
const sourceRoot = maybeSourceRoot || core_1.join(projectRoot, 'src');
|
|
21
|
+
const resolvedSourceRoot = core_1.resolve(root, sourceRoot);
|
|
37
22
|
if (assetPatterns.length === 0) {
|
|
38
23
|
return [];
|
|
39
24
|
}
|
|
40
|
-
return assetPatterns.map(
|
|
25
|
+
return assetPatterns.map((assetPattern) => {
|
|
41
26
|
// Normalize string asset patterns to objects.
|
|
42
27
|
if (typeof assetPattern === 'string') {
|
|
43
|
-
|
|
44
|
-
|
|
28
|
+
const assetPath = core_1.normalize(assetPattern);
|
|
29
|
+
const resolvedAssetPath = core_1.resolve(root, assetPath);
|
|
45
30
|
// Check if the string asset is within sourceRoot.
|
|
46
31
|
if (!resolvedAssetPath.startsWith(resolvedSourceRoot)) {
|
|
47
32
|
throw new MissingAssetSourceRootException(assetPattern);
|
|
48
33
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
34
|
+
let glob;
|
|
35
|
+
let input;
|
|
36
|
+
let isDirectory = false;
|
|
52
37
|
try {
|
|
53
38
|
isDirectory = fs_1.statSync(core_1.getSystemPath(resolvedAssetPath)).isDirectory();
|
|
54
39
|
}
|
|
@@ -68,9 +53,9 @@ function normalizeAssetPatterns(assetPatterns, root, projectRoot, maybeSourceRoo
|
|
|
68
53
|
input = core_1.dirname(assetPath);
|
|
69
54
|
}
|
|
70
55
|
// Output directory for both is the relative path from source root to input.
|
|
71
|
-
|
|
56
|
+
const output = core_1.relative(resolvedSourceRoot, core_1.resolve(root, input));
|
|
72
57
|
// Return the asset pattern in object format.
|
|
73
|
-
return { glob
|
|
58
|
+
return { glob, input, output };
|
|
74
59
|
}
|
|
75
60
|
// It's already an AssetPatternObject, no need to convert.
|
|
76
61
|
return assetPattern;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptimization = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const module_is_available_1 = require("./module-is-available");
|
|
5
|
+
const importAngularCliNormalizeOptimization = () => {
|
|
6
6
|
// First we look for webpack config according to directory structure of Angular
|
|
7
7
|
// present since the version 7.2.0
|
|
8
8
|
if (module_is_available_1.moduleIsAvailable('@angular-devkit/build-angular/src/utils/normalize-optimization')) {
|
|
@@ -11,7 +11,7 @@ var importAngularCliNormalizeOptimization = function () {
|
|
|
11
11
|
}
|
|
12
12
|
return undefined;
|
|
13
13
|
};
|
|
14
|
-
exports.normalizeOptimization =
|
|
14
|
+
exports.normalizeOptimization = (options) => {
|
|
15
15
|
if (importAngularCliNormalizeOptimization()) {
|
|
16
16
|
return importAngularCliNormalizeOptimization().normalizeOptimization(options);
|
|
17
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/angular",
|
|
3
|
-
"version": "6.5.0-alpha.
|
|
3
|
+
"version": "6.5.0-alpha.32",
|
|
4
4
|
"description": "Storybook for Angular: Develop Angular Components in isolation with Hot Reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"prepare": "node ../../scripts/prepare.js"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@storybook/addons": "6.5.0-alpha.
|
|
49
|
-
"@storybook/api": "6.5.0-alpha.
|
|
50
|
-
"@storybook/core": "6.5.0-alpha.
|
|
51
|
-
"@storybook/core-common": "6.5.0-alpha.
|
|
52
|
-
"@storybook/core-events": "6.5.0-alpha.
|
|
48
|
+
"@storybook/addons": "6.5.0-alpha.32",
|
|
49
|
+
"@storybook/api": "6.5.0-alpha.32",
|
|
50
|
+
"@storybook/core": "6.5.0-alpha.32",
|
|
51
|
+
"@storybook/core-common": "6.5.0-alpha.32",
|
|
52
|
+
"@storybook/core-events": "6.5.0-alpha.32",
|
|
53
53
|
"@storybook/csf": "0.0.2--canary.87bc651.0",
|
|
54
|
-
"@storybook/node-logger": "6.5.0-alpha.
|
|
54
|
+
"@storybook/node-logger": "6.5.0-alpha.32",
|
|
55
55
|
"@storybook/semver": "^7.3.2",
|
|
56
|
-
"@storybook/store": "6.5.0-alpha.
|
|
56
|
+
"@storybook/store": "6.5.0-alpha.32",
|
|
57
57
|
"@types/node": "^14.14.20 || ^16.0.0",
|
|
58
58
|
"@types/webpack-env": "^1.16.0",
|
|
59
59
|
"autoprefixer": "^9.8.6",
|
|
@@ -129,5 +129,5 @@
|
|
|
129
129
|
"access": "public"
|
|
130
130
|
},
|
|
131
131
|
"builders": "dist/ts3.9/builders/builders.json",
|
|
132
|
-
"gitHead": "
|
|
132
|
+
"gitHead": "efd7c324921bb08899caa75f707574d758e61dc2"
|
|
133
133
|
}
|
package/standalone.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { CLIOptions, LoadOptions, BuilderOptions } from '@storybook/core-common';
|
|
2
2
|
import { BuilderContext } from '@angular-devkit/architect';
|
|
3
|
-
import { JsonValue } from '@angular-devkit/core';
|
|
4
|
-
import { JsonSchema } from '@angular-devkit/core/src/json/schema';
|
|
5
3
|
|
|
6
4
|
export type StandaloneOptions = Partial<
|
|
7
5
|
CLIOptions &
|
|
@@ -9,9 +7,9 @@ export type StandaloneOptions = Partial<
|
|
|
9
7
|
BuilderOptions & {
|
|
10
8
|
mode?: 'static' | 'dev';
|
|
11
9
|
angularBrowserTarget?: string | null;
|
|
12
|
-
angularBuilderOptions?:
|
|
13
|
-
styles?:
|
|
14
|
-
stylePreprocessorOptions?:
|
|
10
|
+
angularBuilderOptions?: Record<string, any> & {
|
|
11
|
+
styles?: any[];
|
|
12
|
+
stylePreprocessorOptions?: any;
|
|
15
13
|
};
|
|
16
14
|
angularBuilderContext?: BuilderContext | null;
|
|
17
15
|
tsConfig?: string;
|