@clarify-labs/cli 0.9.3 → 0.10.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/spawn.d.ts +1 -1
- package/output/cli.cjs +60 -128
- package/output/cli.cjs.map +1 -1
- package/output/cli.js +56 -124
- package/output/cli.js.map +1 -1
- package/output/core/adapters.d.ts +11 -0
- package/output/core/{config-schema.d.ts → config/config-schema.d.ts} +1 -10
- package/output/core/{config.d.ts → config/config.d.ts} +1 -1
- package/output/core/{options.d.ts → config/options.d.ts} +1 -1
- package/output/core/{user-config.d.ts → config/user-config.d.ts} +1 -1
- package/output/core/engine/context.d.ts +51 -0
- package/output/core/engine/engine.d.ts +68 -0
- package/output/core/engine/phases.d.ts +10 -0
- package/output/core/engine/types.d.ts +26 -0
- package/output/core/{builtin.d.ts → plugin/builtin.d.ts} +1 -1
- package/output/core/{hooks.d.ts → plugin/hooks.d.ts} +2 -1
- package/output/core/plugin/manager.d.ts +9 -0
- package/output/core/project/project-context.d.ts +16 -0
- package/output/core/{project-info.d.ts → project/project-info.d.ts} +3 -3
- package/output/core/{env-types.d.ts → runtime/env-types.d.ts} +1 -1
- package/output/core/runtime/html-template.d.ts +13 -0
- package/output/core/{ssg.d.ts → runtime/ssg.d.ts} +3 -3
- package/output/core/runtime/startup.d.ts +8 -0
- package/output/core/{virtual-modules.d.ts → runtime/virtual-modules.d.ts} +16 -13
- package/output/core/{vite-config.d.ts → runtime/vite-config.d.ts} +2 -1
- package/output/{plugin-poS3N83A.js → engine-3f5Tpa-6.js} +2403 -1804
- package/output/engine-3f5Tpa-6.js.map +1 -0
- package/output/{plugin-BUFe4vEb.cjs → engine-I04EZzjg.cjs} +2425 -1815
- package/output/engine-I04EZzjg.cjs.map +1 -0
- package/output/index.cjs +5 -3
- package/output/index.d.ts +6 -4
- package/output/index.js +2 -2
- package/output/parsers/content/content.d.ts +20 -0
- package/output/parsers/markdown/mdx.d.ts +37 -0
- package/output/{core → parsers/router}/dev-routes.d.ts +2 -2
- package/output/parsers/{routes.d.ts → routes/routes.d.ts} +2 -2
- package/output/parsers/{routes.test-utils.d.ts → routes/routes.test-utils.d.ts} +1 -1
- package/output/plugins/openapi/parser.d.ts +1 -1
- package/output/plugins/openapi/virtual-modules.d.ts +1 -4
- package/output/plugins/variables/index.d.ts +2 -1
- package/output/types.d.ts +40 -5
- package/package.json +12 -12
- package/output/core/content.d.ts +0 -5
- package/output/core/plugin.d.ts +0 -3
- package/output/core/site.d.ts +0 -17
- package/output/parsers/content.d.ts +0 -11
- package/output/parsers/mdx.d.ts +0 -13
- package/output/parsers/variables.d.ts +0 -2
- package/output/plugin-BUFe4vEb.cjs.map +0 -1
- package/output/plugin-poS3N83A.js.map +0 -1
- /package/output/core/{temp-dir.d.ts → project/temp-dir.d.ts} +0 -0
- /package/output/core/{log.d.ts → runtime/log.d.ts} +0 -0
- /package/output/core/{runtime-deps.d.ts → runtime/runtime-deps.d.ts} +0 -0
- /package/output/parsers/{frontmatter.d.ts → markdown/frontmatter.d.ts} +0 -0
- /package/output/{core → parsers/markdown}/utils.d.ts +0 -0
- /package/output/{core → parsers}/theme.d.ts +0 -0
- /package/output/{core → plugins/search-index}/search-language.d.ts +0 -0
package/output/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
1
|
+
export { createViteAdapter } from './core/adapters.js';
|
|
2
|
+
export { ClarifyEngine, createClarifyEngine } from './core/engine/engine.js';
|
|
3
|
+
export { defineConfig } from './core/config/user-config.js';
|
|
4
|
+
export type { ClarifyEngineRuntime, PrepareOptions } from './core/engine/engine.js';
|
|
5
|
+
export type { PhaseName, TapPhaseName, TapHook, InterceptHook, PipelineHook, CollectorHook } from './core/engine/phases.js';
|
|
4
6
|
export * from './types.js';
|
|
5
|
-
export type { ClarifyConfig } from './core/user-config.js';
|
|
7
|
+
export type { ClarifyConfig } from './core/config/user-config.js';
|
|
6
8
|
export type { UISlotName, SlotContext, UISlotRegistration } from '@clarify-labs/renderer';
|
package/output/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { c as defineConfig, n as createClarifyEngine, s as createViteAdapter, t as ClarifyEngine } from "./engine-3f5Tpa-6.js";
|
|
2
|
+
export { ClarifyEngine, createClarifyEngine, createViteAdapter, defineConfig };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ClarifyContentKind, ClarifyContentTransformInput, ClarifyHookContext, ClarifyPlugin } from '../../types.js';
|
|
2
|
+
export type ProcessedMdxContent = {
|
|
3
|
+
frontmatter: Record<string, unknown>;
|
|
4
|
+
content: string;
|
|
5
|
+
};
|
|
6
|
+
export type ContentTransform = (input: ClarifyContentTransformInput) => Promise<ClarifyContentTransformInput> | ClarifyContentTransformInput;
|
|
7
|
+
export type ContentProcessor = {
|
|
8
|
+
processMdx(source: string, filePath?: string): Promise<ProcessedMdxContent>;
|
|
9
|
+
processText(source: string, kind: Exclude<ClarifyContentKind, 'mdx'>, filePath?: string): Promise<string>;
|
|
10
|
+
};
|
|
11
|
+
export declare function createContentProcessor(transform?: ContentTransform): ContentProcessor;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a ContentProcessor that forwards each piece of content through the
|
|
14
|
+
* `content:transform` pipeline hook before it is parsed.
|
|
15
|
+
*
|
|
16
|
+
* Plugins that need to read content (site-discovery, openapi) call this with
|
|
17
|
+
* the plugins list from their hook context. There is no global registry -
|
|
18
|
+
* each call produces an independent processor bound to the given plugins.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createProjectContentProcessor(plugins: ClarifyPlugin[], ctx: ClarifyHookContext): ContentProcessor;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ContentDiagnostic } from '../../types.js';
|
|
2
|
+
type HastNode = {
|
|
3
|
+
type: string;
|
|
4
|
+
tagName?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
properties?: Record<string, unknown>;
|
|
7
|
+
children?: HastNode[];
|
|
8
|
+
};
|
|
9
|
+
export declare function rehypeParseCodeBlocks(): (tree: HastNode) => void;
|
|
10
|
+
export declare function rehypeShiki(): (tree: HastNode) => Promise<void>;
|
|
11
|
+
export declare function rehypeSlugSections(): (tree: HastNode) => void;
|
|
12
|
+
export declare const remarkPlugins: unknown[];
|
|
13
|
+
export declare const rehypePlugins: (typeof rehypeSlugSections)[];
|
|
14
|
+
/**
|
|
15
|
+
* Validate MDX content for diagnostics WITHOUT running the build-time rehype
|
|
16
|
+
* pipeline (Shiki highlighting, slug injection, code-block parsing).
|
|
17
|
+
*
|
|
18
|
+
* `rehypePlugins` includes `rehypeShiki`, which loads grammar/WASM assets and
|
|
19
|
+
* is expensive. The real highlighting happens at Vite build time via the
|
|
20
|
+
* `@mdx-js/rollup` plugin (see `createMdxPlugin` in `core/adapters.ts`), which
|
|
21
|
+
* runs the full remark + rehype pipeline. Re-running it here, during route
|
|
22
|
+
* discovery (Phase 3), would compile every `.mdx` file twice and invoke Shiki
|
|
23
|
+
* once per file per `engine.refresh()` — see ARCHITECTURE.md §2.2 which states
|
|
24
|
+
* "不应在 core 中执行代码高亮".
|
|
25
|
+
*
|
|
26
|
+
* The remark pipeline still runs (shared with the Vite plugin via
|
|
27
|
+
* `remarkPlugins`), so MDX/JSX syntax errors — the only class of error this
|
|
28
|
+
* diagnostic is meant to surface ahead of the Vite build — are caught. The
|
|
29
|
+
* output is discarded; only the thrown error is used.
|
|
30
|
+
*/
|
|
31
|
+
export declare function compileMdxContent(content: string, filePath?: string, projectRoot?: string): Promise<{
|
|
32
|
+
ok: true;
|
|
33
|
+
} | {
|
|
34
|
+
ok: false;
|
|
35
|
+
diagnostic: ContentDiagnostic;
|
|
36
|
+
}>;
|
|
37
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
-
import {
|
|
2
|
+
import { ClarifyProjectContext, ContentRoute } from '../../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Dev-only HTTP endpoint that exposes the in-memory route manifest so external
|
|
5
5
|
* tools (e.g. the VS Code extension) can resolve a content file path to its
|
|
@@ -55,4 +55,4 @@ export declare function inferRouteForFile(filePath: string, contentRoot: string,
|
|
|
55
55
|
* Handle a request to the dev route endpoint. Pure function — does not touch
|
|
56
56
|
* the network directly, only reads the request body and writes to `res`.
|
|
57
57
|
*/
|
|
58
|
-
export declare function handleDevRouteRequest(req: IncomingMessage, res: ServerResponse, routes: ContentRoute[],
|
|
58
|
+
export declare function handleDevRouteRequest(req: IncomingMessage, res: ServerResponse, routes: ContentRoute[], context: ClarifyProjectContext): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContentRoute, ContentSection, ClarifyNavigationNode, ClarifyPagesConfig, ClarifyPagesGroup, ClarifyLocalizedText, ClarifyTabsConfig, LocalizedNavigation, LocalizedTabbedNavigation, ResolvedClarifyI18nConfig, TabbedNavigation } from '
|
|
2
|
-
import { ContentProcessor } from '
|
|
1
|
+
import { ContentRoute, ContentSection, ClarifyNavigationNode, ClarifyPagesConfig, ClarifyPagesGroup, ClarifyLocalizedText, ClarifyTabsConfig, LocalizedNavigation, LocalizedTabbedNavigation, ResolvedClarifyI18nConfig, TabbedNavigation } from '../../types.js';
|
|
2
|
+
import { ContentProcessor } from '../content/content.js';
|
|
3
3
|
export type FindContentRoutesOptions = {
|
|
4
4
|
contentProcessor?: ContentProcessor;
|
|
5
5
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ContentRoute, ResolvedClarifyI18nConfig } from '
|
|
1
|
+
import { ContentRoute, ResolvedClarifyI18nConfig } from '../../types.js';
|
|
2
2
|
export declare function mdxRoute(route: Omit<ContentRoute, 'kind'>): ContentRoute;
|
|
3
3
|
export declare const testI18n: ResolvedClarifyI18nConfig;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContentProcessor } from '../../parsers/content.js';
|
|
1
|
+
import { ContentProcessor } from '../../parsers/content/content.js';
|
|
2
2
|
import { ContentDiagnostic, ContentRoute, ContentSection, OpenAPISpec } from '../../types.js';
|
|
3
3
|
export type OpenAPIParseResult = {
|
|
4
4
|
ok: true;
|
|
@@ -6,10 +6,7 @@ export declare function generateOpenAPIRegistryModule(openApis: Record<string, O
|
|
|
6
6
|
/** Generate a virtual module that exports a single spec as default. */
|
|
7
7
|
export declare function generateOpenAPISpecModule(spec: OpenAPISpec): string;
|
|
8
8
|
type OpenAPIPageModuleOptions = {
|
|
9
|
-
|
|
10
|
-
specKey: string;
|
|
11
|
-
/** virtual:clarify-page/… key used for OpenApisContext registry lookup (namespace 3). */
|
|
12
|
-
specRegistryKey: string;
|
|
9
|
+
spec: OpenAPISpec;
|
|
13
10
|
tagFilter?: string[];
|
|
14
11
|
};
|
|
15
12
|
export declare function generateOpenAPIPageModule(opts: OpenAPIPageModuleOptions): string;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { ClarifyPlugin } from '../../types.js';
|
|
1
|
+
import { ClarifyVariablesConfig, ClarifyPlugin } from '../../types.js';
|
|
2
|
+
export declare function applyVariables(content: string, variables?: ClarifyVariablesConfig): string;
|
|
2
3
|
export declare function createVariablesPlugin(): ClarifyPlugin;
|
package/output/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { OpenAPIV3, OpenAPIV3_1 } from 'openapi-types';
|
|
2
2
|
import { HtmlTagDescriptor, ViteDevServer } from 'vite';
|
|
3
3
|
import { UISlotRegistration } from '@clarify-labs/renderer';
|
|
4
|
-
import { ResolvedBuildOptions } from './core/options.js';
|
|
5
|
-
export type { ClarifyBuildOptions, ResolvedBuildOptions, } from './core/options.js';
|
|
4
|
+
import { ResolvedBuildOptions } from './core/config/options.js';
|
|
5
|
+
export type { ClarifyBuildOptions, ResolvedBuildOptions, } from './core/config/options.js';
|
|
6
6
|
export type OpenAPISpec = OpenAPIV3.Document | OpenAPIV3_1.Document;
|
|
7
7
|
export type ClarifyLogoConfig = string | {
|
|
8
8
|
light?: string;
|
|
@@ -220,10 +220,11 @@ export type ContentSection = {
|
|
|
220
220
|
tags?: string[];
|
|
221
221
|
};
|
|
222
222
|
export type ContentDiagnostic = {
|
|
223
|
+
kind: string;
|
|
223
224
|
title: string;
|
|
224
225
|
message: string;
|
|
226
|
+
details?: string;
|
|
225
227
|
filePath?: string;
|
|
226
|
-
cause?: string;
|
|
227
228
|
};
|
|
228
229
|
export type ContentRoute = {
|
|
229
230
|
path: string;
|
|
@@ -278,11 +279,21 @@ export type ClarifyNavigationNode = {
|
|
|
278
279
|
children?: ClarifyNavigationNode[];
|
|
279
280
|
sections?: Pick<ContentSection, 'id' | 'title' | 'badge' | 'tags'>[];
|
|
280
281
|
};
|
|
281
|
-
export type
|
|
282
|
+
export type ClarifyProjectContext = {
|
|
283
|
+
projectRoot: string;
|
|
284
|
+
contentRoot: string;
|
|
282
285
|
projectConfig: ResolvedProjectConfig;
|
|
283
286
|
generateOptions: ResolvedBuildOptions;
|
|
287
|
+
version: string;
|
|
288
|
+
};
|
|
289
|
+
export type ClarifyHookContext = ClarifyProjectContext & {
|
|
284
290
|
routes: ContentRoute[];
|
|
285
291
|
navigation: NavigationTree;
|
|
292
|
+
plugins: ClarifyPlugin[];
|
|
293
|
+
get<T>(key: string): T | undefined;
|
|
294
|
+
set<T>(key: string, value: T): void;
|
|
295
|
+
has(key: string): boolean;
|
|
296
|
+
delete(key: string): boolean;
|
|
286
297
|
};
|
|
287
298
|
export type ClarifyRouteDiscoveryInput = {
|
|
288
299
|
contentRoot: string;
|
|
@@ -309,10 +320,11 @@ export type ClarifyEmitAsset = {
|
|
|
309
320
|
/** Asset content as a UTF-8 string or raw bytes. */
|
|
310
321
|
source: string | Uint8Array;
|
|
311
322
|
};
|
|
323
|
+
export type ClarifyTapHook = (ctx: ClarifyHookContext) => Promise<void> | void;
|
|
324
|
+
export type ClarifyInterceptHook = (ctx: ClarifyHookContext) => Promise<boolean> | boolean;
|
|
312
325
|
export type ClarifyHooks = {
|
|
313
326
|
'content:transform'?: (input: ClarifyContentTransformInput, ctx: ClarifyHookContext) => Promise<ClarifyContentTransformInput> | ClarifyContentTransformInput;
|
|
314
327
|
'pages:resolved'?: (pages: ClarifyPage[], ctx: ClarifyHookContext) => Promise<ClarifyPage[]> | ClarifyPage[];
|
|
315
|
-
'page:transform'?: (page: ClarifyPage, ctx: ClarifyHookContext) => Promise<ClarifyPage> | ClarifyPage;
|
|
316
328
|
'routes:discover'?: (input: ClarifyRouteDiscoveryInput, ctx: ClarifyHookContext) => Promise<ClarifyRouteDiscoveryInput> | ClarifyRouteDiscoveryInput;
|
|
317
329
|
'routes:discovered'?: (routes: ContentRoute[], ctx: ClarifyHookContext) => Promise<ContentRoute[]> | ContentRoute[];
|
|
318
330
|
'routes:resolved'?: (input: {
|
|
@@ -330,9 +342,32 @@ export type ClarifyHooks = {
|
|
|
330
342
|
'dev:configureServer'?: (server: ViteDevServer, ctx: ClarifyHookContext) => Promise<void> | void;
|
|
331
343
|
'build:assets'?: (ctx: ClarifyHookContext) => Promise<ClarifyEmitAsset[]> | ClarifyEmitAsset[];
|
|
332
344
|
'build:done'?: (ctx: ClarifyHookContext) => Promise<void> | void;
|
|
345
|
+
'before:config:load'?: ClarifyTapHook;
|
|
346
|
+
'after:config:load'?: ClarifyTapHook;
|
|
347
|
+
'before:config:resolve'?: ClarifyTapHook;
|
|
348
|
+
'after:config:resolve'?: ClarifyTapHook;
|
|
349
|
+
'before:plugins:load'?: ClarifyTapHook;
|
|
350
|
+
'after:plugins:load'?: ClarifyTapHook;
|
|
351
|
+
'before:site:discover'?: ClarifyTapHook;
|
|
352
|
+
'after:site:discover'?: ClarifyTapHook;
|
|
353
|
+
'before:content:process'?: ClarifyTapHook;
|
|
354
|
+
'after:content:process'?: ClarifyTapHook;
|
|
355
|
+
'before:modules:build'?: ClarifyTapHook;
|
|
356
|
+
'after:modules:build'?: ClarifyTapHook;
|
|
357
|
+
'before:build'?: ClarifyTapHook;
|
|
358
|
+
'after:build'?: ClarifyTapHook;
|
|
359
|
+
'before:ssg'?: ClarifyTapHook;
|
|
360
|
+
'after:ssg'?: ClarifyTapHook;
|
|
361
|
+
'before:dev:server'?: ClarifyTapHook;
|
|
362
|
+
'after:dev:server'?: ClarifyTapHook;
|
|
363
|
+
'build:shouldRun'?: ClarifyInterceptHook;
|
|
364
|
+
'ssg:shouldRun'?: ClarifyInterceptHook;
|
|
333
365
|
};
|
|
334
366
|
export type ClarifyPlugin = {
|
|
335
367
|
name: string;
|
|
368
|
+
enforce?: 'pre' | 'post';
|
|
369
|
+
priority?: number;
|
|
370
|
+
dependsOn?: string[];
|
|
336
371
|
hooks?: Partial<ClarifyHooks>;
|
|
337
372
|
slots?: UISlotRegistration[];
|
|
338
373
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clarify-labs/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -39,11 +39,12 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@apidevtools/swagger-parser": "^12.1.0",
|
|
42
|
-
"@clarify-labs/renderer": "0.
|
|
43
|
-
"@clarify-labs/templates": "0.
|
|
42
|
+
"@clarify-labs/renderer": "0.10.0",
|
|
43
|
+
"@clarify-labs/templates": "0.10.0",
|
|
44
|
+
"@mdx-js/mdx": "^3.1.1",
|
|
44
45
|
"@mdx-js/rollup": "^3.1.1",
|
|
45
|
-
"@tailwindcss/vite": "^4.
|
|
46
|
-
"@vitejs/plugin-react": "^6.0.
|
|
46
|
+
"@tailwindcss/vite": "^4.3.2",
|
|
47
|
+
"@vitejs/plugin-react": "^6.0.3",
|
|
47
48
|
"cac": "^7.0.0",
|
|
48
49
|
"github-slugger": "^2.0.0",
|
|
49
50
|
"gray-matter": "^4.0.3",
|
|
@@ -58,17 +59,16 @@
|
|
|
58
59
|
"react-zoom-pan-pinch": "^4.0.3",
|
|
59
60
|
"remark": "^15.0.1",
|
|
60
61
|
"remark-gfm": "^4.0.1",
|
|
61
|
-
"shiki": "
|
|
62
|
+
"shiki": "4.3.0",
|
|
62
63
|
"unist-util-visit": "^5.1.0",
|
|
63
|
-
"vite": "^8.
|
|
64
|
+
"vite": "^8.1.4",
|
|
64
65
|
"yaml": "^2.9.0",
|
|
65
66
|
"zod": "^4.4.3"
|
|
66
67
|
},
|
|
67
68
|
"devDependencies": {
|
|
68
|
-
"@
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"vitest": "^4.1.9"
|
|
69
|
+
"@types/react": "^19.2.17",
|
|
70
|
+
"typescript": "^6.0.3",
|
|
71
|
+
"vite-plugin-dts": "^5.0.3",
|
|
72
|
+
"vitest": "^4.1.10"
|
|
73
73
|
}
|
|
74
74
|
}
|
package/output/core/content.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ContentProcessor } from '../parsers/content.js';
|
|
2
|
-
import { ClarifyHookContext, ClarifyPlugin } from '../types.js';
|
|
3
|
-
export declare function createProjectContentProcessor(plugins: ClarifyPlugin[], ctx: ClarifyHookContext): ContentProcessor;
|
|
4
|
-
export declare function setProjectContentProcessor(ctx: ClarifyHookContext, processor: ContentProcessor): void;
|
|
5
|
-
export declare function getProjectContentProcessor(ctx: ClarifyHookContext): ContentProcessor | undefined;
|
package/output/core/plugin.d.ts
DELETED
package/output/core/site.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ClarifyHookContext, ClarifyPlugin, ContentRoute, NavigationTree } from '../types.js';
|
|
2
|
-
import { resolveProjectConfig } from './config.js';
|
|
3
|
-
import { ClarifyBuildOptions, ResolvedBuildOptions } from './options.js';
|
|
4
|
-
export type ResolvedClarifySite = {
|
|
5
|
-
root: string;
|
|
6
|
-
contentRoot: string;
|
|
7
|
-
projectConfig: ReturnType<typeof resolveProjectConfig>;
|
|
8
|
-
generateOptions: ResolvedBuildOptions;
|
|
9
|
-
plugins: ClarifyPlugin[];
|
|
10
|
-
ctx: ClarifyHookContext;
|
|
11
|
-
routes: ContentRoute[];
|
|
12
|
-
navigation: NavigationTree;
|
|
13
|
-
};
|
|
14
|
-
export type ResolveClarifySiteOptions = {
|
|
15
|
-
includeHtmlShellPlugin?: boolean;
|
|
16
|
-
};
|
|
17
|
-
export declare function resolveClarifySite(options?: ClarifyBuildOptions, resolveOptions?: ResolveClarifySiteOptions): Promise<ResolvedClarifySite>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ClarifyContentKind, ClarifyContentTransformInput } from '../types.js';
|
|
2
|
-
export type ProcessedMdxContent = {
|
|
3
|
-
frontmatter: Record<string, unknown>;
|
|
4
|
-
content: string;
|
|
5
|
-
};
|
|
6
|
-
export type ContentTransform = (input: ClarifyContentTransformInput) => Promise<ClarifyContentTransformInput> | ClarifyContentTransformInput;
|
|
7
|
-
export type ContentProcessor = {
|
|
8
|
-
processMdx(source: string, filePath?: string): Promise<ProcessedMdxContent>;
|
|
9
|
-
processText(source: string, kind: Exclude<ClarifyContentKind, 'mdx'>, filePath?: string): Promise<string>;
|
|
10
|
-
};
|
|
11
|
-
export declare function createContentProcessor(transform?: ContentTransform): ContentProcessor;
|
package/output/parsers/mdx.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
type HastNode = {
|
|
2
|
-
type: string;
|
|
3
|
-
tagName?: string;
|
|
4
|
-
value?: string;
|
|
5
|
-
properties?: Record<string, unknown>;
|
|
6
|
-
children?: HastNode[];
|
|
7
|
-
};
|
|
8
|
-
export declare function rehypeParseCodeBlocks(): (tree: HastNode) => void;
|
|
9
|
-
export declare function rehypeShiki(): (tree: HastNode) => Promise<void>;
|
|
10
|
-
export declare function rehypeSlugSections(): (tree: HastNode) => void;
|
|
11
|
-
export declare const remarkPlugins: unknown[];
|
|
12
|
-
export declare const rehypePlugins: (typeof rehypeSlugSections)[];
|
|
13
|
-
export {};
|