@absolutejs/absolute 0.19.0-beta.714 → 0.19.0-beta.715
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/build.js +43 -35
- package/dist/build.js.map +3 -3
- package/dist/index.js +43 -35
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -49291,35 +49291,43 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
49291
49291
|
if (rewritten !== original)
|
|
49292
49292
|
writeFileSync8(filePath, rewritten);
|
|
49293
49293
|
}
|
|
49294
|
-
},
|
|
49295
|
-
const {
|
|
49294
|
+
}, collectTransitiveImports = async (specs, alreadyVendored) => {
|
|
49295
|
+
const { readFileSync: readFileSync15 } = await import("fs");
|
|
49296
49296
|
const transpiler4 = new Bun.Transpiler({ loader: "js" });
|
|
49297
49297
|
const newSpecs = new Set;
|
|
49298
|
-
|
|
49299
|
-
|
|
49300
|
-
entries = readdirSync2(vendorDir).filter((f) => f.endsWith(".js"));
|
|
49301
|
-
} catch {
|
|
49302
|
-
return newSpecs;
|
|
49303
|
-
}
|
|
49304
|
-
for (const entry of entries) {
|
|
49298
|
+
for (const spec of specs) {
|
|
49299
|
+
let resolved;
|
|
49305
49300
|
try {
|
|
49306
|
-
|
|
49307
|
-
|
|
49308
|
-
|
|
49309
|
-
|
|
49310
|
-
|
|
49311
|
-
|
|
49312
|
-
|
|
49313
|
-
|
|
49314
|
-
|
|
49315
|
-
|
|
49316
|
-
|
|
49317
|
-
|
|
49318
|
-
|
|
49319
|
-
|
|
49320
|
-
|
|
49321
|
-
|
|
49322
|
-
|
|
49301
|
+
resolved = Bun.resolveSync(spec, process.cwd());
|
|
49302
|
+
} catch {
|
|
49303
|
+
continue;
|
|
49304
|
+
}
|
|
49305
|
+
let content;
|
|
49306
|
+
try {
|
|
49307
|
+
content = readFileSync15(resolved, "utf-8");
|
|
49308
|
+
} catch {
|
|
49309
|
+
continue;
|
|
49310
|
+
}
|
|
49311
|
+
let imports;
|
|
49312
|
+
try {
|
|
49313
|
+
imports = transpiler4.scanImports(content);
|
|
49314
|
+
} catch {
|
|
49315
|
+
continue;
|
|
49316
|
+
}
|
|
49317
|
+
for (const imp of imports) {
|
|
49318
|
+
const child = imp.path;
|
|
49319
|
+
if (!isBareSpecifier(child))
|
|
49320
|
+
continue;
|
|
49321
|
+
if (isFrameworkSpecifier(child))
|
|
49322
|
+
continue;
|
|
49323
|
+
if (isAbsolutePackageSpecifier(child))
|
|
49324
|
+
continue;
|
|
49325
|
+
if (alreadyVendored.has(child))
|
|
49326
|
+
continue;
|
|
49327
|
+
if (!isResolvable4(child))
|
|
49328
|
+
continue;
|
|
49329
|
+
newSpecs.add(child);
|
|
49330
|
+
}
|
|
49323
49331
|
}
|
|
49324
49332
|
return newSpecs;
|
|
49325
49333
|
}, buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
@@ -49350,19 +49358,19 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
49350
49358
|
const tmpDir = join22(buildDir, "_dep_vendor_tmp");
|
|
49351
49359
|
mkdirSync11(tmpDir, { recursive: true });
|
|
49352
49360
|
const allSpecs = new Set(initialSpecs);
|
|
49353
|
-
let
|
|
49361
|
+
let frontier = allSpecs;
|
|
49354
49362
|
for (let pass = 0;pass < MAX_VENDOR_DISCOVERY_PASSES; pass++) {
|
|
49355
|
-
const
|
|
49356
|
-
if (!result.success) {
|
|
49357
|
-
console.warn("\u26A0\uFE0F Dependency vendor build had errors:", result.logs);
|
|
49358
|
-
success = false;
|
|
49359
|
-
break;
|
|
49360
|
-
}
|
|
49361
|
-
const additional = await collectUnvendoredImports(vendorDir, allSpecs);
|
|
49363
|
+
const additional = await collectTransitiveImports(frontier, allSpecs);
|
|
49362
49364
|
if (additional.size === 0)
|
|
49363
49365
|
break;
|
|
49364
49366
|
for (const spec of additional)
|
|
49365
49367
|
allSpecs.add(spec);
|
|
49368
|
+
frontier = additional;
|
|
49369
|
+
}
|
|
49370
|
+
const result = await buildDepVendorPass(Array.from(allSpecs), vendorDir, tmpDir);
|
|
49371
|
+
const success = result.success;
|
|
49372
|
+
if (!success) {
|
|
49373
|
+
console.warn("\u26A0\uFE0F Dependency vendor build had errors:", result.logs);
|
|
49366
49374
|
}
|
|
49367
49375
|
await rm9(tmpDir, { force: true, recursive: true });
|
|
49368
49376
|
if (success)
|
|
@@ -49745,5 +49753,5 @@ export {
|
|
|
49745
49753
|
build
|
|
49746
49754
|
};
|
|
49747
49755
|
|
|
49748
|
-
//# debugId=
|
|
49756
|
+
//# debugId=3B3195FA2C1847A964756E2164756E21
|
|
49749
49757
|
//# sourceMappingURL=build.js.map
|