rspress-plugin-api-extractor 0.6.0 → 0.6.2
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/build-stages.js +11 -7
- package/index.d.ts +24 -4
- package/observability/sinks/console-sink.js +1 -1
- package/package.json +10 -10
- package/schemas/config.js +12 -2
package/build-stages.js
CHANGED
|
@@ -287,10 +287,10 @@ function generateSinglePage(workItem, ctx) {
|
|
|
287
287
|
}
|
|
288
288
|
if (!page) return null;
|
|
289
289
|
if (namespaceMember) {
|
|
290
|
-
const simpleName = item.displayName.toLowerCase();
|
|
291
290
|
const qualifiedNameLower = namespaceMember.qualifiedName.toLowerCase();
|
|
291
|
+
const lastSlash = page.routePath.lastIndexOf("/");
|
|
292
292
|
page = {
|
|
293
|
-
routePath: page.routePath.
|
|
293
|
+
routePath: `${page.routePath.slice(0, lastSlash + 1)}${qualifiedNameLower}`,
|
|
294
294
|
content: page.content
|
|
295
295
|
};
|
|
296
296
|
}
|
|
@@ -706,17 +706,21 @@ function cleanupAndCommit(input) {
|
|
|
706
706
|
level: "trace"
|
|
707
707
|
}));
|
|
708
708
|
}), { concurrency: "unbounded" });
|
|
709
|
-
|
|
709
|
+
const removedFiles = [...staleFiles, ...orphanedFiles];
|
|
710
|
+
if (removedFiles.length > 0) {
|
|
710
711
|
const dirs = /* @__PURE__ */ new Set();
|
|
711
|
-
for (const
|
|
712
|
-
|
|
713
|
-
|
|
712
|
+
for (const removed of removedFiles) {
|
|
713
|
+
let dir = path.dirname(removed.replace(/\\/g, "/"));
|
|
714
|
+
while (dir !== "." && dir !== "/" && !dirs.has(dir)) {
|
|
715
|
+
dirs.add(dir);
|
|
716
|
+
dir = path.dirname(dir);
|
|
717
|
+
}
|
|
714
718
|
}
|
|
715
719
|
const sortedDirs = [...dirs].sort((a, b) => b.split("/").length - a.split("/").length);
|
|
716
720
|
for (const dir of sortedDirs) {
|
|
717
721
|
const fullDir = path.join(resolvedOutputDir, dir);
|
|
718
722
|
if ((yield* fileSystem.readDirectory(fullDir).pipe(Effect.orElseSucceed(() => ["placeholder"]))).length === 0) {
|
|
719
|
-
yield* fileSystem.remove(fullDir).pipe(Effect.ignore);
|
|
723
|
+
yield* fileSystem.remove(fullDir, { recursive: true }).pipe(Effect.ignore);
|
|
720
724
|
yield* emit(PluginEvent.EmptyDirRemoved({
|
|
721
725
|
ctx: { buildId },
|
|
722
726
|
dir,
|
package/index.d.ts
CHANGED
|
@@ -378,9 +378,19 @@ declare const MultiApiConfig: Schema.Struct<{
|
|
|
378
378
|
readonly copyButtonText: Schema.withDecodingDefault<Schema.String, never>;
|
|
379
379
|
readonly viewOptions: Schema.withDecodingDefault<Schema.mutable<Schema.$Array<Schema.Literals<readonly ["markdownLink", "chatgpt", "claude"]>>>, never>;
|
|
380
380
|
}>>;
|
|
381
|
-
/**
|
|
381
|
+
/**
|
|
382
|
+
* Path to a `tsconfig.json` for Twoslash.
|
|
383
|
+
*
|
|
384
|
+
* @remarks
|
|
385
|
+
* Twoslash runs against a single shared TypeScript environment for the
|
|
386
|
+
* whole build, so per-API tsconfigs are not honored in multi-API mode:
|
|
387
|
+
* the first API that provides one wins and the rest are ignored (a
|
|
388
|
+
* `ConfigCascadeWarning` is emitted when they differ). Ensure the
|
|
389
|
+
* configured tsconfigs are equivalent, or set the intended one on the
|
|
390
|
+
* first API only.
|
|
391
|
+
*/
|
|
382
392
|
readonly tsconfig: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown)>>;
|
|
383
|
-
/** TypeScript compiler options for Twoslash. */
|
|
393
|
+
/** TypeScript compiler options for Twoslash. First API wins, as with `tsconfig`. */
|
|
384
394
|
readonly compilerOptions: Schema.optional<Schema.Unknown>;
|
|
385
395
|
}>;
|
|
386
396
|
/** @public */
|
|
@@ -622,9 +632,19 @@ declare const PluginOptions: Schema.Struct<{
|
|
|
622
632
|
readonly copyButtonText: Schema.withDecodingDefault<Schema.String, never>;
|
|
623
633
|
readonly viewOptions: Schema.withDecodingDefault<Schema.mutable<Schema.$Array<Schema.Literals<readonly ["markdownLink", "chatgpt", "claude"]>>>, never>;
|
|
624
634
|
}>>;
|
|
625
|
-
/**
|
|
635
|
+
/**
|
|
636
|
+
* Path to a `tsconfig.json` for Twoslash.
|
|
637
|
+
*
|
|
638
|
+
* @remarks
|
|
639
|
+
* Twoslash runs against a single shared TypeScript environment for the
|
|
640
|
+
* whole build, so per-API tsconfigs are not honored in multi-API mode:
|
|
641
|
+
* the first API that provides one wins and the rest are ignored (a
|
|
642
|
+
* `ConfigCascadeWarning` is emitted when they differ). Ensure the
|
|
643
|
+
* configured tsconfigs are equivalent, or set the intended one on the
|
|
644
|
+
* first API only.
|
|
645
|
+
*/
|
|
626
646
|
readonly tsconfig: Schema.optional<Schema.declare<string | URL | ((...args: Array<unknown>) => unknown), string | URL | ((...args: Array<unknown>) => unknown)>>;
|
|
627
|
-
/** TypeScript compiler options for Twoslash. */
|
|
647
|
+
/** TypeScript compiler options for Twoslash. First API wins, as with `tsconfig`. */
|
|
628
648
|
readonly compilerOptions: Schema.optional<Schema.Unknown>;
|
|
629
649
|
}>>>>;
|
|
630
650
|
/** Canonical site URL used for Open Graph absolute URLs. */
|
|
@@ -18,7 +18,7 @@ function render(event) {
|
|
|
18
18
|
case "BuildCompleted": return `API documentation complete (${(event.durationMs / 1e3).toFixed(2)}s)`;
|
|
19
19
|
case "BuildFailed": return `Error in ${event.phase}: ${event.error}`;
|
|
20
20
|
case "SlowOperation": return `slow ${event.operation}: ${event.durationMs}ms (>${event.threshold}ms)`;
|
|
21
|
-
case "ConfigCascadeWarning": return `${event.field}: using '${event.chosen}', ignoring ${event.ignored.join(", ")}`;
|
|
21
|
+
case "ConfigCascadeWarning": return event.ignored.length > 2 ? `${event.field}: using '${event.chosen}', ignoring ${event.ignored.length} alternatives (first configured value wins)` : `${event.field}: using '${event.chosen}', ignoring ${event.ignored.join(", ")}`;
|
|
22
22
|
case "ConfigValidationWarning": return `${event.field}: rejected '${event.value}'${event.reason ? ` — ${event.reason}` : ""}`;
|
|
23
23
|
case "DeprecatedConfigUsed": return `option '${event.key}' is deprecated; use ${event.replacement}`;
|
|
24
24
|
case "ModelLoaded": return `loaded model: ${event.itemCount} items, ${event.entryPoints} entry point(s) (${event.durationMs}ms)`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rspress-plugin-api-extractor",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "RSPress plugin for generating API documentation from TypeScript API Extractor models",
|
|
6
6
|
"keywords": [
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
"./package.json": "./package.json"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@effect/platform-node": "4.0.0-beta.
|
|
38
|
-
"@effect/sql-sqlite-node": "4.0.0-beta.
|
|
39
|
-
"@effected/semver": "^0.
|
|
40
|
-
"@effected/store": "^0.1.
|
|
41
|
-
"@effected/tsconfig-json": "^0.2.
|
|
42
|
-
"@effected/xdg": "^0.1.
|
|
43
|
-
"@microsoft/api-extractor-model": "^7.33.
|
|
37
|
+
"@effect/platform-node": "4.0.0-beta.99",
|
|
38
|
+
"@effect/sql-sqlite-node": "4.0.0-beta.99",
|
|
39
|
+
"@effected/semver": "^0.2.0",
|
|
40
|
+
"@effected/store": "^0.1.1",
|
|
41
|
+
"@effected/tsconfig-json": "^0.2.7",
|
|
42
|
+
"@effected/xdg": "^0.1.7",
|
|
43
|
+
"@microsoft/api-extractor-model": "^7.33.10",
|
|
44
44
|
"@shikijs/twoslash": "^4.3.1",
|
|
45
45
|
"@typescript/vfs": "^1.6.4",
|
|
46
46
|
"api-extractor-llms": "^0.2.0",
|
|
47
47
|
"clsx": "^2.1.1",
|
|
48
|
-
"effect": "4.0.0-beta.
|
|
48
|
+
"effect": "4.0.0-beta.99",
|
|
49
49
|
"gray-matter": "^4.0.3",
|
|
50
50
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
51
51
|
"image-size": "^2.0.2",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"prettier": "^3.9.5",
|
|
57
57
|
"react-markdown": "^10.1.0",
|
|
58
58
|
"shiki": "^4.3.1",
|
|
59
|
-
"type-registry-effect": "^2.
|
|
59
|
+
"type-registry-effect": "^2.1.2",
|
|
60
60
|
"typescript": "^6.0.3",
|
|
61
61
|
"unist-util-visit": "^5.1.0"
|
|
62
62
|
},
|
package/schemas/config.js
CHANGED
|
@@ -269,9 +269,19 @@ const MultiApiConfig = Schema.Struct({
|
|
|
269
269
|
ogImage: Schema.optional(OpenGraphImageConfig),
|
|
270
270
|
/** LLMs integration options. */
|
|
271
271
|
llmsPlugin: Schema.optional(LlmsPlugin),
|
|
272
|
-
/**
|
|
272
|
+
/**
|
|
273
|
+
* Path to a `tsconfig.json` for Twoslash.
|
|
274
|
+
*
|
|
275
|
+
* @remarks
|
|
276
|
+
* Twoslash runs against a single shared TypeScript environment for the
|
|
277
|
+
* whole build, so per-API tsconfigs are not honored in multi-API mode:
|
|
278
|
+
* the first API that provides one wins and the rest are ignored (a
|
|
279
|
+
* `ConfigCascadeWarning` is emitted when they differ). Ensure the
|
|
280
|
+
* configured tsconfigs are equivalent, or set the intended one on the
|
|
281
|
+
* first API only.
|
|
282
|
+
*/
|
|
273
283
|
tsconfig: Schema.optional(ModelInput),
|
|
274
|
-
/** TypeScript compiler options for Twoslash. */
|
|
284
|
+
/** TypeScript compiler options for Twoslash. First API wins, as with `tsconfig`. */
|
|
275
285
|
compilerOptions: Schema.optional(Schema.Unknown)
|
|
276
286
|
});
|
|
277
287
|
/**
|