@d1g1tal/tsbuild 1.1.1 → 1.1.3
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/dist/{YGGCSRAC.js → 6CSXJIEW.js} +27 -3
- package/dist/index.js +1 -1
- package/dist/tsbuild.js +2 -2
- package/package.json +3 -3
|
@@ -794,6 +794,8 @@ import {
|
|
|
794
794
|
isModuleDeclaration as isModuleDeclaration2,
|
|
795
795
|
isNamedExports as isNamedExports2,
|
|
796
796
|
isIdentifier as isIdentifier2,
|
|
797
|
+
isNamespaceImport,
|
|
798
|
+
isQualifiedName,
|
|
797
799
|
resolveModuleName,
|
|
798
800
|
isExportAssignment,
|
|
799
801
|
forEachChild as forEachChild2
|
|
@@ -1037,23 +1039,29 @@ var DeclarationBundler = class {
|
|
|
1037
1039
|
const sorted = [];
|
|
1038
1040
|
const visited = /* @__PURE__ */ new Set();
|
|
1039
1041
|
const visiting = /* @__PURE__ */ new Set();
|
|
1042
|
+
const visitStack = [];
|
|
1040
1043
|
const visit = (path) => {
|
|
1041
1044
|
if (visited.has(path)) {
|
|
1042
1045
|
return;
|
|
1043
1046
|
}
|
|
1044
1047
|
if (visiting.has(path)) {
|
|
1045
|
-
|
|
1048
|
+
const cyclePath = [...visitStack.slice(visitStack.indexOf(path)), path].map((p) => Paths.relative(this.options.currentDirectory, p)).join(" -> ");
|
|
1049
|
+
Logger.warn(`Circular dependency detected: ${cyclePath}`);
|
|
1046
1050
|
return;
|
|
1047
1051
|
}
|
|
1048
1052
|
visiting.add(path);
|
|
1053
|
+
visitStack.push(path);
|
|
1049
1054
|
const module = modules.get(path);
|
|
1050
1055
|
if (!module) {
|
|
1056
|
+
visiting.delete(path);
|
|
1057
|
+
visitStack.pop();
|
|
1051
1058
|
return;
|
|
1052
1059
|
}
|
|
1053
1060
|
for (const importPath of module.imports) {
|
|
1054
1061
|
visit(importPath);
|
|
1055
1062
|
}
|
|
1056
1063
|
visiting.delete(path);
|
|
1064
|
+
visitStack.pop();
|
|
1057
1065
|
visited.add(path);
|
|
1058
1066
|
sorted.push(module);
|
|
1059
1067
|
};
|
|
@@ -1140,11 +1148,14 @@ var DeclarationBundler = class {
|
|
|
1140
1148
|
moduleRenames.set(name, renamed);
|
|
1141
1149
|
}
|
|
1142
1150
|
}
|
|
1151
|
+
const bundledNamespaceAliases = /* @__PURE__ */ new Set();
|
|
1143
1152
|
for (const statement of sourceFile.statements) {
|
|
1144
1153
|
if (isImportDeclaration2(statement)) {
|
|
1145
1154
|
const moduleSpecifier = statement.moduleSpecifier.text;
|
|
1146
1155
|
if (this.isExternal(moduleSpecifier) || !bundledImportPaths.includes(moduleSpecifier)) {
|
|
1147
1156
|
externalImports.push(code.substring(statement.pos, statement.end).trim());
|
|
1157
|
+
} else if (statement.importClause?.namedBindings && isNamespaceImport(statement.importClause.namedBindings)) {
|
|
1158
|
+
bundledNamespaceAliases.add(statement.importClause.namedBindings.name.text);
|
|
1148
1159
|
}
|
|
1149
1160
|
magic.remove(statement.pos, statement.end);
|
|
1150
1161
|
} else if (isExportDeclaration2(statement)) {
|
|
@@ -1181,7 +1192,20 @@ var DeclarationBundler = class {
|
|
|
1181
1192
|
}
|
|
1182
1193
|
forEachChild2(node, visit);
|
|
1183
1194
|
};
|
|
1184
|
-
|
|
1195
|
+
for (const statement of sourceFile.statements) {
|
|
1196
|
+
if (!isImportDeclaration2(statement) && !isExportDeclaration2(statement) && !isExportAssignment(statement)) {
|
|
1197
|
+
visit(statement);
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
if (bundledNamespaceAliases.size > 0) {
|
|
1202
|
+
const visitQualified = (node) => {
|
|
1203
|
+
if (isQualifiedName(node) && isIdentifier2(node.left) && bundledNamespaceAliases.has(node.left.text)) {
|
|
1204
|
+
magic.remove(node.left.getStart(), node.right.getStart());
|
|
1205
|
+
}
|
|
1206
|
+
forEachChild2(node, visitQualified);
|
|
1207
|
+
};
|
|
1208
|
+
forEachChild2(sourceFile, visitQualified);
|
|
1185
1209
|
}
|
|
1186
1210
|
const finalValueExports = [...new Set(valueExports.map(exportsMapper))];
|
|
1187
1211
|
const valueExportsSet = new Set(finalValueExports);
|
|
@@ -1982,7 +2006,7 @@ var _TypeScriptProject = class _TypeScriptProject {
|
|
|
1982
2006
|
return Files.empty(this.buildConfiguration.outDir);
|
|
1983
2007
|
}
|
|
1984
2008
|
async build() {
|
|
1985
|
-
Logger.header(`\u{1F680} tsbuild v${"1.1.
|
|
2009
|
+
Logger.header(`\u{1F680} tsbuild v${"1.1.3"}${this.configuration.compilerOptions.incremental ? " [incremental]" : ""}`);
|
|
1986
2010
|
try {
|
|
1987
2011
|
const processes = [];
|
|
1988
2012
|
const filesWereEmitted = await this.typeCheck();
|
package/dist/index.js
CHANGED
package/dist/tsbuild.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
BuildError,
|
|
4
4
|
TypeScriptProject
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./6CSXJIEW.js";
|
|
6
6
|
import "./VMWNQL2J.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.1.
|
|
33
|
+
console.log("1.1.3");
|
|
34
34
|
process.exit(0);
|
|
35
35
|
}
|
|
36
36
|
var typeScriptOptions = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d1g1tal/tsbuild",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"packageManager": "pnpm@10.29.3",
|
|
5
5
|
"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.",
|
|
6
6
|
"type": "module",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
65
65
|
"@typescript-eslint/parser": "^8.56.1",
|
|
66
66
|
"@vitest/coverage-v8": "4.0.18",
|
|
67
|
-
"eslint": "^10.0.
|
|
68
|
-
"eslint-plugin-jsdoc": "^62.7.
|
|
67
|
+
"eslint": "^10.0.2",
|
|
68
|
+
"eslint-plugin-jsdoc": "^62.7.1",
|
|
69
69
|
"fs-monkey": "^1.1.0",
|
|
70
70
|
"memfs": "^4.56.10",
|
|
71
71
|
"tsx": "^4.21.0",
|