@savvy-web/tsdown-plugins 0.7.0 → 0.9.0
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/README.md +2 -1
- package/build/build-target-groups.js +42 -9
- package/build/cjs-default-interop.js +1 -0
- package/build/loose-files.js +1 -0
- package/build/node-builtin-default-interop.js +15 -9
- package/build/strip-maps.js +1 -0
- package/build/sync-public.js +1 -0
- package/build/target-groups.js +7 -2
- package/catalog/resolve-catalogs.js +1 -0
- package/changesets/next-versions.js +1 -0
- package/config-validation/ConfigValidator.js +5 -1
- package/config-validation/ConfigValidatorLive.js +6 -2
- package/dts/resolved-tsconfig.js +10 -2
- package/entry/extract.js +1 -0
- package/entry/package-json-entries.js +5 -1
- package/errors.js +10 -2
- package/exe/build.js +20 -2
- package/exe/config.js +6 -1
- package/exe/filename.js +1 -0
- package/index.d.ts +679 -593
- package/index.js +8 -4
- package/jsx/config.js +2 -0
- package/manifest/emit-manifest.js +10 -2
- package/manifest/transform.js +18 -4
- package/meta/api-extractor.js +41 -1
- package/meta/config.js +5 -1
- package/meta/generate.js +6 -2
- package/meta/optimistic.js +1 -0
- package/meta/run-pass.js +75 -0
- package/meta/tsconfig-resolver.js +12 -12
- package/package.json +1 -1
- package/report/collector.js +141 -0
- package/report/formatters/ci-annotations.js +9 -2
- package/report/formatters/diagnostics.js +23 -0
- package/report/formatters/json.js +1 -0
- package/report/formatters/markdown.js +19 -9
- package/report/formatters/silent.js +1 -0
- package/report/formatters/terminal.js +32 -3
- package/report/issues-artifact.js +88 -0
- package/report/layers/EnvironmentDetectorLive.js +1 -0
- package/report/layers/ExecutorResolverLive.js +1 -0
- package/report/layers/FormatSelectorLive.js +1 -0
- package/report/layers/OutputRendererLive.js +2 -1
- package/report/metrics-plugin.js +63 -0
- package/report/pipeline.js +6 -1
- package/report/schema.js +52 -10
- package/report/services/EnvironmentDetector.js +1 -0
- package/report/services/ExecutorResolver.js +1 -0
- package/report/services/FormatSelector.js +1 -0
- package/report/services/OutputRenderer.js +1 -0
- package/report/timer.js +6 -1
- package/report/tsdown-logger.js +42 -0
- package/targets/binding.js +5 -1
- package/targets/config.js +5 -1
- package/targets/resolve-targets.js +5 -1
- package/tsdoc-metadata.json +11 -0
- package/report/schema-export.js +0 -18
package/index.d.ts
CHANGED
|
@@ -2,25 +2,24 @@ import { CatalogAssemblyError, CatalogResolutionError, ManifestLike, ManifestLik
|
|
|
2
2
|
import { Plugin } from "rolldown";
|
|
3
3
|
import { Context, Effect, Layer, Schema } from "effect";
|
|
4
4
|
import { JsxEmit, ModuleDetectionKind, ModuleKind, ModuleResolutionKind, NewLineKind, ParsedCommandLine, ScriptTarget } from "typescript";
|
|
5
|
-
import * as Schema$1 from "effect/Schema";
|
|
6
|
-
import * as Effect$1 from "effect/Effect";
|
|
7
|
-
import { Option } from "effect/Option";
|
|
8
|
-
import { Scope } from "effect/Scope";
|
|
9
|
-
import { Sink } from "effect/Sink";
|
|
10
|
-
import { Stream } from "effect/Stream";
|
|
11
|
-
import * as Brand from "effect/Brand";
|
|
12
|
-
import { Tag } from "effect/Context";
|
|
13
|
-
import { JsonSchemaError, JsonSchemaOutput } from "json-schema-effect";
|
|
14
5
|
|
|
15
6
|
//#region src/jsx/config.d.ts
|
|
16
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Resolved JSX transform settings, mirroring the subset of rolldown's JsxOptions the bundler forwards.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
17
12
|
interface JsxConfig {
|
|
18
13
|
/** "automatic" auto-imports the JSX factories (react-jsx); "classic" does not (React.createElement). */
|
|
19
14
|
readonly runtime?: "classic" | "automatic" | undefined;
|
|
20
15
|
/** The JSX import source for the automatic runtime (e.g. "react", "preact"). */
|
|
21
16
|
readonly importSource?: string | undefined;
|
|
22
17
|
}
|
|
23
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* The jsx-relevant slice of a tsconfig's compilerOptions.
|
|
20
|
+
*
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
24
23
|
interface TsconfigJsx {
|
|
25
24
|
readonly jsx?: string | undefined;
|
|
26
25
|
readonly jsxImportSource?: string | undefined;
|
|
@@ -28,26 +27,30 @@ interface TsconfigJsx {
|
|
|
28
27
|
/**
|
|
29
28
|
* Resolve the effective JSX config: an explicit override wins; otherwise infer from the tsconfig
|
|
30
29
|
* values. Returns undefined when no JSX transform is needed (preserve/none).
|
|
30
|
+
* @public
|
|
31
31
|
*/
|
|
32
32
|
declare function resolveJsxConfig(tsconfig: TsconfigJsx, override: JsxConfig | undefined): JsxConfig | undefined;
|
|
33
33
|
/**
|
|
34
34
|
* Read the jsx-relevant compilerOptions from a package's own tsconfig.json (best-effort;
|
|
35
35
|
* returns empty on absence or parse error).
|
|
36
|
+
* @public
|
|
36
37
|
*/
|
|
37
38
|
declare function readTsconfigJsx(cwd: string): TsconfigJsx;
|
|
38
39
|
//#endregion
|
|
39
40
|
//#region src/manifest/transform.d.ts
|
|
41
|
+
/** @public */
|
|
40
42
|
type Json = Record<string, unknown>;
|
|
41
43
|
/**
|
|
42
44
|
* Which exports get a CJS `require` condition. `true`/`false` apply uniformly to every
|
|
43
45
|
* TS export; a Set marks ONLY the listed export keys (e.g. "./changesets/markdownlint")
|
|
44
46
|
* as dual — used by per-entry format overrides.
|
|
47
|
+
* @public
|
|
45
48
|
*/
|
|
46
49
|
type DualExports = boolean | ReadonlySet<string>;
|
|
47
50
|
/**
|
|
48
51
|
* The default `transform` applied to every package's manifest when its
|
|
49
52
|
* `savvy.build.ts` does not provide one of its own. Strips the build/dev-only
|
|
50
|
-
* fields in
|
|
53
|
+
* fields in `NON_PUBLISHED_FIELDS` from the emitted package.json.
|
|
51
54
|
*
|
|
52
55
|
* This is the pattern nearly every package repeated by hand (inherited from
|
|
53
56
|
* rslib-builder); `defineBuild` now applies it automatically so a package needs a
|
|
@@ -61,6 +64,7 @@ type DualExports = boolean | ReadonlySet<string>;
|
|
|
61
64
|
* Pure: the supplied `pkg` is NOT mutated — a shallow copy with the fields removed
|
|
62
65
|
* is returned, so external callers invoking this from a custom transform keep their
|
|
63
66
|
* input intact.
|
|
67
|
+
* @public
|
|
64
68
|
*/
|
|
65
69
|
declare function defaultManifestTransform({
|
|
66
70
|
pkg
|
|
@@ -71,6 +75,7 @@ declare function defaultManifestTransform({
|
|
|
71
75
|
* Describes a SEA binary the bundler compiled for this package. When present,
|
|
72
76
|
* {@link transformManifest} rewrites every `exports`/`bin` value equal to `source`
|
|
73
77
|
* to the emitted binary path and adds it to `files` so it ships in the tarball.
|
|
78
|
+
* @public
|
|
74
79
|
*/
|
|
75
80
|
interface ExeRewrite {
|
|
76
81
|
/** The exe entry source path (matches exports/bin values to rewrite). */
|
|
@@ -90,12 +95,22 @@ interface ExeRewrite {
|
|
|
90
95
|
*
|
|
91
96
|
* Export keys in `subdirExports` are built into an isolated `<key>/index.*` subdir (e.g. an
|
|
92
97
|
* RSPress `./runtime`), so their conditions gain an `/index` segment.
|
|
98
|
+
* @public
|
|
93
99
|
*/
|
|
94
100
|
declare function transformExports(exports: unknown, dual?: DualExports, subdirExports?: ReadonlySet<string>): unknown;
|
|
95
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* Rewrite bin: TS targets to bin/[command].js (string to bin/cli.js); strip leading ./ otherwise.
|
|
103
|
+
*
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
96
106
|
declare function transformBin(bin: unknown): unknown;
|
|
97
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* FINAL guard: strip leading ./ from bin paths (npm 11.x drops ./-prefixed bins).
|
|
109
|
+
*
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
98
112
|
declare function normalizeBinPaths(bin: unknown): unknown;
|
|
113
|
+
/** @public */
|
|
99
114
|
interface TransformManifestOptions {
|
|
100
115
|
/** Run after the standard transforms, before the bin final-guard + sort. */
|
|
101
116
|
readonly transform?: ((pkg: Json) => Json) | undefined;
|
|
@@ -106,16 +121,22 @@ interface TransformManifestOptions {
|
|
|
106
121
|
/** When set, rewrite exports/bin values equal to `source` to the SEA path and add it to `files`. */
|
|
107
122
|
readonly exeRewrite?: ExeRewrite | undefined;
|
|
108
123
|
}
|
|
109
|
-
/**
|
|
124
|
+
/**
|
|
125
|
+
* Apply the full standard manifest transform (excluding catalog resolution, done upstream).
|
|
126
|
+
*
|
|
127
|
+
* @public
|
|
128
|
+
*/
|
|
110
129
|
declare function transformManifest(pkg: Json, options?: TransformManifestOptions): Json;
|
|
111
130
|
//#endregion
|
|
112
131
|
//#region src/manifest/emit-manifest.d.ts
|
|
132
|
+
/** @public */
|
|
113
133
|
interface TargetGroupRef {
|
|
114
134
|
readonly id: string;
|
|
115
135
|
/** The package.json name this group's manifest carries (the declarative rename). */
|
|
116
136
|
readonly name: string;
|
|
117
137
|
readonly isProd: boolean;
|
|
118
138
|
}
|
|
139
|
+
/** @public */
|
|
119
140
|
interface BuildEmittedManifestOptions {
|
|
120
141
|
readonly pkg: Json;
|
|
121
142
|
readonly targetGroup: TargetGroupRef;
|
|
@@ -131,8 +152,13 @@ interface BuildEmittedManifestOptions {
|
|
|
131
152
|
/** When set, rewrite exports/bin values equal to the exe source to the SEA path and add it to `files`. */
|
|
132
153
|
readonly exeRewrite?: ExeRewrite | undefined;
|
|
133
154
|
}
|
|
134
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* Compute the final manifest bytes for a TargetGroup (catalog resolution + standard transforms).
|
|
157
|
+
*
|
|
158
|
+
* @public
|
|
159
|
+
*/
|
|
135
160
|
declare function buildEmittedManifest(options: BuildEmittedManifestOptions): Promise<Json>;
|
|
161
|
+
/** @public */
|
|
136
162
|
interface EmitManifestOptions {
|
|
137
163
|
readonly targetGroup: TargetGroupRef;
|
|
138
164
|
readonly devManifest?: "preserve" | "resolve" | undefined;
|
|
@@ -149,21 +175,218 @@ interface EmitManifestOptions {
|
|
|
149
175
|
/** When set, rewrite exports/bin values equal to the exe source to the SEA path and add it to `files`. */
|
|
150
176
|
readonly exeRewrite?: ExeRewrite | undefined;
|
|
151
177
|
}
|
|
152
|
-
/**
|
|
178
|
+
/**
|
|
179
|
+
* Rolldown plugin: emit the transformed package.json + LICENSE/README into the output pkg/ root.
|
|
180
|
+
*
|
|
181
|
+
* @public
|
|
182
|
+
*/
|
|
153
183
|
declare function emitManifest(options: EmitManifestOptions): Plugin;
|
|
154
184
|
//#endregion
|
|
185
|
+
//#region src/report/schema.d.ts
|
|
186
|
+
declare const ReportTimings_base: Schema.Class<ReportTimings, {
|
|
187
|
+
totalMs: typeof Schema.Number;
|
|
188
|
+
}, Schema.Struct.Encoded<{
|
|
189
|
+
totalMs: typeof Schema.Number;
|
|
190
|
+
}>, never, {
|
|
191
|
+
readonly totalMs: number;
|
|
192
|
+
}, {}, {}>;
|
|
193
|
+
/** @public */
|
|
194
|
+
declare class ReportTimings extends ReportTimings_base {}
|
|
195
|
+
declare const DiagnosticEntry_base: Schema.Class<DiagnosticEntry, {
|
|
196
|
+
source: Schema.Literal<["tsdown", "rolldown", "api-extractor"]>;
|
|
197
|
+
level: Schema.Literal<["warn", "error"]>;
|
|
198
|
+
text: typeof Schema.String; /** API Extractor messageId (e.g. "ae-forgotten-export"); used to group suppressed messages by type. */
|
|
199
|
+
code: Schema.optional<typeof Schema.String>; /** True when shown as `warn` locally but a hard error in CI (drives the "[fails CI]" nudge). */
|
|
200
|
+
ciFatal: Schema.optional<typeof Schema.Boolean>;
|
|
201
|
+
file: Schema.optional<typeof Schema.String>;
|
|
202
|
+
line: Schema.optional<typeof Schema.Number>;
|
|
203
|
+
column: Schema.optional<typeof Schema.Number>;
|
|
204
|
+
}, Schema.Struct.Encoded<{
|
|
205
|
+
source: Schema.Literal<["tsdown", "rolldown", "api-extractor"]>;
|
|
206
|
+
level: Schema.Literal<["warn", "error"]>;
|
|
207
|
+
text: typeof Schema.String; /** API Extractor messageId (e.g. "ae-forgotten-export"); used to group suppressed messages by type. */
|
|
208
|
+
code: Schema.optional<typeof Schema.String>; /** True when shown as `warn` locally but a hard error in CI (drives the "[fails CI]" nudge). */
|
|
209
|
+
ciFatal: Schema.optional<typeof Schema.Boolean>;
|
|
210
|
+
file: Schema.optional<typeof Schema.String>;
|
|
211
|
+
line: Schema.optional<typeof Schema.Number>;
|
|
212
|
+
column: Schema.optional<typeof Schema.Number>;
|
|
213
|
+
}>, never, {
|
|
214
|
+
readonly text: string;
|
|
215
|
+
} & {
|
|
216
|
+
readonly source: "tsdown" | "rolldown" | "api-extractor";
|
|
217
|
+
} & {
|
|
218
|
+
readonly level: "warn" | "error";
|
|
219
|
+
} & {
|
|
220
|
+
readonly code?: string | undefined;
|
|
221
|
+
} & {
|
|
222
|
+
readonly ciFatal?: boolean | undefined;
|
|
223
|
+
} & {
|
|
224
|
+
readonly file?: string | undefined;
|
|
225
|
+
} & {
|
|
226
|
+
readonly line?: number | undefined;
|
|
227
|
+
} & {
|
|
228
|
+
readonly column?: number | undefined;
|
|
229
|
+
}, {}, {}>;
|
|
230
|
+
/**
|
|
231
|
+
* A captured warning or error, from tsdown's logger, rolldown's onLog, or API Extractor.
|
|
232
|
+
*
|
|
233
|
+
* @public
|
|
234
|
+
*/
|
|
235
|
+
declare class DiagnosticEntry extends DiagnosticEntry_base {}
|
|
236
|
+
declare const EmittedFile_base: Schema.Class<EmittedFile, {
|
|
237
|
+
path: typeof Schema.String;
|
|
238
|
+
bytes: typeof Schema.Number;
|
|
239
|
+
gzip: Schema.optional<typeof Schema.Number>;
|
|
240
|
+
}, Schema.Struct.Encoded<{
|
|
241
|
+
path: typeof Schema.String;
|
|
242
|
+
bytes: typeof Schema.Number;
|
|
243
|
+
gzip: Schema.optional<typeof Schema.Number>;
|
|
244
|
+
}>, never, {
|
|
245
|
+
readonly path: string;
|
|
246
|
+
} & {
|
|
247
|
+
readonly bytes: number;
|
|
248
|
+
} & {
|
|
249
|
+
readonly gzip?: number | undefined;
|
|
250
|
+
}, {}, {}>;
|
|
251
|
+
/**
|
|
252
|
+
* One emitted output file with its in-memory byte size (gzip only when --verbose).
|
|
253
|
+
*
|
|
254
|
+
* @public
|
|
255
|
+
*/
|
|
256
|
+
declare class EmittedFile extends EmittedFile_base {}
|
|
257
|
+
declare const PassReport_base: Schema.Class<PassReport, {
|
|
258
|
+
id: Schema.Literal<["js", "dts", "loose", "exe", "meta"]>;
|
|
259
|
+
files: Schema.Array$<typeof EmittedFile>;
|
|
260
|
+
ms: typeof Schema.Number;
|
|
261
|
+
}, Schema.Struct.Encoded<{
|
|
262
|
+
id: Schema.Literal<["js", "dts", "loose", "exe", "meta"]>;
|
|
263
|
+
files: Schema.Array$<typeof EmittedFile>;
|
|
264
|
+
ms: typeof Schema.Number;
|
|
265
|
+
}>, never, {
|
|
266
|
+
readonly ms: number;
|
|
267
|
+
} & {
|
|
268
|
+
readonly id: "js" | "dts" | "loose" | "exe" | "meta";
|
|
269
|
+
} & {
|
|
270
|
+
readonly files: readonly EmittedFile[];
|
|
271
|
+
}, {}, {}>;
|
|
272
|
+
/**
|
|
273
|
+
* One build pass within a target group (js / dts / loose / exe / meta).
|
|
274
|
+
*
|
|
275
|
+
* @public
|
|
276
|
+
*/
|
|
277
|
+
declare class PassReport extends PassReport_base {}
|
|
278
|
+
declare const TargetGroupReport_base: Schema.Class<TargetGroupReport, {
|
|
279
|
+
id: typeof Schema.String;
|
|
280
|
+
entries: Schema.Array$<typeof Schema.String>;
|
|
281
|
+
passes: Schema.Array$<typeof PassReport>;
|
|
282
|
+
warnings: Schema.Array$<typeof DiagnosticEntry>;
|
|
283
|
+
errors: Schema.Array$<typeof DiagnosticEntry>; /** Messages matched by `suppressWarnings`, kept for accounting and `--verbose` expansion. */
|
|
284
|
+
suppressed: Schema.Array$<typeof DiagnosticEntry>;
|
|
285
|
+
timings: typeof ReportTimings;
|
|
286
|
+
}, Schema.Struct.Encoded<{
|
|
287
|
+
id: typeof Schema.String;
|
|
288
|
+
entries: Schema.Array$<typeof Schema.String>;
|
|
289
|
+
passes: Schema.Array$<typeof PassReport>;
|
|
290
|
+
warnings: Schema.Array$<typeof DiagnosticEntry>;
|
|
291
|
+
errors: Schema.Array$<typeof DiagnosticEntry>; /** Messages matched by `suppressWarnings`, kept for accounting and `--verbose` expansion. */
|
|
292
|
+
suppressed: Schema.Array$<typeof DiagnosticEntry>;
|
|
293
|
+
timings: typeof ReportTimings;
|
|
294
|
+
}>, never, {
|
|
295
|
+
readonly entries: readonly string[];
|
|
296
|
+
} & {
|
|
297
|
+
readonly id: string;
|
|
298
|
+
} & {
|
|
299
|
+
readonly timings: ReportTimings;
|
|
300
|
+
} & {
|
|
301
|
+
readonly passes: readonly PassReport[];
|
|
302
|
+
} & {
|
|
303
|
+
readonly warnings: readonly DiagnosticEntry[];
|
|
304
|
+
} & {
|
|
305
|
+
readonly errors: readonly DiagnosticEntry[];
|
|
306
|
+
} & {
|
|
307
|
+
readonly suppressed: readonly DiagnosticEntry[];
|
|
308
|
+
}, {}, {}>;
|
|
309
|
+
/** @public */
|
|
310
|
+
declare class TargetGroupReport extends TargetGroupReport_base {}
|
|
311
|
+
declare const BuildReport_base: Schema.Class<BuildReport, {
|
|
312
|
+
package: typeof Schema.String;
|
|
313
|
+
targetGroups: Schema.Array$<typeof TargetGroupReport>;
|
|
314
|
+
}, Schema.Struct.Encoded<{
|
|
315
|
+
package: typeof Schema.String;
|
|
316
|
+
targetGroups: Schema.Array$<typeof TargetGroupReport>;
|
|
317
|
+
}>, never, {
|
|
318
|
+
readonly package: string;
|
|
319
|
+
} & {
|
|
320
|
+
readonly targetGroups: readonly TargetGroupReport[];
|
|
321
|
+
}, {}, {}>;
|
|
322
|
+
/** @public */
|
|
323
|
+
declare class BuildReport extends BuildReport_base {}
|
|
324
|
+
//#endregion
|
|
325
|
+
//#region src/report/collector.d.ts
|
|
326
|
+
/** @public */
|
|
327
|
+
type PassKind = PassReport["id"];
|
|
328
|
+
/** @public */
|
|
329
|
+
interface DiagnosticInput {
|
|
330
|
+
readonly source: DiagnosticEntry["source"];
|
|
331
|
+
readonly level: DiagnosticEntry["level"];
|
|
332
|
+
readonly text: string;
|
|
333
|
+
readonly code?: string;
|
|
334
|
+
readonly ciFatal?: boolean;
|
|
335
|
+
readonly file?: string;
|
|
336
|
+
readonly line?: number;
|
|
337
|
+
readonly column?: number;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Stateful build-event accumulator. The write surface is synchronous so it can be called directly
|
|
341
|
+
* from tsdown's customLogger and API Extractor's messageCallback (both invoked synchronously).
|
|
342
|
+
* `snapshot` builds the immutable BuildReport the Effect render pipeline consumes.
|
|
343
|
+
* @public
|
|
344
|
+
*/
|
|
345
|
+
declare class BuildCollector {
|
|
346
|
+
private readonly groups;
|
|
347
|
+
private group;
|
|
348
|
+
private pass;
|
|
349
|
+
registerGroup(groupId: string, entries: ReadonlyArray<string>): void;
|
|
350
|
+
recordEmitted(groupId: string, pass: PassKind, file: EmittedFile): void;
|
|
351
|
+
recordPassTiming(groupId: string, pass: PassKind, ms: number): void;
|
|
352
|
+
recordWarning(groupId: string, entry: DiagnosticInput): void;
|
|
353
|
+
recordError(groupId: string, entry: DiagnosticInput): void;
|
|
354
|
+
recordSuppressed(groupId: string, entry: DiagnosticInput): void;
|
|
355
|
+
snapshot(packageName: string): ReadonlyArray<BuildReport>;
|
|
356
|
+
}
|
|
357
|
+
declare const BuildCollectorTag_base: Context.TagClass<BuildCollectorTag, "@savvy-web/tsdown-plugins/BuildCollector", BuildCollector>;
|
|
358
|
+
/** @public */
|
|
359
|
+
declare class BuildCollectorTag extends BuildCollectorTag_base {}
|
|
360
|
+
//#endregion
|
|
155
361
|
//#region src/build/target-groups.d.ts
|
|
156
|
-
/**
|
|
362
|
+
/**
|
|
363
|
+
* A build group id: "dev" or any prod byte-variant id (e.g. "npm", "github", a custom key).
|
|
364
|
+
*
|
|
365
|
+
* @public
|
|
366
|
+
*/
|
|
157
367
|
type TargetGroupId = string;
|
|
158
|
-
/**
|
|
368
|
+
/**
|
|
369
|
+
* An output module format the build can emit.
|
|
370
|
+
*
|
|
371
|
+
* @public
|
|
372
|
+
*/
|
|
159
373
|
type BuildFormat = "esm" | "cjs";
|
|
160
|
-
/**
|
|
374
|
+
/**
|
|
375
|
+
* Bundling platform for the JS pass. Defaults to "node". Use "browser" for web runtime partitions.
|
|
376
|
+
*
|
|
377
|
+
* @public
|
|
378
|
+
*/
|
|
161
379
|
type BuildPlatform = "node" | "browser" | "neutral";
|
|
162
|
-
/**
|
|
380
|
+
/**
|
|
381
|
+
* A prod/dev group to build: its folder id and the resolved package name its manifest carries.
|
|
382
|
+
*
|
|
383
|
+
* @public
|
|
384
|
+
*/
|
|
163
385
|
interface BuildGroupSpec {
|
|
164
386
|
readonly id: TargetGroupId;
|
|
165
387
|
readonly name: string;
|
|
166
388
|
}
|
|
389
|
+
/** @public */
|
|
167
390
|
interface DeriveOptions {
|
|
168
391
|
readonly group: TargetGroupId;
|
|
169
392
|
readonly cwd: string;
|
|
@@ -211,6 +434,7 @@ interface DeriveOptions {
|
|
|
211
434
|
* the JS re-bundles workspace consumers (e.g. silk re-bundling silk-effects crashes at
|
|
212
435
|
* runtime). The split keeps per-module JS (no re-bundle hazard) AND bundled, self-contained
|
|
213
436
|
* declarations (no TS2883).
|
|
437
|
+
* @public
|
|
214
438
|
*/
|
|
215
439
|
interface DerivedTsdownOptions {
|
|
216
440
|
readonly outDir: string;
|
|
@@ -262,20 +486,36 @@ interface DerivedTsdownOptions {
|
|
|
262
486
|
/** JSX transform settings to forward to rolldown's inputOptions. */
|
|
263
487
|
readonly jsx?: JsxConfig | undefined;
|
|
264
488
|
}
|
|
265
|
-
/**
|
|
489
|
+
/**
|
|
490
|
+
* Derive the JS-pass tsdown options for one TargetGroup (per-module JS, no dts).
|
|
491
|
+
*
|
|
492
|
+
* @public
|
|
493
|
+
*/
|
|
266
494
|
declare function deriveTargetGroupOptions(options: DeriveOptions): DerivedTsdownOptions;
|
|
267
495
|
//#endregion
|
|
268
496
|
//#region src/build/loose-files.d.ts
|
|
269
|
-
/**
|
|
497
|
+
/**
|
|
498
|
+
* One standalone bundled output file, declared by its literal output filename.
|
|
499
|
+
*
|
|
500
|
+
* @public
|
|
501
|
+
*/
|
|
270
502
|
interface LooseFileSpec {
|
|
271
503
|
/** Source module to bundle into the file. */
|
|
272
504
|
readonly source: string;
|
|
273
505
|
/** Module format. Required only for an ambiguous `.js` key; inferred from `.mjs`/`.cjs`. */
|
|
274
506
|
readonly format?: BuildFormat | undefined;
|
|
275
507
|
}
|
|
276
|
-
/**
|
|
508
|
+
/**
|
|
509
|
+
* Map of literal output filename to its source (bare string) or a `{ source, format }` spec.
|
|
510
|
+
*
|
|
511
|
+
* @public
|
|
512
|
+
*/
|
|
277
513
|
type LooseFiles = Record<string, string | LooseFileSpec>;
|
|
278
|
-
/**
|
|
514
|
+
/**
|
|
515
|
+
* A loose file resolved to a concrete build descriptor.
|
|
516
|
+
*
|
|
517
|
+
* @public
|
|
518
|
+
*/
|
|
279
519
|
interface NormalizedLooseFile {
|
|
280
520
|
/** Literal output filename written into the package dir, e.g. `pnpmfile.mjs`. */
|
|
281
521
|
readonly outFile: string;
|
|
@@ -296,16 +536,22 @@ interface NormalizedLooseFile {
|
|
|
296
536
|
* a missing `source` is surfaced later by tsdown's entry resolution. Throws
|
|
297
537
|
* {@link ConfigValidationError} on any structural problem so the bundler's ConfigValidator
|
|
298
538
|
* surfaces it as a typed, fast-fail config error.
|
|
539
|
+
* @public
|
|
299
540
|
*/
|
|
300
541
|
declare function normalizeLooseFiles(files: LooseFiles): ReadonlyArray<NormalizedLooseFile>;
|
|
301
542
|
//#endregion
|
|
302
543
|
//#region src/build/build-target-groups.d.ts
|
|
303
|
-
/**
|
|
544
|
+
/**
|
|
545
|
+
* Signature compatible with tsdown's `build(inlineConfig)`.
|
|
546
|
+
*
|
|
547
|
+
* @public
|
|
548
|
+
*/
|
|
304
549
|
type TsdownBuild = (config: Record<string, unknown>) => Promise<unknown>;
|
|
305
550
|
/**
|
|
306
551
|
* CSS handling for a partition's JS pass, forwarded VERBATIM to tsdown's `css` option (consumed
|
|
307
552
|
* by `@tsdown/css`). Structurally typed so tsdown-plugins takes no dependency on `@tsdown/css`.
|
|
308
553
|
* The package whose runtime is built must install `@tsdown/css`; tsdown loads it lazily.
|
|
554
|
+
* @public
|
|
309
555
|
*/
|
|
310
556
|
interface CssOptions {
|
|
311
557
|
readonly modules?: boolean | {
|
|
@@ -318,7 +564,8 @@ interface CssOptions {
|
|
|
318
564
|
/**
|
|
319
565
|
* One entry partition built with its own format + bundling posture, layered into the
|
|
320
566
|
* SAME outDir as the base build (clean:false). Anything omitted falls back to the base
|
|
321
|
-
* build's value. `entry` is a subset of the package's entries (entryName -> source path).
|
|
567
|
+
* build's value. `entry` is a subset of the package's entries (`entryName -> source path`).
|
|
568
|
+
* @public
|
|
322
569
|
*/
|
|
323
570
|
interface EntryOverride {
|
|
324
571
|
readonly entry: Record<string, string>;
|
|
@@ -340,6 +587,7 @@ interface EntryOverride {
|
|
|
340
587
|
*/
|
|
341
588
|
readonly outSubdir?: string | undefined;
|
|
342
589
|
}
|
|
590
|
+
/** @public */
|
|
343
591
|
interface BuildTargetGroupsOptions {
|
|
344
592
|
readonly cwd: string;
|
|
345
593
|
readonly version: string;
|
|
@@ -377,8 +625,8 @@ interface BuildTargetGroupsOptions {
|
|
|
377
625
|
/**
|
|
378
626
|
* Force-bundle (inline) these packages into the JS output (tsdown `deps.alwaysBundle`),
|
|
379
627
|
* even declared deps that would otherwise be auto-externalized. The inverse of
|
|
380
|
-
* `externals`. JS pass only; `alwaysBundle` is allowed alongside our
|
|
381
|
-
* false` (the throw only fires when skipNodeModulesBundle is true).
|
|
628
|
+
* `externals`. JS pass only; `alwaysBundle` is allowed alongside our
|
|
629
|
+
* `skipNodeModulesBundle: false` (the throw only fires when skipNodeModulesBundle is true).
|
|
382
630
|
*/
|
|
383
631
|
readonly bundle?: ReadonlyArray<string> | undefined;
|
|
384
632
|
/** Output formats to emit. Defaults to esm-only when unset. */
|
|
@@ -437,6 +685,10 @@ interface BuildTargetGroupsOptions {
|
|
|
437
685
|
readonly exeRewrite?: ExeRewrite | undefined;
|
|
438
686
|
/** Injectable for tests; defaults to tsdown's build. */
|
|
439
687
|
readonly build?: TsdownBuild;
|
|
688
|
+
/** When set, muzzle tsdown (silent + customLogger) and capture metrics/timing into this collector. */
|
|
689
|
+
readonly collector?: BuildCollector | undefined;
|
|
690
|
+
/** Compute gzip sizes for emitted files (verbose render). Forwarded to the metrics plugin. */
|
|
691
|
+
readonly verbose?: boolean | undefined;
|
|
440
692
|
}
|
|
441
693
|
/**
|
|
442
694
|
* Run tsdown.build() per TargetGroup. Composable so the escape hatch gets multi-group too.
|
|
@@ -452,6 +704,7 @@ interface BuildTargetGroupsOptions {
|
|
|
452
704
|
* build (JS and the dts plugin share it), so a single pass cannot give per-module JS + bundled
|
|
453
705
|
* dts. Per-module dts breaks type portability (TS2883); bundling the JS re-bundles workspace
|
|
454
706
|
* consumers. The split keeps per-module JS AND rolled-up, self-contained declarations.
|
|
707
|
+
* @public
|
|
455
708
|
*/
|
|
456
709
|
declare function buildTargetGroups(options: BuildTargetGroupsOptions): Promise<void>;
|
|
457
710
|
//#endregion
|
|
@@ -472,6 +725,7 @@ declare function buildTargetGroups(options: BuildTargetGroupsOptions): Promise<v
|
|
|
472
725
|
*
|
|
473
726
|
* The emitted footer is also self-guarded (`module.exports.default !== void 0`), so it is a
|
|
474
727
|
* runtime no-op whenever the static gate is ever too generous.
|
|
728
|
+
* @public
|
|
475
729
|
*/
|
|
476
730
|
declare function cjsDefaultInterop(): Plugin;
|
|
477
731
|
//#endregion
|
|
@@ -483,13 +737,15 @@ declare function cjsDefaultInterop(): Plugin;
|
|
|
483
737
|
* Why this exists — a rolldown 1.1.0 codegen defect (verified against the latest
|
|
484
738
|
* published rolldown 1.1.0 / tsdown 0.22.2, with no newer release to upgrade to):
|
|
485
739
|
*
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
*
|
|
740
|
+
* ```ts
|
|
741
|
+
* // SOURCE (e.g. vfile's lib/minproc.js)
|
|
742
|
+
* export {default as minproc} from 'node:process'
|
|
743
|
+
* // ...consumed as minproc.cwd()
|
|
489
744
|
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
*
|
|
745
|
+
* // rolldown CJS OUTPUT (BROKEN)
|
|
746
|
+
* let node_process = require("node:process");
|
|
747
|
+
* node_process.default.cwd() // <- require("node:process").default is undefined
|
|
748
|
+
* ```
|
|
493
749
|
*
|
|
494
750
|
* For a default import of an EXTERNAL Node builtin, rolldown emits a bare
|
|
495
751
|
* `require("node:x")` WITHOUT its `__toESM` interop wrapper, yet still accesses
|
|
@@ -506,14 +762,18 @@ declare function cjsDefaultInterop(): Plugin;
|
|
|
506
762
|
* layer, which is why the correction happens here on the source.
|
|
507
763
|
*
|
|
508
764
|
* Rewrites (the two static forms that occur in practice, anchored to statement start):
|
|
509
|
-
*
|
|
510
|
-
*
|
|
511
|
-
*
|
|
765
|
+
*
|
|
766
|
+
* ```ts
|
|
767
|
+
* import NAME from "node:x" -> import * as NAME from "node:x"
|
|
768
|
+
* export { default as NAME } from "node:x" -> export * as NAME from "node:x"
|
|
769
|
+
* import NAME, { a, b } from "node:x" -> import * as NAME from "node:x"; import { a, b } from "node:x"
|
|
770
|
+
* ```
|
|
512
771
|
*
|
|
513
772
|
* The namespace binding NAME carries the builtin's named exports (`NAME.cwd`,
|
|
514
773
|
* `NAME.join`, ...), which is exactly how a default import of a builtin is consumed
|
|
515
774
|
* in practice. ESM output is unaffected at runtime (a namespace import of a builtin
|
|
516
775
|
* resolves to the same members), so the plugin is safe to attach to dual builds.
|
|
776
|
+
* @public
|
|
517
777
|
*/
|
|
518
778
|
declare function nodeBuiltinDefaultInterop(): Plugin;
|
|
519
779
|
//#endregion
|
|
@@ -531,6 +791,7 @@ declare function nodeBuiltinDefaultInterop(): Plugin;
|
|
|
531
791
|
*
|
|
532
792
|
* Recurses, but skips `node_modules` so it does not traverse a self-contained bundle's
|
|
533
793
|
* vendored tree — only the package's own emitted declarations carry maps worth stripping.
|
|
794
|
+
* @public
|
|
534
795
|
*/
|
|
535
796
|
declare function removeDeclarationMaps(pkgDir: string): string[];
|
|
536
797
|
//#endregion
|
|
@@ -548,6 +809,7 @@ declare function removeDeclarationMaps(pkgDir: string): string[];
|
|
|
548
809
|
*
|
|
549
810
|
* The byte-diff keeps unchanged files (and their timestamps) untouched, so a large copied asset
|
|
550
811
|
* tree — e.g. the mcp markdown corpus — is not rewritten on every build.
|
|
812
|
+
* @public
|
|
551
813
|
*/
|
|
552
814
|
declare function syncPublicDir(sourceDir: string, targetDir: string): void;
|
|
553
815
|
//#endregion
|
|
@@ -561,15 +823,20 @@ declare function syncPublicDir(sourceDir: string, targetDir: string): void;
|
|
|
561
823
|
*
|
|
562
824
|
* Rejects with `CatalogResolutionError` on an unresolvable reference, or
|
|
563
825
|
* `CatalogAssemblyError` if the workspace catalog set cannot be assembled.
|
|
826
|
+
* @public
|
|
564
827
|
*/
|
|
565
828
|
declare function resolveManifest(pkg: ManifestLike$1): Promise<ManifestLike$1>;
|
|
566
829
|
//#endregion
|
|
567
830
|
//#region src/changesets/next-versions.d.ts
|
|
568
|
-
/**
|
|
831
|
+
/**
|
|
832
|
+
* Result of resolving next release versions for a workspace.
|
|
833
|
+
*
|
|
834
|
+
* @public
|
|
835
|
+
*/
|
|
569
836
|
interface NextVersions {
|
|
570
837
|
/** Monorepo root containing `.changeset/` (or `cwd` when no workspace was found). */
|
|
571
838
|
readonly root: string;
|
|
572
|
-
/** Canonical package name
|
|
839
|
+
/** Canonical package name `->` next release version (current version when unbumped). */
|
|
573
840
|
readonly versions: ReadonlyMap<string, string>;
|
|
574
841
|
}
|
|
575
842
|
/**
|
|
@@ -579,6 +846,7 @@ interface NextVersions {
|
|
|
579
846
|
* each package's CURRENT version, then overlays `newVersion` for changeset-affected packages
|
|
580
847
|
* via `@changesets/get-release-plan`. Never rejects: any failure (not a workspace, missing
|
|
581
848
|
* `.changeset/config.json`, parse error) degrades to current versions (or an empty map).
|
|
849
|
+
* @public
|
|
582
850
|
*/
|
|
583
851
|
declare function resolveNextVersions(cwd: string): Promise<NextVersions>;
|
|
584
852
|
//#endregion
|
|
@@ -586,7 +854,11 @@ declare function resolveNextVersions(cwd: string): Promise<NextVersions>;
|
|
|
586
854
|
declare const MetaGenerationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
587
855
|
readonly _tag: "MetaGenerationError";
|
|
588
856
|
} & Readonly<A>;
|
|
589
|
-
/**
|
|
857
|
+
/**
|
|
858
|
+
* API Extractor meta generation failed for an entry.
|
|
859
|
+
*
|
|
860
|
+
* @public
|
|
861
|
+
*/
|
|
590
862
|
declare class MetaGenerationError extends MetaGenerationError_base<{
|
|
591
863
|
readonly entry: string;
|
|
592
864
|
readonly reason: string;
|
|
@@ -596,7 +868,11 @@ declare class MetaGenerationError extends MetaGenerationError_base<{
|
|
|
596
868
|
declare const ConfigValidationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
597
869
|
readonly _tag: "ConfigValidationError";
|
|
598
870
|
} & Readonly<A>;
|
|
599
|
-
/**
|
|
871
|
+
/**
|
|
872
|
+
* A savvy.build.ts or publishConfig.targets config is structurally invalid; raised before any build work.
|
|
873
|
+
*
|
|
874
|
+
* @public
|
|
875
|
+
*/
|
|
600
876
|
declare class ConfigValidationError extends ConfigValidationError_base<{
|
|
601
877
|
readonly path: string;
|
|
602
878
|
readonly reason: string;
|
|
@@ -605,26 +881,46 @@ declare class ConfigValidationError extends ConfigValidationError_base<{
|
|
|
605
881
|
}
|
|
606
882
|
//#endregion
|
|
607
883
|
//#region src/exe/config.d.ts
|
|
608
|
-
/**
|
|
884
|
+
/**
|
|
885
|
+
* Default Node runtime embedded in the SEA (parity with the vitest-agent reference).
|
|
886
|
+
*
|
|
887
|
+
* @public
|
|
888
|
+
*/
|
|
609
889
|
declare const DEFAULT_EXE_NODE_VERSION = "25.9.0";
|
|
610
|
-
/**
|
|
890
|
+
/**
|
|
891
|
+
* A resolved per-platform SEA target. `platform` uses the tsdown/\@tsdown/exe token (win, not win32).
|
|
892
|
+
*
|
|
893
|
+
* @public
|
|
894
|
+
*/
|
|
611
895
|
interface ExeTarget {
|
|
612
896
|
readonly platform: "darwin" | "linux" | "win";
|
|
613
897
|
readonly arch: "arm64" | "x64";
|
|
614
898
|
readonly nodeVersion: string;
|
|
615
899
|
}
|
|
616
|
-
/**
|
|
900
|
+
/**
|
|
901
|
+
* A target before nodeVersion defaulting (platform/arch only).
|
|
902
|
+
*
|
|
903
|
+
* @public
|
|
904
|
+
*/
|
|
617
905
|
interface ExeTargetInput {
|
|
618
906
|
readonly platform: "darwin" | "linux" | "win";
|
|
619
907
|
readonly arch: "arm64" | "x64";
|
|
620
908
|
}
|
|
621
|
-
/**
|
|
909
|
+
/**
|
|
910
|
+
* SEA seaConfig overrides (subset; the rest are defaulted).
|
|
911
|
+
*
|
|
912
|
+
* @public
|
|
913
|
+
*/
|
|
622
914
|
interface ExeSeaConfig {
|
|
623
915
|
readonly disableExperimentalSEAWarning?: boolean | undefined;
|
|
624
916
|
readonly useCodeCache?: boolean | undefined;
|
|
625
917
|
readonly useSnapshot?: boolean | undefined;
|
|
626
918
|
}
|
|
627
|
-
/**
|
|
919
|
+
/**
|
|
920
|
+
* One SEA binary to compile.
|
|
921
|
+
*
|
|
922
|
+
* @public
|
|
923
|
+
*/
|
|
628
924
|
interface ExeConfig {
|
|
629
925
|
/** Output binary basename (no extension/suffix). */
|
|
630
926
|
readonly fileName: string;
|
|
@@ -637,7 +933,11 @@ interface ExeConfig {
|
|
|
637
933
|
/** Explicit targets; default inferred from the package os/cpu. */
|
|
638
934
|
readonly targets?: ReadonlyArray<ExeTargetInput> | undefined;
|
|
639
935
|
}
|
|
640
|
-
/**
|
|
936
|
+
/**
|
|
937
|
+
* Fully-resolved SEA binary spec (no optionals).
|
|
938
|
+
*
|
|
939
|
+
* @public
|
|
940
|
+
*/
|
|
641
941
|
interface NormalizedExe {
|
|
642
942
|
readonly fileName: string;
|
|
643
943
|
readonly entry: string;
|
|
@@ -648,7 +948,11 @@ interface NormalizedExe {
|
|
|
648
948
|
readonly useSnapshot: boolean;
|
|
649
949
|
};
|
|
650
950
|
}
|
|
651
|
-
/**
|
|
951
|
+
/**
|
|
952
|
+
* The package's own os/cpu fields, used to infer a single platform target.
|
|
953
|
+
*
|
|
954
|
+
* @public
|
|
955
|
+
*/
|
|
652
956
|
interface PkgOsCpu {
|
|
653
957
|
readonly os: ReadonlyArray<string>;
|
|
654
958
|
readonly cpu: ReadonlyArray<string>;
|
|
@@ -658,27 +962,44 @@ interface PkgOsCpu {
|
|
|
658
962
|
*
|
|
659
963
|
* Pure function; structural validation (missing fileName, empty targets) lives in the
|
|
660
964
|
* config-validation layer.
|
|
965
|
+
* @public
|
|
661
966
|
*/
|
|
662
967
|
declare function normalizeExeOptions(exe: ExeConfig | ReadonlyArray<ExeConfig>, pkg: PkgOsCpu): ReadonlyArray<NormalizedExe>;
|
|
663
968
|
//#endregion
|
|
664
969
|
//#region src/meta/config.d.ts
|
|
665
|
-
/**
|
|
970
|
+
/**
|
|
971
|
+
* A single TSDoc tag definition (parity with api-extractor's TSDoc config).
|
|
972
|
+
*
|
|
973
|
+
* @public
|
|
974
|
+
*/
|
|
666
975
|
interface TsdocTagDefinition {
|
|
667
976
|
readonly tagName: string;
|
|
668
977
|
readonly syntaxKind: "block" | "inline" | "modifier";
|
|
669
978
|
readonly allowMultiple?: boolean | undefined;
|
|
670
979
|
}
|
|
671
|
-
/**
|
|
980
|
+
/**
|
|
981
|
+
* An api-extractor message-suppression rule. messageId is exact-matched; pattern (regex or substring) is AND-matched against the text.
|
|
982
|
+
*
|
|
983
|
+
* @public
|
|
984
|
+
*/
|
|
672
985
|
interface WarningSuppressionRule {
|
|
673
986
|
readonly messageId: string;
|
|
674
987
|
readonly pattern?: string | undefined;
|
|
675
988
|
}
|
|
676
|
-
/**
|
|
989
|
+
/**
|
|
990
|
+
* TSDoc / doc-warning configuration. suppressWarnings is doc functionality, so it lives here.
|
|
991
|
+
*
|
|
992
|
+
* @public
|
|
993
|
+
*/
|
|
677
994
|
interface TsdocOptions {
|
|
678
995
|
readonly suppressWarnings?: ReadonlyArray<WarningSuppressionRule> | undefined;
|
|
679
996
|
readonly tagDefinitions?: ReadonlyArray<TsdocTagDefinition> | undefined;
|
|
680
997
|
}
|
|
681
|
-
/**
|
|
998
|
+
/**
|
|
999
|
+
* The `meta` field on defineBuild. Absent means no api-model generation.
|
|
1000
|
+
*
|
|
1001
|
+
* @public
|
|
1002
|
+
*/
|
|
682
1003
|
interface MetaOptions {
|
|
683
1004
|
/** Directories to copy the canonical group's api-model into after `savvy build --target prod`. */
|
|
684
1005
|
readonly localPaths?: ReadonlyArray<string> | undefined;
|
|
@@ -690,7 +1011,11 @@ interface MetaOptions {
|
|
|
690
1011
|
readonly optimistic?: "auto" | boolean | undefined;
|
|
691
1012
|
readonly tsdoc?: TsdocOptions | undefined;
|
|
692
1013
|
}
|
|
693
|
-
/**
|
|
1014
|
+
/**
|
|
1015
|
+
* Fully-resolved meta options (no optionals).
|
|
1016
|
+
*
|
|
1017
|
+
* @public
|
|
1018
|
+
*/
|
|
694
1019
|
interface NormalizedMeta {
|
|
695
1020
|
readonly localPaths: ReadonlyArray<string>;
|
|
696
1021
|
readonly optimistic: boolean;
|
|
@@ -699,14 +1024,22 @@ interface NormalizedMeta {
|
|
|
699
1024
|
readonly tagDefinitions: ReadonlyArray<TsdocTagDefinition>;
|
|
700
1025
|
};
|
|
701
1026
|
}
|
|
702
|
-
/**
|
|
1027
|
+
/**
|
|
1028
|
+
* Fill defaults so downstream code never branches on undefined.
|
|
1029
|
+
*
|
|
1030
|
+
* @public
|
|
1031
|
+
*/
|
|
703
1032
|
declare function normalizeMetaOptions(meta: MetaOptions, env?: {
|
|
704
1033
|
CI?: string | undefined;
|
|
705
1034
|
GITHUB_ACTIONS?: string | undefined;
|
|
706
1035
|
}): NormalizedMeta;
|
|
707
1036
|
//#endregion
|
|
708
1037
|
//#region src/targets/config.d.ts
|
|
709
|
-
/**
|
|
1038
|
+
/**
|
|
1039
|
+
* A single object-form publish target. Uses `from` XOR `name` (never both).
|
|
1040
|
+
*
|
|
1041
|
+
* @public
|
|
1042
|
+
*/
|
|
710
1043
|
interface PublishTargetObject {
|
|
711
1044
|
/** Registry endpoint. Required for custom keys; defaulted for `npm`/`github`. */
|
|
712
1045
|
readonly registry?: string | undefined;
|
|
@@ -715,11 +1048,23 @@ interface PublishTargetObject {
|
|
|
715
1048
|
/** Reuse another target's group bytes (deploy them to this registry). Mutually exclusive with `name`. */
|
|
716
1049
|
readonly from?: string | undefined;
|
|
717
1050
|
}
|
|
718
|
-
/**
|
|
1051
|
+
/**
|
|
1052
|
+
* A `publishConfig.targets` value: `true` (well-known registry, base name), a string (name override), or an object.
|
|
1053
|
+
*
|
|
1054
|
+
* @public
|
|
1055
|
+
*/
|
|
719
1056
|
type PublishTargetValue = true | string | PublishTargetObject;
|
|
720
|
-
/**
|
|
1057
|
+
/**
|
|
1058
|
+
* The `publishConfig.targets` map, keyed by target id (`npm`, `github`, or a custom key).
|
|
1059
|
+
*
|
|
1060
|
+
* @public
|
|
1061
|
+
*/
|
|
721
1062
|
type PublishTargets = Record<string, PublishTargetValue>;
|
|
722
|
-
/**
|
|
1063
|
+
/**
|
|
1064
|
+
* A distinct byte-variant build group (one per distinct resolved name).
|
|
1065
|
+
*
|
|
1066
|
+
* @public
|
|
1067
|
+
*/
|
|
723
1068
|
interface ResolvedGroup {
|
|
724
1069
|
/** Folder id; the group's output dir nests this id under dist/prod, with a pkg subfolder. */
|
|
725
1070
|
readonly id: string;
|
|
@@ -728,7 +1073,11 @@ interface ResolvedGroup {
|
|
|
728
1073
|
/** The group's pkg output dir, relative to the package root. */
|
|
729
1074
|
readonly dir: string;
|
|
730
1075
|
}
|
|
731
|
-
/**
|
|
1076
|
+
/**
|
|
1077
|
+
* A resolved registry target (one per `publishConfig.targets` key).
|
|
1078
|
+
*
|
|
1079
|
+
* @public
|
|
1080
|
+
*/
|
|
732
1081
|
interface ResolvedTarget {
|
|
733
1082
|
/** The `publishConfig.targets` key. */
|
|
734
1083
|
readonly id: string;
|
|
@@ -739,16 +1088,28 @@ interface ResolvedTarget {
|
|
|
739
1088
|
/** The resolved registry endpoint. */
|
|
740
1089
|
readonly registry: string;
|
|
741
1090
|
}
|
|
742
|
-
/**
|
|
1091
|
+
/**
|
|
1092
|
+
* The full resolution of `publishConfig.targets`: the distinct groups to build, and every target bound to one.
|
|
1093
|
+
*
|
|
1094
|
+
* @public
|
|
1095
|
+
*/
|
|
743
1096
|
interface TargetResolution {
|
|
744
1097
|
readonly groups: ReadonlyArray<ResolvedGroup>;
|
|
745
1098
|
readonly targets: ReadonlyArray<ResolvedTarget>;
|
|
746
1099
|
}
|
|
747
|
-
/**
|
|
1100
|
+
/**
|
|
1101
|
+
* True when a target value is the object form (carries registry/name/from).
|
|
1102
|
+
*
|
|
1103
|
+
* @public
|
|
1104
|
+
*/
|
|
748
1105
|
declare function isTargetObject(value: PublishTargetValue): value is PublishTargetObject;
|
|
749
1106
|
//#endregion
|
|
750
1107
|
//#region src/config-validation/ConfigValidator.d.ts
|
|
751
|
-
/**
|
|
1108
|
+
/**
|
|
1109
|
+
* The normalized facts the validator checks, assembled by the bundler before any build work.
|
|
1110
|
+
*
|
|
1111
|
+
* @public
|
|
1112
|
+
*/
|
|
752
1113
|
interface ValidationInput {
|
|
753
1114
|
readonly baseName: string;
|
|
754
1115
|
/** Whether the package declares an exports map (for the model-without-exports cross-field rule). */
|
|
@@ -766,14 +1127,23 @@ interface ValidationInput {
|
|
|
766
1127
|
declare const ConfigValidator_base: Context.TagClass<ConfigValidator, "@savvy-web/tsdown-plugins/ConfigValidator", {
|
|
767
1128
|
readonly validate: (input: ValidationInput) => Effect.Effect<void, ConfigValidationError>;
|
|
768
1129
|
}>;
|
|
769
|
-
/**
|
|
1130
|
+
/**
|
|
1131
|
+
* Fast-fail config validator; runs first in the bundler over the resolved config.
|
|
1132
|
+
*
|
|
1133
|
+
* @public
|
|
1134
|
+
*/
|
|
770
1135
|
declare class ConfigValidator extends ConfigValidator_base {}
|
|
771
1136
|
//#endregion
|
|
772
1137
|
//#region src/config-validation/ConfigValidatorLive.d.ts
|
|
773
|
-
/**
|
|
1138
|
+
/**
|
|
1139
|
+
* Live ConfigValidator: wraps the synchronous rule set, surfacing ConfigValidationError as a typed Effect failure.
|
|
1140
|
+
*
|
|
1141
|
+
* @public
|
|
1142
|
+
*/
|
|
774
1143
|
declare const ConfigValidatorLive: Layer.Layer<ConfigValidator, never, never>;
|
|
775
1144
|
//#endregion
|
|
776
1145
|
//#region src/dts/resolved-tsconfig.d.ts
|
|
1146
|
+
/** @public */
|
|
777
1147
|
interface ResolvedTsconfigOptions {
|
|
778
1148
|
/** Absolute package root. */
|
|
779
1149
|
readonly cwd: string;
|
|
@@ -784,26 +1154,38 @@ interface ResolvedTsconfigOptions {
|
|
|
784
1154
|
/** TS `compilerOptions.jsxImportSource` to forward (e.g. "react"). */
|
|
785
1155
|
readonly jsxImportSource?: string | undefined;
|
|
786
1156
|
}
|
|
1157
|
+
/** @public */
|
|
787
1158
|
interface ResolvedTsconfig {
|
|
788
1159
|
readonly compilerOptions: Record<string, unknown>;
|
|
789
1160
|
readonly include: ReadonlyArray<string>;
|
|
790
1161
|
readonly exclude: ReadonlyArray<string>;
|
|
791
1162
|
}
|
|
792
|
-
/**
|
|
1163
|
+
/**
|
|
1164
|
+
* Build the portable absolute-path tsconfig object (ported from rslib writeBundleTempConfig).
|
|
1165
|
+
*
|
|
1166
|
+
* @public
|
|
1167
|
+
*/
|
|
793
1168
|
declare function buildResolvedTsconfig(options: ResolvedTsconfigOptions): ResolvedTsconfig;
|
|
794
|
-
/**
|
|
1169
|
+
/**
|
|
1170
|
+
* Write the resolved tsconfig to a temp file and return its absolute path.
|
|
1171
|
+
*
|
|
1172
|
+
* @public
|
|
1173
|
+
*/
|
|
795
1174
|
declare function writeResolvedTsconfig(options: ResolvedTsconfigOptions): string;
|
|
796
1175
|
//#endregion
|
|
797
1176
|
//#region src/entry/extract.d.ts
|
|
1177
|
+
/** @public */
|
|
798
1178
|
interface PackageJsonLike {
|
|
799
1179
|
readonly exports?: unknown;
|
|
800
1180
|
readonly bin?: unknown;
|
|
801
1181
|
}
|
|
1182
|
+
/** @public */
|
|
802
1183
|
interface ExtractOptions {
|
|
803
1184
|
readonly exportsAsIndexes?: boolean | undefined;
|
|
804
1185
|
/** Source paths to NOT turn into JS build entries (e.g. an exe entry compiled as a SEA). */
|
|
805
1186
|
readonly excludeSources?: ReadonlyArray<string> | undefined;
|
|
806
1187
|
}
|
|
1188
|
+
/** @public */
|
|
807
1189
|
interface ExtractResult {
|
|
808
1190
|
/** entry name to TS source path */
|
|
809
1191
|
readonly entries: Record<string, string>;
|
|
@@ -821,22 +1203,36 @@ interface ExtractResult {
|
|
|
821
1203
|
* @internal
|
|
822
1204
|
*/
|
|
823
1205
|
declare const createEntryName: (exportKey: string, exportsAsIndexes: boolean) => string;
|
|
1206
|
+
/** @public */
|
|
824
1207
|
declare function extractEntries(pkg: PackageJsonLike, options?: ExtractOptions): ExtractResult;
|
|
825
1208
|
//#endregion
|
|
826
1209
|
//#region src/entry/package-json-entries.d.ts
|
|
1210
|
+
/** @public */
|
|
827
1211
|
interface PackageJsonEntriesOptions extends ExtractOptions {
|
|
828
1212
|
/** In-memory package.json. If omitted, reads `<cwd>/package.json`. */
|
|
829
1213
|
readonly pkg?: PackageJsonLike;
|
|
830
1214
|
/** Working directory for reading package.json. Defaults to process.cwd(). */
|
|
831
1215
|
readonly cwd?: string;
|
|
832
1216
|
}
|
|
833
|
-
/**
|
|
1217
|
+
/**
|
|
1218
|
+
* Derive a tsdown `entry` record (name to source path) from a package.json.
|
|
1219
|
+
*
|
|
1220
|
+
* @public
|
|
1221
|
+
*/
|
|
834
1222
|
declare function packageJsonEntries(options?: PackageJsonEntriesOptions): Record<string, string>;
|
|
835
1223
|
//#endregion
|
|
836
1224
|
//#region src/exe/build.d.ts
|
|
837
|
-
/**
|
|
1225
|
+
/**
|
|
1226
|
+
* A minimal structural type for tsdown's build, kept loose so this package keeps no tsdown runtime dep (interface-only).
|
|
1227
|
+
*
|
|
1228
|
+
* @public
|
|
1229
|
+
*/
|
|
838
1230
|
type ExeBuild = (config: unknown) => Promise<unknown>;
|
|
839
|
-
/**
|
|
1231
|
+
/**
|
|
1232
|
+
* Options for compiling SEA binaries.
|
|
1233
|
+
*
|
|
1234
|
+
* @public
|
|
1235
|
+
*/
|
|
840
1236
|
interface RunExeBuildOptions {
|
|
841
1237
|
readonly cwd: string;
|
|
842
1238
|
/** Directory the binaries are emitted into (e.g. dist/dev/pkg/bin). */
|
|
@@ -845,19 +1241,31 @@ interface RunExeBuildOptions {
|
|
|
845
1241
|
readonly specs: ReadonlyArray<NormalizedExe>;
|
|
846
1242
|
/** Injectable tsdown build (defaults to tsdown's build function). */
|
|
847
1243
|
readonly build?: ExeBuild | undefined;
|
|
1244
|
+
/** When set with groupId, muzzle tsdown and record an "exe" pass into this collector. */
|
|
1245
|
+
readonly collector?: BuildCollector | undefined;
|
|
1246
|
+
/** Target-group id the exe pass belongs to (required to record into the collector). */
|
|
1247
|
+
readonly groupId?: string | undefined;
|
|
1248
|
+
/** Compute gzip sizes (verbose render). */
|
|
1249
|
+
readonly verbose?: boolean | undefined;
|
|
848
1250
|
}
|
|
849
|
-
/**
|
|
850
|
-
|
|
851
|
-
|
|
1251
|
+
/**
|
|
1252
|
+
* Compile each SEA binary via tsdown's exe mode. One tsdown build per spec.
|
|
1253
|
+
*
|
|
1254
|
+
* @public
|
|
1255
|
+
*/
|
|
1256
|
+
declare function runExeBuild(options: RunExeBuildOptions): Promise<void>;
|
|
1257
|
+
//#endregion
|
|
852
1258
|
//#region src/exe/filename.d.ts
|
|
853
1259
|
/**
|
|
854
1260
|
* The exact filename `@tsdown/exe` emits for a SEA target, mirroring tsdown's
|
|
855
1261
|
* `resolveOutputFileName`: base fileName + `-<platform>-<arch>` + `.exe` on win.
|
|
856
1262
|
* Single source of truth so the manifest value never drifts from the on-disk file.
|
|
1263
|
+
* @public
|
|
857
1264
|
*/
|
|
858
1265
|
declare function computeExeFileName(fileName: string, target: ExeTarget): string;
|
|
859
1266
|
//#endregion
|
|
860
1267
|
//#region src/meta/generate.d.ts
|
|
1268
|
+
/** @public */
|
|
861
1269
|
interface GenerateMetaOptions {
|
|
862
1270
|
readonly cwd: string;
|
|
863
1271
|
readonly packageName: string;
|
|
@@ -880,7 +1288,14 @@ interface GenerateMetaOptions {
|
|
|
880
1288
|
* rewrite. When omitted, the package.json is copied verbatim.
|
|
881
1289
|
*/
|
|
882
1290
|
readonly manifestTransform?: ((pkg: Record<string, unknown>) => Record<string, unknown>) | undefined;
|
|
883
|
-
|
|
1291
|
+
/** When set, API Extractor warnings/errors are routed here (and suppressed from console). */
|
|
1292
|
+
readonly onMessage?: ((entry: DiagnosticInput) => void) | undefined;
|
|
1293
|
+
/** When true (CI), forgotten exports become a hard build error. */
|
|
1294
|
+
readonly ci?: boolean | undefined;
|
|
1295
|
+
/** When set, messages matched by `suppressWarnings` are routed here for accounting. */
|
|
1296
|
+
readonly onSuppressed?: ((entry: DiagnosticInput) => void) | undefined;
|
|
1297
|
+
}
|
|
1298
|
+
/** @public */
|
|
884
1299
|
interface MetaResult {
|
|
885
1300
|
readonly apiJsonPath: string;
|
|
886
1301
|
readonly apiJsonFilename: string;
|
|
@@ -891,6 +1306,7 @@ interface MetaResult {
|
|
|
891
1306
|
* outMetaDir (`<unscoped>.api.json` + the final `package.json` + a portable `tsconfig.json`),
|
|
892
1307
|
* copying that trio into each localPaths dir. The api-extractor `tsdoc-metadata.json` is a
|
|
893
1308
|
* published-package artifact and is written into `dtsDir` (the built pkg/), not the meta bundle.
|
|
1309
|
+
* @public
|
|
894
1310
|
*/
|
|
895
1311
|
declare function generateMeta(options: GenerateMetaOptions): Promise<MetaResult>;
|
|
896
1312
|
//#endregion
|
|
@@ -900,9 +1316,62 @@ declare function generateMeta(options: GenerateMetaOptions): Promise<MetaResult>
|
|
|
900
1316
|
* dependency version reflect their NEXT release version from `versions`. Pure: returns a new
|
|
901
1317
|
* object, never mutates the input. External/catalog-resolved deps (names absent from `versions`)
|
|
902
1318
|
* are left as-is.
|
|
1319
|
+
* @public
|
|
903
1320
|
*/
|
|
904
1321
|
declare function rewriteMetaVersions(pkg: Record<string, unknown>, versions: ReadonlyMap<string, string>, selfName: string): Record<string, unknown>;
|
|
905
1322
|
//#endregion
|
|
1323
|
+
//#region src/meta/run-pass.d.ts
|
|
1324
|
+
/**
|
|
1325
|
+
* Options for the meta-pass orchestrator.
|
|
1326
|
+
*
|
|
1327
|
+
* @public
|
|
1328
|
+
*/
|
|
1329
|
+
interface RunMetaPassOptions {
|
|
1330
|
+
readonly cwd: string;
|
|
1331
|
+
readonly packageName: string;
|
|
1332
|
+
readonly tsconfigPath: string;
|
|
1333
|
+
readonly groups: ReadonlyArray<{
|
|
1334
|
+
id: string;
|
|
1335
|
+
name: string;
|
|
1336
|
+
}>;
|
|
1337
|
+
readonly entries: Record<string, string>;
|
|
1338
|
+
readonly exportsMap: Record<string, string> | undefined;
|
|
1339
|
+
readonly overrides?: ReadonlyArray<{
|
|
1340
|
+
entries: ReadonlyArray<string>;
|
|
1341
|
+
outSubdir?: string | undefined;
|
|
1342
|
+
}> | undefined;
|
|
1343
|
+
readonly meta: MetaOptions;
|
|
1344
|
+
readonly collector: BuildCollector;
|
|
1345
|
+
readonly ci: boolean;
|
|
1346
|
+
/** Injectable for tests; defaults to the real generateMeta. */
|
|
1347
|
+
readonly generateMeta?: (o: GenerateMetaOptions) => Promise<MetaResult>;
|
|
1348
|
+
/** Injectable for tests; defaults to the real resolveNextVersions. Only called when optimistic. */
|
|
1349
|
+
readonly resolveNextVersions?: (cwd: string) => Promise<{
|
|
1350
|
+
versions: ReadonlyMap<string, string>;
|
|
1351
|
+
}>;
|
|
1352
|
+
}
|
|
1353
|
+
/**
|
|
1354
|
+
* Meta-pass orchestrator: derives export paths, filters bin/ entries, resolves optimistic
|
|
1355
|
+
* next-versions, and calls generateMeta once per publish group.
|
|
1356
|
+
* @public
|
|
1357
|
+
*/
|
|
1358
|
+
declare function runMetaPass(o: RunMetaPassOptions): Promise<void>;
|
|
1359
|
+
/**
|
|
1360
|
+
* Map entry names to export paths using the package exports map. index maps to ".".
|
|
1361
|
+
*
|
|
1362
|
+
* @public
|
|
1363
|
+
*/
|
|
1364
|
+
declare function deriveExportPaths(entries: Record<string, string>, exportsMap: Record<string, string> | undefined): Record<string, string>;
|
|
1365
|
+
/**
|
|
1366
|
+
* For each `outSubdir` override, point its meta entry at the isolated sub-package barrel.
|
|
1367
|
+
*
|
|
1368
|
+
* @public
|
|
1369
|
+
*/
|
|
1370
|
+
declare function applySubdirMetaEntries(overrides: ReadonlyArray<{
|
|
1371
|
+
entries: ReadonlyArray<string>;
|
|
1372
|
+
outSubdir?: string | undefined;
|
|
1373
|
+
}> | undefined, dtsBasenames: Record<string, string>, exportPaths: Record<string, string>): void;
|
|
1374
|
+
//#endregion
|
|
906
1375
|
//#region src/meta/tsconfig-resolver.d.ts
|
|
907
1376
|
/**
|
|
908
1377
|
* Compiler options with enum values converted to their string equivalents.
|
|
@@ -962,17 +1431,17 @@ declare class TsconfigResolver {
|
|
|
962
1431
|
private static readonly MODULE_DETECTION_MAP;
|
|
963
1432
|
/** @internal */
|
|
964
1433
|
private static readonly NEW_LINE_MAP;
|
|
965
|
-
/** Converts a
|
|
1434
|
+
/** Converts a `ScriptTarget` enum value to its string form (e.g. `es2023`). */
|
|
966
1435
|
static convertScriptTarget(target: ScriptTarget | undefined): string | undefined;
|
|
967
|
-
/** Converts a
|
|
1436
|
+
/** Converts a `ModuleKind` enum value to its string form (e.g. `nodenext`). */
|
|
968
1437
|
static convertModuleKind(module: ModuleKind | undefined): string | undefined;
|
|
969
|
-
/** Converts a
|
|
1438
|
+
/** Converts a `ModuleResolutionKind` enum value to its string form (e.g. `nodenext`). */
|
|
970
1439
|
static convertModuleResolution(resolution: ModuleResolutionKind | undefined): string | undefined;
|
|
971
|
-
/** Converts a
|
|
1440
|
+
/** Converts a `JsxEmit` enum value to its string form (e.g. `preserve`, `react-jsx`). */
|
|
972
1441
|
static convertJsxEmit(jsx: JsxEmit | undefined): string | undefined;
|
|
973
|
-
/** Converts a
|
|
1442
|
+
/** Converts a `ModuleDetectionKind` enum value to its string form (e.g. `force`). */
|
|
974
1443
|
static convertModuleDetection(detection: ModuleDetectionKind | undefined): string | undefined;
|
|
975
|
-
/** Converts a
|
|
1444
|
+
/** Converts a `NewLineKind` enum value to its string form (`lf` or `crlf`). */
|
|
976
1445
|
static convertNewLine(newLine: NewLineKind | undefined): string | undefined;
|
|
977
1446
|
/**
|
|
978
1447
|
* Converts a lib reference to its canonical short name.
|
|
@@ -1012,615 +1481,232 @@ declare class TsconfigResolver {
|
|
|
1012
1481
|
*/
|
|
1013
1482
|
declare function resolvePortableTsconfig(cwd: string, fallbackConfigPath?: string): PortableTsconfig;
|
|
1014
1483
|
//#endregion
|
|
1015
|
-
//#region src/report/schema.d.ts
|
|
1016
|
-
declare const ReportTimings: Schema.Struct<{
|
|
1017
|
-
totalMs: typeof Schema.Number;
|
|
1018
|
-
}>;
|
|
1019
|
-
declare const TargetGroupReport: Schema.Struct<{
|
|
1020
|
-
id: typeof Schema.String;
|
|
1021
|
-
entries: Schema.Array$<typeof Schema.String>;
|
|
1022
|
-
emittedFiles: Schema.Array$<typeof Schema.String>;
|
|
1023
|
-
timings: Schema.Struct<{
|
|
1024
|
-
totalMs: typeof Schema.Number;
|
|
1025
|
-
}>;
|
|
1026
|
-
warnings: Schema.Array$<typeof Schema.String>;
|
|
1027
|
-
errors: Schema.Array$<typeof Schema.String>;
|
|
1028
|
-
}>;
|
|
1029
|
-
declare const BuildReport: Schema.Struct<{
|
|
1030
|
-
package: typeof Schema.String;
|
|
1031
|
-
targetGroups: Schema.Array$<Schema.Struct<{
|
|
1032
|
-
id: typeof Schema.String;
|
|
1033
|
-
entries: Schema.Array$<typeof Schema.String>;
|
|
1034
|
-
emittedFiles: Schema.Array$<typeof Schema.String>;
|
|
1035
|
-
timings: Schema.Struct<{
|
|
1036
|
-
totalMs: typeof Schema.Number;
|
|
1037
|
-
}>;
|
|
1038
|
-
warnings: Schema.Array$<typeof Schema.String>;
|
|
1039
|
-
errors: Schema.Array$<typeof Schema.String>;
|
|
1040
|
-
}>>;
|
|
1041
|
-
}>;
|
|
1042
|
-
type BuildReport = typeof BuildReport.Type;
|
|
1043
|
-
type TargetGroupReport = typeof TargetGroupReport.Type;
|
|
1044
|
-
//#endregion
|
|
1045
1484
|
//#region src/report/formatters/types.d.ts
|
|
1485
|
+
/** @public */
|
|
1046
1486
|
interface RenderedOutput {
|
|
1047
1487
|
readonly target: "stdout" | "file" | "github-summary";
|
|
1048
1488
|
readonly content: string;
|
|
1049
1489
|
readonly contentType: string;
|
|
1050
1490
|
}
|
|
1491
|
+
/** @public */
|
|
1051
1492
|
interface FormatterContext {
|
|
1052
1493
|
readonly noColor: boolean;
|
|
1494
|
+
readonly verbose: boolean;
|
|
1053
1495
|
}
|
|
1496
|
+
/** @public */
|
|
1054
1497
|
interface Formatter {
|
|
1055
1498
|
readonly format: string;
|
|
1056
1499
|
readonly render: (reports: ReadonlyArray<BuildReport>, ctx: FormatterContext) => ReadonlyArray<RenderedOutput>;
|
|
1057
1500
|
}
|
|
1058
1501
|
//#endregion
|
|
1059
1502
|
//#region src/report/formatters/ci-annotations.d.ts
|
|
1503
|
+
/** @public */
|
|
1060
1504
|
declare const CiAnnotationsFormatter: Formatter;
|
|
1061
1505
|
//#endregion
|
|
1062
1506
|
//#region src/report/formatters/json.d.ts
|
|
1507
|
+
/** @public */
|
|
1063
1508
|
declare const JsonFormatter: Formatter;
|
|
1064
1509
|
//#endregion
|
|
1065
1510
|
//#region src/report/formatters/markdown.d.ts
|
|
1511
|
+
/** @public */
|
|
1066
1512
|
declare const MarkdownFormatter: Formatter;
|
|
1067
1513
|
//#endregion
|
|
1068
1514
|
//#region src/report/formatters/silent.d.ts
|
|
1515
|
+
/** @public */
|
|
1069
1516
|
declare const SilentFormatter: Formatter;
|
|
1070
1517
|
//#endregion
|
|
1071
1518
|
//#region src/report/formatters/terminal.d.ts
|
|
1519
|
+
/** @public */
|
|
1072
1520
|
declare const TerminalFormatter: Formatter;
|
|
1073
1521
|
//#endregion
|
|
1522
|
+
//#region src/report/issues-artifact.d.ts
|
|
1523
|
+
/**
|
|
1524
|
+
* A diagnostic flattened to a plain JSON object (only defined fields are present).
|
|
1525
|
+
*
|
|
1526
|
+
* @public
|
|
1527
|
+
*/
|
|
1528
|
+
interface PlainDiagnostic {
|
|
1529
|
+
source: DiagnosticEntry["source"];
|
|
1530
|
+
level: DiagnosticEntry["level"];
|
|
1531
|
+
text: string;
|
|
1532
|
+
code?: string;
|
|
1533
|
+
ciFatal?: boolean;
|
|
1534
|
+
file?: string;
|
|
1535
|
+
line?: number;
|
|
1536
|
+
column?: number;
|
|
1537
|
+
}
|
|
1538
|
+
/**
|
|
1539
|
+
* The aggregated build-issues artifact written to `dist/<target>/issues.json`.
|
|
1540
|
+
*
|
|
1541
|
+
* @public
|
|
1542
|
+
*/
|
|
1543
|
+
interface BuildIssues {
|
|
1544
|
+
generatedAt: string;
|
|
1545
|
+
package: string;
|
|
1546
|
+
target: "dev" | "prod";
|
|
1547
|
+
warnings: PlainDiagnostic[];
|
|
1548
|
+
errors: PlainDiagnostic[];
|
|
1549
|
+
suppressed: PlainDiagnostic[];
|
|
1550
|
+
}
|
|
1551
|
+
/**
|
|
1552
|
+
* Flatten a build snapshot into the aggregated, de-duplicated issues artifact. Pure.
|
|
1553
|
+
*
|
|
1554
|
+
* @public
|
|
1555
|
+
*/
|
|
1556
|
+
declare function flattenIssues(reports: ReadonlyArray<BuildReport>, opts: {
|
|
1557
|
+
target: "dev" | "prod";
|
|
1558
|
+
generatedAt: string;
|
|
1559
|
+
}): BuildIssues;
|
|
1560
|
+
/**
|
|
1561
|
+
* Serialize the issues artifact to pretty JSON with a trailing newline.
|
|
1562
|
+
*
|
|
1563
|
+
* @public
|
|
1564
|
+
*/
|
|
1565
|
+
declare function serializeIssues(issues: BuildIssues): string;
|
|
1566
|
+
/**
|
|
1567
|
+
* Write the aggregated issues artifact to `<cwd>/dist/<target>/issues.json`. Returns the path written.
|
|
1568
|
+
*
|
|
1569
|
+
* @public
|
|
1570
|
+
*/
|
|
1571
|
+
declare function writeIssuesArtifact(opts: {
|
|
1572
|
+
cwd: string;
|
|
1573
|
+
target: "dev" | "prod";
|
|
1574
|
+
reports: ReadonlyArray<BuildReport>;
|
|
1575
|
+
now?: () => Date;
|
|
1576
|
+
}): string;
|
|
1577
|
+
//#endregion
|
|
1074
1578
|
//#region src/report/services/EnvironmentDetector.d.ts
|
|
1579
|
+
/** @public */
|
|
1075
1580
|
type Environment = "agent-shell" | "terminal" | "ci-github" | "ci-generic";
|
|
1076
1581
|
declare const EnvironmentDetector_base: Context.TagClass<EnvironmentDetector, "@savvy-web/tsdown-plugins/EnvironmentDetector", {
|
|
1077
1582
|
readonly detect: () => Effect.Effect<Environment>;
|
|
1078
1583
|
}>;
|
|
1584
|
+
/** @public */
|
|
1079
1585
|
declare class EnvironmentDetector extends EnvironmentDetector_base {}
|
|
1080
1586
|
//#endregion
|
|
1081
1587
|
//#region src/report/layers/EnvironmentDetectorLive.d.ts
|
|
1588
|
+
/** @public */
|
|
1082
1589
|
declare const EnvironmentDetectorLive: Layer.Layer<EnvironmentDetector, never, never>;
|
|
1083
1590
|
//#endregion
|
|
1084
1591
|
//#region src/report/services/ExecutorResolver.d.ts
|
|
1592
|
+
/** @public */
|
|
1085
1593
|
type Executor = "human" | "agent" | "ci";
|
|
1086
1594
|
declare const ExecutorResolver_base: Context.TagClass<ExecutorResolver, "@savvy-web/tsdown-plugins/ExecutorResolver", {
|
|
1087
1595
|
readonly resolve: (env: Environment) => Effect.Effect<Executor>;
|
|
1088
1596
|
}>;
|
|
1597
|
+
/** @public */
|
|
1089
1598
|
declare class ExecutorResolver extends ExecutorResolver_base {}
|
|
1090
1599
|
//#endregion
|
|
1091
1600
|
//#region src/report/layers/ExecutorResolverLive.d.ts
|
|
1601
|
+
/** @public */
|
|
1092
1602
|
declare const ExecutorResolverLive: Layer.Layer<ExecutorResolver, never, never>;
|
|
1093
1603
|
//#endregion
|
|
1094
1604
|
//#region src/report/services/FormatSelector.d.ts
|
|
1605
|
+
/** @public */
|
|
1095
1606
|
type OutputFormat = "terminal" | "json" | "markdown" | "ci-annotations" | "silent";
|
|
1096
1607
|
declare const FormatSelector_base: Context.TagClass<FormatSelector, "@savvy-web/tsdown-plugins/FormatSelector", {
|
|
1097
1608
|
readonly select: (executor: Executor, explicit?: OutputFormat, env?: Environment) => Effect.Effect<OutputFormat>;
|
|
1098
1609
|
}>;
|
|
1610
|
+
/** @public */
|
|
1099
1611
|
declare class FormatSelector extends FormatSelector_base {}
|
|
1100
1612
|
//#endregion
|
|
1101
1613
|
//#region src/report/layers/FormatSelectorLive.d.ts
|
|
1614
|
+
/** @public */
|
|
1102
1615
|
declare const FormatSelectorLive: Layer.Layer<FormatSelector, never, never>;
|
|
1103
1616
|
//#endregion
|
|
1104
1617
|
//#region src/report/services/OutputRenderer.d.ts
|
|
1105
1618
|
declare const OutputRenderer_base: Context.TagClass<OutputRenderer, "@savvy-web/tsdown-plugins/OutputRenderer", {
|
|
1106
1619
|
readonly render: (reports: ReadonlyArray<BuildReport>, format: OutputFormat, ctx: FormatterContext) => Effect.Effect<ReadonlyArray<RenderedOutput>>;
|
|
1107
1620
|
}>;
|
|
1621
|
+
/** @public */
|
|
1108
1622
|
declare class OutputRenderer extends OutputRenderer_base {}
|
|
1109
1623
|
//#endregion
|
|
1110
1624
|
//#region src/report/layers/OutputRendererLive.d.ts
|
|
1625
|
+
/** @public */
|
|
1111
1626
|
declare const OutputRendererLive: Layer.Layer<OutputRenderer, never, never>;
|
|
1112
1627
|
//#endregion
|
|
1628
|
+
//#region src/report/metrics-plugin.d.ts
|
|
1629
|
+
/**
|
|
1630
|
+
* Rolldown plugin that records emitted-file metrics into the BuildCollector via writeBundle (which
|
|
1631
|
+
* fires for the JS pass AND the emitDtsOnly dts pass — verified against tsdown 0.22.3), plus a
|
|
1632
|
+
* defensive onLog for rolldown-level diagnostics that bypass tsdown's logger. Append it to each
|
|
1633
|
+
* build pass's `plugins` array. `bytes` is taken from the in-memory chunk/asset content (no fs);
|
|
1634
|
+
* `gzip` is computed only when `verbose`.
|
|
1635
|
+
* @public
|
|
1636
|
+
*/
|
|
1637
|
+
declare function buildMetricsPlugin(collector: BuildCollector, groupId: string, pass: PassKind, verbose: boolean): Plugin;
|
|
1638
|
+
//#endregion
|
|
1113
1639
|
//#region src/report/pipeline.d.ts
|
|
1640
|
+
/** @public */
|
|
1114
1641
|
declare const ReportPipelineLive: Layer.Layer<EnvironmentDetector | ExecutorResolver | FormatSelector | OutputRenderer, never, never>;
|
|
1642
|
+
/** @public */
|
|
1115
1643
|
interface RenderReportOptions {
|
|
1116
1644
|
readonly explicitFormat?: OutputFormat;
|
|
1117
1645
|
/** Override env detection (mainly for tests). */
|
|
1118
1646
|
readonly env?: Environment;
|
|
1119
1647
|
readonly noColor: boolean;
|
|
1648
|
+
readonly verbose?: boolean;
|
|
1120
1649
|
}
|
|
1650
|
+
/** @public */
|
|
1121
1651
|
declare const renderReport: (reports: ReadonlyArray<BuildReport>, options: RenderReportOptions) => Effect.Effect<ReadonlyArray<RenderedOutput>, never, EnvironmentDetector | ExecutorResolver | FormatSelector | OutputRenderer>;
|
|
1122
1652
|
//#endregion
|
|
1123
|
-
//#region
|
|
1124
|
-
/**
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
* @since 1.0.0
|
|
1131
|
-
* @category type id
|
|
1132
|
-
*/
|
|
1133
|
-
type TypeId = typeof TypeId;
|
|
1134
|
-
declare const BadArgument_base: Schema$1.TaggedErrorClass<BadArgument, "BadArgument", {
|
|
1135
|
-
readonly _tag: Schema$1.tag<"BadArgument">;
|
|
1136
|
-
} & {
|
|
1137
|
-
module: Schema$1.Literal<["Clipboard", "Command", "FileSystem", "KeyValueStore", "Path", "Stream", "Terminal"]>;
|
|
1138
|
-
method: typeof Schema$1.String;
|
|
1139
|
-
description: Schema$1.optional<typeof Schema$1.String>;
|
|
1140
|
-
cause: Schema$1.optional<typeof Schema$1.Defect>;
|
|
1141
|
-
}>;
|
|
1142
|
-
/**
|
|
1143
|
-
* @since 1.0.0
|
|
1144
|
-
* @category Models
|
|
1145
|
-
*/
|
|
1146
|
-
declare class BadArgument extends BadArgument_base {
|
|
1147
|
-
/**
|
|
1148
|
-
* @since 1.0.0
|
|
1149
|
-
*/
|
|
1150
|
-
readonly [TypeId]: typeof TypeId;
|
|
1151
|
-
/**
|
|
1152
|
-
* @since 1.0.0
|
|
1153
|
-
*/
|
|
1154
|
-
get message(): string;
|
|
1155
|
-
}
|
|
1156
|
-
declare const SystemError_base: Schema$1.TaggedErrorClass<SystemError, "SystemError", {
|
|
1157
|
-
readonly _tag: Schema$1.tag<"SystemError">;
|
|
1158
|
-
} & {
|
|
1159
|
-
reason: Schema$1.Literal<["AlreadyExists", "BadResource", "Busy", "InvalidData", "NotFound", "PermissionDenied", "TimedOut", "UnexpectedEof", "Unknown", "WouldBlock", "WriteZero"]>;
|
|
1160
|
-
module: Schema$1.Literal<["Clipboard", "Command", "FileSystem", "KeyValueStore", "Path", "Stream", "Terminal"]>;
|
|
1161
|
-
method: typeof Schema$1.String;
|
|
1162
|
-
description: Schema$1.optional<typeof Schema$1.String>;
|
|
1163
|
-
syscall: Schema$1.optional<typeof Schema$1.String>;
|
|
1164
|
-
pathOrDescriptor: Schema$1.optional<Schema$1.Union<[typeof Schema$1.String, typeof Schema$1.Number]>>;
|
|
1165
|
-
cause: Schema$1.optional<typeof Schema$1.Defect>;
|
|
1166
|
-
}>;
|
|
1167
|
-
/**
|
|
1168
|
-
* @since 1.0.0
|
|
1169
|
-
* @category models
|
|
1170
|
-
*/
|
|
1171
|
-
declare class SystemError extends SystemError_base {
|
|
1172
|
-
/**
|
|
1173
|
-
* @since 1.0.0
|
|
1174
|
-
*/
|
|
1175
|
-
readonly [TypeId]: typeof TypeId;
|
|
1176
|
-
/**
|
|
1177
|
-
* @since 1.0.0
|
|
1178
|
-
*/
|
|
1179
|
-
get message(): string;
|
|
1180
|
-
}
|
|
1181
|
-
/**
|
|
1182
|
-
* @since 1.0.0
|
|
1183
|
-
* @category Models
|
|
1184
|
-
*/
|
|
1185
|
-
type PlatformError = BadArgument | SystemError;
|
|
1186
|
-
/**
|
|
1187
|
-
* @since 1.0.0
|
|
1188
|
-
* @category Models
|
|
1189
|
-
*/
|
|
1190
|
-
declare const PlatformError: Schema$1.Union<[typeof BadArgument, typeof SystemError]>;
|
|
1191
|
-
//#endregion
|
|
1192
|
-
//#region ../../node_modules/.pnpm/@effect+platform@0.96.1_effect@3.21.3/node_modules/@effect/platform/dist/dts/FileSystem.d.ts
|
|
1193
|
-
/**
|
|
1194
|
-
* @since 1.0.0
|
|
1195
|
-
* @category model
|
|
1196
|
-
*/
|
|
1197
|
-
interface FileSystem {
|
|
1198
|
-
/**
|
|
1199
|
-
* Check if a file can be accessed.
|
|
1200
|
-
* You can optionally specify the level of access to check for.
|
|
1201
|
-
*/
|
|
1202
|
-
readonly access: (path: string, options?: AccessFileOptions) => Effect$1.Effect<void, PlatformError>;
|
|
1203
|
-
/**
|
|
1204
|
-
* Copy a file or directory from `fromPath` to `toPath`.
|
|
1205
|
-
*
|
|
1206
|
-
* Equivalent to `cp -r`.
|
|
1207
|
-
*/
|
|
1208
|
-
readonly copy: (fromPath: string, toPath: string, options?: CopyOptions) => Effect$1.Effect<void, PlatformError>;
|
|
1209
|
-
/**
|
|
1210
|
-
* Copy a file from `fromPath` to `toPath`.
|
|
1211
|
-
*/
|
|
1212
|
-
readonly copyFile: (fromPath: string, toPath: string) => Effect$1.Effect<void, PlatformError>;
|
|
1213
|
-
/**
|
|
1214
|
-
* Change the permissions of a file.
|
|
1215
|
-
*/
|
|
1216
|
-
readonly chmod: (path: string, mode: number) => Effect$1.Effect<void, PlatformError>;
|
|
1217
|
-
/**
|
|
1218
|
-
* Change the owner and group of a file.
|
|
1219
|
-
*/
|
|
1220
|
-
readonly chown: (path: string, uid: number, gid: number) => Effect$1.Effect<void, PlatformError>;
|
|
1221
|
-
/**
|
|
1222
|
-
* Check if a path exists.
|
|
1223
|
-
*/
|
|
1224
|
-
readonly exists: (path: string) => Effect$1.Effect<boolean, PlatformError>;
|
|
1225
|
-
/**
|
|
1226
|
-
* Create a hard link from `fromPath` to `toPath`.
|
|
1227
|
-
*/
|
|
1228
|
-
readonly link: (fromPath: string, toPath: string) => Effect$1.Effect<void, PlatformError>;
|
|
1229
|
-
/**
|
|
1230
|
-
* Create a directory at `path`. You can optionally specify the mode and
|
|
1231
|
-
* whether to recursively create nested directories.
|
|
1232
|
-
*/
|
|
1233
|
-
readonly makeDirectory: (path: string, options?: MakeDirectoryOptions) => Effect$1.Effect<void, PlatformError>;
|
|
1234
|
-
/**
|
|
1235
|
-
* Create a temporary directory.
|
|
1236
|
-
*
|
|
1237
|
-
* By default the directory will be created inside the system's default
|
|
1238
|
-
* temporary directory, but you can specify a different location by setting
|
|
1239
|
-
* the `directory` option.
|
|
1240
|
-
*
|
|
1241
|
-
* You can also specify a prefix for the directory name by setting the
|
|
1242
|
-
* `prefix` option.
|
|
1243
|
-
*/
|
|
1244
|
-
readonly makeTempDirectory: (options?: MakeTempDirectoryOptions) => Effect$1.Effect<string, PlatformError>;
|
|
1245
|
-
/**
|
|
1246
|
-
* Create a temporary directory inside a scope.
|
|
1247
|
-
*
|
|
1248
|
-
* Functionally equivalent to `makeTempDirectory`, but the directory will be
|
|
1249
|
-
* automatically deleted when the scope is closed.
|
|
1250
|
-
*/
|
|
1251
|
-
readonly makeTempDirectoryScoped: (options?: MakeTempDirectoryOptions) => Effect$1.Effect<string, PlatformError, Scope>;
|
|
1252
|
-
/**
|
|
1253
|
-
* Create a temporary file.
|
|
1254
|
-
* The directory creation is functionally equivalent to `makeTempDirectory`.
|
|
1255
|
-
* The file name will be a randomly generated string.
|
|
1256
|
-
*/
|
|
1257
|
-
readonly makeTempFile: (options?: MakeTempFileOptions) => Effect$1.Effect<string, PlatformError>;
|
|
1258
|
-
/**
|
|
1259
|
-
* Create a temporary file inside a scope.
|
|
1260
|
-
*
|
|
1261
|
-
* Functionally equivalent to `makeTempFile`, but the file will be
|
|
1262
|
-
* automatically deleted when the scope is closed.
|
|
1263
|
-
*/
|
|
1264
|
-
readonly makeTempFileScoped: (options?: MakeTempFileOptions) => Effect$1.Effect<string, PlatformError, Scope>;
|
|
1265
|
-
/**
|
|
1266
|
-
* Open a file at `path` with the specified `options`.
|
|
1267
|
-
*
|
|
1268
|
-
* The file handle will be automatically closed when the scope is closed.
|
|
1269
|
-
*/
|
|
1270
|
-
readonly open: (path: string, options?: OpenFileOptions) => Effect$1.Effect<File$1, PlatformError, Scope>;
|
|
1271
|
-
/**
|
|
1272
|
-
* List the contents of a directory.
|
|
1273
|
-
*
|
|
1274
|
-
* You can recursively list the contents of nested directories by setting the
|
|
1275
|
-
* `recursive` option.
|
|
1276
|
-
*/
|
|
1277
|
-
readonly readDirectory: (path: string, options?: ReadDirectoryOptions) => Effect$1.Effect<Array<string>, PlatformError>;
|
|
1278
|
-
/**
|
|
1279
|
-
* Read the contents of a file.
|
|
1280
|
-
*/
|
|
1281
|
-
readonly readFile: (path: string) => Effect$1.Effect<Uint8Array, PlatformError>;
|
|
1282
|
-
/**
|
|
1283
|
-
* Read the contents of a file.
|
|
1284
|
-
*/
|
|
1285
|
-
readonly readFileString: (path: string, encoding?: string) => Effect$1.Effect<string, PlatformError>;
|
|
1286
|
-
/**
|
|
1287
|
-
* Read the destination of a symbolic link.
|
|
1288
|
-
*/
|
|
1289
|
-
readonly readLink: (path: string) => Effect$1.Effect<string, PlatformError>;
|
|
1290
|
-
/**
|
|
1291
|
-
* Resolve a path to its canonicalized absolute pathname.
|
|
1292
|
-
*/
|
|
1293
|
-
readonly realPath: (path: string) => Effect$1.Effect<string, PlatformError>;
|
|
1294
|
-
/**
|
|
1295
|
-
* Remove a file or directory.
|
|
1296
|
-
*/
|
|
1297
|
-
readonly remove: (path: string, options?: RemoveOptions) => Effect$1.Effect<void, PlatformError>;
|
|
1298
|
-
/**
|
|
1299
|
-
* Rename a file or directory.
|
|
1300
|
-
*/
|
|
1301
|
-
readonly rename: (oldPath: string, newPath: string) => Effect$1.Effect<void, PlatformError>;
|
|
1302
|
-
/**
|
|
1303
|
-
* Create a writable `Sink` for the specified `path`.
|
|
1304
|
-
*/
|
|
1305
|
-
readonly sink: (path: string, options?: SinkOptions) => Sink<void, Uint8Array, never, PlatformError>;
|
|
1306
|
-
/**
|
|
1307
|
-
* Get information about a file at `path`.
|
|
1308
|
-
*/
|
|
1309
|
-
readonly stat: (path: string) => Effect$1.Effect<File$1.Info, PlatformError>;
|
|
1310
|
-
/**
|
|
1311
|
-
* Create a readable `Stream` for the specified `path`.
|
|
1312
|
-
*
|
|
1313
|
-
* Changing the `bufferSize` option will change the internal buffer size of
|
|
1314
|
-
* the stream. It defaults to `4`.
|
|
1315
|
-
*
|
|
1316
|
-
* The `chunkSize` option will change the size of the chunks emitted by the
|
|
1317
|
-
* stream. It defaults to 64kb.
|
|
1318
|
-
*
|
|
1319
|
-
* Changing `offset` and `bytesToRead` will change the offset and the number
|
|
1320
|
-
* of bytes to read from the file.
|
|
1321
|
-
*/
|
|
1322
|
-
readonly stream: (path: string, options?: StreamOptions) => Stream<Uint8Array, PlatformError>;
|
|
1323
|
-
/**
|
|
1324
|
-
* Create a symbolic link from `fromPath` to `toPath`.
|
|
1325
|
-
*/
|
|
1326
|
-
readonly symlink: (fromPath: string, toPath: string) => Effect$1.Effect<void, PlatformError>;
|
|
1327
|
-
/**
|
|
1328
|
-
* Truncate a file to a specified length. If the `length` is not specified,
|
|
1329
|
-
* the file will be truncated to length `0`.
|
|
1330
|
-
*/
|
|
1331
|
-
readonly truncate: (path: string, length?: SizeInput) => Effect$1.Effect<void, PlatformError>;
|
|
1332
|
-
/**
|
|
1333
|
-
* Change the file system timestamps of the file at `path`.
|
|
1334
|
-
*/
|
|
1335
|
-
readonly utimes: (path: string, atime: Date | number, mtime: Date | number) => Effect$1.Effect<void, PlatformError>;
|
|
1336
|
-
/**
|
|
1337
|
-
* Watch a directory or file for changes.
|
|
1338
|
-
*
|
|
1339
|
-
* By default, only changes to the direct children of the directory are reported.
|
|
1340
|
-
* Set the `recursive` option to `true` to watch for changes in subdirectories as well.
|
|
1341
|
-
*
|
|
1342
|
-
* Note: The `recursive` option behavior depends on the backend implementation:
|
|
1343
|
-
* - When using the default Node.js `fs.watch()` backend: The `recursive`
|
|
1344
|
-
* option is supported on all platforms (Node.js v20+).
|
|
1345
|
-
* - When using `@parcel/watcher` (via `NodeFileSystem/ParcelWatcher` layer):
|
|
1346
|
-
* Watching is always recursive on all platforms. This option is ignored.
|
|
1347
|
-
*/
|
|
1348
|
-
readonly watch: (path: string, options?: WatchOptions) => Stream<WatchEvent, PlatformError>;
|
|
1349
|
-
/**
|
|
1350
|
-
* Write data to a file at `path`.
|
|
1351
|
-
*/
|
|
1352
|
-
readonly writeFile: (path: string, data: Uint8Array, options?: WriteFileOptions) => Effect$1.Effect<void, PlatformError>;
|
|
1353
|
-
/**
|
|
1354
|
-
* Write a string to a file at `path`.
|
|
1355
|
-
*/
|
|
1356
|
-
readonly writeFileString: (path: string, data: string, options?: WriteFileStringOptions) => Effect$1.Effect<void, PlatformError>;
|
|
1653
|
+
//#region src/report/timer.d.ts
|
|
1654
|
+
/** @public */
|
|
1655
|
+
declare function formatTime(ms: number): string;
|
|
1656
|
+
/** @public */
|
|
1657
|
+
interface Timer {
|
|
1658
|
+
readonly elapsed: () => number;
|
|
1659
|
+
readonly format: () => string;
|
|
1357
1660
|
}
|
|
1358
1661
|
/**
|
|
1359
|
-
*
|
|
1662
|
+
* Create a wall-clock timer. (Date.now is fine in runtime build code.)
|
|
1360
1663
|
*
|
|
1361
|
-
* @
|
|
1362
|
-
* @category sizes
|
|
1664
|
+
* @public
|
|
1363
1665
|
*/
|
|
1364
|
-
|
|
1666
|
+
declare function createTimer(now?: () => number): Timer;
|
|
1667
|
+
//#endregion
|
|
1668
|
+
//#region src/report/tsdown-logger.d.ts
|
|
1365
1669
|
/**
|
|
1366
|
-
*
|
|
1670
|
+
* Structural match for tsdown's Logger interface (tsdown 0.22.x).
|
|
1367
1671
|
*
|
|
1368
|
-
* @
|
|
1369
|
-
* @category sizes
|
|
1370
|
-
*/
|
|
1371
|
-
type SizeInput = bigint | number | Size;
|
|
1372
|
-
/**
|
|
1373
|
-
* @since 1.0.0
|
|
1374
|
-
* @category sizes
|
|
1375
|
-
*/
|
|
1376
|
-
declare const Size: (bytes: SizeInput) => Size;
|
|
1377
|
-
/**
|
|
1378
|
-
* @since 1.0.0
|
|
1379
|
-
* @category model
|
|
1380
|
-
*/
|
|
1381
|
-
type OpenFlag = "r" | "r+" | "w" | "wx" | "w+" | "wx+" | "a" | "ax" | "a+" | "ax+";
|
|
1382
|
-
/**
|
|
1383
|
-
* @since 1.0.0
|
|
1384
|
-
* @category options
|
|
1385
|
-
*/
|
|
1386
|
-
interface AccessFileOptions {
|
|
1387
|
-
readonly ok?: boolean;
|
|
1388
|
-
readonly readable?: boolean;
|
|
1389
|
-
readonly writable?: boolean;
|
|
1390
|
-
}
|
|
1391
|
-
/**
|
|
1392
|
-
* @since 1.0.0
|
|
1393
|
-
* @category options
|
|
1394
|
-
*/
|
|
1395
|
-
interface MakeDirectoryOptions {
|
|
1396
|
-
readonly recursive?: boolean;
|
|
1397
|
-
readonly mode?: number;
|
|
1398
|
-
}
|
|
1399
|
-
/**
|
|
1400
|
-
* @since 1.0.0
|
|
1401
|
-
* @category options
|
|
1402
|
-
*/
|
|
1403
|
-
interface CopyOptions {
|
|
1404
|
-
readonly overwrite?: boolean;
|
|
1405
|
-
readonly preserveTimestamps?: boolean;
|
|
1406
|
-
}
|
|
1407
|
-
/**
|
|
1408
|
-
* @since 1.0.0
|
|
1409
|
-
* @category options
|
|
1410
|
-
*/
|
|
1411
|
-
interface MakeTempDirectoryOptions {
|
|
1412
|
-
readonly directory?: string;
|
|
1413
|
-
readonly prefix?: string;
|
|
1414
|
-
}
|
|
1415
|
-
/**
|
|
1416
|
-
* @since 1.0.0
|
|
1417
|
-
* @category options
|
|
1418
|
-
*/
|
|
1419
|
-
interface MakeTempFileOptions {
|
|
1420
|
-
readonly directory?: string;
|
|
1421
|
-
readonly prefix?: string;
|
|
1422
|
-
readonly suffix?: string;
|
|
1423
|
-
}
|
|
1424
|
-
/**
|
|
1425
|
-
* @since 1.0.0
|
|
1426
|
-
* @category options
|
|
1427
|
-
*/
|
|
1428
|
-
interface OpenFileOptions {
|
|
1429
|
-
readonly flag?: OpenFlag;
|
|
1430
|
-
readonly mode?: number;
|
|
1431
|
-
}
|
|
1432
|
-
/**
|
|
1433
|
-
* @since 1.0.0
|
|
1434
|
-
* @category options
|
|
1435
|
-
*/
|
|
1436
|
-
interface ReadDirectoryOptions {
|
|
1437
|
-
readonly recursive?: boolean;
|
|
1438
|
-
}
|
|
1439
|
-
/**
|
|
1440
|
-
* @since 1.0.0
|
|
1441
|
-
* @category options
|
|
1442
|
-
*/
|
|
1443
|
-
interface RemoveOptions {
|
|
1444
|
-
/**
|
|
1445
|
-
* When `true`, you can recursively remove nested directories.
|
|
1446
|
-
*/
|
|
1447
|
-
readonly recursive?: boolean;
|
|
1448
|
-
/**
|
|
1449
|
-
* When `true`, exceptions will be ignored if `path` does not exist.
|
|
1450
|
-
*/
|
|
1451
|
-
readonly force?: boolean;
|
|
1452
|
-
}
|
|
1453
|
-
/**
|
|
1454
|
-
* @since 1.0.0
|
|
1455
|
-
* @category options
|
|
1456
|
-
*/
|
|
1457
|
-
interface SinkOptions extends OpenFileOptions {}
|
|
1458
|
-
/**
|
|
1459
|
-
* @since 1.0.0
|
|
1460
|
-
* @category options
|
|
1461
|
-
*/
|
|
1462
|
-
interface StreamOptions {
|
|
1463
|
-
readonly bufferSize?: number;
|
|
1464
|
-
readonly bytesToRead?: SizeInput;
|
|
1465
|
-
readonly chunkSize?: SizeInput;
|
|
1466
|
-
readonly offset?: SizeInput;
|
|
1467
|
-
}
|
|
1468
|
-
/**
|
|
1469
|
-
* @since 1.0.0
|
|
1470
|
-
* @category options
|
|
1471
|
-
*/
|
|
1472
|
-
interface WriteFileOptions {
|
|
1473
|
-
readonly flag?: OpenFlag;
|
|
1474
|
-
readonly mode?: number;
|
|
1475
|
-
}
|
|
1476
|
-
/**
|
|
1477
|
-
* @since 1.0.0
|
|
1478
|
-
* @category options
|
|
1479
|
-
*/
|
|
1480
|
-
interface WriteFileStringOptions {
|
|
1481
|
-
readonly flag?: OpenFlag;
|
|
1482
|
-
readonly mode?: number;
|
|
1483
|
-
}
|
|
1484
|
-
/**
|
|
1485
|
-
* @since 1.0.0
|
|
1486
|
-
* @category options
|
|
1487
|
-
*/
|
|
1488
|
-
interface WatchOptions {
|
|
1489
|
-
/**
|
|
1490
|
-
* When `true`, the watcher will also watch for changes in subdirectories.
|
|
1491
|
-
*/
|
|
1492
|
-
readonly recursive?: boolean;
|
|
1493
|
-
}
|
|
1494
|
-
/**
|
|
1495
|
-
* @since 1.0.0
|
|
1496
|
-
* @category tag
|
|
1497
|
-
*/
|
|
1498
|
-
declare const FileSystem: Tag<FileSystem, FileSystem>;
|
|
1499
|
-
/**
|
|
1500
|
-
* @since 1.0.0
|
|
1501
|
-
* @category type id
|
|
1502
|
-
*/
|
|
1503
|
-
declare const FileTypeId: unique symbol;
|
|
1504
|
-
/**
|
|
1505
|
-
* @since 1.0.0
|
|
1506
|
-
* @category type id
|
|
1507
|
-
*/
|
|
1508
|
-
type FileTypeId = typeof FileTypeId;
|
|
1509
|
-
/**
|
|
1510
|
-
* @since 1.0.0
|
|
1511
|
-
* @category model
|
|
1512
|
-
*/
|
|
1513
|
-
interface File$1 {
|
|
1514
|
-
readonly [FileTypeId]: FileTypeId;
|
|
1515
|
-
readonly fd: File$1.Descriptor;
|
|
1516
|
-
readonly stat: Effect$1.Effect<File$1.Info, PlatformError>;
|
|
1517
|
-
readonly seek: (offset: SizeInput, from: SeekMode) => Effect$1.Effect<void>;
|
|
1518
|
-
readonly sync: Effect$1.Effect<void, PlatformError>;
|
|
1519
|
-
readonly read: (buffer: Uint8Array) => Effect$1.Effect<Size, PlatformError>;
|
|
1520
|
-
readonly readAlloc: (size: SizeInput) => Effect$1.Effect<Option<Uint8Array>, PlatformError>;
|
|
1521
|
-
readonly truncate: (length?: SizeInput) => Effect$1.Effect<void, PlatformError>;
|
|
1522
|
-
readonly write: (buffer: Uint8Array) => Effect$1.Effect<Size, PlatformError>;
|
|
1523
|
-
readonly writeAll: (buffer: Uint8Array) => Effect$1.Effect<void, PlatformError>;
|
|
1524
|
-
}
|
|
1525
|
-
/**
|
|
1526
|
-
* @since 1.0.0
|
|
1672
|
+
* @public
|
|
1527
1673
|
*/
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
* @category model
|
|
1537
|
-
*/
|
|
1538
|
-
type Type = "File" | "Directory" | "SymbolicLink" | "BlockDevice" | "CharacterDevice" | "FIFO" | "Socket" | "Unknown";
|
|
1539
|
-
/**
|
|
1540
|
-
* @since 1.0.0
|
|
1541
|
-
* @category model
|
|
1542
|
-
*/
|
|
1543
|
-
interface Info {
|
|
1544
|
-
readonly type: Type;
|
|
1545
|
-
readonly mtime: Option<Date>;
|
|
1546
|
-
readonly atime: Option<Date>;
|
|
1547
|
-
readonly birthtime: Option<Date>;
|
|
1548
|
-
readonly dev: number;
|
|
1549
|
-
readonly ino: Option<number>;
|
|
1550
|
-
readonly mode: number;
|
|
1551
|
-
readonly nlink: Option<number>;
|
|
1552
|
-
readonly uid: Option<number>;
|
|
1553
|
-
readonly gid: Option<number>;
|
|
1554
|
-
readonly rdev: Option<number>;
|
|
1555
|
-
readonly size: Size;
|
|
1556
|
-
readonly blksize: Option<Size>;
|
|
1557
|
-
readonly blocks: Option<number>;
|
|
1558
|
-
}
|
|
1674
|
+
interface TsdownLogger {
|
|
1675
|
+
level: "info";
|
|
1676
|
+
info: (...args: unknown[]) => void;
|
|
1677
|
+
warn: (...args: unknown[]) => void;
|
|
1678
|
+
warnOnce: (...args: unknown[]) => void;
|
|
1679
|
+
error: (...args: unknown[]) => void;
|
|
1680
|
+
success: (...args: unknown[]) => void;
|
|
1681
|
+
clearScreen: () => void;
|
|
1559
1682
|
}
|
|
1560
1683
|
/**
|
|
1561
|
-
*
|
|
1562
|
-
*
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
* @since 1.0.0
|
|
1567
|
-
* @category model
|
|
1568
|
-
*/
|
|
1569
|
-
type WatchEvent = WatchEvent.Create | WatchEvent.Update | WatchEvent.Remove;
|
|
1570
|
-
/**
|
|
1571
|
-
* @since 1.0.0
|
|
1572
|
-
* @category model
|
|
1684
|
+
* A tsdown `customLogger` that routes warnings/errors into the BuildCollector instead of the
|
|
1685
|
+
* console. Paired with `logLevel: "silent"` in the same build config: silent suppresses tsdown's
|
|
1686
|
+
* own console output while this logger still receives every message (verified against tsdown 0.22.3).
|
|
1687
|
+
* info/success are dropped — file metrics come from the writeBundle plugin and timing from our timer.
|
|
1688
|
+
* @public
|
|
1573
1689
|
*/
|
|
1574
|
-
declare
|
|
1575
|
-
/**
|
|
1576
|
-
* @since 1.0.0
|
|
1577
|
-
* @category model
|
|
1578
|
-
*/
|
|
1579
|
-
interface Create {
|
|
1580
|
-
readonly _tag: "Create";
|
|
1581
|
-
readonly path: string;
|
|
1582
|
-
}
|
|
1583
|
-
/**
|
|
1584
|
-
* @since 1.0.0
|
|
1585
|
-
* @category model
|
|
1586
|
-
*/
|
|
1587
|
-
interface Update {
|
|
1588
|
-
readonly _tag: "Update";
|
|
1589
|
-
readonly path: string;
|
|
1590
|
-
}
|
|
1591
|
-
/**
|
|
1592
|
-
* @since 1.0.0
|
|
1593
|
-
* @category model
|
|
1594
|
-
*/
|
|
1595
|
-
interface Remove {
|
|
1596
|
-
readonly _tag: "Remove";
|
|
1597
|
-
readonly path: string;
|
|
1598
|
-
}
|
|
1599
|
-
}
|
|
1600
|
-
//#endregion
|
|
1601
|
-
//#region src/report/schema-export.d.ts
|
|
1602
|
-
/** Generate the SchemaStore-compatible JSON Schema document for BuildReport. */
|
|
1603
|
-
declare const generateBuildReportSchema: () => Effect.Effect<JsonSchemaOutput, JsonSchemaError, FileSystem>;
|
|
1604
|
-
//#endregion
|
|
1605
|
-
//#region src/report/timer.d.ts
|
|
1606
|
-
declare function formatTime(ms: number): string;
|
|
1607
|
-
interface Timer {
|
|
1608
|
-
readonly elapsed: () => number;
|
|
1609
|
-
readonly format: () => string;
|
|
1610
|
-
}
|
|
1611
|
-
/** Create a wall-clock timer. (Date.now is fine in runtime build code.) */
|
|
1612
|
-
declare function createTimer(now?: () => number): Timer;
|
|
1690
|
+
declare function createTsdownLogger(collector: BuildCollector, groupId: string): TsdownLogger;
|
|
1613
1691
|
//#endregion
|
|
1614
1692
|
//#region src/targets/binding.d.ts
|
|
1615
|
-
/**
|
|
1693
|
+
/**
|
|
1694
|
+
* Write the target-to-group binding to dist/prod/targets.json for the release action to consume. Returns the path.
|
|
1695
|
+
*
|
|
1696
|
+
* @public
|
|
1697
|
+
*/
|
|
1616
1698
|
declare function writeTargetsBinding(cwd: string, resolution: TargetResolution): string;
|
|
1617
1699
|
//#endregion
|
|
1618
1700
|
//#region src/targets/resolve-targets.d.ts
|
|
1619
|
-
/**
|
|
1701
|
+
/**
|
|
1702
|
+
* Resolve a `publishConfig.targets` map into the distinct groups to build and every target bound to one. Pure; throws ConfigValidationError on structurally-invalid config.
|
|
1703
|
+
*
|
|
1704
|
+
* @public
|
|
1705
|
+
*/
|
|
1620
1706
|
declare function resolveTargets(options: {
|
|
1621
1707
|
targets: PublishTargets;
|
|
1622
1708
|
baseName: string;
|
|
1623
1709
|
}): TargetResolution;
|
|
1624
1710
|
//#endregion
|
|
1625
|
-
export { type BuildEmittedManifestOptions, type BuildFormat, type BuildGroupSpec, type BuildPlatform, type BuildReport, BuildReport as BuildReportSchema, type BuildTargetGroupsOptions, CatalogAssemblyError, CatalogResolutionError, CiAnnotationsFormatter, ConfigValidationError, ConfigValidator, ConfigValidatorLive, type CssOptions, DEFAULT_EXE_NODE_VERSION, type DeriveOptions, type DerivedTsdownOptions, type DualExports, type EmitManifestOptions, type EntryOverride, type Environment, EnvironmentDetector, EnvironmentDetectorLive, type ExeBuild, type ExeConfig, type ExeRewrite, type ExeSeaConfig, type ExeTarget, type ExeTargetInput, type Executor, ExecutorResolver, ExecutorResolverLive, type ExtractOptions, type ExtractResult, FormatSelector, FormatSelectorLive, type Formatter, type FormatterContext, type GenerateMetaOptions, type Json, JsonFormatter, type JsxConfig, type LooseFileSpec, type LooseFiles, type ManifestLike, MarkdownFormatter, MetaGenerationError, type MetaOptions, type MetaResult, type NextVersions, type NormalizedExe, type NormalizedLooseFile, type NormalizedMeta, type OutputFormat, OutputRenderer, OutputRendererLive, type PackageJsonEntriesOptions, type PackageJsonLike, type PkgOsCpu, type PortableTsconfig, type PublishTargetObject, type PublishTargetValue, type PublishTargets, type RenderReportOptions, type RenderedOutput, ReportPipelineLive, ReportTimings, type ResolvedCompilerOptions, type ResolvedGroup, type ResolvedTarget, type ResolvedTsconfig, type ResolvedTsconfigOptions, type RunExeBuildOptions, SilentFormatter, type TargetGroupId, type TargetGroupRef, type TargetGroupReport, TargetGroupReport as TargetGroupReportSchema, type TargetResolution, TerminalFormatter, type Timer, type TransformManifestOptions, type TsconfigJsx, TsconfigResolver, type TsdocOptions, type TsdocTagDefinition, type TsdownBuild, type ValidationInput, type WarningSuppressionRule, buildEmittedManifest, buildResolvedTsconfig, buildTargetGroups, cjsDefaultInterop, computeExeFileName, createEntryName, createTimer, defaultManifestTransform, deriveTargetGroupOptions, emitManifest, extractEntries,
|
|
1711
|
+
export { BuildCollector, BuildCollectorTag, type BuildEmittedManifestOptions, type BuildFormat, type BuildGroupSpec, type BuildIssues, type BuildPlatform, type BuildReport, BuildReport as BuildReportSchema, type BuildTargetGroupsOptions, CatalogAssemblyError, CatalogResolutionError, CiAnnotationsFormatter, ConfigValidationError, ConfigValidator, ConfigValidatorLive, type CssOptions, DEFAULT_EXE_NODE_VERSION, type DeriveOptions, type DerivedTsdownOptions, type DiagnosticEntry, type DiagnosticInput, type DualExports, type EmitManifestOptions, type EmittedFile, type EntryOverride, type Environment, EnvironmentDetector, EnvironmentDetectorLive, type ExeBuild, type ExeConfig, type ExeRewrite, type ExeSeaConfig, type ExeTarget, type ExeTargetInput, type Executor, ExecutorResolver, ExecutorResolverLive, type ExtractOptions, type ExtractResult, FormatSelector, FormatSelectorLive, type Formatter, type FormatterContext, type GenerateMetaOptions, type Json, JsonFormatter, type JsxConfig, type LooseFileSpec, type LooseFiles, type ManifestLike, MarkdownFormatter, MetaGenerationError, type MetaOptions, type MetaResult, type NextVersions, type NormalizedExe, type NormalizedLooseFile, type NormalizedMeta, type OutputFormat, OutputRenderer, OutputRendererLive, type PackageJsonEntriesOptions, type PackageJsonLike, type PassKind, type PassReport, type PkgOsCpu, type PlainDiagnostic, type PortableTsconfig, type PublishTargetObject, type PublishTargetValue, type PublishTargets, type RenderReportOptions, type RenderedOutput, ReportPipelineLive, ReportTimings, type ResolvedCompilerOptions, type ResolvedGroup, type ResolvedTarget, type ResolvedTsconfig, type ResolvedTsconfigOptions, type RunExeBuildOptions, type RunMetaPassOptions, SilentFormatter, type TargetGroupId, type TargetGroupRef, type TargetGroupReport, TargetGroupReport as TargetGroupReportSchema, type TargetResolution, TerminalFormatter, type Timer, type TransformManifestOptions, type TsconfigJsx, TsconfigResolver, type TsdocOptions, type TsdocTagDefinition, type TsdownBuild, type TsdownLogger, type ValidationInput, type WarningSuppressionRule, applySubdirMetaEntries, buildEmittedManifest, buildMetricsPlugin, buildResolvedTsconfig, buildTargetGroups, cjsDefaultInterop, computeExeFileName, createEntryName, createTimer, createTsdownLogger, defaultManifestTransform, deriveExportPaths, deriveTargetGroupOptions, emitManifest, extractEntries, flattenIssues, formatTime, generateMeta, isTargetObject, nodeBuiltinDefaultInterop, normalizeBinPaths, normalizeExeOptions, normalizeLooseFiles, normalizeMetaOptions, packageJsonEntries, readTsconfigJsx, removeDeclarationMaps, renderReport, resolveJsxConfig, resolveManifest, resolveNextVersions, resolvePortableTsconfig, resolveTargets, rewriteMetaVersions, runExeBuild, runMetaPass, serializeIssues, syncPublicDir, transformBin, transformExports, transformManifest, writeIssuesArtifact, writeResolvedTsconfig, writeTargetsBinding };
|
|
1626
1712
|
//# sourceMappingURL=index.d.ts.map
|