@valaxyjs/devtools 0.19.5 → 0.19.6

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,5 +1,5 @@
1
1
  import { _ as _export_sfc } from './_plugin-vue_export-helper-DgDhiqFL.js';
2
- import { o as openBlock, a as createElementBlock } from './index-DUxi88Gt.js';
2
+ import { o as openBlock, a as createElementBlock } from './index-CPK49_y2.js';
3
3
 
4
4
  /* unplugin-vue-components disabled */const _sfc_main = {};
5
5
 
@@ -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-DUxi88Gt.js"></script>
20
- <link rel="stylesheet" crossorigin href="./assets/index-CIq_dmzy.css">
19
+ <script type="module" crossorigin src="./assets/index-CPK49_y2.js"></script>
20
+ <link rel="stylesheet" crossorigin href="./assets/index-DzN-2s1X.css">
21
21
  </head>
22
22
 
23
23
  <body data-vite-inspect-mode="DEV">
package/dist/index.cjs CHANGED
@@ -7,6 +7,7 @@ const node_path = require('node:path');
7
7
  const node_url = require('node:url');
8
8
  const bodyParser = require('body-parser');
9
9
  const matter = require('gray-matter');
10
+ const jsYaml = require('js-yaml');
10
11
  const fs = require('fs-extra');
11
12
 
12
13
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
@@ -23,6 +24,24 @@ const DEVTOOLS_CLIENT_FOLDER = node_path.resolve(DIR_DIST, "../dist/client");
23
24
  const DIR_CLIENT = DEVTOOLS_CLIENT_FOLDER;
24
25
 
25
26
  const prefix = "/valaxy-devtools-api";
27
+ async function migration(path, frontmatter) {
28
+ if (fs__default.existsSync(path)) {
29
+ const rawMd = await fs__default.readFile(path, "utf-8");
30
+ const matterFile = matter__default(rawMd, { schema: jsYaml.JSON_SCHEMA });
31
+ let mod = false;
32
+ for (const key in frontmatter) {
33
+ if (key in matterFile.data) {
34
+ matterFile.data[frontmatter[key]] = matterFile.data[key];
35
+ delete matterFile.data[key];
36
+ mod = true;
37
+ }
38
+ }
39
+ if (mod) {
40
+ const newMd = matter__default.stringify(matterFile.content, matterFile.data);
41
+ await fs__default.writeFile(path, newMd);
42
+ }
43
+ }
44
+ }
26
45
  function registerApi(server, _viteConfig) {
27
46
  const app = server.middlewares;
28
47
  app.use(bodyParser__default.json());
@@ -39,6 +58,21 @@ function registerApi(server, _viteConfig) {
39
58
  }
40
59
  }
41
60
  });
61
+ app.use(`${prefix}/migration`, async (req, _res) => {
62
+ if (req.method === "POST") {
63
+ const { pageData, frontmatter } = await req.body;
64
+ const worker = [];
65
+ for (const item of pageData) {
66
+ const path = item;
67
+ worker.push(migration(path, frontmatter));
68
+ }
69
+ Promise.all(worker).then(() => {
70
+ _res.end("ok");
71
+ }).catch((_) => {
72
+ _res.end("migration error");
73
+ });
74
+ }
75
+ });
42
76
  }
43
77
 
44
78
  const NAME = "valaxy:devtools";
package/dist/index.d.cts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Plugin } from 'vite';
2
2
 
3
3
  interface ValaxyDevtoolsOptions {
4
+ userRoot?: string;
4
5
  base?: string;
5
6
  }
6
7
 
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Plugin } from 'vite';
2
2
 
3
3
  interface ValaxyDevtoolsOptions {
4
+ userRoot?: string;
4
5
  base?: string;
5
6
  }
6
7
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Plugin } from 'vite';
2
2
 
3
3
  interface ValaxyDevtoolsOptions {
4
+ userRoot?: string;
4
5
  base?: string;
5
6
  }
6
7
 
package/dist/index.mjs CHANGED
@@ -5,6 +5,7 @@ import { dirname, resolve } from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  import bodyParser from 'body-parser';
7
7
  import matter from 'gray-matter';
8
+ import { JSON_SCHEMA } from 'js-yaml';
8
9
  import fs from 'fs-extra';
9
10
 
10
11
  const DIR_DIST = typeof __dirname !== "undefined" ? __dirname : dirname(fileURLToPath(import.meta.url));
@@ -12,6 +13,24 @@ const DEVTOOLS_CLIENT_FOLDER = resolve(DIR_DIST, "../dist/client");
12
13
  const DIR_CLIENT = DEVTOOLS_CLIENT_FOLDER;
13
14
 
14
15
  const prefix = "/valaxy-devtools-api";
16
+ async function migration(path, frontmatter) {
17
+ if (fs.existsSync(path)) {
18
+ const rawMd = await fs.readFile(path, "utf-8");
19
+ const matterFile = matter(rawMd, { schema: JSON_SCHEMA });
20
+ let mod = false;
21
+ for (const key in frontmatter) {
22
+ if (key in matterFile.data) {
23
+ matterFile.data[frontmatter[key]] = matterFile.data[key];
24
+ delete matterFile.data[key];
25
+ mod = true;
26
+ }
27
+ }
28
+ if (mod) {
29
+ const newMd = matter.stringify(matterFile.content, matterFile.data);
30
+ await fs.writeFile(path, newMd);
31
+ }
32
+ }
33
+ }
15
34
  function registerApi(server, _viteConfig) {
16
35
  const app = server.middlewares;
17
36
  app.use(bodyParser.json());
@@ -28,6 +47,21 @@ function registerApi(server, _viteConfig) {
28
47
  }
29
48
  }
30
49
  });
50
+ app.use(`${prefix}/migration`, async (req, _res) => {
51
+ if (req.method === "POST") {
52
+ const { pageData, frontmatter } = await req.body;
53
+ const worker = [];
54
+ for (const item of pageData) {
55
+ const path = item;
56
+ worker.push(migration(path, frontmatter));
57
+ }
58
+ Promise.all(worker).then(() => {
59
+ _res.end("ok");
60
+ }).catch((_) => {
61
+ _res.end("migration error");
62
+ });
63
+ }
64
+ });
31
65
  }
32
66
 
33
67
  const NAME = "valaxy:devtools";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@valaxyjs/devtools",
3
3
  "type": "module",
4
- "version": "0.19.5",
4
+ "version": "0.19.6",
5
5
  "repository": {
6
6
  "url": "https://github.com/YunYouJun/valaxy"
7
7
  },
@@ -18,9 +18,10 @@
18
18
  "types": "dist/index.d.ts",
19
19
  "dependencies": {
20
20
  "@rollup/pluginutils": "^5.1.0",
21
- "axios": "^1.7.2",
21
+ "axios": "^1.7.3",
22
22
  "body-parser": "^1.20.2",
23
23
  "http-proxy-middleware": "^3.0.0",
24
+ "js-yaml": "^4.1.0",
24
25
  "picocolors": "^1.0.1",
25
26
  "sirv": "^2.0.4"
26
27
  },
@@ -33,7 +34,7 @@
33
34
  "splitpanes": "^3.1.5",
34
35
  "typescript": "^5.5.4",
35
36
  "unbuild": "^2.0.0",
36
- "unplugin-vue-router": "^0.10.1",
37
+ "unplugin-vue-router": "^0.10.2",
37
38
  "vite": "^5.3.5"
38
39
  },
39
40
  "scripts": {
@@ -41,8 +42,9 @@
41
42
  "build:client": "vite build src/client",
42
43
  "build:node": "unbuild",
43
44
  "dev": "npm run stub && npm run dev:client",
44
- "dev:client": "vite build src/client --watch",
45
+ "dev:client": "vite dev src/client",
45
46
  "dev:src": "vite dev src/client --port 5001",
47
+ "watch:client": "vite build src/client --watch",
46
48
  "stub": "unbuild --stub",
47
49
  "release": "bumpp && npm publish"
48
50
  }
@@ -1,6 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import { onMounted } from 'vue'
3
3
  import { initDevtoolsClient } from './utils'
4
+ import VDHeader from './components/VDHeader.vue'
4
5
 
5
6
  onMounted(() => {
6
7
  initDevtoolsClient()
@@ -8,5 +9,12 @@ onMounted(() => {
8
9
  </script>
9
10
 
10
11
  <template>
11
- <RouterView />
12
+ <main class="h-full" flex="~ col" text="gray-700 dark:gray-200">
13
+ <VDHeader />
14
+ <!-- <RouterLink to="/about">About</RouterLink> -->
15
+
16
+ <div style="height: calc(100% - 32px)" overflow="auto">
17
+ <RouterView />
18
+ </div>
19
+ </main>
12
20
  </template>
@@ -0,0 +1,57 @@
1
+ <script setup lang="ts">
2
+ import { useRoute } from 'vue-router'
3
+
4
+ const route = useRoute()
5
+ const routeMenus = [
6
+ {
7
+ to: '/',
8
+ opened: 'i-vscode-icons:folder-type-route-opened',
9
+ closed: 'i-vscode-icons:folder-type-route',
10
+ },
11
+ // {
12
+ // to: '/categories',
13
+ // opened: 'i-vscode-icons:folder-type-route-opened',
14
+ // closed: 'i-vscode-icons:folder-type-route',
15
+ // },
16
+ // {
17
+ // to: '/tags',
18
+ // opened: 'i-vscode-icons:folder-type-route-opened',
19
+ // closed: 'i-vscode-icons:folder-type-route',
20
+ // },
21
+ {
22
+ to: '/migration',
23
+ opened: 'i-vscode-icons:folder-type-tools-opened',
24
+ closed: 'i-vscode-icons:folder-type-tools',
25
+ },
26
+ ]
27
+ </script>
28
+
29
+ <template>
30
+ <div
31
+ class="w-full border-b shadow flex justify-end" dark="border-b-black"
32
+ flex="~"
33
+ >
34
+ <RouterLink
35
+ v-for="menu in routeMenus"
36
+ :key="menu.to"
37
+ class=" dark:bg-gray-900 inline-flex justify-center items-center w-8 h-8 hover:bg-gray-100 dark:hover:bg-gray-800"
38
+ :class="{
39
+ 'bg-gray-200 dark:bg-gray-800': route.path === menu.to,
40
+ 'bg-white': route.path !== menu.to,
41
+ }"
42
+ :to="menu.to"
43
+ >
44
+ <div v-if="route.path === menu.to" :class="menu.opened" />
45
+ <div v-else :class="menu.closed" />
46
+ </RouterLink>
47
+
48
+ <div flex="1" />
49
+
50
+ <a
51
+ href="https://valaxy.site" target="_blank"
52
+ class="bg-white dark:bg-gray-900 inline-flex justify-center items-center w-8 h-8 hover:bg-gray-200"
53
+ >
54
+ <div i-ri-book-line />
55
+ </a>
56
+ </div>
57
+ </template>
@@ -7,57 +7,58 @@ export {}
7
7
  /* prettier-ignore */
8
8
  declare module 'vue' {
9
9
  export interface GlobalComponents {
10
- AGUIAccordion: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/accordion/AGUIAccordion.vue')['default']
11
- AGUIAccordionItem: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/accordion/AGUIAccordionItem.vue')['default']
12
- AGUIApp: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUIApp.vue')['default']
13
- AGUIAssetsExplorer: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/explorer/AGUIAssetsExplorer.vue')['default']
14
- AGUIBreadcrumb: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/breadcrumb/AGUIBreadcrumb.vue')['default']
15
- AGUIButton: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/button/AGUIButton.vue')['default']
16
- AGUICheckbox: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUICheckbox.vue')['default']
17
- AGUIColorPicker: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUIColorPicker.vue')['default']
18
- AGUIContextMenu: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/context-menu/AGUIContextMenu.vue')['default']
19
- AGUIContextMenuItem: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/context-menu/AGUIContextMenuItem.vue')['default']
20
- AGUIDetails: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUIDetails.vue')['default']
21
- AGUIExplorerControls: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/explorer/AGUIExplorerControls.vue')['default']
22
- AGUIFileHandler: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/file/AGUIFileHandler.vue')['default']
23
- AGUIFileItem: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/explorer/AGUIFileItem.vue')['default']
24
- AGUIFileList: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/explorer/AGUIFileList.vue')['default']
25
- AGUIForm: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/form/AGUIForm.vue')['default']
26
- AGUIFormItem: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/form/AGUIFormItem.vue')['default']
27
- AGUIHr: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/common/AGUIHr.vue')['default']
28
- AGUIIcon: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/icon/AGUIIcon.vue')['default']
29
- AGUIIconButton: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/button/AGUIIconButton.vue')['default']
30
- AGUIInnerInput: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/input/AGUIInnerInput.vue')['default']
31
- AGUIInput: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/input/AGUIInput.vue')['default']
32
- AGUIInputNumber: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/input/AGUIInputNumber.vue')['default']
33
- AGUIInputVector: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/input/AGUIInputVector.vue')['default']
34
- AGUILayout: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/layout/AGUILayout.vue')['default']
35
- AGUIMenubar: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/menu/AGUIMenubar.vue')['default']
36
- AGUIMenubarMenu: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/menu/AGUIMenubarMenu.vue')['default']
37
- AGUINumberField: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUINumberField.vue')['default']
38
- AGUINumberSlider: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUINumberSlider.vue')['default']
39
- AGUIOpenDirectory: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/explorer/AGUIOpenDirectory.vue')['default']
40
- AGUIOverlay: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUIOverlay.vue')['default']
41
- AGUIPanel: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUIPanel.vue')['default']
42
- AGUIPropertiesForm: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/panel/AGUIPropertiesForm.vue')['default']
43
- AGUIPropertiesPanel: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/panel/AGUIPropertiesPanel.vue')['default']
44
- AGUIProperty: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUIProperty.vue')['default']
45
- AGUISelect: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/select/AGUISelect.vue')['default']
46
- AGUISlider: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUISlider.vue')['default']
47
- AGUITabPanel: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/tabs/AGUITabPanel.vue')['default']
48
- AGUITabs: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/tabs/AGUITabs.vue')['default']
49
- AGUITextarea: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/textarea/AGUITextarea.vue')['default']
50
- AGUIToast: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/toast/AGUIToast.vue')['default']
51
- AGUIToggleIcon: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/button/AGUIToggleIcon.vue')['default']
52
- AGUIToolbar: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/toolbar/AGUIToolbar.vue')['default']
53
- AGUITree: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/tree/AGUITree.vue')['default']
54
- AGUITreeNode: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/tree/AGUITreeNode.vue')['default']
55
- BIconChevronLeft: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/icons/BIconChevronLeft.vue')['default']
56
- BIconChevronRight: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.34_typescript@5.5.4_/node_modules/@advjs/gui/client/components/icons/BIconChevronRight.vue')['default']
10
+ AGUIAccordion: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/accordion/AGUIAccordion.vue')['default']
11
+ AGUIAccordionItem: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/accordion/AGUIAccordionItem.vue')['default']
12
+ AGUIApp: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUIApp.vue')['default']
13
+ AGUIAssetsExplorer: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/explorer/AGUIAssetsExplorer.vue')['default']
14
+ AGUIBreadcrumb: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/breadcrumb/AGUIBreadcrumb.vue')['default']
15
+ AGUIButton: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/button/AGUIButton.vue')['default']
16
+ AGUICheckbox: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUICheckbox.vue')['default']
17
+ AGUIColorPicker: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUIColorPicker.vue')['default']
18
+ AGUIContextMenu: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/context-menu/AGUIContextMenu.vue')['default']
19
+ AGUIContextMenuItem: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/context-menu/AGUIContextMenuItem.vue')['default']
20
+ AGUIDetails: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUIDetails.vue')['default']
21
+ AGUIExplorerControls: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/explorer/AGUIExplorerControls.vue')['default']
22
+ AGUIFileHandler: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/file/AGUIFileHandler.vue')['default']
23
+ AGUIFileItem: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/explorer/AGUIFileItem.vue')['default']
24
+ AGUIFileList: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/explorer/AGUIFileList.vue')['default']
25
+ AGUIForm: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/form/AGUIForm.vue')['default']
26
+ AGUIFormItem: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/form/AGUIFormItem.vue')['default']
27
+ AGUIHr: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/common/AGUIHr.vue')['default']
28
+ AGUIIcon: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/icon/AGUIIcon.vue')['default']
29
+ AGUIIconButton: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/button/AGUIIconButton.vue')['default']
30
+ AGUIInnerInput: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/input/AGUIInnerInput.vue')['default']
31
+ AGUIInput: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/input/AGUIInput.vue')['default']
32
+ AGUIInputNumber: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/input/AGUIInputNumber.vue')['default']
33
+ AGUIInputVector: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/input/AGUIInputVector.vue')['default']
34
+ AGUILayout: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/layout/AGUILayout.vue')['default']
35
+ AGUIMenubar: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/menu/AGUIMenubar.vue')['default']
36
+ AGUIMenubarMenu: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/menu/AGUIMenubarMenu.vue')['default']
37
+ AGUINumberField: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUINumberField.vue')['default']
38
+ AGUINumberSlider: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUINumberSlider.vue')['default']
39
+ AGUIOpenDirectory: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/explorer/AGUIOpenDirectory.vue')['default']
40
+ AGUIOverlay: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUIOverlay.vue')['default']
41
+ AGUIPanel: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUIPanel.vue')['default']
42
+ AGUIPropertiesForm: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/panel/AGUIPropertiesForm.vue')['default']
43
+ AGUIPropertiesPanel: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/panel/AGUIPropertiesPanel.vue')['default']
44
+ AGUIProperty: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUIProperty.vue')['default']
45
+ AGUISelect: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/select/AGUISelect.vue')['default']
46
+ AGUISlider: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/AGUISlider.vue')['default']
47
+ AGUITabPanel: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/tabs/AGUITabPanel.vue')['default']
48
+ AGUITabs: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/tabs/AGUITabs.vue')['default']
49
+ AGUITextarea: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/textarea/AGUITextarea.vue')['default']
50
+ AGUIToast: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/toast/AGUIToast.vue')['default']
51
+ AGUIToggleIcon: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/button/AGUIToggleIcon.vue')['default']
52
+ AGUIToolbar: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/toolbar/AGUIToolbar.vue')['default']
53
+ AGUITree: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/tree/AGUITree.vue')['default']
54
+ AGUITreeNode: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/tree/AGUITreeNode.vue')['default']
55
+ BIconChevronLeft: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/icons/BIconChevronLeft.vue')['default']
56
+ BIconChevronRight: typeof import('./../../../../node_modules/.pnpm/@advjs+gui@0.0.7-beta.1_vue@3.4.35_typescript@5.5.4_/node_modules/@advjs/gui/client/components/icons/BIconChevronRight.vue')['default']
57
57
  PageFrontmatter: typeof import('./components/PageFrontmatter.vue')['default']
58
58
  PostPanel: typeof import('./components/PostPanel.vue')['default']
59
59
  RouterLink: typeof import('vue-router')['RouterLink']
60
60
  RouterView: typeof import('vue-router')['RouterView']
61
+ VDHeader: typeof import('./components/VDHeader.vue')['default']
61
62
  VDPostCategories: typeof import('./components/VDPostCategories.vue')['default']
62
63
  VDPostList: typeof import('./components/VDPostList.vue')['default']
63
64
  VDTag: typeof import('./components/VDTag.vue')['default']
@@ -1,5 +1,5 @@
1
1
  // register vue composition api globally
2
- import { createApp } from 'vue'
2
+ import { createApp, ref } from 'vue'
3
3
 
4
4
  import { createRouter, createWebHashHistory } from 'vue-router/auto'
5
5
  import { routes } from 'vue-router/auto-routes'
@@ -18,5 +18,15 @@ const router = createRouter({
18
18
  routes,
19
19
  })
20
20
 
21
+ if (import.meta.env.DEV) {
22
+ window.__VUE_DEVTOOLS_ROUTER__ = router
23
+
24
+ window.$frontmatter = {}
25
+ window.$pageData = {}
26
+ window.$valaxy = {
27
+ postList: ref([]),
28
+ }
29
+ }
30
+
21
31
  app.use(router)
22
32
  app.mount('#app')
@@ -10,22 +10,12 @@ onMounted(() => {
10
10
  </script>
11
11
 
12
12
  <template>
13
- <main class="h-full" flex="~ col" text="gray-700 dark:gray-200">
14
- <div class="w-full border-b shadow flex justify-end" dark="border-b-black">
15
- <a href="https://valaxy.site" target="_blank" class="bg-gray-100 dark:bg-gray-900 inline-flex justify-center items-center w-8 h-8">
16
- <div i-ri-book-line />
17
- </a>
18
- </div>
19
-
20
- <div style="height: calc(100% - 32px)" overflow="auto">
21
- <Splitpanes class="h-full">
22
- <Pane>
23
- <VDPostList />
24
- </Pane>
25
- <Pane>
26
- <PostPanel />
27
- </Pane>
28
- </Splitpanes>
29
- </div>
30
- </main>
13
+ <Splitpanes class="h-full">
14
+ <Pane>
15
+ <VDPostList />
16
+ </Pane>
17
+ <Pane>
18
+ <PostPanel />
19
+ </Pane>
20
+ </Splitpanes>
31
21
  </template>
@@ -0,0 +1,73 @@
1
+ <script lang="ts" setup>
2
+ import { onMounted, ref } from 'vue'
3
+ import { Pane, Splitpanes } from 'splitpanes'
4
+ import axios from 'axios'
5
+ import { getGlobalValaxyProperty } from '../utils'
6
+
7
+ interface frontmatter {
8
+ [key: string]: string
9
+ }
10
+ const postList = ref<frontmatter[]>([])
11
+ const mapper = ref<frontmatter>({})
12
+
13
+ onMounted(() => {
14
+ postList.value = getGlobalValaxyProperty('postList').value
15
+ postList.value.forEach((element) => {
16
+ const keys = Object.keys(element)
17
+ for (const key of keys)
18
+ mapper.value[key] = ''
19
+ })
20
+ })
21
+ const checkedPosts = ref<string[]>([])
22
+ function clearPosts(select: boolean) {
23
+ checkedPosts.value.length = 0
24
+ if (select)
25
+ checkedPosts.value = checkedPosts.value.concat(postList.value.map(i => i.path))
26
+ }
27
+
28
+ async function migration() {
29
+ const update: frontmatter = {}
30
+ for (const key in mapper.value) {
31
+ if (mapper.value[key] !== '')
32
+ update[key] = mapper.value[key]
33
+ }
34
+ const res = await axios.post('/valaxy-devtools-api/migration', {
35
+ pageData: checkedPosts.value,
36
+ frontmatter: update,
37
+ })
38
+ if (res.data === 'ok') {
39
+ // console.log('migration success')
40
+ }
41
+ }
42
+ </script>
43
+
44
+ <template>
45
+ <Splitpanes class="h-full">
46
+ <Pane>
47
+ <button @click="clearPosts(true)">
48
+ 全选
49
+ </button>
50
+ <button @click="clearPosts(false)">
51
+ 清空
52
+ </button>
53
+ <ul class="h-full" overflow="auto" pl="12" pr="4" py="4">
54
+ <li v-for="post in postList" :key="post.path" class="list-decimal">
55
+ <input v-model="checkedPosts" type="checkbox" :name="post.path" :value="post.path">
56
+ <label :for="post.path">{{ post.title }}</label>
57
+ </li>
58
+ </ul>
59
+ </Pane>
60
+ <Pane>
61
+ <h2>原frontmatter字段->新字段</h2>
62
+ <button @click="migration">
63
+ 提交
64
+ </button>
65
+ <ul class="h-full" overflow="auto" pl="12" pr="4" py="4">
66
+ <li v-for="(_, key) in mapper" :key="key">
67
+ <label :for="key as string" style="margin-right: 20px;">{{ key }} -></label>
68
+ <input v-model="mapper[key]" :name="key as string">
69
+ </li>
70
+ </ul>
71
+ </Pane>
72
+ </Splitpanes>
73
+ </template>
@@ -0,0 +1,12 @@
1
+ declare interface Window {
2
+ __VUE_DEVTOOLS_ROUTER__: import('vue-router').Router
3
+
4
+ $frontmatter: any
5
+ $pageData: any
6
+
7
+ $valaxy: {
8
+ postList: import('vue').Ref<
9
+ import('valaxy/types').Post[]
10
+ >
11
+ }
12
+ }
@@ -21,6 +21,7 @@ declare module 'vue-router/auto-routes' {
21
21
  '/': RouteRecordInfo<'/', '/', Record<never, never>, Record<never, never>>,
22
22
  '/about': RouteRecordInfo<'/about', '/about', Record<never, never>, Record<never, never>>,
23
23
  '/categories': RouteRecordInfo<'/categories', '/categories', Record<never, never>, Record<never, never>>,
24
+ '/migration': RouteRecordInfo<'/migration', '/migration', Record<never, never>, Record<never, never>>,
24
25
  '/tags': RouteRecordInfo<'/tags', '/tags', Record<never, never>, Record<never, never>>,
25
26
  }
26
27
  }
@@ -10,10 +10,16 @@ export function getAppWindow() {
10
10
  * window.parent.parent is the window object of the main app
11
11
  */
12
12
  export function getWindowProperty(property: string) {
13
+ if (import.meta.env.DEV)
14
+ return (window as any)[property]
15
+
13
16
  return (window.parent.parent as any)[property]
14
17
  }
15
18
 
16
19
  export function getGlobalValaxyProperty(property: string) {
20
+ if (import.meta.env.DEV)
21
+ return (window as any).$valaxy[property]
22
+
17
23
  const $valaxy = (window.parent.parent as any).$valaxy
18
24
  return $valaxy[property]
19
25
  }