@absolutejs/absolute 0.20.0-beta.141 → 0.20.0-beta.143
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/CHANGELOG.md +11 -0
- package/changelog.json +21 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/build.js +245 -164
- package/dist/build.js.map +17 -14
- package/dist/cli/{buildDepVendor-bpac1bhq.js → buildDepVendor-e2zz9x78.js} +5 -4
- package/dist/cli/{dev-4ps2yg1z.js → dev-e4w5nq6y.js} +21 -8
- package/dist/cli/index-6vpdsqa1.js +50 -0
- package/dist/cli/index.js +1 -1
- package/dist/dev/serverBootstrap.js +64 -31
- package/dist/index.js +242 -161
- package/dist/index.js.map +17 -14
- package/dist/mobile/remoteMacAgentEntry.js +1 -1
- package/dist/src/build/importFromProject.d.ts +1 -0
- package/dist/src/build/workspacePackages.d.ts +2 -0
- package/dist/src/dev/hot/plugin.d.ts +5 -0
- package/dist/src/dev/srcPath.d.ts +4 -0
- package/package.json +2 -2
- package/dist/cli/index-65kqn88a.js +0 -8
package/dist/build.js
CHANGED
|
@@ -11676,6 +11676,17 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
11676
11676
|
emberVendorPaths = paths;
|
|
11677
11677
|
};
|
|
11678
11678
|
|
|
11679
|
+
// src/dev/srcPath.ts
|
|
11680
|
+
var UP_SEGMENT = "@up", PARENT_SEGMENT = "..", mapLeading = (path, source, target) => {
|
|
11681
|
+
const segments = path.split("/");
|
|
11682
|
+
let index = 0;
|
|
11683
|
+
while (segments[index] === source) {
|
|
11684
|
+
segments[index] = target;
|
|
11685
|
+
index += 1;
|
|
11686
|
+
}
|
|
11687
|
+
return segments.join("/");
|
|
11688
|
+
}, decodeSrcPath = (srcPath) => mapLeading(srcPath, UP_SEGMENT, PARENT_SEGMENT), encodeSrcPath = (relativePath) => mapLeading(relativePath.replace(/\\/g, "/"), PARENT_SEGMENT, UP_SEGMENT);
|
|
11689
|
+
|
|
11679
11690
|
// src/dev/lazyPages.ts
|
|
11680
11691
|
import { existsSync as existsSync18 } from "fs";
|
|
11681
11692
|
import { basename as basename6, extname as extname7, isAbsolute as isAbsolute3, join as join20, resolve as resolve14 } from "path";
|
|
@@ -11683,7 +11694,7 @@ var PAGE_EXTENSIONS, KEY_SUFFIXES, SRC_URL_PREFIX = "/@src/", isTruthyFlag = (va
|
|
|
11683
11694
|
const extension = PAGE_EXTENSIONS[framework].find((ext) => existsSync18(join20(dir, `${name}${ext}`)));
|
|
11684
11695
|
return extension === undefined ? undefined : toDevPageEntry(framework, join20(dir, `${name}${extension}`));
|
|
11685
11696
|
}, resolveSourcePath = (keyOrPath) => {
|
|
11686
|
-
const stripped = keyOrPath.startsWith(SRC_URL_PREFIX) ? keyOrPath.slice(SRC_URL_PREFIX.length).split("?")[0] ?? "" : keyOrPath;
|
|
11697
|
+
const stripped = keyOrPath.startsWith(SRC_URL_PREFIX) ? decodeSrcPath(keyOrPath.slice(SRC_URL_PREFIX.length).split("?")[0] ?? "") : keyOrPath;
|
|
11687
11698
|
return isAbsolute3(stripped) ? stripped : resolve14(stripped);
|
|
11688
11699
|
}, firstDefined = (candidates, lookup) => {
|
|
11689
11700
|
for (const candidate of candidates) {
|
|
@@ -21746,7 +21757,7 @@ var init_compileAngular = __esm(() => {
|
|
|
21746
21757
|
|
|
21747
21758
|
// node_modules/content-tag/pkg/node/content_tag.cjs
|
|
21748
21759
|
var require_content_tag = __commonJS(function(exports, module) {
|
|
21749
|
-
var __dirname = "/home/alexkahn/abs/absolutejs
|
|
21760
|
+
var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/content-tag/pkg/node";
|
|
21750
21761
|
var imports = {};
|
|
21751
21762
|
imports["__wbindgen_placeholder__"] = exports;
|
|
21752
21763
|
var wasm;
|
|
@@ -22413,6 +22424,15 @@ var init_compileEmber = __esm(() => {
|
|
|
22413
22424
|
});
|
|
22414
22425
|
});
|
|
22415
22426
|
|
|
22427
|
+
// src/build/importFromProject.ts
|
|
22428
|
+
var importFromProject = (specifier, projectRoot = process.cwd()) => {
|
|
22429
|
+
let target = specifier;
|
|
22430
|
+
try {
|
|
22431
|
+
target = Bun.resolveSync(specifier, projectRoot);
|
|
22432
|
+
} catch {}
|
|
22433
|
+
return import(target);
|
|
22434
|
+
};
|
|
22435
|
+
|
|
22416
22436
|
// src/build/buildReactVendor.ts
|
|
22417
22437
|
import { existsSync as existsSync33, mkdirSync as mkdirSync8 } from "fs";
|
|
22418
22438
|
import { join as join42, resolve as resolve32 } from "path";
|
|
@@ -22452,7 +22472,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
22452
22472
|
return `export * from '${reactRefreshRuntimePath}';
|
|
22453
22473
|
`;
|
|
22454
22474
|
}
|
|
22455
|
-
const mod = await
|
|
22475
|
+
const mod = await importFromProject(specifier);
|
|
22456
22476
|
const exportNames = Object.keys(mod).filter((key) => key !== "default" && key !== "__esModule");
|
|
22457
22477
|
const lines = [];
|
|
22458
22478
|
if (exportNames.length > 0) {
|
|
@@ -22509,7 +22529,7 @@ var init_buildReactVendor = __esm(() => {
|
|
|
22509
22529
|
|
|
22510
22530
|
// src/build/vendorEntrySource.ts
|
|
22511
22531
|
var RESERVED_KEYS, VALID_IDENTIFIER, generateVendorEntrySource = async (specifier) => {
|
|
22512
|
-
const mod = await
|
|
22532
|
+
const mod = await importFromProject(specifier);
|
|
22513
22533
|
const exportKeys = Object.keys(mod).filter((key) => !RESERVED_KEYS.has(key) && VALID_IDENTIFIER.test(key));
|
|
22514
22534
|
const localBindings = exportKeys.map((key, i) => `const __abs_${i} = __abs_ns[${JSON.stringify(key)}];`).join(`
|
|
22515
22535
|
`);
|
|
@@ -22518,7 +22538,7 @@ var RESERVED_KEYS, VALID_IDENTIFIER, generateVendorEntrySource = async (specifie
|
|
|
22518
22538
|
return `import * as __abs_ns from '${specifier}';
|
|
22519
22539
|
` + (localBindings ? `${localBindings}
|
|
22520
22540
|
` : "") + reExportClause + `export default __abs_ns.default;
|
|
22521
|
-
export const __ABSOLUTE_VENDOR_NAMESPACE__ = __abs_ns;
|
|
22541
|
+
` + `export const __ABSOLUTE_VENDOR_NAMESPACE__ = __abs_ns;
|
|
22522
22542
|
`;
|
|
22523
22543
|
};
|
|
22524
22544
|
var init_vendorEntrySource = __esm(() => {
|
|
@@ -24888,6 +24908,49 @@ var init_buildEmberVendor = __esm(() => {
|
|
|
24888
24908
|
]);
|
|
24889
24909
|
});
|
|
24890
24910
|
|
|
24911
|
+
// src/build/workspacePackages.ts
|
|
24912
|
+
import { readFileSync as readFileSync28, realpathSync as realpathSync3 } from "fs";
|
|
24913
|
+
import { join as join48, sep as sep6 } from "path";
|
|
24914
|
+
var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, projectRoot = process.cwd()) => {
|
|
24915
|
+
const key = `${projectRoot}\x00${specifier}`;
|
|
24916
|
+
const known = verdicts.get(key);
|
|
24917
|
+
if (known !== undefined)
|
|
24918
|
+
return known;
|
|
24919
|
+
let verdict = false;
|
|
24920
|
+
try {
|
|
24921
|
+
const resolved = realpathSync3(Bun.resolveSync(specifier, projectRoot));
|
|
24922
|
+
verdict = !resolved.includes(NODE_MODULES_SEGMENT);
|
|
24923
|
+
} catch {
|
|
24924
|
+
verdict = false;
|
|
24925
|
+
}
|
|
24926
|
+
verdicts.set(key, verdict);
|
|
24927
|
+
return verdict;
|
|
24928
|
+
}, workspacePackageDirs = (projectRoot = process.cwd()) => {
|
|
24929
|
+
let manifest;
|
|
24930
|
+
try {
|
|
24931
|
+
manifest = JSON.parse(readFileSync28(join48(projectRoot, "package.json"), "utf-8"));
|
|
24932
|
+
} catch {
|
|
24933
|
+
return [];
|
|
24934
|
+
}
|
|
24935
|
+
const names = ["dependencies", "devDependencies", "optionalDependencies"].flatMap((field) => {
|
|
24936
|
+
const deps = manifest[field];
|
|
24937
|
+
return deps && typeof deps === "object" ? Object.keys(deps) : [];
|
|
24938
|
+
});
|
|
24939
|
+
const dirs = new Set;
|
|
24940
|
+
for (const name of names) {
|
|
24941
|
+
try {
|
|
24942
|
+
const linked = realpathSync3(join48(projectRoot, "node_modules", name));
|
|
24943
|
+
if (!`${linked}${sep6}`.includes(NODE_MODULES_SEGMENT))
|
|
24944
|
+
dirs.add(linked);
|
|
24945
|
+
} catch {}
|
|
24946
|
+
}
|
|
24947
|
+
return [...dirs];
|
|
24948
|
+
};
|
|
24949
|
+
var init_workspacePackages = __esm(() => {
|
|
24950
|
+
NODE_MODULES_SEGMENT = `${sep6}node_modules${sep6}`;
|
|
24951
|
+
verdicts = new Map;
|
|
24952
|
+
});
|
|
24953
|
+
|
|
24891
24954
|
// src/utils/stripStringsAndComments.ts
|
|
24892
24955
|
var stripStringsAndComments = (source) => {
|
|
24893
24956
|
const { length } = source;
|
|
@@ -24992,7 +25055,7 @@ var stripStringsAndComments = (source) => {
|
|
|
24992
25055
|
};
|
|
24993
25056
|
|
|
24994
25057
|
// src/dev/dependencyGraph.ts
|
|
24995
|
-
import { existsSync as existsSync36, readFileSync as
|
|
25058
|
+
import { existsSync as existsSync36, readFileSync as readFileSync29, realpathSync as realpathSync4 } from "fs";
|
|
24996
25059
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
24997
25060
|
import { resolve as resolve34 } from "path";
|
|
24998
25061
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
@@ -25005,10 +25068,16 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
25005
25068
|
return "html";
|
|
25006
25069
|
return null;
|
|
25007
25070
|
}, resolveImportPath2 = (importPath, fromFile) => {
|
|
25071
|
+
const fromDir = resolve34(fromFile, "..");
|
|
25008
25072
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
25009
|
-
|
|
25073
|
+
if (!isWorkspacePackageSpecifier(importPath, fromDir))
|
|
25074
|
+
return null;
|
|
25075
|
+
try {
|
|
25076
|
+
return realpathSync4(Bun.resolveSync(importPath, fromDir));
|
|
25077
|
+
} catch {
|
|
25078
|
+
return null;
|
|
25079
|
+
}
|
|
25010
25080
|
}
|
|
25011
|
-
const fromDir = resolve34(fromFile, "..");
|
|
25012
25081
|
const normalized = resolve34(fromDir, importPath);
|
|
25013
25082
|
const extensions = [
|
|
25014
25083
|
".ts",
|
|
@@ -25163,15 +25232,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
25163
25232
|
const lowerPath = filePath.toLowerCase();
|
|
25164
25233
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
25165
25234
|
if (loader === "html") {
|
|
25166
|
-
const content =
|
|
25235
|
+
const content = readFileSync29(filePath, "utf-8");
|
|
25167
25236
|
return extractHtmlDependencies(filePath, content);
|
|
25168
25237
|
}
|
|
25169
25238
|
if (loader === "tsx" || loader === "js") {
|
|
25170
|
-
const content =
|
|
25239
|
+
const content = readFileSync29(filePath, "utf-8");
|
|
25171
25240
|
return extractJsDependencies(filePath, content, loader);
|
|
25172
25241
|
}
|
|
25173
25242
|
if (isSvelteOrVue) {
|
|
25174
|
-
const content =
|
|
25243
|
+
const content = readFileSync29(filePath, "utf-8");
|
|
25175
25244
|
return extractSvelteVueDependencies(filePath, content);
|
|
25176
25245
|
}
|
|
25177
25246
|
return [];
|
|
@@ -25218,6 +25287,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
25218
25287
|
removeDependentsForFile(graph, normalizedPath);
|
|
25219
25288
|
};
|
|
25220
25289
|
var init_dependencyGraph = __esm(() => {
|
|
25290
|
+
init_workspacePackages();
|
|
25221
25291
|
emptyDependencyGraph = {
|
|
25222
25292
|
dependencies: new Map,
|
|
25223
25293
|
dependents: new Map
|
|
@@ -25320,7 +25390,7 @@ var init_clientManager = __esm(() => {
|
|
|
25320
25390
|
});
|
|
25321
25391
|
|
|
25322
25392
|
// src/dev/pathUtils.ts
|
|
25323
|
-
import { existsSync as existsSync37, readdirSync as readdirSync8, readFileSync as
|
|
25393
|
+
import { existsSync as existsSync37, readdirSync as readdirSync8, readFileSync as readFileSync30 } from "fs";
|
|
25324
25394
|
import { dirname as dirname26, resolve as resolve36 } from "path";
|
|
25325
25395
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
25326
25396
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
@@ -25420,7 +25490,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
25420
25490
|
}
|
|
25421
25491
|
let source;
|
|
25422
25492
|
try {
|
|
25423
|
-
source =
|
|
25493
|
+
source = readFileSync30(full, "utf8");
|
|
25424
25494
|
} catch {
|
|
25425
25495
|
continue;
|
|
25426
25496
|
}
|
|
@@ -25515,6 +25585,11 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
25515
25585
|
const extraDirs = config.dev?.watchDirs ?? [];
|
|
25516
25586
|
for (const dir of extraDirs)
|
|
25517
25587
|
push(dir);
|
|
25588
|
+
for (const dir of workspacePackageDirs(cwd)) {
|
|
25589
|
+
const abs = normalizePath(dir);
|
|
25590
|
+
if (!roots.includes(abs))
|
|
25591
|
+
roots.push(abs);
|
|
25592
|
+
}
|
|
25518
25593
|
if (cfg.angularDir) {
|
|
25519
25594
|
const resourceDirs = collectAngularResourceDirs(cfg.angularDir);
|
|
25520
25595
|
for (const dir of resourceDirs) {
|
|
@@ -25581,14 +25656,15 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
25581
25656
|
return false;
|
|
25582
25657
|
};
|
|
25583
25658
|
var init_pathUtils = __esm(() => {
|
|
25659
|
+
init_workspacePackages();
|
|
25584
25660
|
STYLE_EXTENSION_PATTERN2 = /\.(css|s[ac]ss|less|styl(?:us)?)$/i;
|
|
25585
|
-
HARD_DENY_PATTERN = /(^|\/)(build|generated|compiled|indexes|\.absolutejs|node_modules|\.git|\.test-builds|dist)(\/|$)/;
|
|
25661
|
+
HARD_DENY_PATTERN = /(^|\/)(build|generated|compiled|indexes|\.absolutejs|node_modules|\.git|\.test-builds|test-results|playwright-report|blob-report|\.playwright-mcp|\.playwright-artifacts(?:-[^/]+)?|dist)(\/|$)/;
|
|
25586
25662
|
});
|
|
25587
25663
|
|
|
25588
25664
|
// src/dev/devPrescan.ts
|
|
25589
25665
|
import { existsSync as existsSync38, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
25590
25666
|
import { mkdir as mkdir11, readFile as readFile7, rename as rename3, writeFile as writeFile9 } from "fs/promises";
|
|
25591
|
-
import { join as
|
|
25667
|
+
import { join as join49 } from "path";
|
|
25592
25668
|
var PRESCAN_DIR, PAYLOAD_VERSION = 1, POLL_INTERVAL_MS = 10, DEFAULT_WAIT_MS = 2000, collectConfigVendorSourceDirs = (config) => Array.from(new Set([
|
|
25593
25669
|
config.reactDirectory,
|
|
25594
25670
|
config.svelteDirectory,
|
|
@@ -25646,7 +25722,7 @@ var init_devPrescan = __esm(() => {
|
|
|
25646
25722
|
init_configResolver();
|
|
25647
25723
|
init_dependencyGraph();
|
|
25648
25724
|
init_pathUtils();
|
|
25649
|
-
PRESCAN_DIR =
|
|
25725
|
+
PRESCAN_DIR = join49(".absolutejs", "dev-prescan");
|
|
25650
25726
|
});
|
|
25651
25727
|
|
|
25652
25728
|
// src/dev/serverEntryCopies.ts
|
|
@@ -25656,7 +25732,7 @@ var init_serverEntryCopies = () => {};
|
|
|
25656
25732
|
// src/dev/fileWatcher.ts
|
|
25657
25733
|
import { watch } from "fs";
|
|
25658
25734
|
import { existsSync as existsSync39, readdirSync as readdirSync10, statSync as statSync6 } from "fs";
|
|
25659
|
-
import { dirname as dirname27, join as
|
|
25735
|
+
import { dirname as dirname27, join as join50, resolve as resolve37 } from "path";
|
|
25660
25736
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
25661
25737
|
try {
|
|
25662
25738
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -25688,7 +25764,9 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
25688
25764
|
for (const name of entries) {
|
|
25689
25765
|
if (shouldSkipFilename(name, isStylesDir))
|
|
25690
25766
|
continue;
|
|
25691
|
-
const child =
|
|
25767
|
+
const child = join50(eventDir, name).replace(/\\/g, "/");
|
|
25768
|
+
if (shouldIgnorePath(child, state.resolvedPaths))
|
|
25769
|
+
continue;
|
|
25692
25770
|
let st;
|
|
25693
25771
|
try {
|
|
25694
25772
|
st = statSync6(child);
|
|
@@ -25709,7 +25787,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
25709
25787
|
return;
|
|
25710
25788
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
25711
25789
|
if (event === "rename") {
|
|
25712
|
-
const eventDir = dirname27(
|
|
25790
|
+
const eventDir = dirname27(join50(absolutePath, filename)).replace(/\\/g, "/");
|
|
25713
25791
|
atomicRecoveryScan(eventDir);
|
|
25714
25792
|
for (const delay of [25, 100]) {
|
|
25715
25793
|
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
@@ -25718,7 +25796,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
25718
25796
|
}
|
|
25719
25797
|
return;
|
|
25720
25798
|
}
|
|
25721
|
-
const fullPath =
|
|
25799
|
+
const fullPath = join50(absolutePath, filename).replace(/\\/g, "/");
|
|
25722
25800
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
25723
25801
|
return;
|
|
25724
25802
|
}
|
|
@@ -25895,10 +25973,10 @@ var init_assetStore = __esm(() => {
|
|
|
25895
25973
|
});
|
|
25896
25974
|
|
|
25897
25975
|
// src/dev/restartScope.ts
|
|
25898
|
-
import { realpathSync as
|
|
25976
|
+
import { realpathSync as realpathSync5 } from "fs";
|
|
25899
25977
|
var MODULE_FILE, DOCUMENT_FILE, realPath = (path) => {
|
|
25900
25978
|
try {
|
|
25901
|
-
return
|
|
25979
|
+
return realpathSync5(path);
|
|
25902
25980
|
} catch {
|
|
25903
25981
|
return path;
|
|
25904
25982
|
}
|
|
@@ -25915,7 +25993,7 @@ var init_restartScope = __esm(() => {
|
|
|
25915
25993
|
});
|
|
25916
25994
|
|
|
25917
25995
|
// src/islands/pageMetadata.ts
|
|
25918
|
-
import { readFileSync as
|
|
25996
|
+
import { readFileSync as readFileSync31 } from "fs";
|
|
25919
25997
|
import { dirname as dirname28, resolve as resolve39 } from "path";
|
|
25920
25998
|
var pagePatterns, getPageDirs = (config) => [
|
|
25921
25999
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
@@ -25958,7 +26036,7 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
25958
26036
|
return;
|
|
25959
26037
|
const files = await scanEntryPoints(resolve39(entry.dir), pattern);
|
|
25960
26038
|
for (const filePath of files) {
|
|
25961
|
-
const source =
|
|
26039
|
+
const source = readFileSync31(filePath, "utf-8");
|
|
25962
26040
|
const islands = extractIslandUsagesFromSource(source);
|
|
25963
26041
|
pageMetadata.set(resolve39(filePath), {
|
|
25964
26042
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
@@ -25989,10 +26067,10 @@ var init_pageMetadata = __esm(() => {
|
|
|
25989
26067
|
});
|
|
25990
26068
|
|
|
25991
26069
|
// src/dev/fileHashTracker.ts
|
|
25992
|
-
import { readFileSync as
|
|
26070
|
+
import { readFileSync as readFileSync32, statSync as statSync7 } from "fs";
|
|
25993
26071
|
var computeFileHash = (filePath) => {
|
|
25994
26072
|
try {
|
|
25995
|
-
const fileContent =
|
|
26073
|
+
const fileContent = readFileSync32(filePath);
|
|
25996
26074
|
return Number(Bun.hash(fileContent));
|
|
25997
26075
|
} catch {
|
|
25998
26076
|
return UNFOUND_INDEX;
|
|
@@ -26317,8 +26395,8 @@ __export(exports_resolveOwningComponents, {
|
|
|
26317
26395
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
26318
26396
|
resolveOwningComponents: () => resolveOwningComponents
|
|
26319
26397
|
});
|
|
26320
|
-
import { readdirSync as readdirSync11, readFileSync as
|
|
26321
|
-
import { dirname as dirname30, extname as extname15, join as
|
|
26398
|
+
import { readdirSync as readdirSync11, readFileSync as readFileSync33, statSync as statSync8 } from "fs";
|
|
26399
|
+
import { dirname as dirname30, extname as extname15, join as join51, resolve as resolve43 } from "path";
|
|
26322
26400
|
import ts19 from "typescript";
|
|
26323
26401
|
var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || file.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
26324
26402
|
const out = [];
|
|
@@ -26333,7 +26411,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
26333
26411
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
26334
26412
|
continue;
|
|
26335
26413
|
}
|
|
26336
|
-
const full =
|
|
26414
|
+
const full = join51(dir, entry.name);
|
|
26337
26415
|
if (entry.isDirectory()) {
|
|
26338
26416
|
visit(full);
|
|
26339
26417
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -26377,7 +26455,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
26377
26455
|
}, parseDecoratedClasses = (filePath) => {
|
|
26378
26456
|
let source;
|
|
26379
26457
|
try {
|
|
26380
|
-
source =
|
|
26458
|
+
source = readFileSync33(filePath, "utf8");
|
|
26381
26459
|
} catch {
|
|
26382
26460
|
return [];
|
|
26383
26461
|
}
|
|
@@ -26467,7 +26545,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
26467
26545
|
}, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
|
|
26468
26546
|
let source;
|
|
26469
26547
|
try {
|
|
26470
|
-
source =
|
|
26548
|
+
source = readFileSync33(childFilePath, "utf8");
|
|
26471
26549
|
} catch {
|
|
26472
26550
|
return null;
|
|
26473
26551
|
}
|
|
@@ -26983,15 +27061,15 @@ var init_hotResources = __esm(() => {
|
|
|
26983
27061
|
});
|
|
26984
27062
|
|
|
26985
27063
|
// src/plugins/openApiPlugin.ts
|
|
26986
|
-
import { existsSync as existsSync40, readFileSync as
|
|
26987
|
-
import { join as
|
|
27064
|
+
import { existsSync as existsSync40, readFileSync as readFileSync34 } from "fs";
|
|
27065
|
+
import { join as join52 } from "path";
|
|
26988
27066
|
var FALLBACK_NAME = "AbsoluteJS API", FALLBACK_VERSION = "1.0.0", projectInfo = (cwd) => {
|
|
26989
|
-
const path =
|
|
27067
|
+
const path = join52(cwd, "package.json");
|
|
26990
27068
|
if (!existsSync40(path)) {
|
|
26991
27069
|
return { name: FALLBACK_NAME, version: FALLBACK_VERSION };
|
|
26992
27070
|
}
|
|
26993
27071
|
try {
|
|
26994
|
-
const pkg = JSON.parse(
|
|
27072
|
+
const pkg = JSON.parse(readFileSync34(path, "utf-8"));
|
|
26995
27073
|
return {
|
|
26996
27074
|
name: typeof pkg.name === "string" ? pkg.name : FALLBACK_NAME,
|
|
26997
27075
|
version: typeof pkg.version === "string" ? pkg.version : FALLBACK_VERSION
|
|
@@ -27040,14 +27118,14 @@ var FALLBACK_NAME = "AbsoluteJS API", FALLBACK_VERSION = "1.0.0", projectInfo =
|
|
|
27040
27118
|
var init_openApiPlugin = () => {};
|
|
27041
27119
|
|
|
27042
27120
|
// src/plugins/telemetryPlugin.ts
|
|
27043
|
-
import { existsSync as existsSync41, readFileSync as
|
|
27044
|
-
import { join as
|
|
27121
|
+
import { existsSync as existsSync41, readFileSync as readFileSync35 } from "fs";
|
|
27122
|
+
import { join as join53 } from "path";
|
|
27045
27123
|
var OTEL_PACKAGE = "@elysia/opentelemetry", readPackageName = (cwd) => {
|
|
27046
|
-
const path =
|
|
27124
|
+
const path = join53(cwd, "package.json");
|
|
27047
27125
|
if (!existsSync41(path))
|
|
27048
27126
|
return null;
|
|
27049
27127
|
try {
|
|
27050
|
-
const pkg = JSON.parse(
|
|
27128
|
+
const pkg = JSON.parse(readFileSync35(path, "utf-8"));
|
|
27051
27129
|
return typeof pkg.name === "string" ? pkg.name : null;
|
|
27052
27130
|
} catch {
|
|
27053
27131
|
return null;
|
|
@@ -27655,7 +27733,7 @@ var exports_config = {};
|
|
|
27655
27733
|
__export(exports_config, {
|
|
27656
27734
|
normalizeAbsoluteMobileConfig: () => normalizeAbsoluteMobileConfig
|
|
27657
27735
|
});
|
|
27658
|
-
import { readFileSync as
|
|
27736
|
+
import { readFileSync as readFileSync36 } from "fs";
|
|
27659
27737
|
import { resolve as resolve46 } from "path";
|
|
27660
27738
|
import { createHash as createHash4, createPublicKey, X509Certificate } from "crypto";
|
|
27661
27739
|
var APP_ID_PATTERN, SCHEME_PATTERN, APPLE_APP_ID_PREFIX_PATTERN, CERTIFICATE_FINGERPRINT_PATTERN, UPDATE_NAME_PATTERN, RELEASE_TARGET_PATTERN, UPDATE_PUBLIC_KEY_PATTERN, ENVIRONMENT_NAME_PATTERN, COLOR_PATTERN, DEFAULT_UPDATE_BOOT_TIMEOUT_MS = 20000, DEFAULT_UPDATE_HEALTH_FAILURE_RATE = 0.2, DEFAULT_UPDATE_HEALTH_MINIMUM_REPORTS = 20, DEFAULT_UPDATE_ROLLOUT_FAILURE_RATE = 0.05, DEFAULT_UPDATE_ROLLOUT_OBSERVATION_MINUTES = 60, MINUTE_MS, DEFAULT_UPDATE_ROLLOUT_STAGES, MINIMUM_UPDATE_BOOT_TIMEOUT_MS = 5000, MAXIMUM_UPDATE_BOOT_TIMEOUT_MS = 120000, HOSTNAME_PATTERN, EXPO_RESERVED_ROUTE_PREFIXES, resolveProjectPath = (projectRoot, value, field) => {
|
|
@@ -27854,7 +27932,7 @@ var APP_ID_PATTERN, SCHEME_PATTERN, APPLE_APP_ID_PREFIX_PATTERN, CERTIFICATE_FIN
|
|
|
27854
27932
|
}))
|
|
27855
27933
|
].sort(), readExpoCodeSigningCertificate = (certificatePath) => {
|
|
27856
27934
|
try {
|
|
27857
|
-
const certificateSource =
|
|
27935
|
+
const certificateSource = readFileSync36(certificatePath, "utf8");
|
|
27858
27936
|
const certificatePem = certificateSource.endsWith(`
|
|
27859
27937
|
`) ? certificateSource : `${certificateSource}
|
|
27860
27938
|
`;
|
|
@@ -28456,11 +28534,11 @@ var init_mobilePreview = __esm(() => {
|
|
|
28456
28534
|
});
|
|
28457
28535
|
|
|
28458
28536
|
// src/mobile/nativeAuth.ts
|
|
28459
|
-
import { readFileSync as
|
|
28460
|
-
import { join as
|
|
28537
|
+
import { readFileSync as readFileSync37 } from "fs";
|
|
28538
|
+
import { join as join54 } from "path";
|
|
28461
28539
|
var ABSOLUTE_AUTH_PACKAGE = "@absolutejs/auth", ABSOLUTE_EXPO_AUTH_CORE_VERSION = "0.76.3", ABSOLUTE_EXPO_AUTH_PACKAGE = "@absolutejs/auth-expo", ABSOLUTE_EXPO_AUTH_VERSION = "0.0.6", ABSOLUTE_EXPO_SYNC_CORE_VERSION = "2.31.0", ABSOLUTE_EXPO_SYNC_PACKAGE = "@absolutejs/sync-expo", ABSOLUTE_EXPO_SYNC_VERSION = "0.0.4", ABSOLUTE_NATIVE_AUTH_CLIENTS_ENV = "ABSOLUTE_AUTH_NATIVE_CLIENTS", ABSOLUTE_NATIVE_AUTH_SCOPES, ABSOLUTE_SYNC_PACKAGE = "@absolutejs/sync", readPackageManifest = (projectRoot) => {
|
|
28462
28540
|
try {
|
|
28463
|
-
return JSON.parse(
|
|
28541
|
+
return JSON.parse(readFileSync37(join54(projectRoot, "package.json"), "utf8"));
|
|
28464
28542
|
} catch {
|
|
28465
28543
|
return;
|
|
28466
28544
|
}
|
|
@@ -28501,7 +28579,7 @@ var init_nativeAuth = __esm(() => {
|
|
|
28501
28579
|
|
|
28502
28580
|
// src/mobile/devDeviceAdapter.ts
|
|
28503
28581
|
import { access as access2, mkdtemp, rm as rm12, writeFile as writeFile11 } from "fs/promises";
|
|
28504
|
-
import { join as
|
|
28582
|
+
import { join as join55 } from "path";
|
|
28505
28583
|
import { tmpdir } from "os";
|
|
28506
28584
|
var absoluteNativeDevAdapterSource = (projectRoot, mobile, resolveModule = (specifier) => specifier, expoAdapterModule = "@absolutejs/absolute/mobile/expo-devices", expoAuthModule = "@absolutejs/absolute/mobile/expo-auth", expoSyncModule = "@absolutejs/absolute/mobile/expo-sync") => {
|
|
28507
28585
|
if ((mobile.engine ?? "capacitor") === "expo") {
|
|
@@ -28539,7 +28617,7 @@ ${auth ? `void createAbsoluteExpoShellAuth(${JSON.stringify(auth)}).then(auth =>
|
|
|
28539
28617
|
`);
|
|
28540
28618
|
}, expoAdapterPath = async () => {
|
|
28541
28619
|
const candidates = await Promise.all(["ts", "js"].map(async (extension) => {
|
|
28542
|
-
const path =
|
|
28620
|
+
const path = join55(import.meta.dir, `shellExpoDevices.${extension}`);
|
|
28543
28621
|
try {
|
|
28544
28622
|
await access2(path);
|
|
28545
28623
|
return path;
|
|
@@ -28553,7 +28631,7 @@ ${auth ? `void createAbsoluteExpoShellAuth(${JSON.stringify(auth)}).then(auth =>
|
|
|
28553
28631
|
throw new TypeError("The AbsoluteJS Expo development adapter is missing.");
|
|
28554
28632
|
}, expoAuthPath = async () => {
|
|
28555
28633
|
const candidates = await Promise.all(["ts", "js"].map(async (extension) => {
|
|
28556
|
-
const path =
|
|
28634
|
+
const path = join55(import.meta.dir, `shellExpoAuth.${extension}`);
|
|
28557
28635
|
try {
|
|
28558
28636
|
await access2(path);
|
|
28559
28637
|
return path;
|
|
@@ -28567,7 +28645,7 @@ ${auth ? `void createAbsoluteExpoShellAuth(${JSON.stringify(auth)}).then(auth =>
|
|
|
28567
28645
|
throw new TypeError("The AbsoluteJS Expo Auth development adapter is missing.");
|
|
28568
28646
|
}, expoSyncPath = async () => {
|
|
28569
28647
|
const candidates = await Promise.all(["ts", "js"].map(async (extension) => {
|
|
28570
|
-
const path =
|
|
28648
|
+
const path = join55(import.meta.dir, `shellExpoSync.${extension}`);
|
|
28571
28649
|
try {
|
|
28572
28650
|
await access2(path);
|
|
28573
28651
|
return path;
|
|
@@ -28580,8 +28658,8 @@ ${auth ? `void createAbsoluteExpoShellAuth(${JSON.stringify(auth)}).then(auth =>
|
|
|
28580
28658
|
return path;
|
|
28581
28659
|
throw new TypeError("The AbsoluteJS Expo Sync development adapter is missing.");
|
|
28582
28660
|
}, buildAbsoluteNativeDevAdapter = async (projectRoot, mobile) => {
|
|
28583
|
-
const temporaryDirectory = await mkdtemp(
|
|
28584
|
-
const entry =
|
|
28661
|
+
const temporaryDirectory = await mkdtemp(join55(tmpdir(), "absolutejs-native-dev-adapter-"));
|
|
28662
|
+
const entry = join55(temporaryDirectory, "entry.ts");
|
|
28585
28663
|
try {
|
|
28586
28664
|
await writeFile11(entry, absoluteNativeDevAdapterSource(projectRoot, mobile, (specifier) => Bun.resolveSync(specifier, projectRoot), await expoAdapterPath(), await expoAuthPath(), await expoSyncPath()));
|
|
28587
28665
|
const result = await Bun.build({
|
|
@@ -28607,11 +28685,11 @@ var init_devDeviceAdapter = __esm(() => {
|
|
|
28607
28685
|
|
|
28608
28686
|
// src/mobile/mobilePreviewClientBundle.ts
|
|
28609
28687
|
import { access as access3 } from "fs/promises";
|
|
28610
|
-
import { join as
|
|
28688
|
+
import { join as join56 } from "path";
|
|
28611
28689
|
var PREVIEW_CLIENT_FILE = "mobilePreviewClient.ts", fileExists = (path) => access3(path).then(() => true, () => false), resolveAbsoluteMobilePreviewClientEntry = async () => {
|
|
28612
28690
|
const candidates = [
|
|
28613
|
-
|
|
28614
|
-
|
|
28691
|
+
join56(import.meta.dir, PREVIEW_CLIENT_FILE),
|
|
28692
|
+
join56(import.meta.dir, "mobile", PREVIEW_CLIENT_FILE)
|
|
28615
28693
|
];
|
|
28616
28694
|
const present = await Promise.all(candidates.map(fileExists));
|
|
28617
28695
|
const entry = candidates.find((_candidate, index) => present[index]);
|
|
@@ -29125,14 +29203,14 @@ import {
|
|
|
29125
29203
|
X509Certificate as X509Certificate3
|
|
29126
29204
|
} from "crypto";
|
|
29127
29205
|
import { access as access4, mkdir as mkdir13 } from "fs/promises";
|
|
29128
|
-
import { dirname as dirname31, isAbsolute as isAbsolute9, relative as relative21, resolve as resolve48, sep as
|
|
29206
|
+
import { dirname as dirname31, isAbsolute as isAbsolute9, relative as relative21, resolve as resolve48, sep as sep7 } from "path";
|
|
29129
29207
|
import { pathToFileURL as pathToFileURL3 } from "url";
|
|
29130
29208
|
import { Elysia as Elysia6 } from "elysia";
|
|
29131
29209
|
var ABSOLUTE_MOBILE_UPDATE_SERVER_FORMAT = 1, DEFAULT_MOBILE_UPDATE_REGISTRY_MODULE = "mobile.update.ts", object4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), projectPath = (projectRoot, requested) => {
|
|
29132
29210
|
const root = resolve48(projectRoot);
|
|
29133
29211
|
const path = resolve48(root, requested);
|
|
29134
29212
|
const projectRelative = relative21(root, path);
|
|
29135
|
-
if (projectRelative === ".." || projectRelative.startsWith(`..${
|
|
29213
|
+
if (projectRelative === ".." || projectRelative.startsWith(`..${sep7}`) || isAbsolute9(projectRelative))
|
|
29136
29214
|
throw new TypeError("mobile.updates.server.registry must remain inside the project.");
|
|
29137
29215
|
return path;
|
|
29138
29216
|
}, isRegistry2 = (value) => object4(value) && [
|
|
@@ -29618,17 +29696,17 @@ var init_hmr = __esm(() => {
|
|
|
29618
29696
|
});
|
|
29619
29697
|
|
|
29620
29698
|
// src/plugins/devtoolsJson.ts
|
|
29621
|
-
import { existsSync as existsSync42, mkdirSync as mkdirSync14, readFileSync as
|
|
29622
|
-
import { dirname as dirname33, join as
|
|
29699
|
+
import { existsSync as existsSync42, mkdirSync as mkdirSync14, readFileSync as readFileSync38, writeFileSync as writeFileSync10 } from "fs";
|
|
29700
|
+
import { dirname as dirname33, join as join57, resolve as resolve50 } from "path";
|
|
29623
29701
|
import { Elysia as Elysia8 } from "elysia";
|
|
29624
29702
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
29625
29703
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
29626
29704
|
return uuid;
|
|
29627
|
-
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve50(uuidCachePath ??
|
|
29705
|
+
}, isUuidV4 = (value) => /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value), resolveDevtoolsUuidCachePath = (buildDir, uuidCachePath) => resolve50(uuidCachePath ?? join57(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
29628
29706
|
if (!existsSync42(cachePath))
|
|
29629
29707
|
return null;
|
|
29630
29708
|
try {
|
|
29631
|
-
const value =
|
|
29709
|
+
const value = readFileSync38(cachePath, "utf-8").trim();
|
|
29632
29710
|
return isUuidV4(value) ? value : null;
|
|
29633
29711
|
} catch {
|
|
29634
29712
|
return null;
|
|
@@ -29663,11 +29741,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
29663
29741
|
if (process.env.WSL_DISTRO_NAME) {
|
|
29664
29742
|
const distro = process.env.WSL_DISTRO_NAME;
|
|
29665
29743
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
29666
|
-
return
|
|
29744
|
+
return join57("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
|
|
29667
29745
|
}
|
|
29668
29746
|
if (process.env.DOCKER_DESKTOP && !root.startsWith("\\\\")) {
|
|
29669
29747
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
29670
|
-
return
|
|
29748
|
+
return join57("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
|
|
29671
29749
|
}
|
|
29672
29750
|
return root;
|
|
29673
29751
|
};
|
|
@@ -30191,7 +30269,7 @@ import {
|
|
|
30191
30269
|
rm as rm13,
|
|
30192
30270
|
writeFile as writeFile12
|
|
30193
30271
|
} from "fs/promises";
|
|
30194
|
-
import { join as
|
|
30272
|
+
import { join as join58, resolve as resolvePath } from "path";
|
|
30195
30273
|
import { pathToFileURL as pathToFileURL4 } from "url";
|
|
30196
30274
|
var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE = "artifact.json", RELEASE_ID_PATTERN, DEFAULT_BLOB_PREFIX = "absolutejs/mobile-compatibility", hashBlob = async (blob) => {
|
|
30197
30275
|
const bytes = new Uint8Array(await blob.arrayBuffer());
|
|
@@ -30206,7 +30284,7 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
|
|
|
30206
30284
|
}
|
|
30207
30285
|
return releaseId;
|
|
30208
30286
|
}, readStoredArtifact = async (releaseDirectory) => {
|
|
30209
|
-
const serialized = await readFile10(
|
|
30287
|
+
const serialized = await readFile10(join58(releaseDirectory, ARTIFACT_FILE), "utf8");
|
|
30210
30288
|
const parsed = JSON.parse(serialized);
|
|
30211
30289
|
return parseAbsoluteMobileCompatibilityArtifact(parsed);
|
|
30212
30290
|
}, validateStoredIdentity = (artifact, appId, releaseId) => {
|
|
@@ -30301,8 +30379,8 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
|
|
|
30301
30379
|
}, createAbsoluteMobileFileArtifactStore = (options) => {
|
|
30302
30380
|
const root = resolvePath(options.root);
|
|
30303
30381
|
const maxProducerBytes = options.maxProducerBytes ?? DEFAULT_MAX_PRODUCER_BYTES;
|
|
30304
|
-
const appDirectory = (appId) =>
|
|
30305
|
-
const releaseDirectory = (appId, releaseId) =>
|
|
30382
|
+
const appDirectory = (appId) => join58(root, appDirectoryName(appId));
|
|
30383
|
+
const releaseDirectory = (appId, releaseId) => join58(appDirectory(appId), requireReleaseId(releaseId));
|
|
30306
30384
|
const acceptExistingRelease = async (error, artifact) => {
|
|
30307
30385
|
if (!errorHasCode(error, "EEXIST") && !errorHasCode(error, "ENOTEMPTY")) {
|
|
30308
30386
|
return false;
|
|
@@ -30343,7 +30421,7 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
|
|
|
30343
30421
|
}
|
|
30344
30422
|
return {
|
|
30345
30423
|
artifact,
|
|
30346
|
-
producer: Bun.file(
|
|
30424
|
+
producer: Bun.file(join58(directory, artifact.producer.module))
|
|
30347
30425
|
};
|
|
30348
30426
|
},
|
|
30349
30427
|
write: async (release) => {
|
|
@@ -30351,14 +30429,14 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
|
|
|
30351
30429
|
const validated = await verifyAbsoluteMobileCompatibilityProducer({ artifact: validatedArtifact, producer: release.producer }, maxProducerBytes);
|
|
30352
30430
|
const parent = appDirectory(validated.artifact.appId);
|
|
30353
30431
|
await mkdir14(parent, { recursive: true });
|
|
30354
|
-
const staging = await mkdtemp2(
|
|
30355
|
-
const producerPath =
|
|
30432
|
+
const staging = await mkdtemp2(join58(parent, ".stage-"));
|
|
30433
|
+
const producerPath = join58(staging, validated.artifact.producer.module);
|
|
30356
30434
|
try {
|
|
30357
30435
|
await mkdir14(resolvePath(producerPath, ".."), {
|
|
30358
30436
|
recursive: true
|
|
30359
30437
|
});
|
|
30360
30438
|
await Promise.all([
|
|
30361
|
-
writeFile12(
|
|
30439
|
+
writeFile12(join58(staging, ARTIFACT_FILE), `${JSON.stringify(validated.artifact, null, "\t")}
|
|
30362
30440
|
`),
|
|
30363
30441
|
writeFile12(producerPath, new Uint8Array(await validated.producer.arrayBuffer()))
|
|
30364
30442
|
]);
|
|
@@ -30415,7 +30493,7 @@ import {
|
|
|
30415
30493
|
rm as rm14,
|
|
30416
30494
|
writeFile as writeFile13
|
|
30417
30495
|
} from "fs/promises";
|
|
30418
|
-
import { dirname as dirname34, join as
|
|
30496
|
+
import { dirname as dirname34, join as join59, resolve as resolvePath2 } from "path";
|
|
30419
30497
|
import { pathToFileURL as pathToFileURL5 } from "url";
|
|
30420
30498
|
var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "current.json", BUNDLES_DIRECTORY = "bundles", ARTIFACT_FILE2 = "artifact.json", BUNDLE_ID_PATTERN, isRecord9 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), errorHasCode2 = (error, code) => typeof error === "object" && error !== null && Reflect.get(error, "code") === code, bundleIdFor = (currentReleaseId, releases) => {
|
|
30421
30499
|
const identity = JSON.stringify({
|
|
@@ -30446,16 +30524,16 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
30446
30524
|
releases
|
|
30447
30525
|
};
|
|
30448
30526
|
}, writeRelease = async (root, release) => {
|
|
30449
|
-
const directory =
|
|
30450
|
-
const producerPath =
|
|
30527
|
+
const directory = join59(root, release.artifact.releaseId);
|
|
30528
|
+
const producerPath = join59(directory, release.artifact.producer.module);
|
|
30451
30529
|
await mkdir15(dirname34(producerPath), { recursive: true });
|
|
30452
30530
|
await Promise.all([
|
|
30453
|
-
writeFile13(
|
|
30531
|
+
writeFile13(join59(directory, ARTIFACT_FILE2), `${JSON.stringify(release.artifact, null, "\t")}
|
|
30454
30532
|
`),
|
|
30455
30533
|
writeFile13(producerPath, new Uint8Array(await release.producer.arrayBuffer()))
|
|
30456
30534
|
]);
|
|
30457
30535
|
}, installImmutableBundle = async (bundlesRoot, bundleId, releases) => {
|
|
30458
|
-
const destination =
|
|
30536
|
+
const destination = join59(bundlesRoot, bundleId);
|
|
30459
30537
|
try {
|
|
30460
30538
|
await access5(destination);
|
|
30461
30539
|
return destination;
|
|
@@ -30463,7 +30541,7 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
30463
30541
|
if (!errorHasCode2(error, "ENOENT"))
|
|
30464
30542
|
throw error;
|
|
30465
30543
|
}
|
|
30466
|
-
const staging = await mkdtemp3(
|
|
30544
|
+
const staging = await mkdtemp3(join59(bundlesRoot, ".stage-"));
|
|
30467
30545
|
try {
|
|
30468
30546
|
await Promise.all(releases.map((release) => writeRelease(staging, release)));
|
|
30469
30547
|
await rename6(staging, destination);
|
|
@@ -30494,15 +30572,15 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
30494
30572
|
};
|
|
30495
30573
|
}, loadAbsoluteMobileMaterializedBundle = async (root) => {
|
|
30496
30574
|
const resolvedRoot = resolvePath2(root);
|
|
30497
|
-
const serialized = await readFile11(
|
|
30575
|
+
const serialized = await readFile11(join59(resolvedRoot, CURRENT_BUNDLE_FILE), "utf8");
|
|
30498
30576
|
const parsed = JSON.parse(serialized);
|
|
30499
30577
|
const index = parseBundleIndex(parsed);
|
|
30500
|
-
const bundleRoot =
|
|
30578
|
+
const bundleRoot = join59(resolvedRoot, BUNDLES_DIRECTORY, index.bundleId);
|
|
30501
30579
|
return {
|
|
30502
30580
|
artifacts: index.releases,
|
|
30503
30581
|
currentReleaseId: index.currentReleaseId,
|
|
30504
30582
|
loadProducer: async (artifact) => {
|
|
30505
|
-
const modulePath =
|
|
30583
|
+
const modulePath = join59(bundleRoot, artifact.releaseId, artifact.producer.module);
|
|
30506
30584
|
await verifyAbsoluteMobileCompatibilityProducer({
|
|
30507
30585
|
artifact,
|
|
30508
30586
|
producer: Bun.file(modulePath)
|
|
@@ -30528,7 +30606,7 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
30528
30606
|
return release;
|
|
30529
30607
|
});
|
|
30530
30608
|
const root = resolvePath2(input.root);
|
|
30531
|
-
const bundlesRoot =
|
|
30609
|
+
const bundlesRoot = join59(root, BUNDLES_DIRECTORY);
|
|
30532
30610
|
await mkdir15(bundlesRoot, { recursive: true });
|
|
30533
30611
|
const bundleId = bundleIdFor(input.currentReleaseId, artifacts);
|
|
30534
30612
|
await installImmutableBundle(bundlesRoot, bundleId, orderedReleases);
|
|
@@ -30538,8 +30616,8 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
30538
30616
|
format: ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT,
|
|
30539
30617
|
releases: artifacts
|
|
30540
30618
|
};
|
|
30541
|
-
const pointerPath =
|
|
30542
|
-
const temporaryPointerPath =
|
|
30619
|
+
const pointerPath = join59(root, CURRENT_BUNDLE_FILE);
|
|
30620
|
+
const temporaryPointerPath = join59(root, `.current-${crypto.randomUUID()}.json`);
|
|
30543
30621
|
await writeFile13(temporaryPointerPath, `${JSON.stringify(index, null, "\t")}
|
|
30544
30622
|
`, { flag: "wx" });
|
|
30545
30623
|
await rename6(temporaryPointerPath, pointerPath);
|
|
@@ -30547,12 +30625,12 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
30547
30625
|
}, readAbsoluteMobileMaterializedReleases = async (root) => {
|
|
30548
30626
|
const resolvedRoot = resolvePath2(root);
|
|
30549
30627
|
try {
|
|
30550
|
-
const serialized = await readFile11(
|
|
30628
|
+
const serialized = await readFile11(join59(resolvedRoot, CURRENT_BUNDLE_FILE), "utf8");
|
|
30551
30629
|
const parsed = JSON.parse(serialized);
|
|
30552
30630
|
const index = parseBundleIndex(parsed);
|
|
30553
|
-
const bundleRoot =
|
|
30631
|
+
const bundleRoot = join59(resolvedRoot, BUNDLES_DIRECTORY, index.bundleId);
|
|
30554
30632
|
return Promise.all(index.releases.map(async (artifact) => {
|
|
30555
|
-
const producer = Bun.file(
|
|
30633
|
+
const producer = Bun.file(join59(bundleRoot, artifact.releaseId, artifact.producer.module));
|
|
30556
30634
|
await verifyAbsoluteMobileCompatibilityProducer({
|
|
30557
30635
|
artifact,
|
|
30558
30636
|
producer
|
|
@@ -31086,15 +31164,15 @@ var init_compatibilityDispatcher = __esm(() => {
|
|
|
31086
31164
|
});
|
|
31087
31165
|
|
|
31088
31166
|
// src/core/prerender.ts
|
|
31089
|
-
import { mkdirSync as mkdirSync15, readFileSync as
|
|
31090
|
-
import { join as
|
|
31167
|
+
import { mkdirSync as mkdirSync15, readFileSync as readFileSync39 } from "fs";
|
|
31168
|
+
import { join as join60 } from "path";
|
|
31091
31169
|
var DEFAULT_FETCH_TIMEOUT_MS = 1e4, PRERENDER_BYPASS_HEADER = "X-Absolute-Prerender-Bypass", routeToFilename = (route) => route === "/" ? "index.html" : `${route.slice(1).replace(/\//g, "-")}.html`, writeTimestamp = async (htmlPath) => {
|
|
31092
31170
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
31093
31171
|
await Bun.write(metaPath, String(Date.now()));
|
|
31094
31172
|
}, readTimestamp = (htmlPath) => {
|
|
31095
31173
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
31096
31174
|
try {
|
|
31097
|
-
const content =
|
|
31175
|
+
const content = readFileSync39(metaPath, "utf-8");
|
|
31098
31176
|
return Number(content) || 0;
|
|
31099
31177
|
} catch {
|
|
31100
31178
|
return 0;
|
|
@@ -31111,7 +31189,7 @@ var DEFAULT_FETCH_TIMEOUT_MS = 1e4, PRERENDER_BYPASS_HEADER = "X-Absolute-Preren
|
|
|
31111
31189
|
if (!isCompleteHtml(html))
|
|
31112
31190
|
return false;
|
|
31113
31191
|
const fileName = routeToFilename(route);
|
|
31114
|
-
const filePath =
|
|
31192
|
+
const filePath = join60(prerenderDir, fileName);
|
|
31115
31193
|
await Bun.write(filePath, html);
|
|
31116
31194
|
await writeTimestamp(filePath);
|
|
31117
31195
|
return true;
|
|
@@ -31130,8 +31208,8 @@ var init_prerender = () => {};
|
|
|
31130
31208
|
|
|
31131
31209
|
// src/core/prepare.ts
|
|
31132
31210
|
import { createHash as createHash9 } from "crypto";
|
|
31133
|
-
import { existsSync as existsSync44, readdirSync as readdirSync12, readFileSync as
|
|
31134
|
-
import { basename as basename19, join as
|
|
31211
|
+
import { existsSync as existsSync44, readdirSync as readdirSync12, readFileSync as readFileSync40 } from "fs";
|
|
31212
|
+
import { basename as basename19, join as join61, relative as relative23, resolve as resolvePath3 } from "path";
|
|
31135
31213
|
import { Elysia as Elysia12, NotFound } from "elysia";
|
|
31136
31214
|
var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_PLUGIN_RETRY_DELAY_MS = 50, waitForStaticPluginRetry = () => new Promise((resolve) => {
|
|
31137
31215
|
setTimeout(resolve, STATIC_PLUGIN_RETRY_DELAY_MS);
|
|
@@ -31261,8 +31339,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
31261
31339
|
const srcPath = resolvePath3(devIndexDir, fileName);
|
|
31262
31340
|
if (!existsSync44(srcPath))
|
|
31263
31341
|
continue;
|
|
31264
|
-
|
|
31265
|
-
manifest[key] = `${SRC_URL_PREFIX}${rel}`;
|
|
31342
|
+
manifest[key] = `${SRC_URL_PREFIX}${encodeSrcPath(relative23(process.cwd(), srcPath))}`;
|
|
31266
31343
|
}
|
|
31267
31344
|
}, ICON_HASH_LENGTH = 8, registerIconVersioning = (buildDir) => {
|
|
31268
31345
|
const cache = new Map;
|
|
@@ -31273,10 +31350,10 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
31273
31350
|
if (cached !== undefined)
|
|
31274
31351
|
return cached;
|
|
31275
31352
|
const path = href.split("?")[0] ?? href;
|
|
31276
|
-
const filePath =
|
|
31353
|
+
const filePath = join61(buildDir, path);
|
|
31277
31354
|
let versioned = href;
|
|
31278
31355
|
if (existsSync44(filePath)) {
|
|
31279
|
-
const hash = createHash9("sha256").update(
|
|
31356
|
+
const hash = createHash9("sha256").update(readFileSync40(filePath)).digest("hex").slice(0, ICON_HASH_LENGTH);
|
|
31280
31357
|
versioned = href.includes("?") ? `${href}&v=${hash}` : `${href}?v=${hash}`;
|
|
31281
31358
|
}
|
|
31282
31359
|
cache.set(href, versioned);
|
|
@@ -31409,12 +31486,12 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
31409
31486
|
continue;
|
|
31410
31487
|
const name = basename19(entry, ".html");
|
|
31411
31488
|
const route = name === "index" ? "/" : `/${name}`;
|
|
31412
|
-
map.set(route,
|
|
31489
|
+
map.set(route, join61(prerenderDir, entry));
|
|
31413
31490
|
}
|
|
31414
31491
|
return map;
|
|
31415
31492
|
}, loadMobileCompatibilityPlugin = async (buildDir) => {
|
|
31416
|
-
const root =
|
|
31417
|
-
if (!existsSync44(
|
|
31493
|
+
const root = join61(buildDir, ".absolutejs", "mobile-compatibility");
|
|
31494
|
+
if (!existsSync44(join61(root, "current.json"))) {
|
|
31418
31495
|
return new Elysia12({ name: "absolutejs-mobile-compatibility-empty" });
|
|
31419
31496
|
}
|
|
31420
31497
|
const [
|
|
@@ -31470,7 +31547,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
31470
31547
|
return result;
|
|
31471
31548
|
}
|
|
31472
31549
|
stepStartedAt = performance.now();
|
|
31473
|
-
const manifest = JSON.parse(
|
|
31550
|
+
const manifest = JSON.parse(readFileSync40(`${buildDir}/manifest.json`, "utf-8"));
|
|
31474
31551
|
setCurrentIslandManifest(manifest);
|
|
31475
31552
|
if (config.islands?.registry) {
|
|
31476
31553
|
setCurrentIslandRegistry(await loadIslandRegistry(config.islands.registry));
|
|
@@ -31478,14 +31555,14 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
31478
31555
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
31479
31556
|
recordStep("load production manifest and island metadata", stepStartedAt);
|
|
31480
31557
|
stepStartedAt = performance.now();
|
|
31481
|
-
const conventionsPath =
|
|
31558
|
+
const conventionsPath = join61(buildDir, "conventions.json");
|
|
31482
31559
|
if (existsSync44(conventionsPath)) {
|
|
31483
|
-
const conventions = JSON.parse(
|
|
31560
|
+
const conventions = JSON.parse(readFileSync40(conventionsPath, "utf-8"));
|
|
31484
31561
|
setConventions(conventions);
|
|
31485
31562
|
}
|
|
31486
|
-
const spaRoutesPath =
|
|
31563
|
+
const spaRoutesPath = join61(buildDir, "spa-routes.json");
|
|
31487
31564
|
if (existsSync44(spaRoutesPath)) {
|
|
31488
|
-
setSpaRouteManifest(JSON.parse(
|
|
31565
|
+
setSpaRouteManifest(JSON.parse(readFileSync40(spaRoutesPath, "utf-8")));
|
|
31489
31566
|
}
|
|
31490
31567
|
recordStep("load production conventions", stepStartedAt);
|
|
31491
31568
|
stepStartedAt = performance.now();
|
|
@@ -31496,7 +31573,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
31496
31573
|
prefix: "",
|
|
31497
31574
|
staticLimit: MAX_STATIC_ROUTE_COUNT
|
|
31498
31575
|
});
|
|
31499
|
-
const generatedAssetsRoot =
|
|
31576
|
+
const generatedAssetsRoot = join61(buildDir, ".absolutejs");
|
|
31500
31577
|
const generatedAssetsPlugin = new Elysia12({
|
|
31501
31578
|
name: "absolutejs-generated-assets"
|
|
31502
31579
|
}).get("/.absolutejs/*", async ({ params, set }) => {
|
|
@@ -31528,7 +31605,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
31528
31605
|
responseValue.headers.set("cache-control", assetCacheControl(pathname));
|
|
31529
31606
|
});
|
|
31530
31607
|
stepStartedAt = performance.now();
|
|
31531
|
-
const prerenderDir =
|
|
31608
|
+
const prerenderDir = join61(buildDir, "_prerendered");
|
|
31532
31609
|
const prerenderMap = loadPrerenderMap(prerenderDir);
|
|
31533
31610
|
const mobileCompatibilityPlugin = await loadMobileCompatibilityPlugin(buildDir);
|
|
31534
31611
|
const mobileAssociationPlugin = await loadMobileAssociationPlugin(config.mobile);
|
|
@@ -31654,8 +31731,8 @@ __export(exports_moduleServer, {
|
|
|
31654
31731
|
warmPage: () => warmPage,
|
|
31655
31732
|
warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
|
|
31656
31733
|
});
|
|
31657
|
-
import { existsSync as existsSync45, readFileSync as
|
|
31658
|
-
import { basename as basename20, dirname as dirname35, extname as extname16, join as
|
|
31734
|
+
import { existsSync as existsSync45, readFileSync as readFileSync41, realpathSync as realpathSync6, statSync as statSync9 } from "fs";
|
|
31735
|
+
import { basename as basename20, dirname as dirname35, extname as extname16, join as join62, resolve as resolve52, relative as relative24 } from "path";
|
|
31659
31736
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
31660
31737
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
31661
31738
|
const allExports = [];
|
|
@@ -31706,7 +31783,7 @@ ${stubs}
|
|
|
31706
31783
|
const invalidationVersion = getInvalidationVersion(absPath);
|
|
31707
31784
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
31708
31785
|
}, srcUrl = (relPath, projectRoot) => {
|
|
31709
|
-
const base = `${SRC_PREFIX}${relPath
|
|
31786
|
+
const base = `${SRC_PREFIX}${encodeSrcPath(relPath)}`;
|
|
31710
31787
|
const absPath = resolve52(projectRoot, relPath);
|
|
31711
31788
|
const cached = mtimeCache.get(absPath);
|
|
31712
31789
|
if (cached !== undefined)
|
|
@@ -31744,9 +31821,9 @@ ${stubs}
|
|
|
31744
31821
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
31745
31822
|
if (!subpath) {
|
|
31746
31823
|
const pkgDir = resolve52(projectRoot, "node_modules", packageName ?? "");
|
|
31747
|
-
const pkgJsonPath =
|
|
31824
|
+
const pkgJsonPath = join62(pkgDir, "package.json");
|
|
31748
31825
|
if (existsSync45(pkgJsonPath)) {
|
|
31749
|
-
const pkg = JSON.parse(
|
|
31826
|
+
const pkg = JSON.parse(readFileSync41(pkgJsonPath, "utf-8"));
|
|
31750
31827
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
31751
31828
|
if (esmEntry) {
|
|
31752
31829
|
const resolved = resolve52(pkgDir, esmEntry);
|
|
@@ -31798,6 +31875,8 @@ ${stubs}
|
|
|
31798
31875
|
const rel = relative24(projectRoot, absPath).replace(/\\/g, "/");
|
|
31799
31876
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
31800
31877
|
}
|
|
31878
|
+
if (!existsSync45(absPath))
|
|
31879
|
+
return _match;
|
|
31801
31880
|
const rel = relative24(projectRoot, absPath).replace(/\\/g, "/");
|
|
31802
31881
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
31803
31882
|
};
|
|
@@ -31855,7 +31934,7 @@ ${code}`;
|
|
|
31855
31934
|
reactFastRefreshWarningEmitted = true;
|
|
31856
31935
|
logWarn("React edits remount the page instead of keeping component state: " + "this Bun ignores `reactFastRefresh` on Bun.Transpiler " + "(https://github.com/oven-sh/bun/issues/32919). Run " + "`absolute bun-patch install` to use AbsoluteJS's patched Bun, " + "which has the fix; `absolute dev` then uses it automatically.");
|
|
31857
31936
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
31858
|
-
const raw =
|
|
31937
|
+
const raw = readFileSync41(filePath, "utf-8");
|
|
31859
31938
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
31860
31939
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
31861
31940
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -31871,7 +31950,7 @@ ${transpiled}`;
|
|
|
31871
31950
|
transpiled += buildIslandMetadataExports(raw);
|
|
31872
31951
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
31873
31952
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
31874
|
-
const raw =
|
|
31953
|
+
const raw = readFileSync41(filePath, "utf-8");
|
|
31875
31954
|
const ext = extname16(filePath);
|
|
31876
31955
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
31877
31956
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -32031,13 +32110,13 @@ ${code}`;
|
|
|
32031
32110
|
code = `import "${cssUrl}";
|
|
32032
32111
|
${code}`;
|
|
32033
32112
|
}
|
|
32034
|
-
const moduleUrl = `${SRC_PREFIX}${relative24(projectRoot, filePath)
|
|
32113
|
+
const moduleUrl = `${SRC_PREFIX}${encodeSrcPath(relative24(projectRoot, filePath))}`;
|
|
32035
32114
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
32036
32115
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
32037
32116
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
32038
32117
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
32039
32118
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
32040
|
-
const raw =
|
|
32119
|
+
const raw = readFileSync41(filePath, "utf-8");
|
|
32041
32120
|
if (!svelteCompiler) {
|
|
32042
32121
|
svelteCompiler = await import("svelte/compiler");
|
|
32043
32122
|
}
|
|
@@ -32103,7 +32182,7 @@ export default __script__;`;
|
|
|
32103
32182
|
return `${cssInjection}
|
|
32104
32183
|
${code}`;
|
|
32105
32184
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
32106
|
-
const rawSource =
|
|
32185
|
+
const rawSource = readFileSync41(filePath, "utf-8");
|
|
32107
32186
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
32108
32187
|
if (!vueCompiler) {
|
|
32109
32188
|
vueCompiler = await loadVueCompiler();
|
|
@@ -32115,8 +32194,8 @@ ${code}`;
|
|
|
32115
32194
|
const compiledScript = hasScript ? vueCompiler.compileScript(descriptor, {
|
|
32116
32195
|
fs: {
|
|
32117
32196
|
fileExists: isFile,
|
|
32118
|
-
realpath:
|
|
32119
|
-
readFile: (file) => isFile(file) ?
|
|
32197
|
+
realpath: realpathSync6,
|
|
32198
|
+
readFile: (file) => isFile(file) ? readFileSync41(file, "utf-8") : undefined
|
|
32120
32199
|
},
|
|
32121
32200
|
id: componentId,
|
|
32122
32201
|
inlineTemplate: false
|
|
@@ -32163,7 +32242,7 @@ ${code}`;
|
|
|
32163
32242
|
}
|
|
32164
32243
|
});
|
|
32165
32244
|
}, handleCssRequest = (filePath) => {
|
|
32166
|
-
const raw =
|
|
32245
|
+
const raw = readFileSync41(filePath, "utf-8");
|
|
32167
32246
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
32168
32247
|
return [
|
|
32169
32248
|
`const style = document.createElement('style');`,
|
|
@@ -32258,7 +32337,7 @@ ${code}`;
|
|
|
32258
32337
|
"Content-Type": "application/javascript"
|
|
32259
32338
|
}
|
|
32260
32339
|
}), buildStubCode = async (specifier, requested = []) => {
|
|
32261
|
-
const discovered = await
|
|
32340
|
+
const discovered = await importFromProject(specifier).then((mod) => Object.keys(mod).filter((key) => key !== "default" && key !== "__esModule"), () => []);
|
|
32262
32341
|
const names = [...new Set([...discovered, ...requested])];
|
|
32263
32342
|
if (names.length === 0)
|
|
32264
32343
|
return `export default {};
|
|
@@ -32292,7 +32371,7 @@ export default {};
|
|
|
32292
32371
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
32293
32372
|
return jsResponse(`var s=document.createElement('style');s.textContent=\`${escaped}\`;s.dataset.svelteHmr=${JSON.stringify(cssCheckPath)};var p=document.querySelector('style[data-svelte-hmr="${cssCheckPath}"]');if(p)p.remove();document.head.appendChild(s);`);
|
|
32294
32373
|
}, resolveSourcePath2 = (relPath, projectRoot) => {
|
|
32295
|
-
const filePath = resolve52(projectRoot, relPath);
|
|
32374
|
+
const filePath = resolve52(projectRoot, decodeSrcPath(relPath));
|
|
32296
32375
|
const ext = extname16(filePath);
|
|
32297
32376
|
if (ext === ".svelte")
|
|
32298
32377
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -32446,7 +32525,7 @@ export default {};
|
|
|
32446
32525
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
32447
32526
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
32448
32527
|
return handleBunWrapRequest();
|
|
32449
|
-
const virtualCssResponse = handleVirtualSvelteCss(resolve52(projectRoot, relPath));
|
|
32528
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve52(projectRoot, decodeSrcPath(relPath)));
|
|
32450
32529
|
if (virtualCssResponse)
|
|
32451
32530
|
return virtualCssResponse;
|
|
32452
32531
|
const { filePath, ext } = resolveSourcePath2(relPath, projectRoot);
|
|
@@ -32465,7 +32544,7 @@ export default {};
|
|
|
32465
32544
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
32466
32545
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
32467
32546
|
if (match[1])
|
|
32468
|
-
files.push(resolve52(projectRoot, match[1]));
|
|
32547
|
+
files.push(resolve52(projectRoot, decodeSrcPath(match[1])));
|
|
32469
32548
|
}
|
|
32470
32549
|
return files;
|
|
32471
32550
|
}, SRC_URL_PREFIX2, invalidateModule = (filePath) => {
|
|
@@ -32850,7 +32929,7 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
32850
32929
|
var init_simpleHTMXHMR = () => {};
|
|
32851
32930
|
|
|
32852
32931
|
// src/dev/backendGraph.ts
|
|
32853
|
-
import { readFileSync as
|
|
32932
|
+
import { readFileSync as readFileSync42, realpathSync as realpathSync7, statSync as statSync10 } from "fs";
|
|
32854
32933
|
import { dirname as dirname36, extname as extname17, resolve as resolve55 } from "path";
|
|
32855
32934
|
var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (path) => {
|
|
32856
32935
|
const loader = LOADERS[extname17(path)] ?? "ts";
|
|
@@ -32862,7 +32941,7 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
|
|
|
32862
32941
|
return created;
|
|
32863
32942
|
}, realPath2 = (path) => {
|
|
32864
32943
|
try {
|
|
32865
|
-
return
|
|
32944
|
+
return realpathSync7(path);
|
|
32866
32945
|
} catch {
|
|
32867
32946
|
return path;
|
|
32868
32947
|
}
|
|
@@ -32885,7 +32964,7 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
|
|
|
32885
32964
|
return cached.imports;
|
|
32886
32965
|
let imports = [];
|
|
32887
32966
|
try {
|
|
32888
|
-
const source =
|
|
32967
|
+
const source = readFileSync42(path, "utf-8");
|
|
32889
32968
|
imports = transpilerFor(path).scanImports(source).map((entry) => resolveImport(entry.path, path)).filter((target) => target !== undefined);
|
|
32890
32969
|
} catch {}
|
|
32891
32970
|
fileCache.set(path, { imports, mtimeMs });
|
|
@@ -33683,11 +33762,11 @@ var init_runtime = __esm(() => {
|
|
|
33683
33762
|
});
|
|
33684
33763
|
|
|
33685
33764
|
// src/dev/hot/plugin.ts
|
|
33686
|
-
import { mkdirSync as mkdirSync16, readFileSync as
|
|
33687
|
-
import { extname as extname19, join as
|
|
33765
|
+
import { mkdirSync as mkdirSync16, readFileSync as readFileSync43, realpathSync as realpathSync8, writeFileSync as writeFileSync11 } from "fs";
|
|
33766
|
+
import { extname as extname19, join as join63, relative as relative25, resolve as resolve56, sep as sep8 } from "path";
|
|
33688
33767
|
var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
33689
33768
|
try {
|
|
33690
|
-
return
|
|
33769
|
+
return realpathSync8(path);
|
|
33691
33770
|
} catch {
|
|
33692
33771
|
return path;
|
|
33693
33772
|
}
|
|
@@ -33701,13 +33780,14 @@ var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
|
33701
33780
|
const file = realPath3(path);
|
|
33702
33781
|
if (!SOURCE.test(file))
|
|
33703
33782
|
return false;
|
|
33704
|
-
|
|
33783
|
+
const root = [state.root, ...state.extraRoots ?? []].find((candidate) => file.startsWith(`${candidate}${sep8}`));
|
|
33784
|
+
if (root === undefined)
|
|
33705
33785
|
return false;
|
|
33706
|
-
if (file.startsWith(`${ABSOLUTE_ROOT}${
|
|
33786
|
+
if (file.startsWith(`${ABSOLUTE_ROOT}${sep8}src${sep8}`))
|
|
33707
33787
|
return false;
|
|
33708
|
-
if (file.startsWith(`${ABSOLUTE_ROOT}${
|
|
33788
|
+
if (file.startsWith(`${ABSOLUTE_ROOT}${sep8}dist${sep8}`))
|
|
33709
33789
|
return false;
|
|
33710
|
-
if (GENERATED.test(file.slice(
|
|
33790
|
+
if (GENERATED.test(file.slice(root.length)))
|
|
33711
33791
|
return false;
|
|
33712
33792
|
if (TEST_FILE.test(file))
|
|
33713
33793
|
return false;
|
|
@@ -33715,7 +33795,7 @@ var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
|
33715
33795
|
return false;
|
|
33716
33796
|
if (isAbsoluteServerEntryCopyPath(file))
|
|
33717
33797
|
return false;
|
|
33718
|
-
return !state.excludedDirs.some((dir) => file === dir || file.startsWith(`${dir}${
|
|
33798
|
+
return !state.excludedDirs.some((dir) => file === dir || file.startsWith(`${dir}${sep8}`));
|
|
33719
33799
|
}, isAnalysis = (value) => {
|
|
33720
33800
|
if (typeof value !== "object" || value === null)
|
|
33721
33801
|
return false;
|
|
@@ -33723,12 +33803,12 @@ var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
|
33723
33803
|
if (status === false)
|
|
33724
33804
|
return typeof Reflect.get(value, "reason") === "string";
|
|
33725
33805
|
return status === true && typeof Reflect.get(value, "code") === "string" && typeof Reflect.get(value, "exports") === "object" && Array.isArray(Reflect.get(value, "reexports")) && Array.isArray(Reflect.get(value, "plan"));
|
|
33726
|
-
}, cachePath = (cacheDir, key) =>
|
|
33806
|
+
}, cachePath = (cacheDir, key) => join63(cacheDir, `${key}.json`), readCached = (key) => {
|
|
33727
33807
|
const state = shared.installed;
|
|
33728
33808
|
if (!state)
|
|
33729
33809
|
return;
|
|
33730
33810
|
try {
|
|
33731
|
-
const cached = JSON.parse(
|
|
33811
|
+
const cached = JSON.parse(readFileSync43(cachePath(state.cacheDir, key), "utf-8"));
|
|
33732
33812
|
return isAnalysis(cached) ? cached : undefined;
|
|
33733
33813
|
} catch {
|
|
33734
33814
|
return;
|
|
@@ -33771,11 +33851,11 @@ var init_plugin = __esm(() => {
|
|
|
33771
33851
|
});
|
|
33772
33852
|
|
|
33773
33853
|
// src/dev/hot/reload.ts
|
|
33774
|
-
import { readFileSync as
|
|
33854
|
+
import { readFileSync as readFileSync44, realpathSync as realpathSync9 } from "fs";
|
|
33775
33855
|
import { relative as relative26 } from "path";
|
|
33776
33856
|
var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
|
|
33777
33857
|
try {
|
|
33778
|
-
return
|
|
33858
|
+
return realpathSync9(path);
|
|
33779
33859
|
} catch {
|
|
33780
33860
|
return path;
|
|
33781
33861
|
}
|
|
@@ -33849,7 +33929,7 @@ var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
|
|
|
33849
33929
|
return { status: "entry" };
|
|
33850
33930
|
if (!moduleRecord(path) || !isHotManaged(path))
|
|
33851
33931
|
return { status: "unmanaged" };
|
|
33852
|
-
const source =
|
|
33932
|
+
const source = readFileSync44(path, "utf-8");
|
|
33853
33933
|
if (moduleRecord(path)?.source === source)
|
|
33854
33934
|
return { status: "unchanged" };
|
|
33855
33935
|
const analysis = await analyzeSource(path, source);
|
|
@@ -33943,10 +34023,10 @@ import {
|
|
|
33943
34023
|
basename as basename21,
|
|
33944
34024
|
dirname as dirname38,
|
|
33945
34025
|
isAbsolute as isAbsolute10,
|
|
33946
|
-
join as
|
|
34026
|
+
join as join64,
|
|
33947
34027
|
relative as relative27,
|
|
33948
34028
|
resolve as resolvePath4,
|
|
33949
|
-
sep as
|
|
34029
|
+
sep as sep9
|
|
33950
34030
|
} from "path";
|
|
33951
34031
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSsrCssCaches = () => {
|
|
33952
34032
|
clearSpaRouteCssCaches();
|
|
@@ -34070,8 +34150,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34070
34150
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
34071
34151
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd);
|
|
34072
34152
|
for (const candidate of [
|
|
34073
|
-
|
|
34074
|
-
`${
|
|
34153
|
+
join64(generatedDir, relJs),
|
|
34154
|
+
`${join64(generatedDir, relJs)}.map`
|
|
34075
34155
|
]) {
|
|
34076
34156
|
try {
|
|
34077
34157
|
rmSync4(candidate, { force: true });
|
|
@@ -34899,7 +34979,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34899
34979
|
const angularDirAbs = resolvePath4(angularDir);
|
|
34900
34980
|
const filesUnderAngular = Array.from(editedFiles).filter((file) => {
|
|
34901
34981
|
const abs = resolvePath4(file);
|
|
34902
|
-
return abs === angularDirAbs || abs.startsWith(angularDirAbs +
|
|
34982
|
+
return abs === angularDirAbs || abs.startsWith(angularDirAbs + sep9);
|
|
34903
34983
|
});
|
|
34904
34984
|
if (filesUnderAngular.length === 0)
|
|
34905
34985
|
return;
|
|
@@ -34995,7 +35075,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
34995
35075
|
const entries = await readdir(dir, { withFileTypes: true });
|
|
34996
35076
|
const files = [];
|
|
34997
35077
|
for (const entry of entries) {
|
|
34998
|
-
const full =
|
|
35078
|
+
const full = join64(dir, entry.name);
|
|
34999
35079
|
if (entry.isDirectory()) {
|
|
35000
35080
|
files.push(...await walk(full));
|
|
35001
35081
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -35097,8 +35177,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35097
35177
|
}, getModuleUrl = async (pageFile) => {
|
|
35098
35178
|
await Promise.resolve().then(() => init_moduleServer());
|
|
35099
35179
|
invalidateModule(pageFile);
|
|
35100
|
-
|
|
35101
|
-
const url = `${SRC_URL_PREFIX2}${
|
|
35180
|
+
await Promise.resolve();
|
|
35181
|
+
const url = `${SRC_URL_PREFIX2}${encodeSrcPath(relative27(process.cwd(), pageFile))}`;
|
|
35102
35182
|
await warmCache(url);
|
|
35103
35183
|
return url;
|
|
35104
35184
|
}, getReactModuleUrl, isReactComponentPath = (file) => file.endsWith(".tsx") || file.endsWith(".jsx"), isReactPagePath = (file) => file.replace(/\\/g, "/").includes("/pages/"), isImportableModule = (file) => {
|
|
@@ -35630,7 +35710,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
35630
35710
|
} = await compileVue(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
35631
35711
|
const serverEntries = [...vueServerPaths];
|
|
35632
35712
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
35633
|
-
const cssOutDir =
|
|
35713
|
+
const cssOutDir = join64(buildDir, state.resolvedPaths.assetsDir ? basename21(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
35634
35714
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
35635
35715
|
const serverExternals = await getServerBundleExternals();
|
|
35636
35716
|
const serverExternalsPlugins = await getServerBundleExternalsPlugins(state.config);
|
|
@@ -36743,7 +36823,7 @@ var init_rebuildTrigger = __esm(() => {
|
|
|
36743
36823
|
// src/build/buildDepVendor.ts
|
|
36744
36824
|
import { mkdirSync as mkdirSync17 } from "fs";
|
|
36745
36825
|
import { isBuiltin as isBuiltin2 } from "module";
|
|
36746
|
-
import { join as
|
|
36826
|
+
import { join as join65 } from "path";
|
|
36747
36827
|
import { rm as rm15 } from "fs/promises";
|
|
36748
36828
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
36749
36829
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -36761,7 +36841,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
36761
36841
|
} catch {
|
|
36762
36842
|
return false;
|
|
36763
36843
|
}
|
|
36764
|
-
}, isBareSpecifier3 = (spec) => !spec.startsWith(".") && !spec.startsWith("/") && !spec.startsWith("@src/"), isAbsolutePackageSpecifier = (spec) => spec === "@absolutejs/absolute" || spec.startsWith("@absolutejs/absolute/"), FRAMEWORK_SPECIFIERS, FRAMEWORK_NAMESPACE_PREFIXES, isFrameworkSpecifier = (spec) => FRAMEWORK_SPECIFIERS.has(spec) || FRAMEWORK_NAMESPACE_PREFIXES.some((prefix) => spec.startsWith(prefix)), FRAMEWORK_EXTERNALS, isSkippedFile = (file) => file.includes("node_modules") || file.includes("/build/") || file.includes("/dist/") || file.includes("/indexes/") || isTestSourcePath(file), isDepSpecifier = (path) => isBareSpecifier3(path) && !isBuiltin2(path) && !isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), isFrameworkRootCandidate = (path) => isBareSpecifier3(path) && isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), readFileSpecifiers = async (file, transpiler) => {
|
|
36844
|
+
}, isBareSpecifier3 = (spec) => !spec.startsWith(".") && !spec.startsWith("/") && !spec.startsWith("@src/"), isAbsolutePackageSpecifier = (spec) => spec === "@absolutejs/absolute" || spec.startsWith("@absolutejs/absolute/"), FRAMEWORK_SPECIFIERS, FRAMEWORK_NAMESPACE_PREFIXES, isFrameworkSpecifier = (spec) => FRAMEWORK_SPECIFIERS.has(spec) || FRAMEWORK_NAMESPACE_PREFIXES.some((prefix) => spec.startsWith(prefix)), FRAMEWORK_EXTERNALS, isSkippedFile = (file) => file.includes("node_modules") || file.includes("/build/") || file.includes("/dist/") || file.includes("/indexes/") || isTestSourcePath(file), isDepSpecifier = (path) => isBareSpecifier3(path) && !isBuiltin2(path) && !isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path) && !isWorkspacePackageSpecifier(path), isFrameworkRootCandidate = (path) => isBareSpecifier3(path) && isFrameworkSpecifier(path) && !isAbsolutePackageSpecifier(path), readFileSpecifiers = async (file, transpiler) => {
|
|
36765
36845
|
const dep = [];
|
|
36766
36846
|
const framework = [];
|
|
36767
36847
|
try {
|
|
@@ -36901,7 +36981,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
36901
36981
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
36902
36982
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
36903
36983
|
const safeName = toSafeFileName6(specifier);
|
|
36904
|
-
const entryPath =
|
|
36984
|
+
const entryPath = join65(tmpDir, `${safeName}.ts`);
|
|
36905
36985
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
36906
36986
|
return { entryPath, specifier };
|
|
36907
36987
|
}));
|
|
@@ -36992,9 +37072,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
36992
37072
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories, files);
|
|
36993
37073
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
36994
37074
|
return {};
|
|
36995
|
-
const vendorDir =
|
|
37075
|
+
const vendorDir = join65(buildDir, "vendor");
|
|
36996
37076
|
mkdirSync17(vendorDir, { recursive: true });
|
|
36997
|
-
const tmpDir =
|
|
37077
|
+
const tmpDir = join65(buildDir, "_dep_vendor_tmp");
|
|
36998
37078
|
mkdirSync17(tmpDir, { recursive: true });
|
|
36999
37079
|
const allSpecs = new Set(initialSpecs);
|
|
37000
37080
|
const alreadyScanned = new Set;
|
|
@@ -37046,6 +37126,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
37046
37126
|
return paths;
|
|
37047
37127
|
};
|
|
37048
37128
|
var init_buildDepVendor = __esm(() => {
|
|
37129
|
+
init_workspacePackages();
|
|
37049
37130
|
init_vendorEntrySource();
|
|
37050
37131
|
init_startupTimings();
|
|
37051
37132
|
FRAMEWORK_SPECIFIERS = new Set([
|
|
@@ -37083,10 +37164,10 @@ import {
|
|
|
37083
37164
|
existsSync as existsSync47,
|
|
37084
37165
|
mkdirSync as mkdirSync18,
|
|
37085
37166
|
readdirSync as readdirSync14,
|
|
37086
|
-
readFileSync as
|
|
37167
|
+
readFileSync as readFileSync45
|
|
37087
37168
|
} from "fs";
|
|
37088
37169
|
import { mkdir as mkdir16, readFile as readFile12, rename as rename7, rm as rm16, writeFile as writeFile14 } from "fs/promises";
|
|
37089
|
-
import { basename as basename22, join as
|
|
37170
|
+
import { basename as basename22, join as join66, resolve as resolve57 } from "path";
|
|
37090
37171
|
var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeVendorCacheKey = (inputs) => {
|
|
37091
37172
|
const hash = createHash11("sha256");
|
|
37092
37173
|
hash.update(String(CACHE_FORMAT_VERSION3));
|
|
@@ -37113,19 +37194,19 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
37113
37194
|
const hash = createHash11("sha256");
|
|
37114
37195
|
let found = false;
|
|
37115
37196
|
for (const name of LOCKFILES) {
|
|
37116
|
-
const path =
|
|
37197
|
+
const path = join66(projectRoot, name);
|
|
37117
37198
|
if (!existsSync47(path))
|
|
37118
37199
|
continue;
|
|
37119
37200
|
found = true;
|
|
37120
37201
|
hash.update(name);
|
|
37121
|
-
hash.update(
|
|
37202
|
+
hash.update(readFileSync45(path));
|
|
37122
37203
|
}
|
|
37123
37204
|
return found ? hash.digest("hex") : null;
|
|
37124
37205
|
}, vendorCacheEnabled = () => process.env.ABSOLUTE_DEV_VENDOR_CACHE !== "0", copyTree = (fromDir, toDir) => {
|
|
37125
37206
|
mkdirSync18(toDir, { recursive: true });
|
|
37126
37207
|
for (const entry of readdirSync14(fromDir, { withFileTypes: true })) {
|
|
37127
|
-
const source =
|
|
37128
|
-
const destination =
|
|
37208
|
+
const source = join66(fromDir, entry.name);
|
|
37209
|
+
const destination = join66(toDir, entry.name);
|
|
37129
37210
|
if (entry.isDirectory())
|
|
37130
37211
|
copyTree(source, destination);
|
|
37131
37212
|
else
|
|
@@ -37133,7 +37214,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
37133
37214
|
}
|
|
37134
37215
|
}, copySlotsInto = (cacheDir, vendorDirs) => {
|
|
37135
37216
|
for (const [index, dir] of vendorDirs.entries()) {
|
|
37136
|
-
const source =
|
|
37217
|
+
const source = join66(cacheDir, slotName(index, dir));
|
|
37137
37218
|
if (!existsSync47(source)) {
|
|
37138
37219
|
throw new Error(`missing cached vendor dir ${source}`);
|
|
37139
37220
|
}
|
|
@@ -37143,11 +37224,11 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
37143
37224
|
for (const [index, dir] of vendorDirs.entries()) {
|
|
37144
37225
|
if (!existsSync47(dir))
|
|
37145
37226
|
continue;
|
|
37146
|
-
copyTree(dir,
|
|
37227
|
+
copyTree(dir, join66(stagingDir, slotName(index, dir)));
|
|
37147
37228
|
}
|
|
37148
37229
|
}, isVendorCachePayload = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "depPaths") === "object", cacheDirFor = (key, projectRoot) => resolve57(projectRoot, CACHE_ROOT2, key), slotName = (index, dir) => `${index}-${basename22(resolve57(dir, ".."))}`, restoreVendorCache = async (key, vendorDirs, projectRoot = process.cwd()) => {
|
|
37149
37230
|
const cacheDir = cacheDirFor(key, projectRoot);
|
|
37150
|
-
const payloadPath =
|
|
37231
|
+
const payloadPath = join66(cacheDir, "payload.json");
|
|
37151
37232
|
if (!existsSync47(payloadPath))
|
|
37152
37233
|
return null;
|
|
37153
37234
|
try {
|
|
@@ -37161,14 +37242,14 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
37161
37242
|
}
|
|
37162
37243
|
}, saveVendorCache = async (key, vendorDirs, payload, projectRoot = process.cwd()) => {
|
|
37163
37244
|
const cacheDir = cacheDirFor(key, projectRoot);
|
|
37164
|
-
if (existsSync47(
|
|
37245
|
+
if (existsSync47(join66(cacheDir, "payload.json")))
|
|
37165
37246
|
return;
|
|
37166
37247
|
const stagingDir = `${cacheDir}.${process.pid}.tmp`;
|
|
37167
37248
|
try {
|
|
37168
37249
|
await rm16(stagingDir, { force: true, recursive: true });
|
|
37169
37250
|
await mkdir16(stagingDir, { recursive: true });
|
|
37170
37251
|
copySlotsFrom(stagingDir, vendorDirs);
|
|
37171
|
-
await writeFile14(
|
|
37252
|
+
await writeFile14(join66(stagingDir, "payload.json"), JSON.stringify(payload));
|
|
37172
37253
|
await rm16(cacheDir, { force: true, recursive: true });
|
|
37173
37254
|
await rename7(stagingDir, cacheDir);
|
|
37174
37255
|
} catch {
|
|
@@ -37178,7 +37259,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
37178
37259
|
}
|
|
37179
37260
|
};
|
|
37180
37261
|
var init_vendorCache = __esm(() => {
|
|
37181
|
-
CACHE_ROOT2 =
|
|
37262
|
+
CACHE_ROOT2 = join66(".absolutejs", "vendor-cache");
|
|
37182
37263
|
LOCKFILES = [
|
|
37183
37264
|
"bun.lock",
|
|
37184
37265
|
"bun.lockb",
|
|
@@ -37746,5 +37827,5 @@ export {
|
|
|
37746
37827
|
devBuild
|
|
37747
37828
|
};
|
|
37748
37829
|
|
|
37749
|
-
//# debugId=
|
|
37830
|
+
//# debugId=5CC37A06E132748E64756E2164756E21
|
|
37750
37831
|
//# sourceMappingURL=build.js.map
|