@storybook/angular 9.0.0-rc.2 → 9.0.0-rc.3

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.
@@ -1,5 +1,5 @@
1
1
  import { ArgTypes, SBType } from 'storybook/internal/types';
2
- import { Class, CompodocJson, Component, Directive, Injectable, Method, Pipe, Property } from './types';
2
+ import { Class, CompodocJson, Component, Directive, Injectable, Method, Pipe, Property } from './compodoc-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;
@@ -1,6 +1,6 @@
1
1
  import './globals';
2
2
  export { render, renderToCanvas } from './render';
3
3
  export { decorateStory as applyDecorators } from './decorateStory';
4
- export declare const parameters: {
5
- renderer: "angular";
6
- };
4
+ import { ArgTypesEnhancer, Parameters } from 'storybook/internal/types';
5
+ export declare const parameters: Parameters;
6
+ export declare const argTypesEnhancers: ArgTypesEnhancer[];
@@ -1,10 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parameters = exports.applyDecorators = exports.renderToCanvas = exports.render = void 0;
3
+ exports.argTypesEnhancers = exports.parameters = exports.applyDecorators = exports.renderToCanvas = exports.render = void 0;
4
4
  require("./globals");
5
5
  var render_1 = require("./render");
6
6
  Object.defineProperty(exports, "render", { enumerable: true, get: function () { return render_1.render; } });
7
7
  Object.defineProperty(exports, "renderToCanvas", { enumerable: true, get: function () { return render_1.renderToCanvas; } });
8
8
  var decorateStory_1 = require("./decorateStory");
9
9
  Object.defineProperty(exports, "applyDecorators", { enumerable: true, get: function () { return decorateStory_1.decorateStory; } });
10
- exports.parameters = { renderer: 'angular' };
10
+ const docs_tools_1 = require("storybook/internal/docs-tools");
11
+ const compodoc_1 = require("./compodoc");
12
+ exports.parameters = {
13
+ renderer: 'angular',
14
+ docs: {
15
+ story: { inline: true },
16
+ extractArgTypes: compodoc_1.extractArgTypes,
17
+ extractComponentDescription: compodoc_1.extractComponentDescription,
18
+ },
19
+ };
20
+ exports.argTypesEnhancers = [docs_tools_1.enhanceArgTypes];
@@ -1,4 +1,14 @@
1
1
  import './globals';
2
2
  export { render, renderToCanvas } from './render';
3
3
  export { decorateStory as applyDecorators } from './decorateStory';
4
- export const parameters = { renderer: 'angular' };
4
+ import { enhanceArgTypes } from 'storybook/internal/docs-tools';
5
+ import { extractArgTypes, extractComponentDescription } from './compodoc';
6
+ export const parameters = {
7
+ renderer: 'angular',
8
+ docs: {
9
+ story: { inline: true },
10
+ extractArgTypes,
11
+ extractComponentDescription,
12
+ },
13
+ };
14
+ export const argTypesEnhancers = [enhanceArgTypes];
@@ -1,4 +1,3 @@
1
- import { ArgTypesEnhancer, DecoratorFunction, Parameters } from 'storybook/internal/types';
1
+ import { DecoratorFunction, Parameters } from 'storybook/internal/types';
2
2
  export declare const parameters: Parameters;
3
3
  export declare const decorators: DecoratorFunction[];
4
- export declare const argTypesEnhancers: ArgTypesEnhancer[];
@@ -1,14 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.argTypesEnhancers = exports.decorators = exports.parameters = void 0;
3
+ exports.decorators = exports.parameters = void 0;
4
4
  const docs_tools_1 = require("storybook/internal/docs-tools");
5
- const compodoc_1 = require("./compodoc");
6
5
  const sourceDecorator_1 = require("./sourceDecorator");
7
6
  exports.parameters = {
8
7
  docs: {
9
- story: { inline: true },
10
- extractArgTypes: compodoc_1.extractArgTypes,
11
- extractComponentDescription: compodoc_1.extractComponentDescription,
12
8
  source: {
13
9
  type: docs_tools_1.SourceType.DYNAMIC,
14
10
  language: 'html',
@@ -16,4 +12,3 @@ exports.parameters = {
16
12
  },
17
13
  };
18
14
  exports.decorators = [sourceDecorator_1.sourceDecorator];
19
- exports.argTypesEnhancers = [docs_tools_1.enhanceArgTypes];
@@ -1,11 +1,7 @@
1
- import { SourceType, enhanceArgTypes } from 'storybook/internal/docs-tools';
2
- import { extractArgTypes, extractComponentDescription } from './compodoc';
1
+ import { SourceType } from 'storybook/internal/docs-tools';
3
2
  import { sourceDecorator } from './sourceDecorator';
4
3
  export const parameters = {
5
4
  docs: {
6
- story: { inline: true },
7
- extractArgTypes,
8
- extractComponentDescription,
9
5
  source: {
10
6
  type: SourceType.DYNAMIC,
11
7
  language: 'html',
@@ -13,4 +9,3 @@ export const parameters = {
13
9
  },
14
10
  };
15
11
  export const decorators = [sourceDecorator];
16
- export const argTypesEnhancers = [enhanceArgTypes];
package/dist/preset.js CHANGED
@@ -6,13 +6,17 @@ const getAbsolutePath = (input) => (0, node_path_1.dirname)(require.resolve((0,
6
6
  exports.addons = [
7
7
  require.resolve('./server/framework-preset-angular-cli'),
8
8
  require.resolve('./server/framework-preset-angular-ivy'),
9
- require.resolve('./server/framework-preset-angular-docs'),
10
9
  ];
11
- const previewAnnotations = (entries = [], options) => {
10
+ const previewAnnotations = async (entries = [], options) => {
12
11
  const annotations = [...entries, require.resolve('./client/config')];
13
12
  if (options.enableProdMode) {
14
13
  annotations.unshift(require.resolve('./client/preview-prod'));
15
14
  }
15
+ const docsConfig = await options.presets.apply('docs', {}, options);
16
+ const docsEnabled = Object.keys(docsConfig).length > 0;
17
+ if (docsEnabled) {
18
+ annotations.push(require.resolve('./client/docs/config'));
19
+ }
16
20
  return annotations;
17
21
  };
18
22
  exports.previewAnnotations = previewAnnotations;
package/dist/preset.mjs CHANGED
@@ -3,13 +3,17 @@ const getAbsolutePath = (input) => dirname(require.resolve(join(input, 'package.
3
3
  export const addons = [
4
4
  require.resolve('./server/framework-preset-angular-cli'),
5
5
  require.resolve('./server/framework-preset-angular-ivy'),
6
- require.resolve('./server/framework-preset-angular-docs'),
7
6
  ];
8
- export const previewAnnotations = (entries = [], options) => {
7
+ export const previewAnnotations = async (entries = [], options) => {
9
8
  const annotations = [...entries, require.resolve('./client/config')];
10
9
  if (options.enableProdMode) {
11
10
  annotations.unshift(require.resolve('./client/preview-prod'));
12
11
  }
12
+ const docsConfig = await options.presets.apply('docs', {}, options);
13
+ const docsEnabled = Object.keys(docsConfig).length > 0;
14
+ if (docsEnabled) {
15
+ annotations.push(require.resolve('./client/docs/config'));
16
+ }
13
17
  return annotations;
14
18
  };
15
19
  export const core = async (config, options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/angular",
3
- "version": "9.0.0-rc.2",
3
+ "version": "9.0.0-rc.3",
4
4
  "description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
5
5
  "keywords": [
6
6
  "storybook",
@@ -52,8 +52,8 @@
52
52
  "prep": "rimraf dist && jiti ../../../scripts/prepare/tsc.ts"
53
53
  },
54
54
  "dependencies": {
55
- "@storybook/builder-webpack5": "9.0.0-rc.2",
56
- "@storybook/core-webpack": "9.0.0-rc.2",
55
+ "@storybook/builder-webpack5": "9.0.0-rc.3",
56
+ "@storybook/core-webpack": "9.0.0-rc.3",
57
57
  "@storybook/global": "^5.0.0",
58
58
  "@types/webpack-env": "^1.18.0",
59
59
  "fd-package-json": "^1.2.0",
@@ -96,7 +96,7 @@
96
96
  "@angular/platform-browser": ">=18.0.0 < 20.0.0",
97
97
  "@angular/platform-browser-dynamic": ">=18.0.0 < 20.0.0",
98
98
  "rxjs": "^6.5.3 || ^7.4.0",
99
- "storybook": "^9.0.0-rc.2",
99
+ "storybook": "^9.0.0-rc.3",
100
100
  "typescript": "^4.9.0 || ^5.0.0",
101
101
  "zone.js": ">=0.14.0"
102
102
  },
@@ -1 +0,0 @@
1
- export * from './compodoc';
@@ -1,17 +0,0 @@
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
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./compodoc"), exports);
@@ -1 +0,0 @@
1
- export * from './compodoc';
@@ -1,2 +0,0 @@
1
- import { PresetProperty } from 'storybook/internal/types';
2
- export declare const previewAnnotations: PresetProperty<'previewAnnotations'>;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.previewAnnotations = void 0;
4
- const docs_tools_1 = require("storybook/internal/docs-tools");
5
- const previewAnnotations = (entry = [], options) => {
6
- if (!(0, docs_tools_1.hasDocsOrControls)(options))
7
- return entry;
8
- return [...entry, require.resolve('../client/docs/config')];
9
- };
10
- exports.previewAnnotations = previewAnnotations;
@@ -1,6 +0,0 @@
1
- import { hasDocsOrControls } from 'storybook/internal/docs-tools';
2
- export const previewAnnotations = (entry = [], options) => {
3
- if (!hasDocsOrControls(options))
4
- return entry;
5
- return [...entry, require.resolve('../client/docs/config')];
6
- };
File without changes
File without changes