@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.
- package/.absolutejs/tsconfig.tsbuildinfo +1 -1
- package/dist/build.js +53 -56
- package/dist/build.js.map +4 -4
- package/dist/dev/client/handlers/react.ts +9 -3
- package/dist/index.js +56 -59
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -123,7 +123,7 @@ __export(exports_generateReactIndexes, {
|
|
|
123
123
|
});
|
|
124
124
|
import { existsSync, mkdirSync } from "fs";
|
|
125
125
|
import { readdir, rm, writeFile } from "fs/promises";
|
|
126
|
-
import { basename, join, resolve } from "path";
|
|
126
|
+
import { basename, join, relative, resolve } from "path";
|
|
127
127
|
var {Glob } = globalThis.Bun;
|
|
128
128
|
var indexContentCache, resolveDevClientDir = () => {
|
|
129
129
|
const fromSource = resolve(import.meta.dir, "../dev/client");
|
|
@@ -426,8 +426,8 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
426
426
|
` if (origOnMessage) origOnMessage.call(this, event);`,
|
|
427
427
|
` try {`,
|
|
428
428
|
` const msg = JSON.parse(event.data);`,
|
|
429
|
-
` if (msg.type === 'react-update' && msg.data?.
|
|
430
|
-
` const url =
|
|
429
|
+
` if (msg.type === 'react-update' && msg.data?.primarySource && !msg.data.primarySource.endsWith('.tsx') && !msg.data.primarySource.endsWith('.jsx')) {`,
|
|
430
|
+
` const url = "/@src/${relative(process.cwd(), resolve(reactPagesDirectory, componentName + ".tsx")).replace(/\\/g, "/")}";`,
|
|
431
431
|
` const start = performance.now();`,
|
|
432
432
|
` import(url + '?t=' + Date.now()).then(mod => {`,
|
|
433
433
|
` const Comp = mod.${componentName} || mod.default;`,
|
|
@@ -901,7 +901,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
901
901
|
|
|
902
902
|
// src/build/angularLinkerPlugin.ts
|
|
903
903
|
import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
904
|
-
import { dirname as dirname2, join as join4, relative, resolve as resolve4 } from "path";
|
|
904
|
+
import { dirname as dirname2, join as join4, relative as relative2, resolve as resolve4 } from "path";
|
|
905
905
|
import { createHash } from "crypto";
|
|
906
906
|
var CACHE_DIR, angularLinkerPlugin;
|
|
907
907
|
var init_angularLinkerPlugin = __esm(() => {
|
|
@@ -944,7 +944,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
944
944
|
dirname: dirname2,
|
|
945
945
|
exists: existsSync7,
|
|
946
946
|
readFile: readFileSync3,
|
|
947
|
-
relative,
|
|
947
|
+
relative: relative2,
|
|
948
948
|
resolve: resolve4
|
|
949
949
|
},
|
|
950
950
|
linkerJitMode: false,
|
|
@@ -985,11 +985,11 @@ var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPath
|
|
|
985
985
|
const currentPaths = new Set(currentOutputPaths.map((path) => resolve5(path)));
|
|
986
986
|
const glob = new Glob4("**/*");
|
|
987
987
|
const removals = [];
|
|
988
|
-
for (const
|
|
989
|
-
const absolute = resolve5(buildPath,
|
|
988
|
+
for (const relative3 of glob.scanSync({ cwd: buildPath })) {
|
|
989
|
+
const absolute = resolve5(buildPath, relative3);
|
|
990
990
|
if (currentPaths.has(absolute))
|
|
991
991
|
continue;
|
|
992
|
-
if (!HASHED_FILE_PATTERN.test(
|
|
992
|
+
if (!HASHED_FILE_PATTERN.test(relative3))
|
|
993
993
|
continue;
|
|
994
994
|
removals.push(rm2(absolute, { force: true }));
|
|
995
995
|
}
|
|
@@ -1143,12 +1143,12 @@ var init_startupBanner = __esm(() => {
|
|
|
1143
1143
|
// src/utils/logger.ts
|
|
1144
1144
|
var colors2, frameworkColors, formatPath = (filePath) => {
|
|
1145
1145
|
const cwd = process.cwd();
|
|
1146
|
-
let
|
|
1147
|
-
|
|
1148
|
-
if (!
|
|
1149
|
-
|
|
1146
|
+
let relative3 = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
|
|
1147
|
+
relative3 = relative3.replace(/\\/g, "/");
|
|
1148
|
+
if (!relative3.startsWith("/")) {
|
|
1149
|
+
relative3 = `/${relative3}`;
|
|
1150
1150
|
}
|
|
1151
|
-
return
|
|
1151
|
+
return relative3;
|
|
1152
1152
|
}, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
|
|
1153
1153
|
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
1154
1154
|
const tag = `${colors2.cyan}[hmr]${colors2.reset}`;
|
|
@@ -1207,11 +1207,11 @@ var init_logger = __esm(() => {
|
|
|
1207
1207
|
});
|
|
1208
1208
|
|
|
1209
1209
|
// src/utils/validateSafePath.ts
|
|
1210
|
-
import { resolve as resolve6, relative as
|
|
1210
|
+
import { resolve as resolve6, relative as relative3 } from "path";
|
|
1211
1211
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
1212
1212
|
const absoluteBase = resolve6(baseDirectory);
|
|
1213
1213
|
const absoluteTarget = resolve6(baseDirectory, targetPath);
|
|
1214
|
-
const relativePath = normalizePath(
|
|
1214
|
+
const relativePath = normalizePath(relative3(absoluteBase, absoluteTarget));
|
|
1215
1215
|
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
1216
1216
|
throw new Error(`Unsafe path: ${targetPath}`);
|
|
1217
1217
|
}
|
|
@@ -1233,7 +1233,7 @@ import {
|
|
|
1233
1233
|
basename as basename2,
|
|
1234
1234
|
extname as extname2,
|
|
1235
1235
|
resolve as resolve7,
|
|
1236
|
-
relative as
|
|
1236
|
+
relative as relative4,
|
|
1237
1237
|
sep
|
|
1238
1238
|
} from "path";
|
|
1239
1239
|
import { env } from "process";
|
|
@@ -1297,7 +1297,7 @@ var resolveDevClientDir2 = () => {
|
|
|
1297
1297
|
const isModule = src.endsWith(".svelte.ts") || src.endsWith(".svelte.js");
|
|
1298
1298
|
const preprocessed = isModule ? raw : (await preprocess(raw, {})).code;
|
|
1299
1299
|
const transpiled = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler.transformSync(preprocessed) : preprocessed;
|
|
1300
|
-
const relDir = dirname3(
|
|
1300
|
+
const relDir = dirname3(relative4(svelteRoot, src)).replace(/\\/g, "/");
|
|
1301
1301
|
const baseName = basename2(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
1302
1302
|
const importPaths = Array.from(transpiled.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
1303
1303
|
const resolvedImports = await Promise.all(importPaths.map((importPath) => resolveSvelte(importPath, src)));
|
|
@@ -1316,7 +1316,7 @@ var resolveDevClientDir2 = () => {
|
|
|
1316
1316
|
}).js.code;
|
|
1317
1317
|
let code = raw2.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
1318
1318
|
if (mode === "client" && isDev) {
|
|
1319
|
-
const moduleKey = `/@src/${
|
|
1319
|
+
const moduleKey = `/@src/${relative4(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
1320
1320
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
1321
1321
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
1322
1322
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -1351,10 +1351,10 @@ var resolveDevClientDir2 = () => {
|
|
|
1351
1351
|
};
|
|
1352
1352
|
const roots = await Promise.all(entryPoints.map(build));
|
|
1353
1353
|
await Promise.all(roots.map(async ({ client }) => {
|
|
1354
|
-
const relClientDir = dirname3(
|
|
1354
|
+
const relClientDir = dirname3(relative4(clientDir, client));
|
|
1355
1355
|
const name = basename2(client, extname2(client));
|
|
1356
1356
|
const indexPath = join6(indexDir, relClientDir, `${name}.js`);
|
|
1357
|
-
const importRaw =
|
|
1357
|
+
const importRaw = relative4(dirname3(indexPath), client).split(sep).join("/");
|
|
1358
1358
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
1359
1359
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
1360
1360
|
import "${hmrClientPath3}";
|
|
@@ -1394,7 +1394,7 @@ if (typeof window !== "undefined") {
|
|
|
1394
1394
|
return {
|
|
1395
1395
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
1396
1396
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
1397
|
-
const rel = dirname3(
|
|
1397
|
+
const rel = dirname3(relative4(clientDir, client));
|
|
1398
1398
|
return join6(indexDir, rel, basename2(client));
|
|
1399
1399
|
}),
|
|
1400
1400
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
@@ -1419,7 +1419,7 @@ __export(exports_compileVue, {
|
|
|
1419
1419
|
});
|
|
1420
1420
|
import { existsSync as existsSync9 } from "fs";
|
|
1421
1421
|
import { mkdir as mkdir2 } from "fs/promises";
|
|
1422
|
-
import { basename as basename3, dirname as dirname4, join as join7, relative as
|
|
1422
|
+
import { basename as basename3, dirname as dirname4, join as join7, relative as relative5, resolve as resolve8 } from "path";
|
|
1423
1423
|
var {file: file2, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
1424
1424
|
var resolveDevClientDir3 = () => {
|
|
1425
1425
|
const fromSource = resolve8(import.meta.dir, "../dev/client");
|
|
@@ -1464,7 +1464,7 @@ var resolveDevClientDir3 = () => {
|
|
|
1464
1464
|
return "template-only";
|
|
1465
1465
|
}
|
|
1466
1466
|
return "full";
|
|
1467
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
1467
|
+
}, 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) => {
|
|
1468
1468
|
if (filePath.endsWith(".vue"))
|
|
1469
1469
|
return filePath.replace(/\.vue$/, ".js");
|
|
1470
1470
|
if (filePath.endsWith(".ts"))
|
|
@@ -1491,7 +1491,7 @@ var resolveDevClientDir3 = () => {
|
|
|
1491
1491
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
1492
1492
|
if (cachedResult)
|
|
1493
1493
|
return cachedResult;
|
|
1494
|
-
const relativeFilePath =
|
|
1494
|
+
const relativeFilePath = relative5(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
1495
1495
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
1496
1496
|
const fileBaseName = basename3(sourceFilePath, ".vue");
|
|
1497
1497
|
const componentId = toKebab(fileBaseName);
|
|
@@ -1620,7 +1620,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
1620
1620
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
1621
1621
|
const entryBaseName = basename3(entryPath, ".vue");
|
|
1622
1622
|
const indexOutputFile = join7(indexOutputDir, `${entryBaseName}.js`);
|
|
1623
|
-
const clientOutputFile = join7(clientOutputDir,
|
|
1623
|
+
const clientOutputFile = join7(clientOutputDir, relative5(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
1624
1624
|
await mkdir2(dirname4(indexOutputFile), { recursive: true });
|
|
1625
1625
|
const vueHmrImports = isDev ? [
|
|
1626
1626
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -1628,7 +1628,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
1628
1628
|
] : [];
|
|
1629
1629
|
await write2(indexOutputFile, [
|
|
1630
1630
|
...vueHmrImports,
|
|
1631
|
-
`import Comp from "${
|
|
1631
|
+
`import Comp from "${relative5(dirname4(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
1632
1632
|
'import { createSSRApp, createApp } from "vue";',
|
|
1633
1633
|
"",
|
|
1634
1634
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -1728,7 +1728,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
1728
1728
|
await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
|
|
1729
1729
|
const sourceCode = await file2(tsPath).text();
|
|
1730
1730
|
const transpiledCode = transpiler2.transformSync(sourceCode);
|
|
1731
|
-
const relativeJsPath =
|
|
1731
|
+
const relativeJsPath = relative5(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
1732
1732
|
const outClientPath = join7(clientOutputDir, relativeJsPath);
|
|
1733
1733
|
const outServerPath = join7(serverOutputDir, relativeJsPath);
|
|
1734
1734
|
await mkdir2(dirname4(outClientPath), { recursive: true });
|
|
@@ -10618,11 +10618,11 @@ ${lanes.join(`
|
|
|
10618
10618
|
return toComponents;
|
|
10619
10619
|
}
|
|
10620
10620
|
const components = toComponents.slice(start);
|
|
10621
|
-
const
|
|
10621
|
+
const relative6 = [];
|
|
10622
10622
|
for (;start < fromComponents.length; start++) {
|
|
10623
|
-
|
|
10623
|
+
relative6.push("..");
|
|
10624
10624
|
}
|
|
10625
|
-
return ["", ...
|
|
10625
|
+
return ["", ...relative6, ...components];
|
|
10626
10626
|
}
|
|
10627
10627
|
function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) {
|
|
10628
10628
|
Debug.assert(getRootLength(fromDirectory) > 0 === getRootLength(to) > 0, "Paths must either both be absolute or both be relative");
|
|
@@ -47918,9 +47918,9 @@ ${lanes.join(`
|
|
|
47918
47918
|
if (!startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) {
|
|
47919
47919
|
return;
|
|
47920
47920
|
}
|
|
47921
|
-
const
|
|
47921
|
+
const relative6 = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName);
|
|
47922
47922
|
for (const symlinkDirectory of symlinkDirectories) {
|
|
47923
|
-
const option = resolvePath(symlinkDirectory,
|
|
47923
|
+
const option = resolvePath(symlinkDirectory, relative6);
|
|
47924
47924
|
const result2 = cb(option, target === referenceRedirect);
|
|
47925
47925
|
shouldFilterIgnoredPaths = true;
|
|
47926
47926
|
if (result2)
|
|
@@ -170486,7 +170486,7 @@ __export(exports_compileAngular, {
|
|
|
170486
170486
|
compileAngular: () => compileAngular
|
|
170487
170487
|
});
|
|
170488
170488
|
import { existsSync as existsSync10, readFileSync as readFileSync4, promises as fs } from "fs";
|
|
170489
|
-
import { join as join8, basename as basename4, sep as sep2, dirname as dirname5, resolve as resolve9, relative as
|
|
170489
|
+
import { join as join8, basename as basename4, sep as sep2, dirname as dirname5, resolve as resolve9, relative as relative6 } from "path";
|
|
170490
170490
|
import { createHash as createHash2 } from "crypto";
|
|
170491
170491
|
var import_typescript, computeConfigHash = () => {
|
|
170492
170492
|
try {
|
|
@@ -170795,7 +170795,7 @@ export default ${componentClassName};
|
|
|
170795
170795
|
await fs.writeFile(ssrDepsFile, ssrDepsContent, "utf-8");
|
|
170796
170796
|
}
|
|
170797
170797
|
await fs.writeFile(rawServerFile, rewritten, "utf-8");
|
|
170798
|
-
const relativePath =
|
|
170798
|
+
const relativePath = relative6(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
170799
170799
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
170800
170800
|
const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
|
|
170801
170801
|
import "${hmrRuntimePath}";
|
|
@@ -171174,7 +171174,7 @@ import {
|
|
|
171174
171174
|
rmSync,
|
|
171175
171175
|
writeFileSync as writeFileSync3
|
|
171176
171176
|
} from "fs";
|
|
171177
|
-
import { basename as basename5, join as join13, relative as
|
|
171177
|
+
import { basename as basename5, join as join13, relative as relative7, resolve as resolve10 } from "path";
|
|
171178
171178
|
import { cwd, env as env2, exit } from "process";
|
|
171179
171179
|
var {build: bunBuild6, Glob: Glob5 } = globalThis.Bun;
|
|
171180
171180
|
var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental, throwOnError) => {
|
|
@@ -171739,7 +171739,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171739
171739
|
const devIndexDir = join13(buildPath, "_src_indexes");
|
|
171740
171740
|
mkdirSync8(devIndexDir, { recursive: true });
|
|
171741
171741
|
const indexFiles = readDir(reactIndexesPath).filter((f) => f.endsWith(".tsx"));
|
|
171742
|
-
const pagesRel =
|
|
171742
|
+
const pagesRel = relative7(process.cwd(), resolve10(reactPagesPath)).replace(/\\/g, "/");
|
|
171743
171743
|
for (const file3 of indexFiles) {
|
|
171744
171744
|
let content = readFileSync5(join13(reactIndexesPath, file3), "utf-8");
|
|
171745
171745
|
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 resolve17, relative as
|
|
202400
|
+
import { basename as basename7, dirname as dirname7, extname as extname3, resolve as resolve17, 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 = resolve17(fileDir, relPath);
|
|
202463
|
-
const rel =
|
|
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(resolve17(projectRoot, srcPath));
|
|
202484
|
-
const resolvedRel =
|
|
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 = resolve17(fileDir, relPath);
|
|
202491
|
-
const rel =
|
|
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 = resolve17(fileDir, relPath);
|
|
202496
|
-
const rel =
|
|
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 =
|
|
202520
|
+
const rel2 = relative8(projectRoot, absPath).replace(/\\/g, "/");
|
|
202521
202521
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
202522
202522
|
}
|
|
202523
|
-
const rel =
|
|
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 =
|
|
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(
|
|
202632
|
+
const cssUrl = srcUrl(relative8(projectRoot, cssPath), projectRoot);
|
|
202633
202633
|
code = `import "${cssUrl}";
|
|
202634
202634
|
${code}`;
|
|
202635
202635
|
}
|
|
202636
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
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 ? resolve17(vueDir) : projectRoot;
|
|
202700
|
-
const hmrId =
|
|
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
|
|
203063
|
+
import { basename as basename8, relative as relative9, resolve as resolve20 } 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 =
|
|
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 file3 of reactFiles) {
|
|
203521
203521
|
invalidateModule2(file3);
|
|
203522
203522
|
}
|
|
203523
|
-
const
|
|
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 =
|
|
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 ?
|
|
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));
|
|
@@ -204906,5 +204903,5 @@ export {
|
|
|
204906
204903
|
build
|
|
204907
204904
|
};
|
|
204908
204905
|
|
|
204909
|
-
//# debugId=
|
|
204906
|
+
//# debugId=06A4EF6FCFC8E3D664756E2164756E21
|
|
204910
204907
|
//# sourceMappingURL=build.js.map
|