@valaxyjs/devtools 1.0.0-rc.10 → 1.0.0-rc.12
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/README.md +138 -12
- package/dist/client/assets/FeedbackEmptyState-Dj1YkJE0.js +1 -0
- package/dist/client/assets/LayoutCard-qUVYVRud.js +1 -0
- package/dist/client/assets/PopperContent-CgXMlFkV.js +3 -0
- package/dist/client/assets/VDCheckbox-CH2V3bFJ.js +1 -0
- package/dist/client/assets/VDNumberField-DVmMsYPC.js +1 -0
- package/dist/client/assets/VDPostListItem-D3Rn_PcJ.js +1 -0
- package/dist/client/assets/VDPostPanel-BWZUkoQC.js +1 -0
- package/dist/client/assets/VDPostPanel-CbCth8UW.css +1 -0
- package/dist/client/assets/VDSelect-4SBTowKT.js +1 -0
- package/dist/client/assets/VDToggleGroup-BOVPTJ4m.js +1 -0
- package/dist/client/assets/addons-CF1AfuFX.js +1 -0
- package/dist/client/assets/archives-CDa7i8eC.js +1 -0
- package/dist/client/assets/batch-edit-DIvZaav7.js +1 -0
- package/dist/client/assets/batch-edit-UNPFWmV7.css +1 -0
- package/dist/client/assets/browser-agent-rpc-BXhoSh1z-BPEkUHEg.js +1 -0
- package/dist/client/assets/categories-Bk3lMeb1.js +1 -0
- package/dist/client/assets/collections-BHxAwkoL.js +1 -0
- package/dist/client/assets/colors-CdKJdJxa.js +1 -0
- package/dist/client/assets/config-B09dyTTS.js +1 -0
- package/dist/client/assets/debug-CMQbsCep.js +1 -0
- package/dist/client/assets/debug-DcFlBZjk.css +1 -0
- package/dist/client/assets/index-Cyol-EzD.css +1 -0
- package/dist/client/assets/index-DUZ9khG8.js +4 -0
- package/dist/client/assets/nanoid-Cya-tyvy.js +1 -0
- package/dist/client/assets/pages-BWRkr8em.js +1 -0
- package/dist/client/assets/posts-mlMGwcAv.js +1 -0
- package/dist/client/assets/rpc-D36U2nIU.js +4 -0
- package/dist/client/assets/runtime-core.esm-bundler-B8D2lM98.js +3 -0
- package/dist/client/assets/runtime-dom.esm-bundler-Btnku4nR.js +2 -0
- package/dist/client/assets/settings-BZuYgjIU.js +1 -0
- package/dist/client/assets/splitpanes.esm-CrBmgK88.js +1 -0
- package/dist/client/assets/tags-DUuGVO-R.js +1 -0
- package/dist/client/assets/virtual_intlify-i18n-0-CRury7qB.js +1 -0
- package/dist/client/assets/virtual_intlify-i18n-1-FM-gmUYx.js +1 -0
- package/{LICENSE → dist/client/icons/LICENSE} +1 -1
- package/dist/client/icons/README.md +2 -0
- package/dist/client/icons/archive.svg +1 -0
- package/dist/client/icons/article.svg +1 -0
- package/dist/client/icons/books.svg +1 -0
- package/dist/client/icons/bug.svg +1 -0
- package/dist/client/icons/folders.svg +1 -0
- package/dist/client/icons/gear-six.svg +1 -0
- package/dist/client/icons/hash.svg +1 -0
- package/dist/client/icons/pencil-simple.svg +1 -0
- package/dist/client/icons/puzzle-piece.svg +1 -0
- package/dist/client/icons/sliders-horizontal.svg +1 -0
- package/dist/client/icons/squares-four.svg +1 -0
- package/dist/client/index.html +9 -5
- package/dist/client-api.d.mts +18 -0
- package/dist/client-api.d.ts +18 -0
- package/dist/client-api.mjs +52 -0
- package/dist/index.d.mts +10 -5
- package/dist/index.d.ts +10 -5
- package/dist/index.mjs +114 -626
- package/dist/node/definition.d.mts +9 -0
- package/dist/node/definition.d.ts +9 -0
- package/dist/node/definition.mjs +826 -0
- package/dist/node/mcp.d.mts +26 -0
- package/dist/node/mcp.d.ts +26 -0
- package/dist/node/mcp.mjs +250 -0
- package/dist/page.d.mts +12 -0
- package/dist/page.d.ts +12 -0
- package/dist/page.mjs +29 -0
- package/dist/plugin.d.mts +48 -0
- package/dist/plugin.d.ts +48 -0
- package/dist/plugin.mjs +5 -0
- package/dist/shared/devtools.B-vZo-vB.mjs +46 -0
- package/dist/shared/devtools.BOLo8y6t.d.mts +58 -0
- package/dist/shared/devtools.BzWtXMed.mjs +3 -0
- package/dist/shared/devtools.CBhjeyeH.mjs +16 -0
- package/dist/shared/devtools.CNAj6Cjx.d.ts +58 -0
- package/dist/shared/devtools.DV0tVpWA.d.mts +95 -0
- package/dist/shared/devtools.O-VZ9RtQ.d.mts +30 -0
- package/dist/shared/devtools.O-VZ9RtQ.d.ts +30 -0
- package/dist/shared/devtools.lzRAl5dD.d.ts +95 -0
- package/dist/shared/rpc.d.mts +171 -0
- package/dist/shared/rpc.d.ts +171 -0
- package/dist/shared/rpc.mjs +1 -0
- package/package.json +52 -26
- package/rpc.d.ts +1 -100
- package/dist/client/assets/VDButton-BxA3M5c6.js +0 -1
- package/dist/client/assets/VDCheckbox-DHsZ2MtO.js +0 -1
- package/dist/client/assets/VDInput--2OfK1U0.js +0 -1
- package/dist/client/assets/VDInput-BtxYqBt3.css +0 -1
- package/dist/client/assets/VDNumberField-CM-eu6ID.js +0 -1
- package/dist/client/assets/VDPostListItem-BRztbQ-7.js +0 -1
- package/dist/client/assets/VDPostPanel-5tXSmi2U.js +0 -1
- package/dist/client/assets/VDPostPanel-Bkkd-Lkf.css +0 -1
- package/dist/client/assets/VDSelect-Ba_Ho-KY.js +0 -1
- package/dist/client/assets/VDToggleGroup-BcFnu_dC.js +0 -1
- package/dist/client/assets/archives-CGYcR25I.js +0 -1
- package/dist/client/assets/batch-edit-BYL9g3v4.css +0 -1
- package/dist/client/assets/batch-edit-CQ7fEreQ.js +0 -1
- package/dist/client/assets/categories-CpHmD64Q.js +0 -1
- package/dist/client/assets/collections-CUGJYU1k.js +0 -1
- package/dist/client/assets/config-DAbNxmJq.js +0 -1
- package/dist/client/assets/index-BbTs73Cs.js +0 -6
- package/dist/client/assets/index-DdAoqzsi.css +0 -1
- package/dist/client/assets/pages-C3fbE5n_.js +0 -1
- package/dist/client/assets/posts-CZaX-7Wl.js +0 -1
- package/dist/client/assets/settings-CfzebNiK.js +0 -1
- package/dist/client/assets/splitpanes.esm-B-DN0qHF.js +0 -1
- package/dist/client/assets/tags-NDF8NhjL.js +0 -1
- package/dist/client/assets/virtual_intlify-i18n-0-C_fbdMlw.js +0 -1
- package/dist/client/assets/virtual_intlify-i18n-1-CjutLn3A.js +0 -1
- package/dist/client/assets/vue.runtime.esm-bundler-DqDZGG6R.js +0 -4
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { ValaxyDevtoolsPlugin } from '../plugin.mjs';
|
|
2
|
+
import { ServerFunctions, ClientOptions, ClientPostList, ClientCollectionData, ConfigData } from './rpc.mjs';
|
|
3
|
+
import * as devframe_rpc from 'devframe/rpc';
|
|
4
|
+
import { RpcDefinitionsToFunctionsWithNamespace } from 'devframe/rpc';
|
|
5
|
+
import * as devframe from 'devframe';
|
|
6
|
+
import { V as ValaxyDevtoolsManifest, a as ValaxyDevtoolsData } from './devtools.BOLo8y6t.mjs';
|
|
7
|
+
import * as v from 'valibot';
|
|
8
|
+
|
|
9
|
+
interface ValaxyDevtoolsOptions {
|
|
10
|
+
userRoot?: string;
|
|
11
|
+
/** Lazy loaders run only when the development tools start. */
|
|
12
|
+
plugins?: (ValaxyDevtoolsPlugin | (() => Promise<ValaxyDevtoolsPlugin | {
|
|
13
|
+
default: ValaxyDevtoolsPlugin;
|
|
14
|
+
}>))[];
|
|
15
|
+
base?: string;
|
|
16
|
+
/** Actual site URL, resolved after the Vite server starts listening. */
|
|
17
|
+
siteUrl?: () => string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare function createManifest(plugins: ValaxyDevtoolsPlugin[], base?: string): ValaxyDevtoolsManifest;
|
|
21
|
+
|
|
22
|
+
declare function createRpcFunctions(functions: ServerFunctions): readonly [devframe_rpc.RpcFunctionDefinitionWithSchemas<"get-post-content", "query", readonly [v.StringSchema<undefined>], v.ObjectSchema<{
|
|
23
|
+
readonly content: v.StringSchema<undefined>;
|
|
24
|
+
readonly revision: v.StringSchema<undefined>;
|
|
25
|
+
}, undefined>, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"update-post-content", "action", readonly [v.ObjectSchema<{
|
|
26
|
+
readonly filePath: v.StringSchema<undefined>;
|
|
27
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000000, undefined>]>;
|
|
28
|
+
readonly revision: v.StringSchema<undefined>;
|
|
29
|
+
}, undefined>], v.ObjectSchema<{
|
|
30
|
+
readonly content: v.StringSchema<undefined>;
|
|
31
|
+
readonly revision: v.StringSchema<undefined>;
|
|
32
|
+
}, undefined>, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithoutSchemas<"get-options", "query", [], Promise<ClientOptions>, undefined, undefined, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithoutSchemas<"get-post-list", "query", [], Promise<ClientPostList>, undefined, undefined, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"get-page-data", "query", readonly [v.StringSchema<undefined>], v.ObjectSchema<{
|
|
33
|
+
readonly routePath: v.StringSchema<undefined>;
|
|
34
|
+
readonly filePath: v.StringSchema<undefined>;
|
|
35
|
+
readonly frontmatter: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
|
|
36
|
+
}, undefined>, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithoutSchemas<"get-collection-list", "query", [], Promise<ClientCollectionData[]>, undefined, undefined, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithoutSchemas<"get-config", "query", [], Promise<ConfigData>, undefined, undefined, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"create-post", "action", readonly [v.ObjectSchema<{
|
|
37
|
+
readonly title: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
38
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
39
|
+
readonly tags: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
40
|
+
readonly categories: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
41
|
+
}, undefined>], v.ObjectSchema<{
|
|
42
|
+
readonly success: v.BooleanSchema<undefined>;
|
|
43
|
+
readonly filePath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
44
|
+
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
45
|
+
}, undefined>, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"update-frontmatter", "action", readonly [v.ObjectSchema<{
|
|
46
|
+
readonly filePath: v.StringSchema<undefined>;
|
|
47
|
+
readonly frontmatter: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
|
|
48
|
+
}, undefined>], v.ObjectSchema<{
|
|
49
|
+
readonly success: v.BooleanSchema<undefined>;
|
|
50
|
+
}, undefined>, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"batch-update-frontmatter", "action", readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
51
|
+
readonly type: v.LiteralSchema<"set", undefined>;
|
|
52
|
+
readonly key: v.StringSchema<undefined>;
|
|
53
|
+
readonly value: v.UnknownSchema;
|
|
54
|
+
}, undefined>, v.ObjectSchema<{
|
|
55
|
+
readonly type: v.LiteralSchema<"delete", undefined>;
|
|
56
|
+
readonly key: v.StringSchema<undefined>;
|
|
57
|
+
}, undefined>, v.ObjectSchema<{
|
|
58
|
+
readonly type: v.LiteralSchema<"rename", undefined>;
|
|
59
|
+
readonly key: v.StringSchema<undefined>;
|
|
60
|
+
readonly newKey: v.StringSchema<undefined>;
|
|
61
|
+
}, undefined>], undefined>, undefined>], v.ObjectSchema<{
|
|
62
|
+
readonly total: v.NumberSchema<undefined>;
|
|
63
|
+
readonly updated: v.NumberSchema<undefined>;
|
|
64
|
+
readonly errors: v.ArraySchema<v.ObjectSchema<{
|
|
65
|
+
readonly filePath: v.StringSchema<undefined>;
|
|
66
|
+
readonly error: v.StringSchema<undefined>;
|
|
67
|
+
}, undefined>, undefined>;
|
|
68
|
+
}, undefined>, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"update-config-field", "action", readonly [v.PicklistSchema<["site", "valaxy", "theme"], undefined>, v.StringSchema<undefined>, v.UnknownSchema], v.ObjectSchema<{
|
|
69
|
+
readonly success: v.BooleanSchema<undefined>;
|
|
70
|
+
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
71
|
+
}, undefined>, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"run-migration", "action", readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>], v.ObjectSchema<{
|
|
72
|
+
readonly success: v.BooleanSchema<undefined>;
|
|
73
|
+
}, undefined>, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"open-in-editor", "action", readonly [v.ObjectSchema<{
|
|
74
|
+
readonly file: v.StringSchema<undefined>;
|
|
75
|
+
readonly line: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
76
|
+
readonly column: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
77
|
+
}, undefined>], v.VoidSchema<undefined>, devframe.DevframeNodeContext>];
|
|
78
|
+
declare function createValaxyDevframe(options?: ValaxyDevtoolsOptions): devframe.DevframeDefinition & {
|
|
79
|
+
dispose: () => Promise<void>;
|
|
80
|
+
};
|
|
81
|
+
declare function createExtensionRpc(manifest: ReturnType<typeof createManifest>, plugins: ValaxyDevtoolsPlugin[], data: ValaxyDevtoolsData): readonly [devframe_rpc.RpcFunctionDefinitionWithoutSchemas<"get-extensions", "query", [], ValaxyDevtoolsManifest, undefined, undefined, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"run-editor-action", "query", readonly [v.StringSchema<undefined>, v.StringSchema<undefined>, v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>], v.ObjectSchema<{
|
|
82
|
+
readonly message: v.StringSchema<undefined>;
|
|
83
|
+
readonly severity: v.OptionalSchema<v.PicklistSchema<["success", "warn", "error", "info"], undefined>, undefined>;
|
|
84
|
+
}, undefined>, devframe.DevframeNodeContext>];
|
|
85
|
+
declare module 'devframe' {
|
|
86
|
+
interface DevframeRpcServerFunctions extends RpcDefinitionsToFunctionsWithNamespace<'valaxy', ReturnType<typeof createRpcFunctions>> {
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
declare module 'devframe' {
|
|
90
|
+
interface DevframeRpcServerFunctions extends RpcDefinitionsToFunctionsWithNamespace<'valaxy', ReturnType<typeof createExtensionRpc>> {
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export { createRpcFunctions as a, createValaxyDevframe as c };
|
|
95
|
+
export type { ValaxyDevtoolsOptions as V };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Browser-local diagnostics, separate from the server's source-file config. */
|
|
2
|
+
interface ValaxyPageDebug {
|
|
3
|
+
route: {
|
|
4
|
+
path: string;
|
|
5
|
+
fullPath: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
layout: string;
|
|
8
|
+
query: Record<string, unknown>;
|
|
9
|
+
params: Record<string, unknown>;
|
|
10
|
+
};
|
|
11
|
+
viewport: {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
breakpoints: {
|
|
15
|
+
label: string;
|
|
16
|
+
active: boolean;
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
config: {
|
|
20
|
+
theme: string;
|
|
21
|
+
site: {
|
|
22
|
+
lang?: string;
|
|
23
|
+
title?: string;
|
|
24
|
+
url?: string;
|
|
25
|
+
};
|
|
26
|
+
themeConfig: Record<string, unknown>;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type { ValaxyPageDebug as V };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Browser-local diagnostics, separate from the server's source-file config. */
|
|
2
|
+
interface ValaxyPageDebug {
|
|
3
|
+
route: {
|
|
4
|
+
path: string;
|
|
5
|
+
fullPath: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
layout: string;
|
|
8
|
+
query: Record<string, unknown>;
|
|
9
|
+
params: Record<string, unknown>;
|
|
10
|
+
};
|
|
11
|
+
viewport: {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
breakpoints: {
|
|
15
|
+
label: string;
|
|
16
|
+
active: boolean;
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
config: {
|
|
20
|
+
theme: string;
|
|
21
|
+
site: {
|
|
22
|
+
lang?: string;
|
|
23
|
+
title?: string;
|
|
24
|
+
url?: string;
|
|
25
|
+
};
|
|
26
|
+
themeConfig: Record<string, unknown>;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type { ValaxyPageDebug as V };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { ValaxyDevtoolsPlugin } from '../plugin.js';
|
|
2
|
+
import { ServerFunctions, ClientOptions, ClientPostList, ClientCollectionData, ConfigData } from './rpc.js';
|
|
3
|
+
import * as devframe_rpc from 'devframe/rpc';
|
|
4
|
+
import { RpcDefinitionsToFunctionsWithNamespace } from 'devframe/rpc';
|
|
5
|
+
import * as devframe from 'devframe';
|
|
6
|
+
import { V as ValaxyDevtoolsManifest, a as ValaxyDevtoolsData } from './devtools.CNAj6Cjx.js';
|
|
7
|
+
import * as v from 'valibot';
|
|
8
|
+
|
|
9
|
+
interface ValaxyDevtoolsOptions {
|
|
10
|
+
userRoot?: string;
|
|
11
|
+
/** Lazy loaders run only when the development tools start. */
|
|
12
|
+
plugins?: (ValaxyDevtoolsPlugin | (() => Promise<ValaxyDevtoolsPlugin | {
|
|
13
|
+
default: ValaxyDevtoolsPlugin;
|
|
14
|
+
}>))[];
|
|
15
|
+
base?: string;
|
|
16
|
+
/** Actual site URL, resolved after the Vite server starts listening. */
|
|
17
|
+
siteUrl?: () => string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare function createManifest(plugins: ValaxyDevtoolsPlugin[], base?: string): ValaxyDevtoolsManifest;
|
|
21
|
+
|
|
22
|
+
declare function createRpcFunctions(functions: ServerFunctions): readonly [devframe_rpc.RpcFunctionDefinitionWithSchemas<"get-post-content", "query", readonly [v.StringSchema<undefined>], v.ObjectSchema<{
|
|
23
|
+
readonly content: v.StringSchema<undefined>;
|
|
24
|
+
readonly revision: v.StringSchema<undefined>;
|
|
25
|
+
}, undefined>, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"update-post-content", "action", readonly [v.ObjectSchema<{
|
|
26
|
+
readonly filePath: v.StringSchema<undefined>;
|
|
27
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000000, undefined>]>;
|
|
28
|
+
readonly revision: v.StringSchema<undefined>;
|
|
29
|
+
}, undefined>], v.ObjectSchema<{
|
|
30
|
+
readonly content: v.StringSchema<undefined>;
|
|
31
|
+
readonly revision: v.StringSchema<undefined>;
|
|
32
|
+
}, undefined>, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithoutSchemas<"get-options", "query", [], Promise<ClientOptions>, undefined, undefined, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithoutSchemas<"get-post-list", "query", [], Promise<ClientPostList>, undefined, undefined, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"get-page-data", "query", readonly [v.StringSchema<undefined>], v.ObjectSchema<{
|
|
33
|
+
readonly routePath: v.StringSchema<undefined>;
|
|
34
|
+
readonly filePath: v.StringSchema<undefined>;
|
|
35
|
+
readonly frontmatter: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
|
|
36
|
+
}, undefined>, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithoutSchemas<"get-collection-list", "query", [], Promise<ClientCollectionData[]>, undefined, undefined, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithoutSchemas<"get-config", "query", [], Promise<ConfigData>, undefined, undefined, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"create-post", "action", readonly [v.ObjectSchema<{
|
|
37
|
+
readonly title: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
38
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
39
|
+
readonly tags: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
40
|
+
readonly categories: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
41
|
+
}, undefined>], v.ObjectSchema<{
|
|
42
|
+
readonly success: v.BooleanSchema<undefined>;
|
|
43
|
+
readonly filePath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
44
|
+
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
45
|
+
}, undefined>, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"update-frontmatter", "action", readonly [v.ObjectSchema<{
|
|
46
|
+
readonly filePath: v.StringSchema<undefined>;
|
|
47
|
+
readonly frontmatter: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
|
|
48
|
+
}, undefined>], v.ObjectSchema<{
|
|
49
|
+
readonly success: v.BooleanSchema<undefined>;
|
|
50
|
+
}, undefined>, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"batch-update-frontmatter", "action", readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
51
|
+
readonly type: v.LiteralSchema<"set", undefined>;
|
|
52
|
+
readonly key: v.StringSchema<undefined>;
|
|
53
|
+
readonly value: v.UnknownSchema;
|
|
54
|
+
}, undefined>, v.ObjectSchema<{
|
|
55
|
+
readonly type: v.LiteralSchema<"delete", undefined>;
|
|
56
|
+
readonly key: v.StringSchema<undefined>;
|
|
57
|
+
}, undefined>, v.ObjectSchema<{
|
|
58
|
+
readonly type: v.LiteralSchema<"rename", undefined>;
|
|
59
|
+
readonly key: v.StringSchema<undefined>;
|
|
60
|
+
readonly newKey: v.StringSchema<undefined>;
|
|
61
|
+
}, undefined>], undefined>, undefined>], v.ObjectSchema<{
|
|
62
|
+
readonly total: v.NumberSchema<undefined>;
|
|
63
|
+
readonly updated: v.NumberSchema<undefined>;
|
|
64
|
+
readonly errors: v.ArraySchema<v.ObjectSchema<{
|
|
65
|
+
readonly filePath: v.StringSchema<undefined>;
|
|
66
|
+
readonly error: v.StringSchema<undefined>;
|
|
67
|
+
}, undefined>, undefined>;
|
|
68
|
+
}, undefined>, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"update-config-field", "action", readonly [v.PicklistSchema<["site", "valaxy", "theme"], undefined>, v.StringSchema<undefined>, v.UnknownSchema], v.ObjectSchema<{
|
|
69
|
+
readonly success: v.BooleanSchema<undefined>;
|
|
70
|
+
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
71
|
+
}, undefined>, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"run-migration", "action", readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>], v.ObjectSchema<{
|
|
72
|
+
readonly success: v.BooleanSchema<undefined>;
|
|
73
|
+
}, undefined>, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"open-in-editor", "action", readonly [v.ObjectSchema<{
|
|
74
|
+
readonly file: v.StringSchema<undefined>;
|
|
75
|
+
readonly line: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
76
|
+
readonly column: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
77
|
+
}, undefined>], v.VoidSchema<undefined>, devframe.DevframeNodeContext>];
|
|
78
|
+
declare function createValaxyDevframe(options?: ValaxyDevtoolsOptions): devframe.DevframeDefinition & {
|
|
79
|
+
dispose: () => Promise<void>;
|
|
80
|
+
};
|
|
81
|
+
declare function createExtensionRpc(manifest: ReturnType<typeof createManifest>, plugins: ValaxyDevtoolsPlugin[], data: ValaxyDevtoolsData): readonly [devframe_rpc.RpcFunctionDefinitionWithoutSchemas<"get-extensions", "query", [], ValaxyDevtoolsManifest, undefined, undefined, devframe.DevframeNodeContext>, devframe_rpc.RpcFunctionDefinitionWithSchemas<"run-editor-action", "query", readonly [v.StringSchema<undefined>, v.StringSchema<undefined>, v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>], v.ObjectSchema<{
|
|
82
|
+
readonly message: v.StringSchema<undefined>;
|
|
83
|
+
readonly severity: v.OptionalSchema<v.PicklistSchema<["success", "warn", "error", "info"], undefined>, undefined>;
|
|
84
|
+
}, undefined>, devframe.DevframeNodeContext>];
|
|
85
|
+
declare module 'devframe' {
|
|
86
|
+
interface DevframeRpcServerFunctions extends RpcDefinitionsToFunctionsWithNamespace<'valaxy', ReturnType<typeof createRpcFunctions>> {
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
declare module 'devframe' {
|
|
90
|
+
interface DevframeRpcServerFunctions extends RpcDefinitionsToFunctionsWithNamespace<'valaxy', ReturnType<typeof createExtensionRpc>> {
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export { createRpcFunctions as a, createValaxyDevframe as c };
|
|
95
|
+
export type { ValaxyDevtoolsOptions as V };
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Post } from 'valaxy';
|
|
2
|
+
import { V as ValaxyPageDebug } from './devtools.O-VZ9RtQ.mjs';
|
|
3
|
+
|
|
4
|
+
interface BlogWindow {
|
|
5
|
+
$frontmatter: any;
|
|
6
|
+
}
|
|
7
|
+
interface ClientOptions {
|
|
8
|
+
userRoot: string;
|
|
9
|
+
siteUrl?: string;
|
|
10
|
+
}
|
|
11
|
+
interface ClientPostList {
|
|
12
|
+
posts: ClientPageData[];
|
|
13
|
+
}
|
|
14
|
+
interface ClientPageData {
|
|
15
|
+
/** Present only in live browser snapshots; never loaded from article files. */
|
|
16
|
+
debug?: ValaxyPageDebug;
|
|
17
|
+
frontmatter: Post;
|
|
18
|
+
/**
|
|
19
|
+
* route.path
|
|
20
|
+
*/
|
|
21
|
+
routePath: string;
|
|
22
|
+
/**
|
|
23
|
+
* 绝对路径
|
|
24
|
+
*/
|
|
25
|
+
filePath: string;
|
|
26
|
+
}
|
|
27
|
+
interface ClientCollectionItem {
|
|
28
|
+
title: string;
|
|
29
|
+
key: string;
|
|
30
|
+
link?: string;
|
|
31
|
+
filePath: string;
|
|
32
|
+
frontmatter: Record<string, any>;
|
|
33
|
+
}
|
|
34
|
+
interface ClientCollectionData {
|
|
35
|
+
key: string;
|
|
36
|
+
title: string;
|
|
37
|
+
cover: string;
|
|
38
|
+
description: string;
|
|
39
|
+
collapse: boolean;
|
|
40
|
+
dirPath: string;
|
|
41
|
+
items: ClientCollectionItem[];
|
|
42
|
+
}
|
|
43
|
+
type BatchFrontmatterOperation = {
|
|
44
|
+
/**
|
|
45
|
+
* 操作类型
|
|
46
|
+
* - set: 设置/更新字段值
|
|
47
|
+
* - delete: 删除字段
|
|
48
|
+
* - rename: 重命名字段(oldKey -> newKey)
|
|
49
|
+
*/
|
|
50
|
+
type: 'set';
|
|
51
|
+
key: string;
|
|
52
|
+
value: unknown;
|
|
53
|
+
} | {
|
|
54
|
+
type: 'delete';
|
|
55
|
+
key: string;
|
|
56
|
+
} | {
|
|
57
|
+
type: 'rename';
|
|
58
|
+
key: string;
|
|
59
|
+
newKey: string;
|
|
60
|
+
};
|
|
61
|
+
interface BatchUpdateResult {
|
|
62
|
+
total: number;
|
|
63
|
+
updated: number;
|
|
64
|
+
errors: {
|
|
65
|
+
filePath: string;
|
|
66
|
+
error: string;
|
|
67
|
+
}[];
|
|
68
|
+
}
|
|
69
|
+
interface ConfigData {
|
|
70
|
+
siteConfig: Record<string, any>;
|
|
71
|
+
valaxyConfig: Record<string, any>;
|
|
72
|
+
themeConfig: Record<string, any>;
|
|
73
|
+
siteConfigExists: boolean;
|
|
74
|
+
valaxyConfigExists: boolean;
|
|
75
|
+
siteConfigPath: string;
|
|
76
|
+
valaxyConfigPath: string;
|
|
77
|
+
}
|
|
78
|
+
interface ConfigUpdateRequest {
|
|
79
|
+
configType: 'site' | 'valaxy' | 'theme';
|
|
80
|
+
fieldPath: string;
|
|
81
|
+
value: any;
|
|
82
|
+
}
|
|
83
|
+
interface CreatePostOptions {
|
|
84
|
+
/** 文章标题 */
|
|
85
|
+
title: string;
|
|
86
|
+
/** 文件路径(相对于 pages/posts/),如 'my-post.md' 或 'sub/my-post.md' */
|
|
87
|
+
path?: string;
|
|
88
|
+
/** 标签 */
|
|
89
|
+
tags?: string[];
|
|
90
|
+
/** 分类 */
|
|
91
|
+
categories?: string[];
|
|
92
|
+
}
|
|
93
|
+
interface UpdateFrontmatterRequest {
|
|
94
|
+
filePath: string;
|
|
95
|
+
frontmatter: Record<string, any>;
|
|
96
|
+
}
|
|
97
|
+
/** Markdown body and its optimistic concurrency token. */
|
|
98
|
+
interface PostContent {
|
|
99
|
+
content: string;
|
|
100
|
+
revision: string;
|
|
101
|
+
}
|
|
102
|
+
interface ServerFunctions {
|
|
103
|
+
/** Read an article body within the project's pages directory. */
|
|
104
|
+
getPostContent: (filePath: string) => Promise<PostContent>;
|
|
105
|
+
/** Save the body while preserving current frontmatter and rejecting stale edits. */
|
|
106
|
+
updatePostContent: (req: {
|
|
107
|
+
filePath: string;
|
|
108
|
+
content: string;
|
|
109
|
+
revision: string;
|
|
110
|
+
}) => Promise<PostContent>;
|
|
111
|
+
openInEditor: (options: {
|
|
112
|
+
file: string;
|
|
113
|
+
line?: number;
|
|
114
|
+
column?: number;
|
|
115
|
+
}) => Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* 获取基础配置
|
|
118
|
+
*/
|
|
119
|
+
getOptions: () => Promise<ClientOptions>;
|
|
120
|
+
/**
|
|
121
|
+
* 获取文章列表
|
|
122
|
+
*/
|
|
123
|
+
getPostList: () => Promise<ClientPostList>;
|
|
124
|
+
/**
|
|
125
|
+
* 获取页面 pageData
|
|
126
|
+
*/
|
|
127
|
+
getPageData: (pagePath: string) => Promise<ClientPageData>;
|
|
128
|
+
/**
|
|
129
|
+
* 获取合集列表
|
|
130
|
+
*/
|
|
131
|
+
getCollectionList: () => Promise<ClientCollectionData[]>;
|
|
132
|
+
/**
|
|
133
|
+
* 更新单个页面的 frontmatter(整体覆盖)
|
|
134
|
+
*/
|
|
135
|
+
updateFrontmatter: (req: UpdateFrontmatterRequest) => Promise<{
|
|
136
|
+
success: boolean;
|
|
137
|
+
}>;
|
|
138
|
+
/**
|
|
139
|
+
* 批量修改文章的 frontmatter
|
|
140
|
+
*/
|
|
141
|
+
batchUpdateFrontmatter: (filePaths: string[], operations: BatchFrontmatterOperation[]) => Promise<BatchUpdateResult>;
|
|
142
|
+
/**
|
|
143
|
+
* 获取配置数据
|
|
144
|
+
*/
|
|
145
|
+
getConfig: () => Promise<ConfigData>;
|
|
146
|
+
/**
|
|
147
|
+
* 更新配置字段
|
|
148
|
+
*/
|
|
149
|
+
updateConfigField: (configType: 'site' | 'valaxy' | 'theme', fieldPath: string, value: any) => Promise<{
|
|
150
|
+
success: boolean;
|
|
151
|
+
error?: string;
|
|
152
|
+
}>;
|
|
153
|
+
/**
|
|
154
|
+
* 运行 frontmatter 迁移
|
|
155
|
+
*/
|
|
156
|
+
runMigration: (filePaths: string[], frontmatter: Record<string, any>) => Promise<{
|
|
157
|
+
success: boolean;
|
|
158
|
+
}>;
|
|
159
|
+
/**
|
|
160
|
+
* 创建新文章
|
|
161
|
+
*/
|
|
162
|
+
createPost: (options: CreatePostOptions) => Promise<{
|
|
163
|
+
success: boolean;
|
|
164
|
+
filePath?: string;
|
|
165
|
+
error?: string;
|
|
166
|
+
}>;
|
|
167
|
+
}
|
|
168
|
+
interface ClientFunctions {
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export type { BatchFrontmatterOperation, BatchUpdateResult, BlogWindow, ClientCollectionData, ClientCollectionItem, ClientFunctions, ClientOptions, ClientPageData, ClientPostList, ConfigData, ConfigUpdateRequest, CreatePostOptions, PostContent, ServerFunctions, UpdateFrontmatterRequest };
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Post } from 'valaxy';
|
|
2
|
+
import { V as ValaxyPageDebug } from './devtools.O-VZ9RtQ.js';
|
|
3
|
+
|
|
4
|
+
interface BlogWindow {
|
|
5
|
+
$frontmatter: any;
|
|
6
|
+
}
|
|
7
|
+
interface ClientOptions {
|
|
8
|
+
userRoot: string;
|
|
9
|
+
siteUrl?: string;
|
|
10
|
+
}
|
|
11
|
+
interface ClientPostList {
|
|
12
|
+
posts: ClientPageData[];
|
|
13
|
+
}
|
|
14
|
+
interface ClientPageData {
|
|
15
|
+
/** Present only in live browser snapshots; never loaded from article files. */
|
|
16
|
+
debug?: ValaxyPageDebug;
|
|
17
|
+
frontmatter: Post;
|
|
18
|
+
/**
|
|
19
|
+
* route.path
|
|
20
|
+
*/
|
|
21
|
+
routePath: string;
|
|
22
|
+
/**
|
|
23
|
+
* 绝对路径
|
|
24
|
+
*/
|
|
25
|
+
filePath: string;
|
|
26
|
+
}
|
|
27
|
+
interface ClientCollectionItem {
|
|
28
|
+
title: string;
|
|
29
|
+
key: string;
|
|
30
|
+
link?: string;
|
|
31
|
+
filePath: string;
|
|
32
|
+
frontmatter: Record<string, any>;
|
|
33
|
+
}
|
|
34
|
+
interface ClientCollectionData {
|
|
35
|
+
key: string;
|
|
36
|
+
title: string;
|
|
37
|
+
cover: string;
|
|
38
|
+
description: string;
|
|
39
|
+
collapse: boolean;
|
|
40
|
+
dirPath: string;
|
|
41
|
+
items: ClientCollectionItem[];
|
|
42
|
+
}
|
|
43
|
+
type BatchFrontmatterOperation = {
|
|
44
|
+
/**
|
|
45
|
+
* 操作类型
|
|
46
|
+
* - set: 设置/更新字段值
|
|
47
|
+
* - delete: 删除字段
|
|
48
|
+
* - rename: 重命名字段(oldKey -> newKey)
|
|
49
|
+
*/
|
|
50
|
+
type: 'set';
|
|
51
|
+
key: string;
|
|
52
|
+
value: unknown;
|
|
53
|
+
} | {
|
|
54
|
+
type: 'delete';
|
|
55
|
+
key: string;
|
|
56
|
+
} | {
|
|
57
|
+
type: 'rename';
|
|
58
|
+
key: string;
|
|
59
|
+
newKey: string;
|
|
60
|
+
};
|
|
61
|
+
interface BatchUpdateResult {
|
|
62
|
+
total: number;
|
|
63
|
+
updated: number;
|
|
64
|
+
errors: {
|
|
65
|
+
filePath: string;
|
|
66
|
+
error: string;
|
|
67
|
+
}[];
|
|
68
|
+
}
|
|
69
|
+
interface ConfigData {
|
|
70
|
+
siteConfig: Record<string, any>;
|
|
71
|
+
valaxyConfig: Record<string, any>;
|
|
72
|
+
themeConfig: Record<string, any>;
|
|
73
|
+
siteConfigExists: boolean;
|
|
74
|
+
valaxyConfigExists: boolean;
|
|
75
|
+
siteConfigPath: string;
|
|
76
|
+
valaxyConfigPath: string;
|
|
77
|
+
}
|
|
78
|
+
interface ConfigUpdateRequest {
|
|
79
|
+
configType: 'site' | 'valaxy' | 'theme';
|
|
80
|
+
fieldPath: string;
|
|
81
|
+
value: any;
|
|
82
|
+
}
|
|
83
|
+
interface CreatePostOptions {
|
|
84
|
+
/** 文章标题 */
|
|
85
|
+
title: string;
|
|
86
|
+
/** 文件路径(相对于 pages/posts/),如 'my-post.md' 或 'sub/my-post.md' */
|
|
87
|
+
path?: string;
|
|
88
|
+
/** 标签 */
|
|
89
|
+
tags?: string[];
|
|
90
|
+
/** 分类 */
|
|
91
|
+
categories?: string[];
|
|
92
|
+
}
|
|
93
|
+
interface UpdateFrontmatterRequest {
|
|
94
|
+
filePath: string;
|
|
95
|
+
frontmatter: Record<string, any>;
|
|
96
|
+
}
|
|
97
|
+
/** Markdown body and its optimistic concurrency token. */
|
|
98
|
+
interface PostContent {
|
|
99
|
+
content: string;
|
|
100
|
+
revision: string;
|
|
101
|
+
}
|
|
102
|
+
interface ServerFunctions {
|
|
103
|
+
/** Read an article body within the project's pages directory. */
|
|
104
|
+
getPostContent: (filePath: string) => Promise<PostContent>;
|
|
105
|
+
/** Save the body while preserving current frontmatter and rejecting stale edits. */
|
|
106
|
+
updatePostContent: (req: {
|
|
107
|
+
filePath: string;
|
|
108
|
+
content: string;
|
|
109
|
+
revision: string;
|
|
110
|
+
}) => Promise<PostContent>;
|
|
111
|
+
openInEditor: (options: {
|
|
112
|
+
file: string;
|
|
113
|
+
line?: number;
|
|
114
|
+
column?: number;
|
|
115
|
+
}) => Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* 获取基础配置
|
|
118
|
+
*/
|
|
119
|
+
getOptions: () => Promise<ClientOptions>;
|
|
120
|
+
/**
|
|
121
|
+
* 获取文章列表
|
|
122
|
+
*/
|
|
123
|
+
getPostList: () => Promise<ClientPostList>;
|
|
124
|
+
/**
|
|
125
|
+
* 获取页面 pageData
|
|
126
|
+
*/
|
|
127
|
+
getPageData: (pagePath: string) => Promise<ClientPageData>;
|
|
128
|
+
/**
|
|
129
|
+
* 获取合集列表
|
|
130
|
+
*/
|
|
131
|
+
getCollectionList: () => Promise<ClientCollectionData[]>;
|
|
132
|
+
/**
|
|
133
|
+
* 更新单个页面的 frontmatter(整体覆盖)
|
|
134
|
+
*/
|
|
135
|
+
updateFrontmatter: (req: UpdateFrontmatterRequest) => Promise<{
|
|
136
|
+
success: boolean;
|
|
137
|
+
}>;
|
|
138
|
+
/**
|
|
139
|
+
* 批量修改文章的 frontmatter
|
|
140
|
+
*/
|
|
141
|
+
batchUpdateFrontmatter: (filePaths: string[], operations: BatchFrontmatterOperation[]) => Promise<BatchUpdateResult>;
|
|
142
|
+
/**
|
|
143
|
+
* 获取配置数据
|
|
144
|
+
*/
|
|
145
|
+
getConfig: () => Promise<ConfigData>;
|
|
146
|
+
/**
|
|
147
|
+
* 更新配置字段
|
|
148
|
+
*/
|
|
149
|
+
updateConfigField: (configType: 'site' | 'valaxy' | 'theme', fieldPath: string, value: any) => Promise<{
|
|
150
|
+
success: boolean;
|
|
151
|
+
error?: string;
|
|
152
|
+
}>;
|
|
153
|
+
/**
|
|
154
|
+
* 运行 frontmatter 迁移
|
|
155
|
+
*/
|
|
156
|
+
runMigration: (filePaths: string[], frontmatter: Record<string, any>) => Promise<{
|
|
157
|
+
success: boolean;
|
|
158
|
+
}>;
|
|
159
|
+
/**
|
|
160
|
+
* 创建新文章
|
|
161
|
+
*/
|
|
162
|
+
createPost: (options: CreatePostOptions) => Promise<{
|
|
163
|
+
success: boolean;
|
|
164
|
+
filePath?: string;
|
|
165
|
+
error?: string;
|
|
166
|
+
}>;
|
|
167
|
+
}
|
|
168
|
+
interface ClientFunctions {
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export type { BatchFrontmatterOperation, BatchUpdateResult, BlogWindow, ClientCollectionData, ClientCollectionItem, ClientFunctions, ClientOptions, ClientPageData, ClientPostList, ConfigData, ConfigUpdateRequest, CreatePostOptions, PostContent, ServerFunctions, UpdateFrontmatterRequest };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|