@d1g1tal/tsbuild 1.7.5 → 1.8.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/CHANGELOG.md +32 -0
- package/dist/{5BZX3OK7.js → YKY7BYLQ.js} +201 -9
- package/dist/tsbuild.js +2 -2
- package/dist/type-script-project.d.ts +15 -3
- package/dist/type-script-project.js +1 -1
- package/package.json +7 -7
- package/schema.json +48 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
## [1.8.0](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.7.5...v1.8.0) (2026-04-09)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **build:** add support for esbuild plugins and iife output (b4ffefbf01e0b3c1bb017f9ce0f87608235c9a6b)
|
|
6
|
+
- add iife plugin to generate iife bundle
|
|
7
|
+
- add resolve-plugin to resolve string/tuple plugin options to plugin instances
|
|
8
|
+
- update type definitions for BuildOptions and create PluginReference type
|
|
9
|
+
- update json schema to support new plugin format and iife options
|
|
10
|
+
- register plugins during build
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Miscellaneous Chores
|
|
14
|
+
|
|
15
|
+
* **deps:** remove overrides from package.json and update watchr package (7d87c0b207a76a17c37fb10df2d1686d5f23713b)
|
|
16
|
+
* **deps:** update dependencies (142c13fff1425e477239ac7f8bdb0a8fcffd3c07)
|
|
17
|
+
- update @types/node to ^25.5.2
|
|
18
|
+
- update @typescript-eslint/eslint-plugin to ^8.58.1
|
|
19
|
+
- update @typescript-eslint/parser to ^8.58.1
|
|
20
|
+
- update @vitest/coverage-v8 to ^4.1.4
|
|
21
|
+
- update typescript-eslint to ^8.58.1
|
|
22
|
+
- update vitest to ^4.1.4
|
|
23
|
+
- update various transitive dependencies in pnpm-lock.yaml
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Tests
|
|
27
|
+
|
|
28
|
+
* **plugins:** add tests for iife and resolve plugins (63371ebd3652831ae168a1fbc18f32d2d436707b)
|
|
29
|
+
- add unit tests for iife plugin covering build options, entry point identification, virtual loader, and file output
|
|
30
|
+
- add unit tests for resolve-plugin utility covering pass-through, string, tuple references, and error handling
|
|
31
|
+
- add a test fixture for the iife plugin
|
|
32
|
+
|
|
1
33
|
## [1.7.5](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.7.4...v1.7.5) (2026-04-07)
|
|
2
34
|
|
|
3
35
|
### Bug Fixes
|
|
@@ -106,7 +106,7 @@ var Files = class _Files {
|
|
|
106
106
|
* @returns The decompressed buffer.
|
|
107
107
|
*/
|
|
108
108
|
static decompressBuffer(buffer) {
|
|
109
|
-
return new Promise((
|
|
109
|
+
return new Promise((resolve3, reject) => brotliDecompress(buffer, (error, result) => error ? reject(error) : resolve3(result)));
|
|
110
110
|
}
|
|
111
111
|
/**
|
|
112
112
|
* Compress data using Brotli compression.
|
|
@@ -115,7 +115,7 @@ var Files = class _Files {
|
|
|
115
115
|
* @returns The compressed buffer.
|
|
116
116
|
*/
|
|
117
117
|
static compressBuffer(buffer) {
|
|
118
|
-
return new Promise((
|
|
118
|
+
return new Promise((resolve3, reject) => brotliCompress(buffer, (error, result) => error ? reject(error) : resolve3(result)));
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
121
121
|
* Load a file and deserialize it using V8 deserialization.
|
|
@@ -1467,6 +1467,190 @@ var externalModulesPlugin = ({ dependencies = [], noExternal = [] }) => {
|
|
|
1467
1467
|
};
|
|
1468
1468
|
};
|
|
1469
1469
|
|
|
1470
|
+
// src/plugins/resolve-plugin.ts
|
|
1471
|
+
import { resolve } from "node:path";
|
|
1472
|
+
function isPlugin(value) {
|
|
1473
|
+
if (typeof value !== "object" || value === null) {
|
|
1474
|
+
return false;
|
|
1475
|
+
}
|
|
1476
|
+
return "name" in value && typeof value.name === "string" && "setup" in value && typeof value.setup === "function";
|
|
1477
|
+
}
|
|
1478
|
+
function isFactory(value) {
|
|
1479
|
+
return typeof value === "function";
|
|
1480
|
+
}
|
|
1481
|
+
async function resolveReference(reference, projectDir) {
|
|
1482
|
+
const [specifier, options] = typeof reference === "string" ? [reference, void 0] : reference;
|
|
1483
|
+
const resolved = Paths.isPath(specifier) ? resolve(projectDir, specifier) : specifier;
|
|
1484
|
+
let module;
|
|
1485
|
+
try {
|
|
1486
|
+
module = await import(resolved);
|
|
1487
|
+
} catch (error) {
|
|
1488
|
+
throw new ConfigurationError(`Failed to load plugin "${specifier}": ${error instanceof Error ? error.message : String(error)}`);
|
|
1489
|
+
}
|
|
1490
|
+
const defaultExport = module.default;
|
|
1491
|
+
if (defaultExport === void 0) {
|
|
1492
|
+
throw new ConfigurationError(`Plugin "${specifier}" has no default export. The module must export a plugin factory function or Plugin object as its default export.`);
|
|
1493
|
+
}
|
|
1494
|
+
if (isFactory(defaultExport)) {
|
|
1495
|
+
const result = defaultExport(options);
|
|
1496
|
+
if (!isPlugin(result)) {
|
|
1497
|
+
throw new ConfigurationError(`Plugin "${specifier}" factory did not return a valid esbuild Plugin (expected { name: string, setup: function }).`);
|
|
1498
|
+
}
|
|
1499
|
+
return result;
|
|
1500
|
+
}
|
|
1501
|
+
if (isPlugin(defaultExport)) {
|
|
1502
|
+
if (options !== void 0) {
|
|
1503
|
+
Logger.warn(`Plugin "${specifier}" is a Plugin object, not a factory function. The provided options will be ignored.`);
|
|
1504
|
+
}
|
|
1505
|
+
return defaultExport;
|
|
1506
|
+
}
|
|
1507
|
+
throw new ConfigurationError(`Plugin "${specifier}" default export is not a function or valid esbuild Plugin object.`);
|
|
1508
|
+
}
|
|
1509
|
+
async function resolvePlugins(plugins, projectDir) {
|
|
1510
|
+
const resolved = [];
|
|
1511
|
+
for (const entry of plugins) {
|
|
1512
|
+
if (isPlugin(entry)) {
|
|
1513
|
+
resolved.push(entry);
|
|
1514
|
+
} else {
|
|
1515
|
+
resolved.push(await resolveReference(entry, projectDir));
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
return resolved;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
// src/plugins/iife.ts
|
|
1522
|
+
import { basename as basename2, dirname as dirname2, join, relative, resolve as resolve2 } from "node:path";
|
|
1523
|
+
import { mkdir as mkdir3, writeFile as writeFile3 } from "node:fs/promises";
|
|
1524
|
+
import { build as esbuild } from "esbuild";
|
|
1525
|
+
var textDecoder2 = new TextDecoder();
|
|
1526
|
+
var jsExtension = ".js";
|
|
1527
|
+
function iifePlugin(options) {
|
|
1528
|
+
const globalName = options?.globalName;
|
|
1529
|
+
const files = [];
|
|
1530
|
+
return {
|
|
1531
|
+
files,
|
|
1532
|
+
plugin: {
|
|
1533
|
+
name: "esbuild:iife",
|
|
1534
|
+
/**
|
|
1535
|
+
* Configures the esbuild build instance to produce IIFE output
|
|
1536
|
+
* @param build The esbuild build instance
|
|
1537
|
+
*/
|
|
1538
|
+
setup(build) {
|
|
1539
|
+
const outdir = build.initialOptions.outdir;
|
|
1540
|
+
if (!outdir) {
|
|
1541
|
+
return;
|
|
1542
|
+
}
|
|
1543
|
+
const sourcemap = build.initialOptions.sourcemap;
|
|
1544
|
+
const entryPointNames = extractEntryNames(build.initialOptions.entryPoints);
|
|
1545
|
+
build.onEnd(async ({ outputFiles }) => {
|
|
1546
|
+
if (!outputFiles?.length || entryPointNames.length === 0) {
|
|
1547
|
+
return;
|
|
1548
|
+
}
|
|
1549
|
+
const written = await buildIife(outputFiles, entryPointNames, outdir, globalName, sourcemap);
|
|
1550
|
+
files.push(...written);
|
|
1551
|
+
});
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
};
|
|
1555
|
+
}
|
|
1556
|
+
function extractEntryNames(entryPoints) {
|
|
1557
|
+
if (!entryPoints) {
|
|
1558
|
+
return [];
|
|
1559
|
+
}
|
|
1560
|
+
if (Array.isArray(entryPoints)) {
|
|
1561
|
+
const names = [];
|
|
1562
|
+
for (const entry of entryPoints) {
|
|
1563
|
+
if (typeof entry === "string") {
|
|
1564
|
+
names.push(basename2(entry).replace(/\.[^.]+$/, ""));
|
|
1565
|
+
} else {
|
|
1566
|
+
names.push(entry.out ?? basename2(entry.in).replace(/\.[^.]+$/, ""));
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
return names;
|
|
1570
|
+
}
|
|
1571
|
+
return Object.keys(entryPoints);
|
|
1572
|
+
}
|
|
1573
|
+
async function buildIife(outputFiles, entryPointNames, outdir, globalName, sourcemap) {
|
|
1574
|
+
const fileContents = /* @__PURE__ */ new Map();
|
|
1575
|
+
for (const file of outputFiles) {
|
|
1576
|
+
if (file.path.endsWith(jsExtension)) {
|
|
1577
|
+
fileContents.set(file.path, textDecoder2.decode(file.contents));
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
const entryPoints = {};
|
|
1581
|
+
for (const name of entryPointNames) {
|
|
1582
|
+
const absPath = join(outdir, name + jsExtension);
|
|
1583
|
+
if (fileContents.has(absPath)) {
|
|
1584
|
+
entryPoints[name] = absPath;
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
if (Object.keys(entryPoints).length === 0) {
|
|
1588
|
+
return [];
|
|
1589
|
+
}
|
|
1590
|
+
const hasSourceMap = sourcemap !== void 0 && sourcemap !== false;
|
|
1591
|
+
const iifeOutdir = join(outdir, "iife");
|
|
1592
|
+
const { outputFiles: iifeFiles } = await esbuild({
|
|
1593
|
+
entryPoints,
|
|
1594
|
+
bundle: true,
|
|
1595
|
+
format: "iife",
|
|
1596
|
+
globalName,
|
|
1597
|
+
splitting: false,
|
|
1598
|
+
outdir: iifeOutdir,
|
|
1599
|
+
sourcemap: hasSourceMap ? "external" : false,
|
|
1600
|
+
write: false,
|
|
1601
|
+
logLevel: "warning",
|
|
1602
|
+
footer: globalName ? { js: `globalThis.${globalName} = ${globalName};` } : void 0,
|
|
1603
|
+
plugins: [virtualLoaderPlugin(fileContents)]
|
|
1604
|
+
});
|
|
1605
|
+
const entryOutputs = /* @__PURE__ */ new Set();
|
|
1606
|
+
for (const name of entryPointNames) {
|
|
1607
|
+
entryOutputs.add(join(iifeOutdir, name + jsExtension));
|
|
1608
|
+
}
|
|
1609
|
+
await mkdir3(iifeOutdir, { recursive: true });
|
|
1610
|
+
const written = [];
|
|
1611
|
+
const writes = [];
|
|
1612
|
+
for (const file of iifeFiles) {
|
|
1613
|
+
const basePath = file.path.endsWith(".map") ? file.path.slice(0, -4) : file.path;
|
|
1614
|
+
if (entryOutputs.has(basePath)) {
|
|
1615
|
+
writes.push(writeFile3(file.path, file.contents));
|
|
1616
|
+
written.push({ path: relative(process.cwd(), file.path), size: file.contents.byteLength });
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
await Promise.all(writes);
|
|
1620
|
+
return written;
|
|
1621
|
+
}
|
|
1622
|
+
function virtualLoaderPlugin(fileContents) {
|
|
1623
|
+
return {
|
|
1624
|
+
name: "iife:virtual-loader",
|
|
1625
|
+
/**
|
|
1626
|
+
* Registers onResolve and onLoad hooks for virtual file loading
|
|
1627
|
+
* @param build The esbuild build instance
|
|
1628
|
+
*/
|
|
1629
|
+
setup(build) {
|
|
1630
|
+
build.onResolve({ filter: /.*/ }, (args) => {
|
|
1631
|
+
if (args.kind === "entry-point") {
|
|
1632
|
+
return { path: args.path, namespace: "iife" };
|
|
1633
|
+
}
|
|
1634
|
+
if (!args.path.startsWith(".") && !args.path.startsWith("/")) {
|
|
1635
|
+
return { external: true };
|
|
1636
|
+
}
|
|
1637
|
+
const resolved = resolve2(args.resolveDir, args.path);
|
|
1638
|
+
if (fileContents.has(resolved)) {
|
|
1639
|
+
return { path: resolved, namespace: "iife" };
|
|
1640
|
+
}
|
|
1641
|
+
return { external: true };
|
|
1642
|
+
});
|
|
1643
|
+
build.onLoad({ filter: /.*/, namespace: "iife" }, (args) => {
|
|
1644
|
+
const contents = fileContents.get(args.path);
|
|
1645
|
+
if (contents !== void 0) {
|
|
1646
|
+
return { contents, loader: "js", resolveDir: dirname2(args.path) };
|
|
1647
|
+
}
|
|
1648
|
+
return null;
|
|
1649
|
+
});
|
|
1650
|
+
}
|
|
1651
|
+
};
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1470
1654
|
// src/process-manager.ts
|
|
1471
1655
|
var ProcessEvent = {
|
|
1472
1656
|
exit: "exit",
|
|
@@ -1650,7 +1834,7 @@ var _DebounceManager = class _DebounceManager {
|
|
|
1650
1834
|
let timeoutId;
|
|
1651
1835
|
let pendingResolve;
|
|
1652
1836
|
return function(...args) {
|
|
1653
|
-
return new Promise((
|
|
1837
|
+
return new Promise((resolve3, reject) => {
|
|
1654
1838
|
if (timeoutId) {
|
|
1655
1839
|
clearTimeout(timeoutId);
|
|
1656
1840
|
_DebounceManager.timers.delete(timeoutId);
|
|
@@ -1658,13 +1842,13 @@ var _DebounceManager = class _DebounceManager {
|
|
|
1658
1842
|
if (pendingResolve) {
|
|
1659
1843
|
pendingResolve(void 0);
|
|
1660
1844
|
}
|
|
1661
|
-
pendingResolve =
|
|
1845
|
+
pendingResolve = resolve3;
|
|
1662
1846
|
timeoutId = setTimeout(() => {
|
|
1663
1847
|
if (timeoutId) {
|
|
1664
1848
|
_DebounceManager.timers.delete(timeoutId);
|
|
1665
1849
|
}
|
|
1666
1850
|
try {
|
|
1667
|
-
|
|
1851
|
+
resolve3(func.apply(this, args));
|
|
1668
1852
|
} catch (error) {
|
|
1669
1853
|
reject(castError(error));
|
|
1670
1854
|
} finally {
|
|
@@ -2093,7 +2277,7 @@ function inferEntryPoints(packageJson, outDir, sourceDir = "src") {
|
|
|
2093
2277
|
}
|
|
2094
2278
|
|
|
2095
2279
|
// src/type-script-project.ts
|
|
2096
|
-
import { build as
|
|
2280
|
+
import { build as esbuild2, formatMessages } from "esbuild";
|
|
2097
2281
|
import { performance as performance2 } from "node:perf_hooks";
|
|
2098
2282
|
import { sys as sys2, createIncrementalProgram, formatDiagnostics, formatDiagnosticsWithColorAndContext, parseJsonConfigFileContent, readConfigFile, findConfigFile } from "typescript";
|
|
2099
2283
|
var globCharacters = /[*?\\[\]!].*$/;
|
|
@@ -2137,7 +2321,7 @@ var _TypeScriptProject = class _TypeScriptProject {
|
|
|
2137
2321
|
return Files.empty(this.buildConfiguration.outDir);
|
|
2138
2322
|
}
|
|
2139
2323
|
async build() {
|
|
2140
|
-
Logger.header(`${tsLogo} tsbuild v${"1.
|
|
2324
|
+
Logger.header(`${tsLogo} tsbuild v${"1.8.0"}${this.configuration.compilerOptions.incremental && this.configuration.buildCache?.isValid() ? " [incremental]" : ""}`);
|
|
2141
2325
|
try {
|
|
2142
2326
|
const processes = [];
|
|
2143
2327
|
const filesWereEmitted = await this.typeCheck();
|
|
@@ -2220,7 +2404,12 @@ var _TypeScriptProject = class _TypeScriptProject {
|
|
|
2220
2404
|
}
|
|
2221
2405
|
}
|
|
2222
2406
|
if (this.buildConfiguration.plugins?.length) {
|
|
2223
|
-
plugins.push(...this.buildConfiguration.plugins);
|
|
2407
|
+
plugins.push(...await resolvePlugins(this.buildConfiguration.plugins, this.directory));
|
|
2408
|
+
}
|
|
2409
|
+
let iife;
|
|
2410
|
+
if (this.buildConfiguration.iife) {
|
|
2411
|
+
iife = iifePlugin(this.buildConfiguration.iife === true ? void 0 : this.buildConfiguration.iife);
|
|
2412
|
+
plugins.push(iife.plugin);
|
|
2224
2413
|
}
|
|
2225
2414
|
const define = {};
|
|
2226
2415
|
if (this.buildConfiguration.env !== void 0) {
|
|
@@ -2230,7 +2419,7 @@ var _TypeScriptProject = class _TypeScriptProject {
|
|
|
2230
2419
|
}
|
|
2231
2420
|
}
|
|
2232
2421
|
try {
|
|
2233
|
-
const { warnings, errors, metafile: { outputs } } = await
|
|
2422
|
+
const { warnings, errors, metafile: { outputs } } = await esbuild2({
|
|
2234
2423
|
format,
|
|
2235
2424
|
plugins,
|
|
2236
2425
|
define,
|
|
@@ -2282,6 +2471,9 @@ var _TypeScriptProject = class _TypeScriptProject {
|
|
|
2282
2471
|
for (const [outputPath, { bytes }] of Object.entries(outputs)) {
|
|
2283
2472
|
writtenFiles.push({ path: outputPath, size: bytes });
|
|
2284
2473
|
}
|
|
2474
|
+
if (iife) {
|
|
2475
|
+
writtenFiles.push(...iife.files);
|
|
2476
|
+
}
|
|
2285
2477
|
return writtenFiles;
|
|
2286
2478
|
} catch (error) {
|
|
2287
2479
|
Logger.error("Transpile failed", error);
|
package/dist/tsbuild.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
BuildError,
|
|
4
4
|
TypeScriptProject
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./YKY7BYLQ.js";
|
|
6
6
|
import "./JKGYA2AW.js";
|
|
7
7
|
|
|
8
8
|
// src/tsbuild.ts
|
|
@@ -30,7 +30,7 @@ if (help) {
|
|
|
30
30
|
process.exit(0);
|
|
31
31
|
}
|
|
32
32
|
if (version) {
|
|
33
|
-
console.log("1.
|
|
33
|
+
console.log("1.8.0");
|
|
34
34
|
process.exit(0);
|
|
35
35
|
}
|
|
36
36
|
var typeScriptOptions = {
|
|
@@ -104,6 +104,10 @@ type DtsOptions = {
|
|
|
104
104
|
resolve?: boolean;
|
|
105
105
|
};
|
|
106
106
|
type DtsConfiguration = MarkRequired<DtsOptions, 'resolve'>;
|
|
107
|
+
type IifeOptions = {
|
|
108
|
+
/** Global variable name for the IIFE bundle (e.g., 'MyLib' becomes `globalThis.MyLib`) */
|
|
109
|
+
globalName?: string;
|
|
110
|
+
};
|
|
107
111
|
type WatchOptions = PrettyModify<WatchrOptions, {
|
|
108
112
|
enabled: boolean;
|
|
109
113
|
recursive?: boolean;
|
|
@@ -156,9 +160,17 @@ type BuildOptions = {
|
|
|
156
160
|
watch?: WatchOptions;
|
|
157
161
|
/** Emit decorator metadata (requires `@swc/core` as optional dependency) */
|
|
158
162
|
decoratorMetadata?: boolean;
|
|
159
|
-
/**
|
|
160
|
-
|
|
163
|
+
/** Produce additional IIFE output alongside ESM. Set to `true` for default IIFE or provide options. */
|
|
164
|
+
iife?: boolean | IifeOptions;
|
|
165
|
+
/** Custom esbuild plugins (Plugin objects via programmatic API, or string/tuple references via config) */
|
|
166
|
+
plugins?: (Plugin | PluginReference)[];
|
|
161
167
|
};
|
|
168
|
+
/**
|
|
169
|
+
* A reference to an esbuild plugin resolved at build time.
|
|
170
|
+
* - `string` — bare npm specifier or relative path to a plugin module
|
|
171
|
+
* - `[string, Record<string, unknown>]` — module specifier with options passed to the factory function
|
|
172
|
+
*/
|
|
173
|
+
type PluginReference = string | [string, Record<string, unknown>];
|
|
162
174
|
type BuildConfiguration = PrettyModify<MarkRequired<BuildOptions, 'entryPoints' | 'splitting' | 'minify' | 'bundle' | 'noExternal' | 'sourceMap'>, {
|
|
163
175
|
watch: WatchConfiguration;
|
|
164
176
|
dts: DtsConfiguration;
|
|
@@ -362,4 +374,4 @@ declare class TypeScriptProject implements Closable {
|
|
|
362
374
|
}
|
|
363
375
|
|
|
364
376
|
export { TypeScriptProject };
|
|
365
|
-
export type { AbsolutePath, AsyncEntryPoints, Brand, BuildCache, BuildConfiguration, CachedDeclaration, Closable, ClosableConstructor, CompilerOptionOverrides, ConditionalPath, DetailedPerformanceEntry, DetailedPerformanceMeasureOptions, EntryPoints, EsTarget, Fn, FormatSupplier, InferredFunction, JsonString, JsxRenderingMode, LogEntryType, MethodFunction, OptionalReturn, Path, Pattern, PendingFileChange, PerformanceSubStep, ProjectBuildConfiguration, ProjectDependencies, ReadConfigResult, RelativePath, SourceMap, TypeScriptConfiguration, TypeScriptOptions, TypedFunction, WrittenFile };
|
|
377
|
+
export type { AbsolutePath, AsyncEntryPoints, Brand, BuildCache, BuildConfiguration, CachedDeclaration, Closable, ClosableConstructor, CompilerOptionOverrides, ConditionalPath, DetailedPerformanceEntry, DetailedPerformanceMeasureOptions, EntryPoints, EsTarget, Fn, FormatSupplier, IifeOptions, InferredFunction, JsonString, JsxRenderingMode, LogEntryType, MethodFunction, OptionalReturn, Path, Pattern, PendingFileChange, PerformanceSubStep, PluginReference, ProjectBuildConfiguration, ProjectDependencies, ReadConfigResult, RelativePath, SourceMap, TypeScriptConfiguration, TypeScriptOptions, TypedFunction, WrittenFile };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d1g1tal/tsbuild",
|
|
3
3
|
"author": "D1g1talEntr0py",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.8.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A fast, ESM-only TypeScript build tool combining the TypeScript API for type checking and declaration generation, esbuild for bundling, and SWC for decorator metadata.",
|
|
7
7
|
"homepage": "https://github.com/D1g1talEntr0py/tsbuild#readme",
|
|
@@ -44,24 +44,24 @@
|
|
|
44
44
|
"tsbuild": "./dist/tsbuild.js"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@d1g1tal/watchr": "^1.0.
|
|
47
|
+
"@d1g1tal/watchr": "^1.0.6",
|
|
48
48
|
"esbuild": "^0.28.0",
|
|
49
49
|
"magic-string": "^0.30.21"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@eslint/js": "^10.0.1",
|
|
53
53
|
"@types/node": "^25.5.2",
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "^8.58.
|
|
55
|
-
"@typescript-eslint/parser": "^8.58.
|
|
56
|
-
"@vitest/coverage-v8": "^4.1.
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "^8.58.1",
|
|
55
|
+
"@typescript-eslint/parser": "^8.58.1",
|
|
56
|
+
"@vitest/coverage-v8": "^4.1.4",
|
|
57
57
|
"eslint": "^10.2.0",
|
|
58
58
|
"eslint-plugin-jsdoc": "^62.9.0",
|
|
59
59
|
"fs-monkey": "^1.1.0",
|
|
60
60
|
"memfs": "^4.57.1",
|
|
61
61
|
"tsx": "^4.21.0",
|
|
62
62
|
"typescript": "^6.0.2",
|
|
63
|
-
"typescript-eslint": "^8.58.
|
|
64
|
-
"vitest": "^4.1.
|
|
63
|
+
"typescript-eslint": "^8.58.1",
|
|
64
|
+
"vitest": "^4.1.4"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"typescript": ">=5.6.3"
|
package/schema.json
CHANGED
|
@@ -193,6 +193,54 @@
|
|
|
193
193
|
}
|
|
194
194
|
},
|
|
195
195
|
"additionalProperties": false
|
|
196
|
+
},
|
|
197
|
+
"plugins": {
|
|
198
|
+
"type": "array",
|
|
199
|
+
"markdownDescription": "Custom esbuild plugins to include in the build. Each entry is either:\n- A **string** — npm package name or relative path to a plugin module (default export must be a factory function or Plugin object)\n- A **tuple** `[string, object]` — module specifier with options passed to the factory function\n\nExample:\n```json\n\"plugins\": [\n \"esbuild-plugin-copy\",\n [\"esbuild-plugin-alias\", { \"aliases\": { \"@\": \"./src\" } }]\n]\n```",
|
|
200
|
+
"items": {
|
|
201
|
+
"oneOf": [
|
|
202
|
+
{
|
|
203
|
+
"type": "string",
|
|
204
|
+
"description": "Plugin module specifier (npm package or relative path)"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"type": "array",
|
|
208
|
+
"description": "Plugin module specifier with options: [specifier, options]",
|
|
209
|
+
"items": false,
|
|
210
|
+
"prefixItems": [
|
|
211
|
+
{
|
|
212
|
+
"type": "string",
|
|
213
|
+
"description": "Plugin module specifier (npm package or relative path)"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"type": "object",
|
|
217
|
+
"description": "Options passed to the plugin factory function",
|
|
218
|
+
"additionalProperties": true
|
|
219
|
+
}
|
|
220
|
+
],
|
|
221
|
+
"minItems": 2,
|
|
222
|
+
"maxItems": 2
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"iife": {
|
|
228
|
+
"markdownDescription": "Produce additional IIFE (Immediately Invoked Function Expression) output alongside the primary ESM build.\n\nWhen enabled, each `.js` entry point is wrapped in an IIFE and written to an `iife/` subdirectory under the output directory.\n\nSet to `true` for default behavior, or provide an object with a `globalName` to assign exports to `globalThis`.\n\nExample:\n```json\n\"iife\": { \"globalName\": \"MyLib\" }\n```",
|
|
229
|
+
"oneOf": [
|
|
230
|
+
{
|
|
231
|
+
"type": "boolean"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"type": "object",
|
|
235
|
+
"properties": {
|
|
236
|
+
"globalName": {
|
|
237
|
+
"type": "string",
|
|
238
|
+
"description": "Global variable name for the IIFE bundle (e.g., 'MyLib' becomes globalThis.MyLib)"
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"additionalProperties": false
|
|
242
|
+
}
|
|
243
|
+
]
|
|
196
244
|
}
|
|
197
245
|
}
|
|
198
246
|
}
|