@clarify-labs/cli 0.6.6 → 0.7.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/output/cli.cjs +5 -4
- package/output/cli.cjs.map +1 -1
- package/output/cli.js +5 -4
- package/output/cli.js.map +1 -1
- package/output/core/config-schema.d.ts +25 -4
- package/output/core/search-language.d.ts +1 -0
- package/output/core/ssg.d.ts +1 -1
- package/output/core/temp-dir.d.ts +2 -0
- package/output/core/virtual-modules.d.ts +8 -1
- package/output/index.cjs +1 -1
- package/output/index.js +1 -1
- package/output/parsers/routes.d.ts +4 -2
- package/output/{plugin-DC2f5YAH.js → plugin-BNzlJ4o7.js} +413 -112
- package/output/plugin-BNzlJ4o7.js.map +1 -0
- package/output/{plugin-GTN_SQ7d.cjs → plugin-dzXRzjdX.cjs} +417 -110
- package/output/plugin-dzXRzjdX.cjs.map +1 -0
- package/output/plugins/openapi/virtual-modules.d.ts +1 -1
- package/output/plugins/search-index/index.d.ts +2 -0
- package/output/types.d.ts +7 -1
- package/package.json +5 -3
- package/output/plugin-DC2f5YAH.js.map +0 -1
- package/output/plugin-GTN_SQ7d.cjs.map +0 -1
|
@@ -31,7 +31,7 @@ export declare const clarifyBannerConfigSchema: z.ZodObject<{
|
|
|
31
31
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
32
32
|
dismissible: z.ZodOptional<z.ZodBoolean>;
|
|
33
33
|
}, z.core.$strip>;
|
|
34
|
-
export declare const
|
|
34
|
+
export declare const clarifyFooterLinksConfigSchema: z.ZodObject<{
|
|
35
35
|
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
36
36
|
label: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
37
37
|
href: z.ZodString;
|
|
@@ -39,7 +39,16 @@ export declare const clarifyFooterConfigSchema: z.ZodObject<{
|
|
|
39
39
|
}, z.core.$strip>>>;
|
|
40
40
|
socials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
41
41
|
copyright: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
42
|
-
}, z.core.$
|
|
42
|
+
}, z.core.$strict>;
|
|
43
|
+
export declare const clarifyFooterConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
44
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
45
|
+
label: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
46
|
+
href: z.ZodString;
|
|
47
|
+
external: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
}, z.core.$strip>>>;
|
|
49
|
+
socials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
50
|
+
copyright: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
51
|
+
}, z.core.$strict>, z.ZodString]>;
|
|
43
52
|
export declare const clarifySourceConfigSchema: z.ZodObject<{
|
|
44
53
|
repository: z.ZodString;
|
|
45
54
|
branch: z.ZodOptional<z.ZodString>;
|
|
@@ -47,11 +56,13 @@ export declare const clarifySourceConfigSchema: z.ZodObject<{
|
|
|
47
56
|
}, z.core.$strip>;
|
|
48
57
|
export declare const clarifyPagesItemSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
49
58
|
page: z.ZodString;
|
|
59
|
+
path: z.ZodOptional<z.ZodString>;
|
|
50
60
|
title: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
51
61
|
icon: z.ZodOptional<z.ZodString>;
|
|
52
62
|
redirect: z.ZodOptional<z.ZodString>;
|
|
53
63
|
}, z.core.$strip>, z.ZodObject<{
|
|
54
64
|
openapi: z.ZodString;
|
|
65
|
+
path: z.ZodOptional<z.ZodString>;
|
|
55
66
|
icon: z.ZodOptional<z.ZodString>;
|
|
56
67
|
title: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
57
68
|
filter: z.ZodOptional<z.ZodObject<{
|
|
@@ -63,11 +74,13 @@ export declare const clarifyPagesGroupSchema: z.ZodObject<{
|
|
|
63
74
|
icon: z.ZodOptional<z.ZodString>;
|
|
64
75
|
pages: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
65
76
|
page: z.ZodString;
|
|
77
|
+
path: z.ZodOptional<z.ZodString>;
|
|
66
78
|
title: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
67
79
|
icon: z.ZodOptional<z.ZodString>;
|
|
68
80
|
redirect: z.ZodOptional<z.ZodString>;
|
|
69
81
|
}, z.core.$strip>, z.ZodObject<{
|
|
70
82
|
openapi: z.ZodString;
|
|
83
|
+
path: z.ZodOptional<z.ZodString>;
|
|
71
84
|
icon: z.ZodOptional<z.ZodString>;
|
|
72
85
|
title: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
73
86
|
filter: z.ZodOptional<z.ZodObject<{
|
|
@@ -80,11 +93,13 @@ export declare const clarifyPagesConfigSchema: z.ZodUnion<readonly [z.ZodArray<z
|
|
|
80
93
|
icon: z.ZodOptional<z.ZodString>;
|
|
81
94
|
pages: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
82
95
|
page: z.ZodString;
|
|
96
|
+
path: z.ZodOptional<z.ZodString>;
|
|
83
97
|
title: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
84
98
|
icon: z.ZodOptional<z.ZodString>;
|
|
85
99
|
redirect: z.ZodOptional<z.ZodString>;
|
|
86
100
|
}, z.core.$strip>, z.ZodObject<{
|
|
87
101
|
openapi: z.ZodString;
|
|
102
|
+
path: z.ZodOptional<z.ZodString>;
|
|
88
103
|
icon: z.ZodOptional<z.ZodString>;
|
|
89
104
|
title: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
90
105
|
filter: z.ZodOptional<z.ZodObject<{
|
|
@@ -100,11 +115,13 @@ export declare const clarifyTabItemSchema: z.ZodObject<{
|
|
|
100
115
|
icon: z.ZodOptional<z.ZodString>;
|
|
101
116
|
pages: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
102
117
|
page: z.ZodString;
|
|
118
|
+
path: z.ZodOptional<z.ZodString>;
|
|
103
119
|
title: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
104
120
|
icon: z.ZodOptional<z.ZodString>;
|
|
105
121
|
redirect: z.ZodOptional<z.ZodString>;
|
|
106
122
|
}, z.core.$strip>, z.ZodObject<{
|
|
107
123
|
openapi: z.ZodString;
|
|
124
|
+
path: z.ZodOptional<z.ZodString>;
|
|
108
125
|
icon: z.ZodOptional<z.ZodString>;
|
|
109
126
|
title: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
110
127
|
filter: z.ZodOptional<z.ZodObject<{
|
|
@@ -121,11 +138,13 @@ export declare const clarifyTabsConfigSchema: z.ZodArray<z.ZodObject<{
|
|
|
121
138
|
icon: z.ZodOptional<z.ZodString>;
|
|
122
139
|
pages: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
123
140
|
page: z.ZodString;
|
|
141
|
+
path: z.ZodOptional<z.ZodString>;
|
|
124
142
|
title: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
125
143
|
icon: z.ZodOptional<z.ZodString>;
|
|
126
144
|
redirect: z.ZodOptional<z.ZodString>;
|
|
127
145
|
}, z.core.$strip>, z.ZodObject<{
|
|
128
146
|
openapi: z.ZodString;
|
|
147
|
+
path: z.ZodOptional<z.ZodString>;
|
|
129
148
|
icon: z.ZodOptional<z.ZodString>;
|
|
130
149
|
title: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
131
150
|
filter: z.ZodOptional<z.ZodObject<{
|
|
@@ -364,7 +383,7 @@ export declare const clarifyProjectConfigSchema: z.ZodObject<{
|
|
|
364
383
|
content: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
365
384
|
dismissible: z.ZodOptional<z.ZodBoolean>;
|
|
366
385
|
}, z.core.$strip>>;
|
|
367
|
-
footer: z.ZodOptional<z.ZodObject<{
|
|
386
|
+
footer: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
368
387
|
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
369
388
|
label: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
370
389
|
href: z.ZodString;
|
|
@@ -372,7 +391,7 @@ export declare const clarifyProjectConfigSchema: z.ZodObject<{
|
|
|
372
391
|
}, z.core.$strip>>>;
|
|
373
392
|
socials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
374
393
|
copyright: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
375
|
-
}, z.core.$
|
|
394
|
+
}, z.core.$strict>, z.ZodString]>>;
|
|
376
395
|
i18n: z.ZodOptional<z.ZodObject<{
|
|
377
396
|
defaultLocale: z.ZodOptional<z.ZodString>;
|
|
378
397
|
missing: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"fallback">, z.ZodLiteral<"404">, z.ZodLiteral<"hide">]>>;
|
|
@@ -390,11 +409,13 @@ export declare const clarifyProjectConfigSchema: z.ZodObject<{
|
|
|
390
409
|
icon: z.ZodOptional<z.ZodString>;
|
|
391
410
|
pages: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
392
411
|
page: z.ZodString;
|
|
412
|
+
path: z.ZodOptional<z.ZodString>;
|
|
393
413
|
title: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
394
414
|
icon: z.ZodOptional<z.ZodString>;
|
|
395
415
|
redirect: z.ZodOptional<z.ZodString>;
|
|
396
416
|
}, z.core.$strip>, z.ZodObject<{
|
|
397
417
|
openapi: z.ZodString;
|
|
418
|
+
path: z.ZodOptional<z.ZodString>;
|
|
398
419
|
icon: z.ZodOptional<z.ZodString>;
|
|
399
420
|
title: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
400
421
|
filter: z.ZodOptional<z.ZodObject<{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function toPagefindLanguage(locale: string | undefined): string;
|
package/output/core/ssg.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare function readIndexHtml(outputDirectory: string): string | undefin
|
|
|
4
4
|
export declare function injectSSRIntoTemplate(template: string, appHtml: string, projectConfig: ResolvedProjectConfig, route?: ContentRoute): string;
|
|
5
5
|
export declare function isNotFoundRoute(route: ContentRoute): boolean;
|
|
6
6
|
export declare function routeOutputFiles(outputDirectory: string, route: ContentRoute): string[];
|
|
7
|
-
export declare const SSR_ENTRY_CODE = "import { renderToHTML } from '@clarify-labs/renderer/server';\nimport { routes, navigation } from 'virtual:clarify-routes/server';\nimport { config } from 'virtual:clarify-config';\nimport { openApis } from 'virtual:clarify-runtime';\n\nexport function render(url) {\n return renderToHTML({ config, routes, navigation, openApis, url, themeEditor: config.theme.editor });\n}";
|
|
7
|
+
export declare const SSR_ENTRY_CODE = "import { renderToHTML } from '@clarify-labs/renderer/server';\nimport { routes, navigation } from 'virtual:clarify-routes/server';\nimport { config } from 'virtual:clarify-config';\nimport { openApis, footerComponent } from 'virtual:clarify-runtime';\n\nexport function render(url) {\n return renderToHTML({ config, routes, navigation, openApis, footerComponent, url, themeEditor: config.theme.editor });\n}";
|
|
8
8
|
export declare function createTempEntryFile(content: string): string;
|
|
9
9
|
export declare function buildSSRBundle(root: string, ssrEntry: string, ssrOutDir: string, plugins: Plugin[]): Promise<void>;
|
|
10
10
|
export declare function renderSSGRoutes(routes: ContentRoute[], projectConfig: ResolvedProjectConfig, outputDirectory: string, ssrBundlePath: string, failOnError?: boolean): Promise<void>;
|
|
@@ -6,6 +6,13 @@ export declare const VIRTUAL_RUNTIME = "virtual:clarify-runtime";
|
|
|
6
6
|
export declare const VIRTUAL_CLIENT_ENTRY = "virtual:clarify-entry-client";
|
|
7
7
|
export declare const RESOLVED_CLIENT_ENTRY: string;
|
|
8
8
|
export type VirtualModules = Map<string, string>;
|
|
9
|
+
type RuntimeImports = {
|
|
10
|
+
footerComponent?: string;
|
|
11
|
+
};
|
|
12
|
+
type RuntimeModuleOptions = {
|
|
13
|
+
imports?: RuntimeImports;
|
|
14
|
+
footerComponentSource?: 'path';
|
|
15
|
+
};
|
|
9
16
|
type BuildVirtualModulesArgs = {
|
|
10
17
|
projectConfig: ResolvedProjectConfig;
|
|
11
18
|
generateOptions: ResolvedBuildOptions;
|
|
@@ -20,7 +27,7 @@ export declare function resolveVirtualId(id: string): string;
|
|
|
20
27
|
export declare function stripVirtualPrefix(id: string): string;
|
|
21
28
|
export declare function generateConfigModule(projectConfig: ResolvedProjectConfig, buildOptions: ResolvedBuildOptions): string;
|
|
22
29
|
export declare function generateRoutesModule(routes: ContentRoute[], resolvedNavigation?: NavigationTree, projectConfig?: ResolvedProjectConfig, mode?: 'client' | 'server'): string;
|
|
23
|
-
export declare function createRuntimeModule(): string;
|
|
30
|
+
export declare function createRuntimeModule(options?: RuntimeModuleOptions): string;
|
|
24
31
|
export declare function createClientEntryModule(options?: CreateClientEntryModuleOptions): string;
|
|
25
32
|
export declare function buildVirtualModules(args: BuildVirtualModulesArgs): VirtualModules;
|
|
26
33
|
export {};
|
package/output/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_plugin = require("./plugin-
|
|
2
|
+
const require_plugin = require("./plugin-dzXRzjdX.cjs");
|
|
3
3
|
exports.clarifyPlugin = require_plugin.clarifyPlugin;
|
|
4
4
|
exports.defineConfig = require_plugin.defineConfig;
|
package/output/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as defineConfig, t as clarifyPlugin } from "./plugin-
|
|
1
|
+
import { n as defineConfig, t as clarifyPlugin } from "./plugin-BNzlJ4o7.js";
|
|
2
2
|
export { clarifyPlugin, defineConfig };
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { ContentRoute, ContentSection, ClarifyNavigationNode, ClarifyPagesConfig, ClarifyPagesGroup, ClarifyLocalizedText, ClarifyTabsConfig, LocalizedNavigation, LocalizedTabbedNavigation, ResolvedClarifyI18nConfig, TabbedNavigation } from '../types.js';
|
|
2
2
|
/** 从 MDX/Markdown 内容中提取 H2/H3 章节 */
|
|
3
3
|
export declare function extractMdxSections(content: string): ContentSection[];
|
|
4
|
+
export declare function normalizePath(path: string): string;
|
|
4
5
|
export declare function openAPITagsPathSegment(tags: string[]): string;
|
|
5
6
|
export declare function basePathFromRef(ref: string): string;
|
|
6
|
-
export declare function openAPIPagePathFromRef(ref: string, tagFilter?: string[]): string;
|
|
7
|
-
export declare function routePathFromRef(ref: string): string;
|
|
7
|
+
export declare function openAPIPagePathFromRef(ref: string, tagFilter?: string[], explicitPath?: string): string;
|
|
8
|
+
export declare function routePathFromRef(ref: string, explicitPath?: string): string;
|
|
8
9
|
export declare function virtualModuleIdFromRef(ref: string): string;
|
|
9
10
|
export declare function localizedRoutePath(basePath: string, locale: string, i18n: ResolvedClarifyI18nConfig): string;
|
|
10
11
|
export declare function resolveLocalizedText(text: ClarifyLocalizedText | undefined, locale: string, fallbackLocale?: string): string | undefined;
|
|
11
12
|
export declare function findContentRoutes(dir: string, base?: string): ContentRoute[];
|
|
12
13
|
export declare function findLocalizedContentRoutes(contentRoot: string, i18n?: ResolvedClarifyI18nConfig): ContentRoute[];
|
|
13
14
|
export declare function buildNavigation(routes: ContentRoute[]): ClarifyNavigationNode[];
|
|
15
|
+
export declare function applyConfiguredPageRoutePaths(routes: ContentRoute[], tabs?: ClarifyTabsConfig, i18n?: ResolvedClarifyI18nConfig): ContentRoute[];
|
|
14
16
|
export declare function buildNavigationFromTabsConfig(routes: ContentRoute[], tabs: ClarifyTabsConfig): TabbedNavigation;
|
|
15
17
|
export declare function buildNavigationFromConfig(routes: ContentRoute[], config: ClarifyPagesGroup[]): ClarifyNavigationNode[];
|
|
16
18
|
export declare function buildLocalizedNavigation(routes: ContentRoute[], config: ClarifyPagesConfig | undefined, i18n?: ResolvedClarifyI18nConfig): LocalizedNavigation | undefined;
|