@modern-js/storybook 0.0.0-next-20231016074859 → 0.0.0-next-20231019105713

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/CHANGELOG.md CHANGED
@@ -1,10 +1,14 @@
1
1
  # @modern-js/storybook
2
2
 
3
- ## 0.0.0-next-20231016074859
3
+ ## 0.0.0-next-20231019105713
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 94139b417: feat: add storybook-framework
7
+ - 772003808: feat: add storybook-framework
8
8
  feat: 支持 storybook-framework
9
- - Updated dependencies [94139b417]
10
- - @modern-js/storybook-builder@0.0.0-next-20231016074859
9
+ - Updated dependencies [383b63681]
10
+ - Updated dependencies [772003808]
11
+ - Updated dependencies [ce0a14e5f]
12
+ - Updated dependencies [708f24819]
13
+ - @modern-js/utils@0.0.0-next-20231019105713
14
+ - @modern-js/storybook-builder@0.0.0-next-20231019105713
package/dist/preset.js CHANGED
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.core = exports.modern = exports.frameworkOptions = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
+ const utils_1 = require("@modern-js/utils");
8
9
  const frameworkOptions = async (_, options) => {
9
10
  const config = await options.presets.apply('framework');
10
11
  if (typeof config === 'string') {
@@ -33,10 +34,9 @@ const modern = (config, _options) => {
33
34
  ...config,
34
35
  source: {
35
36
  ...config.source,
36
- alias: {
37
- ...config.source?.alias,
37
+ alias: (0, utils_1.applyOptionsChain)({
38
38
  '@storybook/react': absPath('@storybook/react'),
39
- },
39
+ }, config.source?.alias),
40
40
  },
41
41
  };
42
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"preset.js","sourceRoot":"","sources":["../src/preset.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAIjB,MAAM,gBAAgB,GAAG,KAAK,EAAE,CAAQ,EAAE,OAAgB,EAAE,EAAE;IAC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GAAG,KAAK,EAAE,MAAW,EAAE,OAAY,EAAE,EAAE;IACtD,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAE3D,OAAO;QACL,GAAG,MAAM;QACT,OAAO,EAAE;YACP,IAAI,EAAE,OAAO,CAAC,8BAA8B,CAAC;YAC7C,OAAO,EACL,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,IAAI,EAAE;SACzE;QACD,gDAAgD;QAChD,QAAQ,EAAE,kBAAkB;KAC7B,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,IAAI,QAaf;AAEF,SAAS,OAAO,CAAC,GAAW;IAC1B,OAAO,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;AACvE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modern-js/storybook",
3
- "version": "0.0.0-next-20231016074859",
3
+ "version": "0.0.0-next-20231019105713",
4
4
  "description": "modern.js support for storybook",
5
5
  "repository": {
6
6
  "type": "git",
@@ -42,7 +42,8 @@
42
42
  "dependencies": {
43
43
  "@storybook/react": "^7.4.6",
44
44
  "storybook": "^7.4.6",
45
- "@modern-js/storybook-builder": "0.0.0-next-20231016074859"
45
+ "@modern-js/storybook-builder": "0.0.0-next-20231019105713",
46
+ "@modern-js/utils": "0.0.0-next-20231019105713"
46
47
  },
47
48
  "devDependencies": {
48
49
  "@storybook/types": "^7.4.6",
package/src/preset.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import path from 'path';
2
2
  import type { Options } from '@storybook/types';
3
3
  import type { BuilderConfig } from '@modern-js/storybook-builder/types';
4
+ import { applyOptionsChain } from '@modern-js/utils';
4
5
 
5
6
  export const frameworkOptions = async (_: never, options: Options) => {
6
7
  const config = await options.presets.apply('framework');
@@ -35,10 +36,12 @@ export const modern = (
35
36
  ...config,
36
37
  source: {
37
38
  ...config.source,
38
- alias: {
39
- ...config.source?.alias,
40
- '@storybook/react': absPath('@storybook/react'),
41
- },
39
+ alias: applyOptionsChain(
40
+ {
41
+ '@storybook/react': absPath('@storybook/react'),
42
+ },
43
+ config.source?.alias,
44
+ ),
42
45
  },
43
46
  };
44
47
  };
@@ -1,4 +0,0 @@
1
-
2
- > @modern-js/storybook@2.31.2 build /home/runner/work/modern.js/modern.js/packages/storybook/framework
3
- > tsc
4
-
package/dist/upgrade.d.ts DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * Old storybook:
3
- * - `path/config/storybook` move to `path/.storybook/main.ts`
4
- * - stories folder -> configure in `.storybook/main.ts`
5
- */
6
- export declare function upgrade(cwd: string): void;
package/dist/upgrade.js DELETED
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.upgrade = void 0;
4
- /**
5
- * Old storybook:
6
- * - `path/config/storybook` move to `path/.storybook/main.ts`
7
- * - stories folder -> configure in `.storybook/main.ts`
8
- */
9
- function upgrade(cwd) {
10
- console.log(cwd);
11
- }
12
- exports.upgrade = upgrade;
13
- //# sourceMappingURL=upgrade.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../src/upgrade.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,SAAgB,OAAO,CAAC,GAAW;IACjC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC;AAFD,0BAEC"}
package/src/upgrade.ts DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * Old storybook:
3
- * - `path/config/storybook` move to `path/.storybook/main.ts`
4
- * - stories folder -> configure in `.storybook/main.ts`
5
- */
6
- export function upgrade(cwd: string) {
7
- console.log(cwd);
8
- }