@effected/bundler 0.0.0-stage → 0.1.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.
Files changed (81) hide show
  1. package/Bundler.js +450 -0
  2. package/BundlerError.js +39 -0
  3. package/LICENSE +21 -0
  4. package/README.md +84 -2
  5. package/action/ActionBuilder.js +108 -0
  6. package/action/ActionBundle.js +261 -0
  7. package/action/ActionErrors.js +83 -0
  8. package/action/ActionValidation.js +195 -0
  9. package/action/ActionYml.js +366 -0
  10. package/action/PersistLocal.js +186 -0
  11. package/action/entries.js +23 -0
  12. package/action/ignore-stub-plugin.js +25 -0
  13. package/action/import-check.js +134 -0
  14. package/assets/Inter-SemiBold.ttf +0 -0
  15. package/assets/LICENSE-Inter.txt +92 -0
  16. package/catalog/resolve-catalogs.js +32 -0
  17. package/changesets/next-versions.js +50 -0
  18. package/config/ActionConfig.js +102 -0
  19. package/config/BuildConfig.js +427 -0
  20. package/config/EffectedConfigFile.js +160 -0
  21. package/config/merge.js +20 -0
  22. package/config/plugins.js +84 -0
  23. package/config-validation/ConfigValidator.js +67 -0
  24. package/dts/bundled-siblings.js +108 -0
  25. package/dts/parse.js +28 -0
  26. package/dts/reexport-stub.js +94 -0
  27. package/dts/relative-imports.js +33 -0
  28. package/dts/resolved-tsconfig.js +238 -0
  29. package/entries/ambient-dts.js +108 -0
  30. package/entries/export-paths.js +16 -0
  31. package/entries/extract.js +79 -0
  32. package/entries/package-json-entries.js +19 -0
  33. package/errors.js +37 -0
  34. package/exe/build.js +55 -0
  35. package/exe/config.js +54 -0
  36. package/exe/filename.js +13 -0
  37. package/index.d.ts +3919 -0
  38. package/index.js +58 -0
  39. package/internal/causeMessage.js +57 -0
  40. package/journal/BuildJournal.js +108 -0
  41. package/jsx/config.js +51 -0
  42. package/manifest/emit-manifest.js +88 -0
  43. package/manifest/export-patterns.js +58 -0
  44. package/manifest/transform.js +323 -0
  45. package/meta/BundleManifest.js +208 -0
  46. package/meta/ManifestSource.js +37 -0
  47. package/meta/api-extractor.js +241 -0
  48. package/meta/config.js +24 -0
  49. package/meta/generate.js +246 -0
  50. package/meta/merge-models.js +43 -0
  51. package/meta/message-suppressor.js +43 -0
  52. package/meta/og-image.js +137 -0
  53. package/meta/og-satori.js +140 -0
  54. package/meta/optimistic.js +32 -0
  55. package/meta/run-pass.js +117 -0
  56. package/meta/scrub-declaration-maps.js +63 -0
  57. package/meta/tsconfig-resolver.js +55 -0
  58. package/meta/tsdoc-config.js +47 -0
  59. package/meta/tsdoctor-config.js +22 -0
  60. package/meta/tsdoctor-manifest.js +134 -0
  61. package/meta/tsdoctor-source.js +94 -0
  62. package/package.json +85 -5
  63. package/passes/build-target-groups.js +346 -0
  64. package/passes/cjs-default-interop.js +98 -0
  65. package/passes/loose-files.js +57 -0
  66. package/passes/node-builtin-default-interop.js +79 -0
  67. package/passes/strip-maps.js +39 -0
  68. package/passes/sync-public.js +100 -0
  69. package/passes/target-groups.js +112 -0
  70. package/report/ci-annotations.js +36 -0
  71. package/report/collector.js +140 -0
  72. package/report/issues-artifact.js +155 -0
  73. package/report/metrics-plugin.js +76 -0
  74. package/report/schema.js +77 -0
  75. package/report/timer.js +19 -0
  76. package/report/tsdown-logger.js +58 -0
  77. package/targets/binding.js +18 -0
  78. package/targets/config.js +21 -0
  79. package/targets/resolve-targets.js +165 -0
  80. package/tsconfig/sync-options.js +20 -0
  81. package/tsdoc-metadata.json +11 -0
package/index.d.ts ADDED
@@ -0,0 +1,3919 @@
1
+ /**
2
+ * Find every relative module specifier in a declaration source: static `import`/`export … from`,
3
+ * `import("…")` type nodes, and `/// <reference path="…" />`. Pure parsing — no I/O.
4
+ *
5
+ * A non-empty result means the file is NOT self-contained and would break when copied verbatim to a
6
+ * flattened output location, so the ambient-copy step rejects it.
7
+ * @public
8
+ */
9
+ import { Context, Effect, FileSystem, Layer, Path, PlatformError, Schema } from "effect";
10
+ import { Plugin } from "rolldown";
11
+ import { WorkspaceDiscovery } from "@effected/workspaces";
12
+ import { AppendError, JournalWatcher, JsonlEvent } from "@effected/jsonl";
13
+ declare const ActionEntries_base: Schema.Class<ActionEntries, Schema.Struct<{
14
+ /** The main entry point's source. */
15
+ readonly main: Schema.withDecodingDefaultKey<Schema.String, never>;
16
+ /** The source of the entry that runs before `main`. */
17
+ readonly pre: Schema.optionalKey<Schema.String>;
18
+ /** The source of the entry that runs after `main`, for cleanup. */
19
+ readonly post: Schema.optionalKey<Schema.String>;
20
+ /** Extra bundles outside the lifecycle: a name to its source, each emitted as `dist/<name>.js`. */
21
+ readonly workers: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.String>, never>;
22
+ }>, {}>;
23
+ /**
24
+ * The bundles a GitHub Action ships, the `[action.entries]` table.
25
+ *
26
+ * @remarks
27
+ * `main`, `pre` and `post` are the lifecycle entries `action.yml` runs. A worker is a bundle outside that
28
+ * lifecycle, which the action loads itself.
29
+ *
30
+ * @public
31
+ */
32
+ export declare class ActionEntries extends ActionEntries_base {}
33
+ declare const ActionBuildOptions_base: Schema.Class<ActionBuildOptions, Schema.Struct<{
34
+ /** Whether to minify the bundles. */
35
+ readonly minify: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
36
+ /** Whether to generate source maps. */
37
+ readonly sourceMap: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
38
+ /** Packages left out of the bundles and imported at runtime, in addition to `node:` builtins. */
39
+ readonly externals: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
40
+ /**
41
+ * Packages left out of the bundles and replaced with a stub that throws if it is ever loaded.
42
+ *
43
+ * @remarks
44
+ * For an optional transitive dependency the action never exercises, such as a native module.
45
+ */
46
+ readonly ignore: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
47
+ /**
48
+ * Whether to import each bundle in a fresh Node after building it, which proves it loads.
49
+ *
50
+ * @remarks
51
+ * A bundle can build cleanly and not load, and this is the only check that finds out. Turn it off for an action
52
+ * with no `GITHUB_ACTIONS` guard around its program, because the import runs that program for real.
53
+ */
54
+ readonly importCheck: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
55
+ }>, {}>;
56
+ /**
57
+ * How an action's bundles are built, the `[action.build]` table.
58
+ *
59
+ * @remarks
60
+ * There is no key for keeping a package's dynamic imports native, and writing one fails like any unknown key.
61
+ * Rolldown leaves a computed `import()` native on its own, so a workaround for a bundler that compiles one into a
62
+ * module that cannot find its target has no counterpart here.
63
+ *
64
+ * @public
65
+ */
66
+ export declare class ActionBuildOptions extends ActionBuildOptions_base {}
67
+ declare const ActionValidationOptions_base: Schema.Class<ActionValidationOptions, Schema.Struct<{
68
+ /** Whether `action.yml` must exist and be valid. */
69
+ readonly requireActionYml: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
70
+ /** The size past which a bundle is reported, such as `"5mb"` or `"500kb"`. */
71
+ readonly maxBundleSize: Schema.optionalKey<Schema.String>;
72
+ /** Whether a warning is an error. Absent means it is under CI and is not locally. */
73
+ readonly strict: Schema.optionalKey<Schema.Boolean>;
74
+ }>, {}>;
75
+ /**
76
+ * What an action build checks before it builds, the `[action.validation]` table.
77
+ *
78
+ * @public
79
+ */
80
+ export declare class ActionValidationOptions extends ActionValidationOptions_base {}
81
+ declare const ActionPersistLocalOptions_base: Schema.Class<ActionPersistLocalOptions, Schema.Struct<{
82
+ /** Whether to copy the build output locally. */
83
+ readonly enabled: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
84
+ /** The local action directory, relative to the package. */
85
+ readonly path: Schema.withDecodingDefaultKey<Schema.String, never>;
86
+ /** Whether to generate the act boilerplate, `.actrc` and `act-test.yml`, when those files do not exist. */
87
+ readonly actTemplate: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
88
+ }>, {}>;
89
+ /**
90
+ * The local copy of an action's build for testing with nektos/act, the `[action.persistLocal]` table.
91
+ *
92
+ * @public
93
+ */
94
+ export declare class ActionPersistLocalOptions extends ActionPersistLocalOptions_base {}
95
+ declare const ActionConfig_base: Schema.Class<ActionConfig, Schema.Struct<{
96
+ /** The bundles to build. */
97
+ readonly entries: Schema.withDecodingDefaultKey<typeof ActionEntries, never>;
98
+ /** How to build them. */
99
+ readonly build: Schema.withDecodingDefaultKey<typeof ActionBuildOptions, never>;
100
+ /** What to check before building. */
101
+ readonly validation: Schema.withDecodingDefaultKey<typeof ActionValidationOptions, never>;
102
+ /** The local copy for testing with nektos/act. */
103
+ readonly persistLocal: Schema.withDecodingDefaultKey<typeof ActionPersistLocalOptions, never>;
104
+ }>, {}>;
105
+ /**
106
+ * A GitHub Action's build settings, the `[action]` table of `effected.toml`.
107
+ *
108
+ * @remarks
109
+ * Every field has a default, so an empty table is a complete config. An `effected.toml` with no `[action]` table
110
+ * at all is a library rather than an action, which is why `config.action` stays absent in that case.
111
+ *
112
+ * @public
113
+ */
114
+ export declare class ActionConfig extends ActionConfig_base {}
115
+ declare const BundleFailed_base: Schema.Class<BundleFailed, Schema.TaggedStruct<"BundleFailed", {
116
+ /** The entry at fault, as its bundle name or source path. */
117
+ readonly entry: Schema.String;
118
+ /** What went wrong. */
119
+ readonly cause: Schema.Defect;
120
+ }>, import("effect/Cause").YieldableError>;
121
+ /**
122
+ * An entry could not go through the bundler, or could not be bundled at all.
123
+ *
124
+ * @public
125
+ */
126
+ export declare class BundleFailed extends BundleFailed_base {
127
+ get message(): string;
128
+ }
129
+ declare const CleanError_base: Schema.Class<CleanError, Schema.TaggedStruct<"CleanError", {
130
+ /** The directory. */
131
+ readonly directory: Schema.String;
132
+ /** What went wrong. */
133
+ readonly cause: Schema.Defect;
134
+ }>, import("effect/Cause").YieldableError>;
135
+ /**
136
+ * The output directory could not be cleaned.
137
+ *
138
+ * @public
139
+ */
140
+ export declare class CleanError extends CleanError_base {
141
+ get message(): string;
142
+ }
143
+ declare const WriteError_base: Schema.Class<WriteError, Schema.TaggedStruct<"WriteError", {
144
+ /** The file. */
145
+ readonly path: Schema.String;
146
+ /** What went wrong. */
147
+ readonly cause: Schema.Defect;
148
+ }>, import("effect/Cause").YieldableError>;
149
+ /**
150
+ * An output file could not be written.
151
+ *
152
+ * @public
153
+ */
154
+ export declare class WriteError extends WriteError_base {
155
+ get message(): string;
156
+ }
157
+ declare const PersistLocalError_base: Schema.Class<PersistLocalError, Schema.TaggedStruct<"PersistLocalError", {
158
+ /** The path involved. */
159
+ readonly path: Schema.String;
160
+ /** What went wrong. */
161
+ readonly cause: Schema.Defect;
162
+ }>, import("effect/Cause").YieldableError>;
163
+ /**
164
+ * A file could not be copied to the local action directory.
165
+ *
166
+ * @public
167
+ */
168
+ export declare class PersistLocalError extends PersistLocalError_base {
169
+ get message(): string;
170
+ }
171
+ declare const ActionYmlPathError_base: Schema.Class<ActionYmlPathError, Schema.TaggedStruct<"ActionYmlPathError", {
172
+ /** The `runs` key: `main`, `pre` or `post`. */
173
+ readonly entryType: Schema.String;
174
+ /** The path as `action.yml` writes it. */
175
+ readonly specifiedPath: Schema.String;
176
+ /** Where that path resolves to. */
177
+ readonly expectedPath: Schema.String;
178
+ }>, import("effect/Cause").YieldableError>;
179
+ /**
180
+ * A `runs` path in `action.yml` names no file in the local action directory.
181
+ *
182
+ * @public
183
+ */
184
+ export declare class ActionYmlPathError extends ActionYmlPathError_base {
185
+ get message(): string;
186
+ }
187
+ declare const BundleStats_base: Schema.Class<BundleStats, Schema.Struct<{
188
+ /** The entry: `main`, `pre`, `post` or a worker's name. */
189
+ readonly entry: Schema.String;
190
+ /** The bundle's size in bytes. */
191
+ readonly size: Schema.Number;
192
+ /** How long the entry took to bundle and check, in milliseconds. */
193
+ readonly duration: Schema.Number;
194
+ /** The output path, relative to the action. */
195
+ readonly outputPath: Schema.String;
196
+ }>, {}>;
197
+ /**
198
+ * What one bundle came to.
199
+ *
200
+ * @public
201
+ */
202
+ export declare class BundleStats extends BundleStats_base {}
203
+ declare const BundleResult_base: Schema.Class<BundleResult, Schema.Struct<{
204
+ /** Whether the entry bundled and its bundle loaded. */
205
+ readonly success: Schema.Boolean;
206
+ /** The bundle's statistics, on success. */
207
+ readonly stats: Schema.optionalKey<typeof BundleStats>;
208
+ /** What went wrong, on failure. */
209
+ readonly error: Schema.optionalKey<Schema.String>;
210
+ /** The warnings rolldown logged for this entry, when it logged any. */
211
+ readonly warnings: Schema.optionalKey<Schema.$Array<Schema.String>>;
212
+ }>, {}>;
213
+ /**
214
+ * How one entry's bundling went.
215
+ *
216
+ * @public
217
+ */
218
+ export declare class BundleResult extends BundleResult_base {}
219
+ declare const BuildResult_base: Schema.Class<BuildResult, Schema.Struct<{
220
+ /** Whether every entry succeeded. */
221
+ readonly success: Schema.Boolean;
222
+ /** Each entry's result: `main`, `pre`, `post`, then the workers. */
223
+ readonly entries: Schema.$Array<typeof BundleResult>;
224
+ /** How long the build took, in milliseconds. */
225
+ readonly duration: Schema.Number;
226
+ /** A summary of what went wrong, on failure. */
227
+ readonly error: Schema.optionalKey<Schema.String>;
228
+ }>, {}>;
229
+ /**
230
+ * How a whole action bundle went.
231
+ *
232
+ * @public
233
+ */
234
+ export declare class BuildResult extends BuildResult_base {}
235
+ /**
236
+ * Bundles a GitHub Action with rolldown.
237
+ *
238
+ * @public
239
+ */
240
+ export declare class ActionBundle {
241
+ private constructor();
242
+ /**
243
+ * Bundles every entry of the action at `options.cwd` into its own `dist/<entry>.js`, and writes `dist/package.json`
244
+ * so Node reads them as ESM.
245
+ *
246
+ * @remarks
247
+ * Each bundle is self-contained apart from `node:` builtins and `build.externals`, and the output does not depend
248
+ * on when or where it is built.
249
+ *
250
+ * Each bundle is then imported in a fresh Node, because a bundle can build cleanly and not load. Set
251
+ * `build.importCheck = false` to skip that. The child has no `GITHUB_*` variable, token or `PATH`, and runs in a
252
+ * temporary directory, for at most a minute. An action's `GITHUB_ACTIONS` guard stays closed, but an action with no
253
+ * guard runs for real there. A failure asking for an input passes. A package listed in `build.externals` that is not
254
+ * installed passes with a warning on the entry, and the check learns nothing about the bundle past that import.
255
+ *
256
+ * An entry that fails to bundle or load is reported in the result with the others still built, and leaves no bundle
257
+ * in `dist`. A missing `main`, a `pre`, `post` or worker the config names with no file, and a bad worker name fail
258
+ * {@link BundleFailed} before `dist` is touched. Interrupting the build kills a running load check.
259
+ *
260
+ * @param options - `cwd` is the action's directory; `clean` removes `dist` first.
261
+ */
262
+ static readonly build: (config: ActionConfig, options: {
263
+ readonly cwd: string;
264
+ readonly clean: boolean;
265
+ }) => Effect.Effect<BuildResult, BundleFailed | CleanError | WriteError>;
266
+ }
267
+ declare const ValidationIssue_base: Schema.Class<ValidationIssue, Schema.Struct<{
268
+ /** What kind of problem it is, such as `MAIN_ENTRY_MISSING`. */
269
+ readonly code: Schema.String;
270
+ /** What went wrong. */
271
+ readonly message: Schema.String;
272
+ /** The file at fault. */
273
+ readonly file: Schema.optionalKey<Schema.String>;
274
+ /** How to fix it. */
275
+ readonly suggestion: Schema.optionalKey<Schema.String>;
276
+ }>, {}>;
277
+ /**
278
+ * One problem a validation found.
279
+ *
280
+ * @public
281
+ */
282
+ export declare class ValidationIssue extends ValidationIssue_base {}
283
+ declare const ValidationResult_base: Schema.Class<ValidationResult, Schema.Struct<{
284
+ /** Whether the build may go ahead: no errors, and in strict mode no warnings either. */
285
+ readonly valid: Schema.Boolean;
286
+ /** Problems that always stop a build. */
287
+ readonly errors: Schema.$Array<typeof ValidationIssue>;
288
+ /** Problems that stop a build only in strict mode. */
289
+ readonly warnings: Schema.$Array<typeof ValidationIssue>;
290
+ }>, {}>;
291
+ /**
292
+ * What a validation found.
293
+ *
294
+ * @public
295
+ */
296
+ export declare class ValidationResult extends ValidationResult_base {}
297
+ /**
298
+ * How {@link ActionValidation.validate} decides strict mode.
299
+ *
300
+ * @public
301
+ */
302
+ interface ActionValidationRunOptions {
303
+ /** Whether this run is under CI, which is what an unset `validation.strict` follows. */
304
+ readonly ci: boolean;
305
+ }
306
+ /**
307
+ * Checks an action's config, entry points and `action.yml`, and the size of what it built.
308
+ *
309
+ * @public
310
+ */
311
+ export declare class ActionValidation {
312
+ private constructor();
313
+ /**
314
+ * Whether `env` describes a CI run, by `@effected/env`'s one rule: a known provider's marker, or a truthy `CI` or
315
+ * `CONTINUOUS_INTEGRATION`.
316
+ */
317
+ static isCI(env: Readonly<Record<string, string | undefined>>): boolean;
318
+ /**
319
+ * Whether warnings stop this build: `validation.strict` when it is set, otherwise whether this is a CI run.
320
+ */
321
+ static isStrict(config: ActionConfig, options: ActionValidationRunOptions): boolean;
322
+ /**
323
+ * Validates the action at `cwd` before a build.
324
+ *
325
+ * @remarks
326
+ * Every finding comes back in the result, whatever its severity: the effect fails only when a file cannot be
327
+ * read. A missing `main`, a `pre`, `post` or worker the config names with no file, a bad worker name, an unreadable `maxBundleSize` and a broken
328
+ * `action.yml` are errors. A missing `action.yml` and missing recommended fields are warnings, and `valid` turns
329
+ * false on them in strict mode.
330
+ *
331
+ * @param cwd - The action's directory.
332
+ * @param options - `ci` says whether this run is under CI. Answer it once at `main`, with {@link ActionValidation.isCI}.
333
+ */
334
+ static readonly validate: (config: ActionConfig, cwd: string, options: ActionValidationRunOptions) => Effect.Effect<ValidationResult, PlatformError.PlatformError, FileSystem.FileSystem | Path.Path>;
335
+ /**
336
+ * The bundles past `validation.maxBundleSize`, one warning each. Nothing when no limit is set or it cannot be read.
337
+ */
338
+ static checkBundleSizes(config: ActionConfig, bundles: ReadonlyArray<{
339
+ readonly entry: string;
340
+ readonly size: number;
341
+ readonly outputPath: string;
342
+ }>): ReadonlyArray<ValidationIssue>;
343
+ /** A result from its findings: valid with no errors, and in strict mode no warnings either. */
344
+ static resultOf(errors: ReadonlyArray<ValidationIssue>, warnings: ReadonlyArray<ValidationIssue>, strict: boolean): ValidationResult;
345
+ }
346
+ declare const ValidationFailed_base: Schema.Class<ValidationFailed, Schema.TaggedStruct<"ValidationFailed", {
347
+ /** How many errors it found. */
348
+ readonly errorCount: Schema.Number;
349
+ /** How many warnings it found. */
350
+ readonly warningCount: Schema.Number;
351
+ /** A summary. */
352
+ readonly message: Schema.String;
353
+ /** Everything it found. */
354
+ readonly validation: typeof ValidationResult;
355
+ /** How bundling went, when validation stopped the build after it. */
356
+ readonly build: Schema.optionalKey<typeof BuildResult>;
357
+ }>, import("effect/Cause").YieldableError>;
358
+ /**
359
+ * Validation stopped an action build, before bundling or on a bundle's size afterwards.
360
+ *
361
+ * @public
362
+ */
363
+ export declare class ValidationFailed extends ValidationFailed_base {}
364
+ declare const BuildFailed_base: Schema.Class<BuildFailed, Schema.TaggedStruct<"BuildFailed", {
365
+ /** A summary. */
366
+ readonly message: Schema.String;
367
+ /** How many entries failed. */
368
+ readonly failedEntries: Schema.Number;
369
+ /** Every entry's result. */
370
+ readonly build: typeof BuildResult;
371
+ /** What validation found before bundling. */
372
+ readonly validation: typeof ValidationResult;
373
+ }>, import("effect/Cause").YieldableError>;
374
+ /**
375
+ * An entry of an action failed to bundle or does not load.
376
+ *
377
+ * @public
378
+ */
379
+ export declare class BuildFailed extends BuildFailed_base {}
380
+ /**
381
+ * What {@link ActionBuilder.build} can fail with.
382
+ *
383
+ * @public
384
+ */
385
+ type ActionBuilderError = ValidationFailed | BuildFailed | BundleFailed | CleanError | WriteError | PersistLocalError | ActionYmlPathError | PlatformError.PlatformError;
386
+ /**
387
+ * What {@link ActionBuilder.build} takes.
388
+ *
389
+ * @public
390
+ */
391
+ interface ActionBuilderOptions {
392
+ /** The action's directory. */
393
+ readonly cwd: string;
394
+ /** The decoded `[action]` table. */
395
+ readonly config: ActionConfig;
396
+ /** Whether to validate before bundling and check bundle sizes after it. */
397
+ readonly validate: boolean;
398
+ /** Whether to copy the build locally. `persistLocal.enabled = false` turns that off too. */
399
+ readonly persist: boolean;
400
+ /** Whether this run is under CI, which is what an unset `validation.strict` follows. */
401
+ readonly ci: boolean;
402
+ }
403
+ declare const ActionBuildResult_base: Schema.Class<ActionBuildResult, Schema.Struct<{
404
+ /** What validation found, including any bundle over its size limit. Empty and valid when validation was skipped. */
405
+ readonly validation: typeof ValidationResult;
406
+ /** How bundling went. */
407
+ readonly build: typeof BuildResult;
408
+ /** Whether the build was copied to the local action directory. */
409
+ readonly persisted: Schema.Boolean;
410
+ }>, {}>;
411
+ /**
412
+ * What a whole action build did.
413
+ *
414
+ * @public
415
+ */
416
+ export declare class ActionBuildResult extends ActionBuildResult_base {}
417
+ /**
418
+ * Builds a GitHub Action.
419
+ *
420
+ * @public
421
+ */
422
+ export declare class ActionBuilder {
423
+ private constructor();
424
+ /**
425
+ * Validates the action, bundles it, checks the bundles' sizes and copies the build locally.
426
+ *
427
+ * @remarks
428
+ * It writes nothing to stdout; rendering belongs to the caller. A step that fails stops the ones after it, so an
429
+ * invalid action leaves `dist` as it was, and a failed build or size check persists nothing. In strict mode, set
430
+ * by `validation.strict` or else by running under CI, a warning fails like an error. With `validate` false, neither
431
+ * validation nor the size check runs. `build.importCheck` alone decides whether each bundle is imported to prove it
432
+ * loads, per {@link ActionBundle.build}.
433
+ *
434
+ * Validation and persisting go through the provided `FileSystem`, while bundling always works on the real disk,
435
+ * because rolldown does. A memory filesystem therefore suits {@link ActionValidation} and {@link PersistLocal} tests,
436
+ * not this method.
437
+ */
438
+ static readonly build: (options: ActionBuilderOptions) => Effect.Effect<ActionBuildResult, ActionBuilderError, FileSystem.FileSystem | Path.Path>;
439
+ }
440
+ /**
441
+ * The Feather icons GitHub accepts as an action's branding icon.
442
+ *
443
+ * @public
444
+ */
445
+ export declare const ActionYmlBrandingIcon: Schema.Literals<readonly ["activity", "airplay", "alert-circle", "alert-octagon", "alert-triangle", "align-center", "align-justify", "align-left", "align-right", "anchor", "aperture", "archive", "arrow-down-circle", "arrow-down-left", "arrow-down-right", "arrow-down", "arrow-left-circle", "arrow-left", "arrow-right-circle", "arrow-right", "arrow-up-circle", "arrow-up-left", "arrow-up-right", "arrow-up", "at-sign", "award", "bar-chart-2", "bar-chart", "battery-charging", "battery", "bell-off", "bell", "bluetooth", "bold", "book-open", "book", "bookmark", "box", "briefcase", "calendar", "camera-off", "camera", "cast", "check-circle", "check-square", "check", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "chevrons-down", "chevrons-left", "chevrons-right", "chevrons-up", "circle", "clipboard", "clock", "cloud-drizzle", "cloud-lightning", "cloud-off", "cloud-rain", "cloud-snow", "cloud", "code", "command", "compass", "copy", "corner-down-left", "corner-down-right", "corner-left-down", "corner-left-up", "corner-right-down", "corner-right-up", "corner-up-left", "corner-up-right", "cpu", "credit-card", "crop", "crosshair", "database", "delete", "disc", "dollar-sign", "download-cloud", "download", "droplet", "edit-2", "edit-3", "edit", "external-link", "eye-off", "eye", "fast-forward", "feather", "file-minus", "file-plus", "file-text", "file", "film", "filter", "flag", "folder-minus", "folder-plus", "folder", "gift", "git-branch", "git-commit", "git-merge", "git-pull-request", "globe", "grid", "hard-drive", "hash", "headphones", "heart", "help-circle", "home", "image", "inbox", "info", "italic", "layers", "layout", "life-buoy", "link-2", "link", "list", "loader", "lock", "log-in", "log-out", "mail", "map-pin", "map", "maximize-2", "maximize", "menu", "message-circle", "message-square", "mic-off", "mic", "minimize-2", "minimize", "minus-circle", "minus-square", "minus", "monitor", "moon", "more-horizontal", "more-vertical", "move", "music", "navigation-2", "navigation", "octagon", "package", "paperclip", "pause-circle", "pause", "percent", "phone-call", "phone-forwarded", "phone-incoming", "phone-missed", "phone-off", "phone-outgoing", "phone", "pie-chart", "play-circle", "play", "plus-circle", "plus-square", "plus", "pocket", "power", "printer", "radio", "refresh-ccw", "refresh-cw", "repeat", "rewind", "rotate-ccw", "rotate-cw", "rss", "save", "scissors", "search", "send", "server", "settings", "share-2", "share", "shield-off", "shield", "shopping-bag", "shopping-cart", "shuffle", "sidebar", "skip-back", "skip-forward", "slash", "sliders", "smartphone", "speaker", "square", "star", "stop-circle", "sun", "sunrise", "sunset", "table", "tablet", "tag", "target", "terminal", "thermometer", "thumbs-down", "thumbs-up", "toggle-left", "toggle-right", "trash-2", "trash", "trending-down", "trending-up", "triangle", "truck", "tv", "type", "umbrella", "underline", "unlock", "upload-cloud", "upload", "user-check", "user-minus", "user-plus", "user-x", "user", "users", "video-off", "video", "voicemail", "volume-1", "volume-2", "volume-x", "volume", "watch", "wifi-off", "wifi", "wind", "x-circle", "x-square", "x", "zap-off", "zap", "zoom-in", "zoom-out"]>;
446
+ /**
447
+ * The decoded type of {@link (ActionYmlBrandingIcon:variable)}.
448
+ *
449
+ * @public
450
+ */
451
+ export type ActionYmlBrandingIcon = typeof ActionYmlBrandingIcon.Type;
452
+ /**
453
+ * The colors GitHub accepts as an action's branding color.
454
+ *
455
+ * @public
456
+ */
457
+ export declare const ActionYmlBrandingColor: Schema.Literals<readonly ["white", "black", "yellow", "blue", "green", "orange", "red", "purple", "gray-dark"]>;
458
+ /**
459
+ * The decoded type of {@link (ActionYmlBrandingColor:variable)}.
460
+ *
461
+ * @public
462
+ */
463
+ export type ActionYmlBrandingColor = typeof ActionYmlBrandingColor.Type;
464
+ declare const ActionYmlInput_base: Schema.Class<ActionYmlInput, Schema.Struct<{
465
+ /** What the input is for. */
466
+ readonly description: Schema.String;
467
+ /** Whether a workflow must supply the input. */
468
+ readonly required: Schema.optionalKey<Schema.Boolean>;
469
+ /** The value used when a workflow supplies none. A string only, so a YAML `default: true` is a schema error: quote it. */
470
+ readonly default: Schema.optionalKey<Schema.String>;
471
+ /** The warning shown when a workflow supplies the input. */
472
+ readonly deprecationMessage: Schema.optionalKey<Schema.String>;
473
+ }>, {}>;
474
+ /**
475
+ * One input an action declares.
476
+ *
477
+ * @public
478
+ */
479
+ export declare class ActionYmlInput extends ActionYmlInput_base {}
480
+ declare const ActionYmlOutput_base: Schema.Class<ActionYmlOutput, Schema.Struct<{
481
+ /** What the output holds. */
482
+ readonly description: Schema.String;
483
+ }>, {}>;
484
+ /**
485
+ * One output an action declares.
486
+ *
487
+ * @public
488
+ */
489
+ export declare class ActionYmlOutput extends ActionYmlOutput_base {}
490
+ declare const ActionYmlRuns_base: Schema.Class<ActionYmlRuns, Schema.Struct<{
491
+ /** The runtime. */
492
+ readonly using: Schema.Literal<"node24">;
493
+ /** The file that runs as the main step. */
494
+ readonly main: Schema.String;
495
+ /** The file that runs before `main`. */
496
+ readonly pre: Schema.optionalKey<Schema.String>;
497
+ /** The condition for running `pre`. */
498
+ readonly "pre-if": Schema.optionalKey<Schema.String>;
499
+ /** The file that runs after `main`. */
500
+ readonly post: Schema.optionalKey<Schema.String>;
501
+ /** The condition for running `post`. */
502
+ readonly "post-if": Schema.optionalKey<Schema.String>;
503
+ }>, {}>;
504
+ /**
505
+ * How an action runs, the `runs` key.
506
+ *
507
+ * @remarks
508
+ * The action builder emits Node 24 actions only, so `using` takes `node24` and nothing else.
509
+ *
510
+ * @public
511
+ */
512
+ export declare class ActionYmlRuns extends ActionYmlRuns_base {}
513
+ declare const ActionYmlBranding_base: Schema.Class<ActionYmlBranding, Schema.Struct<{
514
+ /** The icon. */
515
+ readonly icon: Schema.optionalKey<Schema.Literals<readonly ["activity", "airplay", "alert-circle", "alert-octagon", "alert-triangle", "align-center", "align-justify", "align-left", "align-right", "anchor", "aperture", "archive", "arrow-down-circle", "arrow-down-left", "arrow-down-right", "arrow-down", "arrow-left-circle", "arrow-left", "arrow-right-circle", "arrow-right", "arrow-up-circle", "arrow-up-left", "arrow-up-right", "arrow-up", "at-sign", "award", "bar-chart-2", "bar-chart", "battery-charging", "battery", "bell-off", "bell", "bluetooth", "bold", "book-open", "book", "bookmark", "box", "briefcase", "calendar", "camera-off", "camera", "cast", "check-circle", "check-square", "check", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "chevrons-down", "chevrons-left", "chevrons-right", "chevrons-up", "circle", "clipboard", "clock", "cloud-drizzle", "cloud-lightning", "cloud-off", "cloud-rain", "cloud-snow", "cloud", "code", "command", "compass", "copy", "corner-down-left", "corner-down-right", "corner-left-down", "corner-left-up", "corner-right-down", "corner-right-up", "corner-up-left", "corner-up-right", "cpu", "credit-card", "crop", "crosshair", "database", "delete", "disc", "dollar-sign", "download-cloud", "download", "droplet", "edit-2", "edit-3", "edit", "external-link", "eye-off", "eye", "fast-forward", "feather", "file-minus", "file-plus", "file-text", "file", "film", "filter", "flag", "folder-minus", "folder-plus", "folder", "gift", "git-branch", "git-commit", "git-merge", "git-pull-request", "globe", "grid", "hard-drive", "hash", "headphones", "heart", "help-circle", "home", "image", "inbox", "info", "italic", "layers", "layout", "life-buoy", "link-2", "link", "list", "loader", "lock", "log-in", "log-out", "mail", "map-pin", "map", "maximize-2", "maximize", "menu", "message-circle", "message-square", "mic-off", "mic", "minimize-2", "minimize", "minus-circle", "minus-square", "minus", "monitor", "moon", "more-horizontal", "more-vertical", "move", "music", "navigation-2", "navigation", "octagon", "package", "paperclip", "pause-circle", "pause", "percent", "phone-call", "phone-forwarded", "phone-incoming", "phone-missed", "phone-off", "phone-outgoing", "phone", "pie-chart", "play-circle", "play", "plus-circle", "plus-square", "plus", "pocket", "power", "printer", "radio", "refresh-ccw", "refresh-cw", "repeat", "rewind", "rotate-ccw", "rotate-cw", "rss", "save", "scissors", "search", "send", "server", "settings", "share-2", "share", "shield-off", "shield", "shopping-bag", "shopping-cart", "shuffle", "sidebar", "skip-back", "skip-forward", "slash", "sliders", "smartphone", "speaker", "square", "star", "stop-circle", "sun", "sunrise", "sunset", "table", "tablet", "tag", "target", "terminal", "thermometer", "thumbs-down", "thumbs-up", "toggle-left", "toggle-right", "trash-2", "trash", "trending-down", "trending-up", "triangle", "truck", "tv", "type", "umbrella", "underline", "unlock", "upload-cloud", "upload", "user-check", "user-minus", "user-plus", "user-x", "user", "users", "video-off", "video", "voicemail", "volume-1", "volume-2", "volume-x", "volume", "watch", "wifi-off", "wifi", "wind", "x-circle", "x-square", "x", "zap-off", "zap", "zoom-in", "zoom-out"]>>;
516
+ /** The background color. */
517
+ readonly color: Schema.optionalKey<Schema.Literals<readonly ["white", "black", "yellow", "blue", "green", "orange", "red", "purple", "gray-dark"]>>;
518
+ }>, {}>;
519
+ /**
520
+ * An action's Marketplace branding.
521
+ *
522
+ * @public
523
+ */
524
+ export declare class ActionYmlBranding extends ActionYmlBranding_base {}
525
+ declare const ActionYml_base: Schema.Class<ActionYml, Schema.Struct<{
526
+ /** The action's name. */
527
+ readonly name: Schema.String;
528
+ /** What the action does. */
529
+ readonly description: Schema.String;
530
+ /** The action's author. */
531
+ readonly author: Schema.optionalKey<Schema.String>;
532
+ /** The inputs, by name. */
533
+ readonly inputs: Schema.optionalKey<Schema.$Record<Schema.String, typeof ActionYmlInput>>;
534
+ /** The outputs, by name. */
535
+ readonly outputs: Schema.optionalKey<Schema.$Record<Schema.String, typeof ActionYmlOutput>>;
536
+ /** How the action runs. */
537
+ readonly runs: typeof ActionYmlRuns;
538
+ /** The Marketplace branding. */
539
+ readonly branding: Schema.optionalKey<typeof ActionYmlBranding>;
540
+ }>, {}>;
541
+ /**
542
+ * A decoded `action.yml`, per GitHub's metadata syntax for actions.
543
+ *
544
+ * @remarks
545
+ * Keys it does not model are dropped rather than rejected. Parse the file with `Yaml.parse` from `@effected/yaml`,
546
+ * then decode the document with this schema.
547
+ *
548
+ * @public
549
+ */
550
+ export declare class ActionYml extends ActionYml_base {}
551
+ declare const PersistLocalResult_base: Schema.Class<PersistLocalResult, Schema.Struct<{
552
+ /** Files copied because they were new or changed. */
553
+ readonly filesCopied: Schema.Number;
554
+ /** Files left alone because they matched. */
555
+ readonly filesSkipped: Schema.Number;
556
+ /** Whether an act template file was generated. */
557
+ readonly actTemplateGenerated: Schema.Boolean;
558
+ /** The local action directory. */
559
+ readonly outputPath: Schema.String;
560
+ }>, {}>;
561
+ /**
562
+ * What a persist did.
563
+ *
564
+ * @public
565
+ */
566
+ export declare class PersistLocalResult extends PersistLocalResult_base {}
567
+ /**
568
+ * Copies an action's build to a local action directory, for testing with nektos/act.
569
+ *
570
+ * @public
571
+ */
572
+ export declare class PersistLocal {
573
+ private constructor();
574
+ /**
575
+ * Makes `persistLocal.path` hold the action's `action.yml` and `dist/`, and generates the act template.
576
+ *
577
+ * @remarks
578
+ * It writes nothing when `persistLocal.enabled` is false. Files that match are left alone, and files the source no
579
+ * longer has are removed. A `.actrc` and `.github/workflows/act-test.yml` that already exist are kept. A `runs` path
580
+ * in `action.yml` that names no persisted file fails {@link ActionYmlPathError}.
581
+ *
582
+ * @param options - `cwd` is the action's directory.
583
+ */
584
+ static readonly persist: (config: ActionConfig, options: {
585
+ readonly cwd: string;
586
+ }) => Effect.Effect<PersistLocalResult, PersistLocalError | ActionYmlPathError, FileSystem.FileSystem | Path.Path>;
587
+ }
588
+ declare const ReportTimings_base: Schema.Class<ReportTimings, Schema.Struct<{
589
+ readonly totalMs: Schema.Number;
590
+ }>, {}>;
591
+ /** @public */
592
+ export declare class ReportTimings extends ReportTimings_base {}
593
+ declare const DiagnosticEntry_base: Schema.Class<DiagnosticEntry, Schema.Struct<{
594
+ readonly source: Schema.Literals<readonly ["tsdown", "rolldown", "api-extractor", "meta", "config"]>;
595
+ readonly level: Schema.Literals<readonly ["warn", "error"]>;
596
+ readonly text: Schema.String;
597
+ /**
598
+ * Diagnostic identifier — an API Extractor messageId (e.g. "ae-forgotten-export") or a
599
+ * rolldown warning code (e.g. "MIXED_EXPORTS"); used to group suppressed messages by type.
600
+ */
601
+ readonly code: Schema.optional<Schema.String>;
602
+ /** True when shown as `warn` locally but a hard error in CI (drives the "[fails CI]" nudge). */
603
+ readonly ciFatal: Schema.optional<Schema.Boolean>;
604
+ readonly file: Schema.optional<Schema.String>;
605
+ readonly line: Schema.optional<Schema.Number>;
606
+ readonly column: Schema.optional<Schema.Number>;
607
+ }>, {}>;
608
+ /**
609
+ * A captured warning or error, from tsdown's logger, rolldown's onLog, API Extractor, the meta
610
+ * pass's own sidecar work (`tsdoctor.json` sources, Open Graph generation), or an advisory finding
611
+ * about the build config itself (`config`, e.g. a `publishConfig.targets` set no final release reaches).
612
+ *
613
+ * @public
614
+ */
615
+ export declare class DiagnosticEntry extends DiagnosticEntry_base {}
616
+ declare const EmittedFile_base: Schema.Class<EmittedFile, Schema.Struct<{
617
+ readonly path: Schema.String;
618
+ readonly bytes: Schema.Number;
619
+ readonly gzip: Schema.optional<Schema.Number>;
620
+ }>, {}>;
621
+ /**
622
+ * One emitted output file with its in-memory byte size (gzip only when --verbose).
623
+ *
624
+ * @public
625
+ */
626
+ export declare class EmittedFile extends EmittedFile_base {}
627
+ declare const PassReport_base: Schema.Class<PassReport, Schema.Struct<{
628
+ readonly id: Schema.Literals<readonly ["js", "dts", "loose", "exe", "meta"]>;
629
+ readonly files: Schema.$Array<typeof EmittedFile>;
630
+ readonly ms: Schema.Number;
631
+ }>, {}>;
632
+ /**
633
+ * One build pass within a target group (js / dts / loose / exe / meta).
634
+ *
635
+ * @public
636
+ */
637
+ export declare class PassReport extends PassReport_base {}
638
+ declare const TargetGroupReport_base: Schema.Class<TargetGroupReport, Schema.Struct<{
639
+ readonly id: Schema.String;
640
+ readonly entries: Schema.$Array<Schema.String>;
641
+ readonly passes: Schema.$Array<typeof PassReport>;
642
+ readonly warnings: Schema.$Array<typeof DiagnosticEntry>;
643
+ readonly errors: Schema.$Array<typeof DiagnosticEntry>;
644
+ /** Messages matched by `suppressWarnings`, kept for accounting and `--verbose` expansion. */
645
+ readonly suppressed: Schema.$Array<typeof DiagnosticEntry>;
646
+ readonly timings: typeof ReportTimings;
647
+ }>, {}>;
648
+ /** @public */
649
+ export declare class TargetGroupReport extends TargetGroupReport_base {}
650
+ declare const BuildReport_base: Schema.Class<BuildReport, Schema.Struct<{
651
+ readonly package: Schema.String;
652
+ readonly targetGroups: Schema.$Array<typeof TargetGroupReport>;
653
+ }>, {}>;
654
+ /** @public */
655
+ export declare class BuildReport extends BuildReport_base {}
656
+ /**
657
+ * The part of a build a {@link BundlerError} failed in.
658
+ *
659
+ * @public
660
+ */
661
+ export declare const BundlerPhase: Schema.Literals<readonly ["validate", "js", "dts", "meta", "exe", "manifest"]>;
662
+ /**
663
+ * The decoded type of {@link (BundlerPhase:variable)}.
664
+ *
665
+ * @public
666
+ */
667
+ export type BundlerPhase = typeof BundlerPhase.Type;
668
+ declare const BundlerError_base: Schema.Class<BundlerError, Schema.TaggedStruct<"BundlerError", {
669
+ /** The part of the build that failed. */
670
+ readonly phase: Schema.Literals<readonly ["validate", "js", "dts", "meta", "exe", "manifest"]>;
671
+ /** What went wrong, read from the thrown value and its cause chain. */
672
+ readonly message: Schema.String;
673
+ /** The thrown value, carried structurally. */
674
+ readonly cause: Schema.optionalKey<Schema.Defect>;
675
+ /** Everything the build recorded before it failed. */
676
+ readonly report: typeof BuildReport;
677
+ }>, import("effect/Cause").YieldableError>;
678
+ /**
679
+ * A build ended before it finished.
680
+ *
681
+ * @remarks
682
+ * `report` is the collector's snapshot at the moment of failure, so a caller can still render the diagnostics
683
+ * the build gathered. `dist/prod/issues.json` was written with `buildOk: false` before this failure was raised,
684
+ * unless writing it failed too.
685
+ *
686
+ * @public
687
+ */
688
+ export declare class BundlerError extends BundlerError_base {}
689
+ /**
690
+ * A module format the build can emit.
691
+ *
692
+ * @public
693
+ */
694
+ export declare const BuildFormat: Schema.Literals<readonly ["esm", "cjs"]>;
695
+ /**
696
+ * The decoded type of {@link (BuildFormat:variable)}.
697
+ *
698
+ * @public
699
+ */
700
+ export type BuildFormat = typeof BuildFormat.Type;
701
+ /**
702
+ * The platform a JS pass targets.
703
+ *
704
+ * @public
705
+ */
706
+ export declare const BuildPlatform: Schema.Literals<readonly ["node", "browser", "neutral"]>;
707
+ /**
708
+ * The decoded type of {@link (BuildPlatform:variable)}.
709
+ *
710
+ * @public
711
+ */
712
+ export type BuildPlatform = typeof BuildPlatform.Type;
713
+ declare const EntryOverride_base: Schema.Class<EntryOverride, Schema.Struct<{
714
+ /** Export paths to pin to this partition, e.g. `"./changesets/markdownlint"`, or `"."` for the root. */
715
+ readonly entries: Schema.$Array<Schema.String>;
716
+ /** Output module formats for this partition. */
717
+ readonly format: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["esm", "cjs"]>>>;
718
+ /** Packages force-bundled into this partition's JS output. */
719
+ readonly bundle: Schema.optionalKey<Schema.$Array<Schema.String>>;
720
+ /** Packages kept external in this partition. */
721
+ readonly externals: Schema.optionalKey<Schema.$Array<Schema.String>>;
722
+ /** Whether this partition bundles its `node_modules` dependencies. */
723
+ readonly bundleNodeModules: Schema.optionalKey<Schema.Boolean>;
724
+ /** Packages whose declarations are inlined into this partition's `.d.ts`; a workspace sibling must be built first. */
725
+ readonly bundledPackages: Schema.optionalKey<Schema.$Array<Schema.String>>;
726
+ /** Packages externalized in this partition's declaration pass only. */
727
+ readonly dtsExternals: Schema.optionalKey<Schema.$Array<Schema.String>>;
728
+ /** The JS pass's platform for this partition, `"node"` when absent. Use `"browser"` for a browser runtime. */
729
+ readonly platform: Schema.optionalKey<Schema.Literals<readonly ["node", "browser", "neutral"]>>;
730
+ /** CSS handling forwarded to tsdown's `css` option on the JS pass; tsdown owns the shape. */
731
+ readonly css: Schema.optionalKey<Schema.Unknown>;
732
+ /**
733
+ * Builds this partition into a `pkg/<outSubdir>/` subdirectory as an isolated sub-package.
734
+ *
735
+ * @remarks
736
+ * The export's built path becomes `./<outSubdir>/index.{js,d.ts}`. Exactly one export path may be pinned
737
+ * per `outSubdir` override.
738
+ */
739
+ readonly outSubdir: Schema.optionalKey<Schema.String>;
740
+ }>, {}>;
741
+ /**
742
+ * Format and bundling settings pinned to some of a package's export paths, layered onto the base build.
743
+ *
744
+ * @remarks
745
+ * Use one to keep a single entry CJS in an otherwise ESM-only package, or to build an entry as an isolated
746
+ * browser sub-package. Every setting except `entries` is absent unless written, and absent means the base
747
+ * build's value.
748
+ *
749
+ * @public
750
+ */
751
+ export declare class EntryOverride extends EntryOverride_base {}
752
+ declare const LooseFileSpec_base: Schema.Class<LooseFileSpec$1, Schema.Struct<{
753
+ /** Source module to bundle into the file. */
754
+ readonly source: Schema.String;
755
+ /** Module format. Required only for an ambiguous `.js` key; inferred from `.mjs` and `.cjs`. */
756
+ readonly format: Schema.optionalKey<Schema.Literals<readonly ["esm", "cjs"]>>;
757
+ }>, {}>;
758
+ /**
759
+ * One standalone output file's source and format.
760
+ *
761
+ * @public
762
+ */
763
+ declare class LooseFileSpec$1 extends LooseFileSpec_base {}
764
+ declare const CopyEntry_base: Schema.Class<CopyEntry, Schema.Struct<{
765
+ /**
766
+ * Source paths or globs, relative to the package directory. A directory is copied whole and keeps its own basename
767
+ * under `to`, so `{ from: "../../schemas", to: "schemas" }` emits `pkg/schemas/schemas/...`; use the bare string
768
+ * `"../../schemas"` to ship `schemas/` at the package root.
769
+ */
770
+ readonly from: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.String>]>;
771
+ /** The destination directory, relative to the group's `pkg/` root, which is the default. It may not leave `pkg/`. */
772
+ readonly to: Schema.optionalKey<Schema.String>;
773
+ /** Whether to drop each source's directory structure. tsdown defaults this to `true`. */
774
+ readonly flatten: Schema.optionalKey<Schema.Boolean>;
775
+ }>, {}>;
776
+ /**
777
+ * One non-module asset to copy into each publish group's `pkg/` directory, in the shape of tsdown's `copy` option.
778
+ *
779
+ * @public
780
+ */
781
+ export declare class CopyEntry extends CopyEntry_base {}
782
+ declare const JsxConfig_base: Schema.Class<JsxConfig, Schema.Struct<{
783
+ /** `"automatic"` auto-imports the JSX factories; `"classic"` compiles to `React.createElement`. */
784
+ readonly runtime: Schema.optionalKey<Schema.Literals<readonly ["automatic", "classic"]>>;
785
+ /** The JSX import source for the automatic runtime, e.g. `"react"` or `"preact"`. */
786
+ readonly importSource: Schema.optionalKey<Schema.String>;
787
+ }>, {}>;
788
+ /**
789
+ * JSX transform settings.
790
+ *
791
+ * @public
792
+ */
793
+ export declare class JsxConfig extends JsxConfig_base {}
794
+ declare const ManifestConfig_base: Schema.Class<ManifestConfig, Schema.Struct<{
795
+ /** Top-level manifest keys to drop from the emitted `package.json`, beyond the ones always stripped. */
796
+ readonly drop: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
797
+ }>, {}>;
798
+ /**
799
+ * What the build changes in the emitted `package.json`.
800
+ *
801
+ * @public
802
+ */
803
+ export declare class ManifestConfig extends ManifestConfig_base {}
804
+ declare const WarningSuppressionRule_base: Schema.Class<WarningSuppressionRule$1, Schema.Struct<{
805
+ /** The exact API Extractor message id. */
806
+ readonly messageId: Schema.optionalKey<Schema.String>;
807
+ /** A regex or substring matched against the message text. */
808
+ readonly pattern: Schema.optionalKey<Schema.String>;
809
+ }>, {}>;
810
+ /**
811
+ * An API Extractor message-suppression rule.
812
+ *
813
+ * @remarks
814
+ * `messageId` matches exactly and `pattern`, a regex or substring, matches the message text. A rule with
815
+ * both needs both to match.
816
+ *
817
+ * @public
818
+ */
819
+ declare class WarningSuppressionRule$1 extends WarningSuppressionRule_base {}
820
+ declare const TsdocTagDefinition_base: Schema.Class<TsdocTagDefinition$1, Schema.Struct<{
821
+ /** The tag's name, with its leading `@`. */
822
+ readonly tagName: Schema.String;
823
+ /** The tag's syntax. */
824
+ readonly syntaxKind: Schema.Literals<readonly ["block", "inline", "modifier"]>;
825
+ /** Whether a declaration may carry the tag more than once. */
826
+ readonly allowMultiple: Schema.optionalKey<Schema.Boolean>;
827
+ }>, {}>;
828
+ /**
829
+ * A single TSDoc tag definition, as API Extractor's TSDoc config takes it.
830
+ *
831
+ * @public
832
+ */
833
+ declare class TsdocTagDefinition$1 extends TsdocTagDefinition_base {}
834
+ declare const TsdocConfig_base: Schema.Class<TsdocConfig, Schema.Struct<{
835
+ /**
836
+ * API Extractor messages to suppress.
837
+ *
838
+ * @remarks
839
+ * Defaults to the `_base` forgotten-export every `Schema.Class` synthesizes. A list replaces the default
840
+ * rather than adding to it, so an empty list suppresses nothing.
841
+ */
842
+ readonly suppressWarnings: Schema.withDecodingDefaultKey<Schema.$Array<typeof WarningSuppressionRule$1>, never>;
843
+ /** Custom TSDoc tags to register. */
844
+ readonly tagDefinitions: Schema.withDecodingDefaultKey<Schema.$Array<typeof TsdocTagDefinition$1>, never>;
845
+ }>, {}>;
846
+ /**
847
+ * TSDoc and documentation-warning settings.
848
+ *
849
+ * @public
850
+ */
851
+ export declare class TsdocConfig extends TsdocConfig_base {}
852
+ declare const MetaConfig_base: Schema.Class<MetaConfig, Schema.Struct<{
853
+ /**
854
+ * Directories, relative to the package directory, that the canonical group's API model is copied into.
855
+ *
856
+ * @remarks
857
+ * For a docs site reading the model from its own tree. Each one receives the `.api.json`, the meta `package.json`
858
+ * and `tsconfig.json`, and `tsdoctor.json` when one was emitted.
859
+ */
860
+ readonly localPaths: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
861
+ /**
862
+ * Forward-looks the meta bundle's own version and its workspace siblings' dependency versions to their
863
+ * next release versions from pending changesets.
864
+ *
865
+ * @remarks
866
+ * `"auto"` is `false` under CI and `true` locally, so a local bundle matches the CI release build.
867
+ */
868
+ readonly optimistic: Schema.withDecodingDefaultKey<Schema.Union<readonly [Schema.Literal<"auto">, Schema.Boolean]>, never>;
869
+ /** TSDoc and documentation-warning settings. */
870
+ readonly tsdoc: Schema.withDecodingDefaultKey<typeof TsdocConfig, never>;
871
+ }>, {}>;
872
+ /**
873
+ * API model generation settings, the `[package.build.meta]` table.
874
+ *
875
+ * @public
876
+ */
877
+ export declare class MetaConfig extends MetaConfig_base {}
878
+ declare const ExeTargetConfig_base: Schema.Class<ExeTargetConfig, Schema.Struct<{
879
+ /** The platform, using tsdown's `win` token rather than `win32`. */
880
+ readonly platform: Schema.Literals<readonly ["darwin", "linux", "win"]>;
881
+ /** The CPU architecture. */
882
+ readonly arch: Schema.Literals<readonly ["arm64", "x64"]>;
883
+ }>, {}>;
884
+ /**
885
+ * A single-executable (SEA) target platform and architecture.
886
+ *
887
+ * @public
888
+ */
889
+ export declare class ExeTargetConfig extends ExeTargetConfig_base {}
890
+ declare const ExeSeaConfig_base: Schema.Class<ExeSeaConfig, Schema.Struct<{
891
+ /** Whether to silence Node's experimental SEA warning. */
892
+ readonly disableExperimentalSEAWarning: Schema.optionalKey<Schema.Boolean>;
893
+ /** Whether to embed V8's code cache. */
894
+ readonly useCodeCache: Schema.optionalKey<Schema.Boolean>;
895
+ /** Whether to embed a V8 startup snapshot. */
896
+ readonly useSnapshot: Schema.optionalKey<Schema.Boolean>;
897
+ }>, {}>;
898
+ /**
899
+ * Single-executable `seaConfig` overrides, merged over the defaults.
900
+ *
901
+ * @public
902
+ */
903
+ export declare class ExeSeaConfig extends ExeSeaConfig_base {}
904
+ declare const ExeConfig_base: Schema.Class<ExeConfig, Schema.Struct<{
905
+ /** Output binary basename, with no extension or suffix. */
906
+ readonly fileName: Schema.String;
907
+ /** The bin entry; `./src/bin.ts` when absent. */
908
+ readonly entry: Schema.optionalKey<Schema.String>;
909
+ /** The Node runtime to embed. */
910
+ readonly nodeVersion: Schema.optionalKey<Schema.String>;
911
+ /** `seaConfig` overrides merged over the defaults. */
912
+ readonly seaConfig: Schema.optionalKey<typeof ExeSeaConfig>;
913
+ /** Explicit targets; inferred from the package's `os` and `cpu` when absent. */
914
+ readonly targets: Schema.optionalKey<Schema.$Array<typeof ExeTargetConfig>>;
915
+ }>, {}>;
916
+ /**
917
+ * One single-executable (SEA) binary to compile.
918
+ *
919
+ * @public
920
+ */
921
+ export declare class ExeConfig extends ExeConfig_base {}
922
+ declare const PackageBuildConfig_base: Schema.Class<PackageBuildConfig, Schema.Struct<{
923
+ /** Output module formats. ESM-only by default; add `"cjs"` for a dual-format build. */
924
+ readonly format: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Literals<readonly ["esm", "cjs"]>>, never>;
925
+ /** Packages kept external. */
926
+ readonly externals: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
927
+ /**
928
+ * Packages force-bundled into the JS output, even ones declared in `package.json` that would otherwise be
929
+ * external.
930
+ *
931
+ * @remarks
932
+ * The inverse of `externals`. Declarations are not inlined by this; use `bundledPackages` to roll a
933
+ * package's types into the emitted `.d.ts` too.
934
+ */
935
+ readonly bundle: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
936
+ /**
937
+ * External packages whose declarations are inlined into the bundled `.d.ts`; all others stay external.
938
+ *
939
+ * @remarks
940
+ * A workspace sibling inlines from its built declarations, so it has to be built first; the build fails naming it
941
+ * when they are absent.
942
+ */
943
+ readonly bundledPackages: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
944
+ /**
945
+ * Packages externalized in the declaration pass only: imported from the emitted `.d.ts` rather than
946
+ * inlined, while the JS pass still bundles them per `bundleNodeModules`.
947
+ *
948
+ * @remarks
949
+ * For a dependency whose types cannot be safely inlined, such as `effect`'s cross-module `declare module`
950
+ * augmentations. Declare these as package dependencies so consumers can resolve the emitted imports.
951
+ */
952
+ readonly dtsExternals: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
953
+ /**
954
+ * Bundles `node_modules` and workspace dependencies that are not externalized into the JS output and the
955
+ * bundled declarations alike.
956
+ */
957
+ readonly bundleNodeModules: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
958
+ /**
959
+ * Minifies the output.
960
+ *
961
+ * @remarks
962
+ * Off by default: minified Node libraries trip security scanners and degrade stack traces.
963
+ */
964
+ readonly minify: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
965
+ /**
966
+ * Runs the bundled `.d.ts` pass and, with it, the meta pass that reads those declarations.
967
+ *
968
+ * @remarks
969
+ * `false` is for JS-only artifacts that never consume declarations. It differs from `meta = false`, which
970
+ * disables only the API model and still runs the declaration pass.
971
+ */
972
+ readonly emitDts: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
973
+ /**
974
+ * Compile-time global replacements forwarded to the build's `define`.
975
+ *
976
+ * @remarks
977
+ * Values are inserted verbatim, so a string literal must carry its own quotes.
978
+ */
979
+ readonly define: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.String>, never>;
980
+ /** Modules whose default export is a rolldown plugin or a factory of one, as package-relative paths. */
981
+ readonly plugins: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
982
+ /** Per-entry format and bundling overrides, layered onto the base build. */
983
+ readonly overrides: Schema.withDecodingDefaultKey<Schema.$Array<typeof EntryOverride>, never>;
984
+ /**
985
+ * Standalone bundled output files emitted at literal paths, outside the exports, declaration and meta graph.
986
+ *
987
+ * @remarks
988
+ * Keys are literal output filenames; values are a source path or a {@link LooseFileSpec}. Pair with
989
+ * `bundleNodeModules` to make each file self-contained.
990
+ */
991
+ readonly looseFiles: Schema.withDecodingDefaultKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, typeof LooseFileSpec$1]>>, never>;
992
+ /**
993
+ * Non-module assets copied into each group's `pkg/` directory by the JS pass.
994
+ *
995
+ * @remarks
996
+ * tsdown's `copy` option as data: a string is a path or glob relative to the package directory, copied into the
997
+ * `pkg/` root, and {@link CopyEntry} adds a destination. A directory keeps its basename, so `"../../schemas"` ships
998
+ * `pkg/schemas/...`. A `public/` directory is already copied verbatim with no
999
+ * config; this is the explicit way, for files that live elsewhere. A package that compiles only a binary runs no JS
1000
+ * pass, so setting this there fails validation.
1001
+ */
1002
+ readonly copy: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Union<readonly [Schema.String, typeof CopyEntry]>>, never>;
1003
+ /** JSX transform settings; inferred from the package's tsconfig when absent. */
1004
+ readonly jsx: Schema.optionalKey<typeof JsxConfig>;
1005
+ /** What the build changes in the emitted `package.json`. */
1006
+ readonly manifest: Schema.withDecodingDefaultKey<typeof ManifestConfig, never>;
1007
+ /** API model generation: its settings, or `false` to opt out. Generated with defaults when absent. */
1008
+ readonly meta: Schema.withDecodingDefaultKey<Schema.Union<readonly [Schema.Literal<false>, typeof MetaConfig]>, never>;
1009
+ /** Single-executable binaries to compile: one, or a list. */
1010
+ readonly exe: Schema.optionalKey<Schema.Union<readonly [typeof ExeConfig, Schema.$Array<typeof ExeConfig>]>>;
1011
+ }>, {}>;
1012
+ /**
1013
+ * The build settings of one package, the `[package.build]` table.
1014
+ *
1015
+ * @remarks
1016
+ * Every field has a default or is absent, so an empty table is a complete config.
1017
+ *
1018
+ * @public
1019
+ */
1020
+ export declare class PackageBuildConfig extends PackageBuildConfig_base {}
1021
+ declare const TsdoctorOpenGraphImage_base: Schema.Class<TsdoctorOpenGraphImage, Schema.Struct<{
1022
+ /** Bundle-relative asset path. Mutually exclusive with `url`. */
1023
+ readonly path: Schema.optionalKey<Schema.String>;
1024
+ /** Absolute external URL, used verbatim. Mutually exclusive with `path`. */
1025
+ readonly url: Schema.optionalKey<Schema.String>;
1026
+ /** MIME type; inferred from the extension when absent. */
1027
+ readonly type: Schema.optionalKey<Schema.String>;
1028
+ /** Pixel width. */
1029
+ readonly width: Schema.optionalKey<Schema.Int>;
1030
+ /** Pixel height. */
1031
+ readonly height: Schema.optionalKey<Schema.Int>;
1032
+ /** Alt text; inferred when absent. */
1033
+ readonly alt: Schema.optionalKey<Schema.String>;
1034
+ }>, {}>;
1035
+ /**
1036
+ * One Open Graph image a package's API docs declare.
1037
+ *
1038
+ * @remarks
1039
+ * Exactly one of `path` and `url` must be present.
1040
+ *
1041
+ * @public
1042
+ */
1043
+ export declare class TsdoctorOpenGraphImage extends TsdoctorOpenGraphImage_base {}
1044
+ declare const TsdoctorRegistryRef_base: Schema.Class<TsdoctorRegistryRef, Schema.Struct<{
1045
+ /** The protocol family, e.g. `"npm"` or `"jsr"`. Unknown values are accepted. */
1046
+ readonly type: Schema.String;
1047
+ /** The human instance label, e.g. `"npm"`. */
1048
+ readonly name: Schema.String;
1049
+ /** The package's URL on that registry instance. */
1050
+ readonly url: Schema.String;
1051
+ }>, {}>;
1052
+ /**
1053
+ * One registry a documented package is published to.
1054
+ *
1055
+ * @public
1056
+ */
1057
+ export declare class TsdoctorRegistryRef extends TsdoctorRegistryRef_base {}
1058
+ declare const TsdoctorOpenGraphConfig_base: Schema.Class<TsdoctorOpenGraphConfig, Schema.Struct<{
1059
+ /** Static images, by path or url. Listed after a generated image. */
1060
+ readonly images: Schema.optionalKey<Schema.$Array<typeof TsdoctorOpenGraphImage>>;
1061
+ /** Embed accent color, a CSS color string. */
1062
+ readonly themeColor: Schema.optionalKey<Schema.String>;
1063
+ /** Renders an image at build time, listed first. `"satori"` is the only renderer. */
1064
+ readonly generate: Schema.optionalKey<Schema.Literal<"satori">>;
1065
+ /**
1066
+ * The cross-build image cache's salt.
1067
+ *
1068
+ * @remarks
1069
+ * A string caches under it, so change it whenever the renderer's output changes for the same input.
1070
+ * `false` always regenerates. Absent, the renderer's own salt is used.
1071
+ */
1072
+ readonly cacheSalt: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Literal<false>]>>;
1073
+ }>, {}>;
1074
+ /**
1075
+ * The Open Graph settings of a package's API docs.
1076
+ *
1077
+ * @public
1078
+ */
1079
+ export declare class TsdoctorOpenGraphConfig extends TsdoctorOpenGraphConfig_base {}
1080
+ declare const TsdoctorConfig_base: Schema.Class<TsdoctorConfig, Schema.Struct<{
1081
+ /** The display name. */
1082
+ readonly name: Schema.optionalKey<Schema.String>;
1083
+ /** A one-line tagline. */
1084
+ readonly tagline: Schema.optionalKey<Schema.String>;
1085
+ /** A description. */
1086
+ readonly description: Schema.optionalKey<Schema.String>;
1087
+ /** The Open Graph settings. */
1088
+ readonly openGraph: Schema.optionalKey<typeof TsdoctorOpenGraphConfig>;
1089
+ /** Registries; `false` disables the default derived from `targets.json`. */
1090
+ readonly registries: Schema.optionalKey<Schema.Union<readonly [Schema.$Array<typeof TsdoctorRegistryRef>, Schema.Literal<false>]>>;
1091
+ }>, {}>;
1092
+ /**
1093
+ * The config tier of a package's emitted `tsdoctor.json`, the `[package.tsdoctor]` table.
1094
+ *
1095
+ * @public
1096
+ */
1097
+ export declare class TsdoctorConfig extends TsdoctorConfig_base {}
1098
+ declare const PackageConfig_base: Schema.Class<PackageConfig, Schema.Struct<{
1099
+ /** The build settings. */
1100
+ readonly build: Schema.withDecodingDefaultKey<typeof PackageBuildConfig, never>;
1101
+ /** The `tsdoctor.json` config tier. */
1102
+ readonly tsdoctor: Schema.optionalKey<typeof TsdoctorConfig>;
1103
+ }>, {}>;
1104
+ /**
1105
+ * The `[package]` table of `effected.toml`.
1106
+ *
1107
+ * @public
1108
+ */
1109
+ export declare class PackageConfig extends PackageConfig_base {}
1110
+ declare const EffectedConfig_base: Schema.Class<EffectedConfig, Schema.Struct<{
1111
+ /** The package tables. */
1112
+ readonly package: Schema.optionalKey<typeof PackageConfig>;
1113
+ /** The GitHub Action table. Absent for a library. */
1114
+ readonly action: Schema.optionalKey<typeof ActionConfig>;
1115
+ }>, {}>;
1116
+ /**
1117
+ * A decoded `effected.toml`.
1118
+ *
1119
+ * @remarks
1120
+ * Decode it with `onExcessProperty: "error"`: a struct's decode drops
1121
+ * unknown keys by default, and a typo in a human-written config must fail naming its path rather than
1122
+ * silently taking the default.
1123
+ *
1124
+ * @public
1125
+ */
1126
+ export declare class EffectedConfig extends EffectedConfig_base {}
1127
+ 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 & {
1128
+ readonly _tag: "ConfigValidationError";
1129
+ } & Readonly<A>;
1130
+ /**
1131
+ * A build config is structurally invalid; raised before any build work.
1132
+ *
1133
+ * @public
1134
+ */
1135
+ export declare class ConfigValidationError extends ConfigValidationError_base<{
1136
+ readonly path: string;
1137
+ readonly reason: string;
1138
+ }> {
1139
+ get message(): string;
1140
+ }
1141
+ 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 & {
1142
+ readonly _tag: "MetaGenerationError";
1143
+ } & Readonly<A>;
1144
+ /**
1145
+ * API Extractor meta generation failed for an entry.
1146
+ *
1147
+ * @public
1148
+ */
1149
+ export declare class MetaGenerationError extends MetaGenerationError_base<{
1150
+ readonly entry: string;
1151
+ readonly reason: string;
1152
+ }> {
1153
+ get message(): string;
1154
+ }
1155
+ declare const TsdoctorEmitError_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 & {
1156
+ readonly _tag: "TsdoctorEmitError";
1157
+ } & Readonly<A>;
1158
+ /**
1159
+ * Writing the `tsdoctor.json` sidecar failed: the composed manifest did not encode, or the file could not be
1160
+ * written (a read-only or full disk). Recorded in `issues.json` as a `meta` error.
1161
+ *
1162
+ * @public
1163
+ */
1164
+ export declare class TsdoctorEmitError extends TsdoctorEmitError_base<{
1165
+ readonly packageName: string;
1166
+ readonly path: string;
1167
+ readonly cause: unknown;
1168
+ }> {
1169
+ get message(): string;
1170
+ }
1171
+ /** @public */
1172
+ type PassKind = PassReport["id"];
1173
+ /** @public */
1174
+ interface DiagnosticInput {
1175
+ readonly source: DiagnosticEntry["source"];
1176
+ readonly level: DiagnosticEntry["level"];
1177
+ readonly text: string;
1178
+ readonly code?: string;
1179
+ readonly ciFatal?: boolean;
1180
+ readonly file?: string;
1181
+ readonly line?: number;
1182
+ readonly column?: number;
1183
+ }
1184
+ /**
1185
+ * Stateful build-event accumulator. The write surface is synchronous so it can be called directly
1186
+ * from tsdown's customLogger and API Extractor's messageCallback (both invoked synchronously).
1187
+ * `snapshot` builds the immutable BuildReport the Effect render pipeline consumes.
1188
+ * @public
1189
+ */
1190
+ export declare class BuildCollector {
1191
+ private readonly groups;
1192
+ private group;
1193
+ private pass;
1194
+ registerGroup(groupId: string, entries: ReadonlyArray<string>): void;
1195
+ recordEmitted(groupId: string, pass: PassKind, file: EmittedFile): void;
1196
+ recordPassTiming(groupId: string, pass: PassKind, ms: number): void;
1197
+ recordWarning(groupId: string, entry: DiagnosticInput): void;
1198
+ recordError(groupId: string, entry: DiagnosticInput): void;
1199
+ recordSuppressed(groupId: string, entry: DiagnosticInput): void;
1200
+ snapshot(packageName: string): ReadonlyArray<BuildReport>;
1201
+ }
1202
+ declare const BuildCollectorTag_base: Context.ServiceClass<BuildCollectorTag, "@effected/bundler/BuildCollector", BuildCollector>;
1203
+ /** @public */
1204
+ export declare class BuildCollectorTag extends BuildCollectorTag_base {}
1205
+ /**
1206
+ * Default Node runtime embedded in the SEA (parity with the vitest-agent reference).
1207
+ *
1208
+ * @public
1209
+ */
1210
+ export declare const DEFAULT_EXE_NODE_VERSION = "25.9.0";
1211
+ /**
1212
+ * A resolved per-platform SEA target. `platform` uses the tsdown/\@tsdown/exe token (win, not win32).
1213
+ *
1214
+ * @public
1215
+ */
1216
+ interface ExeTarget {
1217
+ readonly platform: "darwin" | "linux" | "win";
1218
+ readonly arch: "arm64" | "x64";
1219
+ readonly nodeVersion: string;
1220
+ }
1221
+ /**
1222
+ * A target before nodeVersion defaulting (platform/arch only).
1223
+ *
1224
+ * @public
1225
+ */
1226
+ interface ExeTargetInput {
1227
+ readonly platform: "darwin" | "linux" | "win";
1228
+ readonly arch: "arm64" | "x64";
1229
+ }
1230
+ /**
1231
+ * SEA seaConfig overrides (subset; the rest are defaulted).
1232
+ *
1233
+ * @public
1234
+ */
1235
+ interface ExeSeaConfig$1 {
1236
+ readonly disableExperimentalSEAWarning?: boolean | undefined;
1237
+ readonly useCodeCache?: boolean | undefined;
1238
+ readonly useSnapshot?: boolean | undefined;
1239
+ }
1240
+ /**
1241
+ * One SEA binary to compile.
1242
+ *
1243
+ * @public
1244
+ */
1245
+ interface ExeConfig$1 {
1246
+ /** Output binary basename (no extension/suffix). */
1247
+ readonly fileName: string;
1248
+ /** Bin entry; defaults to ./src/bin.ts. */
1249
+ readonly entry?: string | undefined;
1250
+ /** Node runtime to embed; defaults to DEFAULT_EXE_NODE_VERSION. */
1251
+ readonly nodeVersion?: string | undefined;
1252
+ /** seaConfig overrides merged over the defaults. */
1253
+ readonly seaConfig?: ExeSeaConfig$1 | undefined;
1254
+ /** Explicit targets; default inferred from the package os/cpu. */
1255
+ readonly targets?: ReadonlyArray<ExeTargetInput> | undefined;
1256
+ }
1257
+ /**
1258
+ * Fully-resolved SEA binary spec (no optionals).
1259
+ *
1260
+ * @public
1261
+ */
1262
+ interface NormalizedExe {
1263
+ readonly fileName: string;
1264
+ readonly entry: string;
1265
+ readonly targets: ReadonlyArray<ExeTarget>;
1266
+ readonly seaConfig: {
1267
+ readonly disableExperimentalSEAWarning: boolean;
1268
+ readonly useCodeCache: boolean;
1269
+ readonly useSnapshot: boolean;
1270
+ };
1271
+ }
1272
+ /**
1273
+ * The package's own os/cpu fields, used to infer a single platform target.
1274
+ *
1275
+ * @public
1276
+ */
1277
+ interface PkgOsCpu {
1278
+ readonly os: ReadonlyArray<string>;
1279
+ readonly cpu: ReadonlyArray<string>;
1280
+ }
1281
+ /**
1282
+ * Normalize `exe` (object or array) into one fully-resolved spec per binary.
1283
+ *
1284
+ * Pure function; structural validation (missing fileName, empty targets) lives in the
1285
+ * config-validation layer.
1286
+ * @public
1287
+ */
1288
+ export declare function normalizeExeOptions(exe: ExeConfig$1 | ReadonlyArray<ExeConfig$1>, pkg: PkgOsCpu): ReadonlyArray<NormalizedExe>;
1289
+ /**
1290
+ * A minimal structural type for tsdown's build, looser than `TsdownBuild` because this path passes an object literal.
1291
+ *
1292
+ * @public
1293
+ */
1294
+ type ExeBuild = (config: unknown) => Promise<unknown>;
1295
+ /**
1296
+ * Options for compiling SEA binaries.
1297
+ *
1298
+ * @public
1299
+ */
1300
+ interface RunExeBuildOptions {
1301
+ readonly cwd: string;
1302
+ /** Directory the binaries are emitted into (e.g. dist/prod/npm/pkg/bin). */
1303
+ readonly outDir: string;
1304
+ /** One fully-resolved spec per binary. */
1305
+ readonly specs: ReadonlyArray<NormalizedExe>;
1306
+ /** Injectable tsdown build (defaults to tsdown's build function). */
1307
+ readonly build?: ExeBuild | undefined;
1308
+ /** When set with groupId, muzzle tsdown and record an "exe" pass into this collector. */
1309
+ readonly collector?: BuildCollector | undefined;
1310
+ /** Target-group id the exe pass belongs to (required to record into the collector). */
1311
+ readonly groupId?: string | undefined;
1312
+ /** Compute gzip sizes (verbose render). */
1313
+ readonly verbose?: boolean | undefined;
1314
+ }
1315
+ /**
1316
+ * Compile each SEA binary via tsdown's exe mode. One tsdown build per spec.
1317
+ *
1318
+ * @public
1319
+ */
1320
+ export declare function runExeBuild(options: RunExeBuildOptions): Promise<void>;
1321
+ /**
1322
+ * Resolved JSX transform settings. The shape mirrors the subset of rolldown's JsxOptions, but the
1323
+ * bundler consumes it to populate the generated dts tsconfig's `jsx`/`jsxImportSource`, not by
1324
+ * forwarding it into rolldown's input options.
1325
+ *
1326
+ * @public
1327
+ */
1328
+ interface JsxConfig$1 {
1329
+ /** "automatic" auto-imports the JSX factories (react-jsx); "classic" does not (React.createElement). */
1330
+ readonly runtime?: "classic" | "automatic" | undefined;
1331
+ /** The JSX import source for the automatic runtime (e.g. "react", "preact"). */
1332
+ readonly importSource?: string | undefined;
1333
+ }
1334
+ /**
1335
+ * The jsx-relevant slice of a tsconfig's compilerOptions.
1336
+ *
1337
+ * @public
1338
+ */
1339
+ interface TsconfigJsx {
1340
+ readonly jsx?: string | undefined;
1341
+ readonly jsxImportSource?: string | undefined;
1342
+ }
1343
+ /**
1344
+ * Resolve the effective JSX config: an explicit override wins; otherwise infer from the tsconfig
1345
+ * values via `@effected/tsconfig-json`'s `JsxConfig.fromCompilerOptions`. Returns undefined when
1346
+ * no JSX transform is needed (preserve/none).
1347
+ * @public
1348
+ */
1349
+ export declare function resolveJsxConfig(tsconfig: TsconfigJsx, override: JsxConfig$1 | undefined): JsxConfig$1 | undefined;
1350
+ /**
1351
+ * Read the jsx-relevant compilerOptions from a package's own tsconfig.json (best-effort;
1352
+ * returns empty on absence or parse error). Resolved through `@effected/tsconfig-json`'s
1353
+ * sync loader, so JSONC syntax and `extends` chains are honored.
1354
+ * @public
1355
+ */
1356
+ export declare function readTsconfigJsx(cwd: string): TsconfigJsx;
1357
+ /**
1358
+ * The registry protocol families this reader knows how to do more than link
1359
+ * to. `"npm"` means an npm-compatible registry — install commands and tarball
1360
+ * fetching work against any instance of it — and `"jsr"` the jsr protocol.
1361
+ *
1362
+ * @remarks
1363
+ * The manifest's `type` field is deliberately NOT constrained to these
1364
+ * values: unknown future types must degrade to link-only rendering, not
1365
+ * reject the manifest. Use {@link isKnownRegistryType} to branch.
1366
+ *
1367
+ * @public
1368
+ */
1369
+ export declare const KNOWN_REGISTRY_TYPES: readonly ["npm", "jsr"];
1370
+ /**
1371
+ * A registry protocol family this reader recognizes.
1372
+ *
1373
+ * @public
1374
+ */
1375
+ type KnownRegistryType = (typeof KNOWN_REGISTRY_TYPES)[number];
1376
+ /**
1377
+ * Whether a registry `type` value is a protocol family this reader
1378
+ * recognizes. `false` means the registry entry should degrade to link-only
1379
+ * rendering — it is never a validation failure.
1380
+ *
1381
+ * @public
1382
+ */
1383
+ export declare function isKnownRegistryType(type: string): type is KnownRegistryType;
1384
+ /**
1385
+ * One registry the documented package is published to.
1386
+ *
1387
+ * @remarks
1388
+ * `type` is the PROTOCOL FAMILY (`"npm"` covers every npm-compatible
1389
+ * registry), `name` the human instance label, `url` the package's page on
1390
+ * that instance. Unknown `type` values decode successfully and degrade to
1391
+ * link-only rendering (see {@link isKnownRegistryType}).
1392
+ *
1393
+ * @public
1394
+ */
1395
+ export declare const RegistryRef: Schema.Struct<{
1396
+ /** The protocol family, e.g. `"npm"` or `"jsr"`. Unknown values are accepted. */
1397
+ readonly type: Schema.String;
1398
+ /** The human instance label, e.g. `"npm"` or `"Savvy Web Registry"`. */
1399
+ readonly name: Schema.String;
1400
+ /** The package's URL on that registry instance. */
1401
+ readonly url: Schema.String;
1402
+ }>;
1403
+ /**
1404
+ * The decoded type of {@link (RegistryRef:variable)}.
1405
+ *
1406
+ * @public
1407
+ */
1408
+ export type RegistryRef = typeof RegistryRef.Type;
1409
+ /**
1410
+ * One Open Graph image declared by the manifest.
1411
+ *
1412
+ * @remarks
1413
+ * Exactly ONE of `path` (a bundle-relative asset the consuming platform
1414
+ * publishes and resolves to a URL) or `url` (an absolute external URL used
1415
+ * verbatim) must be present — the schema enforces the XOR. `type` is a MIME
1416
+ * type, inferred from the file extension by the resolver when omitted; `alt`
1417
+ * has a documented inference chain (tagline → description →
1418
+ * `"<name> API documentation"`).
1419
+ *
1420
+ * @public
1421
+ */
1422
+ export declare const OpenGraphImage: Schema.Struct<{
1423
+ /** Bundle-relative asset path. Mutually exclusive with `url`. */
1424
+ readonly path: Schema.optionalKey<Schema.String>;
1425
+ /** Absolute external URL, used verbatim. Mutually exclusive with `path`. */
1426
+ readonly url: Schema.optionalKey<Schema.String>;
1427
+ /** MIME type; inferred from the extension when omitted. */
1428
+ readonly type: Schema.optionalKey<Schema.String>;
1429
+ /** Pixel width; 1200×630 (1.91:1) is the cross-platform safe default. */
1430
+ readonly width: Schema.optionalKey<Schema.Int>;
1431
+ /** Pixel height. */
1432
+ readonly height: Schema.optionalKey<Schema.Int>;
1433
+ /** Alt text; inferred (tagline → description → fallback) when omitted. */
1434
+ readonly alt: Schema.optionalKey<Schema.String>;
1435
+ }>;
1436
+ /**
1437
+ * The decoded type of {@link (OpenGraphImage:variable)}.
1438
+ *
1439
+ * @public
1440
+ */
1441
+ export type OpenGraphImage = typeof OpenGraphImage.Type;
1442
+ /**
1443
+ * The manifest's Open Graph block: the asset-ish pieces only — most OG tags
1444
+ * are page-level and derive at render time in the consuming platform.
1445
+ *
1446
+ * @remarks
1447
+ * Multiple images follow OG array semantics: the first declared wins, extras
1448
+ * are alternates (e.g. a portrait 1000×1500 variant).
1449
+ *
1450
+ * @public
1451
+ */
1452
+ export declare const OpenGraphConfig: Schema.Struct<{
1453
+ /** Declared images, first-wins per OG array semantics. */
1454
+ readonly images: Schema.optionalKey<Schema.$Array<Schema.Struct<{
1455
+ /** Bundle-relative asset path. Mutually exclusive with `url`. */
1456
+ readonly path: Schema.optionalKey<Schema.String>;
1457
+ /** Absolute external URL, used verbatim. Mutually exclusive with `path`. */
1458
+ readonly url: Schema.optionalKey<Schema.String>;
1459
+ /** MIME type; inferred from the extension when omitted. */
1460
+ readonly type: Schema.optionalKey<Schema.String>;
1461
+ /** Pixel width; 1200×630 (1.91:1) is the cross-platform safe default. */
1462
+ readonly width: Schema.optionalKey<Schema.Int>;
1463
+ /** Pixel height. */
1464
+ readonly height: Schema.optionalKey<Schema.Int>;
1465
+ /** Alt text; inferred (tagline → description → fallback) when omitted. */
1466
+ readonly alt: Schema.optionalKey<Schema.String>;
1467
+ }>>>;
1468
+ /** Embed accent color (e.g. Discord), a CSS color string. */
1469
+ readonly themeColor: Schema.optionalKey<Schema.String>;
1470
+ }>;
1471
+ /**
1472
+ * The decoded type of {@link (OpenGraphConfig:variable)}.
1473
+ *
1474
+ * @public
1475
+ */
1476
+ export type OpenGraphConfig = typeof OpenGraphConfig.Type;
1477
+ /**
1478
+ * A pointer to the bundle's SBOM, computed by the bundler at publish and
1479
+ * served as a downloadable static asset.
1480
+ *
1481
+ * @public
1482
+ */
1483
+ export declare const SbomRef: Schema.Struct<{
1484
+ /** Bundle-relative path to the SBOM file. */
1485
+ readonly path: Schema.String;
1486
+ /** SBOM format label, e.g. `"spdx-json"`. Unknown values are accepted. */
1487
+ readonly format: Schema.optionalKey<Schema.String>;
1488
+ }>;
1489
+ /**
1490
+ * The decoded type of {@link (SbomRef:variable)}.
1491
+ *
1492
+ * @public
1493
+ */
1494
+ export type SbomRef = typeof SbomRef.Type;
1495
+ /**
1496
+ * The inherited project tier, flattened into the emitted manifest by the
1497
+ * bundler (a fetched bundle has no parent directory to walk). Kept nested —
1498
+ * structurally distinguishable from the leaf fields — because provenance is
1499
+ * load-bearing for override detection.
1500
+ *
1501
+ * @public
1502
+ */
1503
+ export declare const ProjectIdentity: Schema.Struct<{
1504
+ /** The project display name, e.g. `"Effected"` over leaf `@effected/store`. */
1505
+ readonly name: Schema.optionalKey<Schema.String>;
1506
+ /** The project tagline. */
1507
+ readonly tagline: Schema.optionalKey<Schema.String>;
1508
+ }>;
1509
+ /**
1510
+ * The decoded type of {@link (ProjectIdentity:variable)}.
1511
+ *
1512
+ * @public
1513
+ */
1514
+ export type ProjectIdentity = typeof ProjectIdentity.Type;
1515
+ /**
1516
+ * The versioned `tsdoctor.json` sidecar manifest — bundle layer 3.
1517
+ *
1518
+ * @remarks
1519
+ * `spec` is the only required field; every other field enriches. Unknown
1520
+ * top-level fields are ignored on decode (additive fields are minor spec
1521
+ * revisions) and unknown enum-ish values (registry `type`, sbom `format`)
1522
+ * degrade gracefully instead of rejecting — an old reader must be able to
1523
+ * consume a new bundle.
1524
+ *
1525
+ * @public
1526
+ */
1527
+ export declare const BundleManifest: Schema.Struct<{
1528
+ /** The integer spec version. This reader understands spec 1. */
1529
+ readonly spec: Schema.Literal<1>;
1530
+ /** Human display name (the npm name is dry; this one is SEO-friendly). */
1531
+ readonly name: Schema.optionalKey<Schema.String>;
1532
+ /** Short tagline. */
1533
+ readonly tagline: Schema.optionalKey<Schema.String>;
1534
+ /** Long description; overrides the package.json description when present. */
1535
+ readonly description: Schema.optionalKey<Schema.String>;
1536
+ /** The inherited project tier, flattened in at emit time. */
1537
+ readonly project: Schema.optionalKey<Schema.Struct<{
1538
+ /** The project display name, e.g. `"Effected"` over leaf `@effected/store`. */
1539
+ readonly name: Schema.optionalKey<Schema.String>;
1540
+ /** The project tagline. */
1541
+ readonly tagline: Schema.optionalKey<Schema.String>;
1542
+ }>>;
1543
+ /** Open Graph assets. */
1544
+ readonly openGraph: Schema.optionalKey<Schema.Struct<{
1545
+ /** Declared images, first-wins per OG array semantics. */
1546
+ readonly images: Schema.optionalKey<Schema.$Array<Schema.Struct<{
1547
+ /** Bundle-relative asset path. Mutually exclusive with `url`. */
1548
+ readonly path: Schema.optionalKey<Schema.String>;
1549
+ /** Absolute external URL, used verbatim. Mutually exclusive with `path`. */
1550
+ readonly url: Schema.optionalKey<Schema.String>;
1551
+ /** MIME type; inferred from the extension when omitted. */
1552
+ readonly type: Schema.optionalKey<Schema.String>;
1553
+ /** Pixel width; 1200×630 (1.91:1) is the cross-platform safe default. */
1554
+ readonly width: Schema.optionalKey<Schema.Int>;
1555
+ /** Pixel height. */
1556
+ readonly height: Schema.optionalKey<Schema.Int>;
1557
+ /** Alt text; inferred (tagline → description → fallback) when omitted. */
1558
+ readonly alt: Schema.optionalKey<Schema.String>;
1559
+ }>>>;
1560
+ /** Embed accent color (e.g. Discord), a CSS color string. */
1561
+ readonly themeColor: Schema.optionalKey<Schema.String>;
1562
+ }>>;
1563
+ /** SBOM pointer. */
1564
+ readonly sbom: Schema.optionalKey<Schema.Struct<{
1565
+ /** Bundle-relative path to the SBOM file. */
1566
+ readonly path: Schema.String;
1567
+ /** SBOM format label, e.g. `"spdx-json"`. Unknown values are accepted. */
1568
+ readonly format: Schema.optionalKey<Schema.String>;
1569
+ }>>;
1570
+ /** Registries the package is published to. */
1571
+ readonly registries: Schema.optionalKey<Schema.$Array<Schema.Struct<{
1572
+ /** The protocol family, e.g. `"npm"` or `"jsr"`. Unknown values are accepted. */
1573
+ readonly type: Schema.String;
1574
+ /** The human instance label, e.g. `"npm"` or `"Savvy Web Registry"`. */
1575
+ readonly name: Schema.String;
1576
+ /** The package's URL on that registry instance. */
1577
+ readonly url: Schema.String;
1578
+ }>>>;
1579
+ }>;
1580
+ /**
1581
+ * The decoded type of {@link (BundleManifest:variable)}.
1582
+ *
1583
+ * @public
1584
+ */
1585
+ export type BundleManifest = typeof BundleManifest.Type;
1586
+ declare const BundleManifestError_base: Schema.Class<BundleManifestError, Schema.TaggedStruct<"BundleManifestError", {
1587
+ /** The manifest file path, when the failure is tied to a file on disk. */
1588
+ readonly path: Schema.optionalKey<Schema.String>;
1589
+ /** The underlying failure (JSON syntax or schema decode), preserved structurally. */
1590
+ readonly cause: Schema.Defect;
1591
+ }>, import("effect/Cause").YieldableError>;
1592
+ /**
1593
+ * Raised when a present `tsdoctor.json` cannot be parsed or does not satisfy
1594
+ * the {@link (BundleManifest:variable)} schema.
1595
+ *
1596
+ * @remarks
1597
+ * Absence of the manifest is NEVER this error — layers enrich, never gate,
1598
+ * so a missing sidecar is the normal case and reads as `Option.none()`.
1599
+ *
1600
+ * @public
1601
+ */
1602
+ export declare class BundleManifestError extends BundleManifestError_base {
1603
+ get message(): string;
1604
+ }
1605
+ /**
1606
+ * Decode an unknown value into a {@link (BundleManifest:type)}.
1607
+ *
1608
+ * @remarks
1609
+ * The typed boundary for manifest input that has already been parsed from
1610
+ * JSON (plugin options, fetched payloads). File-based reading lives in
1611
+ * `readBundle`, which routes through this after parsing.
1612
+ *
1613
+ * @public
1614
+ */
1615
+ export declare function decodeBundleManifest(input: unknown, path?: string): Effect.Effect<BundleManifest, BundleManifestError>;
1616
+ /**
1617
+ * The manifest spec version this package reads and writes.
1618
+ *
1619
+ * @public
1620
+ */
1621
+ export declare const MANIFEST_SPEC: 1;
1622
+ /**
1623
+ * The sidecar manifest's file name inside a bundle folder.
1624
+ *
1625
+ * @public
1626
+ */
1627
+ export declare const TSDOCTOR_MANIFEST_FILENAME = "tsdoctor.json";
1628
+ /**
1629
+ * Encode a {@link (BundleManifest:type)} into the JSON-ready value a writer
1630
+ * serializes as `tsdoctor.json`.
1631
+ *
1632
+ * @remarks
1633
+ * The writer's boundary. Going through the schema rather than
1634
+ * `JSON.stringify` means an emitted file is by construction what
1635
+ * {@link decodeBundleManifest} accepts.
1636
+ *
1637
+ * @public
1638
+ */
1639
+ export declare function encodeBundleManifest(manifest: BundleManifest): Effect.Effect<unknown, BundleManifestError>;
1640
+ /**
1641
+ * What an Open Graph image generator receives: the merged identity of the
1642
+ * package being built, after the config, leaf and project tiers resolved.
1643
+ *
1644
+ * @public
1645
+ */
1646
+ interface OgImageInfo {
1647
+ /** Display name — the merged `name`, falling back to the npm name. */
1648
+ readonly name: string;
1649
+ /** The npm package name. */
1650
+ readonly packageName: string;
1651
+ /** The emitted version (the optimistic next version when enabled). */
1652
+ readonly version: string;
1653
+ readonly tagline?: string | undefined;
1654
+ readonly description?: string | undefined;
1655
+ /** The inherited project tier, when the workspace root declares one. */
1656
+ readonly project?: {
1657
+ readonly name?: string | undefined;
1658
+ readonly tagline?: string | undefined;
1659
+ } | undefined;
1660
+ }
1661
+ /**
1662
+ * An `openGraph.generate` renderer. A renderer whose output is fully determined by its input can
1663
+ * carry its own `cacheSalt`, naming everything else that shapes the bytes (its version, its
1664
+ * options); that turns on the cross-build cache without any config. `ogImage.satori()` does.
1665
+ *
1666
+ * @public
1667
+ */
1668
+ interface OgImageGenerator {
1669
+ (info: OgImageInfo): Promise<Uint8Array>;
1670
+ readonly cacheSalt?: string | undefined;
1671
+ }
1672
+ /**
1673
+ * The `meta.tsdoctor` block: the CONFIG tier of the emitted `tsdoctor.json`,
1674
+ * ranked over the package's `tsdoctor.json` (leaf) and the workspace root's
1675
+ * (project).
1676
+ *
1677
+ * @public
1678
+ */
1679
+ interface TsdoctorMetaOptions {
1680
+ readonly name?: string | undefined;
1681
+ readonly tagline?: string | undefined;
1682
+ readonly description?: string | undefined;
1683
+ readonly openGraph?: {
1684
+ /** Static images, path (bundle-relative) or url. Listed after a generated image. */
1685
+ readonly images?: ReadonlyArray<OpenGraphImage> | undefined;
1686
+ readonly themeColor?: string | undefined;
1687
+ /** Render an image at build time; the bytes are written to `meta/og/<unscoped>.<png|jpg|webp>` and listed first. */
1688
+ readonly generate?: OgImageGenerator | undefined;
1689
+ /**
1690
+ * The cross-build image cache, keyed on the {@link OgImageInfo} plus this salt. A string
1691
+ * caches under it: change it whenever the generator's output changes for the same input,
1692
+ * since the cache cannot see code. `false` always regenerates. Omitted, the generator's own
1693
+ * {@link OgImageGenerator.cacheSalt} is used when it has one, otherwise it always regenerates.
1694
+ */
1695
+ readonly cacheSalt?: string | false | undefined;
1696
+ } | undefined;
1697
+ /** Registries; `false` disables the default derived from `targets.json`. */
1698
+ readonly registries?: ReadonlyArray<RegistryRef> | false | undefined;
1699
+ }
1700
+ /**
1701
+ * A single TSDoc tag definition (parity with api-extractor's TSDoc config).
1702
+ *
1703
+ * @public
1704
+ */
1705
+ interface TsdocTagDefinition {
1706
+ readonly tagName: string;
1707
+ readonly syntaxKind: "block" | "inline" | "modifier";
1708
+ readonly allowMultiple?: boolean | undefined;
1709
+ }
1710
+ /**
1711
+ * An api-extractor message-suppression rule. messageId is exact-matched; pattern (regex or substring) is matched against the text. A rule with both needs both to match.
1712
+ *
1713
+ * @public
1714
+ */
1715
+ interface WarningSuppressionRule {
1716
+ readonly messageId?: string | undefined;
1717
+ readonly pattern?: string | undefined;
1718
+ }
1719
+ /**
1720
+ * TSDoc / doc-warning configuration. suppressWarnings is doc functionality, so it lives here.
1721
+ *
1722
+ * @public
1723
+ */
1724
+ interface TsdocOptions {
1725
+ readonly suppressWarnings?: ReadonlyArray<WarningSuppressionRule> | undefined;
1726
+ readonly tagDefinitions?: ReadonlyArray<TsdocTagDefinition> | undefined;
1727
+ }
1728
+ /**
1729
+ * The `meta` field on defineBuild. Absent means no api-model generation.
1730
+ *
1731
+ * @public
1732
+ */
1733
+ interface MetaOptions {
1734
+ /** Directories to copy the canonical group's api-model into after `savvy build --target prod`. */
1735
+ readonly localPaths?: ReadonlyArray<string> | undefined;
1736
+ /**
1737
+ * Forward-look the meta bundle's own `version` and workspace-sibling dep versions to their
1738
+ * NEXT release version from pending changesets. `"auto"` (default) is `false` under CI
1739
+ * (`CI`/`GITHUB_ACTIONS` set) and `true` locally, so a local bundle matches the CI release build.
1740
+ */
1741
+ readonly optimistic?: "auto" | boolean | undefined;
1742
+ readonly tsdoc?: TsdocOptions | undefined;
1743
+ /**
1744
+ * The CONFIG tier of the emitted `tsdoctor.json` sidecar (ranked over the package's and the
1745
+ * workspace root's `tsdoctor.json` source files) and the optional build-time Open Graph image.
1746
+ * The project tier is found through workspace discovery, which requires the workspace root's
1747
+ * `package.json` to declare a `version`; without one, discovery fails silently and no `project`
1748
+ * tier is emitted.
1749
+ */
1750
+ readonly tsdoctor?: TsdoctorMetaOptions | undefined;
1751
+ }
1752
+ /**
1753
+ * Fully-resolved meta options (no optionals).
1754
+ *
1755
+ * @public
1756
+ */
1757
+ interface NormalizedMeta {
1758
+ readonly localPaths: ReadonlyArray<string>;
1759
+ readonly optimistic: boolean;
1760
+ readonly tsdoc: {
1761
+ readonly suppressWarnings: ReadonlyArray<WarningSuppressionRule>;
1762
+ readonly tagDefinitions: ReadonlyArray<TsdocTagDefinition>;
1763
+ };
1764
+ /** Passed through verbatim; `undefined` means no config tier (the source tiers still apply). */
1765
+ readonly tsdoctor: TsdoctorMetaOptions | undefined;
1766
+ }
1767
+ /**
1768
+ * Fill defaults so downstream code never branches on undefined.
1769
+ *
1770
+ * @public
1771
+ */
1772
+ export declare function normalizeMetaOptions(meta: MetaOptions, env?: {
1773
+ CI?: string | undefined;
1774
+ GITHUB_ACTIONS?: string | undefined;
1775
+ }): NormalizedMeta;
1776
+ /**
1777
+ * The shape an author checks in as a `tsdoctor.json` SOURCE file, at a
1778
+ * package root (the leaf tier) or a workspace root (the project tier).
1779
+ *
1780
+ * @remarks
1781
+ * `BundleManifest` minus `spec` and `project`: a source file never declares
1782
+ * its own spec version, and it never declares its inherited tier — the
1783
+ * bundler supplies both when it flattens the hierarchy at emit time. Decoded
1784
+ * only by writers; readers never see this shape.
1785
+ *
1786
+ * @public
1787
+ */
1788
+ export declare const ManifestSource: Schema.Struct<{
1789
+ readonly name: Schema.optionalKey<Schema.String>;
1790
+ readonly tagline: Schema.optionalKey<Schema.String>;
1791
+ readonly description: Schema.optionalKey<Schema.String>;
1792
+ readonly openGraph: Schema.optionalKey<Schema.Struct<{
1793
+ readonly images: Schema.optionalKey<Schema.$Array<Schema.Struct<{
1794
+ readonly path: Schema.optionalKey<Schema.String>;
1795
+ readonly url: Schema.optionalKey<Schema.String>;
1796
+ readonly type: Schema.optionalKey<Schema.String>;
1797
+ readonly width: Schema.optionalKey<Schema.Int>;
1798
+ readonly height: Schema.optionalKey<Schema.Int>;
1799
+ readonly alt: Schema.optionalKey<Schema.String>;
1800
+ }>>>;
1801
+ readonly themeColor: Schema.optionalKey<Schema.String>;
1802
+ }>>;
1803
+ readonly sbom: Schema.optionalKey<Schema.Struct<{
1804
+ readonly path: Schema.String;
1805
+ readonly format: Schema.optionalKey<Schema.String>;
1806
+ }>>;
1807
+ readonly registries: Schema.optionalKey<Schema.$Array<Schema.Struct<{
1808
+ readonly type: Schema.String;
1809
+ readonly name: Schema.String;
1810
+ readonly url: Schema.String;
1811
+ }>>>;
1812
+ }>;
1813
+ /**
1814
+ * The decoded type of {@link (ManifestSource:variable)}.
1815
+ *
1816
+ * @public
1817
+ */
1818
+ export type ManifestSource = typeof ManifestSource.Type;
1819
+ /**
1820
+ * Decode an unknown value into a {@link (ManifestSource:type)}.
1821
+ *
1822
+ * @public
1823
+ */
1824
+ export declare function decodeManifestSource(input: unknown, path?: string): Effect.Effect<ManifestSource, BundleManifestError>;
1825
+ /**
1826
+ * A `targets.json` target as the manifest composer sees it: the human label and the registry endpoint.
1827
+ *
1828
+ * @public
1829
+ */
1830
+ interface ManifestTarget {
1831
+ readonly name: string;
1832
+ readonly registry: string;
1833
+ }
1834
+ /**
1835
+ * Everything {@link composeTsdoctorManifest} needs: the three authoring tiers plus the build facts
1836
+ * that derive the rest.
1837
+ *
1838
+ * @public
1839
+ */
1840
+ interface ComposeManifestInput {
1841
+ readonly config: TsdoctorMetaOptions | undefined;
1842
+ readonly leaf: ManifestSource | undefined;
1843
+ readonly project: ManifestSource | undefined;
1844
+ readonly packageName: string;
1845
+ readonly isPrivate: boolean;
1846
+ /** `targets.json` targets for the group being emitted. */
1847
+ readonly targets: ReadonlyArray<ManifestTarget>;
1848
+ /** The image `og-image.ts` wrote, already sized. */
1849
+ readonly generatedImage: OpenGraphImage | undefined;
1850
+ /** The emitted manifest's `repository` field; a GitHub Packages target derives its page URL from it. */
1851
+ readonly repository?: ManifestRepository | undefined;
1852
+ }
1853
+ /**
1854
+ * The `repository` field of the emitted `package.json`, as far as the manifest composer reads it.
1855
+ *
1856
+ * @public
1857
+ */
1858
+ interface ManifestRepository {
1859
+ readonly url: string;
1860
+ readonly directory?: string | undefined;
1861
+ }
1862
+ /**
1863
+ * `owner/repo` from any of the GitHub URL spellings a `repository.url` carries (https, `git+https`,
1864
+ * `git@`, `ssh://`, `git://`, the `github:` shorthand), or `undefined` for anything else.
1865
+ *
1866
+ * @public
1867
+ */
1868
+ export declare function githubOwnerRepo(url: string): {
1869
+ readonly owner: string;
1870
+ readonly repo: string;
1871
+ } | undefined;
1872
+ /**
1873
+ * Derive the registries block from the build's targets. Only for a public
1874
+ * package: a private one is published nowhere.
1875
+ *
1876
+ * @public
1877
+ */
1878
+ export declare function registriesFromTargets(input: Pick<ComposeManifestInput, "targets" | "packageName" | "isPrivate" | "repository">): ReadonlyArray<RegistryRef>;
1879
+ /**
1880
+ * Flatten the three authoring tiers into the emitted manifest. Pure.
1881
+ *
1882
+ * @remarks
1883
+ * Config beats leaf beats project per FIELD; the project tier is emitted
1884
+ * nested, never flattened, because the consumer's provenance ranking depends
1885
+ * on telling the tiers apart. Returns `undefined` when there is nothing to
1886
+ * say, so a package with no metadata emits no file. An `sbom` pointer is
1887
+ * never written here — the release action upserts it at publish.
1888
+ *
1889
+ * @public
1890
+ */
1891
+ export declare function composeTsdoctorManifest(input: ComposeManifestInput): BundleManifest | undefined;
1892
+ /**
1893
+ * What the generator sees. Built from the same tiers as the manifest.
1894
+ *
1895
+ * @public
1896
+ */
1897
+ export declare function ogImageInfoOf(input: ComposeManifestInput & {
1898
+ readonly version: string;
1899
+ }): OgImageInfo;
1900
+ /** @public */
1901
+ interface GenerateMetaOptions {
1902
+ readonly cwd: string;
1903
+ readonly packageName: string;
1904
+ /** Resolved tsconfig (from writeResolvedTsconfig) for the api-extractor compiler. */
1905
+ readonly tsconfigPath: string;
1906
+ /** Directory holding the tsdown-emitted per-file .d.ts (e.g. dist/prod/npm/pkg). */
1907
+ readonly dtsDir: string;
1908
+ /**
1909
+ * Per-module declarations dir used ONLY for a second, diagnostics-only API Extractor run that
1910
+ * resolves accurate per-file source locations. The shipped api-model is still produced from
1911
+ * `dtsDir` (the bundled dts), so it is unchanged. When omitted or equal to `dtsDir`, a single
1912
+ * run over `dtsDir` produces both model and diagnostics (legacy behavior).
1913
+ */
1914
+ readonly aeInputDir?: string | undefined;
1915
+ /** Map of entry name to the .d.ts basename (without extension) inside dtsDir. */
1916
+ readonly entries: Record<string, string>;
1917
+ /** Map of entry name to its export path (".", "./sub"). */
1918
+ readonly exportPaths: Record<string, string>;
1919
+ /** Where to write the meta bundle (.api.json + package.json + tsconfig.json). */
1920
+ readonly outMetaDir: string;
1921
+ /** Directories (relative to cwd) to copy the meta bundle into. */
1922
+ readonly localPaths: ReadonlyArray<string>;
1923
+ readonly tsdoc: NormalizedMeta["tsdoc"];
1924
+ /**
1925
+ * Optional transform applied to the bundle `package.json` (read from `dtsDir`) before it is
1926
+ * written to `outMetaDir` and copied into `localPaths`. Used for the optimistic next-version
1927
+ * rewrite. When omitted, the package.json is copied verbatim.
1928
+ */
1929
+ readonly manifestTransform?: ((pkg: Record<string, unknown>) => Record<string, unknown>) | undefined;
1930
+ /** When set, API Extractor warnings/errors are routed here (and suppressed from console). */
1931
+ readonly onMessage?: ((entry: DiagnosticInput) => void) | undefined;
1932
+ /** When true (CI), forgotten exports become a hard build error. */
1933
+ readonly ci?: boolean | undefined;
1934
+ /** When set, messages matched by `suppressWarnings` are routed here for accounting. */
1935
+ readonly onSuppressed?: ((entry: DiagnosticInput) => void) | undefined;
1936
+ /**
1937
+ * The `tsdoctor.json` sidecar inputs: the config tier, the two source tiers, and the targets bound
1938
+ * to this group (registries derive from them). Omitted means no sidecar and no Open Graph image.
1939
+ */
1940
+ readonly tsdoctor?: {
1941
+ readonly config: TsdoctorMetaOptions | undefined;
1942
+ readonly leaf: ManifestSource | undefined;
1943
+ readonly project: ManifestSource | undefined;
1944
+ readonly targets: ReadonlyArray<ManifestTarget>;
1945
+ } | undefined;
1946
+ }
1947
+ /** @public */
1948
+ interface MetaResult {
1949
+ readonly apiJsonPath: string;
1950
+ readonly apiJsonFilename: string;
1951
+ }
1952
+ declare const TsdoctorSourceError_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 & {
1953
+ readonly _tag: "TsdoctorSourceError";
1954
+ } & Readonly<A>;
1955
+ /**
1956
+ * A present `tsdoctor.json` source file that could not be parsed or decoded. Absence is never
1957
+ * this error — a missing source tier is the normal case.
1958
+ *
1959
+ * @public
1960
+ */
1961
+ export declare class TsdoctorSourceError extends TsdoctorSourceError_base<{
1962
+ readonly path: string;
1963
+ readonly cause: unknown;
1964
+ }> {
1965
+ get message(): string;
1966
+ }
1967
+ /**
1968
+ * The two source tiers a build reads: the package's own file and the workspace root's.
1969
+ *
1970
+ * @public
1971
+ */
1972
+ interface TsdoctorSources {
1973
+ readonly leaf: ManifestSource | undefined;
1974
+ readonly project: ManifestSource | undefined;
1975
+ /**
1976
+ * Why workspace discovery failed, when it did. The project tier is then unknown rather than
1977
+ * absent; `runMetaPass` records it as a `meta` warning so the degradation is visible in `issues.json`.
1978
+ */
1979
+ readonly discoveryFailure?: string | undefined;
1980
+ }
1981
+ /**
1982
+ * Read the leaf (`<cwd>/tsdoctor.json`) and project (`<workspaceRoot>/tsdoctor.json`)
1983
+ * source tiers. Absence is normal; a present file that does not decode throws
1984
+ * {@link TsdoctorSourceError}. A package that IS the workspace root reads its file once, as the
1985
+ * leaf, and has no project tier.
1986
+ *
1987
+ * @public
1988
+ */
1989
+ export declare function loadTsdoctorSources(cwd: string): Promise<TsdoctorSources>;
1990
+ /**
1991
+ * Options for the meta-pass orchestrator.
1992
+ *
1993
+ * @public
1994
+ */
1995
+ interface RunMetaPassOptions {
1996
+ readonly cwd: string;
1997
+ readonly packageName: string;
1998
+ readonly tsconfigPath: string;
1999
+ readonly groups: ReadonlyArray<{
2000
+ id: string;
2001
+ name: string;
2002
+ }>;
2003
+ readonly entries: Record<string, string>;
2004
+ readonly exportsMap: Record<string, string> | undefined;
2005
+ readonly overrides?: ReadonlyArray<{
2006
+ entries: ReadonlyArray<string>;
2007
+ outSubdir?: string | undefined;
2008
+ }> | undefined;
2009
+ readonly meta: MetaOptions;
2010
+ readonly collector: BuildCollector;
2011
+ readonly ci: boolean;
2012
+ /** Injectable for tests; defaults to the real generateMeta. */
2013
+ readonly generateMeta?: (o: GenerateMetaOptions) => Promise<MetaResult>;
2014
+ /** Injectable for tests; defaults to the real resolveNextVersions. Only called when optimistic. */
2015
+ readonly resolveNextVersions?: (cwd: string) => Promise<{
2016
+ versions: ReadonlyMap<string, string>;
2017
+ }>;
2018
+ /**
2019
+ * The resolved `targets.json` targets; each group's `tsdoctor.json` derives its registries from the
2020
+ * targets bound to that group. Omitted (an escape-hatch build with no resolution) means none.
2021
+ */
2022
+ readonly targets?: ReadonlyArray<{
2023
+ group: string;
2024
+ id: string;
2025
+ registry: string;
2026
+ }> | undefined;
2027
+ /** Injectable for tests; defaults to the real loadTsdoctorSources. */
2028
+ readonly loadTsdoctorSources?: (cwd: string) => Promise<TsdoctorSources>;
2029
+ }
2030
+ /** @public */
2031
+ type Json = Record<string, unknown>;
2032
+ /**
2033
+ * Which exports get a CJS `require` condition. `true`/`false` apply uniformly to every
2034
+ * TS export; a Set marks ONLY the listed export keys (e.g. "./changesets/markdownlint")
2035
+ * as dual — used by per-entry format overrides.
2036
+ * @public
2037
+ */
2038
+ type DualExports = boolean | ReadonlySet<string>;
2039
+ /**
2040
+ * The default `transform` applied to every package's manifest when its
2041
+ * build config does not provide one of its own. Strips the build/dev-only
2042
+ * fields in `NON_PUBLISHED_FIELDS` from the emitted package.json.
2043
+ *
2044
+ * This is the pattern nearly every package repeated by hand (inherited from
2045
+ * rslib-builder); `defineBuild` now applies it automatically so a package needs a
2046
+ * `transform` only when it has genuinely custom manifest work to do (e.g. silk
2047
+ * promoting workspace deps to peerDependencies). A custom transform REPLACES this
2048
+ * default — re-export it and call it from a custom transform to keep the stripping.
2049
+ *
2050
+ * `targetGroup` is accepted (so this is assignable wherever the full transform
2051
+ * signature is expected) but unused; the strip is identical for every group.
2052
+ *
2053
+ * `options.drop` names further top-level keys (for example `dependencies`) to delete after the
2054
+ * standard stripping.
2055
+ *
2056
+ * Pure: the supplied `pkg` is NOT mutated — a shallow copy with the fields removed
2057
+ * is returned, so external callers invoking this from a custom transform keep their
2058
+ * input intact.
2059
+ * @public
2060
+ */
2061
+ export declare function defaultManifestTransform({ pkg }: {
2062
+ pkg: Json;
2063
+ }, options?: {
2064
+ readonly drop?: ReadonlyArray<string> | undefined;
2065
+ }): Json;
2066
+ /**
2067
+ * Describes a SEA binary the bundler compiled for this package. When present,
2068
+ * {@link transformManifest} rewrites every `exports`/`bin` value equal to `source`
2069
+ * to the emitted binary path and adds it to `files` so it ships in the tarball.
2070
+ * @public
2071
+ */
2072
+ interface ExeRewrite {
2073
+ /** The exe entry source path (matches exports/bin values to rewrite). */
2074
+ readonly source: string;
2075
+ /** The emitted SEA filename (already suffixed, incl. .exe on win). */
2076
+ readonly fileName: string;
2077
+ /** Relative dir the binary is emitted into (e.g. "bin"). */
2078
+ readonly dir: string;
2079
+ }
2080
+ /**
2081
+ * Rewrite an exports map: TS string targets become a types/import conditions object.
2082
+ * Each TS condition also gets a `require` entry when `dual` is `true` (uniform) or when
2083
+ * the export key is in the `dual` Set (per-entry).
2084
+ *
2085
+ * The output path is derived from the export KEY via the shared entry-name function,
2086
+ * never from the source path, so the manifest target always matches the emitted file.
2087
+ *
2088
+ * Export keys in `subdirExports` are built into an isolated `<key>/index.*` subdir (e.g. an
2089
+ * RSPress `./runtime`), so their conditions gain an `/index` segment.
2090
+ *
2091
+ * `emitDts` gates the `types` condition on every GENERATED (non-ambient) TS export: pass `false`
2092
+ * when the build's dts pass was skipped (issue #198) so the manifest does not point at a `.d.ts`
2093
+ * that was never written. Defaults to `true`. Ambient `.d.ts` exports (hand-authored, copied
2094
+ * verbatim regardless of the dts pass) are unaffected — their `types` condition is always kept.
2095
+ *
2096
+ * A condition-object value whose flat `import`/`default`/`types` conditions all name one TS source
2097
+ * (`"./foo": { "import": "./src/foo.ts" }`) is rewritten like the bare string, named after the export
2098
+ * key as the entry pass names it. Any other condition object holding a TS source throws
2099
+ * {@link ConfigValidationError}, since its targets would never be built; one holding none passes
2100
+ * through as authored.
2101
+ *
2102
+ * A subpath target written as the built path, `./dist/foo.js`, is a build source too: the entry pass
2103
+ * builds it from `./src/foo.ts` and names the output after the export key, so it is rewritten exactly
2104
+ * as `./src/foo.ts` would be. A build source holding a `*` (`./dist/*.js`, `./src/*.ts`) throws
2105
+ * {@link ConfigValidationError}, since the build emits one entry per key from one literal source.
2106
+ * @public
2107
+ */
2108
+ export declare function transformExports(exports: unknown, dual?: DualExports, subdirExports?: ReadonlySet<string>, emitDts?: boolean): unknown;
2109
+ /**
2110
+ * Rewrite bin: TS targets, and `./dist/*.js` targets the entry pass builds from `./src/*.ts`, to
2111
+ * bin/[command].js (string to bin/cli.js); strip leading ./ otherwise.
2112
+ *
2113
+ * @public
2114
+ */
2115
+ export declare function transformBin(bin: unknown): unknown;
2116
+ /**
2117
+ * FINAL guard: strip leading ./ from bin paths (npm 11.x drops ./-prefixed bins).
2118
+ *
2119
+ * @public
2120
+ */
2121
+ export declare function normalizeBinPaths(bin: unknown): unknown;
2122
+ /** @public */
2123
+ interface TransformManifestOptions {
2124
+ /** Run after the standard transforms, before the bin final-guard + sort. */
2125
+ readonly transform?: ((pkg: Json) => Json) | undefined;
2126
+ /** Which exports emit dual import/require conditions. boolean = uniform; Set = per-export-key. */
2127
+ readonly dual?: DualExports | undefined;
2128
+ /** Export keys built into a `<key>/index.*` subdir (e.g. an RSPress `./runtime`). */
2129
+ readonly subdirExports?: ReadonlySet<string> | undefined;
2130
+ /** When set, rewrite exports/bin values equal to `source` to the SEA path and add it to `files`. */
2131
+ readonly exeRewrite?: ExeRewrite | undefined;
2132
+ /**
2133
+ * Whether the build's dts pass ran. `false` omits the `types` condition from generated (non-
2134
+ * ambient) TS exports — the manifest must not point at a `.d.ts` that was never written
2135
+ * (issue #198). Defaults to `true`.
2136
+ */
2137
+ readonly emitDts?: boolean | undefined;
2138
+ }
2139
+ /**
2140
+ * Apply the full standard manifest transform (excluding catalog resolution, done upstream).
2141
+ *
2142
+ * @public
2143
+ */
2144
+ export declare function transformManifest(pkg: Json, options?: TransformManifestOptions): Json;
2145
+ /**
2146
+ * A build group id: "dev" or any prod byte-variant id (e.g. "npm", "github", a custom key).
2147
+ *
2148
+ * @public
2149
+ */
2150
+ type TargetGroupId = string;
2151
+ /**
2152
+ * An output module format the build can emit.
2153
+ *
2154
+ * @public
2155
+ */
2156
+ type BuildFormat$1 = "esm" | "cjs";
2157
+ /**
2158
+ * Bundling platform for the JS pass. Defaults to "node". Use "browser" for web runtime partitions.
2159
+ *
2160
+ * @public
2161
+ */
2162
+ type BuildPlatform$1 = "node" | "browser" | "neutral";
2163
+ /**
2164
+ * A prod/dev group to build: its folder id and the resolved package name its manifest carries.
2165
+ *
2166
+ * @public
2167
+ */
2168
+ interface BuildGroupSpec {
2169
+ readonly id: TargetGroupId;
2170
+ readonly name: string;
2171
+ }
2172
+ /** @public */
2173
+ interface DeriveOptions {
2174
+ readonly group: TargetGroupId;
2175
+ readonly cwd: string;
2176
+ readonly version: string;
2177
+ readonly entry: Record<string, string>;
2178
+ readonly tsconfigPath: string;
2179
+ readonly devManifest: "preserve" | "resolve";
2180
+ readonly externals?: ReadonlyArray<string>;
2181
+ /** JS-pass platform. Defaults to "node"; set "browser" for an RSPress runtime partition. */
2182
+ readonly platform?: BuildPlatform$1 | undefined;
2183
+ /** Output formats to emit. Defaults to esm-only when unset. */
2184
+ readonly format?: ReadonlyArray<BuildFormat$1> | undefined;
2185
+ /** Minify prod output (prod groups only; dev is never minified). Defaults to false. */
2186
+ readonly minify?: boolean | undefined;
2187
+ /**
2188
+ * Compile-time global replacements forwarded to the build `define`. Merged AFTER the
2189
+ * auto-injected `process.env.__PACKAGE_VERSION__` so a user key of the same name wins.
2190
+ * Values are inserted verbatim (string literals must already be quoted).
2191
+ */
2192
+ readonly define?: Record<string, string> | undefined;
2193
+ /**
2194
+ * External packages whose declarations should be INLINED into the bundled dts
2195
+ * (the rslib `dtsBundledPackages` equivalent). Maps to tsdown's `deps.onlyBundle`
2196
+ * in the dts pass, so ONLY these node_modules packages are rolled into the
2197
+ * `.d.ts` and every other dependency stays an external `import`. dts-pass-only:
2198
+ * runtime JS bundling is unaffected.
2199
+ */
2200
+ readonly bundledPackages?: ReadonlyArray<string> | undefined;
2201
+ /**
2202
+ * Force-bundle node_modules (and workspace) JS dependencies into the JS pass.
2203
+ * Consumed here ONLY to decide the JS pass's `unbundle` posture — see
2204
+ * {@link DerivedTsdownOptions.unbundle} — which is the whole of its effect: tsdown
2205
+ * already bundles anything the manifest does not declare as a production dependency,
2206
+ * so no `deps` flag is needed to force it.
2207
+ */
2208
+ readonly bundleNodeModules?: boolean | undefined;
2209
+ }
2210
+ /**
2211
+ * The JS pass: per-module JavaScript, no declarations.
2212
+ *
2213
+ * The build runs TWO tsdown passes per TargetGroup to the SAME outDir:
2214
+ * - pass 1 (this) emits per-module JS (`unbundle: true`) with `dts: false` and the
2215
+ * default `clean: true`, so it starts from a fresh outDir;
2216
+ * - pass 2 (`DerivedDtsPassOptions`) emits ONLY bundled declarations (`unbundle: false`,
2217
+ * `dts: { emitDtsOnly: true }`) with `clean: false`, so it must NOT wipe pass 1.
2218
+ *
2219
+ * We cannot do this in a single pass: tsdown's `unbundle` maps to rolldown
2220
+ * `output.preserveModules` for the WHOLE build, and the dts plugin shares it — so one pass
2221
+ * gives EITHER per-module JS + per-module dts OR bundled JS + bundled dts. Per-module dts
2222
+ * breaks type portability (TS2883) when a package exports only its root entry, and bundling
2223
+ * the JS re-bundles workspace consumers (e.g. silk re-bundling silk-effects crashes at
2224
+ * runtime). The split keeps per-module JS (no re-bundle hazard) AND bundled, self-contained
2225
+ * declarations (no TS2883).
2226
+ *
2227
+ * **`unbundle` flips to `false` when `bundleNodeModules` is set.** `bundleNodeModules: true`
2228
+ * exists to produce a genuinely self-contained artifact (its own TSDoc already promises this),
2229
+ * but `preserveModules` (the per-module JS pass) writes every inlined node_modules dependency
2230
+ * out to its OWN sibling file, mirroring its `node_modules/.pnpm/...` (or workspace) path
2231
+ * relative to the package root — for BOTH esm and cjs. `npm pack` unconditionally strips any
2232
+ * directory literally named `node_modules` from the published tarball, so an esm entry built
2233
+ * this way throws `Cannot find module '.../node_modules/.pnpm/.../foo.js'` once packed and
2234
+ * installed (the cjs sibling accidentally escapes this: tsdown's own dts pass, which always
2235
+ * runs `unbundle: false`, re-emits and overwrites a dual-format build's `.cjs` JS chunk as a
2236
+ * side effect of emitting `.d.cts` — see the dts-pass rebuild note in `buildTargetGroups` — so
2237
+ * only the esm artifact keeps the broken preserveModules layout). Turning `unbundle` off for
2238
+ * the JS pass whenever `bundleNodeModules` is requested makes BOTH formats bundle into one
2239
+ * self-contained file, matching what the flag already promises and what the cjs side already
2240
+ * does by accident. Scoped to `bundleNodeModules` alone: every other build keeps the default
2241
+ * per-module dev-friendly layout unchanged.
2242
+ * @public
2243
+ */
2244
+ interface DerivedTsdownOptions {
2245
+ readonly outDir: string;
2246
+ readonly sourcemap: boolean;
2247
+ readonly minify: boolean;
2248
+ readonly format: ReadonlyArray<BuildFormat$1>;
2249
+ /** `false` only when `bundleNodeModules` is set — see the interface TSDoc above. */
2250
+ readonly unbundle: boolean;
2251
+ /** JS pass starts fresh; it owns the outDir before the dts pass appends to it. */
2252
+ readonly clean: true;
2253
+ readonly platform: BuildPlatform$1;
2254
+ /**
2255
+ * Controls output file extensions. Always false for this builder.
2256
+ *
2257
+ * tsdown 0.22.2 finding (verified by running a real esm+cjs build of a type:module package):
2258
+ * - With fixedExtension: false, tsdown emits ESM index.js plus CJS index.cjs for a
2259
+ * type:module package in the JS pass. There is no collision: tsdown derives the .js
2260
+ * extension for ESM and the .cjs extension for CJS automatically. An earlier M1.1 note
2261
+ * claimed the two formats collide on ambient .js under fixedExtension: false; that claim
2262
+ * was wrong and is corrected here.
2263
+ * - This .js plus .cjs scheme is the one we want. It matches the rslib parity target, where
2264
+ * silk's dual-format output uses import: .js, require: .cjs, and a single types: .d.ts, and
2265
+ * it matches the flat manifest the emit-manifest transform writes.
2266
+ * - Setting fixedExtension: true would instead yield .mjs plus .cjs (and .d.mts plus .d.cts),
2267
+ * which is NOT wanted, so dual-format needs no fixedExtension change and we leave it false.
2268
+ * - The matching `.d.ts` / `.d.cts` declarations are emitted by the SEPARATE dts pass (see
2269
+ * `DerivedDtsPassOptions`), which keeps `unbundle: false` so the declarations are rolled up.
2270
+ */
2271
+ readonly fixedExtension: false;
2272
+ readonly entry: Record<string, string>;
2273
+ /** JS pass emits no declarations; the dts pass owns them. */
2274
+ readonly dts: false;
2275
+ readonly define: Record<string, string>;
2276
+ readonly isProd: boolean;
2277
+ /**
2278
+ * CJS named-export interop, the equivalent of rslib's cjsInterop: true. This is the real
2279
+ * tsdown option name, so it threads straight to the build with no rename.
2280
+ *
2281
+ * tsdown 0.22.2 finding (verified against the dist Options dts plus the build source):
2282
+ * - cjsDefault is a top-level boolean, default true. The build maps it to rolldown's
2283
+ * output.exports: cjsDefault ? "auto" : "named", and also silences the MIXED_EXPORT
2284
+ * warning. With "auto", a module whose only default-style export is a single default
2285
+ * becomes module.exports = value, while named exports stay attached, so a require() call
2286
+ * returns the value directly and named exports survive, the interop rslib gives with
2287
+ * cjsInterop: true.
2288
+ * - We only set it (to true) when cjs is in the format, so esm-only builds leave the tsdown
2289
+ * default untouched and stay byte-identical to before.
2290
+ */
2291
+ readonly cjsDefault?: boolean | undefined;
2292
+ }
2293
+ /**
2294
+ * The dts pass: bundled (rolled-up, self-contained) declarations only, no JS.
2295
+ *
2296
+ * Appended to the SAME outDir as the JS pass, so `clean` MUST be false (otherwise it wipes
2297
+ * the per-module JS the JS pass just wrote). `unbundle: false` makes rolldown roll the
2298
+ * declarations up per public entry, so a type re-exported through the root entry lands inline
2299
+ * in `index.d.ts` (fixing TS2883) instead of as a per-module sibling `.d.ts`.
2300
+ * `dts: { emitDtsOnly: true }` strips the JS chunks this pass would otherwise produce.
2301
+ *
2302
+ * Dual format: when `format` includes `cjs`, the dts pass still emits both `index.d.ts` (esm)
2303
+ * and `index.d.cts` (cjs) to the shared outDir.
2304
+ *
2305
+ * @public
2306
+ */
2307
+ interface DerivedDtsPassOptions {
2308
+ readonly outDir: string;
2309
+ readonly sourcemap: false;
2310
+ readonly format: ReadonlyArray<BuildFormat$1>;
2311
+ readonly unbundle: false;
2312
+ readonly clean: false;
2313
+ readonly platform: "node";
2314
+ readonly fixedExtension: false;
2315
+ readonly entry: Record<string, string>;
2316
+ readonly dts: DtsPassDtsOptions;
2317
+ readonly define: Record<string, string>;
2318
+ readonly isProd: boolean;
2319
+ /** External packages to inline into the bundled dts (tsdown `deps.onlyBundle`). */
2320
+ readonly bundledPackages?: ReadonlyArray<string> | undefined;
2321
+ }
2322
+ /**
2323
+ * The `dts` block both declaration passes hand to tsdown.
2324
+ *
2325
+ * The generator is pinned to `"tsgo"` — the TypeScript 7.1 declaration-emit API — and the
2326
+ * TypeScript module is named explicitly via `tsgo.moduleUrl`, resolved from THIS package's own
2327
+ * `typescript` dependency. rolldown-plugin-dts' auto-detection only inspects whatever
2328
+ * `typescript` it can reach from its own location, which in a consumer workspace may be a
2329
+ * hoisted copy with no API (TypeScript 7.0's main export is a version stub); naming the module
2330
+ * makes the pass resolve the same compiler in every install topology.
2331
+ *
2332
+ * @public
2333
+ */
2334
+ interface DtsPassDtsOptions {
2335
+ readonly tsconfig: string;
2336
+ readonly emitDtsOnly: true;
2337
+ readonly generator: "tsgo";
2338
+ readonly tsgo: {
2339
+ readonly moduleUrl: string;
2340
+ };
2341
+ }
2342
+ /**
2343
+ * Build the {@link DtsPassDtsOptions} for a resolved tsconfig path.
2344
+ *
2345
+ * @public
2346
+ */
2347
+ export declare const dtsPassDtsOptions: (tsconfig: string) => DtsPassDtsOptions;
2348
+ /**
2349
+ * The output dir for a group: `dist/prod/\<group\>/pkg`, or `dist/dev/pkg` for the unused dev group.
2350
+ *
2351
+ * @public
2352
+ */
2353
+ export declare const outDirFor: (cwd: string, group: TargetGroupId) => string;
2354
+ /**
2355
+ * Per-module declarations dir for a prod group: a sibling of `pkg/`, NOT published, used only as
2356
+ * API Extractor's diagnostics-run input so locations resolve to per-file source. Kept (not stripped)
2357
+ * as a cacheable, inspectable build artifact (issue #162).
2358
+ *
2359
+ * @public
2360
+ */
2361
+ export declare const declarationsDirFor: (cwd: string, group: TargetGroupId) => string;
2362
+ /**
2363
+ * Derive the JS-pass tsdown options for one TargetGroup (per-module JS, no dts).
2364
+ *
2365
+ * @public
2366
+ */
2367
+ export declare function deriveTargetGroupOptions(options: DeriveOptions): DerivedTsdownOptions;
2368
+ /**
2369
+ * Derive the dts-pass tsdown options for one TargetGroup (bundled declarations only).
2370
+ *
2371
+ * @public
2372
+ */
2373
+ export declare function deriveDtsPassOptions(options: DeriveOptions): DerivedDtsPassOptions;
2374
+ /** @internal */
2375
+ interface DerivedDeclarationsPassOptions {
2376
+ readonly outDir: string;
2377
+ readonly sourcemap: false;
2378
+ readonly format: ReadonlyArray<BuildFormat$1>;
2379
+ readonly unbundle: true;
2380
+ readonly platform: "node";
2381
+ readonly fixedExtension: false;
2382
+ readonly entry: Record<string, string>;
2383
+ readonly dts: DtsPassDtsOptions;
2384
+ readonly define: Record<string, string>;
2385
+ readonly bundledPackages?: ReadonlyArray<string> | undefined;
2386
+ }
2387
+ /**
2388
+ * Derive the per-module declarations pass (API Extractor diagnostics input). Mirrors
2389
+ * {@link deriveDtsPassOptions} but `unbundle: true` (preserveModules → 1:1 source positions),
2390
+ * esm-only (AE reads the `.d.ts` entry only), into the `declarations/` sibling dir. Bin entries
2391
+ * are dropped (no exports).
2392
+ * @internal
2393
+ */
2394
+ export declare function deriveDeclarationsPassOptions(options: DeriveOptions): DerivedDeclarationsPassOptions;
2395
+ /**
2396
+ * One standalone bundled output file, declared by its literal output filename.
2397
+ *
2398
+ * @public
2399
+ */
2400
+ interface LooseFileSpec {
2401
+ /** Source module to bundle into the file. */
2402
+ readonly source: string;
2403
+ /** Module format. Required only for an ambiguous `.js` key; inferred from `.mjs`/`.cjs`. */
2404
+ readonly format?: BuildFormat$1 | undefined;
2405
+ }
2406
+ /**
2407
+ * Map of literal output filename to its source (bare string) or a `{ source, format }` spec.
2408
+ *
2409
+ * @public
2410
+ */
2411
+ type LooseFiles = Record<string, string | LooseFileSpec>;
2412
+ /**
2413
+ * A loose file resolved to a concrete build descriptor.
2414
+ *
2415
+ * @public
2416
+ */
2417
+ interface NormalizedLooseFile {
2418
+ /** Literal output filename written into the package dir, e.g. `pnpmfile.mjs`. */
2419
+ readonly outFile: string;
2420
+ /** tsdown entry name (outFile without its extension), e.g. `pnpmfile`. */
2421
+ readonly entryName: string;
2422
+ /** Source module to bundle. */
2423
+ readonly source: string;
2424
+ /** Resolved module format. */
2425
+ readonly format: BuildFormat$1;
2426
+ /**
2427
+ * Whether tsdown should use fixed extensions. `.mjs`/`.cjs` need `true` (tsdown derives
2428
+ * `.mjs` for esm and `.cjs` for cjs); a `.js` + esm output needs `false` (tsdown derives `.js`).
2429
+ */
2430
+ readonly fixedExtension: boolean;
2431
+ }
2432
+ /**
2433
+ * Resolve a `looseFiles` map into normalized build descriptors. Pure (no filesystem):
2434
+ * a missing `source` is surfaced later by tsdown's entry resolution. Throws
2435
+ * {@link ConfigValidationError} on any structural problem so the bundler's ConfigValidator
2436
+ * surfaces it as a typed, fast-fail config error.
2437
+ * @public
2438
+ */
2439
+ export declare function normalizeLooseFiles(files: LooseFiles): ReadonlyArray<NormalizedLooseFile>;
2440
+ /**
2441
+ * Signature compatible with tsdown's `build(inlineConfig)`.
2442
+ *
2443
+ * @public
2444
+ */
2445
+ type TsdownBuild = (config: Record<string, unknown>) => Promise<unknown>;
2446
+ /**
2447
+ * CSS handling for a partition's JS pass, forwarded VERBATIM to tsdown's `css` option (consumed
2448
+ * by `@tsdown/css`). Structurally typed so tsdown-plugins takes no dependency on `@tsdown/css`.
2449
+ * The package whose runtime is built must install `@tsdown/css`; tsdown loads it lazily.
2450
+ * @public
2451
+ */
2452
+ interface CssOptions {
2453
+ readonly modules?: boolean | {
2454
+ readonly localsConvention?: string;
2455
+ readonly namedExport?: boolean;
2456
+ readonly [k: string]: unknown;
2457
+ };
2458
+ readonly [k: string]: unknown;
2459
+ }
2460
+ /**
2461
+ * One entry partition built with its own format + bundling posture, layered into the
2462
+ * SAME outDir as the base build (clean:false). Each partition is built from ITS OWN values
2463
+ * only — an option this override omits is simply absent for this partition, not inherited
2464
+ * from the base build (partition 0 in `buildTargetGroups`). Callers that want a base-build
2465
+ * value to also apply to an override must pass it again explicitly. An override can
2466
+ * therefore depend on NOT inheriting the base build's externals. `entry` is a subset of the package's
2467
+ * entries (`entryName -> source path`).
2468
+ * @public
2469
+ */
2470
+ interface EntryOverride$1 {
2471
+ readonly entry: Record<string, string>;
2472
+ readonly format?: ReadonlyArray<BuildFormat$1> | undefined;
2473
+ readonly externals?: ReadonlyArray<string> | undefined;
2474
+ readonly bundle?: ReadonlyArray<string> | undefined;
2475
+ readonly bundleNodeModules?: boolean | undefined;
2476
+ readonly bundledPackages?: ReadonlyArray<string> | undefined;
2477
+ readonly dtsExternals?: ReadonlyArray<string> | undefined;
2478
+ /** JS-pass platform for this partition. Defaults to the base "node". Use "browser" for a web runtime. */
2479
+ readonly platform?: BuildPlatform$1 | undefined;
2480
+ /** CSS handling forwarded to tsdown's `css` option (JS pass only). Enables `@tsdown/css`. */
2481
+ readonly css?: CssOptions | undefined;
2482
+ /**
2483
+ * Build this partition into `<groupOutDir>/<outSubdir>/` instead of the shared group root.
2484
+ * Isolates a sub-package (e.g. an RSPress `./runtime`) so its bundleless per-file output cannot
2485
+ * collide with the base partition's output and its barrel path is deterministic. The partition's
2486
+ * entry should be `{ index: <barrel source> }` so it emits `<outSubdir>/index.js` + `<outSubdir>/index.d.ts`.
2487
+ */
2488
+ readonly outSubdir?: string | undefined;
2489
+ }
2490
+ /** @public */
2491
+ interface BuildTargetGroupsOptions {
2492
+ readonly cwd: string;
2493
+ readonly version: string;
2494
+ readonly entry: Record<string, string>;
2495
+ readonly tsconfigPath: string;
2496
+ readonly groups: ReadonlyArray<BuildGroupSpec>;
2497
+ readonly devManifest: "preserve" | "resolve";
2498
+ readonly externals?: ReadonlyArray<string>;
2499
+ /**
2500
+ * Packages externalized in the dts pass ONLY — emitted as `import ... from "..."`
2501
+ * references in the `.d.ts` rather than inlined — while the JS pass still bundles
2502
+ * them per `bundleNodeModules`. The dts pass `neverBundle` becomes the union of
2503
+ * `externals` and `dtsExternals`. Use when a dependency's types cannot be safely
2504
+ * inlined into a single bundled declaration file (e.g. effect's cross-module
2505
+ * `declare module` augmentations, which inline into conflicting interface
2506
+ * extensions in consumers). The JS pass is unaffected.
2507
+ */
2508
+ readonly dtsExternals?: ReadonlyArray<string> | undefined;
2509
+ /**
2510
+ * External packages whose declarations are inlined into the bundled dts
2511
+ * (rslib `dtsBundledPackages` equivalent). Forwarded to the dts pass as
2512
+ * `deps.dts.alwaysBundle` alongside `deps.neverBundle: true`; unlike
2513
+ * `deps.onlyBundle` this does not enable tsdown's strict-mode check that
2514
+ * errors on every unlisted transitive dependency. The JS pass is unaffected.
2515
+ */
2516
+ readonly bundledPackages?: ReadonlyArray<string> | undefined;
2517
+ /**
2518
+ * Force-bundle node_modules (and workspace) JS dependencies that are not
2519
+ * externalized, restoring the rslib bundle-everything-except-externals
2520
+ * behavior. Acts through the JS pass's `unbundle: false` posture, NOT through a
2521
+ * `deps` flag: bundling node_modules is already tsdown's default for anything the
2522
+ * manifest does not declare as a production dependency. The dts pass mirrors it by
2523
+ * likewise leaving that default in place, so the bundled declarations are also
2524
+ * self-contained. Defaults to false (current behavior).
2525
+ */
2526
+ readonly bundleNodeModules?: boolean | undefined;
2527
+ /**
2528
+ * Force-bundle (inline) these packages into the JS output (tsdown `deps.alwaysBundle`),
2529
+ * even declared deps that would otherwise be auto-externalized. The inverse of
2530
+ * `externals`. Forwarded to the JS pass AND, identically, to the dts pass and the
2531
+ * prod-only per-module declarations pass — the dts pass RE-EMITS the dual-format `.cjs`
2532
+ * chunk (see `buildTargetGroups`'s class doc), so a force-bundled dependency must stay
2533
+ * inlined there too, or the re-emitted `.cjs` re-externalizes it.
2534
+ */
2535
+ readonly bundle?: ReadonlyArray<string> | undefined;
2536
+ /** Output formats to emit. Defaults to esm-only when unset. */
2537
+ readonly format?: ReadonlyArray<BuildFormat$1> | undefined;
2538
+ /**
2539
+ * Minify the JS output of PROD groups only (dev is never minified). Defaults to
2540
+ * false — this builder targets Node libraries where readable output is preferred.
2541
+ */
2542
+ readonly minify?: boolean | undefined;
2543
+ /** Top-level `package.json` keys deleted from every emitted manifest, after the standard stripping. */
2544
+ readonly drop?: ReadonlyArray<string> | undefined;
2545
+ /**
2546
+ * Extra rolldown plugins, forwarded to BOTH the JS pass and the dts-only pass. A plugin
2547
+ * with JS-lifecycle side effects (asset emitters, banner injectors) runs in both passes;
2548
+ * the dts pass uses `emitDtsOnly`, so for esm-only builds it produces no JS chunks and most
2549
+ * rolldown hooks are no-ops there. For DUAL (esm+cjs) builds, however, tsdown's dts pass
2550
+ * still RE-EMITS the `.cjs` JS chunk and overwrites the JS pass's `.cjs` output — so a
2551
+ * `renderChunk`/`generateBundle` plugin that must persist onto the final `.cjs` (e.g. the
2552
+ * built-in cjs-default-interop) has to run in the dts pass too. A caller relying on a hook
2553
+ * firing exactly once should guard the second invocation.
2554
+ */
2555
+ readonly extraPlugins?: ReadonlyArray<Plugin>;
2556
+ /**
2557
+ * Compile-time global replacements forwarded to BOTH the JS and dts passes' `define`.
2558
+ * Build-wide (shared by every entry partition); merged after the auto-injected
2559
+ * `process.env.__PACKAGE_VERSION__` so a user key of the same name wins.
2560
+ */
2561
+ readonly define?: Record<string, string> | undefined;
2562
+ /**
2563
+ * Entry partitions with their own format/bundling, built into the same outDir after
2564
+ * the base entries. Used for per-entry format overrides (e.g. one CJS entry in an
2565
+ * otherwise ESM-only package). The base `entry` must already EXCLUDE these entries.
2566
+ */
2567
+ readonly overrides?: ReadonlyArray<EntryOverride$1> | undefined;
2568
+ /**
2569
+ * Standalone bundled output files emitted at literal paths into each group's pkg/ dir,
2570
+ * outside the exports/dts/meta graph (e.g. pnpm config-dependency pnpmfiles). Each runs as
2571
+ * one extra single-entry, bundled (unbundle:false), no-dts, no-manifest pass per group,
2572
+ * inheriting the group's bundleNodeModules/bundle/externals posture so the file is
2573
+ * self-contained. Caller passes the normalized form (see normalizeLooseFiles).
2574
+ */
2575
+ readonly looseFiles?: ReadonlyArray<NormalizedLooseFile> | undefined;
2576
+ /**
2577
+ * Non-module assets for each group's pkg/ dir, handed to tsdown's `copy` on the base partition's JS pass, after its
2578
+ * clean. A `to` is taken relative to the group's pkg/ dir, where tsdown alone would read it against `cwd` and write
2579
+ * every group's copy to one place.
2580
+ */
2581
+ readonly copy?: ReadonlyArray<string | CopyEntry> | undefined;
2582
+ /**
2583
+ * Which export keys get a CJS `require` condition in the emitted manifest. Pass a Set
2584
+ * when overrides give different entries different formats; omit for the uniform
2585
+ * `format`-includes-cjs behavior.
2586
+ */
2587
+ readonly dualExports?: DualExports | undefined;
2588
+ /** Export keys built into a `<key>/index.*` subdir (e.g. an RSPress `./runtime`). */
2589
+ readonly subdirExports?: ReadonlySet<string> | undefined;
2590
+ /** When set, rewrite the emitted manifest's exports/bin values equal to the exe source to the SEA path and add it to `files`. */
2591
+ readonly exeRewrite?: ExeRewrite | undefined;
2592
+ /** Injectable for tests; defaults to tsdown's build. */
2593
+ readonly build?: TsdownBuild;
2594
+ /** Told when a pass starts, so a caller can name the pass a thrown error came from. */
2595
+ readonly onPass?: ((pass: PassKind) => void) | undefined;
2596
+ /** When set, muzzle tsdown (silent + customLogger) and capture metrics/timing into this collector. */
2597
+ readonly collector?: BuildCollector | undefined;
2598
+ /** Compute gzip sizes for emitted files (verbose render). Forwarded to the metrics plugin. */
2599
+ readonly verbose?: boolean | undefined;
2600
+ /**
2601
+ * Emit a per-module (`unbundle: true`) declaration tree into `dist/prod/<id>/declarations/` per
2602
+ * group, in addition to the bundled dts in `pkg/`. API Extractor's diagnostics-run input for the
2603
+ * meta pass. Prod-only; the bundler sets it for `--target prod`. Absent → no third pass
2604
+ * (byte-identical to the two-pass default). Not captured by the collector. Has no effect when
2605
+ * `emitDts` is `false` — the declarations pass exists only to feed the dts-derived meta pass.
2606
+ */
2607
+ readonly emitDeclarations?: boolean | undefined;
2608
+ /**
2609
+ * When `false`, skip BOTH the bundled per-entry dts pass (Pass 2) and the prod per-module
2610
+ * declarations pass (Pass 3) — no TypeScript compiler load. The JS pass (Pass 1) and
2611
+ * `copyPublicDir` still run. Defaults to `true` (current two/three-pass behavior).
2612
+ */
2613
+ readonly emitDts?: boolean | undefined;
2614
+ }
2615
+ /**
2616
+ * Run tsdown.build() per TargetGroup. Composable so the escape hatch gets multi-group too.
2617
+ *
2618
+ * Each group runs TWO passes to the SAME outDir:
2619
+ * 1. JS pass — per-module JS (`unbundle: true`, `dts: false`), with the `emitManifest` plugin
2620
+ * and the `public/` copy. Default `clean: true` gives it a fresh outDir.
2621
+ * 2. dts pass — bundled declarations only (`unbundle: false`, `dts: { emitDtsOnly: true }`,
2622
+ * `clean: false`). No manifest plugin, no copy, no sourcemaps. `clean: false` is load-bearing:
2623
+ * it must NOT wipe the JS the first pass just wrote.
2624
+ *
2625
+ * Why two passes: tsdown's `unbundle` maps to rolldown `output.preserveModules` for the whole
2626
+ * build (JS and the dts plugin share it), so a single pass cannot give per-module JS + bundled
2627
+ * dts. Per-module dts breaks type portability (TS2883); bundling the JS re-bundles workspace
2628
+ * consumers. The split keeps per-module JS AND rolled-up, self-contained declarations.
2629
+ *
2630
+ * **The JS pass's `unbundle` flips to `false` for a `bundleNodeModules` partition** (see
2631
+ * `DerivedTsdownOptions` in `target-groups.ts`), so that partition's JS pass ALSO bundles
2632
+ * instead of preserving modules — a per-module preserveModules JS pass writes every inlined
2633
+ * node_modules dependency to its own sibling file (mirroring its `node_modules/...` path),
2634
+ * which `npm pack` then strips, breaking the "self-contained" promise `bundleNodeModules`
2635
+ * already makes. Scoped to that flag alone; every other build's JS pass is unaffected.
2636
+ * @public
2637
+ */
2638
+ export declare function buildTargetGroups(options: BuildTargetGroupsOptions): Promise<void>;
2639
+ /**
2640
+ * Which release versions a target receives: every version, only final versions, or only prereleases.
2641
+ *
2642
+ * @remarks
2643
+ * A prerelease is any version carrying a SemVer prerelease suffix (`1.2.0-beta.1`). The filter is
2644
+ * applied per target at publish time, never at build time, so a `from` target that shares a group
2645
+ * with a differently-filtered target still reuses the same bytes.
2646
+ *
2647
+ * @public
2648
+ */
2649
+ type ReleaseChannel = "all" | "stable" | "prerelease";
2650
+ /**
2651
+ * Every {@link ReleaseChannel} value, in declaration order.
2652
+ *
2653
+ * @public
2654
+ */
2655
+ export declare const RELEASE_CHANNELS: ReadonlyArray<ReleaseChannel>;
2656
+ /**
2657
+ * A single object-form publish target. Uses `from` XOR `name` (never both).
2658
+ *
2659
+ * @public
2660
+ */
2661
+ interface PublishTargetObject {
2662
+ /** Registry endpoint. Required for custom keys; defaulted for `npm`/`github`. */
2663
+ readonly registry?: string | undefined;
2664
+ /** Name override for this target's own group. Mutually exclusive with `from`. */
2665
+ readonly name?: string | undefined;
2666
+ /** Reuse another target's group bytes (deploy them to this registry). Mutually exclusive with `name`. */
2667
+ readonly from?: string | undefined;
2668
+ /** Which release versions this target receives. Defaults to `"all"`. */
2669
+ readonly releases?: ReleaseChannel | undefined;
2670
+ /** Force the provenance attestation on or off, overriding the registry-derived default. */
2671
+ readonly provenance?: boolean | undefined;
2672
+ }
2673
+ /**
2674
+ * A `publishConfig.targets` value: `true` (well-known registry, base name), a string (name override), or an object.
2675
+ *
2676
+ * @public
2677
+ */
2678
+ type PublishTargetValue = true | string | PublishTargetObject;
2679
+ /**
2680
+ * The `publishConfig.targets` map, keyed by target id (`npm`, `github`, or a custom key).
2681
+ *
2682
+ * @public
2683
+ */
2684
+ type PublishTargets = Record<string, PublishTargetValue>;
2685
+ /**
2686
+ * A distinct byte-variant build group (one per distinct resolved name).
2687
+ *
2688
+ * @public
2689
+ */
2690
+ interface ResolvedGroup {
2691
+ /** Folder id; the group's output dir nests this id under dist/prod, with a pkg subfolder. */
2692
+ readonly id: string;
2693
+ /** The `package.json.name` this group's manifest carries. */
2694
+ readonly name: string;
2695
+ /** The group's pkg output dir, relative to the package root. */
2696
+ readonly dir: string;
2697
+ }
2698
+ /**
2699
+ * A resolved registry target (one per `publishConfig.targets` key).
2700
+ *
2701
+ * @public
2702
+ */
2703
+ interface ResolvedTarget {
2704
+ /** The `publishConfig.targets` key. */
2705
+ readonly id: string;
2706
+ /** The group id whose bytes this target deploys. */
2707
+ readonly group: string;
2708
+ /** The resolved name for that group. */
2709
+ readonly name: string;
2710
+ /** The resolved registry endpoint. */
2711
+ readonly registry: string;
2712
+ /** Which release versions this target receives; always written, `"all"` when undeclared. */
2713
+ readonly releases: ReleaseChannel;
2714
+ /** The declared provenance override; absent when the target leaves it to the registry default. */
2715
+ readonly provenance?: boolean;
2716
+ }
2717
+ /**
2718
+ * The full resolution of `publishConfig.targets`: the distinct groups to build, and every target bound to one.
2719
+ *
2720
+ * @public
2721
+ */
2722
+ interface TargetResolution {
2723
+ readonly groups: ReadonlyArray<ResolvedGroup>;
2724
+ readonly targets: ReadonlyArray<ResolvedTarget>;
2725
+ }
2726
+ /**
2727
+ * True when a target value is the object form (carries registry/name/from).
2728
+ *
2729
+ * @public
2730
+ */
2731
+ export declare function isTargetObject(value: PublishTargetValue): value is PublishTargetObject;
2732
+ /**
2733
+ * The `package.json` fields the build reads. Any other field reaches the emitted manifest untouched.
2734
+ *
2735
+ * @public
2736
+ */
2737
+ interface BundlerPackageJson {
2738
+ readonly name?: string;
2739
+ readonly version?: string;
2740
+ readonly exports?: unknown;
2741
+ readonly bin?: unknown;
2742
+ readonly publishConfig?: unknown;
2743
+ readonly os?: unknown;
2744
+ readonly cpu?: unknown;
2745
+ readonly [key: string]: unknown;
2746
+ }
2747
+ /**
2748
+ * The orchestrator's side effects, each replaceable so a test can run it without tsdown, API Extractor or a
2749
+ * compiler. Every member defaults to the real implementation.
2750
+ *
2751
+ * @public
2752
+ */
2753
+ interface BundlerSeams {
2754
+ /** The JS and declaration passes. */
2755
+ readonly buildTargetGroups: (options: BuildTargetGroupsOptions) => Promise<void>;
2756
+ /** The meta pass, once per build. */
2757
+ readonly runMetaPass: (options: RunMetaPassOptions) => Promise<void>;
2758
+ /** The API Extractor run inside the real meta pass. */
2759
+ readonly generateMeta: (options: GenerateMetaOptions) => Promise<MetaResult>;
2760
+ /** The optimistic next-version read inside the real meta pass. */
2761
+ readonly resolveNextVersions: (cwd: string) => Promise<{
2762
+ readonly versions: ReadonlyMap<string, string>;
2763
+ }>;
2764
+ /** Imports an optional peer of an Open Graph renderer, the check that it is installed. */
2765
+ readonly importOgPeer: (specifier: string) => Promise<unknown>;
2766
+ /** The SEA compile. */
2767
+ readonly runExeBuild: (options: RunExeBuildOptions) => Promise<void>;
2768
+ /** Writes `dist/prod/issues.json` and answers its path. */
2769
+ readonly writeIssues: (options: {
2770
+ readonly cwd: string;
2771
+ readonly target: "prod";
2772
+ readonly reports: ReadonlyArray<BuildReport>;
2773
+ readonly buildOk: boolean;
2774
+ readonly failure?: {
2775
+ readonly name?: string | undefined;
2776
+ readonly message: string;
2777
+ };
2778
+ }) => string | undefined;
2779
+ /** Reads the package's `package.json`. */
2780
+ readonly readPackageJson: (cwd: string) => BundlerPackageJson;
2781
+ /** Writes the resolved tsconfig and answers its path. */
2782
+ readonly writeTsconfig: (cwd: string, jsx: JsxConfig$1 | undefined) => string;
2783
+ /** Writes `dist/prod/targets.json` and answers its path. */
2784
+ readonly writeTargetsBinding: (cwd: string, resolution: TargetResolution) => string;
2785
+ /** Reads the jsx-relevant slice of the package's tsconfig. */
2786
+ readonly readTsconfigJsx: (cwd: string) => TsconfigJsx;
2787
+ }
2788
+ /**
2789
+ * The inputs of one package build.
2790
+ *
2791
+ * @public
2792
+ */
2793
+ interface BundlerBuildOptions {
2794
+ /** The package root, as an absolute path. The build never reads the process's own directory. */
2795
+ readonly cwd: string;
2796
+ /** The decoded `[package.build]` table. */
2797
+ readonly config: PackageBuildConfig;
2798
+ /** The decoded `[package.tsdoctor]` table, the config tier of the emitted `tsdoctor.json`. */
2799
+ readonly tsdoctor: TsdoctorConfig | undefined;
2800
+ /** Skips the SEA compile. The manifest still points at the binary. */
2801
+ readonly noExe: boolean;
2802
+ /** Measures gzip sizes for the report. */
2803
+ readonly verbose: boolean;
2804
+ /** Rolldown plugins added to the JS and declaration passes, already loaded. */
2805
+ readonly plugins: ReadonlyArray<Plugin>;
2806
+ /** Whether this build runs under CI. Resolves an `"auto"` optimistic meta setting, and read from nothing else. */
2807
+ readonly ci: boolean;
2808
+ /** Replaces side effects, for tests. */
2809
+ readonly seams?: Partial<BundlerSeams>;
2810
+ }
2811
+ declare const BundlerBuildResult_base: Schema.Class<BundlerBuildResult, Schema.Struct<{
2812
+ /** Everything the build recorded. */
2813
+ readonly report: typeof BuildReport;
2814
+ /** Where `issues.json` was written. */
2815
+ readonly issuesPath: Schema.String;
2816
+ /** Where `targets.json` was written. */
2817
+ readonly targetsPath: Schema.UndefinedOr<Schema.String>;
2818
+ }>, {}>;
2819
+ /**
2820
+ * A finished build.
2821
+ *
2822
+ * @public
2823
+ */
2824
+ export declare class BundlerBuildResult extends BundlerBuildResult_base {}
2825
+ /**
2826
+ * Builds one package: the JS and declaration passes for every publish group, the emitted manifest,
2827
+ * `dist/prod/targets.json`, the API model, an optional SEA binary, and `dist/prod/issues.json`.
2828
+ *
2829
+ * @public
2830
+ */
2831
+ export declare class Bundler {
2832
+ /**
2833
+ * Runs a build of the package at `options.cwd`, writing into its `dist/prod`.
2834
+ *
2835
+ * @remarks
2836
+ * It writes nothing to stdout; rendering the report belongs to the caller. A structurally invalid config fails
2837
+ * {@link ConfigValidationError} before any build work, and anything thrown afterwards fails
2838
+ * {@link BundlerError} naming the phase. Both paths write `issues.json` stamped `buildOk: false` first.
2839
+ */
2840
+ static readonly build: (options: BundlerBuildOptions) => Effect.Effect<BundlerBuildResult, BundlerError | ConfigValidationError>;
2841
+ }
2842
+ /**
2843
+ * Minimal shape of a `package.json` manifest needed to resolve catalog and
2844
+ * workspace specifiers.
2845
+ *
2846
+ * @public
2847
+ */
2848
+ interface ManifestLike {
2849
+ readonly name: string;
2850
+ readonly version: string;
2851
+ dependencies?: Record<string, string>;
2852
+ devDependencies?: Record<string, string>;
2853
+ peerDependencies?: Record<string, string>;
2854
+ optionalDependencies?: Record<string, string>;
2855
+ [k: string]: unknown;
2856
+ }
2857
+ /**
2858
+ * Resolve every `catalog:`/`workspace:` specifier in a manifest to a concrete spec,
2859
+ * delegating to `@effected/workspaces`' one-shot `Workspaces.resolveManifest`. The
2860
+ * resolver re-discovers the workspace root from `cwd` on every call, never from the
2861
+ * process directory, and assembles catalogs durably (inline +
2862
+ * config-dependency hook-replay + lockfile), so no transient
2863
+ * `.pnpm-workspace-state-v1.json` is required.
2864
+ *
2865
+ * Rejects with `ManifestDecodeError` when a dependency field is not a string-to-string
2866
+ * record, `UnresolvedDependencyError` on a specifier the workspace cannot answer, or
2867
+ * `CatalogAssemblyError`/`DependencyResolutionError` when catalog assembly or the
2868
+ * resolution mechanism itself fails.
2869
+ * @public
2870
+ */
2871
+ export declare function resolveManifest(pkg: ManifestLike, cwd: string): Promise<ManifestLike>;
2872
+ /**
2873
+ * Result of resolving next release versions for a workspace.
2874
+ *
2875
+ * @public
2876
+ */
2877
+ interface NextVersions {
2878
+ /** Monorepo root containing `.changeset/` (or `cwd` when no workspace was found). */
2879
+ readonly root: string;
2880
+ /** Canonical package name `->` next release version (current version when unbumped). */
2881
+ readonly versions: ReadonlyMap<string, string>;
2882
+ }
2883
+ /**
2884
+ * Resolve the next release version of every workspace package from pending changesets.
2885
+ *
2886
+ * Walks up from `cwd` to the monorepo root via `@effected/workspaces`' `WorkspaceDiscovery`,
2887
+ * seeds the map with each package's CURRENT version, then overlays `newVersion` for
2888
+ * changeset-affected packages via `ReleasePlan.read`, including pre-release versions in pre
2889
+ * mode and fixed or linked groups. Never rejects: any failure (not a workspace, missing
2890
+ * `.changeset/config.json`, an invalid config or `pre.json`, parse error) degrades to current
2891
+ * versions (or an empty map).
2892
+ * @public
2893
+ */
2894
+ export declare function resolveNextVersions(cwd: string): Promise<NextVersions>;
2895
+ declare const EffectedConfigError_base: Schema.Class<EffectedConfigError, Schema.TaggedStruct<"EffectedConfigError", {
2896
+ /** The file at fault. */
2897
+ readonly path: Schema.String;
2898
+ /** The TOML parser's message, or every schema issue rendered with its path. */
2899
+ readonly reason: Schema.String;
2900
+ /** The dotted path of the first schema issue, e.g. `package.build.formats`, when decoding failed. */
2901
+ readonly issuePath: Schema.optionalKey<Schema.String>;
2902
+ }>, import("effect/Cause").YieldableError>;
2903
+ /**
2904
+ * An `effected.toml` could not be read, parsed or decoded, or the workspace around it could not be discovered.
2905
+ *
2906
+ * @public
2907
+ */
2908
+ export declare class EffectedConfigError extends EffectedConfigError_base {
2909
+ get message(): string;
2910
+ }
2911
+ declare const ResolvedConfig_base: Schema.Class<ResolvedConfig, Schema.Struct<{
2912
+ readonly action: Schema.optionalKey<typeof ActionConfig>;
2913
+ package: Schema.withDecodingDefaultKey<typeof PackageConfig, never>;
2914
+ }>, EffectedConfig> & Pick<{}, never>;
2915
+ /**
2916
+ * The effective config {@link EffectedConfigFile.load} answers: an {@link EffectedConfig} whose `package` table
2917
+ * is always present, with every default when no file wrote one, so a consumer never branches on its absence.
2918
+ *
2919
+ * @public
2920
+ */
2921
+ export declare class ResolvedConfig extends ResolvedConfig_base {}
2922
+ declare const ResolvedEffectedConfig_base: Schema.Class<ResolvedEffectedConfig, Schema.Struct<{
2923
+ /** The merged, decoded config. */
2924
+ readonly config: typeof ResolvedConfig;
2925
+ /** The file each tier read, absent for a tier that found none. */
2926
+ readonly sources: Schema.Struct<{
2927
+ /** The workspace root tier's file. */
2928
+ readonly root: Schema.optionalKey<Schema.String>;
2929
+ /** The package tier's file. */
2930
+ readonly package: Schema.optionalKey<Schema.String>;
2931
+ }>;
2932
+ }>, {}>;
2933
+ /**
2934
+ * A package's effective `effected.toml` config and the files it came from.
2935
+ *
2936
+ * @public
2937
+ */
2938
+ export declare class ResolvedEffectedConfig extends ResolvedEffectedConfig_base {}
2939
+ /**
2940
+ * Finds, merges and decodes `effected.toml`.
2941
+ *
2942
+ * @public
2943
+ */
2944
+ export declare class EffectedConfigFile {
2945
+ private constructor();
2946
+ /**
2947
+ * Loads the config that applies to the package at `cwd`.
2948
+ *
2949
+ * @remarks
2950
+ * The root tier is the first of `.config/effected.toml` and `effected.toml` under the workspace root. The
2951
+ * package tier is the first of those two and `lib/configs/effected.toml` under `cwd`; it applies only when
2952
+ * `cwd` is not the root. The package tier merges over the root tier per {@link merge}, and the merged
2953
+ * document decodes once, so defaults apply after precedence.
2954
+ *
2955
+ * Decoding rejects unknown keys and reports all of them. When no workspace root sits above `cwd`, `cwd`
2956
+ * is the root. No file anywhere is not a failure: `config.package` holds every default and `sources` has no
2957
+ * keys.
2958
+ *
2959
+ * @param options - `cwd` is the package directory; `root` skips workspace discovery.
2960
+ */
2961
+ static readonly load: (options: {
2962
+ readonly cwd: string;
2963
+ readonly root?: string;
2964
+ }) => Effect.Effect<ResolvedEffectedConfig, EffectedConfigError, FileSystem.FileSystem | Path.Path | WorkspaceDiscovery>;
2965
+ }
2966
+ /**
2967
+ * Merges a package's raw `effected.toml` document over the workspace root's.
2968
+ *
2969
+ * @remarks
2970
+ * Two tables merge per key; an array or a scalar replaces whatever the root had, whole. It runs on the raw
2971
+ * documents, before any decoding, so a default can never outrank a value the root wrote. Neither input is
2972
+ * modified, and `__proto__`, `constructor` and `prototype` keys are dropped.
2973
+ *
2974
+ * @param root - The root tier's document.
2975
+ * @param pkg - The package tier's document, which wins every conflict.
2976
+ * @returns The merged document.
2977
+ *
2978
+ * @public
2979
+ */
2980
+ export declare const merge: (root: unknown, pkg: unknown) => unknown;
2981
+ declare const PluginLoadError_base: Schema.Class<PluginLoadError, Schema.TaggedStruct<"PluginLoadError", {
2982
+ /** The module's resolved path. */
2983
+ readonly path: Schema.String;
2984
+ /** What was wrong with it. */
2985
+ readonly reason: Schema.String;
2986
+ }>, import("effect/Cause").YieldableError>;
2987
+ /**
2988
+ * A module named in `package.build.plugins` could not be loaded as a rolldown plugin.
2989
+ *
2990
+ * @public
2991
+ */
2992
+ export declare class PluginLoadError extends PluginLoadError_base {
2993
+ get message(): string;
2994
+ }
2995
+ /**
2996
+ * Loads the rolldown plugins named in `package.build.plugins`, in order.
2997
+ *
2998
+ * @remarks
2999
+ * Each module path resolves against `cwd`, so a bare `build/plugin.ts` is a file in the package rather than a
3000
+ * package name. A module's default export is a plugin, or a factory of one that is called once. Loading runs
3001
+ * the module's code, and stops at the first module that fails.
3002
+ *
3003
+ * @param options - `cwd` is the package directory and `modules` the paths to load. `importModule` replaces the
3004
+ * default importer, jiti, which loads TypeScript directly.
3005
+ *
3006
+ * @public
3007
+ */
3008
+ export declare const loadPlugins: (options: {
3009
+ readonly cwd: string;
3010
+ readonly modules: ReadonlyArray<string>;
3011
+ readonly importModule?: (path: string) => Promise<unknown>;
3012
+ }) => Effect.Effect<Plugin<any>[], PluginLoadError, never>;
3013
+ /**
3014
+ * The normalized facts the validator checks, assembled by the bundler before any build work.
3015
+ *
3016
+ * @public
3017
+ */
3018
+ interface ValidationInput {
3019
+ readonly baseName: string;
3020
+ /** Whether the package declares an exports map (for the model-without-exports cross-field rule). */
3021
+ readonly hasExports: boolean;
3022
+ readonly targets?: PublishTargets | undefined;
3023
+ readonly exe?: ExeConfig$1 | ReadonlyArray<ExeConfig$1> | undefined;
3024
+ readonly osCpu?: {
3025
+ readonly os: ReadonlyArray<string>;
3026
+ readonly cpu: ReadonlyArray<string>;
3027
+ } | undefined;
3028
+ readonly meta?: MetaOptions | undefined;
3029
+ /** Standalone bundled output files; validated structurally (extension/format) before any build. */
3030
+ readonly looseFiles?: LooseFiles | undefined;
3031
+ }
3032
+ declare const ConfigValidator_base: Context.ServiceClass<ConfigValidator, "@savvy-web/tsdown-plugins/ConfigValidator", {
3033
+ readonly validate: (input: ValidationInput) => Effect.Effect<void, ConfigValidationError>;
3034
+ }>;
3035
+ /**
3036
+ * Fast-fail config validator; runs first in the bundler over the resolved config.
3037
+ *
3038
+ * @public
3039
+ */
3040
+ export declare class ConfigValidator extends ConfigValidator_base {
3041
+ static readonly layer: Layer.Layer<ConfigValidator>;
3042
+ }
3043
+ /**
3044
+ * The analysis of an entry source treated as a candidate re-export barrel.
3045
+ *
3046
+ * @public
3047
+ */
3048
+ interface ReexportBarrelAnalysis {
3049
+ /** Value (non-type-only) names the module re-exports, after `as` aliasing. */
3050
+ readonly valueNames: ReadonlyArray<string>;
3051
+ /** Type-only names the module re-exports (`export type { … }`), after `as` aliasing. */
3052
+ readonly typeNames: ReadonlyArray<string>;
3053
+ /**
3054
+ * True iff EVERY top-level statement is a NAMED re-export `from` another module
3055
+ * (`export { … } from "…"` / `export type { … } from "…"`). A module that declares anything
3056
+ * locally, re-exports a namespace (`export * as NS from`), star-re-exports (`export * from`), or
3057
+ * has a bare `export { … }` without `from` is NOT a pure named barrel and cannot be expressed as
3058
+ * a thin re-export stub of another entry.
3059
+ */
3060
+ readonly isPureNamedReexportBarrel: boolean;
3061
+ }
3062
+ /**
3063
+ * The set of names a module exports, plus whether that set is fully known.
3064
+ *
3065
+ * @public
3066
+ */
3067
+ interface ModuleExportNames {
3068
+ readonly names: ReadonlySet<string>;
3069
+ /**
3070
+ * False when the module contains a star re-export (`export * from "…"`) whose target exports
3071
+ * cannot be enumerated from this source alone — the name set is then a lower bound, not complete,
3072
+ * so callers must not use it for a strict subset decision.
3073
+ */
3074
+ readonly complete: boolean;
3075
+ }
3076
+ /**
3077
+ * Analyze an entry source as a candidate pure re-export barrel: classify its re-exported names into
3078
+ * value vs type-only and report whether it is expressible as a thin stub. Pure parsing — no I/O.
3079
+ *
3080
+ * @public
3081
+ */
3082
+ export declare function analyzeReexportBarrel(source: string, fileName?: string): ReexportBarrelAnalysis;
3083
+ /**
3084
+ * Collect every name a module exports (named re-exports, namespace re-exports, and local `export`
3085
+ * declarations). Used to test whether a barrel's re-exports are a strict subset of a base entry, so
3086
+ * a stub re-exporting from that base resolves every symbol. Pure parsing — no I/O.
3087
+ *
3088
+ * @public
3089
+ */
3090
+ export declare function collectExportNames(source: string, fileName?: string): ModuleExportNames;
3091
+ /**
3092
+ * Render a thin re-export-stub `.d.ts`/`.d.cts` body: named re-exports of `valueNames` and
3093
+ * `typeNames` from `baseSpecifier` (the published file of the base entry, e.g. `./index.js` for the
3094
+ * ESM `.d.ts` or `./index.cjs` for the CJS `.d.cts`). Names are sorted so the output is
3095
+ * deterministic. Returns the empty string when there is nothing to re-export.
3096
+ *
3097
+ * @public
3098
+ */
3099
+ export declare function renderReexportStub(options: {
3100
+ readonly valueNames: ReadonlyArray<string>;
3101
+ readonly typeNames: ReadonlyArray<string>;
3102
+ readonly baseSpecifier: string;
3103
+ }): string;
3104
+ export declare function findRelativeSpecifiers(source: string, fileName?: string): string[];
3105
+ /** @public */
3106
+ interface ResolvedTsconfigOptions {
3107
+ /** Absolute package root. */
3108
+ readonly cwd: string;
3109
+ /** TS `compilerOptions.jsx` override (e.g. "react-jsx"); wins over the resolved config. */
3110
+ readonly jsx?: string | undefined;
3111
+ /** TS `compilerOptions.jsxImportSource` override (e.g. "react"); wins over the resolved config. */
3112
+ readonly jsxImportSource?: string | undefined;
3113
+ }
3114
+ /** @public */
3115
+ interface ResolvedTsconfig {
3116
+ readonly compilerOptions: Record<string, unknown>;
3117
+ readonly include: ReadonlyArray<string>;
3118
+ readonly exclude: ReadonlyArray<string>;
3119
+ }
3120
+ /**
3121
+ * Build the portable absolute-path tsconfig object for the dts pass.
3122
+ *
3123
+ * @remarks
3124
+ * Resolves the package's own `<cwd>/tsconfig.json` (which extends the shared
3125
+ * `ecma.json` base) through `@effected/tsconfig-json`'s `TsconfigLoaderSync`, so the
3126
+ * result carries the package's real effective options — target, module, lib, strict,
3127
+ * jsx — with `${configDir}` already substituted to absolute paths. Only the dts-pass
3128
+ * overlay (composite/incremental/tsBuildInfoFile forced off, declarationMap forced on)
3129
+ * and an explicit jsx override are layered on top.
3130
+ *
3131
+ * `include`/`exclude` are NOT taken from the resolved config. The shared base includes
3132
+ * `__test__` and `lib` sources, which have no business in a declaration program; the
3133
+ * narrow list below is dts-pass-specific and deliberately held fixed.
3134
+ *
3135
+ * @public
3136
+ */
3137
+ export declare function buildResolvedTsconfig(options: ResolvedTsconfigOptions): ResolvedTsconfig;
3138
+ /**
3139
+ * Write the resolved tsconfig to a temp file and return its absolute path.
3140
+ *
3141
+ * @public
3142
+ */
3143
+ export declare function writeResolvedTsconfig(options: ResolvedTsconfigOptions): string;
3144
+ /**
3145
+ * What a dts-emit tsconfig adds for one partition.
3146
+ *
3147
+ * @public
3148
+ */
3149
+ interface DtsEmitTsconfigOptions {
3150
+ /** The `paths` map of the bundled workspace siblings. Absent or empty, `paths` stays cleared. */
3151
+ readonly paths?: Readonly<Record<string, ReadonlyArray<string>>> | undefined;
3152
+ }
3153
+ /**
3154
+ * Derive a dts-EMIT variant of an already-written resolved tsconfig that adds
3155
+ * `stableTypeOrdering: true`, and return its path. This makes the TypeScript declaration emitter
3156
+ * (rolldown-plugin-dts' tsgo generator over this package's `typescript`) order union/type members
3157
+ * deterministically, so a multi-union `.d.ts` (e.g. an Effect `Layer.Layer<…>` requirement channel)
3158
+ * does not flip member order across otherwise-identical builds (#156). It is kept in a SEPARATE file
3159
+ * from the api-extractor tsconfig on purpose: `@microsoft/api-extractor` compiles with its own
3160
+ * bundled TypeScript 6, which predates the flag and hard-errors on the unknown compiler option — so
3161
+ * only the emit passes ever see it, while the api-extractor compile reads the original clean config.
3162
+ *
3163
+ * The wrapper is written for the tsgo generator, which opens it as a TypeScript PROJECT and then
3164
+ * looks every entry up by the realpath'd module id rolldown hands it — so it has to describe the
3165
+ * same file set under the same names:
3166
+ *
3167
+ * - `extends` names the base by its CANONICAL (symlink-free) path. Root files are resolved relative
3168
+ * to the base's directory, and on a symlinked base dir (macOS `/var` resolving to `/private/var`, a linked
3169
+ * checkout) a non-canonical name would key them differently from rolldown's ids and every entry
3170
+ * would fail with "No TypeScript Go project found".
3171
+ * - `files`/`include`/`exclude` are restated as ABSOLUTE paths under the base's directory. A base
3172
+ * that declares none would otherwise get TypeScript's default `**\/*` resolved against the
3173
+ * wrapper's own directory — the OS temp dir — so the project would be every stray temp file on
3174
+ * the machine and never the package's sources.
3175
+ *
3176
+ * The wrapper also ALWAYS clears `customConditions` and `paths` (written as `null`, which the TypeScript compiler
3177
+ * reads as removing an inherited value): the declaration program must resolve sibling packages the way the package
3178
+ * manifest says, never through a typecheck-only condition or path alias that would pull source files into the
3179
+ * emitted declarations. The one exception is `options.paths`, the bundled workspace siblings resolved to their built
3180
+ * declarations, which is the only `paths` map this file ever carries. The only reader of this file is the tsgo
3181
+ * declaration generator; nothing in the bundler reads it back through the kit's `TsconfigLoaderSync`, which rejects
3182
+ * `null` compiler options.
3183
+ *
3184
+ * Best-effort: if the base tsconfig cannot be read or parsed (e.g. a synthetic test path that was
3185
+ * never written), the original path is returned unchanged — the emit then simply keeps TS's
3186
+ * default ordering rather than aborting the build at this layer.
3187
+ *
3188
+ * @public
3189
+ */
3190
+ export declare function writeDtsEmitTsconfig(resolvedTsconfigPath: string, options?: DtsEmitTsconfigOptions): string;
3191
+ /** @public */
3192
+ interface PackageJsonLike {
3193
+ readonly exports?: unknown;
3194
+ readonly bin?: unknown;
3195
+ }
3196
+ /** @public */
3197
+ interface ExtractOptions {
3198
+ readonly exportsAsIndexes?: boolean | undefined;
3199
+ /** Source paths to NOT turn into JS build entries (e.g. an exe entry compiled as a SEA). */
3200
+ readonly excludeSources?: ReadonlyArray<string> | undefined;
3201
+ }
3202
+ /** @public */
3203
+ interface ExtractResult {
3204
+ /** entry name to TS source path */
3205
+ readonly entries: Record<string, string>;
3206
+ /** entry name to original export key (for downstream output-map alignment) */
3207
+ readonly exportPaths: Record<string, string>;
3208
+ }
3209
+ /**
3210
+ * Map an export key to the tsdown entry name (the emitted output basename).
3211
+ *
3212
+ * `.` becomes `index`; otherwise the leading `./` is stripped and, unless
3213
+ * `exportsAsIndexes` is set, nested slashes are flattened to dashes
3214
+ * (e.g. `./changesets/markdownlint` to `changesets-markdownlint`). The manifest
3215
+ * transform reuses this so the declared output path always matches the emitted file.
3216
+ *
3217
+ * @internal
3218
+ */
3219
+ export declare const createEntryName: (exportKey: string, exportsAsIndexes: boolean) => string;
3220
+ /** @public */
3221
+ export declare function extractEntries(pkg: PackageJsonLike, options?: ExtractOptions): ExtractResult;
3222
+ /** The declaration-file extension of a path, or undefined when it is not a declaration file. @public */
3223
+ export declare function declarationExt(p: string): ".d.ts" | ".d.cts" | ".d.mts" | undefined;
3224
+ /** Classification of a single export value for ambient-.d.ts handling. @public */
3225
+ type DtsExportClass = {
3226
+ readonly kind: "ambient";
3227
+ readonly source: string;
3228
+ } | {
3229
+ readonly kind: "mixed";
3230
+ } | {
3231
+ readonly kind: "none";
3232
+ };
3233
+ /**
3234
+ * Classify an export value:
3235
+ * - `ambient` — a types-only declaration source (bare `.d.ts` string, or `{ types: "*.d.ts" }` with no runtime source).
3236
+ * - `mixed` — a declaration `types` AND a compilable runtime source (`import`/`require`/`default` → `.ts`/`.tsx`).
3237
+ * - `none` — anything else (normal runtime export, json, etc.).
3238
+ * @public
3239
+ */
3240
+ export declare function classifyDtsExport(value: unknown): DtsExportClass;
3241
+ /**
3242
+ * Output basename (including the preserved declaration extension) for an ambient export, derived
3243
+ * from the export KEY — consistent with how JS entries are named. @public
3244
+ */
3245
+ export declare function ambientOutName(exportKey: string, source: string, exportsAsIndexes?: boolean): string;
3246
+ /**
3247
+ * The shared mixed-export error (Decision 2), used by both the extractor and the manifest transform. The reason ends
3248
+ * with the bare-string form to write instead, naming the export's runtime target when `value` holds one: a
3249
+ * hand-written `{ "types": "./dist/foo.d.ts", "import": "./dist/foo.js" }` becomes `"./foo": "./dist/foo.js"`, which
3250
+ * the bundler builds from `./src/foo.ts` and gives generated types. @public
3251
+ */
3252
+ export declare function mixedDtsExportError(exportKey: string, value?: unknown): ConfigValidationError;
3253
+ /** One ambient `.d.ts` export resolved for copy + manifest. @public */
3254
+ interface AmbientDtsEntry {
3255
+ readonly exportKey: string;
3256
+ readonly source: string;
3257
+ readonly outName: string;
3258
+ }
3259
+ /** @public */
3260
+ interface ExtractAmbientOptions {
3261
+ readonly exportsAsIndexes?: boolean | undefined;
3262
+ }
3263
+ /**
3264
+ * Extract the types-only `.d.ts` exports from a package's `exports` map. Pure.
3265
+ * Throws {@link ConfigValidationError} on a mixed export (Decision 2) or an ambient-vs-ambient
3266
+ * output-name collision. @public
3267
+ */
3268
+ export declare function extractAmbientDts(pkg: PackageJsonLike, options?: ExtractAmbientOptions): ReadonlyArray<AmbientDtsEntry>;
3269
+ /**
3270
+ * Throw {@link ConfigValidationError} if any ambient output name collides with a JS build-entry name.
3271
+ * The JS entry names carry no extension, so each ambient `outName` is compared with its declaration
3272
+ * extension stripped. @public
3273
+ */
3274
+ export declare function assertNoEntryCollisions(jsEntryNames: ReadonlyArray<string>, ambient: ReadonlyArray<AmbientDtsEntry>): void;
3275
+ /**
3276
+ * Maps each build entry to its `package.json` export key: the key whose target is the entry's source, else `.`
3277
+ * for `index` and `./<name>` for the rest.
3278
+ *
3279
+ * @public
3280
+ */
3281
+ export declare function deriveExportPaths(entries: Record<string, string>, exportsMap: Record<string, string> | undefined): Record<string, string>;
3282
+ /** @public */
3283
+ interface PackageJsonEntriesOptions extends ExtractOptions {
3284
+ /** In-memory package.json. If omitted, reads `<cwd>/package.json`. */
3285
+ readonly pkg?: PackageJsonLike;
3286
+ /** Working directory for reading package.json. Defaults to process.cwd(). */
3287
+ readonly cwd?: string;
3288
+ }
3289
+ /**
3290
+ * Derive a tsdown `entry` record (name to source path) from a package.json.
3291
+ *
3292
+ * @public
3293
+ */
3294
+ export declare function packageJsonEntries(options?: PackageJsonEntriesOptions): Record<string, string>;
3295
+ /**
3296
+ * The exact filename `@tsdown/exe` emits for a SEA target, mirroring tsdown's
3297
+ * `resolveOutputFileName`: base fileName + `-<platform>-<arch>` + `.exe` on win.
3298
+ * Single source of truth so the manifest value never drifts from the on-disk file.
3299
+ *
3300
+ * @public
3301
+ */
3302
+ export declare function computeExeFileName(fileName: string, target: ExeTarget): string;
3303
+ /**
3304
+ * A diagnostic flattened to a plain JSON object (only defined fields are present).
3305
+ *
3306
+ * @public
3307
+ */
3308
+ interface PlainDiagnostic {
3309
+ source: DiagnosticEntry["source"];
3310
+ level: DiagnosticEntry["level"];
3311
+ text: string;
3312
+ code?: string;
3313
+ ciFatal?: boolean;
3314
+ file?: string;
3315
+ line?: number;
3316
+ column?: number;
3317
+ }
3318
+ /**
3319
+ * The aggregated build-issues artifact written to `dist/<target>/issues.json`.
3320
+ *
3321
+ * @public
3322
+ */
3323
+ interface BuildIssues {
3324
+ generatedAt: string;
3325
+ package: string;
3326
+ target: "dev" | "prod";
3327
+ /**
3328
+ * Whether the build that produced this artifact reached its end without a terminal failure.
3329
+ *
3330
+ * The artifact is written on EVERY terminal path — success and failure alike — so a reader must
3331
+ * gate on this flag, not on `errors.length`. A crashed build (API Extractor blowing up, a racing
3332
+ * `rm -rf dist`) can leave all three diagnostic buckets empty; without this stamp that file is
3333
+ * byte-identical to a perfectly clean gate. Absent on artifacts written before this field existed;
3334
+ * treat a missing value as unknown rather than as a pass.
3335
+ */
3336
+ buildOk: boolean;
3337
+ /** The terminal error that ended the build. Present only when `buildOk` is false. */
3338
+ failure?: {
3339
+ /** The error's `name` (e.g. `"Error"`, `"ConfigValidationError"`), when it has one. */
3340
+ name?: string;
3341
+ /** The error message, truncated to 2000 characters. */
3342
+ message: string;
3343
+ };
3344
+ warnings: ReadonlyArray<PlainDiagnostic>;
3345
+ errors: ReadonlyArray<PlainDiagnostic>;
3346
+ suppressed: ReadonlyArray<PlainDiagnostic>;
3347
+ }
3348
+ /**
3349
+ * The schema of a {@link PlainDiagnostic}, for reading one back from `issues.json` or a journal.
3350
+ *
3351
+ * @public
3352
+ */
3353
+ export declare const PlainDiagnosticSchema: Schema.Struct<{
3354
+ readonly source: Schema.Literals<readonly ["tsdown", "rolldown", "api-extractor", "meta", "config"]>;
3355
+ readonly level: Schema.Literals<readonly ["warn", "error"]>;
3356
+ readonly text: Schema.String;
3357
+ readonly code: Schema.optionalKey<Schema.String>;
3358
+ readonly ciFatal: Schema.optionalKey<Schema.Boolean>;
3359
+ readonly file: Schema.optionalKey<Schema.String>;
3360
+ readonly line: Schema.optionalKey<Schema.Number>;
3361
+ readonly column: Schema.optionalKey<Schema.Number>;
3362
+ }>;
3363
+ /**
3364
+ * The schema of a {@link BuildIssues} artifact, for reading `dist/<target>/issues.json` back.
3365
+ *
3366
+ * @remarks
3367
+ * `buildOk` is required here: an artifact without the stamp is unknown rather than a pass, so it does not decode.
3368
+ *
3369
+ * @public
3370
+ */
3371
+ export declare const BuildIssuesSchema: Schema.Struct<{
3372
+ readonly generatedAt: Schema.String;
3373
+ readonly package: Schema.String;
3374
+ readonly target: Schema.Literals<readonly ["dev", "prod"]>;
3375
+ readonly buildOk: Schema.Boolean;
3376
+ readonly failure: Schema.optionalKey<Schema.Struct<{
3377
+ readonly name: Schema.optionalKey<Schema.String>;
3378
+ readonly message: Schema.String;
3379
+ }>>;
3380
+ readonly warnings: Schema.$Array<Schema.Struct<{
3381
+ readonly source: Schema.Literals<readonly ["tsdown", "rolldown", "api-extractor", "meta", "config"]>;
3382
+ readonly level: Schema.Literals<readonly ["warn", "error"]>;
3383
+ readonly text: Schema.String;
3384
+ readonly code: Schema.optionalKey<Schema.String>;
3385
+ readonly ciFatal: Schema.optionalKey<Schema.Boolean>;
3386
+ readonly file: Schema.optionalKey<Schema.String>;
3387
+ readonly line: Schema.optionalKey<Schema.Number>;
3388
+ readonly column: Schema.optionalKey<Schema.Number>;
3389
+ }>>;
3390
+ readonly errors: Schema.$Array<Schema.Struct<{
3391
+ readonly source: Schema.Literals<readonly ["tsdown", "rolldown", "api-extractor", "meta", "config"]>;
3392
+ readonly level: Schema.Literals<readonly ["warn", "error"]>;
3393
+ readonly text: Schema.String;
3394
+ readonly code: Schema.optionalKey<Schema.String>;
3395
+ readonly ciFatal: Schema.optionalKey<Schema.Boolean>;
3396
+ readonly file: Schema.optionalKey<Schema.String>;
3397
+ readonly line: Schema.optionalKey<Schema.Number>;
3398
+ readonly column: Schema.optionalKey<Schema.Number>;
3399
+ }>>;
3400
+ readonly suppressed: Schema.$Array<Schema.Struct<{
3401
+ readonly source: Schema.Literals<readonly ["tsdown", "rolldown", "api-extractor", "meta", "config"]>;
3402
+ readonly level: Schema.Literals<readonly ["warn", "error"]>;
3403
+ readonly text: Schema.String;
3404
+ readonly code: Schema.optionalKey<Schema.String>;
3405
+ readonly ciFatal: Schema.optionalKey<Schema.Boolean>;
3406
+ readonly file: Schema.optionalKey<Schema.String>;
3407
+ readonly line: Schema.optionalKey<Schema.Number>;
3408
+ readonly column: Schema.optionalKey<Schema.Number>;
3409
+ }>>;
3410
+ }>;
3411
+ /**
3412
+ * Flatten a build snapshot into the aggregated, de-duplicated issues artifact. Pure.
3413
+ *
3414
+ * `buildOk` defaults to `true`, so an existing caller that never fails keeps its current output plus
3415
+ * the stamp; a caller that also writes on a failure path MUST pass `buildOk: false` (and ideally the
3416
+ * `failure`), otherwise the artifact reads as a clean gate.
3417
+ *
3418
+ * @public
3419
+ */
3420
+ export declare function flattenIssues(reports: ReadonlyArray<BuildReport>, opts: {
3421
+ target: "dev" | "prod";
3422
+ generatedAt: string;
3423
+ buildOk?: boolean | undefined;
3424
+ failure?: {
3425
+ name?: string | undefined;
3426
+ message: string;
3427
+ } | undefined;
3428
+ }): BuildIssues;
3429
+ /**
3430
+ * Serialize the issues artifact to pretty JSON with a trailing newline.
3431
+ *
3432
+ * @public
3433
+ */
3434
+ export declare function serializeIssues(issues: BuildIssues): string;
3435
+ /**
3436
+ * Write the aggregated issues artifact to `<cwd>/dist/<target>/issues.json`. Returns the path written.
3437
+ *
3438
+ * The write is atomic: the JSON lands in a sibling temp file which is then `rename`d over the
3439
+ * destination, so a concurrent reader observes either the previous artifact or the complete new one,
3440
+ * never a torn or half-written file. Pass `buildOk: false` (plus `failure`, when there is an error to
3441
+ * report) on a failure path — see the `buildOk` field of `BuildIssues`.
3442
+ *
3443
+ * @public
3444
+ */
3445
+ export declare function writeIssuesArtifact(opts: {
3446
+ cwd: string;
3447
+ target: "dev" | "prod";
3448
+ reports: ReadonlyArray<BuildReport>;
3449
+ now?: () => Date;
3450
+ buildOk?: boolean | undefined;
3451
+ failure?: {
3452
+ name?: string | undefined;
3453
+ message: string;
3454
+ } | undefined;
3455
+ }): string;
3456
+ declare const IssueJournal_base: import("@effected/jsonl").JournalClass<IssueJournal, "effected/IssueJournal", readonly [JsonlEvent<"issue", Schema.Struct<{
3457
+ readonly source: Schema.Literals<readonly ["tsdown", "rolldown", "api-extractor", "meta", "config"]>;
3458
+ readonly level: Schema.Literals<readonly ["warn", "error"]>;
3459
+ readonly text: Schema.String;
3460
+ readonly code: Schema.optionalKey<Schema.String>;
3461
+ readonly ciFatal: Schema.optionalKey<Schema.Boolean>;
3462
+ readonly file: Schema.optionalKey<Schema.String>;
3463
+ readonly line: Schema.optionalKey<Schema.Number>;
3464
+ readonly column: Schema.optionalKey<Schema.Number>;
3465
+ readonly package: Schema.String;
3466
+ readonly generatedAt: Schema.String;
3467
+ }>, boolean, boolean>], never, never>;
3468
+ /**
3469
+ * The per-diagnostic journal: one line per error and warning of a build, in that order, scoped by package name.
3470
+ * Suppressed diagnostics stay in `issues.json` and are counted on the build's line.
3471
+ *
3472
+ * @public
3473
+ */
3474
+ export declare class IssueJournal extends IssueJournal_base {
3475
+ /**
3476
+ * The journal at `<root>/.cache/effected/issues.jsonl`, with its directory and file created.
3477
+ *
3478
+ * @remarks
3479
+ * Every call is a fresh layer, and every build of one an independent journal: bind it to one const.
3480
+ *
3481
+ * @param root - The workspace root.
3482
+ */
3483
+ static readonly layerAt: (root: string) => Layer.Layer<IssueJournal, PlatformError.PlatformError, FileSystem.FileSystem | JournalWatcher>;
3484
+ }
3485
+ declare const BuildJournal_base: import("@effected/jsonl").JournalClass<BuildJournal, "effected/BuildJournal", readonly [JsonlEvent<"build", Schema.Struct<{
3486
+ readonly package: Schema.String;
3487
+ readonly cwd: Schema.String;
3488
+ readonly generatedAt: Schema.String;
3489
+ readonly buildOk: Schema.Boolean;
3490
+ readonly failure: Schema.optionalKey<Schema.Struct<{
3491
+ readonly name: Schema.optionalKey<Schema.String>;
3492
+ readonly message: Schema.String;
3493
+ }>>;
3494
+ readonly errors: Schema.Number;
3495
+ readonly warnings: Schema.Number;
3496
+ readonly suppressed: Schema.Number;
3497
+ readonly issuesPath: Schema.String;
3498
+ }>, boolean, boolean>], never, never>;
3499
+ /**
3500
+ * The per-build journal: one line per finished build, scoped by package name.
3501
+ *
3502
+ * @public
3503
+ */
3504
+ export declare class BuildJournal extends BuildJournal_base {
3505
+ /**
3506
+ * The journal at `<root>/.cache/effected/build.jsonl`, with its directory and file created.
3507
+ *
3508
+ * @remarks
3509
+ * Every call is a fresh layer, and every build of one an independent journal: bind it to one const.
3510
+ *
3511
+ * @param root - The workspace root.
3512
+ */
3513
+ static readonly layerAt: (root: string) => Layer.Layer<BuildJournal, PlatformError.PlatformError, FileSystem.FileSystem | JournalWatcher>;
3514
+ /**
3515
+ * Appends one finished build: a line per error and warning, then the build's own line.
3516
+ *
3517
+ * @remarks
3518
+ * The build's line goes last, so a watcher that sees it finds that build's issues already written. Each line's
3519
+ * `scope` is the package name, which is what a read filters on. Parallel builds may record at once: each line is
3520
+ * one `O_APPEND` write.
3521
+ *
3522
+ * @param issues - The build's `issues.json`.
3523
+ * @param cwd - The package directory the artifact sits under.
3524
+ */
3525
+ static readonly record: (issues: typeof BuildIssuesSchema.Type, cwd: string) => Effect.Effect<void, AppendError, BuildJournal | IssueJournal>;
3526
+ }
3527
+ /** @public */
3528
+ interface TargetGroupRef {
3529
+ readonly id: string;
3530
+ /** The package.json name this group's manifest carries (the declarative rename). */
3531
+ readonly name: string;
3532
+ readonly isProd: boolean;
3533
+ }
3534
+ /** @public */
3535
+ interface BuildEmittedManifestOptions {
3536
+ readonly pkg: Json;
3537
+ /** The package directory. Catalog and workspace specifiers resolve against the workspace found from here. */
3538
+ readonly cwd: string;
3539
+ readonly targetGroup: TargetGroupRef;
3540
+ readonly devManifest: "preserve" | "resolve";
3541
+ /** Top-level keys deleted from the emitted manifest, after the standard stripping. */
3542
+ readonly drop?: ReadonlyArray<string> | undefined;
3543
+ /** Which exports emit dual import/require conditions. boolean (uniform) or a Set of export keys (per-entry). */
3544
+ readonly dual?: DualExports | undefined;
3545
+ /** Export keys built into a `<key>/index.*` subdir (e.g. an RSPress `./runtime`). */
3546
+ readonly subdirExports?: ReadonlySet<string> | undefined;
3547
+ /** When set, rewrite exports/bin values equal to the exe source to the SEA path and add it to `files`. */
3548
+ readonly exeRewrite?: ExeRewrite | undefined;
3549
+ /** Whether the dts pass ran; `false` omits `types` conditions from the emitted manifest (issue #198). Defaults to `true`. */
3550
+ readonly emitDts?: boolean | undefined;
3551
+ }
3552
+ /**
3553
+ * Whether any of `pkg`'s four dependency fields carries at least one `catalog:`/`workspace:`
3554
+ * specifier. `resolveManifest` returns a manifest with none of these unchanged, so callers can
3555
+ * skip the CatalogResolver + pnpm-workspace + lockfile assembly entirely when this is false.
3556
+ *
3557
+ * @public
3558
+ */
3559
+ export declare function manifestNeedsCatalogResolution(pkg: Json): boolean;
3560
+ /**
3561
+ * Compute the final manifest bytes for a TargetGroup (catalog resolution + standard transforms).
3562
+ *
3563
+ * @public
3564
+ */
3565
+ export declare function buildEmittedManifest(options: BuildEmittedManifestOptions): Promise<Json>;
3566
+ /** @public */
3567
+ interface EmitManifestOptions {
3568
+ readonly targetGroup: TargetGroupRef;
3569
+ readonly devManifest?: "preserve" | "resolve" | undefined;
3570
+ /** Top-level keys deleted from the emitted manifest, after the standard stripping. */
3571
+ readonly drop?: ReadonlyArray<string> | undefined;
3572
+ /** Source package dir to read package.json/LICENSE/README from. */
3573
+ readonly sourceDir: string;
3574
+ /** Which exports emit dual import/require conditions. boolean (uniform) or a Set of export keys (per-entry). */
3575
+ readonly dual?: DualExports | undefined;
3576
+ /** Export keys built into a `<key>/index.*` subdir (e.g. an RSPress `./runtime`). */
3577
+ readonly subdirExports?: ReadonlySet<string> | undefined;
3578
+ /** When set, rewrite exports/bin values equal to the exe source to the SEA path and add it to `files`. */
3579
+ readonly exeRewrite?: ExeRewrite | undefined;
3580
+ /** Whether the dts pass ran; `false` omits `types` conditions from the emitted manifest (issue #198). Defaults to `true`. */
3581
+ readonly emitDts?: boolean | undefined;
3582
+ }
3583
+ /**
3584
+ * Rolldown plugin: emit the transformed package.json + LICENSE/README into the output pkg/ root.
3585
+ *
3586
+ * @public
3587
+ */
3588
+ export declare function emitManifest(options: EmitManifestOptions): Plugin;
3589
+ declare const OgGenerateError_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 & {
3590
+ readonly _tag: "OgGenerateError";
3591
+ } & Readonly<A>;
3592
+ /**
3593
+ * A configured `openGraph.generate` renderer threw, returned no bytes, or returned bytes that are
3594
+ * not an image. Fails the build: a half-written OG image is worse than none.
3595
+ *
3596
+ * @public
3597
+ */
3598
+ export declare class OgGenerateError extends OgGenerateError_base<{
3599
+ readonly packageName: string;
3600
+ readonly cause: unknown;
3601
+ }> {
3602
+ get message(): string;
3603
+ }
3604
+ /**
3605
+ * The renderer an `[package.tsdoctor.openGraph] generate` name selects.
3606
+ *
3607
+ * @remarks
3608
+ * Nothing renders here, but a build asking for an image fails now rather than after its passes when a peer is absent.
3609
+ * Both peers are optional, so the renderer's module and its peers load only for a package that asks. `importModule`
3610
+ * replaces the dynamic import of a peer.
3611
+ *
3612
+ * @public
3613
+ */
3614
+ export declare const resolveOgGenerator: (name: "satori", options: {
3615
+ readonly packageName: string;
3616
+ readonly importModule?: (specifier: string) => Promise<unknown>;
3617
+ }) => Effect.Effect<OgImageGenerator, OgGenerateError>;
3618
+ /**
3619
+ * Where generated images persist across builds, and the salt naming the generator's identity.
3620
+ *
3621
+ * @public
3622
+ */
3623
+ interface OgImageCacheOptions {
3624
+ readonly directory: string;
3625
+ /** Change it whenever the generator's output changes for the same input; the cache cannot see code. */
3626
+ readonly salt: string;
3627
+ }
3628
+ /**
3629
+ * The salt the cross-build cache runs under, or `undefined` to always regenerate: an explicit
3630
+ * `cacheSalt` string wins, `false` disables, and otherwise the generator's own salt applies.
3631
+ *
3632
+ * @public
3633
+ */
3634
+ export declare function resolveOgCacheSalt(generate: OgImageGenerator, cacheSalt: string | false | undefined): string | undefined;
3635
+ /**
3636
+ * Options for {@link writeGeneratedOgImage}.
3637
+ *
3638
+ * @public
3639
+ */
3640
+ interface WriteGeneratedOgImageOptions {
3641
+ readonly generate: (info: OgImageInfo) => Promise<Uint8Array>;
3642
+ readonly info: OgImageInfo;
3643
+ /** The meta bundle dir; the image lands at `og/<unscopedName>.<ext>` beneath it. */
3644
+ readonly outMetaDir: string;
3645
+ readonly unscopedName: string;
3646
+ /** Reuse a previous build's image for the same info and salt; omitted, the generator always runs. */
3647
+ readonly cache?: OgImageCacheOptions | undefined;
3648
+ }
3649
+ /**
3650
+ * Run the generator (or reuse a cached render), size the bytes, and write `og/<unscoped>.<ext>`
3651
+ * under the meta dir. Returns the manifest image entry (bundle-relative path, MIME type, dimensions).
3652
+ *
3653
+ * @public
3654
+ */
3655
+ export declare function writeGeneratedOgImage(options: WriteGeneratedOgImageOptions): Promise<OpenGraphImage>;
3656
+ /**
3657
+ * Rewrite a meta `package.json` so the package's own `version` and any workspace-sibling
3658
+ * dependency version reflect their NEXT release version from `versions`. Pure: returns a new
3659
+ * object, never mutates the input. External/catalog-resolved deps (names absent from `versions`)
3660
+ * are left as-is.
3661
+ * @public
3662
+ */
3663
+ export declare function rewriteMetaVersions(pkg: Record<string, unknown>, versions: ReadonlyMap<string, string>, selfName: string): Record<string, unknown>;
3664
+ /**
3665
+ * Compiler options with enum values converted to their string equivalents.
3666
+ *
3667
+ * @remarks
3668
+ * Open-ended record because TypeScript compiler options vary by version.
3669
+ *
3670
+ * @public
3671
+ */
3672
+ interface ResolvedCompilerOptions {
3673
+ [key: string]: unknown;
3674
+ }
3675
+ /**
3676
+ * Portable, JSON-serializable tsconfig.json (compilerOptions-only).
3677
+ *
3678
+ * @remarks
3679
+ * Designed for virtual TypeScript environments (shiki/Twoslash, API Extractor)
3680
+ * where file paths and emit settings are controlled externally. Holds no
3681
+ * machine-specific absolute paths and no emit/path/file-selection options.
3682
+ *
3683
+ * @public
3684
+ */
3685
+ interface PortableTsconfig {
3686
+ /** JSON schema for IDE support. */
3687
+ $schema: string;
3688
+ /** Compiler options with enum values converted to strings. */
3689
+ compilerOptions: ResolvedCompilerOptions;
3690
+ }
3691
+ /**
3692
+ * Resolves the package's effective compiler options (following `extends`) into a
3693
+ * portable, JSON-serializable tsconfig for the meta release bundle.
3694
+ *
3695
+ * @remarks
3696
+ * Resolves the package's own `<cwd>/tsconfig.json` (which extends the shared
3697
+ * `@effected/plugin/tsconfig/ecma.json` base) via `@effected/tsconfig-json`'s
3698
+ * synchronous `TsconfigLoaderSync` (tsc-parity `extends` resolution) so the
3699
+ * result carries the full effective options (target/module/strict/jsx/lib),
3700
+ * then projects them through the kit's `PortableTsconfig.make` allow-list
3701
+ * filter to a portable, compilerOptions-only shape with no absolute paths or
3702
+ * emit/file-selection options.
3703
+ *
3704
+ * When the package has no own `tsconfig.json` (e.g. a minimal test fixture),
3705
+ * falls back to `fallbackConfigPath` — the build's already-resolved dts tsconfig,
3706
+ * which always exists during a build. If neither is present, returns a minimal
3707
+ * portable config carrying only the virtual-environment flags.
3708
+ *
3709
+ * @param cwd - Absolute package root.
3710
+ * @param fallbackConfigPath - Optional resolved tsconfig to use when the package has no own one.
3711
+ * @returns The portable tsconfig object.
3712
+ *
3713
+ * @public
3714
+ */
3715
+ export declare function resolvePortableTsconfig(cwd: string, fallbackConfigPath?: string): PortableTsconfig;
3716
+ /**
3717
+ * Rolldown plugin: append the CJS default-interop footer to ENTRY chunks of the
3718
+ * `cjs` format that export a default alongside named exports.
3719
+ *
3720
+ * Gated tightly so it never touches the wrong chunk:
3721
+ * - format must be `cjs` (ESM is untouched; `import().default` on ESM is already correct);
3722
+ * - the chunk must be an ENTRY chunk — never a SHARED chunk. Shared chunks are required by
3723
+ * entry chunks via their named bindings (e.g. `require_changesets.changesets_exports.X`);
3724
+ * reassigning a shared chunk's `module.exports` to its own default would break those reads
3725
+ * (many bundled vendor chunks carry an `exports.default`);
3726
+ * - the chunk must export a `default` AND at least one named export. A default-only chunk
3727
+ * already gets `module.exports = <default>` from rolldown, and a named-only chunk has no
3728
+ * default to promote.
3729
+ *
3730
+ * The emitted footer is also self-guarded (`module.exports.default !== void 0`), so it is a
3731
+ * runtime no-op whenever the static gate is ever too generous.
3732
+ * @public
3733
+ */
3734
+ export declare function cjsDefaultInterop(): Plugin;
3735
+ /**
3736
+ * Rewrite a default import / default re-export of a Node built-in into the
3737
+ * equivalent NAMESPACE form, so rolldown's CJS codegen produces correct interop.
3738
+ *
3739
+ * Why this exists — a rolldown 1.1.0 codegen defect (verified against the latest
3740
+ * published rolldown 1.1.0 / tsdown 0.22.2, with no newer release to upgrade to):
3741
+ *
3742
+ * ```ts
3743
+ * // SOURCE (e.g. vfile's lib/minproc.js)
3744
+ * export {default as minproc} from 'node:process'
3745
+ * // ...consumed as minproc.cwd()
3746
+ *
3747
+ * // rolldown CJS OUTPUT (BROKEN)
3748
+ * let node_process = require("node:process");
3749
+ * node_process.default.cwd() // <- require("node:process").default is undefined
3750
+ * ```
3751
+ *
3752
+ * For a default import of an EXTERNAL Node builtin, rolldown emits a bare
3753
+ * `require("node:x")` WITHOUT its `__toESM` interop wrapper, yet still accesses
3754
+ * `.default` — which is `undefined` on a builtin's CJS export object, so the call
3755
+ * throws `Cannot read properties of undefined (reading 'cwd')` at runtime. NAMED
3756
+ * imports are unaffected (`(0, node_process.cwd)()` reads a real property), and a
3757
+ * NAMESPACE import is handled correctly: rolldown wraps it as
3758
+ * `node_process = __toESM(require("node:process"), 1)`, which synthesizes `.default`
3759
+ * and copies every own property, so member access works. This transform converts the
3760
+ * broken default form into the working namespace form BEFORE codegen, so it is immune
3761
+ * to minification and applies identically to per-module and bundled output.
3762
+ *
3763
+ * rolldown exposes no Rollup-style `output.interop` knob to fix this at the output
3764
+ * layer, which is why the correction happens here on the source.
3765
+ *
3766
+ * Rewrites (the two static forms that occur in practice, anchored to statement start):
3767
+ *
3768
+ * ```ts
3769
+ * import NAME from "node:x" -> import * as NAME from "node:x"
3770
+ * export { default as NAME } from "node:x" -> export * as NAME from "node:x"
3771
+ * import NAME, { a, b } from "node:x" -> import * as NAME from "node:x"; import { a, b } from "node:x"
3772
+ * ```
3773
+ *
3774
+ * The namespace binding NAME carries the builtin's named exports (`NAME.cwd`,
3775
+ * `NAME.join`, ...), which is exactly how a default import of a builtin is consumed
3776
+ * in practice. ESM output is unaffected at runtime (a namespace import of a builtin
3777
+ * resolves to the same members), so the plugin is safe to attach to dual builds.
3778
+ * @public
3779
+ */
3780
+ export declare function nodeBuiltinDefaultInterop(): Plugin;
3781
+ /**
3782
+ * Remove declaration source-map files (`.d.ts.map` / `.d.cts.map`) from a built `pkg`
3783
+ * directory, returning the removed paths.
3784
+ *
3785
+ * The dts pass emits these next to each `.d.ts` (the resolved dts tsconfig sets
3786
+ * `declarationMap: true`) because API Extractor reads them during meta generation to
3787
+ * resolve original-source positions. But they are dead weight in a PUBLISHED package —
3788
+ * they reference `.ts` sources the tarball does not ship — and they leak local source
3789
+ * paths, so the prod build strips them AFTER meta generation has consumed them. The dev
3790
+ * build keeps them (it is never published, and `savvy build --target meta` reads them).
3791
+ *
3792
+ * Recurses, but skips `node_modules` so it does not traverse a self-contained bundle's
3793
+ * vendored tree — only the package's own emitted declarations carry maps worth stripping.
3794
+ * @public
3795
+ */
3796
+ export declare function removeDeclarationMaps(pkgDir: string): string[];
3797
+ /**
3798
+ * Copy the CONTENTS of `sourceDir` into `outDir`, additively.
3799
+ *
3800
+ * Each `sourceDir/<rel>` copies to `outDir/<rel>` — only the `public/` directory itself is dropped;
3801
+ * the substructure under it is preserved (`public/tsconfig/ecma.json` becomes `<pkg>/tsconfig/ecma.json`,
3802
+ * NOT `<pkg>/ecma.json`). The published manifest mirrors this drop via `transformExports`, which strips
3803
+ * a leading `public/` from export values. This function NEVER deletes: `outDir` is the shared package
3804
+ * root that the JS/dts passes own, so deleting "files not in source" would wipe the build product.
3805
+ * Stale-asset pruning on a non-clean rebuild is therefore out of scope (a full build's `clean: true` handles it).
3806
+ *
3807
+ * Collision guard: when a destination already exists, identical bytes mean a prior copy of the same
3808
+ * asset (skipped); anything else — differing bytes, a directory where a file is needed, or a file
3809
+ * where a parent directory is needed — means a built output occupies that path, so it throws
3810
+ * {@link ConfigValidationError} rather than clobbering it or surfacing a raw fs error.
3811
+ * @public
3812
+ */
3813
+ export declare function copyPublicDir(sourceDir: string, outDir: string): void;
3814
+ /** @public */
3815
+ interface CopyAmbientDtsOptions {
3816
+ /** The ambient exports to copy (from `extractAmbientDts`). */
3817
+ readonly ambient: ReadonlyArray<AmbientDtsEntry>;
3818
+ /** Package root the `source` paths are relative to. */
3819
+ readonly srcCwd: string;
3820
+ /** The built package dir to copy into (e.g. `dist/prod/npm/pkg`). */
3821
+ readonly outDir: string;
3822
+ }
3823
+ /**
3824
+ * Copy each ambient `.d.ts` export's source verbatim into `outDir/<outName>`, byte-stable (an
3825
+ * unchanged file keeps its timestamp). The copy is NOT compiled or bundled, so the build owns two
3826
+ * fast-fail checks: the source must exist, and it must be self-contained — a relative
3827
+ * import/export/reference would not resolve once the file is flattened to the package root.
3828
+ *
3829
+ * Throws {@link ConfigValidationError} on a missing source or any relative specifier.
3830
+ * @public
3831
+ */
3832
+ export declare function copyAmbientDts(options: CopyAmbientDtsOptions): void;
3833
+ /**
3834
+ * Render a build report as GitHub Actions workflow-command annotations, one `::error` or `::warning`
3835
+ * line per diagnostic. Suppressed diagnostics are never annotated. Pure.
3836
+ *
3837
+ * @remarks
3838
+ * The text is a diagnostic's, so it is untrusted: control characters are removed, so it cannot repaint a terminal, and
3839
+ * property values have `:` and `,` escaped, so a file name cannot forge a property or end the list.
3840
+ *
3841
+ * @public
3842
+ */
3843
+ export declare function renderCiAnnotations(report: BuildReport): ReadonlyArray<string>;
3844
+ /**
3845
+ * Rolldown plugin that records emitted-file metrics into the BuildCollector via writeBundle (which
3846
+ * fires for the JS pass AND the emitDtsOnly dts pass — verified against tsdown 0.22.3), plus a
3847
+ * defensive onLog for rolldown-level diagnostics that bypass tsdown's logger. Append it to each
3848
+ * build pass's `plugins` array. `bytes` is taken from the in-memory chunk/asset content (no fs);
3849
+ * `gzip` is computed only when `verbose`.
3850
+ *
3851
+ * Set `suppressMixedExports` for a pass whose emitted CJS carries the `cjsDefaultInterop()`
3852
+ * footer — see the onLog comment below for why rolldown's MIXED_EXPORTS advice does not apply
3853
+ * there.
3854
+ * @public
3855
+ */
3856
+ export declare function buildMetricsPlugin(collector: BuildCollector, groupId: string, pass: PassKind, verbose: boolean, suppressMixedExports?: boolean): Plugin;
3857
+ /** @public */
3858
+ export declare function formatTime(ms: number): string;
3859
+ /** @public */
3860
+ interface Timer {
3861
+ readonly elapsed: () => number;
3862
+ readonly format: () => string;
3863
+ }
3864
+ /**
3865
+ * Create a wall-clock timer. (Date.now is fine in runtime build code.)
3866
+ *
3867
+ * @public
3868
+ */
3869
+ export declare function createTimer(now?: () => number): Timer;
3870
+ /**
3871
+ * Structural match for tsdown's Logger interface (tsdown 0.22.x).
3872
+ *
3873
+ * @public
3874
+ */
3875
+ interface TsdownLogger {
3876
+ level: "info";
3877
+ info: (...args: unknown[]) => void;
3878
+ warn: (...args: unknown[]) => void;
3879
+ warnOnce: (...args: unknown[]) => void;
3880
+ error: (...args: unknown[]) => void;
3881
+ success: (...args: unknown[]) => void;
3882
+ clearScreen: () => void;
3883
+ }
3884
+ /**
3885
+ * A tsdown `customLogger` that routes warnings/errors into the BuildCollector instead of the
3886
+ * console. Paired with `logLevel: "silent"` in the same build config: silent suppresses tsdown's
3887
+ * own console output while this logger still receives every message (verified against tsdown 0.22.3).
3888
+ * info/success are dropped — file metrics come from the writeBundle plugin and timing from our timer.
3889
+ * @public
3890
+ */
3891
+ export declare function createTsdownLogger(collector: BuildCollector, groupId: string): TsdownLogger;
3892
+ /**
3893
+ * Write the target-to-group binding to dist/prod/targets.json for the release action to consume. Returns the path.
3894
+ *
3895
+ * @public
3896
+ */
3897
+ export declare function writeTargetsBinding(cwd: string, resolution: TargetResolution): string;
3898
+ /**
3899
+ * Resolve a `publishConfig.targets` map into the distinct groups to build and every target bound to one. Pure; throws ConfigValidationError on structurally-invalid config.
3900
+ *
3901
+ * @public
3902
+ */
3903
+ export declare function resolveTargets(options: {
3904
+ targets: PublishTargets;
3905
+ baseName: string;
3906
+ }): TargetResolution;
3907
+ /**
3908
+ * Advisory warnings for a resolved target set that is valid but probably not what was meant.
3909
+ *
3910
+ * @remarks
3911
+ * Today the only one is a set whose every target is `releases: "prerelease"`, which leaves final
3912
+ * versions with nowhere to publish. A warning rather than a {@link ConfigValidationError}, since a
3913
+ * prerelease-only package is a legitimate if unusual setup. Pure; returns one message per finding.
3914
+ *
3915
+ * @public
3916
+ */
3917
+ export declare function releaseWarnings(resolution: TargetResolution): ReadonlyArray<string>;
3918
+ export { type ActionBuilderError, type ActionBuilderOptions, type ActionValidationRunOptions, type AmbientDtsEntry, type BuildEmittedManifestOptions, type BuildFormat$1 as BuildFormatOption, type BuildGroupSpec, type BuildIssues, type BuildPlatform$1 as BuildPlatformOption, type BuildTargetGroupsOptions, type BundlerBuildOptions, type BundlerPackageJson, type BundlerSeams, type ComposeManifestInput, type CopyAmbientDtsOptions, type CssOptions, type DeriveOptions, type DerivedDeclarationsPassOptions, type DerivedDtsPassOptions, type DerivedTsdownOptions, type DiagnosticInput, type DtsEmitTsconfigOptions, type DtsExportClass, type DtsPassDtsOptions, type DualExports, type EmitManifestOptions, type EntryOverride$1 as EntryOverrideOptions, type ExeBuild, type ExeConfig$1 as ExeOptions, type ExeRewrite, type ExeSeaConfig$1 as ExeSeaOptions, type ExeTarget, type ExeTargetInput, type ExtractAmbientOptions, type ExtractOptions, type ExtractResult, type GenerateMetaOptions, type Json, type KnownRegistryType, type LooseFileSpec as LooseFileOptions, LooseFileSpec$1 as LooseFileSpec, type LooseFiles, type ManifestLike, type ManifestRepository, type ManifestTarget, type MetaOptions, type MetaResult, type TsdocTagDefinition as MetaTsdocTagDefinition, type WarningSuppressionRule as MetaWarningSuppressionRule, type ModuleExportNames, type NextVersions, type NormalizedExe, type NormalizedLooseFile, type NormalizedMeta, type OgImageCacheOptions, type OgImageGenerator, type OgImageInfo, type PackageJsonEntriesOptions, type PackageJsonLike, type PassKind, type PkgOsCpu, type PlainDiagnostic, type PortableTsconfig, type PublishTargetObject, type PublishTargetValue, type PublishTargets, type ReexportBarrelAnalysis, type ReleaseChannel, type ResolvedCompilerOptions, type ResolvedGroup, type JsxConfig$1 as ResolvedJsxConfig, type ResolvedTarget, type ResolvedTsconfig, type ResolvedTsconfigOptions, type RunExeBuildOptions, type RunMetaPassOptions, type TargetGroupId, type TargetGroupRef, type TargetResolution, type Timer, type TransformManifestOptions, type TsconfigJsx, type TsdocOptions, TsdocTagDefinition$1 as TsdocTagDefinition, type TsdoctorMetaOptions, type TsdoctorSources, type TsdownBuild, type TsdownLogger, type ValidationInput, WarningSuppressionRule$1 as WarningSuppressionRule, type WriteGeneratedOgImageOptions };
3919
+ //# sourceMappingURL=index.d.ts.map