@d1g1tal/tsbuild 1.2.0 → 1.2.1
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.
|
@@ -154,19 +154,35 @@ var Paths = class {
|
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
156
156
|
* Checks if the given path is a directory.
|
|
157
|
+
* Returns false if the path does not exist.
|
|
157
158
|
* @param path - The path to check
|
|
158
159
|
* @returns True if the path is a directory, false otherwise
|
|
159
160
|
*/
|
|
160
161
|
static async isDirectory(path) {
|
|
161
|
-
|
|
162
|
+
try {
|
|
163
|
+
return (await lstat(path)).isDirectory();
|
|
164
|
+
} catch (error) {
|
|
165
|
+
if (error.code === "ENOENT") {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
throw error;
|
|
169
|
+
}
|
|
162
170
|
}
|
|
163
171
|
/**
|
|
164
172
|
* Checks if the given path is a file.
|
|
173
|
+
* Returns false if the path does not exist.
|
|
165
174
|
* @param path - The path to check
|
|
166
175
|
* @returns True if the path is a file, false otherwise
|
|
167
176
|
*/
|
|
168
177
|
static async isFile(path) {
|
|
169
|
-
|
|
178
|
+
try {
|
|
179
|
+
return (await lstat(path)).isFile();
|
|
180
|
+
} catch (error) {
|
|
181
|
+
if (error.code === "ENOENT") {
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
throw error;
|
|
185
|
+
}
|
|
170
186
|
}
|
|
171
187
|
/**
|
|
172
188
|
* Checks if a module specifier represents a local path (not a bare specifier).
|
package/dist/tsbuild.js
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
toEsTarget,
|
|
30
30
|
toJsxRenderingMode,
|
|
31
31
|
typeMatcher
|
|
32
|
-
} from "./
|
|
32
|
+
} from "./7FPDHUPW.js";
|
|
33
33
|
|
|
34
34
|
// src/files.ts
|
|
35
35
|
import { dirname } from "node:path";
|
|
@@ -1997,7 +1997,10 @@ var _TypeScriptProject = class _TypeScriptProject {
|
|
|
1997
1997
|
}
|
|
1998
1998
|
this.fileManager = new FileManager(buildCache);
|
|
1999
1999
|
this.builderProgram = createIncrementalProgram({ rootNames, options: this.configuration.compilerOptions, projectReferences, configFileParsingDiagnostics });
|
|
2000
|
-
|
|
2000
|
+
const entryPointsPromise = this.getEntryPoints(entryPoints);
|
|
2001
|
+
entryPointsPromise.catch(() => {
|
|
2002
|
+
});
|
|
2003
|
+
this.buildConfiguration = { entryPoints: entryPointsPromise, target: toEsTarget(target), outDir, ...tsbuildOptions };
|
|
2001
2004
|
}
|
|
2002
2005
|
/**
|
|
2003
2006
|
* Cleans the output directory
|
|
@@ -2007,7 +2010,7 @@ var _TypeScriptProject = class _TypeScriptProject {
|
|
|
2007
2010
|
return Files.empty(this.buildConfiguration.outDir);
|
|
2008
2011
|
}
|
|
2009
2012
|
async build() {
|
|
2010
|
-
Logger.header(`\u{1F680} tsbuild v${"1.2.
|
|
2013
|
+
Logger.header(`\u{1F680} tsbuild v${"1.2.1"}${this.configuration.compilerOptions.incremental ? " [incremental]" : ""}`);
|
|
2011
2014
|
try {
|
|
2012
2015
|
const processes = [];
|
|
2013
2016
|
const filesWereEmitted = await this.typeCheck();
|
|
@@ -2058,7 +2061,7 @@ var _TypeScriptProject = class _TypeScriptProject {
|
|
|
2058
2061
|
}
|
|
2059
2062
|
if (this.configuration.compilerOptions.emitDecoratorMetadata) {
|
|
2060
2063
|
try {
|
|
2061
|
-
const { swcDecoratorMetadataPlugin } = await import("./
|
|
2064
|
+
const { swcDecoratorMetadataPlugin } = await import("./DSHNVGWV.js");
|
|
2062
2065
|
plugins.push(swcDecoratorMetadataPlugin);
|
|
2063
2066
|
} catch {
|
|
2064
2067
|
throw new ConfigurationError("emitDecoratorMetadata is enabled but @swc/core is not installed. Install it with: pnpm add -D @swc/core");
|
|
@@ -2294,8 +2297,10 @@ var _TypeScriptProject = class _TypeScriptProject {
|
|
|
2294
2297
|
expandedEntryPoints[Paths.parse(file).name] = filePath;
|
|
2295
2298
|
}
|
|
2296
2299
|
}
|
|
2297
|
-
} else {
|
|
2300
|
+
} else if (await Paths.isFile(resolvedPath)) {
|
|
2298
2301
|
expandedEntryPoints[name] = resolvedPath;
|
|
2302
|
+
} else {
|
|
2303
|
+
throw new ConfigurationError(`Entry point does not exist: ${entryPoint}`);
|
|
2299
2304
|
}
|
|
2300
2305
|
}
|
|
2301
2306
|
return expandedEntryPoints;
|
|
@@ -2307,8 +2312,7 @@ var _TypeScriptProject = class _TypeScriptProject {
|
|
|
2307
2312
|
*/
|
|
2308
2313
|
getProjectDependencyPaths() {
|
|
2309
2314
|
return this.dependencyPaths ??= Files.read(Paths.absolute(this.directory, "package.json")).then((content) => {
|
|
2310
|
-
const
|
|
2311
|
-
const { dependencies = {}, peerDependencies = {} } = packageJson;
|
|
2315
|
+
const { dependencies = {}, peerDependencies = {} } = Json.parse(content);
|
|
2312
2316
|
return [.../* @__PURE__ */ new Set([...Object.keys(dependencies), ...Object.keys(peerDependencies)])];
|
|
2313
2317
|
});
|
|
2314
2318
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d1g1tal/tsbuild",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
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",
|