@storybook/addon-docs 7.0.0-alpha.47 → 7.0.0-alpha.48
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/cjs/preset.js +3 -5
- package/dist/esm/preset.js +3 -5
- package/dist/types/preset.d.ts +1 -1
- package/jest-transform-mdx.js +2 -2
- package/package.json +17 -17
package/dist/cjs/preset.js
CHANGED
|
@@ -146,10 +146,9 @@ async function webpack(webpackConfig = {}, options) {
|
|
|
146
146
|
return result;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
const storyIndexers =
|
|
149
|
+
const storyIndexers = indexers => {
|
|
150
150
|
const mdxIndexer = async (fileName, opts) => {
|
|
151
|
-
let code = (await _fsExtra.default.readFile(fileName, 'utf-8')).toString();
|
|
152
|
-
|
|
151
|
+
let code = (await _fsExtra.default.readFile(fileName, 'utf-8')).toString();
|
|
153
152
|
const {
|
|
154
153
|
compile
|
|
155
154
|
} = await Promise.resolve().then(() => _interopRequireWildcard(require('@storybook/mdx2-csf')));
|
|
@@ -161,8 +160,7 @@ const storyIndexers = async indexers => {
|
|
|
161
160
|
|
|
162
161
|
return [{
|
|
163
162
|
test: /(stories|story)\.mdx$/,
|
|
164
|
-
indexer: mdxIndexer
|
|
165
|
-
addDocsTemplate: true
|
|
163
|
+
indexer: mdxIndexer
|
|
166
164
|
}, ...(indexers || [])];
|
|
167
165
|
};
|
|
168
166
|
|
package/dist/esm/preset.js
CHANGED
|
@@ -125,10 +125,9 @@ export async function webpack(webpackConfig = {}, options) {
|
|
|
125
125
|
});
|
|
126
126
|
return result;
|
|
127
127
|
}
|
|
128
|
-
export const storyIndexers =
|
|
128
|
+
export const storyIndexers = indexers => {
|
|
129
129
|
const mdxIndexer = async (fileName, opts) => {
|
|
130
|
-
let code = (await fs.readFile(fileName, 'utf-8')).toString();
|
|
131
|
-
|
|
130
|
+
let code = (await fs.readFile(fileName, 'utf-8')).toString();
|
|
132
131
|
const {
|
|
133
132
|
compile
|
|
134
133
|
} = await import('@storybook/mdx2-csf');
|
|
@@ -140,8 +139,7 @@ export const storyIndexers = async indexers => {
|
|
|
140
139
|
|
|
141
140
|
return [{
|
|
142
141
|
test: /(stories|story)\.mdx$/,
|
|
143
|
-
indexer: mdxIndexer
|
|
144
|
-
addDocsTemplate: true
|
|
142
|
+
indexer: mdxIndexer
|
|
145
143
|
}, ...(indexers || [])];
|
|
146
144
|
};
|
|
147
145
|
export const docs = docsOptions => {
|
package/dist/types/preset.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare function webpack(webpackConfig: any, options: Options & BabelPara
|
|
|
11
11
|
csfPluginOptions: CsfPluginOptions | null;
|
|
12
12
|
transcludeMarkdown: boolean;
|
|
13
13
|
}): Promise<any>;
|
|
14
|
-
export declare const storyIndexers: (indexers: CoreCommon_StoryIndexer[] | null) =>
|
|
14
|
+
export declare const storyIndexers: (indexers: CoreCommon_StoryIndexer[] | null) => CoreCommon_StoryIndexer[];
|
|
15
15
|
export declare const docs: (docsOptions: DocsOptions) => {
|
|
16
16
|
enabled: boolean;
|
|
17
17
|
defaultName: string;
|
package/jest-transform-mdx.js
CHANGED
|
@@ -2,11 +2,11 @@ const path = require('path');
|
|
|
2
2
|
const { ScriptTransformer } = require('@jest/transform');
|
|
3
3
|
const { dedent } = require('ts-dedent');
|
|
4
4
|
|
|
5
|
-
const {
|
|
5
|
+
const { compile } = require('@storybook/mdx2-csf');
|
|
6
6
|
|
|
7
7
|
module.exports = {
|
|
8
8
|
async processAsync(src, filename, config, { instrument }) {
|
|
9
|
-
const code = await
|
|
9
|
+
const code = await compile(src, { skipCsf: false });
|
|
10
10
|
const result = dedent`
|
|
11
11
|
/* @jsx mdx */
|
|
12
12
|
import React from 'react'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-docs",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.48",
|
|
4
4
|
"description": "Document component usage and properties in Markdown",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"addon",
|
|
@@ -52,22 +52,22 @@
|
|
|
52
52
|
"@babel/plugin-transform-react-jsx": "^7.12.12",
|
|
53
53
|
"@jest/transform": "^26.6.2",
|
|
54
54
|
"@mdx-js/react": "^2.1.5",
|
|
55
|
-
"@storybook/addons": "7.0.0-alpha.
|
|
56
|
-
"@storybook/api": "7.0.0-alpha.
|
|
57
|
-
"@storybook/blocks": "7.0.0-alpha.
|
|
58
|
-
"@storybook/components": "7.0.0-alpha.
|
|
59
|
-
"@storybook/core-common": "7.0.0-alpha.
|
|
60
|
-
"@storybook/core-events": "7.0.0-alpha.
|
|
61
|
-
"@storybook/csf-plugin": "7.0.0-alpha.
|
|
62
|
-
"@storybook/csf-tools": "7.0.0-alpha.
|
|
63
|
-
"@storybook/docs-tools": "7.0.0-alpha.
|
|
55
|
+
"@storybook/addons": "7.0.0-alpha.48",
|
|
56
|
+
"@storybook/api": "7.0.0-alpha.48",
|
|
57
|
+
"@storybook/blocks": "7.0.0-alpha.48",
|
|
58
|
+
"@storybook/components": "7.0.0-alpha.48",
|
|
59
|
+
"@storybook/core-common": "7.0.0-alpha.48",
|
|
60
|
+
"@storybook/core-events": "7.0.0-alpha.48",
|
|
61
|
+
"@storybook/csf-plugin": "7.0.0-alpha.48",
|
|
62
|
+
"@storybook/csf-tools": "7.0.0-alpha.48",
|
|
63
|
+
"@storybook/docs-tools": "7.0.0-alpha.48",
|
|
64
64
|
"@storybook/mdx2-csf": "next",
|
|
65
|
-
"@storybook/node-logger": "7.0.0-alpha.
|
|
66
|
-
"@storybook/postinstall": "7.0.0-alpha.
|
|
67
|
-
"@storybook/preview-web": "7.0.0-alpha.
|
|
68
|
-
"@storybook/store": "7.0.0-alpha.
|
|
69
|
-
"@storybook/theming": "7.0.0-alpha.
|
|
70
|
-
"@storybook/types": "7.0.0-alpha.
|
|
65
|
+
"@storybook/node-logger": "7.0.0-alpha.48",
|
|
66
|
+
"@storybook/postinstall": "7.0.0-alpha.48",
|
|
67
|
+
"@storybook/preview-web": "7.0.0-alpha.48",
|
|
68
|
+
"@storybook/store": "7.0.0-alpha.48",
|
|
69
|
+
"@storybook/theming": "7.0.0-alpha.48",
|
|
70
|
+
"@storybook/types": "7.0.0-alpha.48",
|
|
71
71
|
"dequal": "^2.0.2",
|
|
72
72
|
"fs-extra": "^9.0.1",
|
|
73
73
|
"global": "^4.4.0",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"publishConfig": {
|
|
95
95
|
"access": "public"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
|
|
98
98
|
"storybook": {
|
|
99
99
|
"displayName": "Docs",
|
|
100
100
|
"icon": "https://user-images.githubusercontent.com/263385/101991672-48355c80-3c7c-11eb-82d9-95fa12438f64.png",
|