@absolutejs/absolute 0.19.0-beta.107 → 0.19.0-beta.109
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/.absolutejs/tsconfig.tsbuildinfo +1 -1
- package/dist/build.js +57 -51
- package/dist/build.js.map +3 -3
- package/dist/index.js +60 -54
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
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");
|
|
@@ -491,7 +491,13 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
491
491
|
` originalError.apply(console, args);`,
|
|
492
492
|
` };`,
|
|
493
493
|
` }`,
|
|
494
|
-
`}
|
|
494
|
+
`}`,
|
|
495
|
+
...isDev ? [
|
|
496
|
+
`
|
|
497
|
+
// Pre-warm: import the page module from the module server`,
|
|
498
|
+
`// immediately so the browser caches all /@src/ URLs.`,
|
|
499
|
+
`import('/@src/${relative(process.cwd(), resolve2(reactPagesDirectory, componentName + ".tsx")).replace(/\\/g, "/")}').catch(() => {});`
|
|
500
|
+
] : []
|
|
495
501
|
].join(`
|
|
496
502
|
`);
|
|
497
503
|
const indexPath = join(reactIndexesDirectory, `${componentName}.tsx`);
|
|
@@ -945,7 +951,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
945
951
|
|
|
946
952
|
// src/build/angularLinkerPlugin.ts
|
|
947
953
|
import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
948
|
-
import { dirname as dirname2, join as join4, relative, resolve as resolve5 } from "path";
|
|
954
|
+
import { dirname as dirname2, join as join4, relative as relative2, resolve as resolve5 } from "path";
|
|
949
955
|
import { createHash } from "crypto";
|
|
950
956
|
var CACHE_DIR, angularLinkerPlugin;
|
|
951
957
|
var init_angularLinkerPlugin = __esm(() => {
|
|
@@ -988,7 +994,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
988
994
|
dirname: dirname2,
|
|
989
995
|
exists: existsSync7,
|
|
990
996
|
readFile: readFileSync3,
|
|
991
|
-
relative,
|
|
997
|
+
relative: relative2,
|
|
992
998
|
resolve: resolve5
|
|
993
999
|
},
|
|
994
1000
|
linkerJitMode: false,
|
|
@@ -1029,11 +1035,11 @@ var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPath
|
|
|
1029
1035
|
const currentPaths = new Set(currentOutputPaths.map((path) => resolve6(path)));
|
|
1030
1036
|
const glob = new Glob4("**/*");
|
|
1031
1037
|
const removals = [];
|
|
1032
|
-
for (const
|
|
1033
|
-
const absolute = resolve6(buildPath,
|
|
1038
|
+
for (const relative3 of glob.scanSync({ cwd: buildPath })) {
|
|
1039
|
+
const absolute = resolve6(buildPath, relative3);
|
|
1034
1040
|
if (currentPaths.has(absolute))
|
|
1035
1041
|
continue;
|
|
1036
|
-
if (!HASHED_FILE_PATTERN.test(
|
|
1042
|
+
if (!HASHED_FILE_PATTERN.test(relative3))
|
|
1037
1043
|
continue;
|
|
1038
1044
|
removals.push(rm2(absolute, { force: true }));
|
|
1039
1045
|
}
|
|
@@ -1187,12 +1193,12 @@ var init_startupBanner = __esm(() => {
|
|
|
1187
1193
|
// src/utils/logger.ts
|
|
1188
1194
|
var colors2, frameworkColors, formatPath = (filePath) => {
|
|
1189
1195
|
const cwd = process.cwd();
|
|
1190
|
-
let
|
|
1191
|
-
|
|
1192
|
-
if (!
|
|
1193
|
-
|
|
1196
|
+
let relative3 = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
|
|
1197
|
+
relative3 = relative3.replace(/\\/g, "/");
|
|
1198
|
+
if (!relative3.startsWith("/")) {
|
|
1199
|
+
relative3 = `/${relative3}`;
|
|
1194
1200
|
}
|
|
1195
|
-
return
|
|
1201
|
+
return relative3;
|
|
1196
1202
|
}, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
|
|
1197
1203
|
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
1198
1204
|
const tag = `${colors2.cyan}[hmr]${colors2.reset}`;
|
|
@@ -1251,11 +1257,11 @@ var init_logger = __esm(() => {
|
|
|
1251
1257
|
});
|
|
1252
1258
|
|
|
1253
1259
|
// src/utils/validateSafePath.ts
|
|
1254
|
-
import { resolve as resolve7, relative as
|
|
1260
|
+
import { resolve as resolve7, relative as relative3 } from "path";
|
|
1255
1261
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
1256
1262
|
const absoluteBase = resolve7(baseDirectory);
|
|
1257
1263
|
const absoluteTarget = resolve7(baseDirectory, targetPath);
|
|
1258
|
-
const relativePath = normalizePath(
|
|
1264
|
+
const relativePath = normalizePath(relative3(absoluteBase, absoluteTarget));
|
|
1259
1265
|
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
1260
1266
|
throw new Error(`Unsafe path: ${targetPath}`);
|
|
1261
1267
|
}
|
|
@@ -1277,7 +1283,7 @@ import {
|
|
|
1277
1283
|
basename as basename2,
|
|
1278
1284
|
extname as extname2,
|
|
1279
1285
|
resolve as resolve8,
|
|
1280
|
-
relative as
|
|
1286
|
+
relative as relative4,
|
|
1281
1287
|
sep
|
|
1282
1288
|
} from "path";
|
|
1283
1289
|
import { env } from "process";
|
|
@@ -1341,7 +1347,7 @@ var resolveDevClientDir2 = () => {
|
|
|
1341
1347
|
const isModule = src.endsWith(".svelte.ts") || src.endsWith(".svelte.js");
|
|
1342
1348
|
const preprocessed = isModule ? raw : (await preprocess(raw, {})).code;
|
|
1343
1349
|
const transpiled = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler.transformSync(preprocessed) : preprocessed;
|
|
1344
|
-
const relDir = dirname3(
|
|
1350
|
+
const relDir = dirname3(relative4(svelteRoot, src)).replace(/\\/g, "/");
|
|
1345
1351
|
const baseName = basename2(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
1346
1352
|
const importPaths = Array.from(transpiled.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
1347
1353
|
const resolvedImports = await Promise.all(importPaths.map((importPath) => resolveSvelte(importPath, src)));
|
|
@@ -1360,7 +1366,7 @@ var resolveDevClientDir2 = () => {
|
|
|
1360
1366
|
}).js.code;
|
|
1361
1367
|
let code = raw2.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
1362
1368
|
if (mode === "client" && isDev) {
|
|
1363
|
-
const moduleKey = `/@src/${
|
|
1369
|
+
const moduleKey = `/@src/${relative4(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
1364
1370
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
1365
1371
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
1366
1372
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -1395,10 +1401,10 @@ var resolveDevClientDir2 = () => {
|
|
|
1395
1401
|
};
|
|
1396
1402
|
const roots = await Promise.all(entryPoints.map(build2));
|
|
1397
1403
|
await Promise.all(roots.map(async ({ client: client2 }) => {
|
|
1398
|
-
const relClientDir = dirname3(
|
|
1404
|
+
const relClientDir = dirname3(relative4(clientDir, client2));
|
|
1399
1405
|
const name = basename2(client2, extname2(client2));
|
|
1400
1406
|
const indexPath = join6(indexDir, relClientDir, `${name}.js`);
|
|
1401
|
-
const importRaw =
|
|
1407
|
+
const importRaw = relative4(dirname3(indexPath), client2).split(sep).join("/");
|
|
1402
1408
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
1403
1409
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
1404
1410
|
import "${hmrClientPath3}";
|
|
@@ -1438,7 +1444,7 @@ if (typeof window !== "undefined") {
|
|
|
1438
1444
|
return {
|
|
1439
1445
|
svelteClientPaths: roots.map(({ client: client2 }) => client2),
|
|
1440
1446
|
svelteIndexPaths: roots.map(({ client: client2 }) => {
|
|
1441
|
-
const rel = dirname3(
|
|
1447
|
+
const rel = dirname3(relative4(clientDir, client2));
|
|
1442
1448
|
return join6(indexDir, rel, basename2(client2));
|
|
1443
1449
|
}),
|
|
1444
1450
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
@@ -1463,7 +1469,7 @@ __export(exports_compileVue, {
|
|
|
1463
1469
|
});
|
|
1464
1470
|
import { existsSync as existsSync9 } from "fs";
|
|
1465
1471
|
import { mkdir as mkdir2 } from "fs/promises";
|
|
1466
|
-
import { basename as basename3, dirname as dirname4, join as join7, relative as
|
|
1472
|
+
import { basename as basename3, dirname as dirname4, join as join7, relative as relative5, resolve as resolve9 } from "path";
|
|
1467
1473
|
var {file: file3, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
1468
1474
|
var resolveDevClientDir3 = () => {
|
|
1469
1475
|
const fromSource = resolve9(import.meta.dir, "../dev/client");
|
|
@@ -1508,7 +1514,7 @@ var resolveDevClientDir3 = () => {
|
|
|
1508
1514
|
return "template-only";
|
|
1509
1515
|
}
|
|
1510
1516
|
return "full";
|
|
1511
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
1517
|
+
}, 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) => {
|
|
1512
1518
|
if (filePath.endsWith(".vue"))
|
|
1513
1519
|
return filePath.replace(/\.vue$/, ".js");
|
|
1514
1520
|
if (filePath.endsWith(".ts"))
|
|
@@ -1535,7 +1541,7 @@ var resolveDevClientDir3 = () => {
|
|
|
1535
1541
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
1536
1542
|
if (cachedResult)
|
|
1537
1543
|
return cachedResult;
|
|
1538
|
-
const relativeFilePath =
|
|
1544
|
+
const relativeFilePath = relative5(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
1539
1545
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
1540
1546
|
const fileBaseName = basename3(sourceFilePath, ".vue");
|
|
1541
1547
|
const componentId = toKebab(fileBaseName);
|
|
@@ -1664,7 +1670,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
1664
1670
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
1665
1671
|
const entryBaseName = basename3(entryPath, ".vue");
|
|
1666
1672
|
const indexOutputFile = join7(indexOutputDir, `${entryBaseName}.js`);
|
|
1667
|
-
const clientOutputFile = join7(clientOutputDir,
|
|
1673
|
+
const clientOutputFile = join7(clientOutputDir, relative5(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
1668
1674
|
await mkdir2(dirname4(indexOutputFile), { recursive: true });
|
|
1669
1675
|
const vueHmrImports = isDev ? [
|
|
1670
1676
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -1672,7 +1678,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
1672
1678
|
] : [];
|
|
1673
1679
|
await write2(indexOutputFile, [
|
|
1674
1680
|
...vueHmrImports,
|
|
1675
|
-
`import Comp from "${
|
|
1681
|
+
`import Comp from "${relative5(dirname4(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
1676
1682
|
'import { createSSRApp, createApp } from "vue";',
|
|
1677
1683
|
"",
|
|
1678
1684
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -1772,7 +1778,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
1772
1778
|
await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
|
|
1773
1779
|
const sourceCode = await file3(tsPath).text();
|
|
1774
1780
|
const transpiledCode = transpiler2.transformSync(sourceCode);
|
|
1775
|
-
const relativeJsPath =
|
|
1781
|
+
const relativeJsPath = relative5(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
1776
1782
|
const outClientPath = join7(clientOutputDir, relativeJsPath);
|
|
1777
1783
|
const outServerPath = join7(serverOutputDir, relativeJsPath);
|
|
1778
1784
|
await mkdir2(dirname4(outClientPath), { recursive: true });
|
|
@@ -10662,11 +10668,11 @@ ${lanes.join(`
|
|
|
10662
10668
|
return toComponents;
|
|
10663
10669
|
}
|
|
10664
10670
|
const components = toComponents.slice(start);
|
|
10665
|
-
const
|
|
10671
|
+
const relative6 = [];
|
|
10666
10672
|
for (;start < fromComponents.length; start++) {
|
|
10667
|
-
|
|
10673
|
+
relative6.push("..");
|
|
10668
10674
|
}
|
|
10669
|
-
return ["", ...
|
|
10675
|
+
return ["", ...relative6, ...components];
|
|
10670
10676
|
}
|
|
10671
10677
|
function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) {
|
|
10672
10678
|
Debug.assert(getRootLength(fromDirectory) > 0 === getRootLength(to) > 0, "Paths must either both be absolute or both be relative");
|
|
@@ -47962,9 +47968,9 @@ ${lanes.join(`
|
|
|
47962
47968
|
if (!startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) {
|
|
47963
47969
|
return;
|
|
47964
47970
|
}
|
|
47965
|
-
const
|
|
47971
|
+
const relative6 = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName);
|
|
47966
47972
|
for (const symlinkDirectory of symlinkDirectories) {
|
|
47967
|
-
const option = resolvePath(symlinkDirectory,
|
|
47973
|
+
const option = resolvePath(symlinkDirectory, relative6);
|
|
47968
47974
|
const result2 = cb(option, target === referenceRedirect);
|
|
47969
47975
|
shouldFilterIgnoredPaths = true;
|
|
47970
47976
|
if (result2)
|
|
@@ -170530,7 +170536,7 @@ __export(exports_compileAngular, {
|
|
|
170530
170536
|
compileAngular: () => compileAngular
|
|
170531
170537
|
});
|
|
170532
170538
|
import { existsSync as existsSync10, readFileSync as readFileSync4, promises as fs } from "fs";
|
|
170533
|
-
import { join as join8, basename as basename4, sep as sep2, dirname as dirname5, resolve as resolve10, relative as
|
|
170539
|
+
import { join as join8, basename as basename4, sep as sep2, dirname as dirname5, resolve as resolve10, relative as relative6 } from "path";
|
|
170534
170540
|
import { createHash as createHash2 } from "crypto";
|
|
170535
170541
|
var import_typescript, computeConfigHash = () => {
|
|
170536
170542
|
try {
|
|
@@ -170839,7 +170845,7 @@ export default ${componentClassName};
|
|
|
170839
170845
|
await fs.writeFile(ssrDepsFile, ssrDepsContent, "utf-8");
|
|
170840
170846
|
}
|
|
170841
170847
|
await fs.writeFile(rawServerFile, rewritten, "utf-8");
|
|
170842
|
-
const relativePath =
|
|
170848
|
+
const relativePath = relative6(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
170843
170849
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
170844
170850
|
const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
|
|
170845
170851
|
import "${hmrRuntimePath}";
|
|
@@ -171218,7 +171224,7 @@ import {
|
|
|
171218
171224
|
rmSync,
|
|
171219
171225
|
writeFileSync as writeFileSync3
|
|
171220
171226
|
} from "fs";
|
|
171221
|
-
import { basename as basename5, join as join13, relative as
|
|
171227
|
+
import { basename as basename5, join as join13, relative as relative7, resolve as resolve11 } from "path";
|
|
171222
171228
|
import { cwd, env as env2, exit } from "process";
|
|
171223
171229
|
var {build: bunBuild6, Glob: Glob5 } = globalThis.Bun;
|
|
171224
171230
|
var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental, throwOnError) => {
|
|
@@ -171783,7 +171789,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171783
171789
|
const devIndexDir = join13(buildPath, "_src_indexes");
|
|
171784
171790
|
mkdirSync8(devIndexDir, { recursive: true });
|
|
171785
171791
|
const indexFiles = readDir(reactIndexesPath).filter((f) => f.endsWith(".tsx"));
|
|
171786
|
-
const pagesRel =
|
|
171792
|
+
const pagesRel = relative7(process.cwd(), resolve11(reactPagesPath)).replace(/\\/g, "/");
|
|
171787
171793
|
for (const file4 of indexFiles) {
|
|
171788
171794
|
let content = readFileSync5(join13(reactIndexesPath, file4), "utf-8");
|
|
171789
171795
|
content = content.replace(/from\s*['"]\.\.\/pages\/([^'"]+)['"]/g, `from '/@src/${pagesRel}/$1'`);
|
|
@@ -202393,7 +202399,7 @@ __export(exports_moduleServer, {
|
|
|
202393
202399
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
202394
202400
|
});
|
|
202395
202401
|
import { existsSync as existsSync13, readFileSync as readFileSync9, statSync } from "fs";
|
|
202396
|
-
import { basename as basename7, dirname as dirname7, extname as extname3, resolve as resolve18, relative as
|
|
202402
|
+
import { basename as basename7, dirname as dirname7, extname as extname3, resolve as resolve18, relative as relative8 } from "path";
|
|
202397
202403
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
202398
202404
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
202399
202405
|
const allExports = [];
|
|
@@ -202456,7 +202462,7 @@ ${stubs}
|
|
|
202456
202462
|
const fileDir = dirname7(filePath);
|
|
202457
202463
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => {
|
|
202458
202464
|
const absPath = resolve18(fileDir, relPath);
|
|
202459
|
-
const rel =
|
|
202465
|
+
const rel = relative8(projectRoot, absPath);
|
|
202460
202466
|
let srcPath = rel;
|
|
202461
202467
|
if (!extname3(srcPath)) {
|
|
202462
202468
|
const extensions = [
|
|
@@ -202477,19 +202483,19 @@ ${stubs}
|
|
|
202477
202483
|
}
|
|
202478
202484
|
if (extname3(srcPath) === ".svelte") {
|
|
202479
202485
|
const resolved = resolveSvelteModulePath(resolve18(projectRoot, srcPath));
|
|
202480
|
-
const resolvedRel =
|
|
202486
|
+
const resolvedRel = relative8(projectRoot, resolved);
|
|
202481
202487
|
srcPath = resolvedRel;
|
|
202482
202488
|
}
|
|
202483
202489
|
return `${prefix}${srcUrl(srcPath, projectRoot)}${suffix}`;
|
|
202484
202490
|
});
|
|
202485
202491
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => {
|
|
202486
202492
|
const absPath = resolve18(fileDir, relPath);
|
|
202487
|
-
const rel =
|
|
202493
|
+
const rel = relative8(projectRoot, absPath);
|
|
202488
202494
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
202489
202495
|
});
|
|
202490
202496
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => {
|
|
202491
202497
|
const absPath = resolve18(fileDir, relPath);
|
|
202492
|
-
const rel =
|
|
202498
|
+
const rel = relative8(projectRoot, absPath);
|
|
202493
202499
|
let srcPath = rel;
|
|
202494
202500
|
if (!extname3(srcPath)) {
|
|
202495
202501
|
const extensions = [
|
|
@@ -202513,10 +202519,10 @@ ${stubs}
|
|
|
202513
202519
|
});
|
|
202514
202520
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, (_match, prefix, absPath, _ext, suffix) => {
|
|
202515
202521
|
if (absPath.startsWith(projectRoot)) {
|
|
202516
|
-
const rel2 =
|
|
202522
|
+
const rel2 = relative8(projectRoot, absPath).replace(/\\/g, "/");
|
|
202517
202523
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
202518
202524
|
}
|
|
202519
|
-
const rel =
|
|
202525
|
+
const rel = relative8(projectRoot, absPath).replace(/\\/g, "/");
|
|
202520
202526
|
if (!rel.startsWith("..")) {
|
|
202521
202527
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
202522
202528
|
}
|
|
@@ -202558,7 +202564,7 @@ ${stubs}
|
|
|
202558
202564
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
202559
202565
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
202560
202566
|
` + transpiled;
|
|
202561
|
-
const relPath =
|
|
202567
|
+
const relPath = relative8(projectRoot, filePath).replace(/\\/g, "/");
|
|
202562
202568
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
202563
202569
|
return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
|
|
202564
202570
|
}, transformPlainFile = (filePath, projectRoot, rewriter) => {
|
|
@@ -202625,11 +202631,11 @@ ${stubs}
|
|
|
202625
202631
|
if (compiled.css?.code) {
|
|
202626
202632
|
const cssPath = `${filePath}.css`;
|
|
202627
202633
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
202628
|
-
const cssUrl = srcUrl(
|
|
202634
|
+
const cssUrl = srcUrl(relative8(projectRoot, cssPath), projectRoot);
|
|
202629
202635
|
code = `import "${cssUrl}";
|
|
202630
202636
|
${code}`;
|
|
202631
202637
|
}
|
|
202632
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
202638
|
+
const moduleUrl = `${SRC_PREFIX}${relative8(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
202633
202639
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
202634
202640
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
202635
202641
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
@@ -202693,7 +202699,7 @@ ${code}`;
|
|
|
202693
202699
|
}
|
|
202694
202700
|
code = tsTranspiler2.transformSync(code);
|
|
202695
202701
|
const hmrBase = vueDir ? resolve18(vueDir) : projectRoot;
|
|
202696
|
-
const hmrId =
|
|
202702
|
+
const hmrId = relative8(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
202697
202703
|
code = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
202698
202704
|
code += [
|
|
202699
202705
|
"",
|
|
@@ -203056,7 +203062,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
203056
203062
|
// src/dev/rebuildTrigger.ts
|
|
203057
203063
|
import { existsSync as existsSync14 } from "fs";
|
|
203058
203064
|
import { rm as rm8 } from "fs/promises";
|
|
203059
|
-
import { basename as basename8, relative as
|
|
203065
|
+
import { basename as basename8, relative as relative9, resolve as resolve21 } from "path";
|
|
203060
203066
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseErrorLocationFromMessage = (msg) => {
|
|
203061
203067
|
const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
|
|
203062
203068
|
if (pathLineCol) {
|
|
@@ -203490,7 +203496,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
203490
203496
|
}, getModuleUrl = async (pageFile) => {
|
|
203491
203497
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
203492
203498
|
invalidateModule2(pageFile);
|
|
203493
|
-
const rel =
|
|
203499
|
+
const rel = relative9(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
203494
203500
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
203495
203501
|
warmCache2(url);
|
|
203496
203502
|
return url;
|
|
@@ -203527,7 +203533,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
203527
203533
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
203528
203534
|
if (pageModuleUrl) {
|
|
203529
203535
|
const serverDuration = Date.now() - startTime;
|
|
203530
|
-
state.lastHmrPath =
|
|
203536
|
+
state.lastHmrPath = relative9(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
203531
203537
|
state.lastHmrFramework = "react";
|
|
203532
203538
|
broadcastToClients(state, {
|
|
203533
203539
|
data: {
|
|
@@ -203913,7 +203919,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
203913
203919
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
203914
203920
|
const pascalName = toPascal(baseName);
|
|
203915
203921
|
const vueRoot = config.vueDirectory;
|
|
203916
|
-
const hmrId = vueRoot ?
|
|
203922
|
+
const hmrId = vueRoot ? relative9(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
203917
203923
|
const cssKey = `${pascalName}CSS`;
|
|
203918
203924
|
const cssUrl = manifest[cssKey] || null;
|
|
203919
203925
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
@@ -205065,7 +205071,7 @@ var handleHTMLPageRequest = (pagePath) => file(pagePath);
|
|
|
205065
205071
|
var handleHTMXPageRequest = (pagePath) => file(pagePath);
|
|
205066
205072
|
// src/core/prepare.ts
|
|
205067
205073
|
import { readFileSync as readFileSync10 } from "fs";
|
|
205068
|
-
import { relative as
|
|
205074
|
+
import { relative as relative11, resolve as resolve23 } from "path";
|
|
205069
205075
|
|
|
205070
205076
|
// src/utils/loadConfig.ts
|
|
205071
205077
|
import { resolve } from "path";
|
|
@@ -205144,7 +205150,7 @@ var prepare = async (configOrPath) => {
|
|
|
205144
205150
|
})) {
|
|
205145
205151
|
if (file4.includes("/node_modules/"))
|
|
205146
205152
|
continue;
|
|
205147
|
-
const rel =
|
|
205153
|
+
const rel = relative11(process.cwd(), file4).replace(/\\/g, "/");
|
|
205148
205154
|
warmCache2(`${SRC_URL_PREFIX2}${rel}`);
|
|
205149
205155
|
}
|
|
205150
205156
|
}
|
|
@@ -205154,7 +205160,7 @@ var prepare = async (configOrPath) => {
|
|
|
205154
205160
|
if (key.endsWith("Index") && typeof result.manifest[key] === "string" && result.manifest[key].includes("/react/") && result.manifest[key].includes("/indexes/")) {
|
|
205155
205161
|
const fileName = `${key.replace(/Index$/, "")}.tsx`;
|
|
205156
205162
|
const srcPath = resolve23(devIndexDir, fileName);
|
|
205157
|
-
const rel =
|
|
205163
|
+
const rel = relative11(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
205158
205164
|
result.manifest[key] = `${SRC_URL_PREFIX2}${rel}`;
|
|
205159
205165
|
}
|
|
205160
205166
|
}
|
|
@@ -205324,5 +205330,5 @@ export {
|
|
|
205324
205330
|
ANGULAR_INIT_TIMEOUT_MS
|
|
205325
205331
|
};
|
|
205326
205332
|
|
|
205327
|
-
//# debugId=
|
|
205333
|
+
//# debugId=794680ED9EC0256F64756E2164756E21
|
|
205328
205334
|
//# sourceMappingURL=index.js.map
|