@clarify-labs/cli 0.11.3 → 0.11.4
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 +1 -1
- package/output/cli.js +1 -1
- package/output/{engine-CrYRJRZT.js → engine-CJmXVTo5.js} +78 -25
- package/output/engine-CJmXVTo5.js.map +1 -0
- package/output/{engine-6WmOk7xk.cjs → engine-Cgc71w13.cjs} +78 -25
- package/output/engine-Cgc71w13.cjs.map +1 -0
- package/output/index.cjs +1 -1
- package/output/index.js +1 -1
- package/output/parsers/markdown/markdown.d.ts +34 -0
- package/output/parsers/markdown/mdx.d.ts +17 -9
- package/package.json +3 -3
- package/output/engine-6WmOk7xk.cjs.map +0 -1
- package/output/engine-CrYRJRZT.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-Cgc71w13.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 { l as createViteAdapter, n as createClarifyEngine, t as ClarifyEngine, u as defineConfig } from "./engine-
|
|
1
|
+
import { l as createViteAdapter, n as createClarifyEngine, t as ClarifyEngine, u as defineConfig } from "./engine-CJmXVTo5.js";
|
|
2
2
|
export { ClarifyEngine, createClarifyEngine, createViteAdapter, defineConfig };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ContentDiagnostic } from '../../types.js';
|
|
2
|
+
type CompileMarkdownContentOptions = {
|
|
3
|
+
filePath?: string;
|
|
4
|
+
projectRoot?: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Validate Markdown content for diagnostics WITHOUT running the build-time
|
|
8
|
+
* rehype pipeline (Shiki highlighting, slug injection, code-block parsing).
|
|
9
|
+
*
|
|
10
|
+
* `rehypePlugins` includes `rehypeShiki`, which loads grammar/WASM assets and
|
|
11
|
+
* is expensive. The real highlighting happens at Vite build time via the
|
|
12
|
+
* `@mdx-js/rollup` plugin (see `createContentCompilerPlugin` in
|
|
13
|
+
* `core/adapters.ts`), which runs the full remark + rehype pipeline.
|
|
14
|
+
* Re-running it here, during route discovery (Phase 3), would compile every
|
|
15
|
+
* `.md` file twice and invoke Shiki once per file per `engine.refresh()` -
|
|
16
|
+
* see ARCHITECTURE.md §2.2 which states "不应在 core 中执行代码高亮".
|
|
17
|
+
*
|
|
18
|
+
* `format: 'md'` mirrors the adapter's markdown compiler semantics (no JSX,
|
|
19
|
+
* raw HTML allowed via `remarkRehypeOptions`), so the same class of syntax
|
|
20
|
+
* errors that would break the Vite build is surfaced as a diagnostic here
|
|
21
|
+
* instead of leaking out as an opaque
|
|
22
|
+
* `Failed to fetch dynamically imported module` at runtime.
|
|
23
|
+
*
|
|
24
|
+
* MDX files are handled by `compileMdxContent` in `mdx.ts`. Keep the two
|
|
25
|
+
* compilers separate so each format can evolve its own diagnostic rules
|
|
26
|
+
* without contaminating the other.
|
|
27
|
+
*/
|
|
28
|
+
export declare function compileMarkdownContent(content: string, options?: CompileMarkdownContentOptions): Promise<{
|
|
29
|
+
ok: true;
|
|
30
|
+
} | {
|
|
31
|
+
ok: false;
|
|
32
|
+
diagnostic: ContentDiagnostic;
|
|
33
|
+
}>;
|
|
34
|
+
export {};
|
|
@@ -18,25 +18,33 @@ type ContentCompileDiagnosticOptions = {
|
|
|
18
18
|
projectRoot?: string;
|
|
19
19
|
};
|
|
20
20
|
export declare function createContentCompileDiagnostic(options: ContentCompileDiagnosticOptions): ContentDiagnostic;
|
|
21
|
+
type CompileContentOptions = {
|
|
22
|
+
filePath?: string;
|
|
23
|
+
projectRoot?: string;
|
|
24
|
+
};
|
|
21
25
|
/**
|
|
22
26
|
* Validate MDX content for diagnostics WITHOUT running the build-time rehype
|
|
23
27
|
* pipeline (Shiki highlighting, slug injection, code-block parsing).
|
|
24
28
|
*
|
|
25
29
|
* `rehypePlugins` includes `rehypeShiki`, which loads grammar/WASM assets and
|
|
26
30
|
* is expensive. The real highlighting happens at Vite build time via the
|
|
27
|
-
* `@mdx-js/rollup`
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* "不应在 core 中执行代码高亮".
|
|
31
|
+
* `@mdx-js/rollup` plugin (see `createContentCompilerPlugin` in
|
|
32
|
+
* `core/adapters.ts`), which runs the full remark + rehype pipeline.
|
|
33
|
+
* Re-running it here, during route discovery (Phase 3), would compile every
|
|
34
|
+
* `.mdx` file twice and invoke Shiki once per file per `engine.refresh()` -
|
|
35
|
+
* see ARCHITECTURE.md §2.2 which states "不应在 core 中执行代码高亮".
|
|
33
36
|
*
|
|
34
37
|
* The remark pipeline still runs (shared with the Vite plugin via
|
|
35
|
-
* `remarkPlugins`), so MDX/JSX syntax errors
|
|
36
|
-
* diagnostic is meant to surface ahead of the Vite build
|
|
38
|
+
* `remarkPlugins`), so MDX/JSX syntax errors - the only class of error this
|
|
39
|
+
* diagnostic is meant to surface ahead of the Vite build - are caught. The
|
|
37
40
|
* output is discarded; only the thrown error is used.
|
|
41
|
+
*
|
|
42
|
+
* `.md` files are handled by `compileMarkdownContent` in `markdown.ts`, which
|
|
43
|
+
* mirrors the adapter's markdown compiler semantics (`format: 'md'`, raw HTML
|
|
44
|
+
* allowed). Keep the two compilers separate so each format can evolve its own
|
|
45
|
+
* diagnostic rules without contaminating the other.
|
|
38
46
|
*/
|
|
39
|
-
export declare function compileMdxContent(content: string,
|
|
47
|
+
export declare function compileMdxContent(content: string, options?: CompileContentOptions): Promise<{
|
|
40
48
|
ok: true;
|
|
41
49
|
} | {
|
|
42
50
|
ok: false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clarify-labs/cli",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.4",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@apidevtools/swagger-parser": "^12.1.0",
|
|
42
|
-
"@clarify-labs/renderer": "0.11.
|
|
43
|
-
"@clarify-labs/templates": "0.11.
|
|
42
|
+
"@clarify-labs/renderer": "0.11.4",
|
|
43
|
+
"@clarify-labs/templates": "0.11.4",
|
|
44
44
|
"@mdx-js/mdx": "^3.1.1",
|
|
45
45
|
"@mdx-js/rollup": "^3.1.1",
|
|
46
46
|
"@modelcontextprotocol/sdk": "^1.29.0",
|