@absolutejs/absolute 0.20.0-beta.178 → 0.20.0-beta.179

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.
@@ -1176,7 +1176,7 @@ import { basename, dirname as dirname2, extname as extname2, join as join3, rela
1176
1176
  var serverCacheRoot, compiledModuleCache, originalSourcePathCache, syncIslandGeneration, transpiler, ensureRelativeImportPath = (from, target) => {
1177
1177
  const importPath = relative2(dirname2(from), target).replace(/\\/g, "/");
1178
1178
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
1179
- }, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
1179
+ }, escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), replaceQuotedSpecifier = (code, spec, target) => code.replace(new RegExp(`(['"])${escapeRegExp(spec)}\\1`, "g"), (_match, quote) => `${quote}${target}${quote}`), processDirectoryEntries = (entries, dir, targetFileName, stack) => {
1180
1180
  for (const entry of entries) {
1181
1181
  const entryPath = join3(dir, entry.name);
1182
1182
  if (entry.isDirectory())
@@ -1221,18 +1221,21 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, syncIslandGen
1221
1221
  return null;
1222
1222
  }
1223
1223
  const basePath = resolve3(dirname2(from), spec);
1224
+ const extensions = [
1225
+ ".ts",
1226
+ ".tsx",
1227
+ ".mts",
1228
+ ".cts",
1229
+ ".js",
1230
+ ".jsx",
1231
+ ".mjs",
1232
+ ".cjs",
1233
+ ".json"
1234
+ ];
1224
1235
  const candidates = [
1225
1236
  basePath,
1226
- `${basePath}.ts`,
1227
- `${basePath}.js`,
1228
- `${basePath}.mjs`,
1229
- `${basePath}.cjs`,
1230
- `${basePath}.json`,
1231
- join3(basePath, "index.ts"),
1232
- join3(basePath, "index.js"),
1233
- join3(basePath, "index.mjs"),
1234
- join3(basePath, "index.cjs"),
1235
- join3(basePath, "index.json")
1237
+ ...extensions.map((extension) => `${basePath}${extension}`),
1238
+ ...extensions.map((extension) => join3(basePath, `index${extension}`))
1236
1239
  ];
1237
1240
  const existResults = await Promise.all(candidates.map((candidate) => Bun.file(candidate).exists()));
1238
1241
  const foundIndex = existResults.indexOf(true);
@@ -1317,7 +1320,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, syncIslandGen
1317
1320
  rewrittenModulePaths.set(spec, ensureRelativeImportPath(getCachedModulePath(sourcePath), resolvedModuleImport));
1318
1321
  }
1319
1322
  for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
1320
- transpiled = transpiled.replaceAll(spec, resolvedModuleImport);
1323
+ transpiled = replaceQuotedSpecifier(transpiled, spec, resolvedModuleImport);
1321
1324
  }
1322
1325
  let compiledCode = compile(transpiled, {
1323
1326
  css: "injected",
@@ -1329,10 +1332,10 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, syncIslandGen
1329
1332
  hmr: isDevelopmentRuntime()
1330
1333
  }).js.code;
1331
1334
  for (const [spec, compiledChildPath] of childModulePaths) {
1332
- compiledCode = compiledCode.replaceAll(spec, ensureRelativeImportPath(getCachedModulePath(sourcePath), compiledChildPath));
1335
+ compiledCode = replaceQuotedSpecifier(compiledCode, spec, ensureRelativeImportPath(getCachedModulePath(sourcePath), compiledChildPath));
1333
1336
  }
1334
1337
  for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
1335
- compiledCode = compiledCode.replaceAll(spec, resolvedModuleImport);
1338
+ compiledCode = replaceQuotedSpecifier(compiledCode, spec, resolvedModuleImport);
1336
1339
  }
1337
1340
  const sourceId = JSON.stringify(relative2(process.cwd(), resolutionSourcePath).replace(/\\/g, "/"));
1338
1341
  const componentName = /export default function ([\w$]+)\s*\(/.exec(compiledCode)?.[1];
@@ -4253,5 +4256,5 @@ export {
4253
4256
  svelteFileRoute
4254
4257
  };
4255
4258
 
4256
- //# debugId=4FFDB09A23C0E0D964756E2164756E21
4259
+ //# debugId=78AD174572FEF3CC64756E2164756E21
4257
4260
  //# sourceMappingURL=server.js.map