@absolutejs/absolute 0.19.0-beta.737 → 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
@@ -44822,6 +44822,61 @@ var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrit
44822
44822
  } catch {}
44823
44823
  }
44824
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
+ }));
44825
44880
  };
44826
44881
  var init_rewriteImports = __esm(() => {
44827
44882
  init_nativeRewrite();
@@ -49867,5 +49922,5 @@ export {
49867
49922
  build
49868
49923
  };
49869
49924
 
49870
- //# debugId=2B4EAF8662C4F46D64756E2164756E21
49925
+ //# debugId=8B5D6253F9DE513464756E2164756E21
49871
49926
  //# sourceMappingURL=build.js.map