@rspress/plugin-playground 2.0.0-beta.30 → 2.0.0-beta.32

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
@@ -8,9 +8,6 @@ import { visit as external_unist_util_visit_visit } from "unist-util-visit";
8
8
  import napi from "@oxidation-compiler/napi";
9
9
  const DEFAULT_BABEL_URL = 'https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/7.22.20/babel.min.js';
10
10
  const DEFAULT_MONACO_URL = 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.43.0/min/vs';
11
- function normalizeUrl(u) {
12
- return u.replace(/\/\//g, '/');
13
- }
14
11
  const parseImports = (code, sourceExt)=>{
15
12
  const parsed = napi.parseSync(code, {
16
13
  sourceType: 'module',
@@ -95,9 +92,9 @@ function pluginPlayground(options) {
95
92
  const getRouteMeta = ()=>cli_routeMeta;
96
93
  if (render && !/Playground\.(jsx?|tsx?)$/.test(render)) throw new Error('[Playground]: render should ends with Playground.(jsx?|tsx?)');
97
94
  const preloads = [];
98
- const monacoPrefix = monacoLoader.paths?.vs || DEFAULT_MONACO_URL;
99
- preloads.push(normalizeUrl(`${monacoPrefix}/loader.js`));
100
- preloads.push(normalizeUrl(`${monacoPrefix}/editor/editor.main.js`));
95
+ const monacoPrefix = (monacoLoader.paths?.vs || DEFAULT_MONACO_URL).replace(/\/+$/, '');
96
+ preloads.push(`${monacoPrefix}/loader.js`);
97
+ preloads.push(`${monacoPrefix}/editor/editor.main.js`);
101
98
  return {
102
99
  name: '@rspress/plugin-playground',
103
100
  config (config, { removePlugin }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/plugin-playground",
3
- "version": "2.0.0-beta.30",
3
+ "version": "2.0.0-beta.32",
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": {
@@ -35,7 +35,7 @@
35
35
  "unist-util-visit": "^5.0.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@babel/types": "^7.28.2",
38
+ "@babel/types": "^7.28.4",
39
39
  "@rsbuild/plugin-react": "~1.4.0",
40
40
  "@rslib/core": "0.12.4",
41
41
  "@types/babel__core": "^7.20.5",
@@ -52,10 +52,10 @@
52
52
  "rsbuild-plugin-publint": "^0.3.3",
53
53
  "typescript": "^5.8.2",
54
54
  "unified": "^11.0.5",
55
- "@rspress/plugin-playground": "2.0.0-beta.30"
55
+ "@rspress/plugin-playground": "2.0.0-beta.32"
56
56
  },
57
57
  "peerDependencies": {
58
- "@rspress/core": "^2.0.0-beta.30",
58
+ "@rspress/core": "^2.0.0-beta.32",
59
59
  "react": ">=18.0.0",
60
60
  "react-router-dom": "^6.8.1"
61
61
  },