@savvy-web/tsdown-plugins 0.8.0 → 0.9.1

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