@rspress/plugin-playground 2.0.15 → 2.0.17
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 +8 -4
- package/package.json +4 -4
package/dist/cli/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { visit as external_unist_util_visit_visit } from "unist-util-visit";
|
|
|
6
6
|
import napi from "@oxidation-compiler/napi";
|
|
7
7
|
import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
|
|
8
8
|
import { dirname as __rspack_dirname } from "node:path";
|
|
9
|
+
var __rspack_import_meta_dirname__ = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
|
|
9
10
|
const DEFAULT_BABEL_URL = 'https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/7.22.20/babel.min.js';
|
|
10
11
|
const DEFAULT_MONACO_URL = 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.43.0/min/vs';
|
|
11
12
|
const parseImports = (code, sourceExt)=>{
|
|
@@ -82,8 +83,7 @@ const remarkPlugin = ({ getRouteMeta, editorPosition, defaultRenderMode })=>{
|
|
|
82
83
|
});
|
|
83
84
|
};
|
|
84
85
|
};
|
|
85
|
-
|
|
86
|
-
const pkgRootPath = node_path.join(cli_dirname, '../../');
|
|
86
|
+
const pkgRootPath = node_path.join(__rspack_import_meta_dirname__, '../../');
|
|
87
87
|
const staticPath = node_path.join(pkgRootPath, 'static');
|
|
88
88
|
let cli_routeMeta;
|
|
89
89
|
function pluginPlayground(options) {
|
|
@@ -159,8 +159,12 @@ function pluginPlayground(options) {
|
|
|
159
159
|
}
|
|
160
160
|
});
|
|
161
161
|
} catch (e) {
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
const message = `[Playground]: Failed to parse ${filepath}.`;
|
|
163
|
+
if (e instanceof Error) {
|
|
164
|
+
e.message = `${message}\n${e.message}`;
|
|
165
|
+
throw e;
|
|
166
|
+
}
|
|
167
|
+
throw new Error(`${message}\n${String(e)}`);
|
|
164
168
|
}
|
|
165
169
|
}));
|
|
166
170
|
if (include) include.forEach((item)=>{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/plugin-playground",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.17",
|
|
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,8 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@babel/types": "^7.29.7",
|
|
39
|
-
"@rsbuild/plugin-react": "~2.0
|
|
40
|
-
"@rslib/core": "0.23.
|
|
39
|
+
"@rsbuild/plugin-react": "~2.1.0",
|
|
40
|
+
"@rslib/core": "0.23.2",
|
|
41
41
|
"@types/babel__core": "^7.20.5",
|
|
42
42
|
"@types/babel__standalone": "^7.1.9",
|
|
43
43
|
"@types/babel__traverse": "^7.28.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"rsbuild-plugin-publint": "^1.0.0",
|
|
52
52
|
"typescript": "^6.0.3",
|
|
53
53
|
"unified": "^11.0.5",
|
|
54
|
-
"@rspress/plugin-playground": "2.0.
|
|
54
|
+
"@rspress/plugin-playground": "2.0.17"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@rspress/core": "^2.0.10",
|