@valaxyjs/devtools 0.23.3 → 0.23.4

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.
@@ -1,4 +1,4 @@
1
- import { _ as _export_sfc, c as createElementBlock, o as openBlock } from './index-BJpUDkpC.js';
1
+ import { _ as _export_sfc, a as createElementBlock, o as openBlock } from './index-CzS8OdaC.js';
2
2
 
3
3
  /* unplugin-vue-components disabled */const _sfc_main = { };
4
4
 
@@ -9,7 +9,9 @@ const resource = {
9
9
  "save_frontmatter": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"保存 Frontmatter"}}
10
10
  },
11
11
  "pageData": {
12
- "path": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"路径"}}
12
+ "path": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"路径"}},
13
+ "filePath": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"文件路径"}},
14
+ "routePath": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"路由路径"}}
13
15
  },
14
16
  "frontmatter": {
15
17
  "title": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"标题"}},
@@ -16,8 +16,8 @@
16
16
  document.documentElement.classList.toggle('dark', true)
17
17
  })()
18
18
  </script>
19
- <script type="module" crossorigin src="./assets/index-BJpUDkpC.js"></script>
20
- <link rel="stylesheet" crossorigin href="./assets/index-Bu5CF1lM.css">
19
+ <script type="module" crossorigin src="./assets/index-CzS8OdaC.js"></script>
20
+ <link rel="stylesheet" crossorigin href="./assets/index-CJU8Ji_S.css">
21
21
  </head>
22
22
 
23
23
  <body data-vite-inspect-mode="DEV">
package/dist/index.mjs CHANGED
@@ -81,10 +81,16 @@ function registerApi(server, _viteConfig) {
81
81
  });
82
82
  }
83
83
 
84
+ function ensurePrefix(prefix, str) {
85
+ if (!str.startsWith(prefix))
86
+ return prefix + str;
87
+ return str;
88
+ }
84
89
  function getFunctions(server, devtoolsOptions) {
85
90
  const userRoot = devtoolsOptions.userRoot || process.cwd();
86
91
  function getRoutePath(filePath) {
87
- return path.relative(path.resolve(userRoot, "pages"), filePath).slice(0, -".md".length);
92
+ const relativePath = path.relative(path.resolve(userRoot, "pages"), filePath).slice(0, -".md".length);
93
+ return ensurePrefix("/", relativePath);
88
94
  }
89
95
  return {
90
96
  async getOptions() {
@@ -99,9 +105,9 @@ function getFunctions(server, devtoolsOptions) {
99
105
  const md = await fs.readFile(file, "utf-8");
100
106
  const { data } = matter(md);
101
107
  posts.push({
108
+ routePath: getRoutePath(file),
102
109
  frontmatter: data,
103
- filePath: file,
104
- routePath: path.relative(path.resolve(userRoot, "pages"), file).slice(0, -".md".length)
110
+ filePath: file
105
111
  });
106
112
  }
107
113
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@valaxyjs/devtools",
3
3
  "type": "module",
4
- "version": "0.23.3",
4
+ "version": "0.23.4",
5
5
  "repository": {
6
6
  "url": "https://github.com/YunYouJun/valaxy"
7
7
  },
@@ -36,19 +36,19 @@
36
36
  "@advjs/gui": "0.0.7-beta.7",
37
37
  "@iconify-json/ri": "^1.2.5",
38
38
  "@intlify/unplugin-vue-i18n": "^6.0.8",
39
- "@primevue/themes": "^4.3.3",
39
+ "@primevue/themes": "^4.3.4",
40
40
  "@types/body-parser": "^1.19.5",
41
41
  "@types/splitpanes": "^2.2.6",
42
42
  "@types/wicg-file-system-access": "^2023.10.6",
43
43
  "gray-matter": "^4.0.3",
44
- "primevue": "^4.3.3",
45
- "splitpanes": "^4.0.3",
44
+ "primevue": "^4.3.4",
45
+ "splitpanes": "^4.0.4",
46
46
  "typescript": "^5.8.3",
47
47
  "unbuild": "^3.5.0",
48
48
  "unplugin-vue-router": "^0.12.0",
49
- "vite": "^6.3.3",
50
- "vue-i18n": "^11.1.3",
51
- "zod": "^3.24.3"
49
+ "vite": "^6.3.5",
50
+ "vue-i18n": "^11.1.4",
51
+ "zod": "^3.25.28"
52
52
  },
53
53
  "scripts": {
54
54
  "clean": "rimraf dist",