@storybook/angular 7.0.0-alpha.3 → 7.0.0-alpha.33
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 +1 -1
- package/dist/types/builders/build-storybook/index.js +4 -6
- package/dist/types/builders/start-storybook/index.js +4 -6
- package/dist/types/builders/utils/build-standalone-errors-handler.js +3 -6
- package/dist/types/builders/utils/run-compodoc.js +0 -1
- package/dist/types/builders/utils/standalone-options.d.ts +12 -0
- package/dist/types/{client/preview/types-6-0.js → builders/utils/standalone-options.js} +0 -0
- package/dist/types/client/{preview/angular/components → angular}/app.component.d.ts +1 -1
- package/dist/types/client/{preview/angular/components → angular}/app.component.js +1 -1
- package/dist/types/client/{preview/angular → angular}/app.token.d.ts +0 -0
- package/dist/types/client/{preview/angular → angular}/app.token.js +0 -0
- package/dist/types/client/{preview/angular → angular}/helpers.d.ts +1 -1
- package/dist/types/client/{preview/angular → angular}/helpers.js +2 -3
- package/dist/types/client/{preview/angular-beta → angular-beta}/AbstractRenderer.d.ts +1 -2
- package/dist/types/client/{preview/angular-beta → angular-beta}/AbstractRenderer.js +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/CanvasRenderer.d.ts +1 -2
- package/dist/types/client/{preview/angular-beta → angular-beta}/CanvasRenderer.js +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/ComputesTemplateFromComponent.d.ts +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/ComputesTemplateFromComponent.js +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/DocsRenderer.d.ts +1 -2
- package/dist/types/client/{preview/angular-beta → angular-beta}/DocsRenderer.js +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/RendererFactory.d.ts +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/RendererFactory.js +3 -3
- package/dist/types/client/{preview/angular-beta → angular-beta}/StorybookModule.d.ts +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/StorybookModule.js +3 -3
- package/dist/types/client/{preview/angular-beta → angular-beta}/StorybookProvider.d.ts +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/StorybookProvider.js +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/StorybookWrapperComponent.d.ts +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/StorybookWrapperComponent.js +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/utils/NgComponentAnalyzer.d.ts +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/utils/NgComponentAnalyzer.js +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/utils/NgModulesAnalyzer.d.ts +0 -0
- package/dist/types/client/{preview/angular-beta → angular-beta}/utils/NgModulesAnalyzer.js +0 -0
- package/dist/types/client/{preview/config.d.ts → config.d.ts} +1 -1
- package/dist/types/client/{preview/config.js → config.js} +0 -0
- package/dist/types/client/{preview/decorateStory.d.ts → decorateStory.d.ts} +1 -1
- package/dist/types/client/{preview/decorateStory.js → decorateStory.js} +0 -0
- package/dist/types/client/{preview/decorators.d.ts → decorators.d.ts} +1 -2
- package/dist/types/client/{preview/decorators.js → decorators.js} +0 -0
- package/dist/types/client/docs/compodoc.js +2 -3
- package/dist/types/client/docs/config.d.ts +1 -1
- package/dist/types/client/docs/sourceDecorator.d.ts +2 -2
- package/dist/types/client/{preview/angular-polyfills.d.ts → globals.d.ts} +0 -10
- package/dist/types/client/{preview/angular-polyfills.js → globals.js} +7 -1
- package/dist/types/client/index.d.ts +5 -4
- package/dist/types/client/index.js +5 -12
- package/dist/types/client/{preview/index.d.ts → public-api.d.ts} +3 -5
- package/dist/types/client/{preview/index.js → public-api.js} +18 -4
- package/dist/types/client/{preview/types-6-0.d.ts → public-types.d.ts} +4 -19
- package/dist/types/client/{preview/types-7-0.js → public-types.js} +0 -0
- package/dist/types/client/{preview/render.d.ts → render.d.ts} +1 -1
- package/dist/types/client/{preview/render.js → render.js} +0 -0
- package/dist/types/client/{preview/types.d.ts → types.d.ts} +13 -0
- package/dist/types/client/{preview/types.js → types.js} +0 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/preset.d.ts +4 -11
- package/dist/types/preset.js +12 -8
- package/dist/types/renderer.d.ts +4 -4
- package/dist/types/renderer.js +4 -4
- package/dist/types/server/__mocks-ng-workspace__/minimal-config/tsconfig.json +1 -4
- package/dist/types/server/__mocks-ng-workspace__/some-config/tsconfig.json +1 -4
- package/dist/types/server/__mocks-ng-workspace__/with-angularBrowserTarget/tsconfig.json +1 -4
- package/dist/types/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/tsconfig.lib.json +2 -8
- package/dist/types/server/__mocks-ng-workspace__/with-lib/tsconfig.json +1 -4
- package/dist/types/server/__mocks-ng-workspace__/with-nx/tsconfig.json +2 -7
- package/dist/types/server/__mocks-ng-workspace__/with-nx-workspace/tsconfig.json +2 -7
- package/dist/types/server/__mocks-ng-workspace__/with-options-styles/tsconfig.json +1 -4
- package/dist/types/server/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/tsconfig.lib.json +2 -8
- package/dist/types/server/__mocks-ng-workspace__/without-projects-entry/tsconfig.json +1 -4
- package/dist/types/server/__mocks-ng-workspace__/without-tsConfig/tsconfig.json +1 -4
- package/dist/types/server/angular-cli-webpack-older.js +0 -1
- package/dist/types/server/angular-devkit-build-webpack.js +1 -4
- package/dist/types/server/framework-preset-angular-cli.js +2 -2
- package/dist/types/types.d.ts +24 -9
- package/package.json +18 -18
- package/LICENSE +0 -21
- package/dist/types/client/preview/globals.d.ts +0 -1
- package/dist/types/client/preview/globals.js +0 -9
- package/dist/types/client/preview/types-7-0.d.ts +0 -9
- package/standalone.d.ts +0 -21
- package/standalone.js +0 -7
- package/types-6-0.d.ts +0 -1
- package/types-7-0.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
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
|
const architect_1 = require("@angular-devkit/architect");
|
|
7
4
|
const rxjs_1 = require("rxjs");
|
|
8
5
|
const operators_1 = require("rxjs/operators");
|
|
9
6
|
const find_up_1 = require("find-up");
|
|
10
|
-
|
|
11
|
-
const
|
|
7
|
+
const read_pkg_up_1 = require("read-pkg-up");
|
|
8
|
+
const core_server_1 = require("@storybook/core-server");
|
|
12
9
|
const run_compodoc_1 = require("../utils/run-compodoc");
|
|
13
10
|
const build_standalone_errors_handler_1 = require("../utils/build-standalone-errors-handler");
|
|
14
11
|
exports.default = (0, architect_1.createBuilder)(commandBuilder);
|
|
@@ -21,6 +18,7 @@ function commandBuilder(options, context) {
|
|
|
21
18
|
}), (0, operators_1.map)(({ tsConfig }) => {
|
|
22
19
|
const { browserTarget, stylePreprocessorOptions, styles, configDir, docs, loglevel, outputDir, quiet, webpackStatsJson, } = options;
|
|
23
20
|
const standaloneOptions = {
|
|
21
|
+
packageJson: (0, read_pkg_up_1.sync)({ cwd: __dirname }).packageJson,
|
|
24
22
|
configDir,
|
|
25
23
|
docs,
|
|
26
24
|
loglevel,
|
|
@@ -54,5 +52,5 @@ async function setup(options, context) {
|
|
|
54
52
|
};
|
|
55
53
|
}
|
|
56
54
|
function runInstance(options) {
|
|
57
|
-
return (0, rxjs_1.from)((0,
|
|
55
|
+
return (0, rxjs_1.from)((0, core_server_1.buildStaticStandalone)(options)).pipe((0, operators_1.catchError)((error) => (0, rxjs_1.throwError)((0, build_standalone_errors_handler_1.buildStandaloneErrorHandler)(error))));
|
|
58
56
|
}
|
|
@@ -1,14 +1,11 @@
|
|
|
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
|
const architect_1 = require("@angular-devkit/architect");
|
|
7
4
|
const rxjs_1 = require("rxjs");
|
|
8
5
|
const operators_1 = require("rxjs/operators");
|
|
9
6
|
const find_up_1 = require("find-up");
|
|
10
|
-
|
|
11
|
-
const
|
|
7
|
+
const read_pkg_up_1 = require("read-pkg-up");
|
|
8
|
+
const core_server_1 = require("@storybook/core-server");
|
|
12
9
|
const run_compodoc_1 = require("../utils/run-compodoc");
|
|
13
10
|
const build_standalone_errors_handler_1 = require("../utils/build-standalone-errors-handler");
|
|
14
11
|
exports.default = (0, architect_1.createBuilder)(commandBuilder);
|
|
@@ -21,6 +18,7 @@ function commandBuilder(options, context) {
|
|
|
21
18
|
}), (0, operators_1.map)(({ tsConfig }) => {
|
|
22
19
|
const { browserTarget, stylePreprocessorOptions, styles, ci, configDir, docs, host, https, port, quiet, smokeTest, sslCa, sslCert, sslKey, } = options;
|
|
23
20
|
const standaloneOptions = {
|
|
21
|
+
packageJson: (0, read_pkg_up_1.sync)({ cwd: __dirname }).packageJson,
|
|
24
22
|
ci,
|
|
25
23
|
configDir,
|
|
26
24
|
docs,
|
|
@@ -61,6 +59,6 @@ async function setup(options, context) {
|
|
|
61
59
|
function runInstance(options) {
|
|
62
60
|
return new rxjs_1.Observable((observer) => {
|
|
63
61
|
// This Observable intentionally never complete, leaving the process running ;)
|
|
64
|
-
(0,
|
|
62
|
+
(0, core_server_1.buildDevStandalone)(options).then(() => observer.next(), (error) => observer.error((0, build_standalone_errors_handler_1.buildStandaloneErrorHandler)(error)));
|
|
65
63
|
});
|
|
66
64
|
}
|
|
@@ -1,11 +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.buildStandaloneErrorHandler = void 0;
|
|
7
4
|
const node_logger_1 = require("@storybook/node-logger");
|
|
8
|
-
const ts_dedent_1 =
|
|
5
|
+
const ts_dedent_1 = require("ts-dedent");
|
|
9
6
|
const buildStandaloneErrorHandler = (error) => {
|
|
10
7
|
// Duplicate code for Standalone error handling
|
|
11
8
|
// Source: https://github.com/storybookjs/storybook/blob/39c7ba09ad84fbd466f9c25d5b92791a5450b9f6/lib/core-server/src/build-dev.ts#L136
|
|
@@ -26,11 +23,11 @@ const buildStandaloneErrorHandler = (error) => {
|
|
|
26
23
|
}
|
|
27
24
|
node_logger_1.logger.line();
|
|
28
25
|
return error.close
|
|
29
|
-
? (0, ts_dedent_1.
|
|
26
|
+
? (0, ts_dedent_1.dedent) `
|
|
30
27
|
FATAL broken build!, will close the process,
|
|
31
28
|
Fix the error below and restart storybook.
|
|
32
29
|
`
|
|
33
|
-
: (0, ts_dedent_1.
|
|
30
|
+
: (0, ts_dedent_1.dedent) `
|
|
34
31
|
Broken build, fix the error above.
|
|
35
32
|
You may need to refresh the browser.
|
|
36
33
|
`;
|
|
@@ -48,7 +48,6 @@ const runCompodoc = ({ compodocArgs, tsconfig }, context) => {
|
|
|
48
48
|
context.logger.info(finalCompodocArgs.join(' '));
|
|
49
49
|
const child = (0, child_process_1.spawn)('npx', finalCompodocArgs, {
|
|
50
50
|
cwd: context.workspaceRoot,
|
|
51
|
-
env: process.env,
|
|
52
51
|
shell: true,
|
|
53
52
|
});
|
|
54
53
|
child.stdout.on('data', (data) => {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BuilderContext } from '@angular-devkit/architect';
|
|
2
|
+
import type { LoadOptions, CLIOptions, BuilderOptions } from '@storybook/core-common';
|
|
3
|
+
export declare type StandaloneOptions = Partial<CLIOptions & LoadOptions & BuilderOptions & {
|
|
4
|
+
mode?: 'static' | 'dev';
|
|
5
|
+
angularBrowserTarget?: string | null;
|
|
6
|
+
angularBuilderOptions?: Record<string, any> & {
|
|
7
|
+
styles?: any[];
|
|
8
|
+
stylePreprocessorOptions?: any;
|
|
9
|
+
};
|
|
10
|
+
angularBuilderContext?: BuilderContext | null;
|
|
11
|
+
tsConfig?: string;
|
|
12
|
+
}>;
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnInit, ViewContainerRef, ComponentFactoryResolver, OnDestroy, ChangeDetectorRef } from '@angular/core';
|
|
2
2
|
import { Observable, Subscription } from 'rxjs';
|
|
3
|
-
import { StoryFnAngularReturnType } from '
|
|
3
|
+
import { StoryFnAngularReturnType } from '../types';
|
|
4
4
|
export declare class AppComponent implements OnInit, OnDestroy {
|
|
5
5
|
private cfr;
|
|
6
6
|
private changeDetectorRef;
|
|
@@ -21,7 +21,7 @@ exports.AppComponent = void 0;
|
|
|
21
21
|
const core_1 = require("@angular/core");
|
|
22
22
|
const rxjs_1 = require("rxjs");
|
|
23
23
|
const operators_1 = require("rxjs/operators");
|
|
24
|
-
const app_token_1 = require("
|
|
24
|
+
const app_token_1 = require("./app.token");
|
|
25
25
|
let AppComponent = class AppComponent {
|
|
26
26
|
constructor(cfr, changeDetectorRef, data) {
|
|
27
27
|
this.cfr = cfr;
|
|
File without changes
|
|
File without changes
|
|
@@ -4,14 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.renderNgApp = void 0;
|
|
7
|
-
// @ts-ignore
|
|
8
7
|
const global_1 = __importDefault(require("global"));
|
|
9
8
|
const core_1 = require("@angular/core");
|
|
10
9
|
const forms_1 = require("@angular/forms");
|
|
11
10
|
const platform_browser_dynamic_1 = require("@angular/platform-browser-dynamic");
|
|
12
11
|
const platform_browser_1 = require("@angular/platform-browser");
|
|
13
12
|
const rxjs_1 = require("rxjs");
|
|
14
|
-
const app_component_1 = require("./
|
|
13
|
+
const app_component_1 = require("./app.component");
|
|
15
14
|
const app_token_1 = require("./app.token");
|
|
16
15
|
const { document } = global_1.default;
|
|
17
16
|
let platform = null;
|
|
@@ -111,7 +110,7 @@ const initModule = (storyFn) => {
|
|
|
111
110
|
};
|
|
112
111
|
return getModule(componentDeclarations, [AnnotatedComponent], [app_component_1.AppComponent], story, moduleMetadata);
|
|
113
112
|
};
|
|
114
|
-
const staticRoot = document.getElementById('root');
|
|
113
|
+
const staticRoot = document.getElementById('storybook-root');
|
|
115
114
|
const insertDynamicRoot = () => {
|
|
116
115
|
const app = document.createElement('storybook-dynamic-app-root');
|
|
117
116
|
staticRoot.innerHTML = '';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Subject } from 'rxjs';
|
|
2
|
-
import { ICollection, StoryFnAngularReturnType } from '../types';
|
|
3
|
-
import { Parameters } from '../types-6-0';
|
|
2
|
+
import { ICollection, StoryFnAngularReturnType, Parameters } from '../types';
|
|
4
3
|
declare type StoryRenderInfo = {
|
|
5
4
|
storyFnAngular: StoryFnAngularReturnType;
|
|
6
5
|
moduleMetadataSnapshot: string;
|
|
File without changes
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AbstractRenderer } from './AbstractRenderer';
|
|
2
|
-
import { StoryFnAngularReturnType } from '../types';
|
|
3
|
-
import { Parameters } from '../types-6-0';
|
|
2
|
+
import { StoryFnAngularReturnType, Parameters } from '../types';
|
|
4
3
|
export declare class CanvasRenderer extends AbstractRenderer {
|
|
5
4
|
render(options: {
|
|
6
5
|
storyFnAngular: StoryFnAngularReturnType;
|
|
File without changes
|
package/dist/types/client/{preview/angular-beta → angular-beta}/ComputesTemplateFromComponent.d.ts
RENAMED
|
File without changes
|
package/dist/types/client/{preview/angular-beta → angular-beta}/ComputesTemplateFromComponent.js
RENAMED
|
File without changes
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AbstractRenderer } from './AbstractRenderer';
|
|
2
|
-
import { StoryFnAngularReturnType } from '../types';
|
|
3
|
-
import { Parameters } from '../types-6-0';
|
|
2
|
+
import { StoryFnAngularReturnType, Parameters } from '../types';
|
|
4
3
|
export declare class DocsRenderer extends AbstractRenderer {
|
|
5
4
|
render(options: {
|
|
6
5
|
storyFnAngular: StoryFnAngularReturnType;
|
|
File without changes
|
|
File without changes
|
|
@@ -37,16 +37,16 @@ class RendererFactory {
|
|
|
37
37
|
}
|
|
38
38
|
exports.RendererFactory = RendererFactory;
|
|
39
39
|
const getRenderType = (targetDOMNode) => {
|
|
40
|
-
return targetDOMNode.id === 'root' ? 'canvas' : 'docs';
|
|
40
|
+
return targetDOMNode.id === 'storybook-root' ? 'canvas' : 'docs';
|
|
41
41
|
};
|
|
42
42
|
exports.getRenderType = getRenderType;
|
|
43
43
|
function clearRootHTMLElement(renderType) {
|
|
44
44
|
switch (renderType) {
|
|
45
45
|
case 'canvas':
|
|
46
|
-
global.document.getElementById('docs
|
|
46
|
+
global.document.getElementById('storybook-docs').innerHTML = '';
|
|
47
47
|
break;
|
|
48
48
|
case 'docs':
|
|
49
|
-
global.document.getElementById('root').innerHTML = '';
|
|
49
|
+
global.document.getElementById('storybook-root').innerHTML = '';
|
|
50
50
|
break;
|
|
51
51
|
default:
|
|
52
52
|
break;
|
|
File without changes
|
|
@@ -12,18 +12,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.createStorybookModule = exports.getStorybookModuleMetadata = void 0;
|
|
13
13
|
const core_1 = require("@angular/core");
|
|
14
14
|
const platform_browser_1 = require("@angular/platform-browser");
|
|
15
|
-
const ts_dedent_1 =
|
|
15
|
+
const ts_dedent_1 = require("ts-dedent");
|
|
16
16
|
const util_deprecate_1 = __importDefault(require("util-deprecate"));
|
|
17
17
|
const StorybookProvider_1 = require("./StorybookProvider");
|
|
18
18
|
const NgModulesAnalyzer_1 = require("./utils/NgModulesAnalyzer");
|
|
19
19
|
const NgComponentAnalyzer_1 = require("./utils/NgComponentAnalyzer");
|
|
20
20
|
const StorybookWrapperComponent_1 = require("./StorybookWrapperComponent");
|
|
21
21
|
const ComputesTemplateFromComponent_1 = require("./ComputesTemplateFromComponent");
|
|
22
|
-
const deprecatedStoryComponentWarning = (0, util_deprecate_1.default)(() => { }, (0, ts_dedent_1.
|
|
22
|
+
const deprecatedStoryComponentWarning = (0, util_deprecate_1.default)(() => { }, (0, ts_dedent_1.dedent) `\`component\` story return value is deprecated, and will be removed in Storybook 7.0.
|
|
23
23
|
Instead, use \`export const default = () => ({ component: AppComponent });\`
|
|
24
24
|
or
|
|
25
25
|
\`\`\`
|
|
26
|
-
export const Primary:
|
|
26
|
+
export const Primary: StoryFn = () => ({});
|
|
27
27
|
Primary.parameters = { component: AppComponent };
|
|
28
28
|
\`\`\`
|
|
29
29
|
Read more at
|
|
File without changes
|
|
File without changes
|
package/dist/types/client/{preview/angular-beta → angular-beta}/StorybookWrapperComponent.d.ts
RENAMED
|
File without changes
|
package/dist/types/client/{preview/angular-beta → angular-beta}/StorybookWrapperComponent.js
RENAMED
|
File without changes
|
package/dist/types/client/{preview/angular-beta → angular-beta}/utils/NgComponentAnalyzer.d.ts
RENAMED
|
File without changes
|
package/dist/types/client/{preview/angular-beta → angular-beta}/utils/NgComponentAnalyzer.js
RENAMED
|
File without changes
|
package/dist/types/client/{preview/angular-beta → angular-beta}/utils/NgModulesAnalyzer.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { DecoratorFunction, LegacyStoryFn } from '@storybook/csf';
|
|
2
|
-
import type { AngularFramework } from './types
|
|
2
|
+
import type { AngularFramework } from './types';
|
|
3
3
|
export default function decorateStory(mainStoryFn: LegacyStoryFn<AngularFramework>, decorators: DecoratorFunction<AngularFramework>[]): LegacyStoryFn<AngularFramework>;
|
|
4
4
|
export { decorateStory };
|
|
File without changes
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Type } from '@angular/core';
|
|
2
2
|
import type { DecoratorFunction, StoryContext } from '@storybook/csf';
|
|
3
|
-
import type { ICollection, NgModuleMetadata } from './types';
|
|
4
|
-
import type { AngularFramework } from './types-6-0';
|
|
3
|
+
import type { ICollection, NgModuleMetadata, AngularFramework } from './types';
|
|
5
4
|
export declare const moduleMetadata: <TArgs = any>(metadata: Partial<NgModuleMetadata>) => DecoratorFunction<AngularFramework, TArgs>;
|
|
6
5
|
export declare const componentWrapperDecorator: <TArgs = any>(element: Type<unknown> | ((story: string) => string), props?: ICollection | ((storyContext: StoryContext<AngularFramework, TArgs>) => ICollection)) => DecoratorFunction<AngularFramework, TArgs>;
|
|
File without changes
|
|
@@ -9,11 +9,11 @@ const isMethod = (methodOrProp) => {
|
|
|
9
9
|
};
|
|
10
10
|
exports.isMethod = isMethod;
|
|
11
11
|
const setCompodocJson = (compodocJson) => {
|
|
12
|
-
// @ts-ignore
|
|
12
|
+
// @ts-expect-error (Converted from ts-ignore)
|
|
13
13
|
window.__STORYBOOK_COMPODOC_JSON__ = compodocJson;
|
|
14
14
|
};
|
|
15
15
|
exports.setCompodocJson = setCompodocJson;
|
|
16
|
-
// @ts-ignore
|
|
16
|
+
// @ts-expect-error (Converted from ts-ignore)
|
|
17
17
|
const getCompodocJson = () => window.__STORYBOOK_COMPODOC_JSON__;
|
|
18
18
|
exports.getCompodocJson = getCompodocJson;
|
|
19
19
|
const checkValidComponentOrDirective = (component) => {
|
|
@@ -165,7 +165,6 @@ const extractDefaultValueFromComments = (property, value) => {
|
|
|
165
165
|
let commentValue = value;
|
|
166
166
|
property.jsdoctags.forEach((tag) => {
|
|
167
167
|
if (['default', 'defaultvalue'].includes(tag.tagName.escapedText)) {
|
|
168
|
-
// @ts-ignore
|
|
169
168
|
const dom = new window.DOMParser().parseFromString(tag.comment, 'text/html');
|
|
170
169
|
commentValue = dom.body.textContent;
|
|
171
170
|
}
|
|
@@ -10,5 +10,5 @@ export declare const parameters: {
|
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
export declare const decorators: ((storyFn: import("@storybook/csf").PartialStoryFn<import("
|
|
13
|
+
export declare const decorators: ((storyFn: import("@storybook/csf").PartialStoryFn<import("../types").AngularFramework, import("@storybook/csf").Args>, context: import("../types").StoryContext) => import("..").IStory)[];
|
|
14
14
|
export declare const argTypesEnhancers: (<TFramework extends import("@storybook/csf").AnyFramework>(context: import("@storybook/csf").StoryContextForEnhancers<TFramework, import("@storybook/csf").Args>) => import("@storybook/csf").StrictArgTypes<import("@storybook/csf").Args> | import("lib/addons/dist/types").Parameters)[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { PartialStoryFn } from '@storybook/csf';
|
|
2
|
-
import { StoryContext, AngularFramework } from '
|
|
2
|
+
import { StoryContext, AngularFramework } from '../types';
|
|
3
3
|
export declare const skipSourceRender: (context: StoryContext) => any;
|
|
4
4
|
/**
|
|
5
5
|
* Angular source decorator.
|
|
6
6
|
* @param storyFn Fn
|
|
7
7
|
* @param context StoryContext
|
|
8
8
|
*/
|
|
9
|
-
export declare const sourceDecorator: (storyFn: PartialStoryFn<AngularFramework>, context: StoryContext) => import("
|
|
9
|
+
export declare const sourceDecorator: (storyFn: PartialStoryFn<AngularFramework>, context: StoryContext) => import("../types").StoryFnAngularReturnType;
|
|
@@ -29,13 +29,3 @@ import 'core-js/proposals/reflect-metadata';
|
|
|
29
29
|
* Zone JS is required by Angular itself.
|
|
30
30
|
*/
|
|
31
31
|
import 'zone.js/dist/zone';
|
|
32
|
-
/** *************************************************************************************************
|
|
33
|
-
* APPLICATION IMPORTS
|
|
34
|
-
*/
|
|
35
|
-
/**
|
|
36
|
-
* Date, currency, decimal and percent pipes.
|
|
37
|
-
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* Need to import at least one locale-data with intl.
|
|
41
|
-
*/
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const global_1 = __importDefault(require("global"));
|
|
2
7
|
/**
|
|
3
8
|
* This file includes polyfills needed by Angular and is loaded before the app.
|
|
4
9
|
* You can add your own extra polyfills to this file.
|
|
@@ -14,7 +19,6 @@
|
|
|
14
19
|
*
|
|
15
20
|
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
|
|
16
21
|
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
22
|
/** *************************************************************************************************
|
|
19
23
|
* BROWSER POLYFILLS
|
|
20
24
|
*/
|
|
@@ -59,3 +63,5 @@ require("zone.js/dist/zone"); // Included with Angular CLI.
|
|
|
59
63
|
* Need to import at least one locale-data with intl.
|
|
60
64
|
*/
|
|
61
65
|
// import 'intl/locale-data/jsonp/en';
|
|
66
|
+
const { window: globalWindow } = global_1.default;
|
|
67
|
+
globalWindow.STORYBOOK_ENV = 'angular';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export * from './
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
1
|
+
import './globals';
|
|
2
|
+
export * from './public-api';
|
|
3
|
+
export * from './public-types';
|
|
4
|
+
export type { StoryFnAngularReturnType as IStory } from './types';
|
|
5
|
+
export { moduleMetadata, componentWrapperDecorator } from './decorators';
|
|
@@ -14,18 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.componentWrapperDecorator = exports.moduleMetadata =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
Object.defineProperty(exports, "addParameters", { enumerable: true, get: function () { return preview_1.addParameters; } });
|
|
23
|
-
Object.defineProperty(exports, "configure", { enumerable: true, get: function () { return preview_1.configure; } });
|
|
24
|
-
Object.defineProperty(exports, "getStorybook", { enumerable: true, get: function () { return preview_1.getStorybook; } });
|
|
25
|
-
Object.defineProperty(exports, "forceReRender", { enumerable: true, get: function () { return preview_1.forceReRender; } });
|
|
26
|
-
Object.defineProperty(exports, "raw", { enumerable: true, get: function () { return preview_1.raw; } });
|
|
27
|
-
__exportStar(require("./preview/types-6-0"), exports);
|
|
28
|
-
var decorators_1 = require("./preview/decorators");
|
|
17
|
+
exports.componentWrapperDecorator = exports.moduleMetadata = void 0;
|
|
18
|
+
require("./globals");
|
|
19
|
+
__exportStar(require("./public-api"), exports);
|
|
20
|
+
__exportStar(require("./public-types"), exports);
|
|
21
|
+
var decorators_1 = require("./decorators");
|
|
29
22
|
Object.defineProperty(exports, "moduleMetadata", { enumerable: true, get: function () { return decorators_1.moduleMetadata; } });
|
|
30
23
|
Object.defineProperty(exports, "componentWrapperDecorator", { enumerable: true, get: function () { return decorators_1.componentWrapperDecorator; } });
|
|
31
24
|
// optimization: stop HMR propagation in webpack
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="webpack-env" />
|
|
2
1
|
/// <reference types="node" />
|
|
2
|
+
/// <reference types="webpack-env" />
|
|
3
3
|
import type { ClientStoryApi, Loadable } from '@storybook/addons';
|
|
4
|
-
import './
|
|
5
|
-
|
|
6
|
-
import type { AngularFramework } from './types-6-0';
|
|
4
|
+
import type { IStorybookSection, AngularFramework } from './types';
|
|
5
|
+
export * from './public-types';
|
|
7
6
|
interface ClientApi extends ClientStoryApi<AngularFramework['storyResult']> {
|
|
8
7
|
setAddon(addon: any): void;
|
|
9
8
|
configure(loader: Loadable, module: NodeModule): void;
|
|
@@ -22,4 +21,3 @@ export declare const setAddon: ClientApi['setAddon'];
|
|
|
22
21
|
export declare const forceReRender: ClientApi['forceReRender'];
|
|
23
22
|
export declare const getStorybook: ClientApi['getStorybook'];
|
|
24
23
|
export declare const raw: ClientApi['raw'];
|
|
25
|
-
export {};
|
|
@@ -1,22 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
18
|
};
|
|
5
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
20
|
exports.raw = exports.getStorybook = exports.forceReRender = exports.setAddon = exports.clearDecorators = exports.addParameters = exports.addDecorator = exports.configure = exports.storiesOf = void 0;
|
|
7
21
|
const core_client_1 = require("@storybook/core-client");
|
|
8
|
-
require("./globals");
|
|
9
22
|
const render_1 = require("./render");
|
|
10
23
|
const decorateStory_1 = __importDefault(require("./decorateStory"));
|
|
11
|
-
|
|
24
|
+
__exportStar(require("./public-types"), exports);
|
|
25
|
+
const FRAMEWORK = 'angular';
|
|
12
26
|
const api = (0, core_client_1.start)(render_1.renderToDOM, { decorateStory: decorateStory_1.default, render: render_1.render });
|
|
13
27
|
const storiesOf = (kind, m) => {
|
|
14
28
|
return api.clientApi.storiesOf(kind, m).addParameters({
|
|
15
|
-
framework,
|
|
29
|
+
framework: FRAMEWORK,
|
|
16
30
|
});
|
|
17
31
|
};
|
|
18
32
|
exports.storiesOf = storiesOf;
|
|
19
|
-
const configure = (...args) => api.configure(
|
|
33
|
+
const configure = (...args) => api.configure(FRAMEWORK, ...args);
|
|
20
34
|
exports.configure = configure;
|
|
21
35
|
exports.addDecorator = api.clientApi
|
|
22
36
|
.addDecorator;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import type { Args,
|
|
2
|
-
import
|
|
1
|
+
import type { Args, ComponentAnnotations, StoryAnnotations, AnnotatedStoryFn } from '@storybook/csf';
|
|
2
|
+
import { AngularFramework } from './types';
|
|
3
3
|
export type { Args, ArgTypes } from '@storybook/csf';
|
|
4
|
-
export declare type AngularFramework = {
|
|
5
|
-
component: any;
|
|
6
|
-
storyResult: StoryFnAngularReturnType;
|
|
7
|
-
};
|
|
8
4
|
/**
|
|
9
5
|
* Metadata to configure the stories for a component.
|
|
10
6
|
*
|
|
@@ -24,19 +20,8 @@ export declare type StoryFn<TArgs = Args> = AnnotatedStoryFn<AngularFramework, T
|
|
|
24
20
|
*/
|
|
25
21
|
export declare type StoryObj<TArgs = Args> = StoryAnnotations<AngularFramework, TArgs>;
|
|
26
22
|
/**
|
|
27
|
-
* Story function that represents a
|
|
23
|
+
* Story function that represents a CSFv3 component example.
|
|
28
24
|
*
|
|
29
25
|
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
30
|
-
*
|
|
31
|
-
* NOTE that in Storybook 7.0, this type will be renamed to `StoryFn` and replaced by the current `StoryObj` type.
|
|
32
|
-
*
|
|
33
26
|
*/
|
|
34
|
-
export declare type Story<TArgs = Args> =
|
|
35
|
-
export declare type Parameters = DefaultParameters & {
|
|
36
|
-
/** Uses legacy angular rendering engine that use dynamic component */
|
|
37
|
-
angularLegacyRendering?: boolean;
|
|
38
|
-
bootstrapModuleOptions?: unknown;
|
|
39
|
-
};
|
|
40
|
-
export declare type StoryContext = DefaultStoryContext<AngularFramework> & {
|
|
41
|
-
parameters: Parameters;
|
|
42
|
-
};
|
|
27
|
+
export declare type Story<TArgs = Args> = StoryObj<TArgs>;
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RenderContext } from '@storybook/store';
|
|
2
2
|
import type { ArgsStoryFn } from '@storybook/csf';
|
|
3
|
-
import type { AngularFramework } from './types
|
|
3
|
+
import type { AngularFramework } from './types';
|
|
4
4
|
import { RendererFactory } from './angular-beta/RendererFactory';
|
|
5
5
|
export declare const rendererFactory: RendererFactory;
|
|
6
6
|
export declare const render: ArgsStoryFn<AngularFramework>;
|
|
File without changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Parameters as DefaultParameters, StoryContext as DefaultStoryContext } from '@storybook/csf';
|
|
1
2
|
export interface NgModuleMetadata {
|
|
2
3
|
declarations?: any[];
|
|
3
4
|
entryComponents?: any[];
|
|
@@ -27,3 +28,15 @@ export interface StoryFnAngularReturnType {
|
|
|
27
28
|
styles?: string[];
|
|
28
29
|
userDefinedTemplate?: boolean;
|
|
29
30
|
}
|
|
31
|
+
export declare type AngularFramework = {
|
|
32
|
+
component: any;
|
|
33
|
+
storyResult: StoryFnAngularReturnType;
|
|
34
|
+
};
|
|
35
|
+
export declare type Parameters = DefaultParameters & {
|
|
36
|
+
/** Uses legacy angular rendering engine that use dynamic component */
|
|
37
|
+
angularLegacyRendering?: boolean;
|
|
38
|
+
bootstrapModuleOptions?: unknown;
|
|
39
|
+
};
|
|
40
|
+
export declare type StoryContext = DefaultStoryContext<AngularFramework> & {
|
|
41
|
+
parameters: Parameters;
|
|
42
|
+
};
|
|
File without changes
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './client';
|
|
1
|
+
export * from './client/index';
|
|
2
2
|
export * from './types';
|
package/dist/types/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./client"), exports);
|
|
17
|
+
__exportStar(require("./client/index"), exports);
|
|
18
18
|
__exportStar(require("./types"), exports);
|
|
19
19
|
/*
|
|
20
20
|
* ATTENTION:
|
package/dist/types/preset.d.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
+
import type { PresetProperty } from '@storybook/core-common';
|
|
1
2
|
import { StorybookConfig } from './types';
|
|
3
|
+
export declare const addons: PresetProperty<'addons', StorybookConfig>;
|
|
2
4
|
export declare const previewAnnotations: StorybookConfig['previewAnnotations'];
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
builder: string;
|
|
6
|
-
disableWebpackDefaults?: boolean;
|
|
7
|
-
channelOptions?: Partial<import("telejson").Options>;
|
|
8
|
-
disableProjectJson?: boolean;
|
|
9
|
-
disableTelemetry?: boolean;
|
|
10
|
-
enableCrashReports?: boolean;
|
|
11
|
-
crossOriginIsolated?: boolean;
|
|
12
|
-
}>;
|
|
13
|
-
export declare const typescript: (config: StorybookConfig['typescript']) => Promise<StorybookConfig['typescript']>;
|
|
5
|
+
export declare const core: PresetProperty<'core', StorybookConfig>;
|
|
6
|
+
export declare const typescript: PresetProperty<'typescript', StorybookConfig>;
|
package/dist/types/preset.js
CHANGED
|
@@ -3,23 +3,27 @@ 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
|
-
exports.typescript = exports.core = exports.
|
|
6
|
+
exports.typescript = exports.core = exports.previewAnnotations = exports.addons = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const previewAnnotations = (entries = []) => [
|
|
9
|
-
...entries,
|
|
10
|
-
require.resolve('./client/preview/config'),
|
|
11
|
-
];
|
|
12
|
-
exports.previewAnnotations = previewAnnotations;
|
|
13
8
|
exports.addons = [
|
|
14
9
|
require.resolve('./server/framework-preset-angular'),
|
|
15
10
|
require.resolve('./server/framework-preset-angular-cli'),
|
|
16
11
|
require.resolve('./server/framework-preset-angular-ivy'),
|
|
17
12
|
require.resolve('./server/framework-preset-angular-docs'),
|
|
18
13
|
];
|
|
19
|
-
const
|
|
14
|
+
const previewAnnotations = (entries = []) => [
|
|
15
|
+
...entries,
|
|
16
|
+
require.resolve('./client/config'),
|
|
17
|
+
];
|
|
18
|
+
exports.previewAnnotations = previewAnnotations;
|
|
19
|
+
const core = async (config, options) => {
|
|
20
|
+
const framework = await options.presets.apply('framework');
|
|
20
21
|
return {
|
|
21
22
|
...config,
|
|
22
|
-
builder:
|
|
23
|
+
builder: {
|
|
24
|
+
name: path_1.default.dirname(require.resolve(path_1.default.join('@storybook/builder-webpack5', 'package.json'))),
|
|
25
|
+
options: typeof framework === 'string' ? {} : framework.options.builder || {},
|
|
26
|
+
},
|
|
23
27
|
};
|
|
24
28
|
};
|
|
25
29
|
exports.core = core;
|
package/dist/types/renderer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { computesTemplateSourceFromComponent } from './client/
|
|
2
|
-
export { rendererFactory } from './client/
|
|
3
|
-
export { AbstractRenderer } from './client/
|
|
4
|
-
export { getStorybookModuleMetadata } from './client/
|
|
1
|
+
export { computesTemplateSourceFromComponent } from './client/angular-beta/ComputesTemplateFromComponent';
|
|
2
|
+
export { rendererFactory } from './client/render';
|
|
3
|
+
export { AbstractRenderer } from './client/angular-beta/AbstractRenderer';
|
|
4
|
+
export { getStorybookModuleMetadata } from './client/angular-beta/StorybookModule';
|
package/dist/types/renderer.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getStorybookModuleMetadata = exports.AbstractRenderer = exports.rendererFactory = exports.computesTemplateSourceFromComponent = void 0;
|
|
4
|
-
var ComputesTemplateFromComponent_1 = require("./client/
|
|
4
|
+
var ComputesTemplateFromComponent_1 = require("./client/angular-beta/ComputesTemplateFromComponent");
|
|
5
5
|
Object.defineProperty(exports, "computesTemplateSourceFromComponent", { enumerable: true, get: function () { return ComputesTemplateFromComponent_1.computesTemplateSourceFromComponent; } });
|
|
6
|
-
var render_1 = require("./client/
|
|
6
|
+
var render_1 = require("./client/render");
|
|
7
7
|
Object.defineProperty(exports, "rendererFactory", { enumerable: true, get: function () { return render_1.rendererFactory; } });
|
|
8
|
-
var AbstractRenderer_1 = require("./client/
|
|
8
|
+
var AbstractRenderer_1 = require("./client/angular-beta/AbstractRenderer");
|
|
9
9
|
Object.defineProperty(exports, "AbstractRenderer", { enumerable: true, get: function () { return AbstractRenderer_1.AbstractRenderer; } });
|
|
10
|
-
var StorybookModule_1 = require("./client/
|
|
10
|
+
var StorybookModule_1 = require("./client/angular-beta/StorybookModule");
|
|
11
11
|
Object.defineProperty(exports, "getStorybookModuleMetadata", { enumerable: true, get: function () { return StorybookModule_1.getStorybookModuleMetadata; } });
|
package/dist/types/server/__mocks-ng-workspace__/with-lib/projects/pattern-lib/tsconfig.lib.json
CHANGED
|
@@ -9,18 +9,12 @@
|
|
|
9
9
|
"declarationMap": true,
|
|
10
10
|
"inlineSources": true,
|
|
11
11
|
"types": [],
|
|
12
|
-
"lib": [
|
|
13
|
-
"dom",
|
|
14
|
-
"es2018"
|
|
15
|
-
]
|
|
12
|
+
"lib": ["dom", "es2018"]
|
|
16
13
|
},
|
|
17
14
|
"angularCompilerOptions": {
|
|
18
15
|
"skipTemplateCodegen": true,
|
|
19
16
|
"strictMetadataEmit": true,
|
|
20
17
|
"enableResourceInlining": true
|
|
21
18
|
},
|
|
22
|
-
"exclude": [
|
|
23
|
-
"src/test.ts",
|
|
24
|
-
"**/*.spec.ts"
|
|
25
|
-
]
|
|
19
|
+
"exclude": ["src/test.ts", "**/*.spec.ts"]
|
|
26
20
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"include": [
|
|
3
|
-
"./src"
|
|
4
|
-
],
|
|
2
|
+
"include": ["./src"],
|
|
5
3
|
"compilerOptions": {
|
|
6
4
|
"sourceMap": true,
|
|
7
5
|
"moduleResolution": "node",
|
|
@@ -11,9 +9,6 @@
|
|
|
11
9
|
"esModuleInterop": true,
|
|
12
10
|
"skipLibCheck": true,
|
|
13
11
|
"target": "es5",
|
|
14
|
-
"lib": [
|
|
15
|
-
"es2017",
|
|
16
|
-
"dom"
|
|
17
|
-
]
|
|
12
|
+
"lib": ["es2017", "dom"]
|
|
18
13
|
}
|
|
19
14
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"include": [
|
|
3
|
-
"./src"
|
|
4
|
-
],
|
|
2
|
+
"include": ["./src"],
|
|
5
3
|
"compilerOptions": {
|
|
6
4
|
"sourceMap": true,
|
|
7
5
|
"moduleResolution": "node",
|
|
@@ -11,9 +9,6 @@
|
|
|
11
9
|
"esModuleInterop": true,
|
|
12
10
|
"skipLibCheck": true,
|
|
13
11
|
"target": "es5",
|
|
14
|
-
"lib": [
|
|
15
|
-
"es2017",
|
|
16
|
-
"dom"
|
|
17
|
-
]
|
|
12
|
+
"lib": ["es2017", "dom"]
|
|
18
13
|
}
|
|
19
14
|
}
|
|
@@ -9,18 +9,12 @@
|
|
|
9
9
|
"declarationMap": true,
|
|
10
10
|
"inlineSources": true,
|
|
11
11
|
"types": [],
|
|
12
|
-
"lib": [
|
|
13
|
-
"dom",
|
|
14
|
-
"es2018"
|
|
15
|
-
]
|
|
12
|
+
"lib": ["dom", "es2018"]
|
|
16
13
|
},
|
|
17
14
|
"angularCompilerOptions": {
|
|
18
15
|
"skipTemplateCodegen": true,
|
|
19
16
|
"strictMetadataEmit": true,
|
|
20
17
|
"enableResourceInlining": true
|
|
21
18
|
},
|
|
22
|
-
"exclude": [
|
|
23
|
-
"src/test.ts",
|
|
24
|
-
"**/*.spec.ts"
|
|
25
|
-
]
|
|
19
|
+
"exclude": ["src/test.ts", "**/*.spec.ts"]
|
|
26
20
|
}
|
|
@@ -77,7 +77,6 @@ function mergeAngularCliWebpackConfig({ cliCommonWebpackConfig, cliStyleWebpackC
|
|
|
77
77
|
// styleWebpackConfig.entry adds global style files to the webpack context
|
|
78
78
|
const entry = [
|
|
79
79
|
...baseConfig.entry,
|
|
80
|
-
// @ts-ignore
|
|
81
80
|
...Object.values(cliStyleWebpackConfig.entry).reduce((acc, item) => acc.concat(item), []),
|
|
82
81
|
];
|
|
83
82
|
const module = {
|
|
@@ -107,8 +107,6 @@ const buildWebpackConfigOptions = async (dirToSearch, project, target, confName)
|
|
|
107
107
|
sourceMap: {},
|
|
108
108
|
styles: [],
|
|
109
109
|
// Deleted in angular 12. Keep for compatibility with versions lower than angular 12
|
|
110
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
111
|
-
// @ts-ignore
|
|
112
110
|
lazyModules: [],
|
|
113
111
|
// Project Options
|
|
114
112
|
...projectBuildOptions,
|
|
@@ -117,8 +115,7 @@ const buildWebpackConfigOptions = async (dirToSearch, project, target, confName)
|
|
|
117
115
|
// Forced options
|
|
118
116
|
statsJson: false,
|
|
119
117
|
// Deleted in angular 12. Keep for compatibility with versions lower than angular 12
|
|
120
|
-
//
|
|
121
|
-
// @ts-ignore
|
|
118
|
+
// @ts-expect-error (Converted from ts-ignore)
|
|
122
119
|
forkTypeChecker: false,
|
|
123
120
|
};
|
|
124
121
|
return {
|
|
@@ -31,7 +31,7 @@ const node_logger_1 = require("@storybook/node-logger");
|
|
|
31
31
|
const architect_1 = require("@angular-devkit/architect");
|
|
32
32
|
const find_up_1 = require("find-up");
|
|
33
33
|
const semver_1 = __importDefault(require("@storybook/semver"));
|
|
34
|
-
const ts_dedent_1 =
|
|
34
|
+
const ts_dedent_1 = require("ts-dedent");
|
|
35
35
|
const core_1 = require("@angular-devkit/core");
|
|
36
36
|
const module_is_available_1 = require("./utils/module-is-available");
|
|
37
37
|
const angular_cli_webpack_12_2_x_1 = require("./angular-cli-webpack-12.2.x");
|
|
@@ -139,7 +139,7 @@ async function getLegacyDefaultBuildOptions(options) {
|
|
|
139
139
|
// Not use legacy way with builder (`angularBrowserTarget` is defined or null with builder and undefined without)
|
|
140
140
|
return {};
|
|
141
141
|
}
|
|
142
|
-
node_logger_1.logger.warn((0, ts_dedent_1.
|
|
142
|
+
node_logger_1.logger.warn((0, ts_dedent_1.dedent) `Your Storybook startup uses a solution that will not be supported in version 7.0.
|
|
143
143
|
You must use angular builder to have an explicit configuration on the project used in angular.json
|
|
144
144
|
Read more at:
|
|
145
145
|
- https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#sb-angular-builder)
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,13 +1,28 @@
|
|
|
1
|
-
import type { StorybookConfig as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { StorybookConfig as StorybookConfigBase, TypescriptOptions as TypescriptOptionsReact } from '@storybook/core-webpack';
|
|
2
|
+
import type { StorybookConfigWebpack, BuilderOptions, TypescriptOptions as TypescriptOptionsBuilder } from '@storybook/builder-webpack5';
|
|
3
|
+
declare type FrameworkName = '@storybook/angular';
|
|
4
|
+
declare type BuilderName = '@storybook/builder-webpack5';
|
|
5
|
+
export declare type FrameworkOptions = AngularOptions & {
|
|
6
|
+
builder?: BuilderOptions;
|
|
7
|
+
};
|
|
8
|
+
declare type StorybookConfigFramework = {
|
|
9
|
+
framework: FrameworkName | {
|
|
10
|
+
name: FrameworkName;
|
|
11
|
+
options: FrameworkOptions;
|
|
12
|
+
};
|
|
13
|
+
core?: StorybookConfigBase['core'] & {
|
|
14
|
+
builder?: BuilderName | {
|
|
15
|
+
name: BuilderName;
|
|
16
|
+
options: BuilderOptions;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
typescript?: Partial<TypescriptOptionsBuilder & TypescriptOptionsReact> & StorybookConfigBase['typescript'];
|
|
20
|
+
};
|
|
5
21
|
/**
|
|
6
22
|
* The interface for Storybook configuration in `main.ts` files.
|
|
7
23
|
*/
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
options: AngularOptions;
|
|
12
|
-
};
|
|
24
|
+
export declare type StorybookConfig = Omit<StorybookConfigBase, keyof StorybookConfigWebpack | keyof StorybookConfigFramework> & StorybookConfigWebpack & StorybookConfigFramework;
|
|
25
|
+
export interface AngularOptions {
|
|
26
|
+
enableIvy: boolean;
|
|
13
27
|
}
|
|
28
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/angular",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.33",
|
|
4
4
|
"description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -30,22 +30,23 @@
|
|
|
30
30
|
"*.d.ts"
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
|
-
"
|
|
33
|
+
"check": "tsc --noEmit",
|
|
34
|
+
"prep": "node ../../../scripts/prepare.js"
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|
|
36
|
-
"@storybook/addons": "7.0.0-alpha.
|
|
37
|
-
"@storybook/api": "7.0.0-alpha.
|
|
38
|
-
"@storybook/builder-webpack5": "7.0.0-alpha.
|
|
39
|
-
"@storybook/client-logger": "7.0.0-alpha.
|
|
40
|
-
"@storybook/core-client": "7.0.0-alpha.
|
|
41
|
-
"@storybook/core-common": "7.0.0-alpha.
|
|
42
|
-
"@storybook/core-events": "7.0.0-alpha.
|
|
43
|
-
"@storybook/core-server": "7.0.0-alpha.
|
|
44
|
-
"@storybook/csf": "0.0.2--canary.
|
|
45
|
-
"@storybook/docs-tools": "7.0.0-alpha.
|
|
46
|
-
"@storybook/node-logger": "7.0.0-alpha.
|
|
37
|
+
"@storybook/addons": "7.0.0-alpha.33",
|
|
38
|
+
"@storybook/api": "7.0.0-alpha.33",
|
|
39
|
+
"@storybook/builder-webpack5": "7.0.0-alpha.33",
|
|
40
|
+
"@storybook/client-logger": "7.0.0-alpha.33",
|
|
41
|
+
"@storybook/core-client": "7.0.0-alpha.33",
|
|
42
|
+
"@storybook/core-common": "7.0.0-alpha.33",
|
|
43
|
+
"@storybook/core-events": "7.0.0-alpha.33",
|
|
44
|
+
"@storybook/core-server": "7.0.0-alpha.33",
|
|
45
|
+
"@storybook/csf": "0.0.2--canary.0899bb7.0",
|
|
46
|
+
"@storybook/docs-tools": "7.0.0-alpha.33",
|
|
47
|
+
"@storybook/node-logger": "7.0.0-alpha.33",
|
|
47
48
|
"@storybook/semver": "^7.3.2",
|
|
48
|
-
"@storybook/store": "7.0.0-alpha.
|
|
49
|
+
"@storybook/store": "7.0.0-alpha.33",
|
|
49
50
|
"@types/node": "^14.14.20 || ^16.0.0",
|
|
50
51
|
"@types/react": "^16.14.23",
|
|
51
52
|
"@types/react-dom": "^16.9.14",
|
|
@@ -62,7 +63,6 @@
|
|
|
62
63
|
"react": "^16.14.0",
|
|
63
64
|
"react-dom": "^16.14.0",
|
|
64
65
|
"read-pkg-up": "^7.0.1",
|
|
65
|
-
"regenerator-runtime": "^0.13.7",
|
|
66
66
|
"sass-loader": "^12.6.0",
|
|
67
67
|
"telejson": "^6.0.8",
|
|
68
68
|
"ts-dedent": "^2.0.0",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@angular/forms": "^13.3.6",
|
|
85
85
|
"@angular/platform-browser": "^13.3.6",
|
|
86
86
|
"@angular/platform-browser-dynamic": "^13.3.6",
|
|
87
|
-
"@nrwl/workspace": "
|
|
87
|
+
"@nrwl/workspace": "14.6.1",
|
|
88
88
|
"@types/autoprefixer": "^9.7.2",
|
|
89
89
|
"@types/tmp": "^0.2.3",
|
|
90
90
|
"cross-spawn": "^7.0.3",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@angular/platform-browser": ">=6.0.0",
|
|
109
109
|
"@angular/platform-browser-dynamic": ">=6.0.0",
|
|
110
110
|
"@babel/core": "*",
|
|
111
|
-
"@nrwl/workspace": "
|
|
111
|
+
"@nrwl/workspace": "14.6.1",
|
|
112
112
|
"rxjs": "^6.0.0 || ^7.4.0",
|
|
113
113
|
"typescript": "^4.0.0",
|
|
114
114
|
"zone.js": "^0.8.29 || ^0.9.0 || ^0.10.0 || ^0.11.0"
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"access": "public"
|
|
129
129
|
},
|
|
130
130
|
"builders": "dist/types/builders/builders.json",
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "5da5b0fabd04cc5cd5771e8242a960f05d03234a"
|
|
132
132
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2017 Kadira Inc. <hello@kadira.io>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './angular-polyfills';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const global_1 = __importDefault(require("global"));
|
|
7
|
-
require("./angular-polyfills");
|
|
8
|
-
const { window: globalWindow } = global_1.default;
|
|
9
|
-
globalWindow.STORYBOOK_ENV = 'angular';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Args } from '@storybook/csf';
|
|
2
|
-
import type { StoryObj } from './types-6-0';
|
|
3
|
-
export type { StoryFn, StoryObj, Meta } from './types-6-0';
|
|
4
|
-
/**
|
|
5
|
-
* Story function that represents a CSFv3 component example.
|
|
6
|
-
*
|
|
7
|
-
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
8
|
-
*/
|
|
9
|
-
export declare type Story<TArgs = Args> = StoryObj<TArgs>;
|
package/standalone.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { CLIOptions, LoadOptions, BuilderOptions } from '@storybook/core-common';
|
|
2
|
-
import type { BuilderContext } from '@angular-devkit/architect';
|
|
3
|
-
|
|
4
|
-
export type StandaloneOptions = Partial<
|
|
5
|
-
CLIOptions &
|
|
6
|
-
LoadOptions &
|
|
7
|
-
BuilderOptions & {
|
|
8
|
-
mode?: 'static' | 'dev';
|
|
9
|
-
angularBrowserTarget?: string | null;
|
|
10
|
-
angularBuilderOptions?: Record<string, any> & {
|
|
11
|
-
styles?: any[];
|
|
12
|
-
stylePreprocessorOptions?: any;
|
|
13
|
-
};
|
|
14
|
-
angularBuilderContext?: BuilderContext | null;
|
|
15
|
-
tsConfig?: string;
|
|
16
|
-
}
|
|
17
|
-
>;
|
|
18
|
-
|
|
19
|
-
declare module '@storybook/angular/standalone' {
|
|
20
|
-
export default function buildStandalone(options: StandaloneOptions): Promise<unknown>;
|
|
21
|
-
}
|
package/standalone.js
DELETED
package/types-6-0.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './dist/types/client/preview/types-6-0.d';
|
package/types-7-0.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './dist/types/client/preview/types-7-0.d';
|