mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-31 05:03:21 +08:00
Merge pull request #14769 from storybookjs/14602-fix-doc-blocks-cjs
Addon-docs: Allow doc blocks to CJS imported
This commit is contained in:
commit
43fd239ce8
@ -24,9 +24,9 @@
|
||||
"url": "https://opencollective.com/storybook"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "dist/cjs/public_api.js",
|
||||
"module": "dist/esm/public_api.js",
|
||||
"types": "dist/ts3.9/public_api.d.ts",
|
||||
"main": "dist/cjs/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
"types": "dist/ts3.9/index.d.ts",
|
||||
"typesVersions": {
|
||||
"<3.8": {
|
||||
"*": [
|
||||
|
1
addons/docs/src/index.ts
Normal file
1
addons/docs/src/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './blocks';
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin component-args.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Button } from '@storybook/react/demo';
|
||||
import { Story, Meta } from '@storybook/addon-docs/blocks';
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin component-id.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Button } from '@storybook/react/demo';
|
||||
import { Story, Meta } from '@storybook/addon-docs/blocks';
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin csf-imports.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Story, Meta, Canvas } from '@storybook/addon-docs/blocks';
|
||||
import { Welcome, Button } from '@storybook/angular/demo';
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin decorators.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Button } from '@storybook/react/demo';
|
||||
import { Story, Meta } from '@storybook/addon-docs/blocks';
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin docs-only.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Meta } from '@storybook/addon-docs/blocks';
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin loaders.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Button } from '@storybook/react/demo';
|
||||
import { Story, Meta } from '@storybook/addon-docs/blocks';
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin meta-quotes-in-title.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Meta } from '@storybook/addon-docs/blocks';
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin non-story-exports.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Button } from '@storybook/react/demo';
|
||||
import { Story, Meta } from '@storybook/addon-docs/blocks';
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin parameters.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Button } from '@storybook/react/demo';
|
||||
import { Story, Meta } from '@storybook/addon-docs/blocks';
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin previews.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Button } from '@storybook/react/demo';
|
||||
import { Canvas, Story, Meta } from '@storybook/addon-docs/blocks';
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin story-args.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Button } from '@storybook/react/demo';
|
||||
import { Story, Meta } from '@storybook/addon-docs/blocks';
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin story-current.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Story } from '@storybook/addon-docs/blocks';
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin story-def-text-only.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Story, Meta } from '@storybook/addon-docs/blocks';
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin story-definitions.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Button } from '@storybook/react/demo';
|
||||
import { Story, Meta } from '@storybook/addon-docs/blocks';
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin story-function-var.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Meta, Story } from '@storybook/addon-docs/blocks';
|
||||
export const basicFn = () => <Button mdxType=\\"Button\\" />;
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin story-function.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
const makeShortcode = (name) =>
|
||||
function MDXDefaultShortcode(props) {
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin story-multiple-children.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Story, Meta } from '@storybook/addon-docs/blocks';
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin story-object.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Story, Meta } from '@storybook/addon-docs/blocks';
|
||||
import { Welcome, Button } from '@storybook/angular/demo';
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin story-references.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Story } from '@storybook/addon-docs/blocks';
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin title-template-string.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Meta, Story } from '@storybook/addon-docs/blocks';
|
||||
import { titleFunction } from '../title-generators';
|
||||
|
@ -3,7 +3,7 @@
|
||||
exports[`docs-mdx-compiler-plugin vanilla.mdx 1`] = `
|
||||
"/* @jsxRuntime classic */
|
||||
/* @jsx mdx */
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs/blocks';
|
||||
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
||||
|
||||
import { Button } from '@storybook/react/demo';
|
||||
|
||||
|
@ -459,7 +459,7 @@ function extractExports(root, options) {
|
||||
|
||||
const defaultJsx = mdxToJsx.toJSX(root, {}, { ...options, skipExport: true });
|
||||
const fullJsx = [
|
||||
'import { assertIsFn, AddContext } from "@storybook/addon-docs/blocks";',
|
||||
'import { assertIsFn, AddContext } from "@storybook/addon-docs";',
|
||||
defaultJsx,
|
||||
...storyExports,
|
||||
`const componentMeta = ${stringifyMeta(metaExport)};`,
|
||||
|
@ -1,2 +0,0 @@
|
||||
// make it work with --isolatedModules
|
||||
export default {};
|
Loading…
x
Reference in New Issue
Block a user