@modern-js/storybook 0.0.0-next-20231019105713 → 0.0.0-next-20231024065907
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/addons.d.ts +1 -0
- package/dist/addons.js +6 -0
- package/dist/addons.js.map +1 -0
- package/package.json +27 -9
- package/.eslintrc.js +0 -7
- package/CHANGELOG.md +0 -14
- package/preset.js +0 -1
- package/src/index.ts +0 -2
- package/src/preset.ts +0 -66
- package/src/types.ts +0 -21
- package/tsconfig.json +0 -16
package/dist/addons.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export { decorators } from '@modern-js/storybook-builder/addons';
|
package/dist/addons.js
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.decorators = void 0;
|
4
|
+
var addons_1 = require("@modern-js/storybook-builder/addons");
|
5
|
+
Object.defineProperty(exports, "decorators", { enumerable: true, get: function () { return addons_1.decorators; } });
|
6
|
+
//# sourceMappingURL=addons.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"addons.js","sourceRoot":"","sources":["../src/addons.ts"],"names":[],"mappings":";;;AAAA,8DAAiE;AAAxD,oGAAA,UAAU,OAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@modern-js/storybook",
|
3
|
-
"version": "0.0.0-next-
|
3
|
+
"version": "0.0.0-next-20231024065907",
|
4
4
|
"description": "modern.js support for storybook",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -9,17 +9,36 @@
|
|
9
9
|
},
|
10
10
|
"jsnext:source": "./src/index.ts",
|
11
11
|
"main": "./dist/index.js",
|
12
|
+
"types": "./dist/index.d.ts",
|
12
13
|
"bin": {
|
13
14
|
"storybook": "./bin.js",
|
14
15
|
"sb": "./bin.js"
|
15
16
|
},
|
16
|
-
"
|
17
|
+
"files": [
|
18
|
+
"dist",
|
19
|
+
"bin.js"
|
20
|
+
],
|
21
|
+
"typesVersions": {
|
22
|
+
"*": {
|
23
|
+
"addons": [
|
24
|
+
"./dist/addons.d.ts"
|
25
|
+
],
|
26
|
+
"types": [
|
27
|
+
"./dist/types.d.ts"
|
28
|
+
]
|
29
|
+
}
|
30
|
+
},
|
17
31
|
"exports": {
|
18
32
|
".": {
|
19
33
|
"jsnext:source": "./src/index.ts",
|
20
34
|
"types": "./dist/index.d.ts",
|
21
35
|
"default": "./dist/index.js"
|
22
36
|
},
|
37
|
+
"./addons": {
|
38
|
+
"jsnext:source": "./src/addons.ts",
|
39
|
+
"types": "./dist/addons.d.ts",
|
40
|
+
"default": "./dist/addons.js"
|
41
|
+
},
|
23
42
|
"./preset": {
|
24
43
|
"jsnext:source": "./src/preset.ts",
|
25
44
|
"types": "./dist/preset.d.ts",
|
@@ -36,17 +55,16 @@
|
|
36
55
|
"engines": {
|
37
56
|
"node": ">=16.0.0"
|
38
57
|
},
|
39
|
-
"keywords": [],
|
40
|
-
"author": "",
|
41
58
|
"license": "MIT",
|
42
59
|
"dependencies": {
|
43
|
-
"@storybook/react": "^7.
|
44
|
-
"storybook": "^7.
|
45
|
-
"@modern-js/storybook-builder": "0.0.0-next-
|
46
|
-
"@modern-js/utils": "0.0.0-next-
|
60
|
+
"@storybook/react": "^7.5.1",
|
61
|
+
"storybook": "^7.5.1",
|
62
|
+
"@modern-js/storybook-builder": "0.0.0-next-20231024065907",
|
63
|
+
"@modern-js/utils": "0.0.0-next-20231024065907"
|
47
64
|
},
|
48
65
|
"devDependencies": {
|
49
|
-
"@storybook/types": "^7.
|
66
|
+
"@storybook/types": "^7.5.1",
|
67
|
+
"typescript": "^5.2.2",
|
50
68
|
"@types/node": "^20.5.6"
|
51
69
|
},
|
52
70
|
"publishConfig": {
|
package/.eslintrc.js
DELETED
package/CHANGELOG.md
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# @modern-js/storybook
|
2
|
-
|
3
|
-
## 0.0.0-next-20231019105713
|
4
|
-
|
5
|
-
### Patch Changes
|
6
|
-
|
7
|
-
- 772003808: feat: add storybook-framework
|
8
|
-
feat: 支持 storybook-framework
|
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/preset.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
module.exports = require('./dist/preset');
|
package/src/index.ts
DELETED
package/src/preset.ts
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
import path from 'path';
|
2
|
-
import type { Options } from '@storybook/types';
|
3
|
-
import type { BuilderConfig } from '@modern-js/storybook-builder/types';
|
4
|
-
import { applyOptionsChain } from '@modern-js/utils';
|
5
|
-
|
6
|
-
export const frameworkOptions = async (_: never, options: Options) => {
|
7
|
-
const config = await options.presets.apply('framework');
|
8
|
-
|
9
|
-
if (typeof config === 'string') {
|
10
|
-
return {
|
11
|
-
name: config,
|
12
|
-
options: {},
|
13
|
-
};
|
14
|
-
}
|
15
|
-
if (typeof config === 'undefined') {
|
16
|
-
return {
|
17
|
-
name: '@modern-js/storybook',
|
18
|
-
options: {},
|
19
|
-
};
|
20
|
-
}
|
21
|
-
|
22
|
-
return {
|
23
|
-
name: config.name,
|
24
|
-
options: {
|
25
|
-
...config.options,
|
26
|
-
},
|
27
|
-
};
|
28
|
-
};
|
29
|
-
|
30
|
-
export const modern = (
|
31
|
-
config: BuilderConfig,
|
32
|
-
_options: Options,
|
33
|
-
): BuilderConfig => {
|
34
|
-
// @ts-expect-error
|
35
|
-
return {
|
36
|
-
...config,
|
37
|
-
source: {
|
38
|
-
...config.source,
|
39
|
-
alias: applyOptionsChain(
|
40
|
-
{
|
41
|
-
'@storybook/react': absPath('@storybook/react'),
|
42
|
-
},
|
43
|
-
config.source?.alias,
|
44
|
-
),
|
45
|
-
},
|
46
|
-
};
|
47
|
-
};
|
48
|
-
|
49
|
-
export const core = async (config: any, options: any) => {
|
50
|
-
const framework = await options.presets.apply('framework');
|
51
|
-
|
52
|
-
return {
|
53
|
-
...config,
|
54
|
-
builder: {
|
55
|
-
name: absPath('@modern-js/storybook-builder'),
|
56
|
-
options:
|
57
|
-
typeof framework === 'string' ? {} : framework?.options?.builder || {},
|
58
|
-
},
|
59
|
-
// FIXME: renderer: absPath('@storybook/react'),
|
60
|
-
renderer: '@storybook/react',
|
61
|
-
};
|
62
|
-
};
|
63
|
-
|
64
|
-
function absPath(pkg: string) {
|
65
|
-
return path.dirname(require.resolve(path.join(pkg, 'package.json')));
|
66
|
-
}
|
package/src/types.ts
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
import type { StorybookConfig as StorybookConfigBase } from '@storybook/types';
|
2
|
-
import type { BuilderOptions } from '@modern-js/storybook-builder';
|
3
|
-
|
4
|
-
export {
|
5
|
-
defineConfig,
|
6
|
-
type BuilderOptions,
|
7
|
-
} from '@modern-js/storybook-builder';
|
8
|
-
|
9
|
-
export type FrameworkName = '@modern-js/storybook' | string;
|
10
|
-
|
11
|
-
export interface StorybookConfig extends StorybookConfigBase {
|
12
|
-
framework:
|
13
|
-
| FrameworkName
|
14
|
-
| {
|
15
|
-
name: FrameworkName;
|
16
|
-
options: BuilderOptions;
|
17
|
-
};
|
18
|
-
typescript?: {
|
19
|
-
reactDocgen?: 'react-docgen' | 'react-docgen-typescript' | false;
|
20
|
-
} & StorybookConfigBase['typescript'];
|
21
|
-
}
|
package/tsconfig.json
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"extends": "@modern-js/tsconfig/base",
|
3
|
-
"compilerOptions": {
|
4
|
-
"target": "ES2020",
|
5
|
-
"declaration": true,
|
6
|
-
"outDir": "dist",
|
7
|
-
"isolatedModules": true,
|
8
|
-
"noImplicitAny": true,
|
9
|
-
"skipLibCheck": true,
|
10
|
-
"sourceMap": true,
|
11
|
-
"moduleResolution": "NodeNext",
|
12
|
-
"module": "NodeNext",
|
13
|
-
"esModuleInterop": true
|
14
|
-
},
|
15
|
-
"include": ["./src"]
|
16
|
-
}
|