@storybook/addon-docs 7.0.0-alpha.35 → 7.0.0-alpha.38
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 +10 -1
- package/dist/esm/preset.js +10 -1
- package/package.json +17 -17
package/dist/cjs/preset.js
CHANGED
|
@@ -30,11 +30,20 @@ function createBabelOptions({
|
|
|
30
30
|
configureJSX
|
|
31
31
|
}) {
|
|
32
32
|
const babelPlugins = (mdxBabelOptions === null || mdxBabelOptions === void 0 ? void 0 : mdxBabelOptions.plugins) || (babelOptions === null || babelOptions === void 0 ? void 0 : babelOptions.plugins) || [];
|
|
33
|
+
const filteredBabelPlugins = babelPlugins.filter(p => {
|
|
34
|
+
const name = Array.isArray(p) ? p[0] : p;
|
|
35
|
+
|
|
36
|
+
if (typeof name === 'string') {
|
|
37
|
+
return !name.includes('plugin-transform-react-jsx');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return true;
|
|
41
|
+
});
|
|
33
42
|
const jsxPlugin = [require.resolve('@babel/plugin-transform-react-jsx'), {
|
|
34
43
|
pragma: 'React.createElement',
|
|
35
44
|
pragmaFrag: 'React.Fragment'
|
|
36
45
|
}];
|
|
37
|
-
const plugins = configureJSX ? [...
|
|
46
|
+
const plugins = configureJSX ? [...filteredBabelPlugins, jsxPlugin] : babelPlugins;
|
|
38
47
|
return Object.assign({
|
|
39
48
|
// don't use the root babelrc by default (users can override this in mdxBabelOptions)
|
|
40
49
|
babelrc: false,
|
package/dist/esm/preset.js
CHANGED
|
@@ -13,11 +13,20 @@ function createBabelOptions({
|
|
|
13
13
|
configureJSX
|
|
14
14
|
}) {
|
|
15
15
|
const babelPlugins = mdxBabelOptions?.plugins || babelOptions?.plugins || [];
|
|
16
|
+
const filteredBabelPlugins = babelPlugins.filter(p => {
|
|
17
|
+
const name = Array.isArray(p) ? p[0] : p;
|
|
18
|
+
|
|
19
|
+
if (typeof name === 'string') {
|
|
20
|
+
return !name.includes('plugin-transform-react-jsx');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return true;
|
|
24
|
+
});
|
|
16
25
|
const jsxPlugin = [require.resolve('@babel/plugin-transform-react-jsx'), {
|
|
17
26
|
pragma: 'React.createElement',
|
|
18
27
|
pragmaFrag: 'React.Fragment'
|
|
19
28
|
}];
|
|
20
|
-
const plugins = configureJSX ? [...
|
|
29
|
+
const plugins = configureJSX ? [...filteredBabelPlugins, jsxPlugin] : babelPlugins;
|
|
21
30
|
return Object.assign({
|
|
22
31
|
// don't use the root babelrc by default (users can override this in mdxBabelOptions)
|
|
23
32
|
babelrc: false,
|
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.38",
|
|
4
4
|
"description": "Document component usage and properties in Markdown",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"addon",
|
|
@@ -53,22 +53,22 @@
|
|
|
53
53
|
"@babel/preset-env": "^7.12.11",
|
|
54
54
|
"@jest/transform": "^26.6.2",
|
|
55
55
|
"@mdx-js/react": "^1.6.22",
|
|
56
|
-
"@storybook/addons": "7.0.0-alpha.
|
|
57
|
-
"@storybook/api": "7.0.0-alpha.
|
|
58
|
-
"@storybook/blocks": "7.0.0-alpha.
|
|
59
|
-
"@storybook/components": "7.0.0-alpha.
|
|
60
|
-
"@storybook/core-common": "7.0.0-alpha.
|
|
61
|
-
"@storybook/core-events": "7.0.0-alpha.
|
|
62
|
-
"@storybook/csf": "0.0.2--canary.
|
|
63
|
-
"@storybook/csf-tools": "7.0.0-alpha.
|
|
64
|
-
"@storybook/docs-tools": "7.0.0-alpha.
|
|
56
|
+
"@storybook/addons": "7.0.0-alpha.38",
|
|
57
|
+
"@storybook/api": "7.0.0-alpha.38",
|
|
58
|
+
"@storybook/blocks": "7.0.0-alpha.38",
|
|
59
|
+
"@storybook/components": "7.0.0-alpha.38",
|
|
60
|
+
"@storybook/core-common": "7.0.0-alpha.38",
|
|
61
|
+
"@storybook/core-events": "7.0.0-alpha.38",
|
|
62
|
+
"@storybook/csf": "0.0.2--canary.49.258942b.0",
|
|
63
|
+
"@storybook/csf-tools": "7.0.0-alpha.38",
|
|
64
|
+
"@storybook/docs-tools": "7.0.0-alpha.38",
|
|
65
65
|
"@storybook/mdx1-csf": "0.0.5-canary.13.9ce928a.0",
|
|
66
|
-
"@storybook/node-logger": "7.0.0-alpha.
|
|
67
|
-
"@storybook/postinstall": "7.0.0-alpha.
|
|
68
|
-
"@storybook/preview-web": "7.0.0-alpha.
|
|
69
|
-
"@storybook/source-loader": "7.0.0-alpha.
|
|
70
|
-
"@storybook/store": "7.0.0-alpha.
|
|
71
|
-
"@storybook/theming": "7.0.0-alpha.
|
|
66
|
+
"@storybook/node-logger": "7.0.0-alpha.38",
|
|
67
|
+
"@storybook/postinstall": "7.0.0-alpha.38",
|
|
68
|
+
"@storybook/preview-web": "7.0.0-alpha.38",
|
|
69
|
+
"@storybook/source-loader": "7.0.0-alpha.38",
|
|
70
|
+
"@storybook/store": "7.0.0-alpha.38",
|
|
71
|
+
"@storybook/theming": "7.0.0-alpha.38",
|
|
72
72
|
"babel-loader": "^8.2.5",
|
|
73
73
|
"dequal": "^2.0.2",
|
|
74
74
|
"global": "^4.4.0",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"publishConfig": {
|
|
104
104
|
"access": "public"
|
|
105
105
|
},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "438114fcf62a763f0e8c07e2c34890dd987ca431",
|
|
107
107
|
"storybook": {
|
|
108
108
|
"displayName": "Docs",
|
|
109
109
|
"icon": "https://user-images.githubusercontent.com/263385/101991672-48355c80-3c7c-11eb-82d9-95fa12438f64.png",
|