@savvy-web/tsdown-plugins 0.9.0 → 0.9.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/meta/api-extractor.js +11 -5
- package/package.json +1 -1
- package/report/metrics-plugin.js +1 -0
package/meta/api-extractor.js
CHANGED
|
@@ -9,7 +9,16 @@ import { TSDocConfigFile } from "@microsoft/tsdoc-config";
|
|
|
9
9
|
const require_ = createRequire(import.meta.url);
|
|
10
10
|
/** messageIds that become a hard build error in CI (they corrupt the .api.json). */
|
|
11
11
|
const CI_FATAL_MESSAGE_IDS = /* @__PURE__ */ new Set(["ae-forgotten-export"]);
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Map an API Extractor message to a collector DiagnosticInput, or undefined if not warn/error.
|
|
14
|
+
*
|
|
15
|
+
* The location (`file`/`line`/`column`) is deliberately dropped. API Extractor analyzes the
|
|
16
|
+
* bundled `.d.ts` and maps positions back through its `.d.ts.map` source map, which anchors
|
|
17
|
+
* every message to the start of an adjacent declaration rather than the symbol's true source
|
|
18
|
+
* position — wrong for release-tag codes, unresolved links, and the rest alike. A misleading
|
|
19
|
+
* `file:line` is worse than none, so it is omitted; the authoritative locator is the symbol
|
|
20
|
+
* name quoted in `text`. See systems#154.
|
|
21
|
+
*/
|
|
13
22
|
function mapExtractorMessage(message) {
|
|
14
23
|
const isError = message.logLevel === ExtractorLogLevel.Error;
|
|
15
24
|
const isWarning = message.logLevel === ExtractorLogLevel.Warning;
|
|
@@ -18,10 +27,7 @@ function mapExtractorMessage(message) {
|
|
|
18
27
|
source: "api-extractor",
|
|
19
28
|
level: isError ? "error" : "warn",
|
|
20
29
|
text: message.text,
|
|
21
|
-
...message.messageId !== void 0 ? { code: message.messageId } : {}
|
|
22
|
-
...message.sourceFilePath !== void 0 ? { file: message.sourceFilePath } : {},
|
|
23
|
-
...message.sourceFileLine !== void 0 ? { line: message.sourceFileLine } : {},
|
|
24
|
-
...message.sourceFileColumn !== void 0 ? { column: message.sourceFileColumn } : {}
|
|
30
|
+
...message.messageId !== void 0 ? { code: message.messageId } : {}
|
|
25
31
|
};
|
|
26
32
|
}
|
|
27
33
|
/** Run API Extractor over a single entry's .d.ts, writing the .api.json (and optionally tsdoc-metadata.json). Throws on failure. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvy-web/tsdown-plugins",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Interface-only tsdown/rolldown plugin pack powering @savvy-web/bundler",
|
|
6
6
|
"homepage": "https://github.com/savvy-web/systems/tree/main/packages/tsdown-plugins",
|
package/report/metrics-plugin.js
CHANGED
|
@@ -35,6 +35,7 @@ function buildMetricsPlugin(collector, groupId, pass, verbose) {
|
|
|
35
35
|
},
|
|
36
36
|
onLog(level, log) {
|
|
37
37
|
const l = log;
|
|
38
|
+
if (l.code === "SOURCEMAP_BROKEN" && l.plugin?.startsWith("@tsdown/css")) return false;
|
|
38
39
|
const entry = {
|
|
39
40
|
text: l.message ?? String(log),
|
|
40
41
|
...l.id !== void 0 ? { file: l.id } : {},
|