@storybook/addon-docs 7.0.0-alpha.10 → 7.0.0-alpha.11
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/blocks.js +1 -1
- package/dist/cjs/preset.js +13 -5
- package/package.json +19 -17
package/blocks.js
CHANGED
package/dist/cjs/preset.js
CHANGED
|
@@ -29,7 +29,7 @@ function createBabelOptions({
|
|
|
29
29
|
mdxBabelOptions,
|
|
30
30
|
configureJSX
|
|
31
31
|
}) {
|
|
32
|
-
const babelPlugins = mdxBabelOptions
|
|
32
|
+
const babelPlugins = (mdxBabelOptions === null || mdxBabelOptions === void 0 ? void 0 : mdxBabelOptions.plugins) || (babelOptions === null || babelOptions === void 0 ? void 0 : babelOptions.plugins) || [];
|
|
33
33
|
const jsxPlugin = [require.resolve('@babel/plugin-transform-react-jsx'), {
|
|
34
34
|
pragma: 'React.createElement',
|
|
35
35
|
pragmaFrag: 'React.Fragment'
|
|
@@ -45,6 +45,8 @@ function createBabelOptions({
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
async function webpack(webpackConfig = {}, options) {
|
|
48
|
+
var _global$FEATURES, _global$FEATURES2;
|
|
49
|
+
|
|
48
50
|
const resolvedBabelLoader = require.resolve('babel-loader');
|
|
49
51
|
|
|
50
52
|
const {
|
|
@@ -65,11 +67,11 @@ async function webpack(webpackConfig = {}, options) {
|
|
|
65
67
|
skipCsf: true,
|
|
66
68
|
remarkPlugins: [_remarkSlug.default, _remarkExternalLinks.default]
|
|
67
69
|
};
|
|
68
|
-
const mdxVersion = _global.default.FEATURES
|
|
70
|
+
const mdxVersion = (_global$FEATURES = _global.default.FEATURES) !== null && _global$FEATURES !== void 0 && _global$FEATURES.previewMdx2 ? 'MDX2' : 'MDX1';
|
|
69
71
|
|
|
70
72
|
_nodeLogger.logger.info(`Addon-docs: using ${mdxVersion}`);
|
|
71
73
|
|
|
72
|
-
const mdxLoader = _global.default.FEATURES
|
|
74
|
+
const mdxLoader = (_global$FEATURES2 = _global.default.FEATURES) !== null && _global$FEATURES2 !== void 0 && _global$FEATURES2.previewMdx2 ? require.resolve('@storybook/mdx2-csf/loader') : require.resolve('@storybook/mdx1-csf/loader'); // set `sourceLoaderOptions` to `null` to disable for manual configuration
|
|
73
75
|
|
|
74
76
|
const sourceLoader = sourceLoaderOptions ? [{
|
|
75
77
|
test: /\.(stories|story)\.[tj]sx?$/,
|
|
@@ -82,7 +84,11 @@ async function webpack(webpackConfig = {}, options) {
|
|
|
82
84
|
let rules = module.rules || [];
|
|
83
85
|
|
|
84
86
|
if (transcludeMarkdown) {
|
|
85
|
-
rules = [...rules.filter(rule =>
|
|
87
|
+
rules = [...rules.filter(rule => {
|
|
88
|
+
var _rule$test;
|
|
89
|
+
|
|
90
|
+
return ((_rule$test = rule.test) === null || _rule$test === void 0 ? void 0 : _rule$test.toString()) !== '/\\.md$/';
|
|
91
|
+
}), {
|
|
86
92
|
test: /\.md$/,
|
|
87
93
|
use: [{
|
|
88
94
|
loader: resolvedBabelLoader,
|
|
@@ -134,11 +140,13 @@ async function webpack(webpackConfig = {}, options) {
|
|
|
134
140
|
|
|
135
141
|
const storyIndexers = async indexers => {
|
|
136
142
|
const mdxIndexer = async (fileName, opts) => {
|
|
143
|
+
var _global$FEATURES3;
|
|
144
|
+
|
|
137
145
|
let code = (await _fsExtra.default.readFile(fileName, 'utf-8')).toString(); // @ts-ignore
|
|
138
146
|
|
|
139
147
|
const {
|
|
140
148
|
compile
|
|
141
|
-
} = _global.default.FEATURES
|
|
149
|
+
} = (_global$FEATURES3 = _global.default.FEATURES) !== null && _global$FEATURES3 !== void 0 && _global$FEATURES3.previewMdx2 ? await Promise.resolve().then(() => _interopRequireWildcard(require('@storybook/mdx2-csf'))) : await Promise.resolve().then(() => _interopRequireWildcard(require('@storybook/mdx1-csf')));
|
|
142
150
|
code = await compile(code, {});
|
|
143
151
|
return (0, _csfTools.loadCsf)(code, Object.assign({}, opts, {
|
|
144
152
|
fileName
|
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.11",
|
|
4
4
|
"description": "Document component usage and properties in Markdown",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"addon",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"!__testfixtures__"
|
|
46
46
|
],
|
|
47
47
|
"scripts": {
|
|
48
|
+
"check": "tsc --noEmit",
|
|
48
49
|
"prepare": "node ../../scripts/prepare.js"
|
|
49
50
|
},
|
|
50
51
|
"dependencies": {
|
|
@@ -52,22 +53,22 @@
|
|
|
52
53
|
"@babel/preset-env": "^7.12.11",
|
|
53
54
|
"@jest/transform": "^26.6.2",
|
|
54
55
|
"@mdx-js/react": "^1.6.22",
|
|
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.
|
|
56
|
+
"@storybook/addons": "7.0.0-alpha.11",
|
|
57
|
+
"@storybook/api": "7.0.0-alpha.11",
|
|
58
|
+
"@storybook/blocks": "7.0.0-alpha.11",
|
|
59
|
+
"@storybook/components": "7.0.0-alpha.11",
|
|
60
|
+
"@storybook/core-common": "7.0.0-alpha.11",
|
|
61
|
+
"@storybook/core-events": "7.0.0-alpha.11",
|
|
61
62
|
"@storybook/csf": "0.0.2--canary.4566f4d.1",
|
|
62
|
-
"@storybook/csf-tools": "7.0.0-alpha.
|
|
63
|
-
"@storybook/docs-tools": "7.0.0-alpha.
|
|
63
|
+
"@storybook/csf-tools": "7.0.0-alpha.11",
|
|
64
|
+
"@storybook/docs-tools": "7.0.0-alpha.11",
|
|
64
65
|
"@storybook/mdx1-csf": "^0.0.1",
|
|
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/source-loader": "7.0.0-alpha.
|
|
69
|
-
"@storybook/store": "7.0.0-alpha.
|
|
70
|
-
"@storybook/theming": "7.0.0-alpha.
|
|
66
|
+
"@storybook/node-logger": "7.0.0-alpha.11",
|
|
67
|
+
"@storybook/postinstall": "7.0.0-alpha.11",
|
|
68
|
+
"@storybook/preview-web": "7.0.0-alpha.11",
|
|
69
|
+
"@storybook/source-loader": "7.0.0-alpha.11",
|
|
70
|
+
"@storybook/store": "7.0.0-alpha.11",
|
|
71
|
+
"@storybook/theming": "7.0.0-alpha.11",
|
|
71
72
|
"babel-loader": "^8.2.5",
|
|
72
73
|
"core-js": "^3.8.2",
|
|
73
74
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -81,7 +82,8 @@
|
|
|
81
82
|
"devDependencies": {
|
|
82
83
|
"@babel/core": "^7.12.10",
|
|
83
84
|
"@storybook/mdx2-csf": "^0.0.3",
|
|
84
|
-
"@types/util-deprecate": "^1.0.0"
|
|
85
|
+
"@types/util-deprecate": "^1.0.0",
|
|
86
|
+
"typescript": "~4.6.3"
|
|
85
87
|
},
|
|
86
88
|
"peerDependencies": {
|
|
87
89
|
"@storybook/mdx2-csf": "^0.0.3",
|
|
@@ -102,7 +104,7 @@
|
|
|
102
104
|
"publishConfig": {
|
|
103
105
|
"access": "public"
|
|
104
106
|
},
|
|
105
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "688d338903e84a7e83cb104472e868e734399f65",
|
|
106
108
|
"storybook": {
|
|
107
109
|
"displayName": "Docs",
|
|
108
110
|
"icon": "https://user-images.githubusercontent.com/263385/101991672-48355c80-3c7c-11eb-82d9-95fa12438f64.png",
|