@storybook/angular 8.3.0-alpha.4 → 8.3.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builders/build-storybook/index.d.ts +2 -2
- package/dist/builders/build-storybook/index.js +6 -6
- package/dist/builders/build-storybook/index.spec.js +2 -3
- package/dist/builders/start-storybook/index.d.ts +2 -2
- package/dist/builders/start-storybook/index.js +6 -6
- package/dist/builders/start-storybook/index.spec.js +3 -27
- package/dist/builders/utils/run-compodoc.js +4 -27
- package/dist/builders/utils/run-compodoc.spec.js +1 -2
- package/dist/builders/utils/standalone-options.d.ts +1 -1
- package/dist/client/angular-beta/AbstractRenderer.js +1 -1
- package/dist/client/angular-beta/CanvasRenderer.d.ts +1 -1
- package/dist/client/angular-beta/ComputesTemplateFromComponent.d.ts +1 -1
- package/dist/client/angular-beta/ComputesTemplateFromComponent.test.js +4 -8
- package/dist/client/angular-beta/DocsRenderer.d.ts +1 -1
- package/dist/client/angular-beta/DocsRenderer.js +2 -2
- package/dist/client/angular-beta/RendererFactory.js +1 -1
- package/dist/client/angular-beta/StorybookModule.js +1 -1
- package/dist/client/angular-beta/StorybookProvider.d.ts +1 -1
- package/dist/client/angular-beta/utils/BootstrapQueue.test.js +3 -3
- package/dist/client/angular-beta/utils/NgComponentAnalyzer.d.ts +1 -1
- package/dist/client/angular-beta/utils/PropertyExtractor.d.ts +1 -1
- package/dist/client/angular-beta/utils/PropertyExtractor.test.js +2 -2
- package/dist/client/argsToTemplate.test.js +2 -1
- package/dist/client/decorators.d.ts +2 -2
- package/dist/client/docs/angular-properties.test.js +9 -12
- package/dist/client/docs/compodoc.d.ts +1 -1
- package/dist/client/docs/compodoc.js +1 -1
- package/dist/client/docs/config.d.ts +1 -1
- package/dist/client/docs/sourceDecorator.d.ts +1 -1
- package/dist/client/docs/sourceDecorator.js +1 -1
- package/dist/client/globals.js +2 -1
- package/dist/client/index.js +1 -1
- package/dist/client/render.d.ts +2 -2
- package/dist/client/types.d.ts +1 -1
- package/dist/preset.js +2 -2
- package/dist/preset.mjs +1 -1
- package/dist/server/framework-preset-angular-cli.js +1 -1
- package/dist/server/framework-preset-angular-ivy.js +4 -30
- package/dist/test-setup.js +3 -4
- package/dist/test-setup.mjs +1 -2
- package/dist/types.d.ts +2 -2
- package/package.json +10 -10
- package/template/cli/button.stories.ts +1 -0
- package/template/cli/header.stories.ts +1 -1
- package/template/cli/page.stories.ts +1 -1
- package/template/components/index.js +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { CLIOptions } from 'storybook/internal/types';
|
|
1
2
|
import { BuilderOutput } from '@angular-devkit/architect';
|
|
2
|
-
import { JsonObject } from '@angular-devkit/core';
|
|
3
3
|
import { StylePreprocessorOptions } from '@angular-devkit/build-angular';
|
|
4
|
-
import { CLIOptions } from 'storybook/internal/types';
|
|
5
4
|
import { AssetPattern, SourceMapUnion, StyleElement } from '@angular-devkit/build-angular/src/builders/browser/schema';
|
|
5
|
+
import { JsonObject } from '@angular-devkit/core';
|
|
6
6
|
export type StorybookBuilderOptions = JsonObject & {
|
|
7
7
|
browserTarget?: string | null;
|
|
8
8
|
tsConfig?: string;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const common_1 = require("storybook/internal/common");
|
|
4
|
+
const core_server_1 = require("storybook/internal/core-server");
|
|
5
|
+
const telemetry_1 = require("storybook/internal/telemetry");
|
|
3
6
|
const architect_1 = require("@angular-devkit/architect");
|
|
7
|
+
const fd_package_json_1 = require("fd-package-json");
|
|
8
|
+
const find_up_1 = require("find-up");
|
|
4
9
|
const rxjs_1 = require("rxjs");
|
|
5
10
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const find_up_1 = require("find-up");
|
|
7
|
-
const fd_package_json_1 = require("fd-package-json");
|
|
8
|
-
const common_1 = require("storybook/internal/common");
|
|
9
|
-
const telemetry_1 = require("storybook/internal/telemetry");
|
|
10
|
-
const core_server_1 = require("storybook/internal/core-server");
|
|
11
|
-
const run_compodoc_1 = require("../utils/run-compodoc");
|
|
12
11
|
const error_handler_1 = require("../utils/error-handler");
|
|
12
|
+
const run_compodoc_1 = require("../utils/run-compodoc");
|
|
13
13
|
(0, telemetry_1.addToGlobalContext)('cliVersion', common_1.versions.storybook);
|
|
14
14
|
const commandBuilder = (options, context) => {
|
|
15
15
|
const builder = (0, rxjs_1.from)(setup(options, context)).pipe((0, operators_1.switchMap)(({ tsConfig }) => {
|
|
@@ -23,12 +23,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
27
|
-
const vitest_1 = require("vitest");
|
|
28
26
|
const architect_1 = require("@angular-devkit/architect");
|
|
29
27
|
const testing_1 = require("@angular-devkit/architect/testing");
|
|
30
28
|
const core_1 = require("@angular-devkit/core");
|
|
31
|
-
const path = __importStar(require("path"));
|
|
29
|
+
const path = __importStar(require("node:path"));
|
|
30
|
+
const vitest_1 = require("vitest");
|
|
32
31
|
const buildDevStandaloneMock = vitest_1.vi.fn();
|
|
33
32
|
const buildStaticStandaloneMock = vitest_1.vi.fn();
|
|
34
33
|
const buildMock = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { CLIOptions } from 'storybook/internal/types';
|
|
1
2
|
import { BuilderOutput } from '@angular-devkit/architect';
|
|
2
|
-
import { JsonObject } from '@angular-devkit/core';
|
|
3
3
|
import { StylePreprocessorOptions } from '@angular-devkit/build-angular';
|
|
4
|
-
import { CLIOptions } from 'storybook/internal/types';
|
|
5
4
|
import { AssetPattern, SourceMapUnion, StyleElement } from '@angular-devkit/build-angular/src/builders/browser/schema';
|
|
5
|
+
import { JsonObject } from '@angular-devkit/core';
|
|
6
6
|
export type StorybookBuilderOptions = JsonObject & {
|
|
7
7
|
browserTarget?: string | null;
|
|
8
8
|
tsConfig?: string;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const common_1 = require("storybook/internal/common");
|
|
4
|
+
const core_server_1 = require("storybook/internal/core-server");
|
|
5
|
+
const telemetry_1 = require("storybook/internal/telemetry");
|
|
3
6
|
const architect_1 = require("@angular-devkit/architect");
|
|
7
|
+
const fd_package_json_1 = require("fd-package-json");
|
|
8
|
+
const find_up_1 = require("find-up");
|
|
4
9
|
const rxjs_1 = require("rxjs");
|
|
5
10
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const find_up_1 = require("find-up");
|
|
7
|
-
const fd_package_json_1 = require("fd-package-json");
|
|
8
|
-
const common_1 = require("storybook/internal/common");
|
|
9
|
-
const telemetry_1 = require("storybook/internal/telemetry");
|
|
10
|
-
const core_server_1 = require("storybook/internal/core-server");
|
|
11
|
-
const run_compodoc_1 = require("../utils/run-compodoc");
|
|
12
11
|
const error_handler_1 = require("../utils/error-handler");
|
|
12
|
+
const run_compodoc_1 = require("../utils/run-compodoc");
|
|
13
13
|
(0, telemetry_1.addToGlobalContext)('cliVersion', common_1.versions.storybook);
|
|
14
14
|
const commandBuilder = (options, context) => {
|
|
15
15
|
const builder = (0, rxjs_1.from)(setup(options, context)).pipe((0, operators_1.switchMap)(({ tsConfig }) => {
|
|
@@ -1,34 +1,10 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
27
|
-
const vitest_1 = require("vitest");
|
|
28
3
|
const architect_1 = require("@angular-devkit/architect");
|
|
29
4
|
const testing_1 = require("@angular-devkit/architect/testing");
|
|
30
5
|
const core_1 = require("@angular-devkit/core");
|
|
31
|
-
const
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const vitest_1 = require("vitest");
|
|
32
8
|
const buildDevStandaloneMock = vitest_1.vi.fn();
|
|
33
9
|
const buildStaticStandaloneMock = vitest_1.vi.fn();
|
|
34
10
|
const buildMock = {
|
|
@@ -74,7 +50,7 @@ vitest_1.describe.skip('Start Storybook Builder', () => {
|
|
|
74
50
|
});
|
|
75
51
|
// This will either take a Node package name, or a path to the directory
|
|
76
52
|
// for the package.json file.
|
|
77
|
-
await architectHost.addBuilderFromPackage(
|
|
53
|
+
await architectHost.addBuilderFromPackage((0, node_path_1.join)(__dirname, '../../..'));
|
|
78
54
|
});
|
|
79
55
|
(0, vitest_1.beforeEach)(() => {
|
|
80
56
|
buildDevStandaloneMock.mockImplementation((_options) => Promise.resolve(_options));
|
|
@@ -1,38 +1,15 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.runCompodoc = void 0;
|
|
27
|
-
const
|
|
28
|
-
const path = __importStar(require("path"));
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
29
5
|
const common_1 = require("storybook/internal/common");
|
|
6
|
+
const rxjs_1 = require("rxjs");
|
|
30
7
|
const hasTsConfigArg = (args) => args.indexOf('-p') !== -1;
|
|
31
8
|
const hasOutputArg = (args) => args.indexOf('-d') !== -1 || args.indexOf('--output') !== -1;
|
|
32
|
-
//
|
|
9
|
+
// relative is necessary to workaround a compodoc issue with
|
|
33
10
|
// absolute paths on windows machines
|
|
34
11
|
const toRelativePath = (pathToTsConfig) => {
|
|
35
|
-
return
|
|
12
|
+
return (0, node_path_1.isAbsolute)(pathToTsConfig) ? (0, node_path_1.relative)('.', pathToTsConfig) : pathToTsConfig;
|
|
36
13
|
};
|
|
37
14
|
const runCompodoc = ({ compodocArgs, tsconfig }, context) => {
|
|
38
15
|
return new rxjs_1.Observable((observer) => {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
4
|
-
const vitest_1 = require("vitest");
|
|
5
3
|
const operators_1 = require("rxjs/operators");
|
|
4
|
+
const vitest_1 = require("vitest");
|
|
6
5
|
const run_compodoc_1 = require("./run-compodoc");
|
|
7
6
|
const mockRunScript = vitest_1.vi.fn();
|
|
8
7
|
vitest_1.vi.mock('storybook/internal/common', () => ({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { BuilderOptions, CLIOptions, LoadOptions } from 'storybook/internal/types';
|
|
1
2
|
import { BuilderContext } from '@angular-devkit/architect';
|
|
2
3
|
import { AssetPattern, SourceMapUnion, StyleElement, StylePreprocessorOptions } from '@angular-devkit/build-angular/src/builders/browser/schema';
|
|
3
|
-
import { LoadOptions, CLIOptions, BuilderOptions } from 'storybook/internal/types';
|
|
4
4
|
export type StandaloneOptions = CLIOptions & LoadOptions & BuilderOptions & {
|
|
5
5
|
mode?: 'static' | 'dev';
|
|
6
6
|
enableProdMode: boolean;
|
|
@@ -6,8 +6,8 @@ const rxjs_1 = require("rxjs");
|
|
|
6
6
|
const telejson_1 = require("telejson");
|
|
7
7
|
const StorybookModule_1 = require("./StorybookModule");
|
|
8
8
|
const StorybookProvider_1 = require("./StorybookProvider");
|
|
9
|
-
const PropertyExtractor_1 = require("./utils/PropertyExtractor");
|
|
10
9
|
const BootstrapQueue_1 = require("./utils/BootstrapQueue");
|
|
10
|
+
const PropertyExtractor_1 = require("./utils/PropertyExtractor");
|
|
11
11
|
const applicationRefs = new Map();
|
|
12
12
|
/**
|
|
13
13
|
* Attribute name for the story UID that may be written to the targetDOMNode.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { Parameters, StoryFnAngularReturnType } from '../types';
|
|
1
2
|
import { AbstractRenderer } from './AbstractRenderer';
|
|
2
|
-
import { StoryFnAngularReturnType, Parameters } from '../types';
|
|
3
3
|
export declare class CanvasRenderer extends AbstractRenderer {
|
|
4
4
|
render(options: {
|
|
5
5
|
storyFnAngular: StoryFnAngularReturnType;
|
|
@@ -683,10 +683,8 @@ const input_component_1 = require("./__testfixtures__/input.component");
|
|
|
683
683
|
`a string literal with 'single quotes'`,
|
|
684
684
|
'a single quoted string with "double quotes"',
|
|
685
685
|
"a double quoted string with 'single quotes'",
|
|
686
|
-
|
|
687
|
-
'a
|
|
688
|
-
// eslint-disable-next-line prettier/prettier
|
|
689
|
-
"a double quoted string with escaped \"double quotes\"",
|
|
686
|
+
"a single quoted string with escaped 'single quotes'",
|
|
687
|
+
'a double quoted string with escaped "double quotes"',
|
|
690
688
|
`a string literal with \'escaped single quotes\'`,
|
|
691
689
|
`a string literal with \"escaped double quotes\"`,
|
|
692
690
|
],
|
|
@@ -711,10 +709,8 @@ const input_component_1 = require("./__testfixtures__/input.component");
|
|
|
711
709
|
`a string literal with 'single quotes'`,
|
|
712
710
|
'a single quoted string with "double quotes"',
|
|
713
711
|
"a double quoted string with 'single quotes'",
|
|
714
|
-
|
|
715
|
-
'a
|
|
716
|
-
// eslint-disable-next-line prettier/prettier
|
|
717
|
-
"a double quoted string with escaped \"double quotes\"",
|
|
712
|
+
"a single quoted string with escaped 'single quotes'",
|
|
713
|
+
'a double quoted string with escaped "double quotes"',
|
|
718
714
|
`a string literal with \'escaped single quotes\'`,
|
|
719
715
|
`a string literal with \"escaped double quotes\"`,
|
|
720
716
|
],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { Parameters, StoryFnAngularReturnType } from '../types';
|
|
1
2
|
import { AbstractRenderer } from './AbstractRenderer';
|
|
2
|
-
import { StoryFnAngularReturnType, Parameters } from '../types';
|
|
3
3
|
export declare class DocsRenderer extends AbstractRenderer {
|
|
4
4
|
render(options: {
|
|
5
5
|
storyFnAngular: StoryFnAngularReturnType;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DocsRenderer = void 0;
|
|
4
|
-
const preview_api_1 = require("storybook/internal/preview-api");
|
|
5
4
|
const core_events_1 = require("storybook/internal/core-events");
|
|
6
|
-
const
|
|
5
|
+
const preview_api_1 = require("storybook/internal/preview-api");
|
|
7
6
|
const AbstractRenderer_1 = require("./AbstractRenderer");
|
|
7
|
+
const StoryUID_1 = require("./utils/StoryUID");
|
|
8
8
|
class DocsRenderer extends AbstractRenderer_1.AbstractRenderer {
|
|
9
9
|
async render(options) {
|
|
10
10
|
const channel = preview_api_1.addons.getChannel();
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.clearRootHTMLElement = exports.getRenderType = exports.RendererFactory = void 0;
|
|
4
4
|
const AbstractRenderer_1 = require("./AbstractRenderer");
|
|
5
|
-
const DocsRenderer_1 = require("./DocsRenderer");
|
|
6
5
|
const CanvasRenderer_1 = require("./CanvasRenderer");
|
|
6
|
+
const DocsRenderer_1 = require("./DocsRenderer");
|
|
7
7
|
class RendererFactory {
|
|
8
8
|
constructor() {
|
|
9
9
|
this.rendererMap = new Map();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getApplication = void 0;
|
|
4
|
-
const StorybookWrapperComponent_1 = require("./StorybookWrapperComponent");
|
|
5
4
|
const ComputesTemplateFromComponent_1 = require("./ComputesTemplateFromComponent");
|
|
5
|
+
const StorybookWrapperComponent_1 = require("./StorybookWrapperComponent");
|
|
6
6
|
const getApplication = ({ storyFnAngular, component, targetSelector, analyzedMetadata, }) => {
|
|
7
7
|
const { props, styles, moduleMetadata = {} } = storyFnAngular;
|
|
8
8
|
let { template } = storyFnAngular;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InjectionToken, Provider } from '@angular/core';
|
|
2
2
|
import { Subject } from 'rxjs';
|
|
3
3
|
import { ICollection } from '../types';
|
|
4
4
|
export declare const STORY_PROPS: InjectionToken<Subject<ICollection | undefined>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// @vitest-environment happy-dom
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @vitest-environment happy-dom
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const vitest_1 = require("vitest");
|
|
6
6
|
const BootstrapQueue_1 = require("./BootstrapQueue");
|
|
@@ -16,7 +16,7 @@ const instantWaitFor = (fn) => {
|
|
|
16
16
|
(0, vitest_1.afterEach)(() => {
|
|
17
17
|
vitest_1.vi.clearAllMocks();
|
|
18
18
|
});
|
|
19
|
-
(0, vitest_1.it)('should wait until complete', async () => {
|
|
19
|
+
(0, vitest_1.it)('@flaky should wait until complete', async () => {
|
|
20
20
|
const pendingSubject = new rxjs_1.Subject();
|
|
21
21
|
const bootstrapApp = vitest_1.vi.fn().mockImplementation(async () => {
|
|
22
22
|
return (0, rxjs_1.lastValueFrom)(pendingSubject);
|
|
@@ -160,4 +160,4 @@ const instantWaitFor = (fn) => {
|
|
|
160
160
|
(0, vitest_1.expect)(bootstrapAppFinished2).toHaveBeenCalledTimes(1);
|
|
161
161
|
(0, vitest_1.expect)(bootstrapAppError2).not.toHaveBeenCalled();
|
|
162
162
|
});
|
|
163
|
-
});
|
|
163
|
+
}, { retry: 3 });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InjectionToken, NgModule, Provider, ɵReflectionCapabilities as ReflectionCapabilities, importProvidersFrom } from '@angular/core';
|
|
2
2
|
import { NgModuleMetadata } from '../../types';
|
|
3
3
|
export declare const reflectionCapabilities: ReflectionCapabilities;
|
|
4
4
|
export declare const REMOVED_MODULES: InjectionToken<unknown>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const vitest_1 = require("vitest");
|
|
4
3
|
const common_1 = require("@angular/common");
|
|
5
4
|
const core_1 = require("@angular/core");
|
|
6
5
|
const platform_browser_1 = require("@angular/platform-browser");
|
|
7
6
|
const animations_1 = require("@angular/platform-browser/animations");
|
|
8
|
-
const
|
|
7
|
+
const vitest_1 = require("vitest");
|
|
9
8
|
const test_module_1 = require("../__testfixtures__/test.module");
|
|
9
|
+
const PropertyExtractor_1 = require("./PropertyExtractor");
|
|
10
10
|
const TEST_TOKEN = new core_1.InjectionToken('testToken');
|
|
11
11
|
const TestTokenProvider = { provide: TEST_TOKEN, useValue: 123 };
|
|
12
12
|
const TestService = (0, core_1.Injectable)()(class {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const vitest_1 = require("vitest");
|
|
4
|
-
const argsToTemplate_1 = require("./argsToTemplate");
|
|
4
|
+
const argsToTemplate_1 = require("./argsToTemplate");
|
|
5
|
+
// adjust path
|
|
5
6
|
(0, vitest_1.describe)('argsToTemplate', () => {
|
|
6
7
|
(0, vitest_1.it)('should correctly convert args to template string and exclude undefined values', () => {
|
|
7
8
|
const args = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { DecoratorFunction, StoryContext } from 'storybook/internal/types';
|
|
1
2
|
import { Type } from '@angular/core';
|
|
2
3
|
import { ApplicationConfig } from '@angular/platform-browser';
|
|
3
|
-
import {
|
|
4
|
-
import { ICollection, NgModuleMetadata, AngularRenderer } from './types';
|
|
4
|
+
import { AngularRenderer, ICollection, NgModuleMetadata } from './types';
|
|
5
5
|
export declare const moduleMetadata: <TArgs = any>(metadata: Partial<NgModuleMetadata>) => DecoratorFunction<AngularRenderer, TArgs>;
|
|
6
6
|
/**
|
|
7
7
|
* Decorator to set the config options which are available during the application bootstrap operation
|
|
@@ -1,19 +1,16 @@
|
|
|
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
|
-
const
|
|
7
|
-
const
|
|
3
|
+
const node_fs_1 = require("node:fs");
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
8
5
|
const vitest_1 = require("vitest");
|
|
9
6
|
// File hierarchy: __testfixtures__ / some-test-case / input.*
|
|
10
7
|
const inputRegExp = /^input\..*$/;
|
|
11
8
|
(0, vitest_1.describe)('angular component properties', () => {
|
|
12
|
-
const fixturesDir =
|
|
13
|
-
|
|
9
|
+
const fixturesDir = (0, node_path_1.join)(__dirname, '__testfixtures__');
|
|
10
|
+
(0, node_fs_1.readdirSync)(fixturesDir, { withFileTypes: true }).forEach((testEntry) => {
|
|
14
11
|
if (testEntry.isDirectory()) {
|
|
15
|
-
const testDir =
|
|
16
|
-
const testFile =
|
|
12
|
+
const testDir = (0, node_path_1.join)(fixturesDir, testEntry.name);
|
|
13
|
+
const testFile = (0, node_fs_1.readdirSync)(testDir).find((fileName) => inputRegExp.test(fileName));
|
|
17
14
|
if (testFile) {
|
|
18
15
|
// TODO: Remove this as soon as the real test is fixed
|
|
19
16
|
(0, vitest_1.it)('true', () => {
|
|
@@ -21,17 +18,17 @@ const inputRegExp = /^input\..*$/;
|
|
|
21
18
|
});
|
|
22
19
|
// TODO: Fix this test
|
|
23
20
|
// it(`${testEntry.name}`, () => {
|
|
24
|
-
// const inputPath =
|
|
21
|
+
// const inputPath = join(testDir, testFile);
|
|
25
22
|
// // snapshot the output of compodoc
|
|
26
23
|
// const compodocOutput = runCompodoc(inputPath);
|
|
27
24
|
// const compodocJson = JSON.parse(compodocOutput);
|
|
28
25
|
// expect(compodocJson).toMatchFileSnapshot(
|
|
29
|
-
//
|
|
26
|
+
// join(testDir, `compodoc-${SNAPSHOT_OS}.snapshot`)
|
|
30
27
|
// );
|
|
31
28
|
// // snapshot the output of addon-docs angular-properties
|
|
32
29
|
// const componentData = findComponentByName('InputComponent', compodocJson);
|
|
33
30
|
// const argTypes = extractArgTypesFromData(componentData);
|
|
34
|
-
// expect(argTypes).toMatchFileSnapshot(
|
|
31
|
+
// expect(argTypes).toMatchFileSnapshot(join(testDir, 'argtypes.snapshot'));
|
|
35
32
|
// });
|
|
36
33
|
}
|
|
37
34
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ArgTypes, SBType } from 'storybook/internal/types';
|
|
2
|
-
import { Class, CompodocJson, Component, Injectable, Method, Pipe, Property
|
|
2
|
+
import { Class, CompodocJson, Component, Directive, Injectable, Method, Pipe, Property } from './types';
|
|
3
3
|
export declare const isMethod: (methodOrProp: Method | Property) => methodOrProp is Method;
|
|
4
4
|
export declare const setCompodocJson: (compodocJson: CompodocJson) => void;
|
|
5
5
|
export declare const getCompodocJson: () => CompodocJson;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extractComponentDescription = exports.extractArgTypes = exports.extractArgTypesFromData = exports.extractType = exports.findComponentByName = exports.checkValidCompodocJson = exports.checkValidComponentOrDirective = exports.getCompodocJson = exports.setCompodocJson = exports.isMethod = void 0;
|
|
4
4
|
/* eslint-disable no-underscore-dangle */
|
|
5
|
-
const global_1 = require("@storybook/global");
|
|
6
5
|
const client_logger_1 = require("storybook/internal/client-logger");
|
|
6
|
+
const global_1 = require("@storybook/global");
|
|
7
7
|
const isMethod = (methodOrProp) => {
|
|
8
8
|
return methodOrProp.args !== undefined;
|
|
9
9
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArgTypesEnhancer, DecoratorFunction, Parameters } from 'storybook/internal/types';
|
|
2
2
|
export declare const parameters: Parameters;
|
|
3
3
|
export declare const decorators: DecoratorFunction[];
|
|
4
4
|
export declare const argTypesEnhancers: ArgTypesEnhancer[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PartialStoryFn } from 'storybook/internal/types';
|
|
2
|
-
import {
|
|
2
|
+
import { AngularRenderer, StoryContext } from '../types';
|
|
3
3
|
export declare const skipSourceRender: (context: StoryContext) => any;
|
|
4
4
|
/**
|
|
5
5
|
* Angular source decorator.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sourceDecorator = exports.skipSourceRender = void 0;
|
|
4
|
-
const preview_api_1 = require("storybook/internal/preview-api");
|
|
5
4
|
const docs_tools_1 = require("storybook/internal/docs-tools");
|
|
5
|
+
const preview_api_1 = require("storybook/internal/preview-api");
|
|
6
6
|
const renderer_1 = require("../../renderer");
|
|
7
7
|
const skipSourceRender = (context) => {
|
|
8
8
|
const sourceParams = context?.parameters.docs?.source;
|
package/dist/client/globals.js
CHANGED
|
@@ -24,7 +24,8 @@ const global_1 = require("@storybook/global");
|
|
|
24
24
|
/** *************************************************************************************************
|
|
25
25
|
* Zone JS is required by Angular itself.
|
|
26
26
|
*/
|
|
27
|
-
require("zone.js");
|
|
27
|
+
require("zone.js");
|
|
28
|
+
// Included with Angular CLI.
|
|
28
29
|
/** *************************************************************************************************
|
|
29
30
|
* APPLICATION IMPORTS
|
|
30
31
|
*/
|
package/dist/client/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/// <reference types="webpack-env" />
|
|
3
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
3
|
if (k2 === undefined) k2 = k;
|
|
5
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -16,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
15
|
};
|
|
17
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
17
|
exports.argsToTemplate = exports.applicationConfig = exports.componentWrapperDecorator = exports.moduleMetadata = void 0;
|
|
18
|
+
/// <reference types="webpack-env" />
|
|
19
19
|
require("./globals");
|
|
20
20
|
__exportStar(require("./public-types"), exports);
|
|
21
21
|
var decorators_1 = require("./decorators");
|
package/dist/client/render.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { ArgsStoryFn, RenderContext } from 'storybook/internal/types';
|
|
1
2
|
import '@angular/compiler';
|
|
2
|
-
import { RenderContext, ArgsStoryFn } from 'storybook/internal/types';
|
|
3
|
-
import { AngularRenderer } from './types';
|
|
4
3
|
import { RendererFactory } from './angular-beta/RendererFactory';
|
|
4
|
+
import { AngularRenderer } from './types';
|
|
5
5
|
export declare const rendererFactory: RendererFactory;
|
|
6
6
|
export declare const render: ArgsStoryFn<AngularRenderer>;
|
|
7
7
|
export declare function renderToCanvas({ storyFn, showMain, forceRemount, storyContext: { component } }: RenderContext<AngularRenderer>, element: HTMLElement): Promise<void>;
|
package/dist/client/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Parameters as DefaultParameters, StoryContext as DefaultStoryContext, WebRenderer } from 'storybook/internal/types';
|
|
1
2
|
import { Provider } from '@angular/core';
|
|
2
3
|
import { ApplicationConfig } from '@angular/platform-browser';
|
|
3
|
-
import { Parameters as DefaultParameters, StoryContext as DefaultStoryContext, WebRenderer } from 'storybook/internal/types';
|
|
4
4
|
export interface NgModuleMetadata {
|
|
5
5
|
/**
|
|
6
6
|
* List of components, directives, and pipes that belong to your component.
|
package/dist/preset.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.typescript = exports.core = exports.previewAnnotations = exports.addons = void 0;
|
|
4
|
-
const
|
|
5
|
-
const getAbsolutePath = (input) => (0,
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const getAbsolutePath = (input) => (0, node_path_1.dirname)(require.resolve((0, node_path_1.join)(input, 'package.json')));
|
|
6
6
|
exports.addons = [
|
|
7
7
|
require.resolve('./server/framework-preset-angular-cli'),
|
|
8
8
|
require.resolve('./server/framework-preset-angular-ivy'),
|
package/dist/preset.mjs
CHANGED
|
@@ -4,8 +4,8 @@ exports.webpackFinal = void 0;
|
|
|
4
4
|
const node_logger_1 = require("storybook/internal/node-logger");
|
|
5
5
|
const server_errors_1 = require("storybook/internal/server-errors");
|
|
6
6
|
const architect_1 = require("@angular-devkit/architect");
|
|
7
|
-
const find_up_1 = require("find-up");
|
|
8
7
|
const core_1 = require("@angular-devkit/core");
|
|
8
|
+
const find_up_1 = require("find-up");
|
|
9
9
|
const angular_cli_webpack_1 = require("./angular-cli-webpack");
|
|
10
10
|
const module_is_available_1 = require("./utils/module-is-available");
|
|
11
11
|
async function webpackFinal(baseConfig, options) {
|
|
@@ -1,34 +1,8 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
3
|
exports.webpack = exports.runNgcc = void 0;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
32
6
|
/**
|
|
33
7
|
* Source : https://github.com/angular/angular-cli/blob/ebccb5de4a455af813c5e82483db6af20666bdbd/packages/angular_devkit/build_angular/src/utils/load-esm.ts#L23
|
|
34
8
|
* This uses a dynamic import to load a module which may be ESM.
|
|
@@ -64,7 +38,7 @@ const runNgcc = async () => {
|
|
|
64
38
|
// should be async: true but does not work due to
|
|
65
39
|
// https://github.com/storybookjs/storybook/pull/11157/files#r615413803
|
|
66
40
|
async: false,
|
|
67
|
-
basePath:
|
|
41
|
+
basePath: (0, node_path_1.join)(process.cwd(), 'node_modules'), // absolute path to node_modules
|
|
68
42
|
createNewEntryPointFormats: true, // --create-ivy-entry-points
|
|
69
43
|
compileAllFormats: false, // --first-only
|
|
70
44
|
});
|
|
@@ -72,7 +46,7 @@ const runNgcc = async () => {
|
|
|
72
46
|
exports.runNgcc = runNgcc;
|
|
73
47
|
const webpack = async (webpackConfig, options) => {
|
|
74
48
|
const packageJsonPath = require.resolve('@angular/core/package.json');
|
|
75
|
-
const packageJson = JSON.parse(
|
|
49
|
+
const packageJson = JSON.parse((0, node_fs_1.readFileSync)(packageJsonPath, 'utf8'));
|
|
76
50
|
const VERSION = packageJson.version;
|
|
77
51
|
const framework = await options.presets.apply('framework');
|
|
78
52
|
const angularOptions = (typeof framework === 'object' ? framework.options : {});
|
package/dist/test-setup.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
4
3
|
require("@analogjs/vite-plugin-angular/setup-vitest");
|
|
5
|
-
const testing_1 = require("@angular/
|
|
6
|
-
const testing_2 = require("@angular/
|
|
7
|
-
(0,
|
|
4
|
+
const testing_1 = require("@angular/core/testing");
|
|
5
|
+
const testing_2 = require("@angular/platform-browser-dynamic/testing");
|
|
6
|
+
(0, testing_1.getTestBed)().initTestEnvironment(testing_2.BrowserDynamicTestingModule, (0, testing_2.platformBrowserDynamicTesting)());
|
package/dist/test-setup.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
1
|
import '@analogjs/vite-plugin-angular/setup-vitest';
|
|
3
|
-
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting, } from '@angular/platform-browser-dynamic/testing';
|
|
4
2
|
import { getTestBed } from '@angular/core/testing';
|
|
3
|
+
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting, } from '@angular/platform-browser-dynamic/testing';
|
|
5
4
|
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { StorybookConfig as StorybookConfigBase, TypescriptOptions as TypescriptOptionsReact } from '@storybook/core-webpack';
|
|
2
|
-
import { StorybookConfigWebpack, BuilderOptions, TypescriptOptions as TypescriptOptionsBuilder } from '@storybook/builder-webpack5';
|
|
3
1
|
import { CompatibleString } from 'storybook/internal/types';
|
|
2
|
+
import { BuilderOptions, StorybookConfigWebpack, TypescriptOptions as TypescriptOptionsBuilder } from '@storybook/builder-webpack5';
|
|
3
|
+
import { StorybookConfig as StorybookConfigBase, TypescriptOptions as TypescriptOptionsReact } from '@storybook/core-webpack';
|
|
4
4
|
type FrameworkName = CompatibleString<'@storybook/angular'>;
|
|
5
5
|
type BuilderName = CompatibleString<'@storybook/builder-webpack5'>;
|
|
6
6
|
export type FrameworkOptions = AngularOptions & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/angular",
|
|
3
|
-
"version": "8.3.0-alpha.
|
|
3
|
+
"version": "8.3.0-alpha.6",
|
|
4
4
|
"description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
],
|
|
35
35
|
"scripts": {
|
|
36
36
|
"check": "node ../../../scripts/node_modules/.bin/tsc",
|
|
37
|
-
"prep": "rimraf dist &&
|
|
37
|
+
"prep": "rimraf dist && jiti ../../../scripts/prepare/tsc.ts"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@storybook/builder-webpack5": "8.3.0-alpha.
|
|
41
|
-
"@storybook/components": "^8.3.0-alpha.
|
|
42
|
-
"@storybook/core-webpack": "8.3.0-alpha.
|
|
40
|
+
"@storybook/builder-webpack5": "8.3.0-alpha.6",
|
|
41
|
+
"@storybook/components": "^8.3.0-alpha.6",
|
|
42
|
+
"@storybook/core-webpack": "8.3.0-alpha.6",
|
|
43
43
|
"@storybook/global": "^5.0.0",
|
|
44
|
-
"@storybook/manager-api": "^8.3.0-alpha.
|
|
45
|
-
"@storybook/preview-api": "^8.3.0-alpha.
|
|
46
|
-
"@storybook/theming": "^8.3.0-alpha.
|
|
47
|
-
"@types/node": "^
|
|
44
|
+
"@storybook/manager-api": "^8.3.0-alpha.6",
|
|
45
|
+
"@storybook/preview-api": "^8.3.0-alpha.6",
|
|
46
|
+
"@storybook/theming": "^8.3.0-alpha.6",
|
|
47
|
+
"@types/node": "^22.0.0",
|
|
48
48
|
"@types/react": "^18.0.37",
|
|
49
49
|
"@types/react-dom": "^18.0.11",
|
|
50
50
|
"@types/semver": "^7.3.4",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@angular/platform-browser": ">=15.0.0 < 19.0.0",
|
|
94
94
|
"@angular/platform-browser-dynamic": ">=15.0.0 < 19.0.0",
|
|
95
95
|
"rxjs": "^6.0.0 || ^7.4.0",
|
|
96
|
-
"storybook": "^8.3.0-alpha.
|
|
96
|
+
"storybook": "^8.3.0-alpha.6",
|
|
97
97
|
"typescript": "^4.0.0 || ^5.0.0",
|
|
98
98
|
"zone.js": ">= 0.11.1 < 1.0.0"
|
|
99
99
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { global } from '@storybook/global';
|
|
2
2
|
|
|
3
3
|
import Button from './button.component';
|
|
4
|
+
import Form from './form.component';
|
|
4
5
|
import Html from './html.component';
|
|
5
6
|
import Pre from './pre.component';
|
|
6
|
-
import Form from './form.component';
|
|
7
7
|
|
|
8
8
|
global.Components = { Button, Html, Pre, Form };
|