@savvy-web/bundler 1.0.1 → 1.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/config.js +2 -1
- package/index.d.ts +23 -0
- package/package.json +2 -2
- package/run.js +2 -1
package/config.js
CHANGED
|
@@ -25,7 +25,8 @@ function defineBuild(input = {}) {
|
|
|
25
25
|
overrides: input.overrides,
|
|
26
26
|
looseFiles: input.looseFiles,
|
|
27
27
|
define: input.define,
|
|
28
|
-
plugins: input.plugins
|
|
28
|
+
plugins: input.plugins,
|
|
29
|
+
emitDts: input.emitDts ?? true
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
32
|
/** Parse the build CLI argv into the normalized target/flags shape. @public */
|
package/index.d.ts
CHANGED
|
@@ -134,6 +134,20 @@ interface BuildConfigInput {
|
|
|
134
134
|
* interop plugins and before its metrics instrumentation.
|
|
135
135
|
*/
|
|
136
136
|
readonly plugins?: ReadonlyArray<Plugin$1> | undefined;
|
|
137
|
+
/**
|
|
138
|
+
* Emit the bundled `.d.ts` pass for BOTH dev and prod builds (and, downstream on prod, the
|
|
139
|
+
* meta/API-Extractor pass that reads those declarations). Defaults to `true` — bundled,
|
|
140
|
+
* self-contained declarations per public entry are the default posture. Set `false` to skip the
|
|
141
|
+
* dts pass (dev and prod) and the prod meta pass while still
|
|
142
|
+
* emitting JS output, byte-variant target folders, catalog/workspace resolution, and the
|
|
143
|
+
* transformed `package.json`. Orthogonal to `meta: false`, which disables ONLY the API-model
|
|
144
|
+
* generation and still runs the dts pass; `emitDts: false` disables the dts pass itself (and
|
|
145
|
+
* therefore meta, which has nothing to read without it). Intended for JS-only artifacts that
|
|
146
|
+
* never consume declarations (e2e fixtures, bins, internal tools) — skipping the TypeScript
|
|
147
|
+
* compiler load cuts a ~13s/build cost. Named `emitDts` (not `dts`) to avoid confusion with
|
|
148
|
+
* tsdown's internal nested `dts` config object.
|
|
149
|
+
*/
|
|
150
|
+
readonly emitDts?: boolean | undefined;
|
|
137
151
|
}
|
|
138
152
|
/** @public */
|
|
139
153
|
interface BuildConfig {
|
|
@@ -183,6 +197,15 @@ interface BuildConfig {
|
|
|
183
197
|
readonly define?: Record<string, string> | undefined;
|
|
184
198
|
/** Custom tsdown/rolldown plugins forwarded to every tsdown run (JS, dts, per-module declarations, looseFiles). */
|
|
185
199
|
readonly plugins?: ReadonlyArray<Plugin$1> | undefined;
|
|
200
|
+
/**
|
|
201
|
+
* Emit the bundled `.d.ts` pass for dev and prod builds (and, downstream on prod, the meta pass).
|
|
202
|
+
* Defaults to `true`. See
|
|
203
|
+
* {@link BuildConfigInput.emitDts}. Typed optional (like `minify`) even though `defineBuild`
|
|
204
|
+
* always resolves a concrete boolean — a hand-authored `BuildConfig` literal (bypassing
|
|
205
|
+
* `defineBuild`, as several `runBuild` unit tests do) need not supply it; `runBuild` treats
|
|
206
|
+
* `undefined` the same as `true` (current behavior).
|
|
207
|
+
*/
|
|
208
|
+
readonly emitDts?: boolean | undefined;
|
|
186
209
|
}
|
|
187
210
|
/**
|
|
188
211
|
* Normalize + validate a defineBuild config. Pure when imported; self-runs when entry (see run.ts).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvy-web/bundler",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Zero-config tsdown-based bundler for Silk Suite TypeScript packages",
|
|
6
6
|
"homepage": "https://github.com/savvy-web/systems/tree/main/packages/bundler",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"./package.json": "./package.json"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@savvy-web/tsdown-plugins": "1.0
|
|
31
|
+
"@savvy-web/tsdown-plugins": "1.1.0",
|
|
32
32
|
"@tsdown/exe": "^0.22.3",
|
|
33
33
|
"effect": "^3.21.4",
|
|
34
34
|
"rolldown": "^1.1.3",
|
package/run.js
CHANGED
|
@@ -237,11 +237,12 @@ async function runBuild(config, options) {
|
|
|
237
237
|
...config.plugins !== void 0 ? { extraPlugins: config.plugins } : {},
|
|
238
238
|
...exeRewrite !== void 0 ? { exeRewrite } : {},
|
|
239
239
|
...target === "prod" ? { emitDeclarations: true } : {},
|
|
240
|
+
emitDts: config.emitDts,
|
|
240
241
|
collector,
|
|
241
242
|
verbose
|
|
242
243
|
});
|
|
243
244
|
if (target === "prod" && resolution !== void 0) writeBinding(cwd, resolution);
|
|
244
|
-
if (target === "prod" && config.meta !== false && (config.exe === void 0 || hasJsEntries)) {
|
|
245
|
+
if (target === "prod" && config.meta !== false && config.emitDts !== false && (config.exe === void 0 || hasJsEntries)) {
|
|
245
246
|
const ci = process.env.CI === "true" || process.env.GITHUB_ACTIONS === "true";
|
|
246
247
|
await runMetaPass({
|
|
247
248
|
cwd,
|