rspress-plugin-api-extractor 0.19.12 → 0.19.14
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 +2 -1
- package/layers/config-resolution.js +5 -4
- package/layers/type-environment.js +2 -1
- package/package.json +28 -27
- package/plugin.js +2 -1
- package/prettier-formatter.js +2 -1
- package/services/OgService.js +2 -1
- package/services/TypeRegistryService.js +3 -2
- package/tsdoc-metadata.json +1 -1
- package/twoslash-transformer.js +2 -1
package/build-stages.js
CHANGED
|
@@ -7,6 +7,7 @@ import { emit } from "./observability/EventBus.js";
|
|
|
7
7
|
import { emitSync, syncBuildId } from "./observability/sync-emitter.js";
|
|
8
8
|
import { OgService } from "./services/OgService.js";
|
|
9
9
|
import path from "node:path";
|
|
10
|
+
import { ErrorText } from "@effected/engine";
|
|
10
11
|
import { NavEntry, buildIndexPage, buildNav, buildPage, prepareWorkItems } from "@tsdoctor/pages";
|
|
11
12
|
import { Effect, FileSystem, Metric, Option, Stream } from "effect";
|
|
12
13
|
import { Routes, parseFrontmatter, stringifyFrontmatter } from "@tsdoctor/model";
|
|
@@ -104,7 +105,7 @@ function generateSinglePage(workItem, ctx) {
|
|
|
104
105
|
apiScope
|
|
105
106
|
},
|
|
106
107
|
file: "unknown",
|
|
107
|
-
reason:
|
|
108
|
+
reason: ErrorText.describe(cause),
|
|
108
109
|
level: "warn"
|
|
109
110
|
}));
|
|
110
111
|
}
|
|
@@ -16,6 +16,7 @@ import { emitVfsPayloadEvents, mergeApiResult } from "./api-results.js";
|
|
|
16
16
|
import { mergeExternalTypes } from "./external-types.js";
|
|
17
17
|
import { registerTypeEnvironments, resolveTsConfigTyped } from "./type-environment.js";
|
|
18
18
|
import path from "node:path";
|
|
19
|
+
import { ErrorText } from "@effected/engine";
|
|
19
20
|
import { apiScopeOf, normalizeBaseRoute, unscopedName } from "@tsdoctor/pages";
|
|
20
21
|
import { Effect, Metric } from "effect";
|
|
21
22
|
import { ApiExtractedPackage, TypeReferenceExtractor } from "@tsdoctor/model";
|
|
@@ -304,7 +305,7 @@ const makeConfigService = Effect.gen(function* () {
|
|
|
304
305
|
try: () => loadPackageJson(api.packageJson),
|
|
305
306
|
catch: (cause) => new ConfigValidationError({
|
|
306
307
|
field: "packageJson",
|
|
307
|
-
reason:
|
|
308
|
+
reason: ErrorText.describe(cause),
|
|
308
309
|
cause
|
|
309
310
|
})
|
|
310
311
|
}) : void 0;
|
|
@@ -313,7 +314,7 @@ const makeConfigService = Effect.gen(function* () {
|
|
|
313
314
|
try: () => validateExternalPackages(api.externalPackages, packageJson),
|
|
314
315
|
catch: (cause) => new ConfigValidationError({
|
|
315
316
|
field: "externalPackages",
|
|
316
|
-
reason:
|
|
317
|
+
reason: ErrorText.describe(cause),
|
|
317
318
|
cause
|
|
318
319
|
})
|
|
319
320
|
});
|
|
@@ -392,7 +393,7 @@ const makeConfigService = Effect.gen(function* () {
|
|
|
392
393
|
try: () => loadPackageJson(api.packageJson),
|
|
393
394
|
catch: (cause) => new ConfigValidationError({
|
|
394
395
|
field: "packageJson",
|
|
395
|
-
reason:
|
|
396
|
+
reason: ErrorText.describe(cause),
|
|
396
397
|
cause
|
|
397
398
|
})
|
|
398
399
|
}) : void 0);
|
|
@@ -401,7 +402,7 @@ const makeConfigService = Effect.gen(function* () {
|
|
|
401
402
|
try: () => validateExternalPackages(versionExternalPackages || api.externalPackages, packageJson),
|
|
402
403
|
catch: (cause) => new ConfigValidationError({
|
|
403
404
|
field: "externalPackages",
|
|
404
|
-
reason:
|
|
405
|
+
reason: ErrorText.describe(cause),
|
|
405
406
|
cause
|
|
406
407
|
})
|
|
407
408
|
});
|
|
@@ -3,6 +3,7 @@ import { emit } from "../observability/EventBus.js";
|
|
|
3
3
|
import { TwoslashEnvironments } from "../services/TwoslashEnvironments.js";
|
|
4
4
|
import { ConfigValidationError } from "../errors.js";
|
|
5
5
|
import { TwoslashCacheService } from "../services/TwoslashCacheService.js";
|
|
6
|
+
import { ErrorText } from "@effected/engine";
|
|
6
7
|
import { Effect } from "effect";
|
|
7
8
|
import { resolveTypeScriptConfig, twoslashEnvHash } from "@tsdoctor/vfs";
|
|
8
9
|
import ts from "typescript";
|
|
@@ -39,7 +40,7 @@ const resolveTsConfigTyped = (projectRoot, config) => Effect.tryPromise({
|
|
|
39
40
|
try: () => resolveTypeScriptConfig(projectRoot, config),
|
|
40
41
|
catch: (cause) => new ConfigValidationError({
|
|
41
42
|
field: "tsconfig",
|
|
42
|
-
reason:
|
|
43
|
+
reason: ErrorText.describe(cause),
|
|
43
44
|
cause
|
|
44
45
|
})
|
|
45
46
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rspress-plugin-api-extractor",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "RSPress plugin for generating API documentation from TypeScript API Extractor models",
|
|
6
6
|
"keywords": [
|
|
@@ -37,36 +37,37 @@
|
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@effect/platform-node": "
|
|
41
|
-
"@effected/
|
|
42
|
-
"@effected/
|
|
43
|
-
"@effected/
|
|
44
|
-
"@effected/
|
|
45
|
-
"@effected/
|
|
46
|
-
"@effected/
|
|
47
|
-
"@effected/
|
|
48
|
-
"@effected/
|
|
49
|
-
"@effected/
|
|
50
|
-
"@effected/
|
|
51
|
-
"@effected/
|
|
52
|
-
"@effected/
|
|
53
|
-
"@effected/
|
|
54
|
-
"@effected/
|
|
55
|
-
"@effected/
|
|
56
|
-
"@effected/
|
|
40
|
+
"@effect/platform-node": "~4.1.1",
|
|
41
|
+
"@effected/engine": "^0.11.0",
|
|
42
|
+
"@effected/github": "^0.27.0",
|
|
43
|
+
"@effected/glob": "^0.17.0",
|
|
44
|
+
"@effected/images": "^0.8.0",
|
|
45
|
+
"@effected/jsonc": "^0.22.0",
|
|
46
|
+
"@effected/markdown": "^0.25.0",
|
|
47
|
+
"@effected/memfs": "^0.22.0",
|
|
48
|
+
"@effected/npm": "^0.29.0",
|
|
49
|
+
"@effected/package-json": "^0.28.0",
|
|
50
|
+
"@effected/schema-org": "^0.13.0",
|
|
51
|
+
"@effected/semver": "^0.20.0",
|
|
52
|
+
"@effected/spdx": "^0.18.0",
|
|
53
|
+
"@effected/store": "^0.22.0",
|
|
54
|
+
"@effected/tsconfig-json": "^0.19.0",
|
|
55
|
+
"@effected/walker": "^0.24.0",
|
|
56
|
+
"@effected/xdg": "^0.18.0",
|
|
57
|
+
"@effected/yaml": "^0.27.0",
|
|
57
58
|
"@microsoft/api-extractor-model": "^7.33.15",
|
|
58
59
|
"@shikijs/twoslash": "^4.5.0",
|
|
59
|
-
"@tsdoctor/bundle": "0.
|
|
60
|
-
"@tsdoctor/manifest": "0.
|
|
61
|
-
"@tsdoctor/model": "0.
|
|
62
|
-
"@tsdoctor/pages": "0.
|
|
63
|
-
"@tsdoctor/registry": "0.
|
|
64
|
-
"@tsdoctor/seo": "0.
|
|
65
|
-
"@tsdoctor/snapshot": "0.
|
|
66
|
-
"@tsdoctor/vfs": "0.
|
|
60
|
+
"@tsdoctor/bundle": "0.7.0",
|
|
61
|
+
"@tsdoctor/manifest": "0.3.0",
|
|
62
|
+
"@tsdoctor/model": "0.9.0",
|
|
63
|
+
"@tsdoctor/pages": "0.4.0",
|
|
64
|
+
"@tsdoctor/registry": "0.6.0",
|
|
65
|
+
"@tsdoctor/seo": "0.5.0",
|
|
66
|
+
"@tsdoctor/snapshot": "0.6.0",
|
|
67
|
+
"@tsdoctor/vfs": "0.6.0",
|
|
67
68
|
"@typescript/vfs": "^1.6.5",
|
|
68
69
|
"clsx": "^2.1.1",
|
|
69
|
-
"effect": "
|
|
70
|
+
"effect": "~4.1.1",
|
|
70
71
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
71
72
|
"mdast-util-to-hast": "^13.2.1",
|
|
72
73
|
"open": "^11.0.0",
|
package/plugin.js
CHANGED
|
@@ -27,6 +27,7 @@ import fs from "node:fs";
|
|
|
27
27
|
import os from "node:os";
|
|
28
28
|
import path from "node:path";
|
|
29
29
|
import { fileURLToPath } from "node:url";
|
|
30
|
+
import { ErrorText } from "@effected/engine";
|
|
30
31
|
import { normalizeBaseRoute, unscopedName } from "@tsdoctor/pages";
|
|
31
32
|
import { Effect, FileSystem, ManagedRuntime, Option, Ref, Schema } from "effect";
|
|
32
33
|
|
|
@@ -230,7 +231,7 @@ function ApiExtractorPluginImpl(rawOptions) {
|
|
|
230
231
|
}));
|
|
231
232
|
}).pipe(Effect.scoped));
|
|
232
233
|
} catch (error) {
|
|
233
|
-
const message =
|
|
234
|
+
const message = ErrorText.describe(error);
|
|
234
235
|
emitSync(PluginEvent.BuildFailed({
|
|
235
236
|
ctx: { buildId },
|
|
236
237
|
level: "error",
|
package/prettier-formatter.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PluginEvent } from "./observability/events.js";
|
|
2
2
|
import { emitSync, syncBuildId } from "./observability/sync-emitter.js";
|
|
3
|
+
import { ErrorText } from "@effected/engine";
|
|
3
4
|
import { formatExampleCode } from "@tsdoctor/pages";
|
|
4
5
|
import { Effect, Result } from "effect";
|
|
5
6
|
|
|
@@ -27,7 +28,7 @@ async function formatCode(code, language) {
|
|
|
27
28
|
formatTime
|
|
28
29
|
};
|
|
29
30
|
const cause = result.failure.cause;
|
|
30
|
-
const errorMsg =
|
|
31
|
+
const errorMsg = ErrorText.describe(cause);
|
|
31
32
|
emitSync(PluginEvent.PrettierError({
|
|
32
33
|
ctx: { buildId: syncBuildId() },
|
|
33
34
|
file: "unknown",
|
package/services/OgService.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PluginEvent } from "../observability/events.js";
|
|
2
2
|
import { emit } from "../observability/EventBus.js";
|
|
3
|
+
import { ErrorText } from "@effected/engine";
|
|
3
4
|
import { Context, Data, Effect, FileSystem, Layer, Option, Path } from "effect";
|
|
4
5
|
import { resolveUrl } from "@tsdoctor/seo";
|
|
5
6
|
import { ImageFacts } from "@effected/images";
|
|
@@ -32,7 +33,7 @@ var OgImageError = class extends OgImageErrorBase {
|
|
|
32
33
|
get message() {
|
|
33
34
|
if (this.code === "invalid-url") return `Invalid Open Graph image URL in '${this.field}': ${this.value} — expected an absolute http(s) URL or a path starting with '/'`;
|
|
34
35
|
if (this.code === "invalid-secure-url") return `Invalid Open Graph secure URL in '${this.field}': ${this.value} — secureUrl must be an absolute https URL`;
|
|
35
|
-
const cause =
|
|
36
|
+
const cause = ErrorText.describe(this.cause);
|
|
36
37
|
return `Could not read Open Graph image '${this.value}': ${cause}`;
|
|
37
38
|
}
|
|
38
39
|
};
|
|
@@ -3,6 +3,7 @@ import { emit } from "../observability/EventBus.js";
|
|
|
3
3
|
import { resolveExternalPackageVersions } from "../config-utils.js";
|
|
4
4
|
import { TypeRegistryError } from "../errors.js";
|
|
5
5
|
import { AppDirsLive, PlatformLive } from "../layers/xdg.js";
|
|
6
|
+
import { ErrorText } from "@effected/engine";
|
|
6
7
|
import { Cause, Context, Duration, Effect, Layer, Path } from "effect";
|
|
7
8
|
import { NodeHttpClient } from "@effect/platform-node";
|
|
8
9
|
import { Cache } from "@effected/store";
|
|
@@ -110,7 +111,7 @@ const RegistryObserverLayer = Layer.succeed(RegistryObserver, { emit: (event) =>
|
|
|
110
111
|
},
|
|
111
112
|
level: "warn",
|
|
112
113
|
kind: "PackageLoadFailed",
|
|
113
|
-
detail: `[${event.kind}] ${
|
|
114
|
+
detail: `[${event.kind}] ${ErrorText.describe(event.error)}`
|
|
114
115
|
}));
|
|
115
116
|
case "BatchStart": return emit(PluginEvent.TypeRegistryEvent({
|
|
116
117
|
ctx: {},
|
|
@@ -155,7 +156,7 @@ const RegistryBackedLive = Layer.effect(TypeRegistryService, Effect.gen(function
|
|
|
155
156
|
}).pipe(Effect.catch((error) => Effect.fail(new TypeRegistryError({
|
|
156
157
|
packageName: packages.map((p) => p.name).join(", "),
|
|
157
158
|
version: packages.map((p) => p.version).join(", "),
|
|
158
|
-
reason:
|
|
159
|
+
reason: ErrorText.describe(error)
|
|
159
160
|
}))))
|
|
160
161
|
};
|
|
161
162
|
})).pipe(Layer.provide(RegistryLayer));
|
package/tsdoc-metadata.json
CHANGED
package/twoslash-transformer.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PluginEvent } from "./observability/events.js";
|
|
2
2
|
import { emitSync, syncBuildId } from "./observability/sync-emitter.js";
|
|
3
|
+
import { ErrorText } from "@effected/engine";
|
|
3
4
|
import { Result } from "effect";
|
|
4
5
|
import { Markdown, Mdast } from "@effected/markdown";
|
|
5
6
|
import { rendererRich, transformerTwoslash } from "@shikijs/twoslash";
|
|
@@ -360,7 +361,7 @@ var TwoslashEnvironmentRegistry = class {
|
|
|
360
361
|
return this._resolvedCompilerOptions;
|
|
361
362
|
}
|
|
362
363
|
handleTwoslashError(error, _code, file) {
|
|
363
|
-
const message =
|
|
364
|
+
const message = ErrorText.describe(error);
|
|
364
365
|
const match = /TS(\d+)/.exec(message);
|
|
365
366
|
const tsCode = match ? Number(match[1]) : 0;
|
|
366
367
|
emitSync(PluginEvent.TwoslashDiagnostic({
|