@rspress/plugin-playground 2.0.22 → 2.1.0-beta.1

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/dist/cli/index.js CHANGED
@@ -23,8 +23,8 @@ const parseImports = (code, sourceExt)=>{
23
23
  const getNodeMeta = (node, metaName)=>{
24
24
  if (!node.meta) return;
25
25
  const meta = node.meta.split(' ');
26
- const item = meta.find((x)=>x.startsWith(metaName));
27
- if (item?.startsWith(`${metaName}=`)) return item.slice(metaName.length + 1).replace(/'"`/g, '');
26
+ const item = meta.find((x)=>x === metaName || x.startsWith(`${metaName}=`));
27
+ if (item?.startsWith(`${metaName}=`)) return item.slice(metaName.length + 1).replace(/['"`]/g, '');
28
28
  return item;
29
29
  };
30
30
  function createPlaygroundNode(currentNode, attrs) {
package/dist/web/index.js CHANGED
@@ -127,13 +127,13 @@ async function loadUmdBabelModule() {
127
127
  const data = await fetch(__PLAYGROUND_BABEL_URL__);
128
128
  const umdSourceCode = await data.text();
129
129
  const run = new Function('exports', 'module', 'require', `with(exports, module, require) {${umdSourceCode}}`);
130
- const __nested_rspack_exports__ = {};
130
+ const exports = {};
131
131
  const module = {
132
- exports: __nested_rspack_exports__
132
+ exports
133
133
  };
134
134
  const require = ()=>{};
135
- run(__nested_rspack_exports__, module, require);
136
- return __nested_rspack_exports__;
135
+ run(exports, module, require);
136
+ return exports;
137
137
  }
138
138
  let loadBabelPromise = null;
139
139
  async function getBabel() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/plugin-playground",
3
- "version": "2.0.22",
3
+ "version": "2.1.0-beta.1",
4
4
  "description": "A plugin for rspress to preview the code block in markdown/mdx file.",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -36,7 +36,8 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@babel/types": "^7.29.8",
39
- "@rsbuild/plugin-react": "~2.1.0",
39
+ "@rsbuild/plugin-react": "~2.1.1",
40
+ "@rspress/plugin-playground": "2.1.0-beta.1",
40
41
  "@types/babel__core": "^7.20.5",
41
42
  "@types/babel__standalone": "^7.1.9",
42
43
  "@types/babel__traverse": "^7.28.0",
@@ -49,11 +50,10 @@
49
50
  "react-dom": "^19.2.8",
50
51
  "rsbuild-plugin-publint": "^1.0.0",
51
52
  "typescript": "^6.0.3",
52
- "unified": "^11.0.5",
53
- "@rspress/plugin-playground": "2.0.22"
53
+ "unified": "^11.0.5"
54
54
  },
55
55
  "peerDependencies": {
56
- "@rspress/core": "^2.0.10",
56
+ "@rspress/core": "^2.1.0-beta.1",
57
57
  "react": ">=18.0.0",
58
58
  "react-dom": ">=18.0.0"
59
59
  },