@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/index.js CHANGED
@@ -45014,6 +45014,61 @@ var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrit
45014
45014
  } catch {}
45015
45015
  }
45016
45016
  await rewriteImports(allFiles, vendorPaths);
45017
+ await fixMissingReExportNamespaces(allFiles);
45018
+ }, fixMissingReExportNamespaces = async (files) => {
45019
+ const REEXPORT_PATTERN = /__reExport\(\s*[A-Za-z_$][\w$]*\s*,\s*([A-Za-z_$][\w$]*)\s*\)/g;
45020
+ await Promise.all(files.map(async (filePath) => {
45021
+ const content = await Bun.file(filePath).text();
45022
+ REEXPORT_PATTERN.lastIndex = 0;
45023
+ const missing = [];
45024
+ let match;
45025
+ while ((match = REEXPORT_PATTERN.exec(content)) !== null) {
45026
+ const ident = match[1];
45027
+ if (!ident)
45028
+ continue;
45029
+ const nsImportRe = new RegExp(`\\bimport\\s*\\*\\s*as\\s+${ident}\\s+from\\b`);
45030
+ if (nsImportRe.test(content))
45031
+ continue;
45032
+ const declRe = new RegExp(`\\b(?:const|let|var|function|class)\\s+${ident}\\b`);
45033
+ if (declRe.test(content))
45034
+ continue;
45035
+ const namedImportRe = new RegExp(`\\bimport\\s*\\{[^}]*\\b${ident}\\b[^}]*\\}\\s*from\\b`);
45036
+ if (namedImportRe.test(content))
45037
+ continue;
45038
+ const importPathRe = /from\s+["']([^"']+)["']/g;
45039
+ let pathMatch;
45040
+ let sourcePath;
45041
+ while ((pathMatch = importPathRe.exec(content)) !== null) {
45042
+ const p = pathMatch[1];
45043
+ if (!p)
45044
+ continue;
45045
+ const base = p.split("/").pop()?.replace(/\.[mc]?js$/, "");
45046
+ if (!base)
45047
+ continue;
45048
+ if (base === ident || base.endsWith(`_${ident}`)) {
45049
+ sourcePath = p;
45050
+ break;
45051
+ }
45052
+ }
45053
+ if (sourcePath) {
45054
+ missing.push({ ident, path: sourcePath });
45055
+ }
45056
+ }
45057
+ if (missing.length === 0)
45058
+ return;
45059
+ const seen = new Set;
45060
+ const unique = missing.filter((entry) => {
45061
+ if (seen.has(entry.ident))
45062
+ return false;
45063
+ seen.add(entry.ident);
45064
+ return true;
45065
+ });
45066
+ const inserts = unique.map((entry) => `import * as ${entry.ident} from "${entry.path}";`).join(`
45067
+ `);
45068
+ const patched = `${inserts}
45069
+ ${content}`;
45070
+ await Bun.write(filePath, patched);
45071
+ }));
45017
45072
  };
45018
45073
  var init_rewriteImports = __esm(() => {
45019
45074
  init_nativeRewrite();
@@ -58327,5 +58382,5 @@ export {
58327
58382
  ANGULAR_INIT_TIMEOUT_MS
58328
58383
  };
58329
58384
 
58330
- //# debugId=48AA30BC1C62695364756E2164756E21
58385
+ //# debugId=69FC64DF6241AA5664756E2164756E21
58331
58386
  //# sourceMappingURL=index.js.map