@savvy-web/tsdown-plugins 2.11.0 → 2.11.1

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.
Files changed (2) hide show
  1. package/meta/generate.js +39 -16
  2. package/package.json +6 -6
package/meta/generate.js CHANGED
@@ -74,26 +74,42 @@ async function generateMeta(options) {
74
74
  const captureRollupOnlyFatal = splitDiagnostics && onMessage !== void 0 && ci !== true;
75
75
  const rollupFatal = [];
76
76
  const runBReported = /* @__PURE__ */ new Set();
77
+ const captureRollupSuppressed = splitDiagnostics && onSuppressed !== void 0;
78
+ const rollupSuppressed = [];
79
+ const runBSuppressed = /* @__PURE__ */ new Set();
77
80
  const runAOnMessage = captureRollupOnlyFatal ? (entry) => {
78
81
  if (entry.ciFatal === true) rollupFatal.push(entry);
79
82
  } : ci === true && onMessage !== void 0 ? (entry) => {
80
83
  if (entry.level === "error") onMessage(stripLocation(entry));
81
84
  } : () => {};
82
- runApiExtractor({
83
- cwd,
84
- packageJsonPath,
85
- entryDtsPath: modelEntryDts,
86
- tsconfigPath,
87
- tsdocConfigPath,
88
- apiJsonPath: perEntryApiJson,
89
- ...isMain && !mainEntryDidTsdocMetadata ? { tsdocMetadataPath } : {},
90
- suppressWarnings: tsdoc.suppressWarnings,
91
- ...ci !== void 0 ? { ci } : {},
92
- ...splitDiagnostics ? { onMessage: runAOnMessage } : {
93
- ...onMessage !== void 0 ? { onMessage } : {},
94
- ...onSuppressed !== void 0 ? { onSuppressed } : {}
95
- }
96
- });
85
+ const flushRollupSuppressedOnThrow = (err) => {
86
+ if (onSuppressed !== void 0) for (const entry of rollupSuppressed) onSuppressed(stripLocation(entry));
87
+ throw err;
88
+ };
89
+ try {
90
+ runApiExtractor({
91
+ cwd,
92
+ packageJsonPath,
93
+ entryDtsPath: modelEntryDts,
94
+ tsconfigPath,
95
+ tsdocConfigPath,
96
+ apiJsonPath: perEntryApiJson,
97
+ ...isMain && !mainEntryDidTsdocMetadata ? { tsdocMetadataPath } : {},
98
+ suppressWarnings: tsdoc.suppressWarnings,
99
+ ...ci !== void 0 ? { ci } : {},
100
+ ...splitDiagnostics ? {
101
+ onMessage: runAOnMessage,
102
+ ...captureRollupSuppressed ? { onSuppressed: (entry) => {
103
+ rollupSuppressed.push(entry);
104
+ } } : {}
105
+ } : {
106
+ ...onMessage !== void 0 ? { onMessage } : {},
107
+ ...onSuppressed !== void 0 ? { onSuppressed } : {}
108
+ }
109
+ });
110
+ } catch (err) {
111
+ flushRollupSuppressedOnThrow(err);
112
+ }
97
113
  if (splitDiagnostics) {
98
114
  const runBOnMessage = captureRollupOnlyFatal && onMessage !== void 0 ? (entry) => {
99
115
  if (entry.ciFatal === true) runBReported.add(diagnosticKey(entry));
@@ -111,7 +127,10 @@ async function generateMeta(options) {
111
127
  selfReferencePaths,
112
128
  suppressWarnings: tsdoc.suppressWarnings,
113
129
  ...runBOnMessage !== void 0 ? { onMessage: runBOnMessage } : {},
114
- ...onSuppressed !== void 0 ? { onSuppressed } : {}
130
+ ...onSuppressed !== void 0 ? { onSuppressed: (entry) => {
131
+ runBSuppressed.add(diagnosticKey(entry));
132
+ onSuppressed(entry);
133
+ } } : {}
115
134
  });
116
135
  } catch (err) {
117
136
  if (onMessage !== void 0) onMessage({
@@ -125,6 +144,10 @@ async function generateMeta(options) {
125
144
  if (runBReported.has(diagnosticKey(entry))) continue;
126
145
  onMessage(stripLocation(entry));
127
146
  }
147
+ if (onSuppressed !== void 0) for (const entry of rollupSuppressed) {
148
+ if (runBSuppressed.has(diagnosticKey(entry))) continue;
149
+ onSuppressed(stripLocation(entry));
150
+ }
128
151
  }
129
152
  if (isMain) mainEntryDidTsdocMetadata = true;
130
153
  perEntryModels.set(entryName, JSON.parse(readFileSync(perEntryApiJson, "utf-8")));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@savvy-web/tsdown-plugins",
3
- "version": "2.11.0",
3
+ "version": "2.11.1",
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",
@@ -34,12 +34,12 @@
34
34
  "@effected/glob": "^0.14.0",
35
35
  "@effected/images": "^0.6.1",
36
36
  "@effected/jsonc": "^0.20.0",
37
- "@effected/npm": "^0.26.2",
38
- "@effected/package-json": "^0.25.2",
37
+ "@effected/npm": "^0.27.0",
38
+ "@effected/package-json": "^0.26.0",
39
39
  "@effected/semver": "^0.18.0",
40
- "@effected/tsconfig-json": "^0.17.2",
41
- "@effected/walker": "^0.20.0",
42
- "@effected/workspaces": "^0.38.1",
40
+ "@effected/tsconfig-json": "^0.17.3",
41
+ "@effected/walker": "^0.20.1",
42
+ "@effected/workspaces": "^0.39.0",
43
43
  "@jridgewell/sourcemap-codec": "^1.6.0",
44
44
  "@microsoft/api-extractor": "^7.59.4",
45
45
  "@microsoft/tsdoc": "~0.17.1",