@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/index.js CHANGED
@@ -49368,35 +49368,43 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
49368
49368
  if (rewritten !== original)
49369
49369
  writeFileSync8(filePath, rewritten);
49370
49370
  }
49371
- }, collectUnvendoredImports = async (vendorDir, alreadyVendored) => {
49372
- const { readdirSync: readdirSync2, readFileSync: readFileSync15 } = await import("fs");
49371
+ }, collectTransitiveImports = async (specs, alreadyVendored) => {
49372
+ const { readFileSync: readFileSync15 } = await import("fs");
49373
49373
  const transpiler4 = new Bun.Transpiler({ loader: "js" });
49374
49374
  const newSpecs = new Set;
49375
- let entries;
49376
- try {
49377
- entries = readdirSync2(vendorDir).filter((f) => f.endsWith(".js"));
49378
- } catch {
49379
- return newSpecs;
49380
- }
49381
- for (const entry of entries) {
49375
+ for (const spec of specs) {
49376
+ let resolved;
49382
49377
  try {
49383
- const content = readFileSync15(join22(vendorDir, entry), "utf-8");
49384
- const imports = transpiler4.scanImports(content);
49385
- for (const imp of imports) {
49386
- const spec = imp.path;
49387
- if (!isBareSpecifier(spec))
49388
- continue;
49389
- if (isFrameworkSpecifier(spec))
49390
- continue;
49391
- if (isAbsolutePackageSpecifier(spec))
49392
- continue;
49393
- if (alreadyVendored.has(spec))
49394
- continue;
49395
- if (!isResolvable4(spec))
49396
- continue;
49397
- newSpecs.add(spec);
49398
- }
49399
- } catch {}
49378
+ resolved = Bun.resolveSync(spec, process.cwd());
49379
+ } catch {
49380
+ continue;
49381
+ }
49382
+ let content;
49383
+ try {
49384
+ content = readFileSync15(resolved, "utf-8");
49385
+ } catch {
49386
+ continue;
49387
+ }
49388
+ let imports;
49389
+ try {
49390
+ imports = transpiler4.scanImports(content);
49391
+ } catch {
49392
+ continue;
49393
+ }
49394
+ for (const imp of imports) {
49395
+ const child = imp.path;
49396
+ if (!isBareSpecifier(child))
49397
+ continue;
49398
+ if (isFrameworkSpecifier(child))
49399
+ continue;
49400
+ if (isAbsolutePackageSpecifier(child))
49401
+ continue;
49402
+ if (alreadyVendored.has(child))
49403
+ continue;
49404
+ if (!isResolvable4(child))
49405
+ continue;
49406
+ newSpecs.add(child);
49407
+ }
49400
49408
  }
49401
49409
  return newSpecs;
49402
49410
  }, buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
@@ -49427,19 +49435,19 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
49427
49435
  const tmpDir = join22(buildDir, "_dep_vendor_tmp");
49428
49436
  mkdirSync11(tmpDir, { recursive: true });
49429
49437
  const allSpecs = new Set(initialSpecs);
49430
- let success = true;
49438
+ let frontier = allSpecs;
49431
49439
  for (let pass = 0;pass < MAX_VENDOR_DISCOVERY_PASSES; pass++) {
49432
- const result = await buildDepVendorPass(Array.from(allSpecs), vendorDir, tmpDir);
49433
- if (!result.success) {
49434
- console.warn("\u26A0\uFE0F Dependency vendor build had errors:", result.logs);
49435
- success = false;
49436
- break;
49437
- }
49438
- const additional = await collectUnvendoredImports(vendorDir, allSpecs);
49440
+ const additional = await collectTransitiveImports(frontier, allSpecs);
49439
49441
  if (additional.size === 0)
49440
49442
  break;
49441
49443
  for (const spec of additional)
49442
49444
  allSpecs.add(spec);
49445
+ frontier = additional;
49446
+ }
49447
+ const result = await buildDepVendorPass(Array.from(allSpecs), vendorDir, tmpDir);
49448
+ const success = result.success;
49449
+ if (!success) {
49450
+ console.warn("\u26A0\uFE0F Dependency vendor build had errors:", result.logs);
49443
49451
  }
49444
49452
  await rm9(tmpDir, { force: true, recursive: true });
49445
49453
  if (success)
@@ -58205,5 +58213,5 @@ export {
58205
58213
  ANGULAR_INIT_TIMEOUT_MS
58206
58214
  };
58207
58215
 
58208
- //# debugId=39CB1BA32A09A31C64756E2164756E21
58216
+ //# debugId=C5600232735DC36764756E2164756E21
58209
58217
  //# sourceMappingURL=index.js.map