@savvy-web/tsdown-plugins 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.
- package/README.md +61 -0
- package/build/build-target-groups.js +133 -0
- package/build/cjs-default-interop.js +98 -0
- package/build/node-builtin-default-interop.js +74 -0
- package/build/strip-maps.js +40 -0
- package/build/sync-public.js +67 -0
- package/build/target-groups.js +52 -0
- package/catalog/resolve-catalogs.js +24 -0
- package/config-validation/ConfigValidator.js +8 -0
- package/config-validation/ConfigValidatorLive.js +61 -0
- package/dts/resolved-tsconfig.js +44 -0
- package/entry/extract.js +68 -0
- package/entry/package-json-entries.js +12 -0
- package/errors.js +36 -0
- package/exe/build.js +23 -0
- package/exe/config.js +50 -0
- package/index.d.ts +1457 -0
- package/index.js +44 -0
- package/jsx/config.js +40 -0
- package/manifest/emit-manifest.js +56 -0
- package/manifest/transform.js +123 -0
- package/meta/api-extractor.js +59 -0
- package/meta/config.js +14 -0
- package/meta/generate.js +76 -0
- package/meta/merge-models.js +44 -0
- package/meta/message-suppressor.js +37 -0
- package/meta/tsconfig-resolver.js +260 -0
- package/meta/tsdoc-config.js +47 -0
- package/package.json +45 -0
- package/report/formatters/ci-annotations.js +20 -0
- package/report/formatters/json.js +12 -0
- package/report/formatters/markdown.js +25 -0
- package/report/formatters/silent.js +8 -0
- package/report/formatters/terminal.js +29 -0
- package/report/layers/EnvironmentDetectorLive.js +15 -0
- package/report/layers/ExecutorResolverLive.js +8 -0
- package/report/layers/FormatSelectorLive.js +8 -0
- package/report/layers/OutputRendererLive.js +23 -0
- package/report/pipeline.js +25 -0
- package/report/schema-export.js +18 -0
- package/report/schema.js +19 -0
- package/report/services/EnvironmentDetector.js +7 -0
- package/report/services/ExecutorResolver.js +7 -0
- package/report/services/FormatSelector.js +7 -0
- package/report/services/OutputRenderer.js +7 -0
- package/report/timer.js +15 -0
- package/targets/binding.js +15 -0
- package/targets/config.js +8 -0
- package/targets/resolve-targets.js +126 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,1457 @@
|
|
|
1
|
+
import { CatalogAssemblyError, CatalogResolutionError, ManifestLike, ManifestLike as ManifestLike$1 } from "workspaces-effect";
|
|
2
|
+
import { Plugin } from "rolldown";
|
|
3
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
4
|
+
import { JsxEmit, ModuleDetectionKind, ModuleKind, ModuleResolutionKind, NewLineKind, ParsedCommandLine, ScriptTarget } from "typescript";
|
|
5
|
+
import * as Schema$1 from "effect/Schema";
|
|
6
|
+
import * as Effect$1 from "effect/Effect";
|
|
7
|
+
import { Option } from "effect/Option";
|
|
8
|
+
import { Scope } from "effect/Scope";
|
|
9
|
+
import { Sink } from "effect/Sink";
|
|
10
|
+
import { Stream } from "effect/Stream";
|
|
11
|
+
import * as Brand from "effect/Brand";
|
|
12
|
+
import { Tag } from "effect/Context";
|
|
13
|
+
import { JsonSchemaError, JsonSchemaOutput } from "json-schema-effect";
|
|
14
|
+
|
|
15
|
+
//#region src/jsx/config.d.ts
|
|
16
|
+
/** Resolved JSX transform settings, mirroring the subset of rolldown's JsxOptions the bundler forwards. */
|
|
17
|
+
interface JsxConfig {
|
|
18
|
+
/** "automatic" auto-imports the JSX factories (react-jsx); "classic" does not (React.createElement). */
|
|
19
|
+
readonly runtime?: "classic" | "automatic" | undefined;
|
|
20
|
+
/** The JSX import source for the automatic runtime (e.g. "react", "preact"). */
|
|
21
|
+
readonly importSource?: string | undefined;
|
|
22
|
+
}
|
|
23
|
+
/** The jsx-relevant slice of a tsconfig's compilerOptions. */
|
|
24
|
+
interface TsconfigJsx {
|
|
25
|
+
readonly jsx?: string | undefined;
|
|
26
|
+
readonly jsxImportSource?: string | undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Resolve the effective JSX config: an explicit override wins; otherwise infer from the tsconfig
|
|
30
|
+
* values. Returns undefined when no JSX transform is needed (preserve/none).
|
|
31
|
+
*/
|
|
32
|
+
declare function resolveJsxConfig(tsconfig: TsconfigJsx, override: JsxConfig | undefined): JsxConfig | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Read the jsx-relevant compilerOptions from a package's own tsconfig.json (best-effort;
|
|
35
|
+
* returns empty on absence or parse error).
|
|
36
|
+
*/
|
|
37
|
+
declare function readTsconfigJsx(cwd: string): TsconfigJsx;
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/manifest/transform.d.ts
|
|
40
|
+
type Json = Record<string, unknown>;
|
|
41
|
+
/**
|
|
42
|
+
* Which exports get a CJS `require` condition. `true`/`false` apply uniformly to every
|
|
43
|
+
* TS export; a Set marks ONLY the listed export keys (e.g. "./changesets/markdownlint")
|
|
44
|
+
* as dual — used by per-entry format overrides.
|
|
45
|
+
*/
|
|
46
|
+
type DualExports = boolean | ReadonlySet<string>;
|
|
47
|
+
/**
|
|
48
|
+
* The default `transform` applied to every package's manifest when its
|
|
49
|
+
* `savvy.build.ts` does not provide one of its own. Strips the build/dev-only
|
|
50
|
+
* fields in {@link NON_PUBLISHED_FIELDS} from the emitted package.json.
|
|
51
|
+
*
|
|
52
|
+
* This is the pattern nearly every package repeated by hand (inherited from
|
|
53
|
+
* rslib-builder); `defineBuild` now applies it automatically so a package needs a
|
|
54
|
+
* `transform` only when it has genuinely custom manifest work to do (e.g. silk
|
|
55
|
+
* promoting workspace deps to peerDependencies). A custom transform REPLACES this
|
|
56
|
+
* default — re-export it and call it from a custom transform to keep the stripping.
|
|
57
|
+
*
|
|
58
|
+
* `targetGroup` is accepted (so this is assignable wherever the full transform
|
|
59
|
+
* signature is expected) but unused; the strip is identical for every group.
|
|
60
|
+
*
|
|
61
|
+
* Pure: the supplied `pkg` is NOT mutated — a shallow copy with the fields removed
|
|
62
|
+
* is returned, so external callers invoking this from a custom transform keep their
|
|
63
|
+
* input intact.
|
|
64
|
+
*/
|
|
65
|
+
declare function defaultManifestTransform({
|
|
66
|
+
pkg
|
|
67
|
+
}: {
|
|
68
|
+
pkg: Json;
|
|
69
|
+
}): Json;
|
|
70
|
+
/**
|
|
71
|
+
* Rewrite an exports map: TS string targets become a types/import conditions object.
|
|
72
|
+
* Each TS condition also gets a `require` entry when `dual` is `true` (uniform) or when
|
|
73
|
+
* the export key is in the `dual` Set (per-entry).
|
|
74
|
+
*
|
|
75
|
+
* The output path is derived from the export KEY via the shared entry-name function,
|
|
76
|
+
* never from the source path, so the manifest target always matches the emitted file.
|
|
77
|
+
*/
|
|
78
|
+
declare function transformExports(exports: unknown, dual?: DualExports): unknown;
|
|
79
|
+
/** Rewrite bin: TS targets to bin/[command].js (string to bin/cli.js); strip leading ./ otherwise. */
|
|
80
|
+
declare function transformBin(bin: unknown): unknown;
|
|
81
|
+
/** FINAL guard: strip leading ./ from bin paths (npm 11.x drops ./-prefixed bins). */
|
|
82
|
+
declare function normalizeBinPaths(bin: unknown): unknown;
|
|
83
|
+
interface TransformManifestOptions {
|
|
84
|
+
/** Run after the standard transforms, before the bin final-guard + sort. */
|
|
85
|
+
readonly transform?: ((pkg: Json) => Json) | undefined;
|
|
86
|
+
/** Which exports emit dual import/require conditions. boolean = uniform; Set = per-export-key. */
|
|
87
|
+
readonly dual?: DualExports | undefined;
|
|
88
|
+
}
|
|
89
|
+
/** Apply the full standard manifest transform (excluding catalog resolution, done upstream). */
|
|
90
|
+
declare function transformManifest(pkg: Json, options?: TransformManifestOptions): Json;
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/manifest/emit-manifest.d.ts
|
|
93
|
+
interface TargetGroupRef {
|
|
94
|
+
readonly id: string;
|
|
95
|
+
/** The package.json name this group's manifest carries (the declarative rename). */
|
|
96
|
+
readonly name: string;
|
|
97
|
+
readonly isProd: boolean;
|
|
98
|
+
}
|
|
99
|
+
interface BuildEmittedManifestOptions {
|
|
100
|
+
readonly pkg: Json;
|
|
101
|
+
readonly targetGroup: TargetGroupRef;
|
|
102
|
+
readonly devManifest: "preserve" | "resolve";
|
|
103
|
+
readonly transform?: ((args: {
|
|
104
|
+
pkg: Json;
|
|
105
|
+
targetGroup: TargetGroupRef;
|
|
106
|
+
}) => Json) | undefined;
|
|
107
|
+
/** Which exports emit dual import/require conditions. boolean (uniform) or a Set of export keys (per-entry). */
|
|
108
|
+
readonly dual?: DualExports | undefined;
|
|
109
|
+
}
|
|
110
|
+
/** Compute the final manifest bytes for a TargetGroup (catalog resolution + standard transforms). */
|
|
111
|
+
declare function buildEmittedManifest(options: BuildEmittedManifestOptions): Promise<Json>;
|
|
112
|
+
interface EmitManifestOptions {
|
|
113
|
+
readonly targetGroup: TargetGroupRef;
|
|
114
|
+
readonly devManifest?: "preserve" | "resolve" | undefined;
|
|
115
|
+
readonly transform?: ((args: {
|
|
116
|
+
pkg: Json;
|
|
117
|
+
targetGroup: TargetGroupRef;
|
|
118
|
+
}) => Json) | undefined;
|
|
119
|
+
/** Source package dir to read package.json/LICENSE/README from. */
|
|
120
|
+
readonly sourceDir: string;
|
|
121
|
+
/** Which exports emit dual import/require conditions. boolean (uniform) or a Set of export keys (per-entry). */
|
|
122
|
+
readonly dual?: DualExports | undefined;
|
|
123
|
+
}
|
|
124
|
+
/** Rolldown plugin: emit the transformed package.json + LICENSE/README into the output pkg/ root. */
|
|
125
|
+
declare function emitManifest(options: EmitManifestOptions): Plugin;
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/build/target-groups.d.ts
|
|
128
|
+
/** A build group id: "dev" or any prod byte-variant id (e.g. "npm", "github", a custom key). */
|
|
129
|
+
type TargetGroupId = string;
|
|
130
|
+
/** An output module format the build can emit. */
|
|
131
|
+
type BuildFormat = "esm" | "cjs";
|
|
132
|
+
/** A prod/dev group to build: its folder id and the resolved package name its manifest carries. */
|
|
133
|
+
interface BuildGroupSpec {
|
|
134
|
+
readonly id: TargetGroupId;
|
|
135
|
+
readonly name: string;
|
|
136
|
+
}
|
|
137
|
+
interface DeriveOptions {
|
|
138
|
+
readonly group: TargetGroupId;
|
|
139
|
+
readonly cwd: string;
|
|
140
|
+
readonly version: string;
|
|
141
|
+
readonly entry: Record<string, string>;
|
|
142
|
+
readonly tsconfigPath: string;
|
|
143
|
+
readonly devManifest: "preserve" | "resolve";
|
|
144
|
+
readonly externals?: ReadonlyArray<string>;
|
|
145
|
+
/** Output formats to emit. Defaults to esm-only when unset. */
|
|
146
|
+
readonly format?: ReadonlyArray<BuildFormat> | undefined;
|
|
147
|
+
/** Minify prod output (prod groups only; dev is never minified). Defaults to false. */
|
|
148
|
+
readonly minify?: boolean | undefined;
|
|
149
|
+
/** JSX transform settings to forward to rolldown's inputOptions. */
|
|
150
|
+
readonly jsx?: JsxConfig | undefined;
|
|
151
|
+
/**
|
|
152
|
+
* External packages whose declarations should be INLINED into the bundled dts
|
|
153
|
+
* (the rslib `dtsBundledPackages` equivalent). Maps to tsdown's `deps.onlyBundle`
|
|
154
|
+
* in the dts pass, so ONLY these node_modules packages are rolled into the
|
|
155
|
+
* `.d.ts` and every other dependency stays an external `import`. dts-pass-only:
|
|
156
|
+
* runtime JS bundling is unaffected.
|
|
157
|
+
*/
|
|
158
|
+
readonly bundledPackages?: ReadonlyArray<string> | undefined;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* The JS pass: per-module JavaScript, no declarations.
|
|
162
|
+
*
|
|
163
|
+
* The build runs TWO tsdown passes per TargetGroup to the SAME outDir:
|
|
164
|
+
* - pass 1 (this) emits per-module JS (`unbundle: true`) with `dts: false` and the
|
|
165
|
+
* default `clean: true`, so it starts from a fresh outDir;
|
|
166
|
+
* - pass 2 (`DerivedDtsPassOptions`) emits ONLY bundled declarations (`unbundle: false`,
|
|
167
|
+
* `dts: { emitDtsOnly: true }`) with `clean: false`, so it must NOT wipe pass 1.
|
|
168
|
+
*
|
|
169
|
+
* We cannot do this in a single pass: tsdown's `unbundle` maps to rolldown
|
|
170
|
+
* `output.preserveModules` for the WHOLE build, and the dts plugin shares it — so one pass
|
|
171
|
+
* gives EITHER per-module JS + per-module dts OR bundled JS + bundled dts. Per-module dts
|
|
172
|
+
* breaks type portability (TS2883) when a package exports only its root entry, and bundling
|
|
173
|
+
* the JS re-bundles workspace consumers (e.g. silk re-bundling silk-effects crashes at
|
|
174
|
+
* runtime). The split keeps per-module JS (no re-bundle hazard) AND bundled, self-contained
|
|
175
|
+
* declarations (no TS2883).
|
|
176
|
+
*/
|
|
177
|
+
interface DerivedTsdownOptions {
|
|
178
|
+
readonly outDir: string;
|
|
179
|
+
readonly sourcemap: boolean;
|
|
180
|
+
readonly minify: boolean;
|
|
181
|
+
readonly format: ReadonlyArray<BuildFormat>;
|
|
182
|
+
readonly unbundle: true;
|
|
183
|
+
/** JS pass starts fresh; it owns the outDir before the dts pass appends to it. */
|
|
184
|
+
readonly clean: true;
|
|
185
|
+
readonly platform: "node";
|
|
186
|
+
/**
|
|
187
|
+
* Controls output file extensions. Always false for this builder.
|
|
188
|
+
*
|
|
189
|
+
* tsdown 0.22.2 finding (verified by running a real esm+cjs build of a type:module package):
|
|
190
|
+
* - With fixedExtension: false, tsdown emits ESM index.js plus CJS index.cjs for a
|
|
191
|
+
* type:module package in the JS pass. There is no collision: tsdown derives the .js
|
|
192
|
+
* extension for ESM and the .cjs extension for CJS automatically. An earlier M1.1 note
|
|
193
|
+
* claimed the two formats collide on ambient .js under fixedExtension: false; that claim
|
|
194
|
+
* was wrong and is corrected here.
|
|
195
|
+
* - This .js plus .cjs scheme is the one we want. It matches the rslib parity target, where
|
|
196
|
+
* silk's dual-format output uses import: .js, require: .cjs, and a single types: .d.ts, and
|
|
197
|
+
* it matches the flat manifest the emit-manifest transform writes.
|
|
198
|
+
* - Setting fixedExtension: true would instead yield .mjs plus .cjs (and .d.mts plus .d.cts),
|
|
199
|
+
* which is NOT wanted, so dual-format needs no fixedExtension change and we leave it false.
|
|
200
|
+
* - The matching `.d.ts` / `.d.cts` declarations are emitted by the SEPARATE dts pass (see
|
|
201
|
+
* `DerivedDtsPassOptions`), which keeps `unbundle: false` so the declarations are rolled up.
|
|
202
|
+
*/
|
|
203
|
+
readonly fixedExtension: false;
|
|
204
|
+
readonly entry: Record<string, string>;
|
|
205
|
+
/** JS pass emits no declarations; the dts pass owns them. */
|
|
206
|
+
readonly dts: false;
|
|
207
|
+
readonly define: Record<string, string>;
|
|
208
|
+
readonly isProd: boolean;
|
|
209
|
+
/**
|
|
210
|
+
* CJS named-export interop, the equivalent of rslib's cjsInterop: true. This is the real
|
|
211
|
+
* tsdown option name, so it threads straight to the build with no rename.
|
|
212
|
+
*
|
|
213
|
+
* tsdown 0.22.2 finding (verified against the dist Options dts plus the build source):
|
|
214
|
+
* - cjsDefault is a top-level boolean, default true. The build maps it to rolldown's
|
|
215
|
+
* output.exports: cjsDefault ? "auto" : "named", and also silences the MIXED_EXPORT
|
|
216
|
+
* warning. With "auto", a module whose only default-style export is a single default
|
|
217
|
+
* becomes module.exports = value, while named exports stay attached, so a require() call
|
|
218
|
+
* returns the value directly and named exports survive, the interop rslib gives with
|
|
219
|
+
* cjsInterop: true.
|
|
220
|
+
* - We only set it (to true) when cjs is in the format, so esm-only builds leave the tsdown
|
|
221
|
+
* default untouched and stay byte-identical to before.
|
|
222
|
+
*/
|
|
223
|
+
readonly cjsDefault?: boolean | undefined;
|
|
224
|
+
/** JSX transform settings to forward to rolldown's inputOptions. */
|
|
225
|
+
readonly jsx?: JsxConfig | undefined;
|
|
226
|
+
}
|
|
227
|
+
/** Derive the JS-pass tsdown options for one TargetGroup (per-module JS, no dts). */
|
|
228
|
+
declare function deriveTargetGroupOptions(options: DeriveOptions): DerivedTsdownOptions;
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/build/build-target-groups.d.ts
|
|
231
|
+
/** Signature compatible with tsdown's `build(inlineConfig)`. */
|
|
232
|
+
type TsdownBuild = (config: Record<string, unknown>) => Promise<unknown>;
|
|
233
|
+
/**
|
|
234
|
+
* One entry partition built with its own format + bundling posture, layered into the
|
|
235
|
+
* SAME outDir as the base build (clean:false). Anything omitted falls back to the base
|
|
236
|
+
* build's value. `entry` is a subset of the package's entries (entryName -> source path).
|
|
237
|
+
*/
|
|
238
|
+
interface EntryOverride {
|
|
239
|
+
readonly entry: Record<string, string>;
|
|
240
|
+
readonly format?: ReadonlyArray<BuildFormat> | undefined;
|
|
241
|
+
readonly externals?: ReadonlyArray<string> | undefined;
|
|
242
|
+
readonly bundle?: ReadonlyArray<string> | undefined;
|
|
243
|
+
readonly bundleNodeModules?: boolean | undefined;
|
|
244
|
+
readonly bundledPackages?: ReadonlyArray<string> | undefined;
|
|
245
|
+
readonly dtsExternals?: ReadonlyArray<string> | undefined;
|
|
246
|
+
}
|
|
247
|
+
interface BuildTargetGroupsOptions {
|
|
248
|
+
readonly cwd: string;
|
|
249
|
+
readonly version: string;
|
|
250
|
+
readonly entry: Record<string, string>;
|
|
251
|
+
readonly tsconfigPath: string;
|
|
252
|
+
readonly groups: ReadonlyArray<BuildGroupSpec>;
|
|
253
|
+
readonly devManifest: "preserve" | "resolve";
|
|
254
|
+
readonly externals?: ReadonlyArray<string>;
|
|
255
|
+
/**
|
|
256
|
+
* Packages externalized in the dts pass ONLY — emitted as `import ... from "..."`
|
|
257
|
+
* references in the `.d.ts` rather than inlined — while the JS pass still bundles
|
|
258
|
+
* them per `bundleNodeModules`. The dts pass `neverBundle` becomes the union of
|
|
259
|
+
* `externals` and `dtsExternals`. Use when a dependency's types cannot be safely
|
|
260
|
+
* inlined into a single bundled declaration file (e.g. effect's cross-module
|
|
261
|
+
* `declare module` augmentations, which inline into conflicting interface
|
|
262
|
+
* extensions in consumers). The JS pass is unaffected.
|
|
263
|
+
*/
|
|
264
|
+
readonly dtsExternals?: ReadonlyArray<string> | undefined;
|
|
265
|
+
/**
|
|
266
|
+
* External packages whose declarations are inlined into the bundled dts
|
|
267
|
+
* (rslib `dtsBundledPackages` equivalent). Forwarded to the dts pass as
|
|
268
|
+
* `deps.dts.alwaysBundle` alongside `skipNodeModulesBundle: true`; unlike
|
|
269
|
+
* `deps.onlyBundle` this does not enable tsdown's strict-mode check that
|
|
270
|
+
* errors on every unlisted transitive dependency. The JS pass is unaffected.
|
|
271
|
+
*/
|
|
272
|
+
readonly bundledPackages?: ReadonlyArray<string> | undefined;
|
|
273
|
+
/**
|
|
274
|
+
* Force-bundle node_modules (and workspace) JS dependencies that are not
|
|
275
|
+
* externalized, restoring the rslib bundle-everything-except-externals
|
|
276
|
+
* behavior. Sets tsdown `deps.skipNodeModulesBundle: false`; the dts pass
|
|
277
|
+
* posture mirrors the JS pass, so the bundled declarations are also
|
|
278
|
+
* self-contained. Defaults to false (current behavior).
|
|
279
|
+
*/
|
|
280
|
+
readonly bundleNodeModules?: boolean | undefined;
|
|
281
|
+
/**
|
|
282
|
+
* Force-bundle (inline) these packages into the JS output (tsdown `deps.alwaysBundle`),
|
|
283
|
+
* even declared deps that would otherwise be auto-externalized. The inverse of
|
|
284
|
+
* `externals`. JS pass only; `alwaysBundle` is allowed alongside our `skipNodeModulesBundle:
|
|
285
|
+
* false` (the throw only fires when skipNodeModulesBundle is true).
|
|
286
|
+
*/
|
|
287
|
+
readonly bundle?: ReadonlyArray<string> | undefined;
|
|
288
|
+
/** Output formats to emit. Defaults to esm-only when unset. */
|
|
289
|
+
readonly format?: ReadonlyArray<BuildFormat> | undefined;
|
|
290
|
+
/**
|
|
291
|
+
* Minify the JS output of PROD groups only (dev is never minified). Defaults to
|
|
292
|
+
* false — this builder targets Node libraries where readable output is preferred.
|
|
293
|
+
*/
|
|
294
|
+
readonly minify?: boolean | undefined;
|
|
295
|
+
readonly transform?: (args: {
|
|
296
|
+
pkg: Json;
|
|
297
|
+
targetGroup: TargetGroupRef;
|
|
298
|
+
}) => Json;
|
|
299
|
+
/**
|
|
300
|
+
* Extra rolldown plugins, forwarded to BOTH the JS pass and the dts-only pass. A plugin
|
|
301
|
+
* with JS-lifecycle side effects (asset emitters, banner injectors) runs in both passes;
|
|
302
|
+
* the dts pass uses `emitDtsOnly`, so for esm-only builds it produces no JS chunks and most
|
|
303
|
+
* rolldown hooks are no-ops there. For DUAL (esm+cjs) builds, however, tsdown's dts pass
|
|
304
|
+
* still RE-EMITS the `.cjs` JS chunk and overwrites the JS pass's `.cjs` output — so a
|
|
305
|
+
* `renderChunk`/`generateBundle` plugin that must persist onto the final `.cjs` (e.g. the
|
|
306
|
+
* built-in cjs-default-interop) has to run in the dts pass too. A caller relying on a hook
|
|
307
|
+
* firing exactly once should guard the second invocation.
|
|
308
|
+
*/
|
|
309
|
+
readonly extraPlugins?: ReadonlyArray<Plugin>;
|
|
310
|
+
/** JSX transform settings forwarded to rolldown's inputOptions. */
|
|
311
|
+
readonly jsx?: JsxConfig | undefined;
|
|
312
|
+
/**
|
|
313
|
+
* Entry partitions with their own format/bundling, built into the same outDir after
|
|
314
|
+
* the base entries. Used for per-entry format overrides (e.g. one CJS entry in an
|
|
315
|
+
* otherwise ESM-only package). The base `entry` must already EXCLUDE these entries.
|
|
316
|
+
*/
|
|
317
|
+
readonly overrides?: ReadonlyArray<EntryOverride> | undefined;
|
|
318
|
+
/**
|
|
319
|
+
* Which export keys get a CJS `require` condition in the emitted manifest. Pass a Set
|
|
320
|
+
* when overrides give different entries different formats; omit for the uniform
|
|
321
|
+
* `format`-includes-cjs behavior.
|
|
322
|
+
*/
|
|
323
|
+
readonly dualExports?: DualExports | undefined;
|
|
324
|
+
/** Injectable for tests; defaults to tsdown's build. */
|
|
325
|
+
readonly build?: TsdownBuild;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Run tsdown.build() per TargetGroup. Composable so the escape hatch gets multi-group too.
|
|
329
|
+
*
|
|
330
|
+
* Each group runs TWO passes to the SAME outDir:
|
|
331
|
+
* 1. JS pass — per-module JS (`unbundle: true`, `dts: false`), with the `emitManifest` plugin
|
|
332
|
+
* and the `public/` copy. Default `clean: true` gives it a fresh outDir.
|
|
333
|
+
* 2. dts pass — bundled declarations only (`unbundle: false`, `dts: { emitDtsOnly: true }`,
|
|
334
|
+
* `clean: false`). No manifest plugin, no copy, no sourcemaps. `clean: false` is load-bearing:
|
|
335
|
+
* it must NOT wipe the JS the first pass just wrote.
|
|
336
|
+
*
|
|
337
|
+
* Why two passes: tsdown's `unbundle` maps to rolldown `output.preserveModules` for the whole
|
|
338
|
+
* build (JS and the dts plugin share it), so a single pass cannot give per-module JS + bundled
|
|
339
|
+
* dts. Per-module dts breaks type portability (TS2883); bundling the JS re-bundles workspace
|
|
340
|
+
* consumers. The split keeps per-module JS AND rolled-up, self-contained declarations.
|
|
341
|
+
*/
|
|
342
|
+
declare function buildTargetGroups(options: BuildTargetGroupsOptions): Promise<void>;
|
|
343
|
+
//#endregion
|
|
344
|
+
//#region src/build/cjs-default-interop.d.ts
|
|
345
|
+
/**
|
|
346
|
+
* Rolldown plugin: append the CJS default-interop footer to ENTRY chunks of the
|
|
347
|
+
* `cjs` format that export a default alongside named exports.
|
|
348
|
+
*
|
|
349
|
+
* Gated tightly so it never touches the wrong chunk:
|
|
350
|
+
* - format must be `cjs` (ESM is untouched; `import().default` on ESM is already correct);
|
|
351
|
+
* - the chunk must be an ENTRY chunk — never a SHARED chunk. Shared chunks are required by
|
|
352
|
+
* entry chunks via their named bindings (e.g. `require_changesets.changesets_exports.X`);
|
|
353
|
+
* reassigning a shared chunk's `module.exports` to its own default would break those reads
|
|
354
|
+
* (many bundled vendor chunks carry an `exports.default`);
|
|
355
|
+
* - the chunk must export a `default` AND at least one named export. A default-only chunk
|
|
356
|
+
* already gets `module.exports = <default>` from rolldown, and a named-only chunk has no
|
|
357
|
+
* default to promote.
|
|
358
|
+
*
|
|
359
|
+
* The emitted footer is also self-guarded (`module.exports.default !== void 0`), so it is a
|
|
360
|
+
* runtime no-op whenever the static gate is ever too generous.
|
|
361
|
+
*/
|
|
362
|
+
declare function cjsDefaultInterop(): Plugin;
|
|
363
|
+
//#endregion
|
|
364
|
+
//#region src/build/node-builtin-default-interop.d.ts
|
|
365
|
+
/**
|
|
366
|
+
* Rewrite a default import / default re-export of a Node built-in into the
|
|
367
|
+
* equivalent NAMESPACE form, so rolldown's CJS codegen produces correct interop.
|
|
368
|
+
*
|
|
369
|
+
* Why this exists — a rolldown 1.1.0 codegen defect (verified against the latest
|
|
370
|
+
* published rolldown 1.1.0 / tsdown 0.22.2, with no newer release to upgrade to):
|
|
371
|
+
*
|
|
372
|
+
* // SOURCE (e.g. vfile's lib/minproc.js)
|
|
373
|
+
* export {default as minproc} from 'node:process'
|
|
374
|
+
* // ...consumed as minproc.cwd()
|
|
375
|
+
*
|
|
376
|
+
* // rolldown CJS OUTPUT (BROKEN)
|
|
377
|
+
* let node_process = require("node:process");
|
|
378
|
+
* node_process.default.cwd() // <- require("node:process").default is undefined
|
|
379
|
+
*
|
|
380
|
+
* For a default import of an EXTERNAL Node builtin, rolldown emits a bare
|
|
381
|
+
* `require("node:x")` WITHOUT its `__toESM` interop wrapper, yet still accesses
|
|
382
|
+
* `.default` — which is `undefined` on a builtin's CJS export object, so the call
|
|
383
|
+
* throws `Cannot read properties of undefined (reading 'cwd')` at runtime. NAMED
|
|
384
|
+
* imports are unaffected (`(0, node_process.cwd)()` reads a real property), and a
|
|
385
|
+
* NAMESPACE import is handled correctly: rolldown wraps it as
|
|
386
|
+
* `node_process = __toESM(require("node:process"), 1)`, which synthesizes `.default`
|
|
387
|
+
* and copies every own property, so member access works. This transform converts the
|
|
388
|
+
* broken default form into the working namespace form BEFORE codegen, so it is immune
|
|
389
|
+
* to minification and applies identically to per-module and bundled output.
|
|
390
|
+
*
|
|
391
|
+
* rolldown exposes no Rollup-style `output.interop` knob to fix this at the output
|
|
392
|
+
* layer, which is why the correction happens here on the source.
|
|
393
|
+
*
|
|
394
|
+
* Rewrites (the two static forms that occur in practice, anchored to statement start):
|
|
395
|
+
* - `import NAME from "node:x"` -> `import * as NAME from "node:x"`
|
|
396
|
+
* - `export { default as NAME } from "node:x"` -> `export * as NAME from "node:x"`
|
|
397
|
+
* - `import NAME, { a, b } from "node:x"` -> `import * as NAME from "node:x"; import { a, b } from "node:x"`
|
|
398
|
+
*
|
|
399
|
+
* The namespace binding NAME carries the builtin's named exports (`NAME.cwd`,
|
|
400
|
+
* `NAME.join`, ...), which is exactly how a default import of a builtin is consumed
|
|
401
|
+
* in practice. ESM output is unaffected at runtime (a namespace import of a builtin
|
|
402
|
+
* resolves to the same members), so the plugin is safe to attach to dual builds.
|
|
403
|
+
*/
|
|
404
|
+
declare function nodeBuiltinDefaultInterop(): Plugin;
|
|
405
|
+
//#endregion
|
|
406
|
+
//#region src/build/strip-maps.d.ts
|
|
407
|
+
/**
|
|
408
|
+
* Remove declaration source-map files (`.d.ts.map` / `.d.cts.map`) from a built `pkg`
|
|
409
|
+
* directory, returning the removed paths.
|
|
410
|
+
*
|
|
411
|
+
* The dts pass emits these next to each `.d.ts` (the resolved dts tsconfig sets
|
|
412
|
+
* `declarationMap: true`) because API Extractor reads them during meta generation to
|
|
413
|
+
* resolve original-source positions. But they are dead weight in a PUBLISHED package —
|
|
414
|
+
* they reference `.ts` sources the tarball does not ship — and they leak local source
|
|
415
|
+
* paths, so the prod build strips them AFTER meta generation has consumed them. The dev
|
|
416
|
+
* build keeps them (it is never published, and `savvy build --target meta` reads them).
|
|
417
|
+
*
|
|
418
|
+
* Recurses, but skips `node_modules` so it does not traverse a self-contained bundle's
|
|
419
|
+
* vendored tree — only the package's own emitted declarations carry maps worth stripping.
|
|
420
|
+
*/
|
|
421
|
+
declare function removeDeclarationMaps(pkgDir: string): string[];
|
|
422
|
+
//#endregion
|
|
423
|
+
//#region src/build/sync-public.d.ts
|
|
424
|
+
/**
|
|
425
|
+
* Mirror `sourceDir` into `targetDir`, idempotently.
|
|
426
|
+
*
|
|
427
|
+
* Replaces tsdown's built-in `copy`, whose non-recursive mkdir throws `EEXIST` when the target
|
|
428
|
+
* already exists (re-builds, `prepare`-on-install, concurrent turbo invocations). Behavior:
|
|
429
|
+
*
|
|
430
|
+
* - source absent: no-op.
|
|
431
|
+
* - target absent: copy `sourceDir` wholesale.
|
|
432
|
+
* - target present: copy only files that are new or whose bytes differ, then delete target files
|
|
433
|
+
* that no longer exist in the source and prune the directories left empty.
|
|
434
|
+
*
|
|
435
|
+
* The byte-diff keeps unchanged files (and their timestamps) untouched, so a large copied asset
|
|
436
|
+
* tree — e.g. the mcp markdown corpus — is not rewritten on every build.
|
|
437
|
+
*/
|
|
438
|
+
declare function syncPublicDir(sourceDir: string, targetDir: string): void;
|
|
439
|
+
//#endregion
|
|
440
|
+
//#region src/catalog/resolve-catalogs.d.ts
|
|
441
|
+
/**
|
|
442
|
+
* Resolve every `catalog:`/`workspace:` specifier in a manifest to a concrete spec,
|
|
443
|
+
* delegating to workspaces-effect's CatalogResolver. The resolver discovers the
|
|
444
|
+
* workspace root from `process.cwd()` (run this from inside the target workspace)
|
|
445
|
+
* and assembles catalogs durably (inline + config-dependency hook-replay + lockfile),
|
|
446
|
+
* so no transient `.pnpm-workspace-state-v1.json` is required.
|
|
447
|
+
*
|
|
448
|
+
* Rejects with `CatalogResolutionError` on an unresolvable reference, or
|
|
449
|
+
* `CatalogAssemblyError` if the workspace catalog set cannot be assembled.
|
|
450
|
+
*/
|
|
451
|
+
declare function resolveManifest(pkg: ManifestLike$1): Promise<ManifestLike$1>;
|
|
452
|
+
//#endregion
|
|
453
|
+
//#region src/errors.d.ts
|
|
454
|
+
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 & {
|
|
455
|
+
readonly _tag: "MetaGenerationError";
|
|
456
|
+
} & Readonly<A>;
|
|
457
|
+
/** API Extractor meta generation failed for an entry. */
|
|
458
|
+
declare class MetaGenerationError extends MetaGenerationError_base<{
|
|
459
|
+
readonly entry: string;
|
|
460
|
+
readonly reason: string;
|
|
461
|
+
}> {
|
|
462
|
+
get message(): string;
|
|
463
|
+
}
|
|
464
|
+
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 & {
|
|
465
|
+
readonly _tag: "ConfigValidationError";
|
|
466
|
+
} & Readonly<A>;
|
|
467
|
+
/** A savvy.build.ts or publishConfig.targets config is structurally invalid; raised before any build work. */
|
|
468
|
+
declare class ConfigValidationError extends ConfigValidationError_base<{
|
|
469
|
+
readonly path: string;
|
|
470
|
+
readonly reason: string;
|
|
471
|
+
}> {
|
|
472
|
+
get message(): string;
|
|
473
|
+
}
|
|
474
|
+
//#endregion
|
|
475
|
+
//#region src/exe/config.d.ts
|
|
476
|
+
/** Default Node runtime embedded in the SEA (parity with the vitest-agent reference). */
|
|
477
|
+
declare const DEFAULT_EXE_NODE_VERSION = "25.9.0";
|
|
478
|
+
/** A resolved per-platform SEA target. `platform` uses the tsdown/\@tsdown/exe token (win, not win32). */
|
|
479
|
+
interface ExeTarget {
|
|
480
|
+
readonly platform: "darwin" | "linux" | "win";
|
|
481
|
+
readonly arch: "arm64" | "x64";
|
|
482
|
+
readonly nodeVersion: string;
|
|
483
|
+
}
|
|
484
|
+
/** A target before nodeVersion defaulting (platform/arch only). */
|
|
485
|
+
interface ExeTargetInput {
|
|
486
|
+
readonly platform: "darwin" | "linux" | "win";
|
|
487
|
+
readonly arch: "arm64" | "x64";
|
|
488
|
+
}
|
|
489
|
+
/** SEA seaConfig overrides (subset; the rest are defaulted). */
|
|
490
|
+
interface ExeSeaConfig {
|
|
491
|
+
readonly disableExperimentalSEAWarning?: boolean | undefined;
|
|
492
|
+
readonly useCodeCache?: boolean | undefined;
|
|
493
|
+
readonly useSnapshot?: boolean | undefined;
|
|
494
|
+
}
|
|
495
|
+
/** One SEA binary to compile. */
|
|
496
|
+
interface ExeConfig {
|
|
497
|
+
/** Output binary basename (no extension/suffix). */
|
|
498
|
+
readonly fileName: string;
|
|
499
|
+
/** Bin entry; defaults to ./src/bin.ts. */
|
|
500
|
+
readonly entry?: string | undefined;
|
|
501
|
+
/** Node runtime to embed; defaults to DEFAULT_EXE_NODE_VERSION. */
|
|
502
|
+
readonly nodeVersion?: string | undefined;
|
|
503
|
+
/** seaConfig overrides merged over the defaults. */
|
|
504
|
+
readonly seaConfig?: ExeSeaConfig | undefined;
|
|
505
|
+
/** Explicit targets; default inferred from the package os/cpu. */
|
|
506
|
+
readonly targets?: ReadonlyArray<ExeTargetInput> | undefined;
|
|
507
|
+
}
|
|
508
|
+
/** Fully-resolved SEA binary spec (no optionals). */
|
|
509
|
+
interface NormalizedExe {
|
|
510
|
+
readonly fileName: string;
|
|
511
|
+
readonly entry: string;
|
|
512
|
+
readonly targets: ReadonlyArray<ExeTarget>;
|
|
513
|
+
readonly seaConfig: {
|
|
514
|
+
readonly disableExperimentalSEAWarning: boolean;
|
|
515
|
+
readonly useCodeCache: boolean;
|
|
516
|
+
readonly useSnapshot: boolean;
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
/** The package's own os/cpu fields, used to infer a single platform target. */
|
|
520
|
+
interface PkgOsCpu {
|
|
521
|
+
readonly os: ReadonlyArray<string>;
|
|
522
|
+
readonly cpu: ReadonlyArray<string>;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Normalize `exe` (object or array) into one fully-resolved spec per binary.
|
|
526
|
+
*
|
|
527
|
+
* Pure function; structural validation (missing fileName, empty targets) lives in the
|
|
528
|
+
* config-validation layer.
|
|
529
|
+
*/
|
|
530
|
+
declare function normalizeExeOptions(exe: ExeConfig | ReadonlyArray<ExeConfig>, pkg: PkgOsCpu): ReadonlyArray<NormalizedExe>;
|
|
531
|
+
//#endregion
|
|
532
|
+
//#region src/meta/config.d.ts
|
|
533
|
+
/** A single TSDoc tag definition (parity with api-extractor's TSDoc config). */
|
|
534
|
+
interface TsdocTagDefinition {
|
|
535
|
+
readonly tagName: string;
|
|
536
|
+
readonly syntaxKind: "block" | "inline" | "modifier";
|
|
537
|
+
readonly allowMultiple?: boolean | undefined;
|
|
538
|
+
}
|
|
539
|
+
/** An api-extractor message-suppression rule. messageId is exact-matched; pattern (regex or substring) is AND-matched against the text. */
|
|
540
|
+
interface WarningSuppressionRule {
|
|
541
|
+
readonly messageId: string;
|
|
542
|
+
readonly pattern?: string | undefined;
|
|
543
|
+
}
|
|
544
|
+
/** TSDoc / doc-warning configuration. suppressWarnings is doc functionality, so it lives here. */
|
|
545
|
+
interface TsdocOptions {
|
|
546
|
+
readonly suppressWarnings?: ReadonlyArray<WarningSuppressionRule> | undefined;
|
|
547
|
+
readonly tagDefinitions?: ReadonlyArray<TsdocTagDefinition> | undefined;
|
|
548
|
+
}
|
|
549
|
+
/** The `meta` field on defineBuild. Absent means no api-model generation. */
|
|
550
|
+
interface MetaOptions {
|
|
551
|
+
/** Directories to copy the api-model into on `savvy build --target meta`. */
|
|
552
|
+
readonly localPaths?: ReadonlyArray<string> | undefined;
|
|
553
|
+
readonly tsdoc?: TsdocOptions | undefined;
|
|
554
|
+
}
|
|
555
|
+
/** Fully-resolved meta options (no optionals). */
|
|
556
|
+
interface NormalizedMeta {
|
|
557
|
+
readonly localPaths: ReadonlyArray<string>;
|
|
558
|
+
readonly tsdoc: {
|
|
559
|
+
readonly suppressWarnings: ReadonlyArray<WarningSuppressionRule>;
|
|
560
|
+
readonly tagDefinitions: ReadonlyArray<TsdocTagDefinition>;
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
/** Fill defaults so downstream code never branches on undefined. */
|
|
564
|
+
declare function normalizeMetaOptions(meta: MetaOptions): NormalizedMeta;
|
|
565
|
+
//#endregion
|
|
566
|
+
//#region src/targets/config.d.ts
|
|
567
|
+
/** A single object-form publish target. Uses `from` XOR `name` (never both). */
|
|
568
|
+
interface PublishTargetObject {
|
|
569
|
+
/** Registry endpoint. Required for custom keys; defaulted for `npm`/`github`. */
|
|
570
|
+
readonly registry?: string | undefined;
|
|
571
|
+
/** Name override for this target's own group. Mutually exclusive with `from`. */
|
|
572
|
+
readonly name?: string | undefined;
|
|
573
|
+
/** Reuse another target's group bytes (deploy them to this registry). Mutually exclusive with `name`. */
|
|
574
|
+
readonly from?: string | undefined;
|
|
575
|
+
}
|
|
576
|
+
/** A `publishConfig.targets` value: `true` (well-known registry, base name), a string (name override), or an object. */
|
|
577
|
+
type PublishTargetValue = true | string | PublishTargetObject;
|
|
578
|
+
/** The `publishConfig.targets` map, keyed by target id (`npm`, `github`, or a custom key). */
|
|
579
|
+
type PublishTargets = Record<string, PublishTargetValue>;
|
|
580
|
+
/** A distinct byte-variant build group (one per distinct resolved name). */
|
|
581
|
+
interface ResolvedGroup {
|
|
582
|
+
/** Folder id; the group's output dir nests this id under dist/prod, with a pkg subfolder. */
|
|
583
|
+
readonly id: string;
|
|
584
|
+
/** The `package.json.name` this group's manifest carries. */
|
|
585
|
+
readonly name: string;
|
|
586
|
+
/** The group's pkg output dir, relative to the package root. */
|
|
587
|
+
readonly dir: string;
|
|
588
|
+
}
|
|
589
|
+
/** A resolved registry target (one per `publishConfig.targets` key). */
|
|
590
|
+
interface ResolvedTarget {
|
|
591
|
+
/** The `publishConfig.targets` key. */
|
|
592
|
+
readonly id: string;
|
|
593
|
+
/** The group id whose bytes this target deploys. */
|
|
594
|
+
readonly group: string;
|
|
595
|
+
/** The resolved name for that group. */
|
|
596
|
+
readonly name: string;
|
|
597
|
+
/** The resolved registry endpoint. */
|
|
598
|
+
readonly registry: string;
|
|
599
|
+
}
|
|
600
|
+
/** The full resolution of `publishConfig.targets`: the distinct groups to build, and every target bound to one. */
|
|
601
|
+
interface TargetResolution {
|
|
602
|
+
readonly groups: ReadonlyArray<ResolvedGroup>;
|
|
603
|
+
readonly targets: ReadonlyArray<ResolvedTarget>;
|
|
604
|
+
}
|
|
605
|
+
/** True when a target value is the object form (carries registry/name/from). */
|
|
606
|
+
declare function isTargetObject(value: PublishTargetValue): value is PublishTargetObject;
|
|
607
|
+
//#endregion
|
|
608
|
+
//#region src/config-validation/ConfigValidator.d.ts
|
|
609
|
+
/** The normalized facts the validator checks, assembled by the bundler before any build work. */
|
|
610
|
+
interface ValidationInput {
|
|
611
|
+
readonly baseName: string;
|
|
612
|
+
/** Whether the package declares an exports map (for the model-without-exports cross-field rule). */
|
|
613
|
+
readonly hasExports: boolean;
|
|
614
|
+
readonly targets?: PublishTargets | undefined;
|
|
615
|
+
readonly exe?: ExeConfig | ReadonlyArray<ExeConfig> | undefined;
|
|
616
|
+
readonly osCpu?: {
|
|
617
|
+
readonly os: ReadonlyArray<string>;
|
|
618
|
+
readonly cpu: ReadonlyArray<string>;
|
|
619
|
+
} | undefined;
|
|
620
|
+
readonly meta?: MetaOptions | undefined;
|
|
621
|
+
}
|
|
622
|
+
declare const ConfigValidator_base: Context.TagClass<ConfigValidator, "@savvy-web/tsdown-plugins/ConfigValidator", {
|
|
623
|
+
readonly validate: (input: ValidationInput) => Effect.Effect<void, ConfigValidationError>;
|
|
624
|
+
}>;
|
|
625
|
+
/** Fast-fail config validator; runs first in the bundler over the resolved config. */
|
|
626
|
+
declare class ConfigValidator extends ConfigValidator_base {}
|
|
627
|
+
//#endregion
|
|
628
|
+
//#region src/config-validation/ConfigValidatorLive.d.ts
|
|
629
|
+
/** Live ConfigValidator: wraps the synchronous rule set, surfacing ConfigValidationError as a typed Effect failure. */
|
|
630
|
+
declare const ConfigValidatorLive: Layer.Layer<ConfigValidator, never, never>;
|
|
631
|
+
//#endregion
|
|
632
|
+
//#region src/dts/resolved-tsconfig.d.ts
|
|
633
|
+
interface ResolvedTsconfigOptions {
|
|
634
|
+
/** Absolute package root. */
|
|
635
|
+
readonly cwd: string;
|
|
636
|
+
/** Explicit `types` to forward (default ["node"]). Pulled from the project tsconfig by the caller. */
|
|
637
|
+
readonly types?: ReadonlyArray<string> | undefined;
|
|
638
|
+
/** TS `compilerOptions.jsx` to forward into the dts tsconfig (e.g. "react-jsx"). */
|
|
639
|
+
readonly jsx?: string | undefined;
|
|
640
|
+
/** TS `compilerOptions.jsxImportSource` to forward (e.g. "react"). */
|
|
641
|
+
readonly jsxImportSource?: string | undefined;
|
|
642
|
+
}
|
|
643
|
+
interface ResolvedTsconfig {
|
|
644
|
+
readonly compilerOptions: Record<string, unknown>;
|
|
645
|
+
readonly include: ReadonlyArray<string>;
|
|
646
|
+
readonly exclude: ReadonlyArray<string>;
|
|
647
|
+
}
|
|
648
|
+
/** Build the portable absolute-path tsconfig object (ported from rslib writeBundleTempConfig). */
|
|
649
|
+
declare function buildResolvedTsconfig(options: ResolvedTsconfigOptions): ResolvedTsconfig;
|
|
650
|
+
/** Write the resolved tsconfig to a temp file and return its absolute path. */
|
|
651
|
+
declare function writeResolvedTsconfig(options: ResolvedTsconfigOptions): string;
|
|
652
|
+
//#endregion
|
|
653
|
+
//#region src/entry/extract.d.ts
|
|
654
|
+
interface PackageJsonLike {
|
|
655
|
+
readonly exports?: unknown;
|
|
656
|
+
readonly bin?: unknown;
|
|
657
|
+
}
|
|
658
|
+
interface ExtractOptions {
|
|
659
|
+
readonly exportsAsIndexes?: boolean | undefined;
|
|
660
|
+
}
|
|
661
|
+
interface ExtractResult {
|
|
662
|
+
/** entry name to TS source path */
|
|
663
|
+
readonly entries: Record<string, string>;
|
|
664
|
+
/** entry name to original export key (for downstream output-map alignment) */
|
|
665
|
+
readonly exportPaths: Record<string, string>;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Map an export key to the tsdown entry name (the emitted output basename).
|
|
669
|
+
*
|
|
670
|
+
* `.` becomes `index`; otherwise the leading `./` is stripped and, unless
|
|
671
|
+
* `exportsAsIndexes` is set, nested slashes are flattened to dashes
|
|
672
|
+
* (e.g. `./changesets/markdownlint` to `changesets-markdownlint`). The manifest
|
|
673
|
+
* transform reuses this so the declared output path always matches the emitted file.
|
|
674
|
+
*
|
|
675
|
+
* @internal
|
|
676
|
+
*/
|
|
677
|
+
declare const createEntryName: (exportKey: string, exportsAsIndexes: boolean) => string;
|
|
678
|
+
declare function extractEntries(pkg: PackageJsonLike, options?: ExtractOptions): ExtractResult;
|
|
679
|
+
//#endregion
|
|
680
|
+
//#region src/entry/package-json-entries.d.ts
|
|
681
|
+
interface PackageJsonEntriesOptions extends ExtractOptions {
|
|
682
|
+
/** In-memory package.json. If omitted, reads `<cwd>/package.json`. */
|
|
683
|
+
readonly pkg?: PackageJsonLike;
|
|
684
|
+
/** Working directory for reading package.json. Defaults to process.cwd(). */
|
|
685
|
+
readonly cwd?: string;
|
|
686
|
+
}
|
|
687
|
+
/** Derive a tsdown `entry` record (name to source path) from a package.json. */
|
|
688
|
+
declare function packageJsonEntries(options?: PackageJsonEntriesOptions): Record<string, string>;
|
|
689
|
+
//#endregion
|
|
690
|
+
//#region src/exe/build.d.ts
|
|
691
|
+
/** A minimal structural type for tsdown's build, kept loose so this package keeps no tsdown runtime dep (interface-only). */
|
|
692
|
+
type ExeBuild = (config: unknown) => Promise<unknown>;
|
|
693
|
+
/** Options for compiling SEA binaries. */
|
|
694
|
+
interface RunExeBuildOptions {
|
|
695
|
+
readonly cwd: string;
|
|
696
|
+
/** Directory the binaries are emitted into (e.g. dist/dev/pkg/bin). */
|
|
697
|
+
readonly outDir: string;
|
|
698
|
+
/** One fully-resolved spec per binary. */
|
|
699
|
+
readonly specs: ReadonlyArray<NormalizedExe>;
|
|
700
|
+
/** Injectable tsdown build (defaults to tsdown's build function). */
|
|
701
|
+
readonly build?: ExeBuild | undefined;
|
|
702
|
+
}
|
|
703
|
+
/** Compile each SEA binary via tsdown's exe mode. One tsdown build per spec. */
|
|
704
|
+
declare function runExeBuild(options: RunExeBuildOptions): Promise<void>;
|
|
705
|
+
//#endregion
|
|
706
|
+
//#region src/meta/generate.d.ts
|
|
707
|
+
interface GenerateMetaOptions {
|
|
708
|
+
readonly cwd: string;
|
|
709
|
+
readonly packageName: string;
|
|
710
|
+
/** Resolved tsconfig (from writeResolvedTsconfig) for the api-extractor compiler. */
|
|
711
|
+
readonly tsconfigPath: string;
|
|
712
|
+
/** Directory holding the tsdown-emitted per-file .d.ts (e.g. dist/dev/pkg). */
|
|
713
|
+
readonly dtsDir: string;
|
|
714
|
+
/** Map of entry name to the .d.ts basename (without extension) inside dtsDir. */
|
|
715
|
+
readonly entries: Record<string, string>;
|
|
716
|
+
/** Map of entry name to its export path (".", "./sub"). */
|
|
717
|
+
readonly exportPaths: Record<string, string>;
|
|
718
|
+
/** Where to write the meta bundle (.api.json + package.json + tsconfig.json). */
|
|
719
|
+
readonly outMetaDir: string;
|
|
720
|
+
/** Directories (relative to cwd) to copy the meta bundle into. */
|
|
721
|
+
readonly localPaths: ReadonlyArray<string>;
|
|
722
|
+
readonly tsdoc: NormalizedMeta["tsdoc"];
|
|
723
|
+
}
|
|
724
|
+
interface MetaResult {
|
|
725
|
+
readonly apiJsonPath: string;
|
|
726
|
+
readonly apiJsonFilename: string;
|
|
727
|
+
}
|
|
728
|
+
/**
|
|
729
|
+
* Generate the api-model meta bundle from already-emitted .d.ts. Writes tsdoc.json (idempotent),
|
|
730
|
+
* runs the extractor per entry, merges if needed, and writes the "virtual TS env" trio to
|
|
731
|
+
* outMetaDir (`<unscoped>.api.json` + the final `package.json` + a portable `tsconfig.json`),
|
|
732
|
+
* copying that trio into each localPaths dir. The api-extractor `tsdoc-metadata.json` is a
|
|
733
|
+
* published-package artifact and is written into `dtsDir` (the built pkg/), not the meta bundle.
|
|
734
|
+
*/
|
|
735
|
+
declare function generateMeta(options: GenerateMetaOptions): Promise<MetaResult>;
|
|
736
|
+
//#endregion
|
|
737
|
+
//#region src/meta/tsconfig-resolver.d.ts
|
|
738
|
+
/**
|
|
739
|
+
* Compiler options with enum values converted to their string equivalents.
|
|
740
|
+
*
|
|
741
|
+
* @remarks
|
|
742
|
+
* Open-ended record because TypeScript compiler options vary by version.
|
|
743
|
+
*
|
|
744
|
+
* @public
|
|
745
|
+
*/
|
|
746
|
+
interface ResolvedCompilerOptions {
|
|
747
|
+
[key: string]: unknown;
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* Portable, JSON-serializable tsconfig.json (compilerOptions-only).
|
|
751
|
+
*
|
|
752
|
+
* @remarks
|
|
753
|
+
* Designed for virtual TypeScript environments (shiki/Twoslash, API Extractor)
|
|
754
|
+
* where file paths and emit settings are controlled externally. Holds no
|
|
755
|
+
* machine-specific absolute paths and no emit/path/file-selection options.
|
|
756
|
+
*
|
|
757
|
+
* @public
|
|
758
|
+
*/
|
|
759
|
+
interface PortableTsconfig {
|
|
760
|
+
/** JSON schema for IDE support. */
|
|
761
|
+
$schema: string;
|
|
762
|
+
/** Compiler options with enum values converted to strings. */
|
|
763
|
+
compilerOptions: ResolvedCompilerOptions;
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Resolves a TypeScript `ParsedCommandLine` to a portable, JSON-serializable
|
|
767
|
+
* tsconfig (compilerOptions-only) for virtual TypeScript environments.
|
|
768
|
+
*
|
|
769
|
+
* @remarks
|
|
770
|
+
* Converts TypeScript's internal enum representation back to portable JSON
|
|
771
|
+
* suitable for tooling that needs type information without emitting files:
|
|
772
|
+
*
|
|
773
|
+
* - Converts enum values (target, module, moduleResolution, jsx, etc.) to strings.
|
|
774
|
+
* - Converts lib references from full paths (`lib.esnext.d.ts`) to short names (`esnext`).
|
|
775
|
+
* - Forces `composite: false` and `noEmit: true`.
|
|
776
|
+
* - Excludes path-dependent options (rootDir, outDir, baseUrl, paths, typeRoots, types).
|
|
777
|
+
* - Excludes emit-related options (declaration, sourceMap, etc.).
|
|
778
|
+
* - Excludes file selection (include, exclude, files, references).
|
|
779
|
+
* - Adds `$schema` for IDE support.
|
|
780
|
+
*
|
|
781
|
+
* @public
|
|
782
|
+
*/
|
|
783
|
+
declare class TsconfigResolver {
|
|
784
|
+
/** @internal */
|
|
785
|
+
private static readonly SCRIPT_TARGET_MAP;
|
|
786
|
+
/** @internal */
|
|
787
|
+
private static readonly MODULE_KIND_MAP;
|
|
788
|
+
/** @internal */
|
|
789
|
+
private static readonly MODULE_RESOLUTION_MAP;
|
|
790
|
+
/** @internal */
|
|
791
|
+
private static readonly JSX_EMIT_MAP;
|
|
792
|
+
/** @internal */
|
|
793
|
+
private static readonly MODULE_DETECTION_MAP;
|
|
794
|
+
/** @internal */
|
|
795
|
+
private static readonly NEW_LINE_MAP;
|
|
796
|
+
/** Converts a {@link ScriptTarget} enum value to its string form (e.g. `es2023`). */
|
|
797
|
+
static convertScriptTarget(target: ScriptTarget | undefined): string | undefined;
|
|
798
|
+
/** Converts a {@link ModuleKind} enum value to its string form (e.g. `nodenext`). */
|
|
799
|
+
static convertModuleKind(module: ModuleKind | undefined): string | undefined;
|
|
800
|
+
/** Converts a {@link ModuleResolutionKind} enum value to its string form (e.g. `nodenext`). */
|
|
801
|
+
static convertModuleResolution(resolution: ModuleResolutionKind | undefined): string | undefined;
|
|
802
|
+
/** Converts a {@link JsxEmit} enum value to its string form (e.g. `preserve`, `react-jsx`). */
|
|
803
|
+
static convertJsxEmit(jsx: JsxEmit | undefined): string | undefined;
|
|
804
|
+
/** Converts a {@link ModuleDetectionKind} enum value to its string form (e.g. `force`). */
|
|
805
|
+
static convertModuleDetection(detection: ModuleDetectionKind | undefined): string | undefined;
|
|
806
|
+
/** Converts a {@link NewLineKind} enum value to its string form (`lf` or `crlf`). */
|
|
807
|
+
static convertNewLine(newLine: NewLineKind | undefined): string | undefined;
|
|
808
|
+
/**
|
|
809
|
+
* Converts a lib reference to its canonical short name.
|
|
810
|
+
*
|
|
811
|
+
* @remarks
|
|
812
|
+
* `ParsedCommandLine` stores lib references as full paths like `lib.esnext.d.ts`
|
|
813
|
+
* or `/path/to/typescript/lib/lib.dom.d.ts`. This returns the short tsconfig form
|
|
814
|
+
* (`esnext`, `dom`).
|
|
815
|
+
*/
|
|
816
|
+
static convertLibReference(lib: string): string;
|
|
817
|
+
/**
|
|
818
|
+
* Resolves a parsed TypeScript config to a portable, compilerOptions-only tsconfig.
|
|
819
|
+
*/
|
|
820
|
+
resolve(parsed: ParsedCommandLine): PortableTsconfig;
|
|
821
|
+
}
|
|
822
|
+
/**
|
|
823
|
+
* Resolves the package's effective compiler options (following `extends`) into a
|
|
824
|
+
* portable, JSON-serializable tsconfig for the meta release bundle.
|
|
825
|
+
*
|
|
826
|
+
* @remarks
|
|
827
|
+
* Resolves the package's own `<cwd>/tsconfig.json` (which extends the shared
|
|
828
|
+
* `@savvy-web/bundler/ecma.json` base) via the TypeScript API so the result
|
|
829
|
+
* carries the full effective options (target/module/strict/jsx/lib), then
|
|
830
|
+
* converts them to a portable, compilerOptions-only shape with no absolute
|
|
831
|
+
* paths or emit/file-selection options.
|
|
832
|
+
*
|
|
833
|
+
* When the package has no own `tsconfig.json` (e.g. a minimal test fixture),
|
|
834
|
+
* falls back to `fallbackConfigPath` — the build's already-resolved dts tsconfig,
|
|
835
|
+
* which always exists during a build. If neither is present, returns a minimal
|
|
836
|
+
* portable config carrying only the virtual-environment flags.
|
|
837
|
+
*
|
|
838
|
+
* @param cwd - Absolute package root.
|
|
839
|
+
* @param fallbackConfigPath - Optional resolved tsconfig to use when the package has no own one.
|
|
840
|
+
* @returns The portable tsconfig object.
|
|
841
|
+
*
|
|
842
|
+
* @public
|
|
843
|
+
*/
|
|
844
|
+
declare function resolvePortableTsconfig(cwd: string, fallbackConfigPath?: string): PortableTsconfig;
|
|
845
|
+
//#endregion
|
|
846
|
+
//#region src/report/schema.d.ts
|
|
847
|
+
declare const ReportTimings: Schema.Struct<{
|
|
848
|
+
totalMs: typeof Schema.Number;
|
|
849
|
+
}>;
|
|
850
|
+
declare const TargetGroupReport: Schema.Struct<{
|
|
851
|
+
id: typeof Schema.String;
|
|
852
|
+
entries: Schema.Array$<typeof Schema.String>;
|
|
853
|
+
emittedFiles: Schema.Array$<typeof Schema.String>;
|
|
854
|
+
timings: Schema.Struct<{
|
|
855
|
+
totalMs: typeof Schema.Number;
|
|
856
|
+
}>;
|
|
857
|
+
warnings: Schema.Array$<typeof Schema.String>;
|
|
858
|
+
errors: Schema.Array$<typeof Schema.String>;
|
|
859
|
+
}>;
|
|
860
|
+
declare const BuildReport: Schema.Struct<{
|
|
861
|
+
package: typeof Schema.String;
|
|
862
|
+
targetGroups: Schema.Array$<Schema.Struct<{
|
|
863
|
+
id: typeof Schema.String;
|
|
864
|
+
entries: Schema.Array$<typeof Schema.String>;
|
|
865
|
+
emittedFiles: Schema.Array$<typeof Schema.String>;
|
|
866
|
+
timings: Schema.Struct<{
|
|
867
|
+
totalMs: typeof Schema.Number;
|
|
868
|
+
}>;
|
|
869
|
+
warnings: Schema.Array$<typeof Schema.String>;
|
|
870
|
+
errors: Schema.Array$<typeof Schema.String>;
|
|
871
|
+
}>>;
|
|
872
|
+
}>;
|
|
873
|
+
type BuildReport = typeof BuildReport.Type;
|
|
874
|
+
type TargetGroupReport = typeof TargetGroupReport.Type;
|
|
875
|
+
//#endregion
|
|
876
|
+
//#region src/report/formatters/types.d.ts
|
|
877
|
+
interface RenderedOutput {
|
|
878
|
+
readonly target: "stdout" | "file" | "github-summary";
|
|
879
|
+
readonly content: string;
|
|
880
|
+
readonly contentType: string;
|
|
881
|
+
}
|
|
882
|
+
interface FormatterContext {
|
|
883
|
+
readonly noColor: boolean;
|
|
884
|
+
}
|
|
885
|
+
interface Formatter {
|
|
886
|
+
readonly format: string;
|
|
887
|
+
readonly render: (reports: ReadonlyArray<BuildReport>, ctx: FormatterContext) => ReadonlyArray<RenderedOutput>;
|
|
888
|
+
}
|
|
889
|
+
//#endregion
|
|
890
|
+
//#region src/report/formatters/ci-annotations.d.ts
|
|
891
|
+
declare const CiAnnotationsFormatter: Formatter;
|
|
892
|
+
//#endregion
|
|
893
|
+
//#region src/report/formatters/json.d.ts
|
|
894
|
+
declare const JsonFormatter: Formatter;
|
|
895
|
+
//#endregion
|
|
896
|
+
//#region src/report/formatters/markdown.d.ts
|
|
897
|
+
declare const MarkdownFormatter: Formatter;
|
|
898
|
+
//#endregion
|
|
899
|
+
//#region src/report/formatters/silent.d.ts
|
|
900
|
+
declare const SilentFormatter: Formatter;
|
|
901
|
+
//#endregion
|
|
902
|
+
//#region src/report/formatters/terminal.d.ts
|
|
903
|
+
declare const TerminalFormatter: Formatter;
|
|
904
|
+
//#endregion
|
|
905
|
+
//#region src/report/services/EnvironmentDetector.d.ts
|
|
906
|
+
type Environment = "agent-shell" | "terminal" | "ci-github" | "ci-generic";
|
|
907
|
+
declare const EnvironmentDetector_base: Context.TagClass<EnvironmentDetector, "@savvy-web/tsdown-plugins/EnvironmentDetector", {
|
|
908
|
+
readonly detect: () => Effect.Effect<Environment>;
|
|
909
|
+
}>;
|
|
910
|
+
declare class EnvironmentDetector extends EnvironmentDetector_base {}
|
|
911
|
+
//#endregion
|
|
912
|
+
//#region src/report/layers/EnvironmentDetectorLive.d.ts
|
|
913
|
+
declare const EnvironmentDetectorLive: Layer.Layer<EnvironmentDetector, never, never>;
|
|
914
|
+
//#endregion
|
|
915
|
+
//#region src/report/services/ExecutorResolver.d.ts
|
|
916
|
+
type Executor = "human" | "agent" | "ci";
|
|
917
|
+
declare const ExecutorResolver_base: Context.TagClass<ExecutorResolver, "@savvy-web/tsdown-plugins/ExecutorResolver", {
|
|
918
|
+
readonly resolve: (env: Environment) => Effect.Effect<Executor>;
|
|
919
|
+
}>;
|
|
920
|
+
declare class ExecutorResolver extends ExecutorResolver_base {}
|
|
921
|
+
//#endregion
|
|
922
|
+
//#region src/report/layers/ExecutorResolverLive.d.ts
|
|
923
|
+
declare const ExecutorResolverLive: Layer.Layer<ExecutorResolver, never, never>;
|
|
924
|
+
//#endregion
|
|
925
|
+
//#region src/report/services/FormatSelector.d.ts
|
|
926
|
+
type OutputFormat = "terminal" | "json" | "markdown" | "ci-annotations" | "silent";
|
|
927
|
+
declare const FormatSelector_base: Context.TagClass<FormatSelector, "@savvy-web/tsdown-plugins/FormatSelector", {
|
|
928
|
+
readonly select: (executor: Executor, explicit?: OutputFormat, env?: Environment) => Effect.Effect<OutputFormat>;
|
|
929
|
+
}>;
|
|
930
|
+
declare class FormatSelector extends FormatSelector_base {}
|
|
931
|
+
//#endregion
|
|
932
|
+
//#region src/report/layers/FormatSelectorLive.d.ts
|
|
933
|
+
declare const FormatSelectorLive: Layer.Layer<FormatSelector, never, never>;
|
|
934
|
+
//#endregion
|
|
935
|
+
//#region src/report/services/OutputRenderer.d.ts
|
|
936
|
+
declare const OutputRenderer_base: Context.TagClass<OutputRenderer, "@savvy-web/tsdown-plugins/OutputRenderer", {
|
|
937
|
+
readonly render: (reports: ReadonlyArray<BuildReport>, format: OutputFormat, ctx: FormatterContext) => Effect.Effect<ReadonlyArray<RenderedOutput>>;
|
|
938
|
+
}>;
|
|
939
|
+
declare class OutputRenderer extends OutputRenderer_base {}
|
|
940
|
+
//#endregion
|
|
941
|
+
//#region src/report/layers/OutputRendererLive.d.ts
|
|
942
|
+
declare const OutputRendererLive: Layer.Layer<OutputRenderer, never, never>;
|
|
943
|
+
//#endregion
|
|
944
|
+
//#region src/report/pipeline.d.ts
|
|
945
|
+
declare const ReportPipelineLive: Layer.Layer<EnvironmentDetector | ExecutorResolver | FormatSelector | OutputRenderer, never, never>;
|
|
946
|
+
interface RenderReportOptions {
|
|
947
|
+
readonly explicitFormat?: OutputFormat;
|
|
948
|
+
/** Override env detection (mainly for tests). */
|
|
949
|
+
readonly env?: Environment;
|
|
950
|
+
readonly noColor: boolean;
|
|
951
|
+
}
|
|
952
|
+
declare const renderReport: (reports: ReadonlyArray<BuildReport>, options: RenderReportOptions) => Effect.Effect<ReadonlyArray<RenderedOutput>, never, EnvironmentDetector | ExecutorResolver | FormatSelector | OutputRenderer>;
|
|
953
|
+
//#endregion
|
|
954
|
+
//#region ../../node_modules/.pnpm/@effect+platform@0.96.1_effect@3.21.3/node_modules/@effect/platform/dist/dts/Error.d.ts
|
|
955
|
+
/**
|
|
956
|
+
* @since 1.0.0
|
|
957
|
+
* @category type id
|
|
958
|
+
*/
|
|
959
|
+
declare const TypeId: unique symbol;
|
|
960
|
+
/**
|
|
961
|
+
* @since 1.0.0
|
|
962
|
+
* @category type id
|
|
963
|
+
*/
|
|
964
|
+
type TypeId = typeof TypeId;
|
|
965
|
+
declare const BadArgument_base: Schema$1.TaggedErrorClass<BadArgument, "BadArgument", {
|
|
966
|
+
readonly _tag: Schema$1.tag<"BadArgument">;
|
|
967
|
+
} & {
|
|
968
|
+
module: Schema$1.Literal<["Clipboard", "Command", "FileSystem", "KeyValueStore", "Path", "Stream", "Terminal"]>;
|
|
969
|
+
method: typeof Schema$1.String;
|
|
970
|
+
description: Schema$1.optional<typeof Schema$1.String>;
|
|
971
|
+
cause: Schema$1.optional<typeof Schema$1.Defect>;
|
|
972
|
+
}>;
|
|
973
|
+
/**
|
|
974
|
+
* @since 1.0.0
|
|
975
|
+
* @category Models
|
|
976
|
+
*/
|
|
977
|
+
declare class BadArgument extends BadArgument_base {
|
|
978
|
+
/**
|
|
979
|
+
* @since 1.0.0
|
|
980
|
+
*/
|
|
981
|
+
readonly [TypeId]: typeof TypeId;
|
|
982
|
+
/**
|
|
983
|
+
* @since 1.0.0
|
|
984
|
+
*/
|
|
985
|
+
get message(): string;
|
|
986
|
+
}
|
|
987
|
+
declare const SystemError_base: Schema$1.TaggedErrorClass<SystemError, "SystemError", {
|
|
988
|
+
readonly _tag: Schema$1.tag<"SystemError">;
|
|
989
|
+
} & {
|
|
990
|
+
reason: Schema$1.Literal<["AlreadyExists", "BadResource", "Busy", "InvalidData", "NotFound", "PermissionDenied", "TimedOut", "UnexpectedEof", "Unknown", "WouldBlock", "WriteZero"]>;
|
|
991
|
+
module: Schema$1.Literal<["Clipboard", "Command", "FileSystem", "KeyValueStore", "Path", "Stream", "Terminal"]>;
|
|
992
|
+
method: typeof Schema$1.String;
|
|
993
|
+
description: Schema$1.optional<typeof Schema$1.String>;
|
|
994
|
+
syscall: Schema$1.optional<typeof Schema$1.String>;
|
|
995
|
+
pathOrDescriptor: Schema$1.optional<Schema$1.Union<[typeof Schema$1.String, typeof Schema$1.Number]>>;
|
|
996
|
+
cause: Schema$1.optional<typeof Schema$1.Defect>;
|
|
997
|
+
}>;
|
|
998
|
+
/**
|
|
999
|
+
* @since 1.0.0
|
|
1000
|
+
* @category models
|
|
1001
|
+
*/
|
|
1002
|
+
declare class SystemError extends SystemError_base {
|
|
1003
|
+
/**
|
|
1004
|
+
* @since 1.0.0
|
|
1005
|
+
*/
|
|
1006
|
+
readonly [TypeId]: typeof TypeId;
|
|
1007
|
+
/**
|
|
1008
|
+
* @since 1.0.0
|
|
1009
|
+
*/
|
|
1010
|
+
get message(): string;
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* @since 1.0.0
|
|
1014
|
+
* @category Models
|
|
1015
|
+
*/
|
|
1016
|
+
type PlatformError = BadArgument | SystemError;
|
|
1017
|
+
/**
|
|
1018
|
+
* @since 1.0.0
|
|
1019
|
+
* @category Models
|
|
1020
|
+
*/
|
|
1021
|
+
declare const PlatformError: Schema$1.Union<[typeof BadArgument, typeof SystemError]>;
|
|
1022
|
+
//#endregion
|
|
1023
|
+
//#region ../../node_modules/.pnpm/@effect+platform@0.96.1_effect@3.21.3/node_modules/@effect/platform/dist/dts/FileSystem.d.ts
|
|
1024
|
+
/**
|
|
1025
|
+
* @since 1.0.0
|
|
1026
|
+
* @category model
|
|
1027
|
+
*/
|
|
1028
|
+
interface FileSystem {
|
|
1029
|
+
/**
|
|
1030
|
+
* Check if a file can be accessed.
|
|
1031
|
+
* You can optionally specify the level of access to check for.
|
|
1032
|
+
*/
|
|
1033
|
+
readonly access: (path: string, options?: AccessFileOptions) => Effect$1.Effect<void, PlatformError>;
|
|
1034
|
+
/**
|
|
1035
|
+
* Copy a file or directory from `fromPath` to `toPath`.
|
|
1036
|
+
*
|
|
1037
|
+
* Equivalent to `cp -r`.
|
|
1038
|
+
*/
|
|
1039
|
+
readonly copy: (fromPath: string, toPath: string, options?: CopyOptions) => Effect$1.Effect<void, PlatformError>;
|
|
1040
|
+
/**
|
|
1041
|
+
* Copy a file from `fromPath` to `toPath`.
|
|
1042
|
+
*/
|
|
1043
|
+
readonly copyFile: (fromPath: string, toPath: string) => Effect$1.Effect<void, PlatformError>;
|
|
1044
|
+
/**
|
|
1045
|
+
* Change the permissions of a file.
|
|
1046
|
+
*/
|
|
1047
|
+
readonly chmod: (path: string, mode: number) => Effect$1.Effect<void, PlatformError>;
|
|
1048
|
+
/**
|
|
1049
|
+
* Change the owner and group of a file.
|
|
1050
|
+
*/
|
|
1051
|
+
readonly chown: (path: string, uid: number, gid: number) => Effect$1.Effect<void, PlatformError>;
|
|
1052
|
+
/**
|
|
1053
|
+
* Check if a path exists.
|
|
1054
|
+
*/
|
|
1055
|
+
readonly exists: (path: string) => Effect$1.Effect<boolean, PlatformError>;
|
|
1056
|
+
/**
|
|
1057
|
+
* Create a hard link from `fromPath` to `toPath`.
|
|
1058
|
+
*/
|
|
1059
|
+
readonly link: (fromPath: string, toPath: string) => Effect$1.Effect<void, PlatformError>;
|
|
1060
|
+
/**
|
|
1061
|
+
* Create a directory at `path`. You can optionally specify the mode and
|
|
1062
|
+
* whether to recursively create nested directories.
|
|
1063
|
+
*/
|
|
1064
|
+
readonly makeDirectory: (path: string, options?: MakeDirectoryOptions) => Effect$1.Effect<void, PlatformError>;
|
|
1065
|
+
/**
|
|
1066
|
+
* Create a temporary directory.
|
|
1067
|
+
*
|
|
1068
|
+
* By default the directory will be created inside the system's default
|
|
1069
|
+
* temporary directory, but you can specify a different location by setting
|
|
1070
|
+
* the `directory` option.
|
|
1071
|
+
*
|
|
1072
|
+
* You can also specify a prefix for the directory name by setting the
|
|
1073
|
+
* `prefix` option.
|
|
1074
|
+
*/
|
|
1075
|
+
readonly makeTempDirectory: (options?: MakeTempDirectoryOptions) => Effect$1.Effect<string, PlatformError>;
|
|
1076
|
+
/**
|
|
1077
|
+
* Create a temporary directory inside a scope.
|
|
1078
|
+
*
|
|
1079
|
+
* Functionally equivalent to `makeTempDirectory`, but the directory will be
|
|
1080
|
+
* automatically deleted when the scope is closed.
|
|
1081
|
+
*/
|
|
1082
|
+
readonly makeTempDirectoryScoped: (options?: MakeTempDirectoryOptions) => Effect$1.Effect<string, PlatformError, Scope>;
|
|
1083
|
+
/**
|
|
1084
|
+
* Create a temporary file.
|
|
1085
|
+
* The directory creation is functionally equivalent to `makeTempDirectory`.
|
|
1086
|
+
* The file name will be a randomly generated string.
|
|
1087
|
+
*/
|
|
1088
|
+
readonly makeTempFile: (options?: MakeTempFileOptions) => Effect$1.Effect<string, PlatformError>;
|
|
1089
|
+
/**
|
|
1090
|
+
* Create a temporary file inside a scope.
|
|
1091
|
+
*
|
|
1092
|
+
* Functionally equivalent to `makeTempFile`, but the file will be
|
|
1093
|
+
* automatically deleted when the scope is closed.
|
|
1094
|
+
*/
|
|
1095
|
+
readonly makeTempFileScoped: (options?: MakeTempFileOptions) => Effect$1.Effect<string, PlatformError, Scope>;
|
|
1096
|
+
/**
|
|
1097
|
+
* Open a file at `path` with the specified `options`.
|
|
1098
|
+
*
|
|
1099
|
+
* The file handle will be automatically closed when the scope is closed.
|
|
1100
|
+
*/
|
|
1101
|
+
readonly open: (path: string, options?: OpenFileOptions) => Effect$1.Effect<File$1, PlatformError, Scope>;
|
|
1102
|
+
/**
|
|
1103
|
+
* List the contents of a directory.
|
|
1104
|
+
*
|
|
1105
|
+
* You can recursively list the contents of nested directories by setting the
|
|
1106
|
+
* `recursive` option.
|
|
1107
|
+
*/
|
|
1108
|
+
readonly readDirectory: (path: string, options?: ReadDirectoryOptions) => Effect$1.Effect<Array<string>, PlatformError>;
|
|
1109
|
+
/**
|
|
1110
|
+
* Read the contents of a file.
|
|
1111
|
+
*/
|
|
1112
|
+
readonly readFile: (path: string) => Effect$1.Effect<Uint8Array, PlatformError>;
|
|
1113
|
+
/**
|
|
1114
|
+
* Read the contents of a file.
|
|
1115
|
+
*/
|
|
1116
|
+
readonly readFileString: (path: string, encoding?: string) => Effect$1.Effect<string, PlatformError>;
|
|
1117
|
+
/**
|
|
1118
|
+
* Read the destination of a symbolic link.
|
|
1119
|
+
*/
|
|
1120
|
+
readonly readLink: (path: string) => Effect$1.Effect<string, PlatformError>;
|
|
1121
|
+
/**
|
|
1122
|
+
* Resolve a path to its canonicalized absolute pathname.
|
|
1123
|
+
*/
|
|
1124
|
+
readonly realPath: (path: string) => Effect$1.Effect<string, PlatformError>;
|
|
1125
|
+
/**
|
|
1126
|
+
* Remove a file or directory.
|
|
1127
|
+
*/
|
|
1128
|
+
readonly remove: (path: string, options?: RemoveOptions) => Effect$1.Effect<void, PlatformError>;
|
|
1129
|
+
/**
|
|
1130
|
+
* Rename a file or directory.
|
|
1131
|
+
*/
|
|
1132
|
+
readonly rename: (oldPath: string, newPath: string) => Effect$1.Effect<void, PlatformError>;
|
|
1133
|
+
/**
|
|
1134
|
+
* Create a writable `Sink` for the specified `path`.
|
|
1135
|
+
*/
|
|
1136
|
+
readonly sink: (path: string, options?: SinkOptions) => Sink<void, Uint8Array, never, PlatformError>;
|
|
1137
|
+
/**
|
|
1138
|
+
* Get information about a file at `path`.
|
|
1139
|
+
*/
|
|
1140
|
+
readonly stat: (path: string) => Effect$1.Effect<File$1.Info, PlatformError>;
|
|
1141
|
+
/**
|
|
1142
|
+
* Create a readable `Stream` for the specified `path`.
|
|
1143
|
+
*
|
|
1144
|
+
* Changing the `bufferSize` option will change the internal buffer size of
|
|
1145
|
+
* the stream. It defaults to `4`.
|
|
1146
|
+
*
|
|
1147
|
+
* The `chunkSize` option will change the size of the chunks emitted by the
|
|
1148
|
+
* stream. It defaults to 64kb.
|
|
1149
|
+
*
|
|
1150
|
+
* Changing `offset` and `bytesToRead` will change the offset and the number
|
|
1151
|
+
* of bytes to read from the file.
|
|
1152
|
+
*/
|
|
1153
|
+
readonly stream: (path: string, options?: StreamOptions) => Stream<Uint8Array, PlatformError>;
|
|
1154
|
+
/**
|
|
1155
|
+
* Create a symbolic link from `fromPath` to `toPath`.
|
|
1156
|
+
*/
|
|
1157
|
+
readonly symlink: (fromPath: string, toPath: string) => Effect$1.Effect<void, PlatformError>;
|
|
1158
|
+
/**
|
|
1159
|
+
* Truncate a file to a specified length. If the `length` is not specified,
|
|
1160
|
+
* the file will be truncated to length `0`.
|
|
1161
|
+
*/
|
|
1162
|
+
readonly truncate: (path: string, length?: SizeInput) => Effect$1.Effect<void, PlatformError>;
|
|
1163
|
+
/**
|
|
1164
|
+
* Change the file system timestamps of the file at `path`.
|
|
1165
|
+
*/
|
|
1166
|
+
readonly utimes: (path: string, atime: Date | number, mtime: Date | number) => Effect$1.Effect<void, PlatformError>;
|
|
1167
|
+
/**
|
|
1168
|
+
* Watch a directory or file for changes.
|
|
1169
|
+
*
|
|
1170
|
+
* By default, only changes to the direct children of the directory are reported.
|
|
1171
|
+
* Set the `recursive` option to `true` to watch for changes in subdirectories as well.
|
|
1172
|
+
*
|
|
1173
|
+
* Note: The `recursive` option behavior depends on the backend implementation:
|
|
1174
|
+
* - When using the default Node.js `fs.watch()` backend: The `recursive`
|
|
1175
|
+
* option is supported on all platforms (Node.js v20+).
|
|
1176
|
+
* - When using `@parcel/watcher` (via `NodeFileSystem/ParcelWatcher` layer):
|
|
1177
|
+
* Watching is always recursive on all platforms. This option is ignored.
|
|
1178
|
+
*/
|
|
1179
|
+
readonly watch: (path: string, options?: WatchOptions) => Stream<WatchEvent, PlatformError>;
|
|
1180
|
+
/**
|
|
1181
|
+
* Write data to a file at `path`.
|
|
1182
|
+
*/
|
|
1183
|
+
readonly writeFile: (path: string, data: Uint8Array, options?: WriteFileOptions) => Effect$1.Effect<void, PlatformError>;
|
|
1184
|
+
/**
|
|
1185
|
+
* Write a string to a file at `path`.
|
|
1186
|
+
*/
|
|
1187
|
+
readonly writeFileString: (path: string, data: string, options?: WriteFileStringOptions) => Effect$1.Effect<void, PlatformError>;
|
|
1188
|
+
}
|
|
1189
|
+
/**
|
|
1190
|
+
* Represents a size in bytes.
|
|
1191
|
+
*
|
|
1192
|
+
* @since 1.0.0
|
|
1193
|
+
* @category sizes
|
|
1194
|
+
*/
|
|
1195
|
+
type Size = Brand.Branded<bigint, "Size">;
|
|
1196
|
+
/**
|
|
1197
|
+
* Represents a size in bytes.
|
|
1198
|
+
*
|
|
1199
|
+
* @since 1.0.0
|
|
1200
|
+
* @category sizes
|
|
1201
|
+
*/
|
|
1202
|
+
type SizeInput = bigint | number | Size;
|
|
1203
|
+
/**
|
|
1204
|
+
* @since 1.0.0
|
|
1205
|
+
* @category sizes
|
|
1206
|
+
*/
|
|
1207
|
+
declare const Size: (bytes: SizeInput) => Size;
|
|
1208
|
+
/**
|
|
1209
|
+
* @since 1.0.0
|
|
1210
|
+
* @category model
|
|
1211
|
+
*/
|
|
1212
|
+
type OpenFlag = "r" | "r+" | "w" | "wx" | "w+" | "wx+" | "a" | "ax" | "a+" | "ax+";
|
|
1213
|
+
/**
|
|
1214
|
+
* @since 1.0.0
|
|
1215
|
+
* @category options
|
|
1216
|
+
*/
|
|
1217
|
+
interface AccessFileOptions {
|
|
1218
|
+
readonly ok?: boolean;
|
|
1219
|
+
readonly readable?: boolean;
|
|
1220
|
+
readonly writable?: boolean;
|
|
1221
|
+
}
|
|
1222
|
+
/**
|
|
1223
|
+
* @since 1.0.0
|
|
1224
|
+
* @category options
|
|
1225
|
+
*/
|
|
1226
|
+
interface MakeDirectoryOptions {
|
|
1227
|
+
readonly recursive?: boolean;
|
|
1228
|
+
readonly mode?: number;
|
|
1229
|
+
}
|
|
1230
|
+
/**
|
|
1231
|
+
* @since 1.0.0
|
|
1232
|
+
* @category options
|
|
1233
|
+
*/
|
|
1234
|
+
interface CopyOptions {
|
|
1235
|
+
readonly overwrite?: boolean;
|
|
1236
|
+
readonly preserveTimestamps?: boolean;
|
|
1237
|
+
}
|
|
1238
|
+
/**
|
|
1239
|
+
* @since 1.0.0
|
|
1240
|
+
* @category options
|
|
1241
|
+
*/
|
|
1242
|
+
interface MakeTempDirectoryOptions {
|
|
1243
|
+
readonly directory?: string;
|
|
1244
|
+
readonly prefix?: string;
|
|
1245
|
+
}
|
|
1246
|
+
/**
|
|
1247
|
+
* @since 1.0.0
|
|
1248
|
+
* @category options
|
|
1249
|
+
*/
|
|
1250
|
+
interface MakeTempFileOptions {
|
|
1251
|
+
readonly directory?: string;
|
|
1252
|
+
readonly prefix?: string;
|
|
1253
|
+
readonly suffix?: string;
|
|
1254
|
+
}
|
|
1255
|
+
/**
|
|
1256
|
+
* @since 1.0.0
|
|
1257
|
+
* @category options
|
|
1258
|
+
*/
|
|
1259
|
+
interface OpenFileOptions {
|
|
1260
|
+
readonly flag?: OpenFlag;
|
|
1261
|
+
readonly mode?: number;
|
|
1262
|
+
}
|
|
1263
|
+
/**
|
|
1264
|
+
* @since 1.0.0
|
|
1265
|
+
* @category options
|
|
1266
|
+
*/
|
|
1267
|
+
interface ReadDirectoryOptions {
|
|
1268
|
+
readonly recursive?: boolean;
|
|
1269
|
+
}
|
|
1270
|
+
/**
|
|
1271
|
+
* @since 1.0.0
|
|
1272
|
+
* @category options
|
|
1273
|
+
*/
|
|
1274
|
+
interface RemoveOptions {
|
|
1275
|
+
/**
|
|
1276
|
+
* When `true`, you can recursively remove nested directories.
|
|
1277
|
+
*/
|
|
1278
|
+
readonly recursive?: boolean;
|
|
1279
|
+
/**
|
|
1280
|
+
* When `true`, exceptions will be ignored if `path` does not exist.
|
|
1281
|
+
*/
|
|
1282
|
+
readonly force?: boolean;
|
|
1283
|
+
}
|
|
1284
|
+
/**
|
|
1285
|
+
* @since 1.0.0
|
|
1286
|
+
* @category options
|
|
1287
|
+
*/
|
|
1288
|
+
interface SinkOptions extends OpenFileOptions {}
|
|
1289
|
+
/**
|
|
1290
|
+
* @since 1.0.0
|
|
1291
|
+
* @category options
|
|
1292
|
+
*/
|
|
1293
|
+
interface StreamOptions {
|
|
1294
|
+
readonly bufferSize?: number;
|
|
1295
|
+
readonly bytesToRead?: SizeInput;
|
|
1296
|
+
readonly chunkSize?: SizeInput;
|
|
1297
|
+
readonly offset?: SizeInput;
|
|
1298
|
+
}
|
|
1299
|
+
/**
|
|
1300
|
+
* @since 1.0.0
|
|
1301
|
+
* @category options
|
|
1302
|
+
*/
|
|
1303
|
+
interface WriteFileOptions {
|
|
1304
|
+
readonly flag?: OpenFlag;
|
|
1305
|
+
readonly mode?: number;
|
|
1306
|
+
}
|
|
1307
|
+
/**
|
|
1308
|
+
* @since 1.0.0
|
|
1309
|
+
* @category options
|
|
1310
|
+
*/
|
|
1311
|
+
interface WriteFileStringOptions {
|
|
1312
|
+
readonly flag?: OpenFlag;
|
|
1313
|
+
readonly mode?: number;
|
|
1314
|
+
}
|
|
1315
|
+
/**
|
|
1316
|
+
* @since 1.0.0
|
|
1317
|
+
* @category options
|
|
1318
|
+
*/
|
|
1319
|
+
interface WatchOptions {
|
|
1320
|
+
/**
|
|
1321
|
+
* When `true`, the watcher will also watch for changes in subdirectories.
|
|
1322
|
+
*/
|
|
1323
|
+
readonly recursive?: boolean;
|
|
1324
|
+
}
|
|
1325
|
+
/**
|
|
1326
|
+
* @since 1.0.0
|
|
1327
|
+
* @category tag
|
|
1328
|
+
*/
|
|
1329
|
+
declare const FileSystem: Tag<FileSystem, FileSystem>;
|
|
1330
|
+
/**
|
|
1331
|
+
* @since 1.0.0
|
|
1332
|
+
* @category type id
|
|
1333
|
+
*/
|
|
1334
|
+
declare const FileTypeId: unique symbol;
|
|
1335
|
+
/**
|
|
1336
|
+
* @since 1.0.0
|
|
1337
|
+
* @category type id
|
|
1338
|
+
*/
|
|
1339
|
+
type FileTypeId = typeof FileTypeId;
|
|
1340
|
+
/**
|
|
1341
|
+
* @since 1.0.0
|
|
1342
|
+
* @category model
|
|
1343
|
+
*/
|
|
1344
|
+
interface File$1 {
|
|
1345
|
+
readonly [FileTypeId]: FileTypeId;
|
|
1346
|
+
readonly fd: File$1.Descriptor;
|
|
1347
|
+
readonly stat: Effect$1.Effect<File$1.Info, PlatformError>;
|
|
1348
|
+
readonly seek: (offset: SizeInput, from: SeekMode) => Effect$1.Effect<void>;
|
|
1349
|
+
readonly sync: Effect$1.Effect<void, PlatformError>;
|
|
1350
|
+
readonly read: (buffer: Uint8Array) => Effect$1.Effect<Size, PlatformError>;
|
|
1351
|
+
readonly readAlloc: (size: SizeInput) => Effect$1.Effect<Option<Uint8Array>, PlatformError>;
|
|
1352
|
+
readonly truncate: (length?: SizeInput) => Effect$1.Effect<void, PlatformError>;
|
|
1353
|
+
readonly write: (buffer: Uint8Array) => Effect$1.Effect<Size, PlatformError>;
|
|
1354
|
+
readonly writeAll: (buffer: Uint8Array) => Effect$1.Effect<void, PlatformError>;
|
|
1355
|
+
}
|
|
1356
|
+
/**
|
|
1357
|
+
* @since 1.0.0
|
|
1358
|
+
*/
|
|
1359
|
+
declare namespace File$1 {
|
|
1360
|
+
/**
|
|
1361
|
+
* @since 1.0.0
|
|
1362
|
+
* @category model
|
|
1363
|
+
*/
|
|
1364
|
+
type Descriptor = Brand.Branded<number, "FileDescriptor">;
|
|
1365
|
+
/**
|
|
1366
|
+
* @since 1.0.0
|
|
1367
|
+
* @category model
|
|
1368
|
+
*/
|
|
1369
|
+
type Type = "File" | "Directory" | "SymbolicLink" | "BlockDevice" | "CharacterDevice" | "FIFO" | "Socket" | "Unknown";
|
|
1370
|
+
/**
|
|
1371
|
+
* @since 1.0.0
|
|
1372
|
+
* @category model
|
|
1373
|
+
*/
|
|
1374
|
+
interface Info {
|
|
1375
|
+
readonly type: Type;
|
|
1376
|
+
readonly mtime: Option<Date>;
|
|
1377
|
+
readonly atime: Option<Date>;
|
|
1378
|
+
readonly birthtime: Option<Date>;
|
|
1379
|
+
readonly dev: number;
|
|
1380
|
+
readonly ino: Option<number>;
|
|
1381
|
+
readonly mode: number;
|
|
1382
|
+
readonly nlink: Option<number>;
|
|
1383
|
+
readonly uid: Option<number>;
|
|
1384
|
+
readonly gid: Option<number>;
|
|
1385
|
+
readonly rdev: Option<number>;
|
|
1386
|
+
readonly size: Size;
|
|
1387
|
+
readonly blksize: Option<Size>;
|
|
1388
|
+
readonly blocks: Option<number>;
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
/**
|
|
1392
|
+
* @since 1.0.0
|
|
1393
|
+
* @category model
|
|
1394
|
+
*/
|
|
1395
|
+
type SeekMode = "start" | "current";
|
|
1396
|
+
/**
|
|
1397
|
+
* @since 1.0.0
|
|
1398
|
+
* @category model
|
|
1399
|
+
*/
|
|
1400
|
+
type WatchEvent = WatchEvent.Create | WatchEvent.Update | WatchEvent.Remove;
|
|
1401
|
+
/**
|
|
1402
|
+
* @since 1.0.0
|
|
1403
|
+
* @category model
|
|
1404
|
+
*/
|
|
1405
|
+
declare namespace WatchEvent {
|
|
1406
|
+
/**
|
|
1407
|
+
* @since 1.0.0
|
|
1408
|
+
* @category model
|
|
1409
|
+
*/
|
|
1410
|
+
interface Create {
|
|
1411
|
+
readonly _tag: "Create";
|
|
1412
|
+
readonly path: string;
|
|
1413
|
+
}
|
|
1414
|
+
/**
|
|
1415
|
+
* @since 1.0.0
|
|
1416
|
+
* @category model
|
|
1417
|
+
*/
|
|
1418
|
+
interface Update {
|
|
1419
|
+
readonly _tag: "Update";
|
|
1420
|
+
readonly path: string;
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* @since 1.0.0
|
|
1424
|
+
* @category model
|
|
1425
|
+
*/
|
|
1426
|
+
interface Remove {
|
|
1427
|
+
readonly _tag: "Remove";
|
|
1428
|
+
readonly path: string;
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
//#endregion
|
|
1432
|
+
//#region src/report/schema-export.d.ts
|
|
1433
|
+
/** Generate the SchemaStore-compatible JSON Schema document for BuildReport. */
|
|
1434
|
+
declare const generateBuildReportSchema: () => Effect.Effect<JsonSchemaOutput, JsonSchemaError, FileSystem>;
|
|
1435
|
+
//#endregion
|
|
1436
|
+
//#region src/report/timer.d.ts
|
|
1437
|
+
declare function formatTime(ms: number): string;
|
|
1438
|
+
interface Timer {
|
|
1439
|
+
readonly elapsed: () => number;
|
|
1440
|
+
readonly format: () => string;
|
|
1441
|
+
}
|
|
1442
|
+
/** Create a wall-clock timer. (Date.now is fine in runtime build code.) */
|
|
1443
|
+
declare function createTimer(now?: () => number): Timer;
|
|
1444
|
+
//#endregion
|
|
1445
|
+
//#region src/targets/binding.d.ts
|
|
1446
|
+
/** Write the target-to-group binding to dist/prod/targets.json for the release action to consume. Returns the path. */
|
|
1447
|
+
declare function writeTargetsBinding(cwd: string, resolution: TargetResolution): string;
|
|
1448
|
+
//#endregion
|
|
1449
|
+
//#region src/targets/resolve-targets.d.ts
|
|
1450
|
+
/** Resolve a `publishConfig.targets` map into the distinct groups to build and every target bound to one. Pure; throws ConfigValidationError on structurally-invalid config. */
|
|
1451
|
+
declare function resolveTargets(options: {
|
|
1452
|
+
targets: PublishTargets;
|
|
1453
|
+
baseName: string;
|
|
1454
|
+
}): TargetResolution;
|
|
1455
|
+
//#endregion
|
|
1456
|
+
export { type BuildEmittedManifestOptions, type BuildFormat, type BuildGroupSpec, type BuildReport, BuildReport as BuildReportSchema, type BuildTargetGroupsOptions, CatalogAssemblyError, CatalogResolutionError, CiAnnotationsFormatter, ConfigValidationError, ConfigValidator, ConfigValidatorLive, DEFAULT_EXE_NODE_VERSION, type DeriveOptions, type DerivedTsdownOptions, type DualExports, type EmitManifestOptions, type EntryOverride, type Environment, EnvironmentDetector, EnvironmentDetectorLive, type ExeBuild, type ExeConfig, type ExeSeaConfig, type ExeTarget, type ExeTargetInput, type Executor, ExecutorResolver, ExecutorResolverLive, type ExtractOptions, type ExtractResult, FormatSelector, FormatSelectorLive, type Formatter, type FormatterContext, type GenerateMetaOptions, type Json, JsonFormatter, type JsxConfig, type ManifestLike, MarkdownFormatter, MetaGenerationError, type MetaOptions, type MetaResult, type NormalizedExe, type NormalizedMeta, type OutputFormat, OutputRenderer, OutputRendererLive, type PackageJsonEntriesOptions, type PackageJsonLike, type PkgOsCpu, type PortableTsconfig, type PublishTargetObject, type PublishTargetValue, type PublishTargets, type RenderReportOptions, type RenderedOutput, ReportPipelineLive, ReportTimings, type ResolvedCompilerOptions, type ResolvedGroup, type ResolvedTarget, type ResolvedTsconfig, type ResolvedTsconfigOptions, type RunExeBuildOptions, SilentFormatter, type TargetGroupId, type TargetGroupRef, type TargetGroupReport, TargetGroupReport as TargetGroupReportSchema, type TargetResolution, TerminalFormatter, type Timer, type TransformManifestOptions, type TsconfigJsx, TsconfigResolver, type TsdocOptions, type TsdocTagDefinition, type TsdownBuild, type ValidationInput, type WarningSuppressionRule, buildEmittedManifest, buildResolvedTsconfig, buildTargetGroups, cjsDefaultInterop, createEntryName, createTimer, defaultManifestTransform, deriveTargetGroupOptions, emitManifest, extractEntries, formatTime, generateBuildReportSchema, generateMeta, isTargetObject, nodeBuiltinDefaultInterop, normalizeBinPaths, normalizeExeOptions, normalizeMetaOptions, packageJsonEntries, readTsconfigJsx, removeDeclarationMaps, renderReport, resolveJsxConfig, resolveManifest, resolvePortableTsconfig, resolveTargets, runExeBuild, syncPublicDir, transformBin, transformExports, transformManifest, writeResolvedTsconfig, writeTargetsBinding };
|
|
1457
|
+
//# sourceMappingURL=index.d.ts.map
|