@absolutejs/absolute 0.19.0-beta.24 → 0.19.0-beta.26

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
@@ -202161,20 +202161,13 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, TRANSPILABLE, REACT_EXTENSIONS, escape
202161
202161
  return { dynamicRegex, fromRegex, lookup, sideEffectRegex };
202162
202162
  }, rewriteImports2 = (code, filePath, projectRoot, rewriter) => {
202163
202163
  let result = code;
202164
- if (rewriter) {
202165
- const replacer = (_match, prefix, specifier, suffix) => {
202166
- const webPath = rewriter.lookup.get(specifier);
202167
- if (!webPath)
202168
- return _match;
202164
+ const bareSpecifierRe = /((?:from|import)\s*["'])([^"'./][^"']*)(["'])/g;
202165
+ result = result.replace(bareSpecifierRe, (_match, prefix, specifier, suffix) => {
202166
+ const webPath = rewriter?.lookup.get(specifier);
202167
+ if (webPath)
202169
202168
  return `${prefix}${webPath}${suffix}`;
202170
- };
202171
- rewriter.fromRegex.lastIndex = 0;
202172
- rewriter.sideEffectRegex.lastIndex = 0;
202173
- rewriter.dynamicRegex.lastIndex = 0;
202174
- result = result.replace(rewriter.fromRegex, replacer);
202175
- result = result.replace(rewriter.sideEffectRegex, replacer);
202176
- result = result.replace(rewriter.dynamicRegex, replacer);
202177
- }
202169
+ return `${prefix}/@stub/${encodeURIComponent(specifier)}${suffix}`;
202170
+ });
202178
202171
  const fileDir = dirname7(filePath);
202179
202172
  result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => {
202180
202173
  const absPath = resolve17(fileDir, relPath);
@@ -202282,6 +202275,14 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, TRANSPILABLE, REACT_EXTENSIONS, escape
202282
202275
  const { projectRoot, vendorPaths } = config;
202283
202276
  const rewriter = buildImportRewriter(vendorPaths);
202284
202277
  return (pathname) => {
202278
+ if (pathname.startsWith("/@stub/")) {
202279
+ return new Response("export default {}; export {};", {
202280
+ headers: {
202281
+ "Cache-Control": "no-cache",
202282
+ "Content-Type": "application/javascript"
202283
+ }
202284
+ });
202285
+ }
202285
202286
  if (!pathname.startsWith(SRC_PREFIX))
202286
202287
  return;
202287
202288
  const relPath = pathname.slice(SRC_PREFIX.length);
@@ -203778,34 +203779,8 @@ var toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
203778
203779
  } catch {}
203779
203780
  }
203780
203781
  return Array.from(specifiers).filter(isResolvable2);
203781
- }, generateEntrySource2 = async (specifier) => {
203782
- try {
203783
- const mod = await import(specifier);
203784
- const exportNames = Object.keys(mod).filter((key) => key !== "default" && key !== "__esModule");
203785
- const lines = [];
203786
- if (exportNames.length > 0) {
203787
- lines.push(`export { ${exportNames.join(", ")} } from '${specifier}';`);
203788
- }
203789
- try {
203790
- const resolved = __require.resolve(specifier);
203791
- const source = await Bun.file(resolved).text();
203792
- const hasExportDefault = /export\s+default\b/.test(source) || /module\.exports\s*=/.test(source);
203793
- if (hasExportDefault) {
203794
- lines.push(`export { default } from '${specifier}';`);
203795
- }
203796
- } catch {}
203797
- if (lines.length === 0) {
203798
- return `export * from '${specifier}';
203799
- `;
203800
- }
203801
- return lines.join(`
203802
- `) + `
203803
- `;
203804
- } catch {
203805
- return `export * from '${specifier}';
203806
- `;
203807
- }
203808
- }, computeDepVendorPaths = async (directories) => {
203782
+ }, generateEntrySource2 = (specifier) => `export * from '${specifier}';
203783
+ `, computeDepVendorPaths = async (directories) => {
203809
203784
  const specifiers = await scanBareImports(directories);
203810
203785
  const paths = {};
203811
203786
  for (const specifier of specifiers) {
@@ -204484,5 +204459,5 @@ export {
204484
204459
  ANGULAR_INIT_TIMEOUT_MS
204485
204460
  };
204486
204461
 
204487
- //# debugId=1CE0503FCC7A083F64756E2164756E21
204462
+ //# debugId=5EE265A4D3D1840D64756E2164756E21
204488
204463
  //# sourceMappingURL=index.js.map