@storybook/angular 6.5.0-alpha.7 → 6.5.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 +2 -2
- package/dist/ts3.4/builders/build-storybook/index.d.ts +1 -1
- package/dist/ts3.4/client/docs/compodoc.d.ts +18 -0
- package/dist/ts3.4/client/docs/config.d.ts +15 -0
- package/dist/ts3.4/client/docs/index.d.ts +1 -0
- package/dist/ts3.4/client/docs/prepareForInline.d.ts +7 -0
- package/dist/ts3.4/client/docs/sourceDecorator.d.ts +9 -0
- package/dist/ts3.4/client/docs/types.d.ts +102 -0
- package/dist/ts3.4/client/preview/angular-beta/utils/NgComponentAnalyzer.d.ts +4 -2
- package/dist/ts3.4/server/angular-cli-webpack-older.d.ts +2 -1
- package/dist/ts3.4/server/framework-preset-angular-docs.d.ts +2 -0
- package/dist/ts3.4/server/framework-preset-angular.d.ts +3 -2
- package/dist/ts3.4/server/preset.d.ts +1 -1
- package/dist/ts3.9/builders/build-storybook/index.d.ts +2 -2
- package/dist/ts3.9/builders/build-storybook/index.js +34 -84
- package/dist/ts3.9/builders/build-storybook/schema.json +6 -2
- package/dist/ts3.9/builders/start-storybook/index.d.ts +1 -1
- package/dist/ts3.9/builders/start-storybook/index.js +40 -91
- package/dist/ts3.9/builders/start-storybook/schema.json +1 -2
- package/dist/ts3.9/builders/utils/build-standalone-errors-handler.js +13 -11
- package/dist/ts3.9/builders/utils/run-compodoc.js +41 -21
- package/dist/ts3.9/client/docs/compodoc.d.ts +18 -0
- package/dist/ts3.9/client/docs/compodoc.js +247 -0
- package/dist/ts3.9/client/docs/config.d.ts +15 -0
- package/dist/ts3.9/client/docs/config.js +22 -0
- package/dist/ts3.9/client/docs/index.d.ts +1 -0
- package/dist/ts3.9/client/docs/index.js +13 -0
- package/dist/ts3.9/client/docs/prepareForInline.d.ts +7 -0
- package/dist/ts3.9/client/docs/prepareForInline.js +45 -0
- package/dist/ts3.9/client/docs/sourceDecorator.d.ts +9 -0
- package/dist/ts3.9/client/docs/sourceDecorator.js +49 -0
- package/dist/ts3.9/client/docs/types.d.ts +102 -0
- package/dist/ts3.9/client/docs/types.js +2 -0
- 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.d.ts +2 -2
- 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.d.ts +3 -3
- package/dist/ts3.9/client/preview/angular-beta/ComputesTemplateFromComponent.js +75 -69
- 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 +58 -98
- package/dist/ts3.9/client/preview/angular-beta/utils/NgComponentAnalyzer.d.ts +4 -2
- package/dist/ts3.9/client/preview/angular-beta/utils/NgComponentAnalyzer.js +30 -77
- package/dist/ts3.9/client/preview/angular-beta/utils/NgModulesAnalyzer.js +10 -14
- package/dist/ts3.9/client/preview/decorateStory.d.ts +2 -2
- package/dist/ts3.9/client/preview/decorateStory.js +16 -36
- package/dist/ts3.9/client/preview/decorators.d.ts +4 -4
- package/dist/ts3.9/client/preview/decorators.js +22 -37
- package/dist/ts3.9/client/preview/globals.js +2 -2
- package/dist/ts3.9/client/preview/index.d.ts +3 -3
- package/dist/ts3.9/client/preview/index.js +8 -21
- package/dist/ts3.9/client/preview/render.d.ts +3 -3
- package/dist/ts3.9/client/preview/render.js +17 -56
- package/dist/ts3.9/client/preview/types-6-0.d.ts +2 -2
- package/dist/ts3.9/client/preview/types-7-0.d.ts +1 -1
- 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/__mocks-ng-workspace__/minimal-config/tsconfig.json +4 -1
- package/dist/ts3.9/server/__mocks-ng-workspace__/some-config/tsconfig.json +4 -1
- package/dist/ts3.9/server/__mocks-ng-workspace__/with-angularBrowserTarget/tsconfig.json +4 -1
- package/dist/ts3.9/server/__mocks-ng-workspace__/with-lib/tsconfig.json +4 -1
- package/dist/ts3.9/server/__mocks-ng-workspace__/with-nx/tsconfig.json +7 -2
- package/dist/ts3.9/server/__mocks-ng-workspace__/with-nx-workspace/tsconfig.json +7 -2
- package/dist/ts3.9/server/__mocks-ng-workspace__/with-options-styles/tsconfig.json +4 -1
- package/dist/ts3.9/server/__mocks-ng-workspace__/without-projects-entry/tsconfig.json +4 -1
- package/dist/ts3.9/server/__mocks-ng-workspace__/without-tsConfig/tsconfig.json +4 -1
- 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.d.ts +2 -1
- 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 +3 -3
- package/dist/ts3.9/server/framework-preset-angular-cli.js +111 -179
- package/dist/ts3.9/server/framework-preset-angular-docs.d.ts +2 -0
- package/dist/ts3.9/server/framework-preset-angular-docs.js +13 -0
- package/dist/ts3.9/server/framework-preset-angular-ivy.js +35 -92
- package/dist/ts3.9/server/framework-preset-angular.d.ts +3 -2
- package/dist/ts3.9/server/framework-preset-angular.js +88 -62
- 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.d.ts +1 -1
- package/dist/ts3.9/server/options.js +1 -1
- package/dist/ts3.9/server/preset.d.ts +1 -1
- package/dist/ts3.9/server/preset.js +6 -14
- 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/dist/ts3.9/types/index.d.ts +1 -1
- package/package.json +24 -26
- package/standalone.d.ts +5 -7
|
@@ -1,74 +1,100 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
12
20
|
};
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
19
29
|
};
|
|
20
30
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
31
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
32
|
};
|
|
23
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
34
|
exports.webpack = void 0;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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;
|
|
50
|
+
}
|
|
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
|
+
},
|
|
62
87
|
},
|
|
63
88
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
+
] });
|
|
98
|
+
});
|
|
73
99
|
}
|
|
74
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,4 +1,4 @@
|
|
|
1
|
-
import { LoadOptions, Options as CoreOptions } from '@storybook/core-common';
|
|
1
|
+
import type { LoadOptions, Options as CoreOptions } from '@storybook/core-common';
|
|
2
2
|
import { BuilderContext } from '@angular-devkit/architect';
|
|
3
3
|
import { ExtraEntryPoint, StylePreprocessorOptions } from '@angular-devkit/build-angular';
|
|
4
4
|
export declare type PresetOptions = CoreOptions & {
|
|
@@ -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,21 +1,13 @@
|
|
|
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
|
-
exports.addons = exports.
|
|
11
|
-
exports.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
]);
|
|
16
|
-
};
|
|
3
|
+
exports.addons = exports.previewAnnotations = void 0;
|
|
4
|
+
exports.previewAnnotations = (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'),
|
|
20
11
|
require.resolve('./framework-preset-angular-ivy'),
|
|
12
|
+
require.resolve('./framework-preset-angular-docs'),
|
|
21
13
|
];
|
|
@@ -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-
|
|
3
|
+
"version": "6.5.0-beta.1",
|
|
4
4
|
"description": "Storybook for Angular: Develop Angular Components in isolation with Hot Reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -45,37 +45,42 @@
|
|
|
45
45
|
"prepare": "node ../../scripts/prepare.js"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@storybook/addons": "6.5.0-
|
|
49
|
-
"@storybook/api": "6.5.0-
|
|
50
|
-
"@storybook/
|
|
51
|
-
"@storybook/core
|
|
52
|
-
"@storybook/core-
|
|
53
|
-
"@storybook/
|
|
54
|
-
"@storybook/
|
|
48
|
+
"@storybook/addons": "6.5.0-beta.1",
|
|
49
|
+
"@storybook/api": "6.5.0-beta.1",
|
|
50
|
+
"@storybook/client-logger": "6.5.0-beta.1",
|
|
51
|
+
"@storybook/core": "6.5.0-beta.1",
|
|
52
|
+
"@storybook/core-common": "6.5.0-beta.1",
|
|
53
|
+
"@storybook/core-events": "6.5.0-beta.1",
|
|
54
|
+
"@storybook/csf": "0.0.2--canary.4566f4d.1",
|
|
55
|
+
"@storybook/docs-tools": "6.5.0-beta.1",
|
|
56
|
+
"@storybook/node-logger": "6.5.0-beta.1",
|
|
55
57
|
"@storybook/semver": "^7.3.2",
|
|
56
|
-
"@storybook/store": "6.5.0-
|
|
58
|
+
"@storybook/store": "6.5.0-beta.1",
|
|
57
59
|
"@types/node": "^14.14.20 || ^16.0.0",
|
|
60
|
+
"@types/react": "^16.14.23",
|
|
61
|
+
"@types/react-dom": "^16.9.14",
|
|
58
62
|
"@types/webpack-env": "^1.16.0",
|
|
59
63
|
"autoprefixer": "^9.8.6",
|
|
60
64
|
"core-js": "^3.8.2",
|
|
61
65
|
"find-up": "^5.0.0",
|
|
62
66
|
"fork-ts-checker-webpack-plugin": "^4.1.6",
|
|
63
67
|
"global": "^4.4.0",
|
|
68
|
+
"nanoid": "^3.1.23",
|
|
69
|
+
"p-limit": "^3.1.0",
|
|
64
70
|
"postcss": "^7.0.36",
|
|
65
71
|
"postcss-loader": "^4.2.0",
|
|
66
72
|
"raw-loader": "^4.0.2",
|
|
67
|
-
"react": "16.14.0",
|
|
68
|
-
"react-dom": "16.14.0",
|
|
73
|
+
"react": "^16.14.0",
|
|
74
|
+
"react-dom": "^16.14.0",
|
|
69
75
|
"read-pkg-up": "^7.0.1",
|
|
70
76
|
"regenerator-runtime": "^0.13.7",
|
|
71
77
|
"sass-loader": "^10.1.0",
|
|
72
|
-
"strip-json-comments": "3.1.1",
|
|
73
78
|
"telejson": "^5.3.3",
|
|
74
79
|
"ts-dedent": "^2.0.0",
|
|
75
80
|
"ts-loader": "^8.0.14",
|
|
76
81
|
"tsconfig-paths-webpack-plugin": "^3.3.0",
|
|
77
82
|
"util-deprecate": "^1.0.2",
|
|
78
|
-
"webpack": "4"
|
|
83
|
+
"webpack": ">=4.0.0 <6.0.0"
|
|
79
84
|
},
|
|
80
85
|
"devDependencies": {
|
|
81
86
|
"@angular-devkit/architect": "~0.1102.0",
|
|
@@ -86,17 +91,18 @@
|
|
|
86
91
|
"@angular/compiler": "^11.2.14",
|
|
87
92
|
"@angular/compiler-cli": "^11.2.14",
|
|
88
93
|
"@angular/core": "^11.2.14",
|
|
89
|
-
"@angular/elements": "^11.2.14",
|
|
90
94
|
"@angular/forms": "^11.2.14",
|
|
91
95
|
"@angular/platform-browser": "^11.2.14",
|
|
92
96
|
"@angular/platform-browser-dynamic": "^11.2.14",
|
|
93
97
|
"@nrwl/workspace": "^11.6.3",
|
|
94
98
|
"@types/autoprefixer": "^9.7.2",
|
|
95
|
-
"@types/
|
|
96
|
-
"
|
|
99
|
+
"@types/tmp": "^0.2.3",
|
|
100
|
+
"cross-spawn": "^7.0.3",
|
|
97
101
|
"jest": "^26.6.3",
|
|
98
102
|
"jest-preset-angular": "^8.3.2",
|
|
99
|
-
"
|
|
103
|
+
"jest-specific-snapshot": "^4.0.0",
|
|
104
|
+
"tmp": "^0.2.1",
|
|
105
|
+
"webpack": "4"
|
|
100
106
|
},
|
|
101
107
|
"peerDependencies": {
|
|
102
108
|
"@angular-devkit/architect": ">=0.8.9",
|
|
@@ -107,13 +113,11 @@
|
|
|
107
113
|
"@angular/compiler": ">=6.0.0",
|
|
108
114
|
"@angular/compiler-cli": ">=6.0.0",
|
|
109
115
|
"@angular/core": ">=6.0.0",
|
|
110
|
-
"@angular/elements": ">=6.0.0",
|
|
111
116
|
"@angular/forms": ">=6.0.0",
|
|
112
117
|
"@angular/platform-browser": ">=6.0.0",
|
|
113
118
|
"@angular/platform-browser-dynamic": ">=6.0.0",
|
|
114
119
|
"@babel/core": "*",
|
|
115
120
|
"@nrwl/workspace": ">=11.1.0",
|
|
116
|
-
"@webcomponents/custom-elements": ">=1.4.3",
|
|
117
121
|
"rxjs": "^6.0.0 || ^7.4.0",
|
|
118
122
|
"typescript": "^3.4.0 || >=4.0.0",
|
|
119
123
|
"zone.js": "^0.8.29 || ^0.9.0 || ^0.10.0 || ^0.11.0"
|
|
@@ -122,14 +126,8 @@
|
|
|
122
126
|
"@angular/cli": {
|
|
123
127
|
"optional": true
|
|
124
128
|
},
|
|
125
|
-
"@angular/elements": {
|
|
126
|
-
"optional": true
|
|
127
|
-
},
|
|
128
129
|
"@nrwl/workspace": {
|
|
129
130
|
"optional": true
|
|
130
|
-
},
|
|
131
|
-
"@webcomponents/custom-elements": {
|
|
132
|
-
"optional": true
|
|
133
131
|
}
|
|
134
132
|
},
|
|
135
133
|
"engines": {
|
|
@@ -139,5 +137,5 @@
|
|
|
139
137
|
"access": "public"
|
|
140
138
|
},
|
|
141
139
|
"builders": "dist/ts3.9/builders/builders.json",
|
|
142
|
-
"gitHead": "
|
|
140
|
+
"gitHead": "85bcae3041a0664d7c0ee4756241e29ad1063a9a"
|
|
143
141
|
}
|
package/standalone.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { CLIOptions, LoadOptions, BuilderOptions } from '@storybook/core-common';
|
|
2
|
-
import { BuilderContext } from '@angular-devkit/architect';
|
|
3
|
-
import { JsonValue } from '@angular-devkit/core';
|
|
4
|
-
import { JsonSchema } from '@angular-devkit/core/src/json/schema';
|
|
1
|
+
import type { CLIOptions, LoadOptions, BuilderOptions } from '@storybook/core-common';
|
|
2
|
+
import type { BuilderContext } from '@angular-devkit/architect';
|
|
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;
|