rspress-plugin-api-extractor 0.19.11 → 0.19.13

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 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: cause instanceof Error ? cause.message : String(cause),
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: cause instanceof Error ? cause.message : String(cause),
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: cause instanceof Error ? cause.message : String(cause),
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: cause instanceof Error ? cause.message : String(cause),
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: cause instanceof Error ? cause.message : String(cause),
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: cause instanceof Error ? cause.message : String(cause),
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.11",
3
+ "version": "0.19.13",
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": "^4.0.6",
41
- "@effected/github": "^0.25.0",
42
- "@effected/glob": "^0.14.0",
43
- "@effected/images": "^0.6.1",
44
- "@effected/jsonc": "^0.20.0",
45
- "@effected/markdown": "^0.23.0",
46
- "@effected/memfs": "^0.19.0",
47
- "@effected/npm": "^0.27.0",
48
- "@effected/package-json": "^0.26.0",
49
- "@effected/schema-org": "^0.11.0",
50
- "@effected/semver": "^0.18.0",
51
- "@effected/spdx": "^0.16.1",
52
- "@effected/store": "^0.19.0",
53
- "@effected/tsconfig-json": "^0.17.3",
54
- "@effected/walker": "^0.20.1",
55
- "@effected/xdg": "^0.15.1",
56
- "@effected/yaml": "^0.25.1",
40
+ "@effect/platform-node": "^4.0.7",
41
+ "@effected/engine": "^0.10.0",
42
+ "@effected/github": "^0.26.0",
43
+ "@effected/glob": "^0.16.0",
44
+ "@effected/images": "^0.7.0",
45
+ "@effected/jsonc": "^0.21.0",
46
+ "@effected/markdown": "^0.24.0",
47
+ "@effected/memfs": "^0.21.0",
48
+ "@effected/npm": "^0.28.0",
49
+ "@effected/package-json": "^0.27.0",
50
+ "@effected/schema-org": "^0.12.0",
51
+ "@effected/semver": "^0.19.0",
52
+ "@effected/spdx": "^0.17.0",
53
+ "@effected/store": "^0.21.0",
54
+ "@effected/tsconfig-json": "^0.18.0",
55
+ "@effected/walker": "^0.22.0",
56
+ "@effected/xdg": "^0.17.0",
57
+ "@effected/yaml": "^0.26.0",
57
58
  "@microsoft/api-extractor-model": "^7.33.15",
58
59
  "@shikijs/twoslash": "^4.5.0",
59
- "@tsdoctor/bundle": "0.6.9",
60
- "@tsdoctor/manifest": "0.2.10",
61
- "@tsdoctor/model": "0.8.14",
62
- "@tsdoctor/pages": "0.3.16",
63
- "@tsdoctor/registry": "0.5.12",
64
- "@tsdoctor/seo": "0.4.12",
65
- "@tsdoctor/snapshot": "0.5.9",
66
- "@tsdoctor/vfs": "0.4.8",
60
+ "@tsdoctor/bundle": "0.6.11",
61
+ "@tsdoctor/manifest": "0.2.11",
62
+ "@tsdoctor/model": "0.8.15",
63
+ "@tsdoctor/pages": "0.3.17",
64
+ "@tsdoctor/registry": "0.5.14",
65
+ "@tsdoctor/seo": "0.4.13",
66
+ "@tsdoctor/snapshot": "0.5.11",
67
+ "@tsdoctor/vfs": "0.5.0",
67
68
  "@typescript/vfs": "^1.6.5",
68
69
  "clsx": "^2.1.1",
69
- "effect": "^4.0.6",
70
+ "effect": "^4.0.7",
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 = error instanceof Error ? error.message : String(error);
234
+ const message = ErrorText.describe(error);
234
235
  emitSync(PluginEvent.BuildFailed({
235
236
  ctx: { buildId },
236
237
  level: "error",
@@ -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 = cause instanceof Error ? cause.message : String(cause);
31
+ const errorMsg = ErrorText.describe(cause);
31
32
  emitSync(PluginEvent.PrettierError({
32
33
  ctx: { buildId: syncBuildId() },
33
34
  file: "unknown",
@@ -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 = this.cause instanceof Error ? this.cause.message : String(this.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}] ${event.error instanceof Error ? event.error.message : String(event.error)}`
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: error instanceof Error ? error.message ?? String(error) : String(error)
159
+ reason: ErrorText.describe(error)
159
160
  }))))
160
161
  };
161
162
  })).pipe(Layer.provide(RegistryLayer));
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.59.4"
8
+ "packageVersion": "7.60.0"
9
9
  }
10
10
  ]
11
11
  }
@@ -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 = error instanceof Error ? error.message : String(error);
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({