@storybook/angular 6.4.0-beta.8 → 6.4.0-rc.2

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.
Files changed (43) hide show
  1. package/dist/ts3.4/builders/build-storybook/index.d.ts +1 -1
  2. package/dist/ts3.4/builders/start-storybook/index.d.ts +1 -1
  3. package/dist/ts3.4/client/preview/config.d.ts +2 -0
  4. package/dist/ts3.4/client/preview/decorateStory.d.ts +1 -0
  5. package/dist/ts3.4/server/angular-cli-webpack-12.2.x.d.ts +1 -0
  6. package/dist/ts3.4/server/angular-cli-webpack-13.x.x.d.ts +1 -0
  7. package/dist/ts3.4/server/angular-cli-webpack-older.d.ts +72 -0
  8. package/dist/ts3.4/server/angular-devkit-build-webpack.d.ts +1 -1
  9. package/dist/ts3.4/server/framework-preset-angular-cli.d.ts +2 -72
  10. package/dist/ts3.4/server/framework-preset-angular-ivy.d.ts +3 -3
  11. package/dist/ts3.4/server/options.d.ts +9 -1
  12. package/dist/ts3.4/server/preset.d.ts +3 -0
  13. package/dist/ts3.9/builders/build-storybook/index.d.ts +1 -1
  14. package/dist/ts3.9/builders/build-storybook/index.js +2 -1
  15. package/dist/ts3.9/builders/build-storybook/schema.json +0 -7
  16. package/dist/ts3.9/builders/start-storybook/index.d.ts +1 -1
  17. package/dist/ts3.9/builders/start-storybook/index.js +2 -1
  18. package/dist/ts3.9/builders/start-storybook/schema.json +1 -16
  19. package/dist/ts3.9/client/preview/config.d.ts +2 -0
  20. package/dist/ts3.9/client/preview/config.js +3 -0
  21. package/dist/ts3.9/client/preview/decorateStory.d.ts +1 -0
  22. package/dist/ts3.9/client/preview/decorateStory.js +2 -0
  23. package/dist/ts3.9/server/__mocks-ng-workspace__/with-angularBrowserTarget/angular.json +32 -0
  24. package/dist/ts3.9/server/angular-cli-webpack-12.2.x.d.ts +1 -0
  25. package/dist/ts3.9/server/angular-cli-webpack-12.2.x.js +93 -0
  26. package/dist/ts3.9/server/angular-cli-webpack-13.x.x.d.ts +1 -0
  27. package/dist/ts3.9/server/angular-cli-webpack-13.x.x.js +93 -0
  28. package/dist/ts3.9/server/angular-cli-webpack-older.d.ts +72 -0
  29. package/dist/ts3.9/server/angular-cli-webpack-older.js +156 -0
  30. package/dist/ts3.9/server/angular-devkit-build-webpack.d.ts +1 -1
  31. package/dist/ts3.9/server/angular-devkit-build-webpack.js +18 -8
  32. package/dist/ts3.9/server/framework-preset-angular-cli.d.ts +2 -72
  33. package/dist/ts3.9/server/framework-preset-angular-cli.js +123 -88
  34. package/dist/ts3.9/server/framework-preset-angular-ivy.d.ts +3 -3
  35. package/dist/ts3.9/server/framework-preset-angular-ivy.js +45 -10
  36. package/dist/ts3.9/server/options.d.ts +9 -1
  37. package/dist/ts3.9/server/options.js +1 -5
  38. package/dist/ts3.9/server/preset.d.ts +3 -0
  39. package/dist/ts3.9/server/preset.js +21 -0
  40. package/package.json +12 -10
  41. package/preset.js +1 -7
  42. package/standalone.d.ts +4 -0
  43. package/types-7-0.d.ts +1 -0
@@ -67,24 +67,59 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
67
67
  };
68
68
  Object.defineProperty(exports, "__esModule", { value: true });
69
69
  exports.webpack = exports.runNgcc = void 0;
70
- var ngcc_1 = require("@angular/compiler-cli/ngcc");
71
70
  var path = __importStar(require("path"));
71
+ /**
72
+ * Source : https://github.com/angular/angular-cli/blob/ebccb5de4a455af813c5e82483db6af20666bdbd/packages/angular_devkit/build_angular/src/utils/load-esm.ts#L23
73
+ * This uses a dynamic import to load a module which may be ESM.
74
+ * CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript
75
+ * will currently, unconditionally downlevel dynamic import into a require call.
76
+ * require calls cannot load ESM code and will result in a runtime error. To workaround
77
+ * this, a Function constructor is used to prevent TypeScript from changing the dynamic import.
78
+ * Once TypeScript provides support for keeping the dynamic import this workaround can
79
+ * be dropped.
80
+ *
81
+ * @param modulePath The path of the module to load.
82
+ * @returns A Promise that resolves to the dynamically imported module.
83
+ */
84
+ function loadEsmModule(modulePath) {
85
+ // eslint-disable-next-line no-new-func
86
+ return new Function('modulePath', "return import(modulePath);")(modulePath);
87
+ }
72
88
  /**
73
89
  * Run ngcc for converting modules to ivy format before starting storybook
74
90
  * This step is needed in order to support Ivy in storybook
75
91
  *
76
92
  * Information about Ivy can be found here https://angular.io/guide/ivy
77
93
  */
78
- exports.runNgcc = function () {
79
- ngcc_1.process({
80
- // should be async: true but does not work due to
81
- // https://github.com/storybookjs/storybook/pull/11157/files#r615413803
82
- async: false,
83
- basePath: path.join(process.cwd(), 'node_modules'),
84
- createNewEntryPointFormats: true,
85
- compileAllFormats: false,
94
+ exports.runNgcc = function () { return __awaiter(void 0, void 0, void 0, function () {
95
+ var ngcc, error_1;
96
+ return __generator(this, function (_a) {
97
+ switch (_a.label) {
98
+ case 0:
99
+ _a.trys.push([0, 2, , 4]);
100
+ return [4 /*yield*/, Promise.resolve().then(function () { return __importStar(require('@angular/compiler-cli/ngcc')); })];
101
+ case 1:
102
+ ngcc = _a.sent();
103
+ return [3 /*break*/, 4];
104
+ case 2:
105
+ error_1 = _a.sent();
106
+ return [4 /*yield*/, loadEsmModule('@angular/compiler-cli/ngcc')];
107
+ case 3:
108
+ ngcc = _a.sent();
109
+ return [3 /*break*/, 4];
110
+ case 4:
111
+ ngcc.process({
112
+ // should be async: true but does not work due to
113
+ // https://github.com/storybookjs/storybook/pull/11157/files#r615413803
114
+ async: false,
115
+ basePath: path.join(process.cwd(), 'node_modules'),
116
+ createNewEntryPointFormats: true,
117
+ compileAllFormats: false,
118
+ });
119
+ return [2 /*return*/];
120
+ }
86
121
  });
87
- };
122
+ }); };
88
123
  exports.webpack = function (webpackConfig, options) { return __awaiter(void 0, void 0, void 0, function () {
89
124
  var angularOptions;
90
125
  return __generator(this, function (_a) {
@@ -1,3 +1,11 @@
1
- import { LoadOptions } from '@storybook/core-common';
1
+ import { LoadOptions, Options as CoreOptions } from '@storybook/core-common';
2
+ import { BuilderContext } from '@angular-devkit/architect';
3
+ import { JsonObject } from '@angular-devkit/core';
4
+ export declare type PresetOptions = CoreOptions & {
5
+ angularBrowserTarget?: string | null;
6
+ angularBuilderOptions?: JsonObject | null;
7
+ angularBuilderContext?: BuilderContext | null;
8
+ tsConfig?: string;
9
+ };
2
10
  declare const _default: LoadOptions;
3
11
  export default _default;
@@ -4,9 +4,5 @@ var read_pkg_up_1 = require("read-pkg-up");
4
4
  exports.default = {
5
5
  packageJson: read_pkg_up_1.sync({ cwd: __dirname }).packageJson,
6
6
  framework: 'angular',
7
- frameworkPresets: [
8
- require.resolve('./framework-preset-angular'),
9
- require.resolve('./framework-preset-angular-cli'),
10
- require.resolve('./framework-preset-angular-ivy'),
11
- ],
7
+ frameworkPresets: [require.resolve('./preset')],
12
8
  };
@@ -0,0 +1,3 @@
1
+ import type { StorybookConfig } from '@storybook/core-common';
2
+ export declare const config: StorybookConfig['config'];
3
+ export declare const addons: StorybookConfig['addons'];
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __spreadArrays = (this && this.__spreadArrays) || function () {
3
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
4
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
5
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
6
+ r[k] = a[j];
7
+ return r;
8
+ };
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.addons = exports.config = void 0;
11
+ exports.config = function (entries) {
12
+ if (entries === void 0) { entries = []; }
13
+ return __spreadArrays(entries, [
14
+ require.resolve('../client/preview/config'),
15
+ ]);
16
+ };
17
+ exports.addons = [
18
+ require.resolve('./framework-preset-angular'),
19
+ require.resolve('./framework-preset-angular-cli'),
20
+ require.resolve('./framework-preset-angular-ivy'),
21
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/angular",
3
- "version": "6.4.0-beta.8",
3
+ "version": "6.4.0-rc.2",
4
4
  "description": "Storybook for Angular: Develop Angular Components in isolation with Hot Reloading.",
5
5
  "keywords": [
6
6
  "storybook"
@@ -45,17 +45,19 @@
45
45
  "prepare": "node ../../scripts/prepare.js"
46
46
  },
47
47
  "dependencies": {
48
- "@storybook/addons": "6.4.0-beta.8",
49
- "@storybook/api": "6.4.0-beta.8",
50
- "@storybook/core": "6.4.0-beta.8",
51
- "@storybook/core-common": "6.4.0-beta.8",
52
- "@storybook/core-events": "6.4.0-beta.8",
53
- "@storybook/csf": "0.0.2--canary.6aca495.0",
54
- "@storybook/node-logger": "6.4.0-beta.8",
55
- "@storybook/store": "6.4.0-beta.8",
48
+ "@storybook/addons": "6.4.0-rc.2",
49
+ "@storybook/api": "6.4.0-rc.2",
50
+ "@storybook/core": "6.4.0-rc.2",
51
+ "@storybook/core-common": "6.4.0-rc.2",
52
+ "@storybook/core-events": "6.4.0-rc.2",
53
+ "@storybook/csf": "0.0.2--canary.87bc651.0",
54
+ "@storybook/node-logger": "6.4.0-rc.2",
55
+ "@storybook/semver": "^7.3.2",
56
+ "@storybook/store": "6.4.0-rc.2",
56
57
  "@types/webpack-env": "^1.16.0",
57
58
  "autoprefixer": "^9.8.6",
58
59
  "core-js": "^3.8.2",
60
+ "find-up": "^5.0.0",
59
61
  "fork-ts-checker-webpack-plugin": "^4.1.6",
60
62
  "global": "^4.4.0",
61
63
  "postcss": "^7.0.36",
@@ -131,5 +133,5 @@
131
133
  "access": "public"
132
134
  },
133
135
  "builders": "dist/ts3.9/builders/builders.json",
134
- "gitHead": "7f1ecb08225a3f146f9d6013a89e2a6d4d3dcd11"
136
+ "gitHead": "16be10b522569b4b55c684e1556b91b300009bf4"
135
137
  }
package/preset.js CHANGED
@@ -1,7 +1 @@
1
- function config(entry = []) {
2
- return [...entry, require.resolve('./dist/esm/client/preview/config')];
3
- }
4
-
5
- module.exports = {
6
- config,
7
- };
1
+ module.exports = require('./dist/ts3.9/server/preset');
package/standalone.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import { CLIOptions, LoadOptions, BuilderOptions } from '@storybook/core-common';
2
+ import { BuilderContext } from '@angular-devkit/architect';
3
+ import { JsonObject } from '@angular-devkit/core';
2
4
 
3
5
  export type StandaloneOptions = Partial<
4
6
  CLIOptions &
@@ -6,6 +8,8 @@ export type StandaloneOptions = Partial<
6
8
  BuilderOptions & {
7
9
  mode?: 'static' | 'dev';
8
10
  angularBrowserTarget?: string | null;
11
+ angularBuilderOptions?: JsonObject;
12
+ angularBuilderContext?: BuilderContext | null;
9
13
  tsConfig?: string;
10
14
  }
11
15
  >;
package/types-7-0.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/ts3.9/client/preview/types-7-0.d';