@absolutejs/absolute 0.19.0-beta.62 → 0.19.0-beta.64
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/.claude/settings.local.json +5 -1
- package/dist/build.js +56 -50
- package/dist/build.js.map +4 -4
- package/dist/cli/index.js +2 -1
- package/dist/dev/client/handlers/react.ts +57 -15
- package/dist/index.js +59 -53
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
- package/types/globals.d.ts +1 -0
|
@@ -216,7 +216,11 @@
|
|
|
216
216
|
"Bash(kill 870841)",
|
|
217
217
|
"Bash(sed -i 's/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.58\"\"\"\"/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.59\"\"\"\"/' package.json)",
|
|
218
218
|
"Bash(kill 881290)",
|
|
219
|
-
"Bash(sed -i 's/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.60\"\"\"\"/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.61\"\"\"\"/' package.json)"
|
|
219
|
+
"Bash(sed -i 's/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.60\"\"\"\"/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.61\"\"\"\"/' package.json)",
|
|
220
|
+
"Bash(kill 883998)",
|
|
221
|
+
"Bash(sed -i 's/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.61\"\"\"\"/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.62\"\"\"\"/' package.json)",
|
|
222
|
+
"Bash(kill 892052)",
|
|
223
|
+
"Bash(sed -i 's/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.62\"\"\"\"/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.63\"\"\"\"/' package.json)"
|
|
220
224
|
]
|
|
221
225
|
}
|
|
222
226
|
}
|
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");
|
|
@@ -160,6 +160,7 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
160
160
|
const hmrPreamble = isDev ? [
|
|
161
161
|
`window.__HMR_FRAMEWORK__ = "react";`,
|
|
162
162
|
`window.__REACT_COMPONENT_KEY__ = "${componentName}Index";`,
|
|
163
|
+
`window.__REACT_PAGE_MODULE__ = "/@src/${relative(process.cwd(), resolve(reactPagesDirectory, componentName + ".tsx")).replace(/\\\\/g, "/")}";`,
|
|
163
164
|
`import '${refreshSetupPath}';`,
|
|
164
165
|
`import '${hmrClientPath}';`,
|
|
165
166
|
`import { showErrorOverlay, hideErrorOverlay } from '${errorOverlayPath}';
|
|
@@ -866,7 +867,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
866
867
|
|
|
867
868
|
// src/build/angularLinkerPlugin.ts
|
|
868
869
|
import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
869
|
-
import { dirname as dirname2, join as join4, relative, resolve as resolve4 } from "path";
|
|
870
|
+
import { dirname as dirname2, join as join4, relative as relative2, resolve as resolve4 } from "path";
|
|
870
871
|
import { createHash } from "crypto";
|
|
871
872
|
var CACHE_DIR, angularLinkerPlugin;
|
|
872
873
|
var init_angularLinkerPlugin = __esm(() => {
|
|
@@ -909,7 +910,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
909
910
|
dirname: dirname2,
|
|
910
911
|
exists: existsSync7,
|
|
911
912
|
readFile: readFileSync3,
|
|
912
|
-
relative,
|
|
913
|
+
relative: relative2,
|
|
913
914
|
resolve: resolve4
|
|
914
915
|
},
|
|
915
916
|
linkerJitMode: false,
|
|
@@ -950,11 +951,11 @@ var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPath
|
|
|
950
951
|
const currentPaths = new Set(currentOutputPaths.map((path) => resolve5(path)));
|
|
951
952
|
const glob = new Glob4("**/*");
|
|
952
953
|
const removals = [];
|
|
953
|
-
for (const
|
|
954
|
-
const absolute = resolve5(buildPath,
|
|
954
|
+
for (const relative3 of glob.scanSync({ cwd: buildPath })) {
|
|
955
|
+
const absolute = resolve5(buildPath, relative3);
|
|
955
956
|
if (currentPaths.has(absolute))
|
|
956
957
|
continue;
|
|
957
|
-
if (!HASHED_FILE_PATTERN.test(
|
|
958
|
+
if (!HASHED_FILE_PATTERN.test(relative3))
|
|
958
959
|
continue;
|
|
959
960
|
removals.push(rm2(absolute, { force: true }));
|
|
960
961
|
}
|
|
@@ -1108,12 +1109,12 @@ var init_startupBanner = __esm(() => {
|
|
|
1108
1109
|
// src/utils/logger.ts
|
|
1109
1110
|
var colors2, frameworkColors, formatPath = (filePath) => {
|
|
1110
1111
|
const cwd = process.cwd();
|
|
1111
|
-
let
|
|
1112
|
-
|
|
1113
|
-
if (!
|
|
1114
|
-
|
|
1112
|
+
let relative3 = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
|
|
1113
|
+
relative3 = relative3.replace(/\\/g, "/");
|
|
1114
|
+
if (!relative3.startsWith("/")) {
|
|
1115
|
+
relative3 = `/${relative3}`;
|
|
1115
1116
|
}
|
|
1116
|
-
return
|
|
1117
|
+
return relative3;
|
|
1117
1118
|
}, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
|
|
1118
1119
|
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
1119
1120
|
const tag = `${colors2.cyan}[hmr]${colors2.reset}`;
|
|
@@ -1172,11 +1173,11 @@ var init_logger = __esm(() => {
|
|
|
1172
1173
|
});
|
|
1173
1174
|
|
|
1174
1175
|
// src/utils/validateSafePath.ts
|
|
1175
|
-
import { resolve as resolve6, relative as
|
|
1176
|
+
import { resolve as resolve6, relative as relative3 } from "path";
|
|
1176
1177
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
1177
1178
|
const absoluteBase = resolve6(baseDirectory);
|
|
1178
1179
|
const absoluteTarget = resolve6(baseDirectory, targetPath);
|
|
1179
|
-
const relativePath = normalizePath(
|
|
1180
|
+
const relativePath = normalizePath(relative3(absoluteBase, absoluteTarget));
|
|
1180
1181
|
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
1181
1182
|
throw new Error(`Unsafe path: ${targetPath}`);
|
|
1182
1183
|
}
|
|
@@ -1198,7 +1199,7 @@ import {
|
|
|
1198
1199
|
basename as basename2,
|
|
1199
1200
|
extname as extname2,
|
|
1200
1201
|
resolve as resolve7,
|
|
1201
|
-
relative as
|
|
1202
|
+
relative as relative4,
|
|
1202
1203
|
sep
|
|
1203
1204
|
} from "path";
|
|
1204
1205
|
import { env } from "process";
|
|
@@ -1262,7 +1263,7 @@ var resolveDevClientDir2 = () => {
|
|
|
1262
1263
|
const isModule = src.endsWith(".svelte.ts") || src.endsWith(".svelte.js");
|
|
1263
1264
|
const preprocessed = isModule ? raw : (await preprocess(raw, {})).code;
|
|
1264
1265
|
const transpiled = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler.transformSync(preprocessed) : preprocessed;
|
|
1265
|
-
const relDir = dirname3(
|
|
1266
|
+
const relDir = dirname3(relative4(svelteRoot, src)).replace(/\\/g, "/");
|
|
1266
1267
|
const baseName = basename2(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
1267
1268
|
const importPaths = Array.from(transpiled.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
1268
1269
|
const resolvedImports = await Promise.all(importPaths.map((importPath) => resolveSvelte(importPath, src)));
|
|
@@ -1281,7 +1282,7 @@ var resolveDevClientDir2 = () => {
|
|
|
1281
1282
|
}).js.code;
|
|
1282
1283
|
let code = raw2.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
1283
1284
|
if (mode === "client" && isDev) {
|
|
1284
|
-
const moduleKey = `/@src/${
|
|
1285
|
+
const moduleKey = `/@src/${relative4(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
1285
1286
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
1286
1287
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
1287
1288
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -1316,10 +1317,10 @@ var resolveDevClientDir2 = () => {
|
|
|
1316
1317
|
};
|
|
1317
1318
|
const roots = await Promise.all(entryPoints.map(build));
|
|
1318
1319
|
await Promise.all(roots.map(async ({ client }) => {
|
|
1319
|
-
const relClientDir = dirname3(
|
|
1320
|
+
const relClientDir = dirname3(relative4(clientDir, client));
|
|
1320
1321
|
const name = basename2(client, extname2(client));
|
|
1321
1322
|
const indexPath = join6(indexDir, relClientDir, `${name}.js`);
|
|
1322
|
-
const importRaw =
|
|
1323
|
+
const importRaw = relative4(dirname3(indexPath), client).split(sep).join("/");
|
|
1323
1324
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
1324
1325
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
1325
1326
|
import "${hmrClientPath3}";
|
|
@@ -1359,7 +1360,7 @@ if (typeof window !== "undefined") {
|
|
|
1359
1360
|
return {
|
|
1360
1361
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
1361
1362
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
1362
|
-
const rel = dirname3(
|
|
1363
|
+
const rel = dirname3(relative4(clientDir, client));
|
|
1363
1364
|
return join6(indexDir, rel, basename2(client));
|
|
1364
1365
|
}),
|
|
1365
1366
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
@@ -1384,7 +1385,7 @@ __export(exports_compileVue, {
|
|
|
1384
1385
|
});
|
|
1385
1386
|
import { existsSync as existsSync9 } from "fs";
|
|
1386
1387
|
import { mkdir as mkdir2 } from "fs/promises";
|
|
1387
|
-
import { basename as basename3, dirname as dirname4, join as join7, relative as
|
|
1388
|
+
import { basename as basename3, dirname as dirname4, join as join7, relative as relative5, resolve as resolve8 } from "path";
|
|
1388
1389
|
var {file: file2, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
1389
1390
|
var resolveDevClientDir3 = () => {
|
|
1390
1391
|
const fromSource = resolve8(import.meta.dir, "../dev/client");
|
|
@@ -1429,7 +1430,7 @@ var resolveDevClientDir3 = () => {
|
|
|
1429
1430
|
return "template-only";
|
|
1430
1431
|
}
|
|
1431
1432
|
return "full";
|
|
1432
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
1433
|
+
}, 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) => {
|
|
1433
1434
|
if (filePath.endsWith(".vue"))
|
|
1434
1435
|
return filePath.replace(/\.vue$/, ".js");
|
|
1435
1436
|
if (filePath.endsWith(".ts"))
|
|
@@ -1456,7 +1457,7 @@ var resolveDevClientDir3 = () => {
|
|
|
1456
1457
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
1457
1458
|
if (cachedResult)
|
|
1458
1459
|
return cachedResult;
|
|
1459
|
-
const relativeFilePath =
|
|
1460
|
+
const relativeFilePath = relative5(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
1460
1461
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
1461
1462
|
const fileBaseName = basename3(sourceFilePath, ".vue");
|
|
1462
1463
|
const componentId = toKebab(fileBaseName);
|
|
@@ -1585,7 +1586,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
1585
1586
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
1586
1587
|
const entryBaseName = basename3(entryPath, ".vue");
|
|
1587
1588
|
const indexOutputFile = join7(indexOutputDir, `${entryBaseName}.js`);
|
|
1588
|
-
const clientOutputFile = join7(clientOutputDir,
|
|
1589
|
+
const clientOutputFile = join7(clientOutputDir, relative5(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
1589
1590
|
await mkdir2(dirname4(indexOutputFile), { recursive: true });
|
|
1590
1591
|
const vueHmrImports = isDev ? [
|
|
1591
1592
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -1593,7 +1594,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
1593
1594
|
] : [];
|
|
1594
1595
|
await write2(indexOutputFile, [
|
|
1595
1596
|
...vueHmrImports,
|
|
1596
|
-
`import Comp from "${
|
|
1597
|
+
`import Comp from "${relative5(dirname4(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
1597
1598
|
'import { createSSRApp, createApp } from "vue";',
|
|
1598
1599
|
"",
|
|
1599
1600
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -1693,7 +1694,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
1693
1694
|
await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
|
|
1694
1695
|
const sourceCode = await file2(tsPath).text();
|
|
1695
1696
|
const transpiledCode = transpiler2.transformSync(sourceCode);
|
|
1696
|
-
const relativeJsPath =
|
|
1697
|
+
const relativeJsPath = relative5(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
1697
1698
|
const outClientPath = join7(clientOutputDir, relativeJsPath);
|
|
1698
1699
|
const outServerPath = join7(serverOutputDir, relativeJsPath);
|
|
1699
1700
|
await mkdir2(dirname4(outClientPath), { recursive: true });
|
|
@@ -10583,11 +10584,11 @@ ${lanes.join(`
|
|
|
10583
10584
|
return toComponents;
|
|
10584
10585
|
}
|
|
10585
10586
|
const components = toComponents.slice(start);
|
|
10586
|
-
const
|
|
10587
|
+
const relative6 = [];
|
|
10587
10588
|
for (;start < fromComponents.length; start++) {
|
|
10588
|
-
|
|
10589
|
+
relative6.push("..");
|
|
10589
10590
|
}
|
|
10590
|
-
return ["", ...
|
|
10591
|
+
return ["", ...relative6, ...components];
|
|
10591
10592
|
}
|
|
10592
10593
|
function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) {
|
|
10593
10594
|
Debug.assert(getRootLength(fromDirectory) > 0 === getRootLength(to) > 0, "Paths must either both be absolute or both be relative");
|
|
@@ -47883,9 +47884,9 @@ ${lanes.join(`
|
|
|
47883
47884
|
if (!startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) {
|
|
47884
47885
|
return;
|
|
47885
47886
|
}
|
|
47886
|
-
const
|
|
47887
|
+
const relative6 = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName);
|
|
47887
47888
|
for (const symlinkDirectory of symlinkDirectories) {
|
|
47888
|
-
const option = resolvePath(symlinkDirectory,
|
|
47889
|
+
const option = resolvePath(symlinkDirectory, relative6);
|
|
47889
47890
|
const result2 = cb(option, target === referenceRedirect);
|
|
47890
47891
|
shouldFilterIgnoredPaths = true;
|
|
47891
47892
|
if (result2)
|
|
@@ -170451,7 +170452,7 @@ __export(exports_compileAngular, {
|
|
|
170451
170452
|
compileAngular: () => compileAngular
|
|
170452
170453
|
});
|
|
170453
170454
|
import { existsSync as existsSync10, readFileSync as readFileSync4, promises as fs } from "fs";
|
|
170454
|
-
import { join as join8, basename as basename4, sep as sep2, dirname as dirname5, resolve as resolve9, relative as
|
|
170455
|
+
import { join as join8, basename as basename4, sep as sep2, dirname as dirname5, resolve as resolve9, relative as relative6 } from "path";
|
|
170455
170456
|
import { createHash as createHash2 } from "crypto";
|
|
170456
170457
|
var import_typescript, computeConfigHash = () => {
|
|
170457
170458
|
try {
|
|
@@ -170760,7 +170761,7 @@ export default ${componentClassName};
|
|
|
170760
170761
|
await fs.writeFile(ssrDepsFile, ssrDepsContent, "utf-8");
|
|
170761
170762
|
}
|
|
170762
170763
|
await fs.writeFile(rawServerFile, rewritten, "utf-8");
|
|
170763
|
-
const relativePath =
|
|
170764
|
+
const relativePath = relative6(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
170764
170765
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
170765
170766
|
const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
|
|
170766
170767
|
import "${hmrRuntimePath}";
|
|
@@ -171139,7 +171140,7 @@ import {
|
|
|
171139
171140
|
rmSync,
|
|
171140
171141
|
writeFileSync as writeFileSync3
|
|
171141
171142
|
} from "fs";
|
|
171142
|
-
import { basename as basename5, join as join13, relative as
|
|
171143
|
+
import { basename as basename5, join as join13, relative as relative7, resolve as resolve10 } from "path";
|
|
171143
171144
|
import { cwd, env as env2, exit } from "process";
|
|
171144
171145
|
var {build: bunBuild6, Glob: Glob5 } = globalThis.Bun;
|
|
171145
171146
|
var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental, throwOnError) => {
|
|
@@ -171704,7 +171705,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171704
171705
|
const devIndexDir = join13(buildPath, "_src_indexes");
|
|
171705
171706
|
mkdirSync8(devIndexDir, { recursive: true });
|
|
171706
171707
|
const indexFiles = readDir(reactIndexesPath).filter((f) => f.endsWith(".tsx"));
|
|
171707
|
-
const pagesRel =
|
|
171708
|
+
const pagesRel = relative7(process.cwd(), resolve10(reactPagesPath)).replace(/\\/g, "/");
|
|
171708
171709
|
for (const file3 of indexFiles) {
|
|
171709
171710
|
let content = readFileSync5(join13(reactIndexesPath, file3), "utf-8");
|
|
171710
171711
|
content = content.replace(/from\s*['"]\.\.\/pages\/([^'"]+)['"]/g, `from '/@src/${pagesRel}/$1'`);
|
|
@@ -202344,7 +202345,7 @@ __export(exports_moduleServer, {
|
|
|
202344
202345
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
202345
202346
|
});
|
|
202346
202347
|
import { existsSync as existsSync13, readFileSync as readFileSync9, statSync } from "fs";
|
|
202347
|
-
import { basename as basename7, dirname as dirname7, extname as extname3, resolve as resolve17, relative as
|
|
202348
|
+
import { basename as basename7, dirname as dirname7, extname as extname3, resolve as resolve17, relative as relative8 } from "path";
|
|
202348
202349
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
202349
202350
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
202350
202351
|
const allExports = [];
|
|
@@ -202405,7 +202406,7 @@ ${stubs}
|
|
|
202405
202406
|
const fileDir = dirname7(filePath);
|
|
202406
202407
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => {
|
|
202407
202408
|
const absPath = resolve17(fileDir, relPath);
|
|
202408
|
-
const rel =
|
|
202409
|
+
const rel = relative8(projectRoot, absPath);
|
|
202409
202410
|
let srcPath = rel;
|
|
202410
202411
|
if (!extname3(srcPath)) {
|
|
202411
202412
|
const extensions = [
|
|
@@ -202426,19 +202427,19 @@ ${stubs}
|
|
|
202426
202427
|
}
|
|
202427
202428
|
if (extname3(srcPath) === ".svelte") {
|
|
202428
202429
|
const resolved = resolveSvelteModulePath(resolve17(projectRoot, srcPath));
|
|
202429
|
-
const resolvedRel =
|
|
202430
|
+
const resolvedRel = relative8(projectRoot, resolved);
|
|
202430
202431
|
srcPath = resolvedRel;
|
|
202431
202432
|
}
|
|
202432
202433
|
return `${prefix}${srcUrl(srcPath, projectRoot)}${suffix}`;
|
|
202433
202434
|
});
|
|
202434
202435
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => {
|
|
202435
202436
|
const absPath = resolve17(fileDir, relPath);
|
|
202436
|
-
const rel =
|
|
202437
|
+
const rel = relative8(projectRoot, absPath);
|
|
202437
202438
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
202438
202439
|
});
|
|
202439
202440
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => {
|
|
202440
202441
|
const absPath = resolve17(fileDir, relPath);
|
|
202441
|
-
const rel =
|
|
202442
|
+
const rel = relative8(projectRoot, absPath);
|
|
202442
202443
|
let srcPath = rel;
|
|
202443
202444
|
if (!extname3(srcPath)) {
|
|
202444
202445
|
const extensions = [
|
|
@@ -202462,10 +202463,10 @@ ${stubs}
|
|
|
202462
202463
|
});
|
|
202463
202464
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, (_match, prefix, absPath, _ext, suffix) => {
|
|
202464
202465
|
if (absPath.startsWith(projectRoot)) {
|
|
202465
|
-
const rel2 =
|
|
202466
|
+
const rel2 = relative8(projectRoot, absPath).replace(/\\/g, "/");
|
|
202466
202467
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
202467
202468
|
}
|
|
202468
|
-
const rel =
|
|
202469
|
+
const rel = relative8(projectRoot, absPath).replace(/\\/g, "/");
|
|
202469
202470
|
if (!rel.startsWith("..")) {
|
|
202470
202471
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
202471
202472
|
}
|
|
@@ -202507,7 +202508,7 @@ ${stubs}
|
|
|
202507
202508
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
202508
202509
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
202509
202510
|
` + transpiled;
|
|
202510
|
-
const relPath =
|
|
202511
|
+
const relPath = relative8(projectRoot, filePath).replace(/\\/g, "/");
|
|
202511
202512
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
202512
202513
|
return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
|
|
202513
202514
|
}, transformPlainFile = (filePath, projectRoot, rewriter) => {
|
|
@@ -202574,11 +202575,11 @@ ${stubs}
|
|
|
202574
202575
|
if (compiled.css?.code) {
|
|
202575
202576
|
const cssPath = `${filePath}.css`;
|
|
202576
202577
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
202577
|
-
const cssUrl = srcUrl(
|
|
202578
|
+
const cssUrl = srcUrl(relative8(projectRoot, cssPath), projectRoot);
|
|
202578
202579
|
code = `import "${cssUrl}";
|
|
202579
202580
|
${code}`;
|
|
202580
202581
|
}
|
|
202581
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
202582
|
+
const moduleUrl = `${SRC_PREFIX}${relative8(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
202582
202583
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
202583
202584
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
202584
202585
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
@@ -202642,7 +202643,7 @@ ${code}`;
|
|
|
202642
202643
|
}
|
|
202643
202644
|
code = tsTranspiler2.transformSync(code);
|
|
202644
202645
|
const hmrBase = vueDir ? resolve17(vueDir) : projectRoot;
|
|
202645
|
-
const hmrId =
|
|
202646
|
+
const hmrId = relative8(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
202646
202647
|
code = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
202647
202648
|
code += [
|
|
202648
202649
|
"",
|
|
@@ -202988,7 +202989,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
202988
202989
|
// src/dev/rebuildTrigger.ts
|
|
202989
202990
|
import { existsSync as existsSync14 } from "fs";
|
|
202990
202991
|
import { rm as rm8 } from "fs/promises";
|
|
202991
|
-
import { basename as basename8, relative as
|
|
202992
|
+
import { basename as basename8, relative as relative9, resolve as resolve20 } from "path";
|
|
202992
202993
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseErrorLocationFromMessage = (msg) => {
|
|
202993
202994
|
const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
|
|
202994
202995
|
if (pathLineCol) {
|
|
@@ -203422,7 +203423,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
203422
203423
|
}, getModuleUrl = async (pageFile) => {
|
|
203423
203424
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
203424
203425
|
invalidateModule2(pageFile);
|
|
203425
|
-
const rel =
|
|
203426
|
+
const rel = relative9(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
203426
203427
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
203427
203428
|
warmCache2(url);
|
|
203428
203429
|
return url;
|
|
@@ -203475,12 +203476,17 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
203475
203476
|
}
|
|
203476
203477
|
}
|
|
203477
203478
|
const pageModuleUrl = await getReactModuleUrl(broadcastFile);
|
|
203479
|
+
let dataModuleUrl;
|
|
203480
|
+
if (!isComponentFile && broadcastFile !== primaryFile) {
|
|
203481
|
+
dataModuleUrl = await getReactModuleUrl(primaryFile);
|
|
203482
|
+
}
|
|
203478
203483
|
if (pageModuleUrl) {
|
|
203479
203484
|
const serverDuration = Date.now() - startTime;
|
|
203480
|
-
state.lastHmrPath =
|
|
203485
|
+
state.lastHmrPath = relative9(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
203481
203486
|
state.lastHmrFramework = "react";
|
|
203482
203487
|
broadcastToClients(state, {
|
|
203483
203488
|
data: {
|
|
203489
|
+
dataModuleUrl,
|
|
203484
203490
|
framework: "react",
|
|
203485
203491
|
hasComponentChanges: true,
|
|
203486
203492
|
hasCSSChanges: false,
|
|
@@ -203863,7 +203869,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
203863
203869
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
203864
203870
|
const pascalName = toPascal(baseName);
|
|
203865
203871
|
const vueRoot = config.vueDirectory;
|
|
203866
|
-
const hmrId = vueRoot ?
|
|
203872
|
+
const hmrId = vueRoot ? relative9(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
203867
203873
|
const cssKey = `${pascalName}CSS`;
|
|
203868
203874
|
const cssUrl = manifest[cssKey] || null;
|
|
203869
203875
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
@@ -204856,5 +204862,5 @@ export {
|
|
|
204856
204862
|
build
|
|
204857
204863
|
};
|
|
204858
204864
|
|
|
204859
|
-
//# debugId=
|
|
204865
|
+
//# debugId=97FF81EE2B472F2864756E2164756E21
|
|
204860
204866
|
//# sourceMappingURL=build.js.map
|