@clarify-labs/cli 0.10.1 → 0.10.3
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 +18 -32
- package/output/cli.cjs.map +1 -1
- package/output/cli.js +18 -32
- package/output/cli.js.map +1 -1
- package/output/core/adapters.d.ts +5 -0
- package/output/core/config/config-schema.d.ts +6 -110
- package/output/core/engine/engine.d.ts +1 -0
- package/output/core/runtime/virtual-modules.d.ts +1 -1
- package/output/{engine-5bdNX2Oo.cjs → engine-BDdPszs2.cjs} +212 -177
- package/output/engine-BDdPszs2.cjs.map +1 -0
- package/output/{engine-Ca_2MCj9.js → engine-CyFtr8Pz.js} +210 -178
- package/output/engine-CyFtr8Pz.js.map +1 -0
- package/output/index.cjs +1 -1
- package/output/index.js +1 -1
- package/output/parsers/content/diagnostic.d.ts +12 -0
- package/output/parsers/markdown/mdx.d.ts +12 -4
- package/output/plugins/openapi/parser.d.ts +1 -1
- package/output/plugins/openapi/virtual-modules.d.ts +1 -2
- package/output/types.d.ts +4 -9
- package/package.json +6 -3
- package/output/engine-5bdNX2Oo.cjs.map +0 -1
- package/output/engine-Ca_2MCj9.js.map +0 -1
package/output/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_engine = require("./engine-
|
|
2
|
+
const require_engine = require("./engine-BDdPszs2.cjs");
|
|
3
3
|
exports.ClarifyEngine = require_engine.ClarifyEngine;
|
|
4
4
|
exports.createClarifyEngine = require_engine.createClarifyEngine;
|
|
5
5
|
exports.createViteAdapter = require_engine.createViteAdapter;
|
package/output/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as defineConfig, n as createClarifyEngine, s as createViteAdapter, t as ClarifyEngine } from "./engine-
|
|
1
|
+
import { c as defineConfig, n as createClarifyEngine, s as createViteAdapter, t as ClarifyEngine } from "./engine-CyFtr8Pz.js";
|
|
2
2
|
export { ClarifyEngine, createClarifyEngine, createViteAdapter, defineConfig };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ContentDiagnostic } from '@clarify-labs/renderer';
|
|
2
|
+
type CreateContentDiagnosticOptions = {
|
|
3
|
+
kind: ContentDiagnostic['kind'];
|
|
4
|
+
title: string;
|
|
5
|
+
message: string;
|
|
6
|
+
error: unknown;
|
|
7
|
+
filePath?: string;
|
|
8
|
+
projectRoot?: string;
|
|
9
|
+
includeStack?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare function createContentDiagnostic(options: CreateContentDiagnosticOptions): ContentDiagnostic;
|
|
12
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CompileOptions } from '@mdx-js/mdx';
|
|
1
2
|
import { ContentDiagnostic } from '../../types.js';
|
|
2
3
|
type HastNode = {
|
|
3
4
|
type: string;
|
|
@@ -7,17 +8,24 @@ type HastNode = {
|
|
|
7
8
|
children?: HastNode[];
|
|
8
9
|
};
|
|
9
10
|
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
11
|
export declare const remarkPlugins: unknown[];
|
|
13
|
-
export declare const rehypePlugins:
|
|
12
|
+
export declare const rehypePlugins: NonNullable<CompileOptions['rehypePlugins']>;
|
|
13
|
+
type ContentCompileDiagnosticOptions = {
|
|
14
|
+
format: 'markdown' | 'mdx';
|
|
15
|
+
phase: 'syntax' | 'compilation';
|
|
16
|
+
error: unknown;
|
|
17
|
+
filePath?: string;
|
|
18
|
+
projectRoot?: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function createContentCompileDiagnostic(options: ContentCompileDiagnosticOptions): ContentDiagnostic;
|
|
14
21
|
/**
|
|
15
22
|
* Validate MDX content for diagnostics WITHOUT running the build-time rehype
|
|
16
23
|
* pipeline (Shiki highlighting, slug injection, code-block parsing).
|
|
17
24
|
*
|
|
18
25
|
* `rehypePlugins` includes `rehypeShiki`, which loads grammar/WASM assets and
|
|
19
26
|
* is expensive. The real highlighting happens at Vite build time via the
|
|
20
|
-
* `@mdx-js/rollup`
|
|
27
|
+
* `@mdx-js/rollup` plugins (see `createMarkdownPlugin` and `createMdxPlugin`
|
|
28
|
+
* in `core/adapters.ts`), which
|
|
21
29
|
* runs the full remark + rehype pipeline. Re-running it here, during route
|
|
22
30
|
* discovery (Phase 3), would compile every `.mdx` file twice and invoke Shiki
|
|
23
31
|
* once per file per `engine.refresh()` — see ARCHITECTURE.md §2.2 which states
|
|
@@ -13,4 +13,4 @@ export declare function normalizeOpenAPISpecSectionIds(spec: OpenAPISpec): OpenA
|
|
|
13
13
|
export declare function filterSpecByTags(spec: OpenAPISpec, tags: string[]): OpenAPISpec;
|
|
14
14
|
/** Extract endpoint operations from an OpenAPI spec as page sections. */
|
|
15
15
|
export declare function extractOpenAPISections(spec: OpenAPISpec, filterTags?: string[]): ContentSection[];
|
|
16
|
-
export declare function readOpenAPISpec(filePath: string, contentProcessor?: ContentProcessor): Promise<OpenAPIParseResult>;
|
|
16
|
+
export declare function readOpenAPISpec(filePath: string, contentProcessor?: ContentProcessor, projectRoot?: string): Promise<OpenAPIParseResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OpenAPISpec } from '../../types.js';
|
|
2
2
|
export declare const openApiRegistryModuleId = "virtual:clarify/openapi";
|
|
3
3
|
export declare const openApiServerRegistryModuleId = "virtual:clarify/openapi/server";
|
|
4
4
|
export declare const OPENAPI_SPEC_PREFIX = "virtual:clarify/openapi-spec/";
|
|
@@ -11,5 +11,4 @@ type OpenAPIPageModuleOptions = {
|
|
|
11
11
|
specModuleId: string;
|
|
12
12
|
};
|
|
13
13
|
export declare function generateOpenAPIPageModule(opts: OpenAPIPageModuleOptions): string;
|
|
14
|
-
export declare function generateOpenAPIErrorModule(diagnostic: ContentDiagnostic): string;
|
|
15
14
|
export {};
|
package/output/types.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { OpenAPIV3, OpenAPIV3_1 } from 'openapi-types';
|
|
2
2
|
import { HtmlTagDescriptor, ViteDevServer } from 'vite';
|
|
3
|
-
import { UISlotRegistration } from '@clarify-labs/renderer';
|
|
3
|
+
import { ContentDiagnostic, UISlotRegistration } from '@clarify-labs/renderer';
|
|
4
4
|
import { ResolvedBuildOptions } from './core/config/options.js';
|
|
5
5
|
export type { ClarifyBuildOptions, ResolvedBuildOptions, } from './core/config/options.js';
|
|
6
|
+
export type { ContentDiagnostic } from '@clarify-labs/renderer';
|
|
6
7
|
export type OpenAPISpec = OpenAPIV3.Document | OpenAPIV3_1.Document;
|
|
7
8
|
export type ClarifyLogoConfig = string | {
|
|
8
9
|
light?: string;
|
|
@@ -115,7 +116,7 @@ export type ResolvedClarifyThemeConfig = {
|
|
|
115
116
|
layout: ResolvedClarifyThemeLayoutConfig;
|
|
116
117
|
editor: boolean;
|
|
117
118
|
};
|
|
118
|
-
export type ClarifyPagesItem = string | {
|
|
119
|
+
export type ClarifyPagesItem = string | ClarifyPagesGroup | {
|
|
119
120
|
page: string;
|
|
120
121
|
/** Explicit route path. Defaults to the path generated from page. */
|
|
121
122
|
path?: string;
|
|
@@ -144,6 +145,7 @@ export type ClarifyPagesGroup = {
|
|
|
144
145
|
group: ClarifyLocalizedText;
|
|
145
146
|
/** Icon name from lucide-react, e.g. "BookOpen". */
|
|
146
147
|
icon?: string;
|
|
148
|
+
/** Pages or nested groups within this section. */
|
|
147
149
|
pages: ClarifyPagesItem[];
|
|
148
150
|
};
|
|
149
151
|
/** Use the string "FileTree" to auto-generate pages from the file system. */
|
|
@@ -236,13 +238,6 @@ export type ContentSection = {
|
|
|
236
238
|
badge?: string;
|
|
237
239
|
tags?: string[];
|
|
238
240
|
};
|
|
239
|
-
export type ContentDiagnostic = {
|
|
240
|
-
kind: string;
|
|
241
|
-
title: string;
|
|
242
|
-
message: string;
|
|
243
|
-
details?: string;
|
|
244
|
-
filePath?: string;
|
|
245
|
-
};
|
|
246
241
|
export type ContentRouteMeta = {
|
|
247
242
|
title: string;
|
|
248
243
|
description?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clarify-labs/cli",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -39,10 +39,11 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@apidevtools/swagger-parser": "^12.1.0",
|
|
42
|
-
"@clarify-labs/renderer": "0.10.
|
|
43
|
-
"@clarify-labs/templates": "0.10.
|
|
42
|
+
"@clarify-labs/renderer": "0.10.3",
|
|
43
|
+
"@clarify-labs/templates": "0.10.3",
|
|
44
44
|
"@mdx-js/mdx": "^3.1.1",
|
|
45
45
|
"@mdx-js/rollup": "^3.1.1",
|
|
46
|
+
"@shikijs/rehype": "^4.3.0",
|
|
46
47
|
"@tailwindcss/vite": "^4.3.2",
|
|
47
48
|
"@vitejs/plugin-react": "^6.0.3",
|
|
48
49
|
"cac": "^7.0.0",
|
|
@@ -57,6 +58,8 @@
|
|
|
57
58
|
"react-router": "^7.0.0",
|
|
58
59
|
"react-router-dom": "^7.0.0",
|
|
59
60
|
"react-zoom-pan-pinch": "^4.0.3",
|
|
61
|
+
"rehype-raw": "^7.0.0",
|
|
62
|
+
"rehype-slug": "^6.0.0",
|
|
60
63
|
"remark": "^15.0.1",
|
|
61
64
|
"remark-gfm": "^4.0.1",
|
|
62
65
|
"shiki": "4.3.0",
|