@storybook/builder-vite 7.0.0-alpha.39 → 7.0.0-alpha.40

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.
@@ -67,11 +67,11 @@ function mdxPlugin(options) {
67
67
 
68
68
  const {
69
69
  compile
70
- } = features !== null && features !== void 0 && features.previewMdx2 ? await Promise.resolve().then(() => _interopRequireWildcard(require('@storybook/mdx2-csf'))) : await Promise.resolve().then(() => _interopRequireWildcard(require('@storybook/mdx1-csf')));
70
+ } = await Promise.resolve().then(() => _interopRequireWildcard(require('@storybook/mdx2-csf')));
71
71
  const mdxCode = String(await compile(src, {
72
72
  skipCsf: !isStorybookMdx(id)
73
73
  }));
74
- const modifiedCode = injectRenderer(mdxCode, Boolean(features === null || features === void 0 ? void 0 : features.previewMdx2)); // Hooks in recent rollup versions can be functions or objects, and though react hasn't changed, the typescript defs have
74
+ const modifiedCode = injectRenderer(mdxCode, true); // Hooks in recent rollup versions can be functions or objects, and though react hasn't changed, the typescript defs have
75
75
 
76
76
  const rTransform = (_reactRefresh = reactRefresh) === null || _reactRefresh === void 0 ? void 0 : _reactRefresh.transform;
77
77
  const transform = rTransform && 'handler' in rTransform ? rTransform.handler : rTransform; // It's safe to disable this, because we know it'll be there, since we added it ourselves.
@@ -54,11 +54,11 @@ export function mdxPlugin(options) {
54
54
 
55
55
  const {
56
56
  compile
57
- } = features?.previewMdx2 ? await import('@storybook/mdx2-csf') : await import('@storybook/mdx1-csf');
57
+ } = await import('@storybook/mdx2-csf');
58
58
  const mdxCode = String(await compile(src, {
59
59
  skipCsf: !isStorybookMdx(id)
60
60
  }));
61
- const modifiedCode = injectRenderer(mdxCode, Boolean(features?.previewMdx2)); // Hooks in recent rollup versions can be functions or objects, and though react hasn't changed, the typescript defs have
61
+ const modifiedCode = injectRenderer(mdxCode, true); // Hooks in recent rollup versions can be functions or objects, and though react hasn't changed, the typescript defs have
62
62
 
63
63
  const rTransform = reactRefresh?.transform;
64
64
  const transform = rTransform && 'handler' in rTransform ? rTransform.handler : rTransform; // It's safe to disable this, because we know it'll be there, since we added it ourselves.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/builder-vite",
3
- "version": "7.0.0-alpha.39",
3
+ "version": "7.0.0-alpha.40",
4
4
  "description": "A plugin to run and build Storybooks with Vite",
5
5
  "homepage": "https://github.com/storybookjs/storybook/tree/main/code/lib/builder-vite/#readme",
6
6
  "repository": {
@@ -19,13 +19,13 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@joshwooding/vite-plugin-react-docgen-typescript": "0.0.5",
22
- "@storybook/client-api": "7.0.0-alpha.39",
23
- "@storybook/client-logger": "7.0.0-alpha.39",
24
- "@storybook/core-common": "7.0.0-alpha.39",
25
- "@storybook/mdx1-csf": "0.0.5-canary.13.9ce928a.0",
26
- "@storybook/node-logger": "7.0.0-alpha.39",
27
- "@storybook/preview-web": "7.0.0-alpha.39",
28
- "@storybook/source-loader": "7.0.0-alpha.39",
22
+ "@storybook/client-api": "7.0.0-alpha.40",
23
+ "@storybook/client-logger": "7.0.0-alpha.40",
24
+ "@storybook/core-common": "7.0.0-alpha.40",
25
+ "@storybook/mdx2-csf": "0.1.0-next.0",
26
+ "@storybook/node-logger": "7.0.0-alpha.40",
27
+ "@storybook/preview-web": "7.0.0-alpha.40",
28
+ "@storybook/source-loader": "7.0.0-alpha.40",
29
29
  "@vitejs/plugin-react": "^2.0.0",
30
30
  "browser-assert": "^1.2.1",
31
31
  "es-module-lexer": "^0.9.3",
@@ -36,22 +36,13 @@
36
36
  "vite": "^3.1.3"
37
37
  },
38
38
  "devDependencies": {
39
- "@storybook/mdx2-csf": "^0.0.3",
40
39
  "@types/express": "^4.17.13",
41
40
  "@types/node": "^16.0.0",
42
41
  "typescript": "~4.6.3",
43
42
  "vite": "^3.1.3"
44
43
  },
45
- "peerDependencies": {
46
- "@storybook/mdx2-csf": "^0.0.3"
47
- },
48
- "peerDependenciesMeta": {
49
- "@storybook/mdx2-csf": {
50
- "optional": true
51
- }
52
- },
53
44
  "publishConfig": {
54
45
  "access": "public"
55
46
  },
56
- "gitHead": "47386bd49d141ea70daac41ab3e4d52749fc5da9"
47
+ "gitHead": "8f6d8629f1ad7e776c39e2c7621f4a0d538aa93c"
57
48
  }
@@ -56,13 +56,11 @@ export function mdxPlugin(options: Options): Plugin {
56
56
  if (!filter(id)) return undefined;
57
57
 
58
58
  // @ts-expect-error typescript doesn't think compile exists, but it does.
59
- const { compile } = features?.previewMdx2
60
- ? await import('@storybook/mdx2-csf')
61
- : await import('@storybook/mdx1-csf');
59
+ const { compile } = await import('@storybook/mdx2-csf');
62
60
 
63
61
  const mdxCode = String(await compile(src, { skipCsf: !isStorybookMdx(id) }));
64
62
 
65
- const modifiedCode = injectRenderer(mdxCode, Boolean(features?.previewMdx2));
63
+ const modifiedCode = injectRenderer(mdxCode, true);
66
64
 
67
65
  // Hooks in recent rollup versions can be functions or objects, and though react hasn't changed, the typescript defs have
68
66
  const rTransform = reactRefresh?.transform;