@storybook/docs-mdx
Advanced tools
Comparing version 0.0.1-canary.3.5adaa89.0 to 0.0.1-canary.3.c25ec0c.0
@@ -108,3 +108,3 @@ import * as t from '@babel/types'; | ||
} | ||
} else if (t.isJSXExpressionContainer(child) && t.isStringLiteral(child.expression)) {// Skip string literals | ||
} else if (t.isJSXExpressionContainer(child)) {// Skip string literals & other JSX expressions | ||
} else { | ||
@@ -111,0 +111,0 @@ throw new Error(`Unexpected JSX child: ${child.type}`); |
@@ -28,10 +28,8 @@ import { dedent } from 'ts-dedent'; | ||
expect(analyze(input)).toMatchInlineSnapshot(` | ||
Object { | ||
"imports": Array [], | ||
"isTemplate": false, | ||
"name": undefined, | ||
"of": undefined, | ||
"title": "foobar", | ||
} | ||
`); | ||
Object { | ||
"imports": Array [], | ||
"of": undefined, | ||
"title": "foobar", | ||
} | ||
`); | ||
}); | ||
@@ -185,6 +183,6 @@ it('template literal title', () => { | ||
const input = dedent` | ||
import * as ButtonStories from './Button.stories'; | ||
import meta, { Basic } from './Button.stories'; | ||
<Meta of={ButtonStories} />/> | ||
`; | ||
<Meta of={meta} />/> | ||
`; | ||
expect(analyze(input)).toMatchInlineSnapshot(` | ||
@@ -220,3 +218,21 @@ Object { | ||
}); | ||
it('MDX comments', () => { | ||
const input = dedent` | ||
import meta, { Basic } from './Button.stories'; | ||
<Meta of={meta} /> | ||
{/* whatever */} | ||
`; | ||
expect(analyze(input)).toMatchInlineSnapshot(` | ||
Object { | ||
"imports": Array [ | ||
"./Button.stories", | ||
], | ||
"of": "./Button.stories", | ||
"title": undefined, | ||
} | ||
`); | ||
}); | ||
}); | ||
}); |
{ | ||
"name": "@storybook/docs-mdx", | ||
"version": "0.0.1-canary.3.5adaa89.0", | ||
"version": "0.0.1-canary.3.c25ec0c.0", | ||
"description": "Storybook Docs MDX analyzer", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/storybookjs/docs2-mdx" | ||
"url": "https://github.com/storybookjs/docs-mdx" | ||
}, | ||
@@ -12,4 +12,3 @@ "author": "Michael Shilman <michael@lab80.co>", | ||
"type": "module", | ||
"main": "index.cjs", | ||
"module": "dist/esm/index.js", | ||
"main": "index", | ||
"types": "dist/ts/index.d.ts", | ||
@@ -21,2 +20,3 @@ "files": [ | ||
"*.d.ts", | ||
"index.mjs", | ||
"index.cjs" | ||
@@ -23,0 +23,0 @@ ], |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17215
11
433