@@ -369,3 +369,14 @@ import { builtinModules } from "node:module"; | ||
| } | ||
| const writtenFiles = await Promise.all(promises); | ||
| const results = await Promise.allSettled(promises); | ||
| const errors = results.filter((result) => result.status === "rejected").map((result) => result.reason); | ||
| if (errors.length > 0) { | ||
| let isolatedErrors = []; | ||
| let otherErrors = []; | ||
| for (const error of errors.flatMap((err) => Array.isArray(err.cause) ? err.cause : [err])) if (error.message?.includes("--isolatedDeclarations")) isolatedErrors.push(error); | ||
| else otherErrors.push(error); | ||
| for (const error of otherErrors) consola.error(error); | ||
| for (const error of isolatedErrors) consola.warn(error); | ||
| if (otherErrors.length > 0) throw new Error(`Errors while transforming ${entry.input}`); | ||
| } | ||
| const writtenFiles = results.filter((result) => result.status === "fulfilled").map((result) => result.value); | ||
| consola.log(`\n${colors.magenta("[transform] ")}${colors.underline(fmtPath(entry.outDir) + "/")}${entry.stub ? colors.dim(" (stub)") : ""}\n${colors.dim(itemsTable(writtenFiles.map((f) => fmtPath(f))))}`); | ||
@@ -431,2 +442,4 @@ } | ||
| sourceText = magicString.toString(); | ||
| let emitDeclaration = entry.dts ?? true; | ||
| if (typeof emitDeclaration === "function") emitDeclaration = await emitDeclaration(entryPath); | ||
| const transformed = transformSync(entryPath, sourceText, { | ||
@@ -437,3 +450,3 @@ ...entry.oxc, | ||
| typescript: { | ||
| declaration: { stripInternal: true }, | ||
| declaration: emitDeclaration ? { stripInternal: true } : void 0, | ||
| ...entry.oxc?.typescript | ||
@@ -445,3 +458,3 @@ } | ||
| if (transformed.errors.length === 1) throw transformed.errors[0]; | ||
| throw new Error(`Errors while transforming ${entryPath}: (hint: check build-dump.ts)`, { cause: transformed.errors }); | ||
| throw new Error(`Errors while transforming ${entryPath}`, { cause: transformed.errors }); | ||
| } | ||
@@ -448,0 +461,0 @@ if (entry.minify) { |
@@ -84,2 +84,6 @@ import { InputOptions, MinifyOptions, OutputOptions, RolldownBuild, RolldownPluginOption } from "rolldown"; | ||
| filter?: (filePath: string) => boolean | Promise<boolean>; | ||
| /** | ||
| * If sets to `false`, or if the function returns `false`, declaration files won't be emitted for the module. | ||
| */ | ||
| dts?: boolean | ((filePath: string) => boolean | Promise<boolean>); | ||
| }; | ||
@@ -86,0 +90,0 @@ type BuildEntry = BundleEntry | TransformEntry; |
+1
-1
| { | ||
| "name": "obuild", | ||
| "version": "0.4.30", | ||
| "version": "0.4.31", | ||
| "description": "Zero-config ESM/TS package builder", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
32178
3.34%577
2.3%