@absolutejs/absolute 0.19.0-beta.100 → 0.19.0-beta.102

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.
@@ -34,9 +34,15 @@ export const handleReactUpdate = (message: {
34
34
  const serverDuration = message.data.serverDuration;
35
35
  const pageModuleUrl = message.data.pageModuleUrl;
36
36
 
37
- // If the root accept handler is active (index file re-renders
38
- // the root), skip the Fast Refresh import root.render() handles it.
39
- if ((window as unknown as Record<string, unknown>).__HMR_ROOT_ACCEPT__) {
37
+ // For non-component files (.ts data), the root accept handler
38
+ // re-imports the page and calls root.render(). Skip Fast Refresh.
39
+ // For component files (.tsx/.jsx), use Fast Refresh directly.
40
+ const src = message.data.primarySource ?? '';
41
+ const isComponent = src.endsWith('.tsx') || src.endsWith('.jsx');
42
+ if (
43
+ !isComponent &&
44
+ (window as unknown as Record<string, unknown>).__HMR_ROOT_ACCEPT__
45
+ ) {
40
46
  return;
41
47
  }
42
48
 
package/dist/index.js CHANGED
@@ -202,7 +202,7 @@ __export(exports_generateReactIndexes, {
202
202
  });
203
203
  import { existsSync, mkdirSync } from "fs";
204
204
  import { readdir, rm, writeFile } from "fs/promises";
205
- import { basename, join, resolve as resolve2 } from "path";
205
+ import { basename, join, relative, resolve as resolve2 } from "path";
206
206
  var {Glob } = globalThis.Bun;
207
207
  var indexContentCache, resolveDevClientDir = () => {
208
208
  const fromSource = resolve2(import.meta.dir, "../dev/client");
@@ -505,8 +505,8 @@ var indexContentCache, resolveDevClientDir = () => {
505
505
  ` if (origOnMessage) origOnMessage.call(this, event);`,
506
506
  ` try {`,
507
507
  ` const msg = JSON.parse(event.data);`,
508
- ` if (msg.type === 'react-update' && msg.data?.pageModuleUrl) {`,
509
- ` const url = msg.data.pageModuleUrl;`,
508
+ ` if (msg.type === 'react-update' && msg.data?.primarySource && !msg.data.primarySource.endsWith('.tsx') && !msg.data.primarySource.endsWith('.jsx')) {`,
509
+ ` const url = "/@src/${relative(process.cwd(), resolve2(reactPagesDirectory, componentName + ".tsx")).replace(/\\/g, "/")}";`,
510
510
  ` const start = performance.now();`,
511
511
  ` import(url + '?t=' + Date.now()).then(mod => {`,
512
512
  ` const Comp = mod.${componentName} || mod.default;`,
@@ -980,7 +980,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
980
980
 
981
981
  // src/build/angularLinkerPlugin.ts
982
982
  import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
983
- import { dirname as dirname2, join as join4, relative, resolve as resolve5 } from "path";
983
+ import { dirname as dirname2, join as join4, relative as relative2, resolve as resolve5 } from "path";
984
984
  import { createHash } from "crypto";
985
985
  var CACHE_DIR, angularLinkerPlugin;
986
986
  var init_angularLinkerPlugin = __esm(() => {
@@ -1023,7 +1023,7 @@ var init_angularLinkerPlugin = __esm(() => {
1023
1023
  dirname: dirname2,
1024
1024
  exists: existsSync7,
1025
1025
  readFile: readFileSync3,
1026
- relative,
1026
+ relative: relative2,
1027
1027
  resolve: resolve5
1028
1028
  },
1029
1029
  linkerJitMode: false,
@@ -1064,11 +1064,11 @@ var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPath
1064
1064
  const currentPaths = new Set(currentOutputPaths.map((path) => resolve6(path)));
1065
1065
  const glob = new Glob4("**/*");
1066
1066
  const removals = [];
1067
- for (const relative2 of glob.scanSync({ cwd: buildPath })) {
1068
- const absolute = resolve6(buildPath, relative2);
1067
+ for (const relative3 of glob.scanSync({ cwd: buildPath })) {
1068
+ const absolute = resolve6(buildPath, relative3);
1069
1069
  if (currentPaths.has(absolute))
1070
1070
  continue;
1071
- if (!HASHED_FILE_PATTERN.test(relative2))
1071
+ if (!HASHED_FILE_PATTERN.test(relative3))
1072
1072
  continue;
1073
1073
  removals.push(rm2(absolute, { force: true }));
1074
1074
  }
@@ -1222,12 +1222,12 @@ var init_startupBanner = __esm(() => {
1222
1222
  // src/utils/logger.ts
1223
1223
  var colors2, frameworkColors, formatPath = (filePath) => {
1224
1224
  const cwd = process.cwd();
1225
- let relative2 = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
1226
- relative2 = relative2.replace(/\\/g, "/");
1227
- if (!relative2.startsWith("/")) {
1228
- relative2 = `/${relative2}`;
1225
+ let relative3 = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
1226
+ relative3 = relative3.replace(/\\/g, "/");
1227
+ if (!relative3.startsWith("/")) {
1228
+ relative3 = `/${relative3}`;
1229
1229
  }
1230
- return relative2;
1230
+ return relative3;
1231
1231
  }, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
1232
1232
  const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
1233
1233
  const tag = `${colors2.cyan}[hmr]${colors2.reset}`;
@@ -1286,11 +1286,11 @@ var init_logger = __esm(() => {
1286
1286
  });
1287
1287
 
1288
1288
  // src/utils/validateSafePath.ts
1289
- import { resolve as resolve7, relative as relative2 } from "path";
1289
+ import { resolve as resolve7, relative as relative3 } from "path";
1290
1290
  var validateSafePath = (targetPath, baseDirectory) => {
1291
1291
  const absoluteBase = resolve7(baseDirectory);
1292
1292
  const absoluteTarget = resolve7(baseDirectory, targetPath);
1293
- const relativePath = normalizePath(relative2(absoluteBase, absoluteTarget));
1293
+ const relativePath = normalizePath(relative3(absoluteBase, absoluteTarget));
1294
1294
  if (relativePath.startsWith("../") || relativePath === "..") {
1295
1295
  throw new Error(`Unsafe path: ${targetPath}`);
1296
1296
  }
@@ -1312,7 +1312,7 @@ import {
1312
1312
  basename as basename2,
1313
1313
  extname as extname2,
1314
1314
  resolve as resolve8,
1315
- relative as relative3,
1315
+ relative as relative4,
1316
1316
  sep
1317
1317
  } from "path";
1318
1318
  import { env } from "process";
@@ -1376,7 +1376,7 @@ var resolveDevClientDir2 = () => {
1376
1376
  const isModule = src.endsWith(".svelte.ts") || src.endsWith(".svelte.js");
1377
1377
  const preprocessed = isModule ? raw : (await preprocess(raw, {})).code;
1378
1378
  const transpiled = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler.transformSync(preprocessed) : preprocessed;
1379
- const relDir = dirname3(relative3(svelteRoot, src)).replace(/\\/g, "/");
1379
+ const relDir = dirname3(relative4(svelteRoot, src)).replace(/\\/g, "/");
1380
1380
  const baseName = basename2(src).replace(/\.svelte(\.(ts|js))?$/, "");
1381
1381
  const importPaths = Array.from(transpiled.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
1382
1382
  const resolvedImports = await Promise.all(importPaths.map((importPath) => resolveSvelte(importPath, src)));
@@ -1395,7 +1395,7 @@ var resolveDevClientDir2 = () => {
1395
1395
  }).js.code;
1396
1396
  let code = raw2.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
1397
1397
  if (mode === "client" && isDev) {
1398
- const moduleKey = `/@src/${relative3(process.cwd(), src).replace(/\\/g, "/")}`;
1398
+ const moduleKey = `/@src/${relative4(process.cwd(), src).replace(/\\/g, "/")}`;
1399
1399
  code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
1400
1400
  if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
1401
1401
  var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
@@ -1430,10 +1430,10 @@ var resolveDevClientDir2 = () => {
1430
1430
  };
1431
1431
  const roots = await Promise.all(entryPoints.map(build2));
1432
1432
  await Promise.all(roots.map(async ({ client: client2 }) => {
1433
- const relClientDir = dirname3(relative3(clientDir, client2));
1433
+ const relClientDir = dirname3(relative4(clientDir, client2));
1434
1434
  const name = basename2(client2, extname2(client2));
1435
1435
  const indexPath = join6(indexDir, relClientDir, `${name}.js`);
1436
- const importRaw = relative3(dirname3(indexPath), client2).split(sep).join("/");
1436
+ const importRaw = relative4(dirname3(indexPath), client2).split(sep).join("/");
1437
1437
  const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
1438
1438
  const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
1439
1439
  import "${hmrClientPath3}";
@@ -1473,7 +1473,7 @@ if (typeof window !== "undefined") {
1473
1473
  return {
1474
1474
  svelteClientPaths: roots.map(({ client: client2 }) => client2),
1475
1475
  svelteIndexPaths: roots.map(({ client: client2 }) => {
1476
- const rel = dirname3(relative3(clientDir, client2));
1476
+ const rel = dirname3(relative4(clientDir, client2));
1477
1477
  return join6(indexDir, rel, basename2(client2));
1478
1478
  }),
1479
1479
  svelteServerPaths: roots.map(({ ssr }) => ssr)
@@ -1498,7 +1498,7 @@ __export(exports_compileVue, {
1498
1498
  });
1499
1499
  import { existsSync as existsSync9 } from "fs";
1500
1500
  import { mkdir as mkdir2 } from "fs/promises";
1501
- import { basename as basename3, dirname as dirname4, join as join7, relative as relative4, resolve as resolve9 } from "path";
1501
+ import { basename as basename3, dirname as dirname4, join as join7, relative as relative5, resolve as resolve9 } from "path";
1502
1502
  var {file: file3, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
1503
1503
  var resolveDevClientDir3 = () => {
1504
1504
  const fromSource = resolve9(import.meta.dir, "../dev/client");
@@ -1543,7 +1543,7 @@ var resolveDevClientDir3 = () => {
1543
1543
  return "template-only";
1544
1544
  }
1545
1545
  return "full";
1546
- }, generateVueHmrId = (sourceFilePath, vueRootDir) => relative4(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), extractImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => importPath !== undefined), toJs = (filePath) => {
1546
+ }, generateVueHmrId = (sourceFilePath, vueRootDir) => relative5(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), extractImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => importPath !== undefined), toJs = (filePath) => {
1547
1547
  if (filePath.endsWith(".vue"))
1548
1548
  return filePath.replace(/\.vue$/, ".js");
1549
1549
  if (filePath.endsWith(".ts"))
@@ -1570,7 +1570,7 @@ var resolveDevClientDir3 = () => {
1570
1570
  const cachedResult = cacheMap.get(sourceFilePath);
1571
1571
  if (cachedResult)
1572
1572
  return cachedResult;
1573
- const relativeFilePath = relative4(vueRootDir, sourceFilePath).replace(/\\/g, "/");
1573
+ const relativeFilePath = relative5(vueRootDir, sourceFilePath).replace(/\\/g, "/");
1574
1574
  const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
1575
1575
  const fileBaseName = basename3(sourceFilePath, ".vue");
1576
1576
  const componentId = toKebab(fileBaseName);
@@ -1699,7 +1699,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
1699
1699
  result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
1700
1700
  const entryBaseName = basename3(entryPath, ".vue");
1701
1701
  const indexOutputFile = join7(indexOutputDir, `${entryBaseName}.js`);
1702
- const clientOutputFile = join7(clientOutputDir, relative4(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
1702
+ const clientOutputFile = join7(clientOutputDir, relative5(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
1703
1703
  await mkdir2(dirname4(indexOutputFile), { recursive: true });
1704
1704
  const vueHmrImports = isDev ? [
1705
1705
  `window.__HMR_FRAMEWORK__ = "vue";`,
@@ -1707,7 +1707,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
1707
1707
  ] : [];
1708
1708
  await write2(indexOutputFile, [
1709
1709
  ...vueHmrImports,
1710
- `import Comp from "${relative4(dirname4(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
1710
+ `import Comp from "${relative5(dirname4(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
1711
1711
  'import { createSSRApp, createApp } from "vue";',
1712
1712
  "",
1713
1713
  "// HMR State Preservation: Check for preserved state from HMR",
@@ -1807,7 +1807,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
1807
1807
  await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
1808
1808
  const sourceCode = await file3(tsPath).text();
1809
1809
  const transpiledCode = transpiler2.transformSync(sourceCode);
1810
- const relativeJsPath = relative4(vueRootDir, tsPath).replace(/\.ts$/, ".js");
1810
+ const relativeJsPath = relative5(vueRootDir, tsPath).replace(/\.ts$/, ".js");
1811
1811
  const outClientPath = join7(clientOutputDir, relativeJsPath);
1812
1812
  const outServerPath = join7(serverOutputDir, relativeJsPath);
1813
1813
  await mkdir2(dirname4(outClientPath), { recursive: true });
@@ -10697,11 +10697,11 @@ ${lanes.join(`
10697
10697
  return toComponents;
10698
10698
  }
10699
10699
  const components = toComponents.slice(start);
10700
- const relative5 = [];
10700
+ const relative6 = [];
10701
10701
  for (;start < fromComponents.length; start++) {
10702
- relative5.push("..");
10702
+ relative6.push("..");
10703
10703
  }
10704
- return ["", ...relative5, ...components];
10704
+ return ["", ...relative6, ...components];
10705
10705
  }
10706
10706
  function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) {
10707
10707
  Debug.assert(getRootLength(fromDirectory) > 0 === getRootLength(to) > 0, "Paths must either both be absolute or both be relative");
@@ -47997,9 +47997,9 @@ ${lanes.join(`
47997
47997
  if (!startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) {
47998
47998
  return;
47999
47999
  }
48000
- const relative5 = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName);
48000
+ const relative6 = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName);
48001
48001
  for (const symlinkDirectory of symlinkDirectories) {
48002
- const option = resolvePath(symlinkDirectory, relative5);
48002
+ const option = resolvePath(symlinkDirectory, relative6);
48003
48003
  const result2 = cb(option, target === referenceRedirect);
48004
48004
  shouldFilterIgnoredPaths = true;
48005
48005
  if (result2)
@@ -170565,7 +170565,7 @@ __export(exports_compileAngular, {
170565
170565
  compileAngular: () => compileAngular
170566
170566
  });
170567
170567
  import { existsSync as existsSync10, readFileSync as readFileSync4, promises as fs } from "fs";
170568
- import { join as join8, basename as basename4, sep as sep2, dirname as dirname5, resolve as resolve10, relative as relative5 } from "path";
170568
+ import { join as join8, basename as basename4, sep as sep2, dirname as dirname5, resolve as resolve10, relative as relative6 } from "path";
170569
170569
  import { createHash as createHash2 } from "crypto";
170570
170570
  var import_typescript, computeConfigHash = () => {
170571
170571
  try {
@@ -170874,7 +170874,7 @@ export default ${componentClassName};
170874
170874
  await fs.writeFile(ssrDepsFile, ssrDepsContent, "utf-8");
170875
170875
  }
170876
170876
  await fs.writeFile(rawServerFile, rewritten, "utf-8");
170877
- const relativePath = relative5(indexesDir, rawServerFile).replace(/\\/g, "/");
170877
+ const relativePath = relative6(indexesDir, rawServerFile).replace(/\\/g, "/");
170878
170878
  const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
170879
170879
  const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
170880
170880
  import "${hmrRuntimePath}";
@@ -171253,7 +171253,7 @@ import {
171253
171253
  rmSync,
171254
171254
  writeFileSync as writeFileSync3
171255
171255
  } from "fs";
171256
- import { basename as basename5, join as join13, relative as relative6, resolve as resolve11 } from "path";
171256
+ import { basename as basename5, join as join13, relative as relative7, resolve as resolve11 } from "path";
171257
171257
  import { cwd, env as env2, exit } from "process";
171258
171258
  var {build: bunBuild6, Glob: Glob5 } = globalThis.Bun;
171259
171259
  var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental, throwOnError) => {
@@ -171818,7 +171818,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
171818
171818
  const devIndexDir = join13(buildPath, "_src_indexes");
171819
171819
  mkdirSync8(devIndexDir, { recursive: true });
171820
171820
  const indexFiles = readDir(reactIndexesPath).filter((f) => f.endsWith(".tsx"));
171821
- const pagesRel = relative6(process.cwd(), resolve11(reactPagesPath)).replace(/\\/g, "/");
171821
+ const pagesRel = relative7(process.cwd(), resolve11(reactPagesPath)).replace(/\\/g, "/");
171822
171822
  for (const file4 of indexFiles) {
171823
171823
  let content = readFileSync5(join13(reactIndexesPath, file4), "utf-8");
171824
171824
  content = content.replace(/from\s*['"]\.\.\/pages\/([^'"]+)['"]/g, `from '/@src/${pagesRel}/$1'`);
@@ -202397,7 +202397,7 @@ __export(exports_moduleServer, {
202397
202397
  SRC_URL_PREFIX: () => SRC_URL_PREFIX
202398
202398
  });
202399
202399
  import { existsSync as existsSync13, readFileSync as readFileSync9, statSync } from "fs";
202400
- import { basename as basename7, dirname as dirname7, extname as extname3, resolve as resolve18, relative as relative7 } from "path";
202400
+ import { basename as basename7, dirname as dirname7, extname as extname3, resolve as resolve18, relative as relative8 } from "path";
202401
202401
  var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
202402
202402
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
202403
202403
  const allExports = [];
@@ -202460,7 +202460,7 @@ ${stubs}
202460
202460
  const fileDir = dirname7(filePath);
202461
202461
  result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => {
202462
202462
  const absPath = resolve18(fileDir, relPath);
202463
- const rel = relative7(projectRoot, absPath);
202463
+ const rel = relative8(projectRoot, absPath);
202464
202464
  let srcPath = rel;
202465
202465
  if (!extname3(srcPath)) {
202466
202466
  const extensions = [
@@ -202481,19 +202481,19 @@ ${stubs}
202481
202481
  }
202482
202482
  if (extname3(srcPath) === ".svelte") {
202483
202483
  const resolved = resolveSvelteModulePath(resolve18(projectRoot, srcPath));
202484
- const resolvedRel = relative7(projectRoot, resolved);
202484
+ const resolvedRel = relative8(projectRoot, resolved);
202485
202485
  srcPath = resolvedRel;
202486
202486
  }
202487
202487
  return `${prefix}${srcUrl(srcPath, projectRoot)}${suffix}`;
202488
202488
  });
202489
202489
  result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => {
202490
202490
  const absPath = resolve18(fileDir, relPath);
202491
- const rel = relative7(projectRoot, absPath);
202491
+ const rel = relative8(projectRoot, absPath);
202492
202492
  return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
202493
202493
  });
202494
202494
  result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => {
202495
202495
  const absPath = resolve18(fileDir, relPath);
202496
- const rel = relative7(projectRoot, absPath);
202496
+ const rel = relative8(projectRoot, absPath);
202497
202497
  let srcPath = rel;
202498
202498
  if (!extname3(srcPath)) {
202499
202499
  const extensions = [
@@ -202517,10 +202517,10 @@ ${stubs}
202517
202517
  });
202518
202518
  result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, (_match, prefix, absPath, _ext, suffix) => {
202519
202519
  if (absPath.startsWith(projectRoot)) {
202520
- const rel2 = relative7(projectRoot, absPath).replace(/\\/g, "/");
202520
+ const rel2 = relative8(projectRoot, absPath).replace(/\\/g, "/");
202521
202521
  return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
202522
202522
  }
202523
- const rel = relative7(projectRoot, absPath).replace(/\\/g, "/");
202523
+ const rel = relative8(projectRoot, absPath).replace(/\\/g, "/");
202524
202524
  if (!rel.startsWith("..")) {
202525
202525
  return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
202526
202526
  }
@@ -202562,7 +202562,7 @@ ${stubs}
202562
202562
  transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
202563
202563
  ` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
202564
202564
  ` + transpiled;
202565
- const relPath = relative7(projectRoot, filePath).replace(/\\/g, "/");
202565
+ const relPath = relative8(projectRoot, filePath).replace(/\\/g, "/");
202566
202566
  transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
202567
202567
  return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
202568
202568
  }, transformPlainFile = (filePath, projectRoot, rewriter) => {
@@ -202629,11 +202629,11 @@ ${stubs}
202629
202629
  if (compiled.css?.code) {
202630
202630
  const cssPath = `${filePath}.css`;
202631
202631
  svelteExternalCss.set(cssPath, compiled.css.code);
202632
- const cssUrl = srcUrl(relative7(projectRoot, cssPath), projectRoot);
202632
+ const cssUrl = srcUrl(relative8(projectRoot, cssPath), projectRoot);
202633
202633
  code = `import "${cssUrl}";
202634
202634
  ${code}`;
202635
202635
  }
202636
- const moduleUrl = `${SRC_PREFIX}${relative7(projectRoot, filePath).replace(/\\/g, "/")}`;
202636
+ const moduleUrl = `${SRC_PREFIX}${relative8(projectRoot, filePath).replace(/\\/g, "/")}`;
202637
202637
  code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
202638
202638
  if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
202639
202639
  var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
@@ -202697,7 +202697,7 @@ ${code}`;
202697
202697
  }
202698
202698
  code = tsTranspiler2.transformSync(code);
202699
202699
  const hmrBase = vueDir ? resolve18(vueDir) : projectRoot;
202700
- const hmrId = relative7(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
202700
+ const hmrId = relative8(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
202701
202701
  code = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
202702
202702
  code += [
202703
202703
  "",
@@ -203060,7 +203060,7 @@ var init_simpleHTMXHMR = () => {};
203060
203060
  // src/dev/rebuildTrigger.ts
203061
203061
  import { existsSync as existsSync14 } from "fs";
203062
203062
  import { rm as rm8 } from "fs/promises";
203063
- import { basename as basename8, relative as relative8, resolve as resolve21 } from "path";
203063
+ import { basename as basename8, relative as relative9, resolve as resolve21 } from "path";
203064
203064
  var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseErrorLocationFromMessage = (msg) => {
203065
203065
  const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
203066
203066
  if (pathLineCol) {
@@ -203494,7 +203494,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
203494
203494
  }, getModuleUrl = async (pageFile) => {
203495
203495
  const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
203496
203496
  invalidateModule2(pageFile);
203497
- const rel = relative8(process.cwd(), pageFile).replace(/\\/g, "/");
203497
+ const rel = relative9(process.cwd(), pageFile).replace(/\\/g, "/");
203498
203498
  const url = `${SRC_URL_PREFIX2}${rel}`;
203499
203499
  warmCache2(url);
203500
203500
  return url;
@@ -203520,13 +203520,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
203520
203520
  for (const file4 of reactFiles) {
203521
203521
  invalidateModule2(file4);
203522
203522
  }
203523
- const reactPagesDir = resolve21(config.reactDirectory ?? "", "pages");
203524
- const pageFile = reactFiles.find((f) => f.replace(/\\/g, "/").includes("/pages/"));
203525
- const broadcastTarget = pageFile ?? primaryFile;
203526
- const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
203523
+ const pageModuleUrl = await getReactModuleUrl(primaryFile);
203527
203524
  if (pageModuleUrl) {
203528
203525
  const serverDuration = Date.now() - startTime;
203529
- state.lastHmrPath = relative8(process.cwd(), primaryFile).replace(/\\/g, "/");
203526
+ state.lastHmrPath = relative9(process.cwd(), primaryFile).replace(/\\/g, "/");
203530
203527
  state.lastHmrFramework = "react";
203531
203528
  broadcastToClients(state, {
203532
203529
  data: {
@@ -203912,7 +203909,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
203912
203909
  const baseName = fileName.replace(/\.vue$/, "");
203913
203910
  const pascalName = toPascal(baseName);
203914
203911
  const vueRoot = config.vueDirectory;
203915
- const hmrId = vueRoot ? relative8(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
203912
+ const hmrId = vueRoot ? relative9(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
203916
203913
  const cssKey = `${pascalName}CSS`;
203917
203914
  const cssUrl = manifest[cssKey] || null;
203918
203915
  const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
@@ -205063,7 +205060,7 @@ var handleHTMLPageRequest = (pagePath) => file(pagePath);
205063
205060
  var handleHTMXPageRequest = (pagePath) => file(pagePath);
205064
205061
  // src/core/prepare.ts
205065
205062
  import { readFileSync as readFileSync10 } from "fs";
205066
- import { relative as relative10, resolve as resolve23 } from "path";
205063
+ import { relative as relative11, resolve as resolve23 } from "path";
205067
205064
 
205068
205065
  // src/utils/loadConfig.ts
205069
205066
  import { resolve } from "path";
@@ -205142,7 +205139,7 @@ var prepare = async (configOrPath) => {
205142
205139
  })) {
205143
205140
  if (file4.includes("/node_modules/"))
205144
205141
  continue;
205145
- const rel = relative10(process.cwd(), file4).replace(/\\/g, "/");
205142
+ const rel = relative11(process.cwd(), file4).replace(/\\/g, "/");
205146
205143
  warmCache2(`${SRC_URL_PREFIX2}${rel}`);
205147
205144
  }
205148
205145
  }
@@ -205152,7 +205149,7 @@ var prepare = async (configOrPath) => {
205152
205149
  if (key.endsWith("Index") && typeof result.manifest[key] === "string" && result.manifest[key].includes("/react/") && result.manifest[key].includes("/indexes/")) {
205153
205150
  const fileName = `${key.replace(/Index$/, "")}.tsx`;
205154
205151
  const srcPath = resolve23(devIndexDir, fileName);
205155
- const rel = relative10(process.cwd(), srcPath).replace(/\\/g, "/");
205152
+ const rel = relative11(process.cwd(), srcPath).replace(/\\/g, "/");
205156
205153
  result.manifest[key] = `${SRC_URL_PREFIX2}${rel}`;
205157
205154
  }
205158
205155
  }
@@ -205322,5 +205319,5 @@ export {
205322
205319
  ANGULAR_INIT_TIMEOUT_MS
205323
205320
  };
205324
205321
 
205325
- //# debugId=C0C0D90912664F8864756E2164756E21
205322
+ //# debugId=9822FF122B8382B864756E2164756E21
205326
205323
  //# sourceMappingURL=index.js.map