From 68c4a945026a22efb846532a389536a77be49257 Mon Sep 17 00:00:00 2001 From: cpojer Date: Mon, 6 Nov 2023 09:30:51 +0900 Subject: [PATCH] 0.8.0. --- examples/tokyo/package.json | 2 +- package.json | 2 +- packages/create-remdx/package.json | 2 +- packages/remdx/package.json | 2 +- .../__tests__/plugin.test.ts | 60 ++++++++++--------- packages/vite-plugin-remdx/index.ts | 1 - packages/vite-plugin-remdx/package.json | 2 +- 7 files changed, 37 insertions(+), 34 deletions(-) diff --git a/examples/tokyo/package.json b/examples/tokyo/package.json index 35d2c77..5db9108 100644 --- a/examples/tokyo/package.json +++ b/examples/tokyo/package.json @@ -1,7 +1,7 @@ { "name": "@nkzw/remdx-tokyo-example", "description": "Beautiful Minimalist React & MDX Presentations", - "version": "0.7.0", + "version": "0.8.0", "author": "Christoph Nakazawa ", "private": true, "repository": { diff --git a/package.json b/package.json index 44ddddb..51057f1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nkzw/remdx-private", - "version": "0.7.0", + "version": "0.8.0", "author": "Christoph Nakazawa ", "private": true, "repository": { diff --git a/packages/create-remdx/package.json b/packages/create-remdx/package.json index 898d9a1..f814c76 100644 --- a/packages/create-remdx/package.json +++ b/packages/create-remdx/package.json @@ -1,7 +1,7 @@ { "name": "create-remdx", "description": "Beautiful Minimalist React & MDX Presentations", - "version": "0.7.0", + "version": "0.8.0", "author": "Christoph Nakazawa ", "repository": { "type": "git", diff --git a/packages/remdx/package.json b/packages/remdx/package.json index abda01c..7819aec 100644 --- a/packages/remdx/package.json +++ b/packages/remdx/package.json @@ -1,7 +1,7 @@ { "name": "@nkzw/remdx", "description": "Beautiful Minimalist React & MDX Presentations", - "version": "0.7.0", + "version": "0.8.0", "author": "Christoph Nakazawa ", "repository": { "type": "git", diff --git a/packages/vite-plugin-remdx/__tests__/plugin.test.ts b/packages/vite-plugin-remdx/__tests__/plugin.test.ts index e5fdf6f..fa7ceeb 100644 --- a/packages/vite-plugin-remdx/__tests__/plugin.test.ts +++ b/packages/vite-plugin-remdx/__tests__/plugin.test.ts @@ -37,15 +37,12 @@ theme: dark export default [(() => { function MDXContentWrapper(props) { - /*@jsxRuntime automatic @jsxImportSource react*/ - - - - - function _createMdxContent(props) { - const _components = Object.assign({ - h1: \\"h1\\" - }, _provideComponents(), props.components); + function _createMdxContent(props) { + const _components = { + h1: \\"h1\\", + ..._provideComponents(), + ...props.components + }; return _jsxDEV(_components.h1, { children: \\"Slide 1\\" }, undefined, false, { @@ -55,16 +52,21 @@ theme: dark }, this); } function MDXContent(props = {}) { - const {wrapper: MDXLayout} = Object.assign({}, _provideComponents(), props.components); - return MDXLayout ? _jsxDEV(MDXLayout, Object.assign({}, props, { - children: _jsxDEV(_createMdxContent, props, undefined, false, { + const {wrapper: MDXLayout} = { + ..._provideComponents(), + ...props.components + }; + return MDXLayout ? _jsxDEV(MDXLayout, { + ...props, + children: _jsxDEV(_createMdxContent, { + ...props + }, undefined, false, { fileName: \\"\\" }, this) - }), undefined, false, { + }, undefined, false, { fileName: \\"\\" }, this) : _createMdxContent(props); } - MDXContent; return _jsxDEV(MDXContent, props); }; MDXContentWrapper.isMDXComponent = true; @@ -72,15 +74,12 @@ theme: dark })(), (() => { function MDXContentWrapper(props) { - /*@jsxRuntime automatic @jsxImportSource react*/ - - - - - function _createMdxContent(props) { - const _components = Object.assign({ - h1: \\"h1\\" - }, _provideComponents(), props.components); + function _createMdxContent(props) { + const _components = { + h1: \\"h1\\", + ..._provideComponents(), + ...props.components + }; return _jsxDEV(_components.h1, { children: \\"Slide 2\\" }, undefined, false, { @@ -90,16 +89,21 @@ theme: dark }, this); } function MDXContent(props = {}) { - const {wrapper: MDXLayout} = Object.assign({}, _provideComponents(), props.components); - return MDXLayout ? _jsxDEV(MDXLayout, Object.assign({}, props, { - children: _jsxDEV(_createMdxContent, props, undefined, false, { + const {wrapper: MDXLayout} = { + ..._provideComponents(), + ...props.components + }; + return MDXLayout ? _jsxDEV(MDXLayout, { + ...props, + children: _jsxDEV(_createMdxContent, { + ...props + }, undefined, false, { fileName: \\"\\" }, this) - }), undefined, false, { + }, undefined, false, { fileName: \\"\\" }, this) : _createMdxContent(props); } - MDXContent; return _jsxDEV(MDXContent, props); }; MDXContentWrapper.isMDXComponent = true; diff --git a/packages/vite-plugin-remdx/index.ts b/packages/vite-plugin-remdx/index.ts index 3fece30..80928d1 100644 --- a/packages/vite-plugin-remdx/index.ts +++ b/packages/vite-plugin-remdx/index.ts @@ -167,7 +167,6 @@ export default function remdx(): Plugin { } return await transform(code, { - // @ts-expect-error rehypePlugins: [[rehypeRaw, { passThrough: nodeTypes }]], // @ts-expect-error remarkPlugins: [[shikiTwoslashFn, shikiOptions]], diff --git a/packages/vite-plugin-remdx/package.json b/packages/vite-plugin-remdx/package.json index 1bd0657..1a1b52d 100644 --- a/packages/vite-plugin-remdx/package.json +++ b/packages/vite-plugin-remdx/package.json @@ -1,7 +1,7 @@ { "name": "@nkzw/vite-plugin-remdx", "description": "Beautiful Minimalist React & MDX Presentations", - "version": "0.7.0", + "version": "0.8.0", "author": "Christoph Nakazawa ", "repository": { "type": "git",