@absolutejs/absolute 0.19.0-beta.736 → 0.19.0-beta.738

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 CHANGED
@@ -44586,7 +44586,7 @@ var REQUIRED_ANGULAR_SPECIFIERS, SERVER_ONLY_ANGULAR_SPECIFIERS, SCAN_SKIP_DIRS,
44586
44586
  angular.add(spec);
44587
44587
  await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
44588
44588
  return Array.from(angular).filter(isResolvable2);
44589
- }, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false) => {
44589
+ }, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
44590
44590
  const vendorDir = join17(buildDir, "angular", "vendor");
44591
44591
  mkdirSync7(vendorDir, { recursive: true });
44592
44592
  const tmpDir = join17(buildDir, "_angular_vendor_tmp");
@@ -44600,6 +44600,7 @@ var REQUIRED_ANGULAR_SPECIFIERS, SERVER_ONLY_ANGULAR_SPECIFIERS, SCAN_SKIP_DIRS,
44600
44600
  }));
44601
44601
  const result = await bunBuild4({
44602
44602
  entrypoints,
44603
+ external: depVendorSpecifiers,
44603
44604
  format: "esm",
44604
44605
  minify: false,
44605
44606
  naming: "[name].[ext]",
@@ -44821,6 +44822,61 @@ var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrit
44821
44822
  } catch {}
44822
44823
  }
44823
44824
  await rewriteImports(allFiles, vendorPaths);
44825
+ await fixMissingReExportNamespaces(allFiles);
44826
+ }, fixMissingReExportNamespaces = async (files) => {
44827
+ const REEXPORT_PATTERN = /__reExport\(\s*[A-Za-z_$][\w$]*\s*,\s*([A-Za-z_$][\w$]*)\s*\)/g;
44828
+ await Promise.all(files.map(async (filePath) => {
44829
+ const content = await Bun.file(filePath).text();
44830
+ REEXPORT_PATTERN.lastIndex = 0;
44831
+ const missing = [];
44832
+ let match;
44833
+ while ((match = REEXPORT_PATTERN.exec(content)) !== null) {
44834
+ const ident = match[1];
44835
+ if (!ident)
44836
+ continue;
44837
+ const nsImportRe = new RegExp(`\\bimport\\s*\\*\\s*as\\s+${ident}\\s+from\\b`);
44838
+ if (nsImportRe.test(content))
44839
+ continue;
44840
+ const declRe = new RegExp(`\\b(?:const|let|var|function|class)\\s+${ident}\\b`);
44841
+ if (declRe.test(content))
44842
+ continue;
44843
+ const namedImportRe = new RegExp(`\\bimport\\s*\\{[^}]*\\b${ident}\\b[^}]*\\}\\s*from\\b`);
44844
+ if (namedImportRe.test(content))
44845
+ continue;
44846
+ const importPathRe = /from\s+["']([^"']+)["']/g;
44847
+ let pathMatch;
44848
+ let sourcePath;
44849
+ while ((pathMatch = importPathRe.exec(content)) !== null) {
44850
+ const p = pathMatch[1];
44851
+ if (!p)
44852
+ continue;
44853
+ const base = p.split("/").pop()?.replace(/\.[mc]?js$/, "");
44854
+ if (!base)
44855
+ continue;
44856
+ if (base === ident || base.endsWith(`_${ident}`)) {
44857
+ sourcePath = p;
44858
+ break;
44859
+ }
44860
+ }
44861
+ if (sourcePath) {
44862
+ missing.push({ ident, path: sourcePath });
44863
+ }
44864
+ }
44865
+ if (missing.length === 0)
44866
+ return;
44867
+ const seen = new Set;
44868
+ const unique = missing.filter((entry) => {
44869
+ if (seen.has(entry.ident))
44870
+ return false;
44871
+ seen.add(entry.ident);
44872
+ return true;
44873
+ });
44874
+ const inserts = unique.map((entry) => `import * as ${entry.ident} from "${entry.path}";`).join(`
44875
+ `);
44876
+ const patched = `${inserts}
44877
+ ${content}`;
44878
+ await Bun.write(filePath, patched);
44879
+ }));
44824
44880
  };
44825
44881
  var init_rewriteImports = __esm(() => {
44826
44882
  init_nativeRewrite();
@@ -49767,7 +49823,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
49767
49823
  const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
49768
49824
  const [, angularSpecs, , , depPaths] = await Promise.all([
49769
49825
  config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
49770
- config.angularDirectory ? buildAngularVendor(state.resolvedPaths.buildDir, sourceDirs, true) : Promise.resolve(undefined),
49826
+ config.angularDirectory ? buildAngularVendor(state.resolvedPaths.buildDir, sourceDirs, true, Object.keys(globalThis.__depVendorPaths ?? {})) : Promise.resolve(undefined),
49771
49827
  config.svelteDirectory ? buildSvelteVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
49772
49828
  config.vueDirectory ? buildVueVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
49773
49829
  buildDepVendor2(state.resolvedPaths.buildDir, sourceDirs)
@@ -49866,5 +49922,5 @@ export {
49866
49922
  build
49867
49923
  };
49868
49924
 
49869
- //# debugId=762BA503FA6E78FB64756E2164756E21
49925
+ //# debugId=8B5D6253F9DE513464756E2164756E21
49870
49926
  //# sourceMappingURL=build.js.map