@valaxyjs/devtools 0.21.1 → 0.22.0
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/build.config.ts +0 -1
- package/dist/client/assets/{about-BOi5HgAL.js → about-DG1GsLHQ.js} +1 -1
- package/dist/client/assets/{categories-BoywQLCd.js → categories-Bm7oRFJy.js} +1 -1
- package/dist/client/assets/{index-BtHI3jth.js → index-DERgnaDy.js} +7 -7
- package/dist/client/assets/{index-BXzBS9S9.js → index-DjRUnZlz.js} +3 -2
- package/dist/client/assets/{migration-YufEETN0.js → migration-CLNK0vJL.js} +2 -2
- package/dist/client/assets/{splitpanes.es-BzsZAuZt.js → splitpanes.es-C0nkbxNz.js} +1 -1
- package/dist/client/assets/{tags-Y0x_kR--.js → tags-hRXnGE0o.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +5 -6
- package/src/client/components/PageFrontmatter.vue +2 -1
- package/dist/index.cjs +0 -126
- package/dist/index.d.cts +0 -10
package/build.config.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as _export_sfc } from './_plugin-vue_export-helper-DgDhiqFL.js';
|
|
2
|
-
import { a as createElementBlock, o as openBlock } from './index-
|
|
2
|
+
import { a as createElementBlock, o as openBlock } from './index-DERgnaDy.js';
|
|
3
3
|
|
|
4
4
|
/* unplugin-vue-components disabled */const _sfc_main = {};
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as _export_sfc } from './_plugin-vue_export-helper-DgDhiqFL.js';
|
|
2
|
-
import { a as createElementBlock, o as openBlock } from './index-
|
|
2
|
+
import { a as createElementBlock, o as openBlock } from './index-DERgnaDy.js';
|
|
3
3
|
|
|
4
4
|
/* unplugin-vue-components disabled */const _sfc_main = {};
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DjRUnZlz.js","./_plugin-vue_export-helper-DgDhiqFL.js","./splitpanes.es-C0nkbxNz.js","./index-BsE069b2.css","./about-DG1GsLHQ.js","./categories-Bm7oRFJy.js","./migration-CLNK0vJL.js","./tags-hRXnGE0o.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
true&&(function polyfill() {
|
|
3
3
|
const relList = document.createElement("link").relList;
|
|
4
4
|
if (relList && relList.supports && relList.supports("modulepreload")) {
|
|
@@ -8375,31 +8375,31 @@ const routes = [
|
|
|
8375
8375
|
{
|
|
8376
8376
|
path: "/",
|
|
8377
8377
|
name: "/",
|
|
8378
|
-
component: () => __vitePreload(() => import('./index-
|
|
8378
|
+
component: () => __vitePreload(() => import('./index-DjRUnZlz.js'),true?__vite__mapDeps([0,1,2,3]):void 0,import.meta.url)
|
|
8379
8379
|
/* no children */
|
|
8380
8380
|
},
|
|
8381
8381
|
{
|
|
8382
8382
|
path: "/about",
|
|
8383
8383
|
name: "/about",
|
|
8384
|
-
component: () => __vitePreload(() => import('./about-
|
|
8384
|
+
component: () => __vitePreload(() => import('./about-DG1GsLHQ.js'),true?__vite__mapDeps([4,1]):void 0,import.meta.url)
|
|
8385
8385
|
/* no children */
|
|
8386
8386
|
},
|
|
8387
8387
|
{
|
|
8388
8388
|
path: "/categories",
|
|
8389
8389
|
name: "/categories",
|
|
8390
|
-
component: () => __vitePreload(() => import('./categories-
|
|
8390
|
+
component: () => __vitePreload(() => import('./categories-Bm7oRFJy.js'),true?__vite__mapDeps([5,1]):void 0,import.meta.url)
|
|
8391
8391
|
/* no children */
|
|
8392
8392
|
},
|
|
8393
8393
|
{
|
|
8394
8394
|
path: "/migration",
|
|
8395
8395
|
name: "/migration",
|
|
8396
|
-
component: () => __vitePreload(() => import('./migration-
|
|
8396
|
+
component: () => __vitePreload(() => import('./migration-CLNK0vJL.js'),true?__vite__mapDeps([6,2]):void 0,import.meta.url)
|
|
8397
8397
|
/* no children */
|
|
8398
8398
|
},
|
|
8399
8399
|
{
|
|
8400
8400
|
path: "/tags",
|
|
8401
8401
|
name: "/tags",
|
|
8402
|
-
component: () => __vitePreload(() => import('./tags-
|
|
8402
|
+
component: () => __vitePreload(() => import('./tags-hRXnGE0o.js'),true?__vite__mapDeps([7,1]):void 0,import.meta.url)
|
|
8403
8403
|
/* no children */
|
|
8404
8404
|
}
|
|
8405
8405
|
];
|
|
@@ -8569,4 +8569,4 @@ app.mount("#app");
|
|
|
8569
8569
|
|
|
8570
8570
|
/* Injected with object hook! */
|
|
8571
8571
|
|
|
8572
|
-
export { isStaticMode as A, withDirectives as B, vModelCheckbox as C, vModelText as D, h as E, Fragment as F, normalizeStyle as G, createElementBlock as a, createCommentVNode as b, computed as c, defineComponent as d, ref as e, onMounted as f, getAppWindow as g, createBaseVNode as h, resolveComponent as i, createBlock as j, renderList as k, createTextVNode as l, createVNode as m, normalizeClass as n, openBlock as o,
|
|
8572
|
+
export { isStaticMode as A, withDirectives as B, vModelCheckbox as C, vModelText as D, h as E, Fragment as F, normalizeStyle as G, createElementBlock as a, createCommentVNode as b, computed as c, defineComponent as d, ref as e, onMounted as f, getAppWindow as g, createBaseVNode as h, resolveComponent as i, createBlock as j, renderList as k, createTextVNode as l, createVNode as m, normalizeClass as n, openBlock as o, activePath as p, pageData as q, renderSlot as r, toRaw as s, toDisplayString as t, unref as u, frontmatter as v, withCtx as w, getWindowProperty as x, getGlobalValaxyProperty as y, devtoolsRouter as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as getAppWindow, d as defineComponent, c as computed, o as openBlock, a as createElementBlock, n as normalizeClass, b as createCommentVNode, r as renderSlot, e as ref, f as onMounted, h as createBaseVNode, i as resolveComponent, j as createBlock, w as withCtx, t as toDisplayString, F as Fragment, k as renderList, l as createTextVNode, m as createVNode, p as
|
|
1
|
+
import { g as getAppWindow, d as defineComponent, c as computed, o as openBlock, a as createElementBlock, n as normalizeClass, b as createCommentVNode, r as renderSlot, e as ref, f as onMounted, h as createBaseVNode, i as resolveComponent, j as createBlock, w as withCtx, t as toDisplayString, F as Fragment, k as renderList, l as createTextVNode, m as createVNode, p as activePath, q as pageData, s as toRaw, u as unref, v as frontmatter, x as getWindowProperty, y as getGlobalValaxyProperty, z as devtoolsRouter, A as isStaticMode } from './index-DERgnaDy.js';
|
|
2
2
|
import { _ as _export_sfc } from './_plugin-vue_export-helper-DgDhiqFL.js';
|
|
3
|
-
import { a as axios, g, M } from './splitpanes.es-
|
|
3
|
+
import { a as axios, g, M } from './splitpanes.es-C0nkbxNz.js';
|
|
4
4
|
|
|
5
5
|
const target = getAppWindow();
|
|
6
6
|
function openInEditor(options = {}) {
|
|
@@ -660,6 +660,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
660
660
|
const newFm = ref(props.frontmatter);
|
|
661
661
|
async function saveNewFm() {
|
|
662
662
|
const res = await axios.post("/valaxy-devtools-api/frontmatter", {
|
|
663
|
+
path: activePath.value,
|
|
663
664
|
pageData: pageData.value,
|
|
664
665
|
frontmatter: toRaw(newFm.value)
|
|
665
666
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as defineComponent, e as ref, f as onMounted,
|
|
2
|
-
import { g, M, a as axios } from './splitpanes.es-
|
|
1
|
+
import { d as defineComponent, e as ref, f as onMounted, y as getGlobalValaxyProperty, o as openBlock, j as createBlock, w as withCtx, u as unref, m as createVNode, h as createBaseVNode, a as createElementBlock, k as renderList, F as Fragment, B as withDirectives, C as vModelCheckbox, t as toDisplayString, D as vModelText } from './index-DERgnaDy.js';
|
|
2
|
+
import { g, M, a as axios } from './splitpanes.es-C0nkbxNz.js';
|
|
3
3
|
|
|
4
4
|
const _hoisted_1 = {
|
|
5
5
|
class: "h-full",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as h, o as openBlock, a as createElementBlock, r as renderSlot, G as normalizeStyle } from './index-
|
|
1
|
+
import { E as h, o as openBlock, a as createElementBlock, r as renderSlot, G as normalizeStyle } from './index-DERgnaDy.js';
|
|
2
2
|
|
|
3
3
|
function bind(fn, thisArg) {
|
|
4
4
|
return function wrap() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as _export_sfc } from './_plugin-vue_export-helper-DgDhiqFL.js';
|
|
2
|
-
import { a as createElementBlock, o as openBlock } from './index-
|
|
2
|
+
import { a as createElementBlock, o as openBlock } from './index-DERgnaDy.js';
|
|
3
3
|
|
|
4
4
|
/* unplugin-vue-components disabled */const _sfc_main = {};
|
|
5
5
|
|
package/dist/client/index.html
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
document.documentElement.classList.toggle('dark', true)
|
|
17
17
|
})()
|
|
18
18
|
</script>
|
|
19
|
-
<script type="module" crossorigin src="./assets/index-
|
|
19
|
+
<script type="module" crossorigin src="./assets/index-DERgnaDy.js"></script>
|
|
20
20
|
<link rel="stylesheet" crossorigin href="./assets/index-CGiiZwdq.css">
|
|
21
21
|
</head>
|
|
22
22
|
|
package/package.json
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valaxyjs/devtools",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.22.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/YunYouJun/valaxy"
|
|
7
7
|
},
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
-
"
|
|
12
|
-
"require": "./dist/index.cjs"
|
|
11
|
+
"default": "./dist/index.mjs"
|
|
13
12
|
},
|
|
14
13
|
"./*": "./*"
|
|
15
14
|
},
|
|
@@ -17,7 +16,7 @@
|
|
|
17
16
|
"module": "dist/index.mjs",
|
|
18
17
|
"types": "dist/index.d.ts",
|
|
19
18
|
"dependencies": {
|
|
20
|
-
"@rollup/pluginutils": "^5.1.
|
|
19
|
+
"@rollup/pluginutils": "^5.1.4",
|
|
21
20
|
"axios": "^1.7.9",
|
|
22
21
|
"body-parser": "^2.0.2",
|
|
23
22
|
"http-proxy-middleware": "^3.0.3",
|
|
@@ -27,13 +26,13 @@
|
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
28
|
"@advjs/gui": "0.0.7-beta.1",
|
|
30
|
-
"@iconify-json/ri": "^1.2.
|
|
29
|
+
"@iconify-json/ri": "^1.2.5",
|
|
31
30
|
"@types/body-parser": "^1.19.5",
|
|
32
31
|
"@types/splitpanes": "^2.2.6",
|
|
33
32
|
"gray-matter": "^4.0.3",
|
|
34
33
|
"splitpanes": "^3.1.5",
|
|
35
34
|
"typescript": "5.6",
|
|
36
|
-
"unbuild": "^3.0.
|
|
35
|
+
"unbuild": "^3.0.1",
|
|
37
36
|
"unplugin-vue-router": "^0.10.9",
|
|
38
37
|
"vite": "^6.0.3"
|
|
39
38
|
},
|
|
@@ -4,7 +4,7 @@ import axios from 'axios'
|
|
|
4
4
|
|
|
5
5
|
import consola from 'consola'
|
|
6
6
|
import { ref, toRaw } from 'vue'
|
|
7
|
-
import { pageData } from '../composables/app'
|
|
7
|
+
import { activePath, pageData } from '../composables/app'
|
|
8
8
|
|
|
9
9
|
const props = defineProps<{
|
|
10
10
|
frontmatter: PostFrontMatter
|
|
@@ -18,6 +18,7 @@ async function saveNewFm() {
|
|
|
18
18
|
// })
|
|
19
19
|
|
|
20
20
|
const res = await axios.post('/valaxy-devtools-api/frontmatter', {
|
|
21
|
+
path: activePath.value,
|
|
21
22
|
pageData: pageData.value,
|
|
22
23
|
frontmatter: toRaw(newFm.value),
|
|
23
24
|
})
|
package/dist/index.cjs
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const httpProxyMiddleware = require('http-proxy-middleware');
|
|
4
|
-
const c = require('picocolors');
|
|
5
|
-
const sirv = require('sirv');
|
|
6
|
-
const node_path = require('node:path');
|
|
7
|
-
const node_url = require('node:url');
|
|
8
|
-
const bodyParser = require('body-parser');
|
|
9
|
-
const fs = require('fs-extra');
|
|
10
|
-
const matter = require('gray-matter');
|
|
11
|
-
const jsYaml = require('js-yaml');
|
|
12
|
-
|
|
13
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
14
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
15
|
-
|
|
16
|
-
const c__default = /*#__PURE__*/_interopDefaultCompat(c);
|
|
17
|
-
const sirv__default = /*#__PURE__*/_interopDefaultCompat(sirv);
|
|
18
|
-
const bodyParser__default = /*#__PURE__*/_interopDefaultCompat(bodyParser);
|
|
19
|
-
const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
20
|
-
const matter__default = /*#__PURE__*/_interopDefaultCompat(matter);
|
|
21
|
-
|
|
22
|
-
const DIR_DIST = typeof __dirname !== "undefined" ? __dirname : node_path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
|
|
23
|
-
const DEVTOOLS_CLIENT_FOLDER = node_path.resolve(DIR_DIST, "../dist/client");
|
|
24
|
-
const DIR_CLIENT = DEVTOOLS_CLIENT_FOLDER;
|
|
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
|
-
}
|
|
45
|
-
function registerApi(server, _viteConfig) {
|
|
46
|
-
const app = server.middlewares;
|
|
47
|
-
app.use(bodyParser__default.json());
|
|
48
|
-
app.use(`${prefix}/frontmatter`, async (req, _res) => {
|
|
49
|
-
if (req.method === "POST") {
|
|
50
|
-
const { pageData, frontmatter: newFm } = await req.body;
|
|
51
|
-
const path = pageData.path;
|
|
52
|
-
if (fs__default.existsSync(path)) {
|
|
53
|
-
const rawMd = await fs__default.readFile(path, "utf-8");
|
|
54
|
-
const matterFile = matter__default(rawMd);
|
|
55
|
-
matterFile.data = newFm;
|
|
56
|
-
const newMd = matter__default.stringify(matterFile.content, matterFile.data);
|
|
57
|
-
await fs__default.writeFile(path, newMd);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
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
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const NAME = "valaxy:devtools";
|
|
79
|
-
function ValaxyDevtools(options = {}) {
|
|
80
|
-
let config;
|
|
81
|
-
function configureServer(server) {
|
|
82
|
-
const _print = server.printUrls;
|
|
83
|
-
const base = (options.base ?? server.config.base) || "/";
|
|
84
|
-
const devtoolsUrl = `${base}__valaxy_devtools__/`;
|
|
85
|
-
if (undefined?.VITE_DEV_VALAXY_DEVTOOLS === "true") {
|
|
86
|
-
server.middlewares.use(devtoolsUrl, httpProxyMiddleware.createProxyMiddleware({
|
|
87
|
-
target: "http://localhost:5001/#/",
|
|
88
|
-
changeOrigin: true
|
|
89
|
-
}));
|
|
90
|
-
} else {
|
|
91
|
-
server.middlewares.use(devtoolsUrl, sirv__default(DIR_CLIENT, {
|
|
92
|
-
single: true,
|
|
93
|
-
dev: true
|
|
94
|
-
}));
|
|
95
|
-
}
|
|
96
|
-
server.printUrls = () => {
|
|
97
|
-
let host = `${config.server.https ? "https" : "http"}://localhost:${config.server.port || "80"}`;
|
|
98
|
-
const url = server.resolvedUrls?.local[0];
|
|
99
|
-
if (url) {
|
|
100
|
-
try {
|
|
101
|
-
const u = new URL(url);
|
|
102
|
-
host = `${u.protocol}//${u.host}`;
|
|
103
|
-
} catch (error) {
|
|
104
|
-
console.warn("Parse resolved url failed:", error);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
_print();
|
|
108
|
-
const colorUrl = (url2) => c__default.green(url2.replace(/:(\d+)\//, (_, port) => `:${c__default.bold(port)}/`));
|
|
109
|
-
console.log(` ${c__default.green("\u279C")} ${c__default.bold("Inspect")}: ${colorUrl(`${host}${base}__inspect/`)}`);
|
|
110
|
-
};
|
|
111
|
-
registerApi(server);
|
|
112
|
-
}
|
|
113
|
-
const plugin = {
|
|
114
|
-
name: NAME,
|
|
115
|
-
enforce: "pre",
|
|
116
|
-
configResolved(_config) {
|
|
117
|
-
config = _config;
|
|
118
|
-
},
|
|
119
|
-
configureServer(server) {
|
|
120
|
-
configureServer(server);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
return plugin;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
module.exports = ValaxyDevtools;
|
package/dist/index.d.cts
DELETED