Skip to content

Commit 30e4bdc

Browse files
chore(library): silence api-extractor's non-actionable TypeScript-version notice (#797)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent cba2d71 commit 30e4bdc

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

library/vite.config.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@ import react from "@vitejs/plugin-react"
33
import dts from "vite-plugin-dts"
44
import { resolve } from "path"
55
import { readFileSync } from "fs"
6+
import type {
7+
ExtractorMessage,
8+
IExtractorInvokeOptions,
9+
} from "@microsoft/api-extractor"
10+
11+
// vite-plugin-dts rolls the .d.ts up with @microsoft/api-extractor, which has no
12+
// release for the project's TypeScript major yet. It therefore analyses with its
13+
// own older bundled TypeScript and prints a "consider upgrading API Extractor"
14+
// notice on every entry point. The rolled .d.ts is correct regardless, so drop
15+
// that one non-actionable console notice (the "using bundled version X" preamble
16+
// is left as-is). Remove this once api-extractor supports the project's TS major.
17+
const dtsInvokeOptions: IExtractorInvokeOptions = {
18+
messageCallback(message: ExtractorMessage) {
19+
if (message.messageId === "console-compiler-version-notice") {
20+
message.handled = true
21+
}
22+
},
23+
}
624

725
// The bundled Inter woff2 is base64-inlined into style.css (and index.js via
826
// `?inline`), so the SIL Open Font License binary ships inside our artifacts.
@@ -88,6 +106,8 @@ export default defineConfig({
88106
// rolled .d.ts is self-contained (no dependency on the private workspace
89107
// package).
90108
bundledPackages: ["@tumaet/ui"],
109+
// Silence api-extractor's non-actionable TS-version notice (see above).
110+
invokeOptions: dtsInvokeOptions,
91111
},
92112
// The JS build aliases @tumaet/ui to its TS source so the runtime inlines
93113
// into dist. For TYPES, resolve the package's published declarations (via

0 commit comments

Comments
 (0)