@rspress/plugin-playground 1.40.3-cannary-20250126 → 1.41.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/cjs/301.js +1 -3
- package/dist/cli/cjs/index.js +7 -11
- package/dist/cli/esm/301.mjs +1 -3
- package/dist/cli/esm/index.mjs +6 -7
- package/package.json +6 -6
package/dist/cli/cjs/301.js
CHANGED
|
@@ -5,9 +5,7 @@ exports.ids = [
|
|
|
5
5
|
exports.modules = {
|
|
6
6
|
"../../node_modules/.pnpm/unist-util-visit@4.1.2/node_modules/unist-util-visit/index.js": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
7
7
|
__webpack_require__.d(__webpack_exports__, {
|
|
8
|
-
visit:
|
|
9
|
-
return _lib_index_js__WEBPACK_IMPORTED_MODULE_0__.Vn;
|
|
10
|
-
}
|
|
8
|
+
visit: ()=>_lib_index_js__WEBPACK_IMPORTED_MODULE_0__.Vn
|
|
11
9
|
});
|
|
12
10
|
var _lib_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../node_modules/.pnpm/unist-util-visit@4.1.2/node_modules/unist-util-visit/lib/index.js");
|
|
13
11
|
}
|
package/dist/cli/cjs/index.js
CHANGED
|
@@ -3,9 +3,6 @@ var __webpack_modules__ = {
|
|
|
3
3
|
"@mdx-js/mdx": function(module) {
|
|
4
4
|
module.exports = import("@mdx-js/mdx");
|
|
5
5
|
},
|
|
6
|
-
"@rspress/shared/fs-extra": function(module) {
|
|
7
|
-
module.exports = import("@rspress/shared/fs-extra");
|
|
8
|
-
},
|
|
9
6
|
"remark-gfm": function(module) {
|
|
10
7
|
module.exports = import("remark-gfm");
|
|
11
8
|
},
|
|
@@ -206,6 +203,8 @@ var __webpack_exports__ = {};
|
|
|
206
203
|
pluginPlayground: ()=>pluginPlayground,
|
|
207
204
|
routeMeta: ()=>cli_rslib_entry_routeMeta
|
|
208
205
|
});
|
|
206
|
+
const external_node_fs_namespaceObject = require("node:fs");
|
|
207
|
+
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
209
208
|
const external_node_path_namespaceObject = require("node:path");
|
|
210
209
|
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
211
210
|
const DEFAULT_BABEL_URL = 'https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/7.22.20/babel.min.js';
|
|
@@ -215,8 +214,6 @@ var __webpack_exports__ = {};
|
|
|
215
214
|
}
|
|
216
215
|
const external_rspack_plugin_virtual_module_namespaceObject = require("rspack-plugin-virtual-module");
|
|
217
216
|
const staticPath = external_node_path_default().join(__dirname, '../../../static');
|
|
218
|
-
const fs_extra_namespaceObject = require("@rspress/shared/fs-extra");
|
|
219
|
-
var fs_extra_default = /*#__PURE__*/ __webpack_require__.n(fs_extra_namespaceObject);
|
|
220
217
|
var lib = __webpack_require__("../../node_modules/.pnpm/unist-util-visit@4.1.2/node_modules/unist-util-visit/lib/index.js");
|
|
221
218
|
const napi_namespaceObject = require("@oxidation-compiler/napi");
|
|
222
219
|
var napi_default = /*#__PURE__*/ __webpack_require__.n(napi_namespaceObject);
|
|
@@ -264,9 +261,9 @@ var __webpack_exports__ = {};
|
|
|
264
261
|
const src = getNodeAttribute(node, 'src');
|
|
265
262
|
if (!src) return;
|
|
266
263
|
const demoPath = (0, external_node_path_namespaceObject.join)((0, external_node_path_namespaceObject.dirname)(route.absolutePath), src);
|
|
267
|
-
if (!
|
|
264
|
+
if (!external_node_fs_default().existsSync(demoPath)) return;
|
|
268
265
|
const direction = getNodeAttribute(node, 'direction') || '';
|
|
269
|
-
const code =
|
|
266
|
+
const code = external_node_fs_default().readFileSync(demoPath, {
|
|
270
267
|
encoding: 'utf8'
|
|
271
268
|
});
|
|
272
269
|
const language = src.substr(src.lastIndexOf('.') + 1);
|
|
@@ -350,7 +347,6 @@ var __webpack_exports__ = {};
|
|
|
350
347
|
return config;
|
|
351
348
|
},
|
|
352
349
|
async routeGenerated (routes) {
|
|
353
|
-
const { default: fs } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "@rspress/shared/fs-extra"));
|
|
354
350
|
cli_rslib_entry_routeMeta = routes;
|
|
355
351
|
const files = routes.map((route)=>route.absolutePath);
|
|
356
352
|
const imports = {};
|
|
@@ -367,15 +363,15 @@ var __webpack_exports__ = {};
|
|
|
367
363
|
remarkGFM
|
|
368
364
|
]
|
|
369
365
|
});
|
|
370
|
-
const source = await
|
|
366
|
+
const source = await external_node_fs_default().promises.readFile(filepath, 'utf-8');
|
|
371
367
|
const ast = processor.parse(source);
|
|
372
368
|
visit(ast, 'mdxJsxFlowElement', (node)=>{
|
|
373
369
|
if ('code' === node.name) {
|
|
374
370
|
const src = getNodeAttribute(node, 'src');
|
|
375
371
|
if (!src) return;
|
|
376
372
|
const demoPath = (0, external_node_path_namespaceObject.join)(external_node_path_default().dirname(filepath), src);
|
|
377
|
-
if (!
|
|
378
|
-
const code =
|
|
373
|
+
if (!external_node_fs_default().existsSync(demoPath)) return;
|
|
374
|
+
const code = external_node_fs_default().readFileSync(demoPath, {
|
|
379
375
|
encoding: 'utf8'
|
|
380
376
|
});
|
|
381
377
|
const thisImports = parseImports(code, external_node_path_default().extname(demoPath));
|
package/dist/cli/esm/301.mjs
CHANGED
|
@@ -4,9 +4,7 @@ export const ids = [
|
|
|
4
4
|
export const modules = {
|
|
5
5
|
"../../node_modules/.pnpm/unist-util-visit@4.1.2/node_modules/unist-util-visit/index.js": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
6
6
|
__webpack_require__.d(__webpack_exports__, {
|
|
7
|
-
visit:
|
|
8
|
-
return _lib_index_js__WEBPACK_IMPORTED_MODULE_0__.Vn;
|
|
9
|
-
}
|
|
7
|
+
visit: ()=>_lib_index_js__WEBPACK_IMPORTED_MODULE_0__.Vn
|
|
10
8
|
});
|
|
11
9
|
var _lib_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../node_modules/.pnpm/unist-util-visit@4.1.2/node_modules/unist-util-visit/lib/index.js");
|
|
12
10
|
}
|
package/dist/cli/esm/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
|
|
1
2
|
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
2
3
|
import * as __WEBPACK_EXTERNAL_MODULE_rspack_plugin_virtual_module_609978fd__ from "rspack-plugin-virtual-module";
|
|
3
|
-
import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_fs_extra_006a0330__ from "@rspress/shared/fs-extra";
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE__oxidation_compiler_napi_5e24345a__ from "@oxidation-compiler/napi";
|
|
5
5
|
var __webpack_modules__ = {
|
|
6
6
|
"../../node_modules/.pnpm/unist-util-visit@4.1.2/node_modules/unist-util-visit/lib/index.js": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
@@ -246,9 +246,9 @@ const remarkPlugin = ({ getRouteMeta, editorPosition, defaultRenderMode })=>{
|
|
|
246
246
|
const src = getNodeAttribute(node, 'src');
|
|
247
247
|
if (!src) return;
|
|
248
248
|
const demoPath = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)((0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.dirname)(route.absolutePath), src);
|
|
249
|
-
if (!
|
|
249
|
+
if (!__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].existsSync(demoPath)) return;
|
|
250
250
|
const direction = getNodeAttribute(node, 'direction') || '';
|
|
251
|
-
const code =
|
|
251
|
+
const code = __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].readFileSync(demoPath, {
|
|
252
252
|
encoding: 'utf8'
|
|
253
253
|
});
|
|
254
254
|
const language = src.substr(src.lastIndexOf('.') + 1);
|
|
@@ -332,7 +332,6 @@ function pluginPlayground(options) {
|
|
|
332
332
|
return config;
|
|
333
333
|
},
|
|
334
334
|
async routeGenerated (routes) {
|
|
335
|
-
const { default: fs } = await import("@rspress/shared/fs-extra");
|
|
336
335
|
cli_rslib_entry_routeMeta = routes;
|
|
337
336
|
const files = routes.map((route)=>route.absolutePath);
|
|
338
337
|
const imports = {};
|
|
@@ -349,15 +348,15 @@ function pluginPlayground(options) {
|
|
|
349
348
|
remarkGFM
|
|
350
349
|
]
|
|
351
350
|
});
|
|
352
|
-
const source = await
|
|
351
|
+
const source = await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].promises.readFile(filepath, 'utf-8');
|
|
353
352
|
const ast = processor.parse(source);
|
|
354
353
|
visit(ast, 'mdxJsxFlowElement', (node)=>{
|
|
355
354
|
if ('code' === node.name) {
|
|
356
355
|
const src = getNodeAttribute(node, 'src');
|
|
357
356
|
if (!src) return;
|
|
358
357
|
const demoPath = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname(filepath), src);
|
|
359
|
-
if (!
|
|
360
|
-
const code =
|
|
358
|
+
if (!__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].existsSync(demoPath)) return;
|
|
359
|
+
const code = __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].readFileSync(demoPath, {
|
|
361
360
|
encoding: 'utf8'
|
|
362
361
|
});
|
|
363
362
|
const thisImports = parseImports(code, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].extname(demoPath));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/plugin-playground",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.41.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": {
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"@oxidation-compiler/napi": "^0.2.0",
|
|
35
35
|
"remark-gfm": "3.0.1",
|
|
36
36
|
"rspack-plugin-virtual-module": "0.1.13",
|
|
37
|
-
"@rspress/shared": "1.
|
|
37
|
+
"@rspress/shared": "1.41.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@babel/types": "^7.26.
|
|
41
|
-
"@rslib/core": "0.
|
|
40
|
+
"@babel/types": "^7.26.7",
|
|
41
|
+
"@rslib/core": "0.4.0",
|
|
42
42
|
"@types/babel__core": "^7.20.5",
|
|
43
43
|
"@types/babel__standalone": "^7.1.9",
|
|
44
44
|
"@types/babel__traverse": "^7.20.6",
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
"@types/react-dom": "^18.3.5",
|
|
49
49
|
"react": "^18.3.1",
|
|
50
50
|
"react-dom": "^18.3.1",
|
|
51
|
-
"react-router-dom": "^6.
|
|
51
|
+
"react-router-dom": "^6.29.0",
|
|
52
52
|
"typescript": "^5.5.3",
|
|
53
53
|
"unified": "^10.1.2",
|
|
54
54
|
"unist-util-visit": "^4.1.2"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@rspress/core": "^1.
|
|
57
|
+
"@rspress/core": "^1.41.1",
|
|
58
58
|
"react": ">=17.0.0",
|
|
59
59
|
"react-router-dom": "^6.8.1"
|
|
60
60
|
},
|