@d1g1tal/tsbuild 1.9.0 → 1.9.2
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 +69 -0
- package/dist/{XTZ3MYA7.js → 237SIAOE.js} +0 -53
- package/dist/{3ZUONNU3.js → HDWN4W6U.js} +2 -1
- package/dist/HQEQHKVJ.js +58 -0
- package/dist/WE3VBWJ5.js +54 -0
- package/dist/tsbuild.js +19 -19
- package/dist/type-script-project.d.ts +1 -87
- package/dist/type-script-project.js +3109 -3
- package/package.json +12 -12
- package/dist/S3D7UW6Z.js +0 -3166
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,72 @@
|
|
|
1
|
+
## [1.9.2](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.9.1...v1.9.2) (2026-06-18)
|
|
2
|
+
|
|
3
|
+
### Code Refactoring
|
|
4
|
+
|
|
5
|
+
* migrate class private fields to standard ES private names (de28ee0ab09d685b845dd6a45d179a7551afbe7a)
|
|
6
|
+
|
|
7
|
+
### Documentation
|
|
8
|
+
|
|
9
|
+
* update copilot instructions for step-loop cycle and terminal usage (e3288cd97ce5f5810c3b4b97c50332336746794b)
|
|
10
|
+
Adds guidelines for the development change-test loop cycle and enforces a rule to avoid prefixing commands in the terminal with redundant directory changes.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Miscellaneous Chores
|
|
14
|
+
|
|
15
|
+
* **benchmark:** simplify benchmark tool output directory configuration (4a2ed917460159c922e1cb0e0cf0e37966beeb8a)
|
|
16
|
+
Consolidates the benchmark task build destination directory to use a single unified path name for output files.
|
|
17
|
+
|
|
18
|
+
* **githooks:** make commit-msg hook executable (40e886425642873d96e2395474ac37d933f76336)
|
|
19
|
+
* upgrade dependencies and package manager version (cd5a295ac7e5efd5f18aa4d609d77265a86f211c)
|
|
20
|
+
Updates the pnpm package manager to 11.7.0 and bumps several development dependencies, including typescript-eslint, vitest, and eslint-plugin-jsdoc, to their latest patch versions.
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Continuous Integration
|
|
24
|
+
|
|
25
|
+
* **tests:** defer importing type-script-project.ts until it is needed (26856454610061a1adecad72fe9012c618963dc9)
|
|
26
|
+
* **tests:** fix failing compatibility checks (591c4bb6eafe1562a96932f4d00554d89993697d)
|
|
27
|
+
|
|
28
|
+
## [1.9.1](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.9.0...v1.9.1) (2026-06-14)
|
|
29
|
+
|
|
30
|
+
### Performance Improvements
|
|
31
|
+
|
|
32
|
+
* **loader:** improve loader caching key uniqueness and safety (319eb4f938458aa69ccdc71783a8116934769e6a)
|
|
33
|
+
- Add file inode and configuration status metrics to the transformation cache keys
|
|
34
|
+
- Migrate from async block writes to safe, synchronous filesystem writes
|
|
35
|
+
- Recover on-the-fly from zero-byte or corrupt cached module assets
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Code Refactoring
|
|
39
|
+
|
|
40
|
+
* **tsbuild:** remove test-only flush methods and standardize process exit (bebbc91a1516dff7560fd373358496d170f15e60)
|
|
41
|
+
- Avoid direct process.exit calls and handle exit state through process.exitCode
|
|
42
|
+
- Remove the flushBackgroundCleanup project hook, refactoring test suites to poll for output removal instead
|
|
43
|
+
- Simplify dependency path resolution by referencing internal promises directly
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Documentation
|
|
47
|
+
|
|
48
|
+
* refine project guidelines and update copilot instructions (3b7d6bed70d84968be88793897bfa5580931d098)
|
|
49
|
+
- Clean up githooks file permissions and mode headers
|
|
50
|
+
- Condense Copilot instructions into a unified, high-density reference snapshot
|
|
51
|
+
- Document target values and criteria for performance optimization checks
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Miscellaneous Chores
|
|
55
|
+
|
|
56
|
+
* **bench:** remove platform-specific details and introduce non-dts benchmarks (5887e241de3d4c22967030815f3ff548ac445276)
|
|
57
|
+
- Remove platform-specific MAXRSS memory measurements to ensure portable benchmark execution
|
|
58
|
+
- Introduce comparative benchmarks testing tsbuild with decoration emitting disabled
|
|
59
|
+
- Improve child process crash diagnostics and print cleaner terminal result layouts
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Build System
|
|
63
|
+
|
|
64
|
+
* **deps:** upgrade Node engine, package manager, and dependencies (a695f4e2e1a7af8b2036e8ed1f2c766cdcaeb21f)
|
|
65
|
+
- Raise Node.js requirement to >=22.6.0 and pnpm package manager to 11.6.0
|
|
66
|
+
- Upgrade esbuild production dependency to 0.28.1
|
|
67
|
+
- Update multiple devDependencies including ESLint, typescript-eslint, memory-fs, and Vitest
|
|
68
|
+
- Regenerate the lockfile to align with package version bumps
|
|
69
|
+
|
|
1
70
|
## [1.9.0](https://github.com/D1g1talEntr0py/tsbuild/compare/v1.8.10...v1.9.0) (2026-05-23)
|
|
2
71
|
|
|
3
72
|
### Features
|
|
@@ -1,52 +1,3 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for("Symbol." + name);
|
|
5
|
-
var __typeError = (msg) => {
|
|
6
|
-
throw TypeError(msg);
|
|
7
|
-
};
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
-
var __decoratorStart = (base) => [, , , __create(base?.[__knownSymbol("metadata")] ?? null)];
|
|
11
|
-
var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
12
|
-
var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
|
|
13
|
-
var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) });
|
|
14
|
-
var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
|
|
15
|
-
var __runInitializers = (array, flags, self, value) => {
|
|
16
|
-
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
17
|
-
return value;
|
|
18
|
-
};
|
|
19
|
-
var __decorateElement = (array, flags, name, decorators, target, extra) => {
|
|
20
|
-
var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
|
|
21
|
-
var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5];
|
|
22
|
-
var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
|
|
23
|
-
var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : { get [name]() {
|
|
24
|
-
return __privateGet(this, extra);
|
|
25
|
-
}, set [name](x) {
|
|
26
|
-
return __privateSet(this, extra, x);
|
|
27
|
-
} }, name));
|
|
28
|
-
k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
|
|
29
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
30
|
-
ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
|
|
31
|
-
if (k) {
|
|
32
|
-
ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => name in x };
|
|
33
|
-
if (k ^ 3) access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
|
|
34
|
-
if (k > 2) access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
|
|
35
|
-
}
|
|
36
|
-
it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1;
|
|
37
|
-
if (k ^ 4 || it === void 0) __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
|
|
38
|
-
else if (typeof it !== "object" || it === null) __typeError("Object expected");
|
|
39
|
-
else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
|
|
40
|
-
}
|
|
41
|
-
return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
|
|
42
|
-
};
|
|
43
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
44
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
45
|
-
var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj);
|
|
46
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
47
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
48
|
-
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
49
|
-
|
|
50
1
|
// src/constants.ts
|
|
51
2
|
import { JsxEmit, ScriptTarget } from "typescript";
|
|
52
3
|
var dataUnits = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
@@ -245,10 +196,6 @@ var Json = class {
|
|
|
245
196
|
};
|
|
246
197
|
|
|
247
198
|
export {
|
|
248
|
-
__decoratorStart,
|
|
249
|
-
__runInitializers,
|
|
250
|
-
__decorateElement,
|
|
251
|
-
__publicField,
|
|
252
199
|
dataUnits,
|
|
253
200
|
Platform,
|
|
254
201
|
BuildMessageType,
|
package/dist/HQEQHKVJ.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for("Symbol." + name);
|
|
5
|
+
var __typeError = (msg) => {
|
|
6
|
+
throw TypeError(msg);
|
|
7
|
+
};
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
+
var __decoratorStart = (base) => [, , , __create(base?.[__knownSymbol("metadata")] ?? null)];
|
|
11
|
+
var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
12
|
+
var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
|
|
13
|
+
var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) });
|
|
14
|
+
var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
|
|
15
|
+
var __runInitializers = (array, flags, self, value) => {
|
|
16
|
+
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
17
|
+
return value;
|
|
18
|
+
};
|
|
19
|
+
var __decorateElement = (array, flags, name, decorators, target, extra) => {
|
|
20
|
+
var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
|
|
21
|
+
var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5];
|
|
22
|
+
var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
|
|
23
|
+
var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : { get [name]() {
|
|
24
|
+
return __privateGet(this, extra);
|
|
25
|
+
}, set [name](x) {
|
|
26
|
+
return __privateSet(this, extra, x);
|
|
27
|
+
} }, name));
|
|
28
|
+
k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
|
|
29
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
30
|
+
ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
|
|
31
|
+
if (k) {
|
|
32
|
+
ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => name in x };
|
|
33
|
+
if (k ^ 3) access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
|
|
34
|
+
if (k > 2) access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
|
|
35
|
+
}
|
|
36
|
+
it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1;
|
|
37
|
+
if (k ^ 4 || it === void 0) __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
|
|
38
|
+
else if (typeof it !== "object" || it === null) __typeError("Object expected");
|
|
39
|
+
else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
|
|
40
|
+
}
|
|
41
|
+
return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
|
|
42
|
+
};
|
|
43
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
44
|
+
var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj);
|
|
45
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
46
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
47
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
48
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
__decoratorStart,
|
|
52
|
+
__runInitializers,
|
|
53
|
+
__decorateElement,
|
|
54
|
+
__privateGet,
|
|
55
|
+
__privateAdd,
|
|
56
|
+
__privateSet,
|
|
57
|
+
__privateMethod
|
|
58
|
+
};
|
package/dist/WE3VBWJ5.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// src/errors.ts
|
|
2
|
+
import { SyntaxKind } from "typescript";
|
|
3
|
+
var BuildError = class extends Error {
|
|
4
|
+
constructor(message, code = 1) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.code = code;
|
|
7
|
+
this.name = "BuildError";
|
|
8
|
+
Error.captureStackTrace(this, this.constructor);
|
|
9
|
+
}
|
|
10
|
+
code;
|
|
11
|
+
};
|
|
12
|
+
var TypeCheckError = class extends BuildError {
|
|
13
|
+
constructor(message, diagnostics) {
|
|
14
|
+
super(message, 1);
|
|
15
|
+
this.diagnostics = diagnostics;
|
|
16
|
+
this.name = "TypeCheckError";
|
|
17
|
+
}
|
|
18
|
+
diagnostics;
|
|
19
|
+
};
|
|
20
|
+
var BundleError = class extends BuildError {
|
|
21
|
+
constructor(message) {
|
|
22
|
+
super(message, 2);
|
|
23
|
+
this.name = "BundleError";
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var ConfigurationError = class extends BuildError {
|
|
27
|
+
constructor(message) {
|
|
28
|
+
super(message, 3);
|
|
29
|
+
this.name = "ConfigurationError";
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var UnsupportedSyntaxError = class extends BundleError {
|
|
33
|
+
constructor(node, message = "Syntax not yet supported") {
|
|
34
|
+
const syntaxKindName = SyntaxKind[node.kind] ?? `Unknown(${node.kind})`;
|
|
35
|
+
const nodeText = node.getText ? node.getText().slice(0, 100) : "<no text>";
|
|
36
|
+
super(`${message}: ${syntaxKindName} - "${nodeText}"`);
|
|
37
|
+
this.name = "UnsupportedSyntaxError";
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var castError = (exception) => {
|
|
41
|
+
if (exception instanceof Error) {
|
|
42
|
+
return exception;
|
|
43
|
+
}
|
|
44
|
+
return new Error(typeof exception === "string" ? exception : "Unknown error");
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
BuildError,
|
|
49
|
+
TypeCheckError,
|
|
50
|
+
BundleError,
|
|
51
|
+
ConfigurationError,
|
|
52
|
+
UnsupportedSyntaxError,
|
|
53
|
+
castError
|
|
54
|
+
};
|
package/dist/tsbuild.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
BuildError
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import "./XTZ3MYA7.js";
|
|
3
|
+
BuildError
|
|
4
|
+
} from "./WE3VBWJ5.js";
|
|
5
|
+
import "./HQEQHKVJ.js";
|
|
7
6
|
|
|
8
7
|
// src/tsbuild.ts
|
|
9
8
|
import { sys } from "typescript";
|
|
@@ -27,19 +26,20 @@ if (help) {
|
|
|
27
26
|
console.log(` ${`-${short}, --${long}`.padEnd(20)} ${description}`);
|
|
28
27
|
}
|
|
29
28
|
console.log();
|
|
30
|
-
process.
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} catch (error) {
|
|
44
|
-
|
|
29
|
+
process.exitCode = 0;
|
|
30
|
+
} else if (version) {
|
|
31
|
+
console.log("1.9.2");
|
|
32
|
+
process.exitCode = 0;
|
|
33
|
+
} else {
|
|
34
|
+
const typeScriptOptions = {
|
|
35
|
+
clearCache: args.clearCache,
|
|
36
|
+
compilerOptions: { noEmit: args.noEmit },
|
|
37
|
+
tsbuild: { force: args.force, minify: args.minify, watch: { enabled: args.watch } }
|
|
38
|
+
};
|
|
39
|
+
try {
|
|
40
|
+
const { TypeScriptProject } = await import("./type-script-project.js");
|
|
41
|
+
await new TypeScriptProject(args.project, typeScriptOptions).build();
|
|
42
|
+
} catch (error) {
|
|
43
|
+
process.exitCode = error instanceof BuildError ? error.code : 1;
|
|
44
|
+
}
|
|
45
45
|
}
|
|
@@ -276,18 +276,7 @@ type LogEntryType = 'info' | 'success' | 'done' | 'error' | 'warn';
|
|
|
276
276
|
|
|
277
277
|
/** Class representing a TypeScript project */
|
|
278
278
|
declare class TypeScriptProject implements Closable {
|
|
279
|
-
private
|
|
280
|
-
private builderProgram;
|
|
281
|
-
private readonly directory;
|
|
282
|
-
private readonly configuration;
|
|
283
|
-
private readonly fileManager;
|
|
284
|
-
private readonly buildConfiguration;
|
|
285
|
-
private readonly pendingChanges;
|
|
286
|
-
private readonly buildDependencies;
|
|
287
|
-
private pendingStaleOutputsCleanup?;
|
|
288
|
-
/** Identity of the Program that populated buildDependencies — skip re-walking when unchanged */
|
|
289
|
-
private buildDependenciesProgram;
|
|
290
|
-
private dependencyPaths?;
|
|
279
|
+
#private;
|
|
291
280
|
/**
|
|
292
281
|
* Creates a TypeScript project and prepares it for building/bundling.
|
|
293
282
|
* @param directory - Project root directory (defaults to current working directory)
|
|
@@ -299,88 +288,13 @@ declare class TypeScriptProject implements Closable {
|
|
|
299
288
|
* @returns A promise that resolves when the cleaning is complete.
|
|
300
289
|
*/
|
|
301
290
|
clean(): Promise<void>;
|
|
302
|
-
/**
|
|
303
|
-
* Removes outputs that the previous build wrote but the current build did not — e.g. renamed
|
|
304
|
-
* entry points or content-hashed chunks whose hash changed. Restricted to files under outDir
|
|
305
|
-
* for safety. Fire-and-forget: scheduled after build completion so it never inflates timings.
|
|
306
|
-
* @param previous - Project-relative paths recorded by the previous build (or undefined)
|
|
307
|
-
* @param current - Project-relative paths produced by the current build
|
|
308
|
-
*/
|
|
309
|
-
private cleanupStaleOutputs;
|
|
310
|
-
/**
|
|
311
|
-
* Waits for fire-and-forget stale-output cleanup to settle.
|
|
312
|
-
* Useful for deterministic tests that need to assert post-cleanup filesystem state.
|
|
313
|
-
*/
|
|
314
|
-
flushBackgroundCleanup(): Promise<void>;
|
|
315
291
|
/**
|
|
316
292
|
* Builds the project
|
|
317
293
|
* @returns A promise that resolves when the build is complete.
|
|
318
294
|
*/
|
|
319
295
|
build(): Promise<void>;
|
|
320
|
-
/**
|
|
321
|
-
* Type-checks the project and optionally emits declaration files.
|
|
322
|
-
* When declarations are enabled in compiler options, this method also handles
|
|
323
|
-
* initializing and finalizing the file manager for incremental builds.
|
|
324
|
-
*
|
|
325
|
-
* For incremental builds, TypeScript's emit writes a .tsbuildinfo file only when changes
|
|
326
|
-
* are detected. This is used to determine whether subsequent build phases should run.
|
|
327
|
-
*
|
|
328
|
-
* @returns True if files were emitted (or non-incremental build), false if no changes detected
|
|
329
|
-
*/
|
|
330
|
-
private typeCheck;
|
|
331
|
-
/**
|
|
332
|
-
* Transpiles the project using esbuild.
|
|
333
|
-
* @returns A promise that resolves to an array of written files after transpilation.
|
|
334
|
-
*/
|
|
335
|
-
private transpile;
|
|
336
|
-
/**
|
|
337
|
-
* Watches for changes in the project files and rebuilds the project when changes are detected.
|
|
338
|
-
*/
|
|
339
|
-
private watch;
|
|
340
296
|
/** Closes the project and cleans up resources. */
|
|
341
297
|
close(): void;
|
|
342
|
-
/**
|
|
343
|
-
* Processes declaration files.
|
|
344
|
-
* @returns A promise that resolves to an array of written files after processing declarations.
|
|
345
|
-
*/
|
|
346
|
-
private processDeclarations;
|
|
347
|
-
/**
|
|
348
|
-
* Triggers a rebuild after debouncing.
|
|
349
|
-
*/
|
|
350
|
-
private triggerRebuild;
|
|
351
|
-
/**
|
|
352
|
-
* Resolves configuration by merging options with tsconfig.json.
|
|
353
|
-
* @param directory - Project root directory
|
|
354
|
-
* @param typeScriptOptions - Partial TypeScript options to merge
|
|
355
|
-
* @returns Resolved configuration and TypeScript parser results
|
|
356
|
-
*/
|
|
357
|
-
private static resolveConfiguration;
|
|
358
|
-
/**
|
|
359
|
-
* Gets the entry points for the project.
|
|
360
|
-
* @param entryPoints - The entry points to get.
|
|
361
|
-
* @returns A promise that resolves to the entry points.
|
|
362
|
-
*/
|
|
363
|
-
private getEntryPoints;
|
|
364
|
-
/**
|
|
365
|
-
* Gets the project dependency paths.
|
|
366
|
-
* The promise is started in the constructor so it overlaps with TS Program creation.
|
|
367
|
-
* @returns A promise that resolves to an array of project dependency paths.
|
|
368
|
-
*/
|
|
369
|
-
private getProjectDependencyPaths;
|
|
370
|
-
/**
|
|
371
|
-
* Handles build errors by logging unexpected errors and setting appropriate exit codes.
|
|
372
|
-
* Expected build failures (TypeCheckError, BundleError) are already logged when they occur,
|
|
373
|
-
* so this method only logs unexpected errors to avoid duplicate output.
|
|
374
|
-
* @param error - The error to handle
|
|
375
|
-
*/
|
|
376
|
-
private handleBuildError;
|
|
377
|
-
/**
|
|
378
|
-
* Handles type errors in the project.
|
|
379
|
-
* @param message - The message to display.
|
|
380
|
-
* @param diagnostics - The diagnostics to handle.
|
|
381
|
-
* @param projectDirectory - The project directory.
|
|
382
|
-
*/
|
|
383
|
-
private static handleTypeErrors;
|
|
384
298
|
}
|
|
385
299
|
|
|
386
300
|
export { Plugin, TypeScriptProject };
|