@savvy-web/bundler 1.0.0 → 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/LICENSE +21 -0
- package/config.js +2 -1
- package/index.d.ts +23 -0
- package/package.json +3 -3
- package/run.js +2 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Savvy Web Strategy, LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
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.
|
|
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,8 +28,8 @@
|
|
|
28
28
|
"./package.json": "./package.json"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@savvy-web/tsdown-plugins": "1.
|
|
32
|
-
"@tsdown/exe": "^0.22.
|
|
31
|
+
"@savvy-web/tsdown-plugins": "1.1.0",
|
|
32
|
+
"@tsdown/exe": "^0.22.3",
|
|
33
33
|
"effect": "^3.21.4",
|
|
34
34
|
"rolldown": "^1.1.3",
|
|
35
35
|
"tsdown": "^0.22.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,
|