@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/index.js
CHANGED
|
@@ -9625,6 +9625,17 @@ var init_hotResources = __esm(() => {
|
|
|
9625
9625
|
};
|
|
9626
9626
|
});
|
|
9627
9627
|
|
|
9628
|
+
// src/dev/srcPath.ts
|
|
9629
|
+
var UP_SEGMENT = "@up", PARENT_SEGMENT = "..", mapLeading = (path, source, target) => {
|
|
9630
|
+
const segments = path.split("/");
|
|
9631
|
+
let index = 0;
|
|
9632
|
+
while (segments[index] === source) {
|
|
9633
|
+
segments[index] = target;
|
|
9634
|
+
index += 1;
|
|
9635
|
+
}
|
|
9636
|
+
return segments.join("/");
|
|
9637
|
+
}, decodeSrcPath = (srcPath) => mapLeading(srcPath, UP_SEGMENT, PARENT_SEGMENT), encodeSrcPath = (relativePath) => mapLeading(relativePath.replace(/\\/g, "/"), PARENT_SEGMENT, UP_SEGMENT);
|
|
9638
|
+
|
|
9628
9639
|
// src/plugins/openApiPlugin.ts
|
|
9629
9640
|
import { existsSync as existsSync6, readFileSync as readFileSync8 } from "fs";
|
|
9630
9641
|
import { join as join11 } from "path";
|
|
@@ -15990,7 +16001,7 @@ var PAGE_EXTENSIONS, KEY_SUFFIXES, SRC_URL_PREFIX = "/@src/", isTruthyFlag2 = (v
|
|
|
15990
16001
|
const extension = PAGE_EXTENSIONS[framework].find((ext) => existsSync22(join29(dir, `${name}${ext}`)));
|
|
15991
16002
|
return extension === undefined ? undefined : toDevPageEntry(framework, join29(dir, `${name}${extension}`));
|
|
15992
16003
|
}, resolveSourcePath = (keyOrPath) => {
|
|
15993
|
-
const stripped = keyOrPath.startsWith(SRC_URL_PREFIX) ? keyOrPath.slice(SRC_URL_PREFIX.length).split("?")[0] ?? "" : keyOrPath;
|
|
16004
|
+
const stripped = keyOrPath.startsWith(SRC_URL_PREFIX) ? decodeSrcPath(keyOrPath.slice(SRC_URL_PREFIX.length).split("?")[0] ?? "") : keyOrPath;
|
|
15994
16005
|
return isAbsolute4(stripped) ? stripped : resolve23(stripped);
|
|
15995
16006
|
}, firstDefined = (candidates, lookup) => {
|
|
15996
16007
|
for (const candidate of candidates) {
|
|
@@ -24784,7 +24795,7 @@ var init_compileAngular = __esm(() => {
|
|
|
24784
24795
|
|
|
24785
24796
|
// node_modules/content-tag/pkg/node/content_tag.cjs
|
|
24786
24797
|
var require_content_tag = __commonJS(function(exports, module) {
|
|
24787
|
-
var __dirname = "/home/alexkahn/abs/absolutejs
|
|
24798
|
+
var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/content-tag/pkg/node";
|
|
24788
24799
|
var imports = {};
|
|
24789
24800
|
imports["__wbindgen_placeholder__"] = exports;
|
|
24790
24801
|
var wasm;
|
|
@@ -25451,6 +25462,15 @@ var init_compileEmber = __esm(() => {
|
|
|
25451
25462
|
});
|
|
25452
25463
|
});
|
|
25453
25464
|
|
|
25465
|
+
// src/build/importFromProject.ts
|
|
25466
|
+
var importFromProject = (specifier, projectRoot = process.cwd()) => {
|
|
25467
|
+
let target = specifier;
|
|
25468
|
+
try {
|
|
25469
|
+
target = Bun.resolveSync(specifier, projectRoot);
|
|
25470
|
+
} catch {}
|
|
25471
|
+
return import(target);
|
|
25472
|
+
};
|
|
25473
|
+
|
|
25454
25474
|
// src/build/buildReactVendor.ts
|
|
25455
25475
|
import { existsSync as existsSync36, mkdirSync as mkdirSync8 } from "fs";
|
|
25456
25476
|
import { join as join48, resolve as resolve38 } from "path";
|
|
@@ -25490,7 +25510,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
25490
25510
|
return `export * from '${reactRefreshRuntimePath}';
|
|
25491
25511
|
`;
|
|
25492
25512
|
}
|
|
25493
|
-
const mod = await
|
|
25513
|
+
const mod = await importFromProject(specifier);
|
|
25494
25514
|
const exportNames = Object.keys(mod).filter((key) => key !== "default" && key !== "__esModule");
|
|
25495
25515
|
const lines = [];
|
|
25496
25516
|
if (exportNames.length > 0) {
|
|
@@ -25547,7 +25567,7 @@ var init_buildReactVendor = __esm(() => {
|
|
|
25547
25567
|
|
|
25548
25568
|
// src/build/vendorEntrySource.ts
|
|
25549
25569
|
var RESERVED_KEYS, VALID_IDENTIFIER, generateVendorEntrySource = async (specifier) => {
|
|
25550
|
-
const mod = await
|
|
25570
|
+
const mod = await importFromProject(specifier);
|
|
25551
25571
|
const exportKeys = Object.keys(mod).filter((key) => !RESERVED_KEYS.has(key) && VALID_IDENTIFIER.test(key));
|
|
25552
25572
|
const localBindings = exportKeys.map((key, i) => `const __abs_${i} = __abs_ns[${JSON.stringify(key)}];`).join(`
|
|
25553
25573
|
`);
|
|
@@ -25556,7 +25576,7 @@ var RESERVED_KEYS, VALID_IDENTIFIER, generateVendorEntrySource = async (specifie
|
|
|
25556
25576
|
return `import * as __abs_ns from '${specifier}';
|
|
25557
25577
|
` + (localBindings ? `${localBindings}
|
|
25558
25578
|
` : "") + reExportClause + `export default __abs_ns.default;
|
|
25559
|
-
export const __ABSOLUTE_VENDOR_NAMESPACE__ = __abs_ns;
|
|
25579
|
+
` + `export const __ABSOLUTE_VENDOR_NAMESPACE__ = __abs_ns;
|
|
25560
25580
|
`;
|
|
25561
25581
|
};
|
|
25562
25582
|
var init_vendorEntrySource = __esm(() => {
|
|
@@ -27926,6 +27946,49 @@ var init_buildEmberVendor = __esm(() => {
|
|
|
27926
27946
|
]);
|
|
27927
27947
|
});
|
|
27928
27948
|
|
|
27949
|
+
// src/build/workspacePackages.ts
|
|
27950
|
+
import { readFileSync as readFileSync34, realpathSync as realpathSync3 } from "fs";
|
|
27951
|
+
import { join as join54, sep as sep7 } from "path";
|
|
27952
|
+
var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, projectRoot = process.cwd()) => {
|
|
27953
|
+
const key = `${projectRoot}\x00${specifier}`;
|
|
27954
|
+
const known = verdicts.get(key);
|
|
27955
|
+
if (known !== undefined)
|
|
27956
|
+
return known;
|
|
27957
|
+
let verdict = false;
|
|
27958
|
+
try {
|
|
27959
|
+
const resolved = realpathSync3(Bun.resolveSync(specifier, projectRoot));
|
|
27960
|
+
verdict = !resolved.includes(NODE_MODULES_SEGMENT);
|
|
27961
|
+
} catch {
|
|
27962
|
+
verdict = false;
|
|
27963
|
+
}
|
|
27964
|
+
verdicts.set(key, verdict);
|
|
27965
|
+
return verdict;
|
|
27966
|
+
}, workspacePackageDirs = (projectRoot = process.cwd()) => {
|
|
27967
|
+
let manifest;
|
|
27968
|
+
try {
|
|
27969
|
+
manifest = JSON.parse(readFileSync34(join54(projectRoot, "package.json"), "utf-8"));
|
|
27970
|
+
} catch {
|
|
27971
|
+
return [];
|
|
27972
|
+
}
|
|
27973
|
+
const names = ["dependencies", "devDependencies", "optionalDependencies"].flatMap((field) => {
|
|
27974
|
+
const deps = manifest[field];
|
|
27975
|
+
return deps && typeof deps === "object" ? Object.keys(deps) : [];
|
|
27976
|
+
});
|
|
27977
|
+
const dirs = new Set;
|
|
27978
|
+
for (const name of names) {
|
|
27979
|
+
try {
|
|
27980
|
+
const linked = realpathSync3(join54(projectRoot, "node_modules", name));
|
|
27981
|
+
if (!`${linked}${sep7}`.includes(NODE_MODULES_SEGMENT))
|
|
27982
|
+
dirs.add(linked);
|
|
27983
|
+
} catch {}
|
|
27984
|
+
}
|
|
27985
|
+
return [...dirs];
|
|
27986
|
+
};
|
|
27987
|
+
var init_workspacePackages = __esm(() => {
|
|
27988
|
+
NODE_MODULES_SEGMENT = `${sep7}node_modules${sep7}`;
|
|
27989
|
+
verdicts = new Map;
|
|
27990
|
+
});
|
|
27991
|
+
|
|
27929
27992
|
// src/utils/stripStringsAndComments.ts
|
|
27930
27993
|
var stripStringsAndComments = (source) => {
|
|
27931
27994
|
const { length } = source;
|
|
@@ -28030,7 +28093,7 @@ var stripStringsAndComments = (source) => {
|
|
|
28030
28093
|
};
|
|
28031
28094
|
|
|
28032
28095
|
// src/dev/dependencyGraph.ts
|
|
28033
|
-
import { existsSync as existsSync39, readFileSync as
|
|
28096
|
+
import { existsSync as existsSync39, readFileSync as readFileSync35, realpathSync as realpathSync4 } from "fs";
|
|
28034
28097
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
28035
28098
|
import { resolve as resolve40 } from "path";
|
|
28036
28099
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
@@ -28043,10 +28106,16 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28043
28106
|
return "html";
|
|
28044
28107
|
return null;
|
|
28045
28108
|
}, resolveImportPath2 = (importPath, fromFile) => {
|
|
28109
|
+
const fromDir = resolve40(fromFile, "..");
|
|
28046
28110
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
28047
|
-
|
|
28111
|
+
if (!isWorkspacePackageSpecifier(importPath, fromDir))
|
|
28112
|
+
return null;
|
|
28113
|
+
try {
|
|
28114
|
+
return realpathSync4(Bun.resolveSync(importPath, fromDir));
|
|
28115
|
+
} catch {
|
|
28116
|
+
return null;
|
|
28117
|
+
}
|
|
28048
28118
|
}
|
|
28049
|
-
const fromDir = resolve40(fromFile, "..");
|
|
28050
28119
|
const normalized = resolve40(fromDir, importPath);
|
|
28051
28120
|
const extensions = [
|
|
28052
28121
|
".ts",
|
|
@@ -28201,15 +28270,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28201
28270
|
const lowerPath = filePath.toLowerCase();
|
|
28202
28271
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
28203
28272
|
if (loader === "html") {
|
|
28204
|
-
const content =
|
|
28273
|
+
const content = readFileSync35(filePath, "utf-8");
|
|
28205
28274
|
return extractHtmlDependencies(filePath, content);
|
|
28206
28275
|
}
|
|
28207
28276
|
if (loader === "tsx" || loader === "js") {
|
|
28208
|
-
const content =
|
|
28277
|
+
const content = readFileSync35(filePath, "utf-8");
|
|
28209
28278
|
return extractJsDependencies(filePath, content, loader);
|
|
28210
28279
|
}
|
|
28211
28280
|
if (isSvelteOrVue) {
|
|
28212
|
-
const content =
|
|
28281
|
+
const content = readFileSync35(filePath, "utf-8");
|
|
28213
28282
|
return extractSvelteVueDependencies(filePath, content);
|
|
28214
28283
|
}
|
|
28215
28284
|
return [];
|
|
@@ -28256,6 +28325,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28256
28325
|
removeDependentsForFile(graph, normalizedPath);
|
|
28257
28326
|
};
|
|
28258
28327
|
var init_dependencyGraph = __esm(() => {
|
|
28328
|
+
init_workspacePackages();
|
|
28259
28329
|
emptyDependencyGraph = {
|
|
28260
28330
|
dependencies: new Map,
|
|
28261
28331
|
dependents: new Map
|
|
@@ -28358,7 +28428,7 @@ var init_clientManager = __esm(() => {
|
|
|
28358
28428
|
});
|
|
28359
28429
|
|
|
28360
28430
|
// src/dev/pathUtils.ts
|
|
28361
|
-
import { existsSync as existsSync40, readdirSync as readdirSync8, readFileSync as
|
|
28431
|
+
import { existsSync as existsSync40, readdirSync as readdirSync8, readFileSync as readFileSync36 } from "fs";
|
|
28362
28432
|
import { dirname as dirname29, resolve as resolve42 } from "path";
|
|
28363
28433
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
28364
28434
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
@@ -28458,7 +28528,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28458
28528
|
}
|
|
28459
28529
|
let source;
|
|
28460
28530
|
try {
|
|
28461
|
-
source =
|
|
28531
|
+
source = readFileSync36(full, "utf8");
|
|
28462
28532
|
} catch {
|
|
28463
28533
|
continue;
|
|
28464
28534
|
}
|
|
@@ -28553,6 +28623,11 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28553
28623
|
const extraDirs = config.dev?.watchDirs ?? [];
|
|
28554
28624
|
for (const dir of extraDirs)
|
|
28555
28625
|
push(dir);
|
|
28626
|
+
for (const dir of workspacePackageDirs(cwd)) {
|
|
28627
|
+
const abs = normalizePath2(dir);
|
|
28628
|
+
if (!roots.includes(abs))
|
|
28629
|
+
roots.push(abs);
|
|
28630
|
+
}
|
|
28556
28631
|
if (cfg.angularDir) {
|
|
28557
28632
|
const resourceDirs = collectAngularResourceDirs(cfg.angularDir);
|
|
28558
28633
|
for (const dir of resourceDirs) {
|
|
@@ -28619,14 +28694,15 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28619
28694
|
return false;
|
|
28620
28695
|
};
|
|
28621
28696
|
var init_pathUtils = __esm(() => {
|
|
28697
|
+
init_workspacePackages();
|
|
28622
28698
|
STYLE_EXTENSION_PATTERN2 = /\.(css|s[ac]ss|less|styl(?:us)?)$/i;
|
|
28623
|
-
HARD_DENY_PATTERN = /(^|\/)(build|generated|compiled|indexes|\.absolutejs|node_modules|\.git|\.test-builds|dist)(\/|$)/;
|
|
28699
|
+
HARD_DENY_PATTERN = /(^|\/)(build|generated|compiled|indexes|\.absolutejs|node_modules|\.git|\.test-builds|test-results|playwright-report|blob-report|\.playwright-mcp|\.playwright-artifacts(?:-[^/]+)?|dist)(\/|$)/;
|
|
28624
28700
|
});
|
|
28625
28701
|
|
|
28626
28702
|
// src/dev/devPrescan.ts
|
|
28627
28703
|
import { existsSync as existsSync41, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
28628
28704
|
import { mkdir as mkdir13, readFile as readFile8, rename as rename4, writeFile as writeFile11 } from "fs/promises";
|
|
28629
|
-
import { join as
|
|
28705
|
+
import { join as join55 } from "path";
|
|
28630
28706
|
var PRESCAN_DIR, PAYLOAD_VERSION = 1, POLL_INTERVAL_MS = 10, DEFAULT_WAIT_MS = 2000, collectConfigVendorSourceDirs = (config) => Array.from(new Set([
|
|
28631
28707
|
config.reactDirectory,
|
|
28632
28708
|
config.svelteDirectory,
|
|
@@ -28684,7 +28760,7 @@ var init_devPrescan = __esm(() => {
|
|
|
28684
28760
|
init_configResolver();
|
|
28685
28761
|
init_dependencyGraph();
|
|
28686
28762
|
init_pathUtils();
|
|
28687
|
-
PRESCAN_DIR =
|
|
28763
|
+
PRESCAN_DIR = join55(".absolutejs", "dev-prescan");
|
|
28688
28764
|
});
|
|
28689
28765
|
|
|
28690
28766
|
// src/dev/serverEntryCopies.ts
|
|
@@ -28694,7 +28770,7 @@ var init_serverEntryCopies = () => {};
|
|
|
28694
28770
|
// src/dev/fileWatcher.ts
|
|
28695
28771
|
import { watch } from "fs";
|
|
28696
28772
|
import { existsSync as existsSync42, readdirSync as readdirSync10, statSync as statSync6 } from "fs";
|
|
28697
|
-
import { dirname as dirname30, join as
|
|
28773
|
+
import { dirname as dirname30, join as join56, resolve as resolve43 } from "path";
|
|
28698
28774
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
28699
28775
|
try {
|
|
28700
28776
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -28726,7 +28802,9 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28726
28802
|
for (const name of entries) {
|
|
28727
28803
|
if (shouldSkipFilename(name, isStylesDir))
|
|
28728
28804
|
continue;
|
|
28729
|
-
const child =
|
|
28805
|
+
const child = join56(eventDir, name).replace(/\\/g, "/");
|
|
28806
|
+
if (shouldIgnorePath(child, state.resolvedPaths))
|
|
28807
|
+
continue;
|
|
28730
28808
|
let st;
|
|
28731
28809
|
try {
|
|
28732
28810
|
st = statSync6(child);
|
|
@@ -28747,7 +28825,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28747
28825
|
return;
|
|
28748
28826
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
28749
28827
|
if (event === "rename") {
|
|
28750
|
-
const eventDir = dirname30(
|
|
28828
|
+
const eventDir = dirname30(join56(absolutePath, filename)).replace(/\\/g, "/");
|
|
28751
28829
|
atomicRecoveryScan(eventDir);
|
|
28752
28830
|
for (const delay of [25, 100]) {
|
|
28753
28831
|
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
@@ -28756,7 +28834,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28756
28834
|
}
|
|
28757
28835
|
return;
|
|
28758
28836
|
}
|
|
28759
|
-
const fullPath =
|
|
28837
|
+
const fullPath = join56(absolutePath, filename).replace(/\\/g, "/");
|
|
28760
28838
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
28761
28839
|
return;
|
|
28762
28840
|
}
|
|
@@ -28933,10 +29011,10 @@ var init_assetStore = __esm(() => {
|
|
|
28933
29011
|
});
|
|
28934
29012
|
|
|
28935
29013
|
// src/dev/restartScope.ts
|
|
28936
|
-
import { realpathSync as
|
|
29014
|
+
import { realpathSync as realpathSync5 } from "fs";
|
|
28937
29015
|
var MODULE_FILE, DOCUMENT_FILE, realPath = (path) => {
|
|
28938
29016
|
try {
|
|
28939
|
-
return
|
|
29017
|
+
return realpathSync5(path);
|
|
28940
29018
|
} catch {
|
|
28941
29019
|
return path;
|
|
28942
29020
|
}
|
|
@@ -28953,10 +29031,10 @@ var init_restartScope = __esm(() => {
|
|
|
28953
29031
|
});
|
|
28954
29032
|
|
|
28955
29033
|
// src/dev/fileHashTracker.ts
|
|
28956
|
-
import { readFileSync as
|
|
29034
|
+
import { readFileSync as readFileSync37, statSync as statSync7 } from "fs";
|
|
28957
29035
|
var computeFileHash = (filePath) => {
|
|
28958
29036
|
try {
|
|
28959
|
-
const fileContent =
|
|
29037
|
+
const fileContent = readFileSync37(filePath);
|
|
28960
29038
|
return Number(Bun.hash(fileContent));
|
|
28961
29039
|
} catch {
|
|
28962
29040
|
return UNFOUND_INDEX;
|
|
@@ -29281,8 +29359,8 @@ __export(exports_resolveOwningComponents, {
|
|
|
29281
29359
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
29282
29360
|
resolveOwningComponents: () => resolveOwningComponents
|
|
29283
29361
|
});
|
|
29284
|
-
import { readdirSync as readdirSync11, readFileSync as
|
|
29285
|
-
import { dirname as dirname32, extname as extname15, join as
|
|
29362
|
+
import { readdirSync as readdirSync11, readFileSync as readFileSync38, statSync as statSync8 } from "fs";
|
|
29363
|
+
import { dirname as dirname32, extname as extname15, join as join57, resolve as resolve48 } from "path";
|
|
29286
29364
|
import ts19 from "typescript";
|
|
29287
29365
|
var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || file.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
29288
29366
|
const out = [];
|
|
@@ -29297,7 +29375,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29297
29375
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
29298
29376
|
continue;
|
|
29299
29377
|
}
|
|
29300
|
-
const full =
|
|
29378
|
+
const full = join57(dir, entry.name);
|
|
29301
29379
|
if (entry.isDirectory()) {
|
|
29302
29380
|
visit(full);
|
|
29303
29381
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -29341,7 +29419,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29341
29419
|
}, parseDecoratedClasses = (filePath) => {
|
|
29342
29420
|
let source;
|
|
29343
29421
|
try {
|
|
29344
|
-
source =
|
|
29422
|
+
source = readFileSync38(filePath, "utf8");
|
|
29345
29423
|
} catch {
|
|
29346
29424
|
return [];
|
|
29347
29425
|
}
|
|
@@ -29431,7 +29509,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29431
29509
|
}, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
|
|
29432
29510
|
let source;
|
|
29433
29511
|
try {
|
|
29434
|
-
source =
|
|
29512
|
+
source = readFileSync38(childFilePath, "utf8");
|
|
29435
29513
|
} catch {
|
|
29436
29514
|
return null;
|
|
29437
29515
|
}
|
|
@@ -29764,8 +29842,8 @@ __export(exports_moduleServer, {
|
|
|
29764
29842
|
warmPage: () => warmPage,
|
|
29765
29843
|
warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
|
|
29766
29844
|
});
|
|
29767
|
-
import { existsSync as existsSync43, readFileSync as
|
|
29768
|
-
import { basename as basename19, dirname as dirname33, extname as extname16, join as
|
|
29845
|
+
import { existsSync as existsSync43, readFileSync as readFileSync39, realpathSync as realpathSync6, statSync as statSync9 } from "fs";
|
|
29846
|
+
import { basename as basename19, dirname as dirname33, extname as extname16, join as join58, resolve as resolve49, relative as relative22 } from "path";
|
|
29769
29847
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
29770
29848
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
29771
29849
|
const allExports = [];
|
|
@@ -29816,7 +29894,7 @@ ${stubs}
|
|
|
29816
29894
|
const invalidationVersion = getInvalidationVersion(absPath);
|
|
29817
29895
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
29818
29896
|
}, srcUrl = (relPath, projectRoot) => {
|
|
29819
|
-
const base = `${SRC_PREFIX}${relPath
|
|
29897
|
+
const base = `${SRC_PREFIX}${encodeSrcPath(relPath)}`;
|
|
29820
29898
|
const absPath = resolve49(projectRoot, relPath);
|
|
29821
29899
|
const cached = mtimeCache.get(absPath);
|
|
29822
29900
|
if (cached !== undefined)
|
|
@@ -29854,9 +29932,9 @@ ${stubs}
|
|
|
29854
29932
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
29855
29933
|
if (!subpath) {
|
|
29856
29934
|
const pkgDir = resolve49(projectRoot, "node_modules", packageName ?? "");
|
|
29857
|
-
const pkgJsonPath =
|
|
29935
|
+
const pkgJsonPath = join58(pkgDir, "package.json");
|
|
29858
29936
|
if (existsSync43(pkgJsonPath)) {
|
|
29859
|
-
const pkg = JSON.parse(
|
|
29937
|
+
const pkg = JSON.parse(readFileSync39(pkgJsonPath, "utf-8"));
|
|
29860
29938
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
29861
29939
|
if (esmEntry) {
|
|
29862
29940
|
const resolved = resolve49(pkgDir, esmEntry);
|
|
@@ -29908,6 +29986,8 @@ ${stubs}
|
|
|
29908
29986
|
const rel = relative22(projectRoot, absPath).replace(/\\/g, "/");
|
|
29909
29987
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
29910
29988
|
}
|
|
29989
|
+
if (!existsSync43(absPath))
|
|
29990
|
+
return _match;
|
|
29911
29991
|
const rel = relative22(projectRoot, absPath).replace(/\\/g, "/");
|
|
29912
29992
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
29913
29993
|
};
|
|
@@ -29965,7 +30045,7 @@ ${code}`;
|
|
|
29965
30045
|
reactFastRefreshWarningEmitted = true;
|
|
29966
30046
|
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.");
|
|
29967
30047
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
29968
|
-
const raw =
|
|
30048
|
+
const raw = readFileSync39(filePath, "utf-8");
|
|
29969
30049
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
29970
30050
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
29971
30051
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -29981,7 +30061,7 @@ ${transpiled}`;
|
|
|
29981
30061
|
transpiled += buildIslandMetadataExports(raw);
|
|
29982
30062
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
29983
30063
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
29984
|
-
const raw =
|
|
30064
|
+
const raw = readFileSync39(filePath, "utf-8");
|
|
29985
30065
|
const ext = extname16(filePath);
|
|
29986
30066
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
29987
30067
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -30141,13 +30221,13 @@ ${code}`;
|
|
|
30141
30221
|
code = `import "${cssUrl}";
|
|
30142
30222
|
${code}`;
|
|
30143
30223
|
}
|
|
30144
|
-
const moduleUrl = `${SRC_PREFIX}${relative22(projectRoot, filePath)
|
|
30224
|
+
const moduleUrl = `${SRC_PREFIX}${encodeSrcPath(relative22(projectRoot, filePath))}`;
|
|
30145
30225
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
30146
30226
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
30147
30227
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
30148
30228
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
30149
30229
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
30150
|
-
const raw =
|
|
30230
|
+
const raw = readFileSync39(filePath, "utf-8");
|
|
30151
30231
|
if (!svelteCompiler) {
|
|
30152
30232
|
svelteCompiler = await import("svelte/compiler");
|
|
30153
30233
|
}
|
|
@@ -30213,7 +30293,7 @@ export default __script__;`;
|
|
|
30213
30293
|
return `${cssInjection}
|
|
30214
30294
|
${code}`;
|
|
30215
30295
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
30216
|
-
const rawSource =
|
|
30296
|
+
const rawSource = readFileSync39(filePath, "utf-8");
|
|
30217
30297
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
30218
30298
|
if (!vueCompiler) {
|
|
30219
30299
|
vueCompiler = await loadVueCompiler();
|
|
@@ -30225,8 +30305,8 @@ ${code}`;
|
|
|
30225
30305
|
const compiledScript = hasScript ? vueCompiler.compileScript(descriptor, {
|
|
30226
30306
|
fs: {
|
|
30227
30307
|
fileExists: isFile,
|
|
30228
|
-
realpath:
|
|
30229
|
-
readFile: (file) => isFile(file) ?
|
|
30308
|
+
realpath: realpathSync6,
|
|
30309
|
+
readFile: (file) => isFile(file) ? readFileSync39(file, "utf-8") : undefined
|
|
30230
30310
|
},
|
|
30231
30311
|
id: componentId,
|
|
30232
30312
|
inlineTemplate: false
|
|
@@ -30273,7 +30353,7 @@ ${code}`;
|
|
|
30273
30353
|
}
|
|
30274
30354
|
});
|
|
30275
30355
|
}, handleCssRequest = (filePath) => {
|
|
30276
|
-
const raw =
|
|
30356
|
+
const raw = readFileSync39(filePath, "utf-8");
|
|
30277
30357
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
30278
30358
|
return [
|
|
30279
30359
|
`const style = document.createElement('style');`,
|
|
@@ -30368,7 +30448,7 @@ ${code}`;
|
|
|
30368
30448
|
"Content-Type": "application/javascript"
|
|
30369
30449
|
}
|
|
30370
30450
|
}), buildStubCode = async (specifier, requested = []) => {
|
|
30371
|
-
const discovered = await
|
|
30451
|
+
const discovered = await importFromProject(specifier).then((mod) => Object.keys(mod).filter((key) => key !== "default" && key !== "__esModule"), () => []);
|
|
30372
30452
|
const names = [...new Set([...discovered, ...requested])];
|
|
30373
30453
|
if (names.length === 0)
|
|
30374
30454
|
return `export default {};
|
|
@@ -30402,7 +30482,7 @@ export default {};
|
|
|
30402
30482
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
30403
30483
|
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);`);
|
|
30404
30484
|
}, resolveSourcePath2 = (relPath, projectRoot) => {
|
|
30405
|
-
const filePath = resolve49(projectRoot, relPath);
|
|
30485
|
+
const filePath = resolve49(projectRoot, decodeSrcPath(relPath));
|
|
30406
30486
|
const ext = extname16(filePath);
|
|
30407
30487
|
if (ext === ".svelte")
|
|
30408
30488
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -30556,7 +30636,7 @@ export default {};
|
|
|
30556
30636
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
30557
30637
|
if (relPath === "bun:wrap" || relPath.startsWith("bun:wrap?"))
|
|
30558
30638
|
return handleBunWrapRequest();
|
|
30559
|
-
const virtualCssResponse = handleVirtualSvelteCss(resolve49(projectRoot, relPath));
|
|
30639
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve49(projectRoot, decodeSrcPath(relPath)));
|
|
30560
30640
|
if (virtualCssResponse)
|
|
30561
30641
|
return virtualCssResponse;
|
|
30562
30642
|
const { filePath, ext } = resolveSourcePath2(relPath, projectRoot);
|
|
@@ -30575,7 +30655,7 @@ export default {};
|
|
|
30575
30655
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
30576
30656
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
30577
30657
|
if (match[1])
|
|
30578
|
-
files.push(resolve49(projectRoot, match[1]));
|
|
30658
|
+
files.push(resolve49(projectRoot, decodeSrcPath(match[1])));
|
|
30579
30659
|
}
|
|
30580
30660
|
return files;
|
|
30581
30661
|
}, SRC_URL_PREFIX2, invalidateModule = (filePath) => {
|
|
@@ -30964,7 +31044,7 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
30964
31044
|
var init_simpleHTMXHMR = () => {};
|
|
30965
31045
|
|
|
30966
31046
|
// src/dev/backendGraph.ts
|
|
30967
|
-
import { readFileSync as
|
|
31047
|
+
import { readFileSync as readFileSync40, realpathSync as realpathSync7, statSync as statSync10 } from "fs";
|
|
30968
31048
|
import { dirname as dirname35, extname as extname17, resolve as resolve53 } from "path";
|
|
30969
31049
|
var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (path) => {
|
|
30970
31050
|
const loader = LOADERS[extname17(path)] ?? "ts";
|
|
@@ -30976,7 +31056,7 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
|
|
|
30976
31056
|
return created;
|
|
30977
31057
|
}, realPath2 = (path) => {
|
|
30978
31058
|
try {
|
|
30979
|
-
return
|
|
31059
|
+
return realpathSync7(path);
|
|
30980
31060
|
} catch {
|
|
30981
31061
|
return path;
|
|
30982
31062
|
}
|
|
@@ -30999,7 +31079,7 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
|
|
|
30999
31079
|
return cached.imports;
|
|
31000
31080
|
let imports = [];
|
|
31001
31081
|
try {
|
|
31002
|
-
const source =
|
|
31082
|
+
const source = readFileSync40(path, "utf-8");
|
|
31003
31083
|
imports = transpilerFor(path).scanImports(source).map((entry) => resolveImport(entry.path, path)).filter((target) => target !== undefined);
|
|
31004
31084
|
} catch {}
|
|
31005
31085
|
fileCache.set(path, { imports, mtimeMs });
|
|
@@ -31797,11 +31877,11 @@ var init_runtime = __esm(() => {
|
|
|
31797
31877
|
});
|
|
31798
31878
|
|
|
31799
31879
|
// src/dev/hot/plugin.ts
|
|
31800
|
-
import { mkdirSync as mkdirSync14, readFileSync as
|
|
31801
|
-
import { extname as extname19, join as
|
|
31880
|
+
import { mkdirSync as mkdirSync14, readFileSync as readFileSync41, realpathSync as realpathSync8, writeFileSync as writeFileSync11 } from "fs";
|
|
31881
|
+
import { extname as extname19, join as join59, relative as relative24, resolve as resolve54, sep as sep8 } from "path";
|
|
31802
31882
|
var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
31803
31883
|
try {
|
|
31804
|
-
return
|
|
31884
|
+
return realpathSync8(path);
|
|
31805
31885
|
} catch {
|
|
31806
31886
|
return path;
|
|
31807
31887
|
}
|
|
@@ -31815,13 +31895,14 @@ var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
|
31815
31895
|
const file = realPath3(path);
|
|
31816
31896
|
if (!SOURCE.test(file))
|
|
31817
31897
|
return false;
|
|
31818
|
-
|
|
31898
|
+
const root = [state.root, ...state.extraRoots ?? []].find((candidate) => file.startsWith(`${candidate}${sep8}`));
|
|
31899
|
+
if (root === undefined)
|
|
31819
31900
|
return false;
|
|
31820
|
-
if (file.startsWith(`${ABSOLUTE_ROOT}${
|
|
31901
|
+
if (file.startsWith(`${ABSOLUTE_ROOT}${sep8}src${sep8}`))
|
|
31821
31902
|
return false;
|
|
31822
|
-
if (file.startsWith(`${ABSOLUTE_ROOT}${
|
|
31903
|
+
if (file.startsWith(`${ABSOLUTE_ROOT}${sep8}dist${sep8}`))
|
|
31823
31904
|
return false;
|
|
31824
|
-
if (GENERATED.test(file.slice(
|
|
31905
|
+
if (GENERATED.test(file.slice(root.length)))
|
|
31825
31906
|
return false;
|
|
31826
31907
|
if (TEST_FILE.test(file))
|
|
31827
31908
|
return false;
|
|
@@ -31829,7 +31910,7 @@ var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
|
31829
31910
|
return false;
|
|
31830
31911
|
if (isAbsoluteServerEntryCopyPath(file))
|
|
31831
31912
|
return false;
|
|
31832
|
-
return !state.excludedDirs.some((dir) => file === dir || file.startsWith(`${dir}${
|
|
31913
|
+
return !state.excludedDirs.some((dir) => file === dir || file.startsWith(`${dir}${sep8}`));
|
|
31833
31914
|
}, isAnalysis = (value) => {
|
|
31834
31915
|
if (typeof value !== "object" || value === null)
|
|
31835
31916
|
return false;
|
|
@@ -31837,12 +31918,12 @@ var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
|
31837
31918
|
if (status === false)
|
|
31838
31919
|
return typeof Reflect.get(value, "reason") === "string";
|
|
31839
31920
|
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"));
|
|
31840
|
-
}, cachePath = (cacheDir, key) =>
|
|
31921
|
+
}, cachePath = (cacheDir, key) => join59(cacheDir, `${key}.json`), readCached = (key) => {
|
|
31841
31922
|
const state = shared.installed;
|
|
31842
31923
|
if (!state)
|
|
31843
31924
|
return;
|
|
31844
31925
|
try {
|
|
31845
|
-
const cached = JSON.parse(
|
|
31926
|
+
const cached = JSON.parse(readFileSync41(cachePath(state.cacheDir, key), "utf-8"));
|
|
31846
31927
|
return isAnalysis(cached) ? cached : undefined;
|
|
31847
31928
|
} catch {
|
|
31848
31929
|
return;
|
|
@@ -31885,11 +31966,11 @@ var init_plugin = __esm(() => {
|
|
|
31885
31966
|
});
|
|
31886
31967
|
|
|
31887
31968
|
// src/dev/hot/reload.ts
|
|
31888
|
-
import { readFileSync as
|
|
31969
|
+
import { readFileSync as readFileSync42, realpathSync as realpathSync9 } from "fs";
|
|
31889
31970
|
import { relative as relative25 } from "path";
|
|
31890
31971
|
var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
|
|
31891
31972
|
try {
|
|
31892
|
-
return
|
|
31973
|
+
return realpathSync9(path);
|
|
31893
31974
|
} catch {
|
|
31894
31975
|
return path;
|
|
31895
31976
|
}
|
|
@@ -31963,7 +32044,7 @@ var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
|
|
|
31963
32044
|
return { status: "entry" };
|
|
31964
32045
|
if (!moduleRecord(path) || !isHotManaged(path))
|
|
31965
32046
|
return { status: "unmanaged" };
|
|
31966
|
-
const source =
|
|
32047
|
+
const source = readFileSync42(path, "utf-8");
|
|
31967
32048
|
if (moduleRecord(path)?.source === source)
|
|
31968
32049
|
return { status: "unchanged" };
|
|
31969
32050
|
const analysis = await analyzeSource(path, source);
|
|
@@ -32057,10 +32138,10 @@ import {
|
|
|
32057
32138
|
basename as basename20,
|
|
32058
32139
|
dirname as dirname37,
|
|
32059
32140
|
isAbsolute as isAbsolute10,
|
|
32060
|
-
join as
|
|
32141
|
+
join as join60,
|
|
32061
32142
|
relative as relative26,
|
|
32062
32143
|
resolve as resolvePath,
|
|
32063
|
-
sep as
|
|
32144
|
+
sep as sep9
|
|
32064
32145
|
} from "path";
|
|
32065
32146
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSsrCssCaches = () => {
|
|
32066
32147
|
clearSpaRouteCssCaches();
|
|
@@ -32184,8 +32265,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32184
32265
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
32185
32266
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd);
|
|
32186
32267
|
for (const candidate of [
|
|
32187
|
-
|
|
32188
|
-
`${
|
|
32268
|
+
join60(generatedDir, relJs),
|
|
32269
|
+
`${join60(generatedDir, relJs)}.map`
|
|
32189
32270
|
]) {
|
|
32190
32271
|
try {
|
|
32191
32272
|
rmSync4(candidate, { force: true });
|
|
@@ -33013,7 +33094,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33013
33094
|
const angularDirAbs = resolvePath(angularDir);
|
|
33014
33095
|
const filesUnderAngular = Array.from(editedFiles).filter((file) => {
|
|
33015
33096
|
const abs = resolvePath(file);
|
|
33016
|
-
return abs === angularDirAbs || abs.startsWith(angularDirAbs +
|
|
33097
|
+
return abs === angularDirAbs || abs.startsWith(angularDirAbs + sep9);
|
|
33017
33098
|
});
|
|
33018
33099
|
if (filesUnderAngular.length === 0)
|
|
33019
33100
|
return;
|
|
@@ -33109,7 +33190,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33109
33190
|
const entries = await readdir(dir, { withFileTypes: true });
|
|
33110
33191
|
const files = [];
|
|
33111
33192
|
for (const entry of entries) {
|
|
33112
|
-
const full =
|
|
33193
|
+
const full = join60(dir, entry.name);
|
|
33113
33194
|
if (entry.isDirectory()) {
|
|
33114
33195
|
files.push(...await walk(full));
|
|
33115
33196
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -33211,8 +33292,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33211
33292
|
}, getModuleUrl = async (pageFile) => {
|
|
33212
33293
|
await Promise.resolve().then(() => init_moduleServer());
|
|
33213
33294
|
invalidateModule(pageFile);
|
|
33214
|
-
|
|
33215
|
-
const url = `${SRC_URL_PREFIX2}${
|
|
33295
|
+
await Promise.resolve();
|
|
33296
|
+
const url = `${SRC_URL_PREFIX2}${encodeSrcPath(relative26(process.cwd(), pageFile))}`;
|
|
33216
33297
|
await warmCache(url);
|
|
33217
33298
|
return url;
|
|
33218
33299
|
}, getReactModuleUrl, isReactComponentPath = (file) => file.endsWith(".tsx") || file.endsWith(".jsx"), isReactPagePath = (file) => file.replace(/\\/g, "/").includes("/pages/"), isImportableModule = (file) => {
|
|
@@ -33744,7 +33825,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33744
33825
|
} = await compileVue(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
33745
33826
|
const serverEntries = [...vueServerPaths];
|
|
33746
33827
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
33747
|
-
const cssOutDir =
|
|
33828
|
+
const cssOutDir = join60(buildDir, state.resolvedPaths.assetsDir ? basename20(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
33748
33829
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
33749
33830
|
const serverExternals = await getServerBundleExternals();
|
|
33750
33831
|
const serverExternalsPlugins = await getServerBundleExternalsPlugins(state.config);
|
|
@@ -34857,7 +34938,7 @@ var init_rebuildTrigger = __esm(() => {
|
|
|
34857
34938
|
// src/build/buildDepVendor.ts
|
|
34858
34939
|
import { mkdirSync as mkdirSync15 } from "fs";
|
|
34859
34940
|
import { isBuiltin as isBuiltin2 } from "module";
|
|
34860
|
-
import { join as
|
|
34941
|
+
import { join as join61 } from "path";
|
|
34861
34942
|
import { rm as rm13 } from "fs/promises";
|
|
34862
34943
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
34863
34944
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -34875,7 +34956,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
34875
34956
|
} catch {
|
|
34876
34957
|
return false;
|
|
34877
34958
|
}
|
|
34878
|
-
}, 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) => {
|
|
34959
|
+
}, 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) => {
|
|
34879
34960
|
const dep = [];
|
|
34880
34961
|
const framework = [];
|
|
34881
34962
|
try {
|
|
@@ -35015,7 +35096,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
35015
35096
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
35016
35097
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
35017
35098
|
const safeName = toSafeFileName6(specifier);
|
|
35018
|
-
const entryPath =
|
|
35099
|
+
const entryPath = join61(tmpDir, `${safeName}.ts`);
|
|
35019
35100
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
35020
35101
|
return { entryPath, specifier };
|
|
35021
35102
|
}));
|
|
@@ -35106,9 +35187,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
35106
35187
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories, files);
|
|
35107
35188
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
35108
35189
|
return {};
|
|
35109
|
-
const vendorDir =
|
|
35190
|
+
const vendorDir = join61(buildDir, "vendor");
|
|
35110
35191
|
mkdirSync15(vendorDir, { recursive: true });
|
|
35111
|
-
const tmpDir =
|
|
35192
|
+
const tmpDir = join61(buildDir, "_dep_vendor_tmp");
|
|
35112
35193
|
mkdirSync15(tmpDir, { recursive: true });
|
|
35113
35194
|
const allSpecs = new Set(initialSpecs);
|
|
35114
35195
|
const alreadyScanned = new Set;
|
|
@@ -35160,6 +35241,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
35160
35241
|
return paths;
|
|
35161
35242
|
};
|
|
35162
35243
|
var init_buildDepVendor = __esm(() => {
|
|
35244
|
+
init_workspacePackages();
|
|
35163
35245
|
init_vendorEntrySource();
|
|
35164
35246
|
init_startupTimings();
|
|
35165
35247
|
FRAMEWORK_SPECIFIERS = new Set([
|
|
@@ -35197,10 +35279,10 @@ import {
|
|
|
35197
35279
|
existsSync as existsSync45,
|
|
35198
35280
|
mkdirSync as mkdirSync16,
|
|
35199
35281
|
readdirSync as readdirSync13,
|
|
35200
|
-
readFileSync as
|
|
35282
|
+
readFileSync as readFileSync43
|
|
35201
35283
|
} from "fs";
|
|
35202
35284
|
import { mkdir as mkdir14, readFile as readFile10, rename as rename5, rm as rm14, writeFile as writeFile12 } from "fs/promises";
|
|
35203
|
-
import { basename as basename21, join as
|
|
35285
|
+
import { basename as basename21, join as join62, resolve as resolve55 } from "path";
|
|
35204
35286
|
var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeVendorCacheKey = (inputs) => {
|
|
35205
35287
|
const hash = createHash7("sha256");
|
|
35206
35288
|
hash.update(String(CACHE_FORMAT_VERSION3));
|
|
@@ -35227,19 +35309,19 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35227
35309
|
const hash = createHash7("sha256");
|
|
35228
35310
|
let found = false;
|
|
35229
35311
|
for (const name of LOCKFILES) {
|
|
35230
|
-
const path =
|
|
35312
|
+
const path = join62(projectRoot, name);
|
|
35231
35313
|
if (!existsSync45(path))
|
|
35232
35314
|
continue;
|
|
35233
35315
|
found = true;
|
|
35234
35316
|
hash.update(name);
|
|
35235
|
-
hash.update(
|
|
35317
|
+
hash.update(readFileSync43(path));
|
|
35236
35318
|
}
|
|
35237
35319
|
return found ? hash.digest("hex") : null;
|
|
35238
35320
|
}, vendorCacheEnabled = () => process.env.ABSOLUTE_DEV_VENDOR_CACHE !== "0", copyTree = (fromDir, toDir) => {
|
|
35239
35321
|
mkdirSync16(toDir, { recursive: true });
|
|
35240
35322
|
for (const entry of readdirSync13(fromDir, { withFileTypes: true })) {
|
|
35241
|
-
const source =
|
|
35242
|
-
const destination =
|
|
35323
|
+
const source = join62(fromDir, entry.name);
|
|
35324
|
+
const destination = join62(toDir, entry.name);
|
|
35243
35325
|
if (entry.isDirectory())
|
|
35244
35326
|
copyTree(source, destination);
|
|
35245
35327
|
else
|
|
@@ -35247,7 +35329,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35247
35329
|
}
|
|
35248
35330
|
}, copySlotsInto = (cacheDir, vendorDirs) => {
|
|
35249
35331
|
for (const [index, dir] of vendorDirs.entries()) {
|
|
35250
|
-
const source =
|
|
35332
|
+
const source = join62(cacheDir, slotName(index, dir));
|
|
35251
35333
|
if (!existsSync45(source)) {
|
|
35252
35334
|
throw new Error(`missing cached vendor dir ${source}`);
|
|
35253
35335
|
}
|
|
@@ -35257,11 +35339,11 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35257
35339
|
for (const [index, dir] of vendorDirs.entries()) {
|
|
35258
35340
|
if (!existsSync45(dir))
|
|
35259
35341
|
continue;
|
|
35260
|
-
copyTree(dir,
|
|
35342
|
+
copyTree(dir, join62(stagingDir, slotName(index, dir)));
|
|
35261
35343
|
}
|
|
35262
35344
|
}, isVendorCachePayload = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "depPaths") === "object", cacheDirFor = (key, projectRoot) => resolve55(projectRoot, CACHE_ROOT2, key), slotName = (index, dir) => `${index}-${basename21(resolve55(dir, ".."))}`, restoreVendorCache = async (key, vendorDirs, projectRoot = process.cwd()) => {
|
|
35263
35345
|
const cacheDir = cacheDirFor(key, projectRoot);
|
|
35264
|
-
const payloadPath =
|
|
35346
|
+
const payloadPath = join62(cacheDir, "payload.json");
|
|
35265
35347
|
if (!existsSync45(payloadPath))
|
|
35266
35348
|
return null;
|
|
35267
35349
|
try {
|
|
@@ -35275,14 +35357,14 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35275
35357
|
}
|
|
35276
35358
|
}, saveVendorCache = async (key, vendorDirs, payload, projectRoot = process.cwd()) => {
|
|
35277
35359
|
const cacheDir = cacheDirFor(key, projectRoot);
|
|
35278
|
-
if (existsSync45(
|
|
35360
|
+
if (existsSync45(join62(cacheDir, "payload.json")))
|
|
35279
35361
|
return;
|
|
35280
35362
|
const stagingDir = `${cacheDir}.${process.pid}.tmp`;
|
|
35281
35363
|
try {
|
|
35282
35364
|
await rm14(stagingDir, { force: true, recursive: true });
|
|
35283
35365
|
await mkdir14(stagingDir, { recursive: true });
|
|
35284
35366
|
copySlotsFrom(stagingDir, vendorDirs);
|
|
35285
|
-
await writeFile12(
|
|
35367
|
+
await writeFile12(join62(stagingDir, "payload.json"), JSON.stringify(payload));
|
|
35286
35368
|
await rm14(cacheDir, { force: true, recursive: true });
|
|
35287
35369
|
await rename5(stagingDir, cacheDir);
|
|
35288
35370
|
} catch {
|
|
@@ -35292,7 +35374,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35292
35374
|
}
|
|
35293
35375
|
};
|
|
35294
35376
|
var init_vendorCache = __esm(() => {
|
|
35295
|
-
CACHE_ROOT2 =
|
|
35377
|
+
CACHE_ROOT2 = join62(".absolutejs", "vendor-cache");
|
|
35296
35378
|
LOCKFILES = [
|
|
35297
35379
|
"bun.lock",
|
|
35298
35380
|
"bun.lockb",
|
|
@@ -36068,17 +36150,17 @@ var init_hmr = __esm(() => {
|
|
|
36068
36150
|
});
|
|
36069
36151
|
|
|
36070
36152
|
// src/plugins/devtoolsJson.ts
|
|
36071
|
-
import { existsSync as existsSync47, mkdirSync as mkdirSync17, readFileSync as
|
|
36072
|
-
import { dirname as dirname38, join as
|
|
36153
|
+
import { existsSync as existsSync47, mkdirSync as mkdirSync17, readFileSync as readFileSync44, writeFileSync as writeFileSync12 } from "fs";
|
|
36154
|
+
import { dirname as dirname38, join as join63, resolve as resolve57 } from "path";
|
|
36073
36155
|
import { Elysia as Elysia8 } from "elysia";
|
|
36074
36156
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
36075
36157
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
36076
36158
|
return uuid;
|
|
36077
|
-
}, 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) => resolve57(uuidCachePath ??
|
|
36159
|
+
}, 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) => resolve57(uuidCachePath ?? join63(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
36078
36160
|
if (!existsSync47(cachePath))
|
|
36079
36161
|
return null;
|
|
36080
36162
|
try {
|
|
36081
|
-
const value =
|
|
36163
|
+
const value = readFileSync44(cachePath, "utf-8").trim();
|
|
36082
36164
|
return isUuidV4(value) ? value : null;
|
|
36083
36165
|
} catch {
|
|
36084
36166
|
return null;
|
|
@@ -36113,11 +36195,11 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
36113
36195
|
if (process.env.WSL_DISTRO_NAME) {
|
|
36114
36196
|
const distro = process.env.WSL_DISTRO_NAME;
|
|
36115
36197
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
36116
|
-
return
|
|
36198
|
+
return join63("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
|
|
36117
36199
|
}
|
|
36118
36200
|
if (process.env.DOCKER_DESKTOP && !root.startsWith("\\\\")) {
|
|
36119
36201
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
36120
|
-
return
|
|
36202
|
+
return join63("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
|
|
36121
36203
|
}
|
|
36122
36204
|
return root;
|
|
36123
36205
|
};
|
|
@@ -36641,7 +36723,7 @@ import {
|
|
|
36641
36723
|
rm as rm15,
|
|
36642
36724
|
writeFile as writeFile13
|
|
36643
36725
|
} from "fs/promises";
|
|
36644
|
-
import { join as
|
|
36726
|
+
import { join as join64, resolve as resolvePath2 } from "path";
|
|
36645
36727
|
import { pathToFileURL as pathToFileURL4 } from "url";
|
|
36646
36728
|
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) => {
|
|
36647
36729
|
const bytes = new Uint8Array(await blob.arrayBuffer());
|
|
@@ -36656,7 +36738,7 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
|
|
|
36656
36738
|
}
|
|
36657
36739
|
return releaseId;
|
|
36658
36740
|
}, readStoredArtifact = async (releaseDirectory) => {
|
|
36659
|
-
const serialized = await readFile11(
|
|
36741
|
+
const serialized = await readFile11(join64(releaseDirectory, ARTIFACT_FILE), "utf8");
|
|
36660
36742
|
const parsed = JSON.parse(serialized);
|
|
36661
36743
|
return parseAbsoluteMobileCompatibilityArtifact(parsed);
|
|
36662
36744
|
}, validateStoredIdentity = (artifact, appId, releaseId) => {
|
|
@@ -36751,8 +36833,8 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
|
|
|
36751
36833
|
}, createAbsoluteMobileFileArtifactStore = (options) => {
|
|
36752
36834
|
const root = resolvePath2(options.root);
|
|
36753
36835
|
const maxProducerBytes = options.maxProducerBytes ?? DEFAULT_MAX_PRODUCER_BYTES;
|
|
36754
|
-
const appDirectory = (appId) =>
|
|
36755
|
-
const releaseDirectory = (appId, releaseId) =>
|
|
36836
|
+
const appDirectory = (appId) => join64(root, appDirectoryName(appId));
|
|
36837
|
+
const releaseDirectory = (appId, releaseId) => join64(appDirectory(appId), requireReleaseId(releaseId));
|
|
36756
36838
|
const acceptExistingRelease = async (error, artifact) => {
|
|
36757
36839
|
if (!errorHasCode(error, "EEXIST") && !errorHasCode(error, "ENOTEMPTY")) {
|
|
36758
36840
|
return false;
|
|
@@ -36793,7 +36875,7 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
|
|
|
36793
36875
|
}
|
|
36794
36876
|
return {
|
|
36795
36877
|
artifact,
|
|
36796
|
-
producer: Bun.file(
|
|
36878
|
+
producer: Bun.file(join64(directory, artifact.producer.module))
|
|
36797
36879
|
};
|
|
36798
36880
|
},
|
|
36799
36881
|
write: async (release) => {
|
|
@@ -36801,14 +36883,14 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
|
|
|
36801
36883
|
const validated = await verifyAbsoluteMobileCompatibilityProducer({ artifact: validatedArtifact, producer: release.producer }, maxProducerBytes);
|
|
36802
36884
|
const parent = appDirectory(validated.artifact.appId);
|
|
36803
36885
|
await mkdir15(parent, { recursive: true });
|
|
36804
|
-
const staging = await mkdtemp2(
|
|
36805
|
-
const producerPath =
|
|
36886
|
+
const staging = await mkdtemp2(join64(parent, ".stage-"));
|
|
36887
|
+
const producerPath = join64(staging, validated.artifact.producer.module);
|
|
36806
36888
|
try {
|
|
36807
36889
|
await mkdir15(resolvePath2(producerPath, ".."), {
|
|
36808
36890
|
recursive: true
|
|
36809
36891
|
});
|
|
36810
36892
|
await Promise.all([
|
|
36811
|
-
writeFile13(
|
|
36893
|
+
writeFile13(join64(staging, ARTIFACT_FILE), `${JSON.stringify(validated.artifact, null, "\t")}
|
|
36812
36894
|
`),
|
|
36813
36895
|
writeFile13(producerPath, new Uint8Array(await validated.producer.arrayBuffer()))
|
|
36814
36896
|
]);
|
|
@@ -36865,7 +36947,7 @@ import {
|
|
|
36865
36947
|
rm as rm16,
|
|
36866
36948
|
writeFile as writeFile14
|
|
36867
36949
|
} from "fs/promises";
|
|
36868
|
-
import { dirname as dirname39, join as
|
|
36950
|
+
import { dirname as dirname39, join as join65, resolve as resolvePath3 } from "path";
|
|
36869
36951
|
import { pathToFileURL as pathToFileURL5 } from "url";
|
|
36870
36952
|
var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "current.json", BUNDLES_DIRECTORY = "bundles", ARTIFACT_FILE2 = "artifact.json", BUNDLE_ID_PATTERN, isRecord10 = (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) => {
|
|
36871
36953
|
const identity = JSON.stringify({
|
|
@@ -36896,16 +36978,16 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
36896
36978
|
releases
|
|
36897
36979
|
};
|
|
36898
36980
|
}, writeRelease = async (root, release) => {
|
|
36899
|
-
const directory =
|
|
36900
|
-
const producerPath =
|
|
36981
|
+
const directory = join65(root, release.artifact.releaseId);
|
|
36982
|
+
const producerPath = join65(directory, release.artifact.producer.module);
|
|
36901
36983
|
await mkdir16(dirname39(producerPath), { recursive: true });
|
|
36902
36984
|
await Promise.all([
|
|
36903
|
-
writeFile14(
|
|
36985
|
+
writeFile14(join65(directory, ARTIFACT_FILE2), `${JSON.stringify(release.artifact, null, "\t")}
|
|
36904
36986
|
`),
|
|
36905
36987
|
writeFile14(producerPath, new Uint8Array(await release.producer.arrayBuffer()))
|
|
36906
36988
|
]);
|
|
36907
36989
|
}, installImmutableBundle = async (bundlesRoot, bundleId, releases) => {
|
|
36908
|
-
const destination =
|
|
36990
|
+
const destination = join65(bundlesRoot, bundleId);
|
|
36909
36991
|
try {
|
|
36910
36992
|
await access5(destination);
|
|
36911
36993
|
return destination;
|
|
@@ -36913,7 +36995,7 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
36913
36995
|
if (!errorHasCode2(error, "ENOENT"))
|
|
36914
36996
|
throw error;
|
|
36915
36997
|
}
|
|
36916
|
-
const staging = await mkdtemp3(
|
|
36998
|
+
const staging = await mkdtemp3(join65(bundlesRoot, ".stage-"));
|
|
36917
36999
|
try {
|
|
36918
37000
|
await Promise.all(releases.map((release) => writeRelease(staging, release)));
|
|
36919
37001
|
await rename7(staging, destination);
|
|
@@ -36944,15 +37026,15 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
36944
37026
|
};
|
|
36945
37027
|
}, loadAbsoluteMobileMaterializedBundle = async (root) => {
|
|
36946
37028
|
const resolvedRoot = resolvePath3(root);
|
|
36947
|
-
const serialized = await readFile12(
|
|
37029
|
+
const serialized = await readFile12(join65(resolvedRoot, CURRENT_BUNDLE_FILE), "utf8");
|
|
36948
37030
|
const parsed = JSON.parse(serialized);
|
|
36949
37031
|
const index = parseBundleIndex(parsed);
|
|
36950
|
-
const bundleRoot =
|
|
37032
|
+
const bundleRoot = join65(resolvedRoot, BUNDLES_DIRECTORY, index.bundleId);
|
|
36951
37033
|
return {
|
|
36952
37034
|
artifacts: index.releases,
|
|
36953
37035
|
currentReleaseId: index.currentReleaseId,
|
|
36954
37036
|
loadProducer: async (artifact) => {
|
|
36955
|
-
const modulePath =
|
|
37037
|
+
const modulePath = join65(bundleRoot, artifact.releaseId, artifact.producer.module);
|
|
36956
37038
|
await verifyAbsoluteMobileCompatibilityProducer({
|
|
36957
37039
|
artifact,
|
|
36958
37040
|
producer: Bun.file(modulePath)
|
|
@@ -36978,7 +37060,7 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
36978
37060
|
return release;
|
|
36979
37061
|
});
|
|
36980
37062
|
const root = resolvePath3(input.root);
|
|
36981
|
-
const bundlesRoot =
|
|
37063
|
+
const bundlesRoot = join65(root, BUNDLES_DIRECTORY);
|
|
36982
37064
|
await mkdir16(bundlesRoot, { recursive: true });
|
|
36983
37065
|
const bundleId = bundleIdFor(input.currentReleaseId, artifacts);
|
|
36984
37066
|
await installImmutableBundle(bundlesRoot, bundleId, orderedReleases);
|
|
@@ -36988,8 +37070,8 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
36988
37070
|
format: ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT,
|
|
36989
37071
|
releases: artifacts
|
|
36990
37072
|
};
|
|
36991
|
-
const pointerPath =
|
|
36992
|
-
const temporaryPointerPath =
|
|
37073
|
+
const pointerPath = join65(root, CURRENT_BUNDLE_FILE);
|
|
37074
|
+
const temporaryPointerPath = join65(root, `.current-${crypto.randomUUID()}.json`);
|
|
36993
37075
|
await writeFile14(temporaryPointerPath, `${JSON.stringify(index, null, "\t")}
|
|
36994
37076
|
`, { flag: "wx" });
|
|
36995
37077
|
await rename7(temporaryPointerPath, pointerPath);
|
|
@@ -36997,12 +37079,12 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
36997
37079
|
}, readAbsoluteMobileMaterializedReleases = async (root) => {
|
|
36998
37080
|
const resolvedRoot = resolvePath3(root);
|
|
36999
37081
|
try {
|
|
37000
|
-
const serialized = await readFile12(
|
|
37082
|
+
const serialized = await readFile12(join65(resolvedRoot, CURRENT_BUNDLE_FILE), "utf8");
|
|
37001
37083
|
const parsed = JSON.parse(serialized);
|
|
37002
37084
|
const index = parseBundleIndex(parsed);
|
|
37003
|
-
const bundleRoot =
|
|
37085
|
+
const bundleRoot = join65(resolvedRoot, BUNDLES_DIRECTORY, index.bundleId);
|
|
37004
37086
|
return Promise.all(index.releases.map(async (artifact) => {
|
|
37005
|
-
const producer = Bun.file(
|
|
37087
|
+
const producer = Bun.file(join65(bundleRoot, artifact.releaseId, artifact.producer.module));
|
|
37006
37088
|
await verifyAbsoluteMobileCompatibilityProducer({
|
|
37007
37089
|
artifact,
|
|
37008
37090
|
producer
|
|
@@ -37187,15 +37269,15 @@ var init_compatibilityDispatcher = __esm(() => {
|
|
|
37187
37269
|
});
|
|
37188
37270
|
|
|
37189
37271
|
// src/core/prerender.ts
|
|
37190
|
-
import { mkdirSync as mkdirSync18, readFileSync as
|
|
37191
|
-
import { join as
|
|
37272
|
+
import { mkdirSync as mkdirSync18, readFileSync as readFileSync45 } from "fs";
|
|
37273
|
+
import { join as join66 } from "path";
|
|
37192
37274
|
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) => {
|
|
37193
37275
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
37194
37276
|
await Bun.write(metaPath, String(Date.now()));
|
|
37195
37277
|
}, readTimestamp = (htmlPath) => {
|
|
37196
37278
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
37197
37279
|
try {
|
|
37198
|
-
const content =
|
|
37280
|
+
const content = readFileSync45(metaPath, "utf-8");
|
|
37199
37281
|
return Number(content) || 0;
|
|
37200
37282
|
} catch {
|
|
37201
37283
|
return 0;
|
|
@@ -37212,7 +37294,7 @@ var DEFAULT_FETCH_TIMEOUT_MS = 1e4, PRERENDER_BYPASS_HEADER = "X-Absolute-Preren
|
|
|
37212
37294
|
if (!isCompleteHtml(html))
|
|
37213
37295
|
return false;
|
|
37214
37296
|
const fileName = routeToFilename(route);
|
|
37215
|
-
const filePath =
|
|
37297
|
+
const filePath = join66(prerenderDir, fileName);
|
|
37216
37298
|
await Bun.write(filePath, html);
|
|
37217
37299
|
await writeTimestamp(filePath);
|
|
37218
37300
|
return true;
|
|
@@ -37231,8 +37313,8 @@ var init_prerender = () => {};
|
|
|
37231
37313
|
|
|
37232
37314
|
// src/core/prepare.ts
|
|
37233
37315
|
import { createHash as createHash11 } from "crypto";
|
|
37234
|
-
import { existsSync as existsSync49, readdirSync as readdirSync14, readFileSync as
|
|
37235
|
-
import { basename as basename22, join as
|
|
37316
|
+
import { existsSync as existsSync49, readdirSync as readdirSync14, readFileSync as readFileSync46 } from "fs";
|
|
37317
|
+
import { basename as basename22, join as join67, relative as relative27, resolve as resolvePath4 } from "path";
|
|
37236
37318
|
import { Elysia as Elysia12, NotFound } from "elysia";
|
|
37237
37319
|
var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_PLUGIN_RETRY_DELAY_MS = 50, waitForStaticPluginRetry = () => new Promise((resolve) => {
|
|
37238
37320
|
setTimeout(resolve, STATIC_PLUGIN_RETRY_DELAY_MS);
|
|
@@ -37362,8 +37444,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37362
37444
|
const srcPath = resolvePath4(devIndexDir, fileName);
|
|
37363
37445
|
if (!existsSync49(srcPath))
|
|
37364
37446
|
continue;
|
|
37365
|
-
|
|
37366
|
-
manifest[key] = `${SRC_URL_PREFIX}${rel}`;
|
|
37447
|
+
manifest[key] = `${SRC_URL_PREFIX}${encodeSrcPath(relative27(process.cwd(), srcPath))}`;
|
|
37367
37448
|
}
|
|
37368
37449
|
}, ICON_HASH_LENGTH = 8, registerIconVersioning = (buildDir) => {
|
|
37369
37450
|
const cache = new Map;
|
|
@@ -37374,10 +37455,10 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37374
37455
|
if (cached !== undefined)
|
|
37375
37456
|
return cached;
|
|
37376
37457
|
const path = href.split("?")[0] ?? href;
|
|
37377
|
-
const filePath =
|
|
37458
|
+
const filePath = join67(buildDir, path);
|
|
37378
37459
|
let versioned = href;
|
|
37379
37460
|
if (existsSync49(filePath)) {
|
|
37380
|
-
const hash = createHash11("sha256").update(
|
|
37461
|
+
const hash = createHash11("sha256").update(readFileSync46(filePath)).digest("hex").slice(0, ICON_HASH_LENGTH);
|
|
37381
37462
|
versioned = href.includes("?") ? `${href}&v=${hash}` : `${href}?v=${hash}`;
|
|
37382
37463
|
}
|
|
37383
37464
|
cache.set(href, versioned);
|
|
@@ -37510,12 +37591,12 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37510
37591
|
continue;
|
|
37511
37592
|
const name = basename22(entry, ".html");
|
|
37512
37593
|
const route = name === "index" ? "/" : `/${name}`;
|
|
37513
|
-
map.set(route,
|
|
37594
|
+
map.set(route, join67(prerenderDir, entry));
|
|
37514
37595
|
}
|
|
37515
37596
|
return map;
|
|
37516
37597
|
}, loadMobileCompatibilityPlugin = async (buildDir) => {
|
|
37517
|
-
const root =
|
|
37518
|
-
if (!existsSync49(
|
|
37598
|
+
const root = join67(buildDir, ".absolutejs", "mobile-compatibility");
|
|
37599
|
+
if (!existsSync49(join67(root, "current.json"))) {
|
|
37519
37600
|
return new Elysia12({ name: "absolutejs-mobile-compatibility-empty" });
|
|
37520
37601
|
}
|
|
37521
37602
|
const [
|
|
@@ -37571,7 +37652,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37571
37652
|
return result;
|
|
37572
37653
|
}
|
|
37573
37654
|
stepStartedAt = performance.now();
|
|
37574
|
-
const manifest = JSON.parse(
|
|
37655
|
+
const manifest = JSON.parse(readFileSync46(`${buildDir}/manifest.json`, "utf-8"));
|
|
37575
37656
|
setCurrentIslandManifest(manifest);
|
|
37576
37657
|
if (config.islands?.registry) {
|
|
37577
37658
|
setCurrentIslandRegistry(await loadIslandRegistry(config.islands.registry));
|
|
@@ -37579,14 +37660,14 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37579
37660
|
setCurrentPageIslandMetadata(await loadPageIslandMetadata(config));
|
|
37580
37661
|
recordStep("load production manifest and island metadata", stepStartedAt);
|
|
37581
37662
|
stepStartedAt = performance.now();
|
|
37582
|
-
const conventionsPath =
|
|
37663
|
+
const conventionsPath = join67(buildDir, "conventions.json");
|
|
37583
37664
|
if (existsSync49(conventionsPath)) {
|
|
37584
|
-
const conventions = JSON.parse(
|
|
37665
|
+
const conventions = JSON.parse(readFileSync46(conventionsPath, "utf-8"));
|
|
37585
37666
|
setConventions(conventions);
|
|
37586
37667
|
}
|
|
37587
|
-
const spaRoutesPath =
|
|
37668
|
+
const spaRoutesPath = join67(buildDir, "spa-routes.json");
|
|
37588
37669
|
if (existsSync49(spaRoutesPath)) {
|
|
37589
|
-
setSpaRouteManifest(JSON.parse(
|
|
37670
|
+
setSpaRouteManifest(JSON.parse(readFileSync46(spaRoutesPath, "utf-8")));
|
|
37590
37671
|
}
|
|
37591
37672
|
recordStep("load production conventions", stepStartedAt);
|
|
37592
37673
|
stepStartedAt = performance.now();
|
|
@@ -37597,7 +37678,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37597
37678
|
prefix: "",
|
|
37598
37679
|
staticLimit: MAX_STATIC_ROUTE_COUNT
|
|
37599
37680
|
});
|
|
37600
|
-
const generatedAssetsRoot =
|
|
37681
|
+
const generatedAssetsRoot = join67(buildDir, ".absolutejs");
|
|
37601
37682
|
const generatedAssetsPlugin = new Elysia12({
|
|
37602
37683
|
name: "absolutejs-generated-assets"
|
|
37603
37684
|
}).get("/.absolutejs/*", async ({ params, set }) => {
|
|
@@ -37629,7 +37710,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37629
37710
|
responseValue.headers.set("cache-control", assetCacheControl(pathname));
|
|
37630
37711
|
});
|
|
37631
37712
|
stepStartedAt = performance.now();
|
|
37632
|
-
const prerenderDir =
|
|
37713
|
+
const prerenderDir = join67(buildDir, "_prerendered");
|
|
37633
37714
|
const prerenderMap = loadPrerenderMap(prerenderDir);
|
|
37634
37715
|
const mobileCompatibilityPlugin = await loadMobileCompatibilityPlugin(buildDir);
|
|
37635
37716
|
const mobileAssociationPlugin = await loadMobileAssociationPlugin(config.mobile);
|
|
@@ -37749,15 +37830,15 @@ import {
|
|
|
37749
37830
|
copyFileSync as copyFileSync6,
|
|
37750
37831
|
existsSync as existsSync51,
|
|
37751
37832
|
readdirSync as readdirSync16,
|
|
37752
|
-
readFileSync as
|
|
37833
|
+
readFileSync as readFileSync49,
|
|
37753
37834
|
statSync as statSync13,
|
|
37754
37835
|
watch as watch2
|
|
37755
37836
|
} from "fs";
|
|
37756
37837
|
import { createHash as createHash12 } from "crypto";
|
|
37757
|
-
import { dirname as dirname40, join as
|
|
37838
|
+
import { dirname as dirname40, join as join70, resolve as resolve59 } from "path";
|
|
37758
37839
|
var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETRY_DELAY_MS = 250, MAX_ENTRY_IMPORT_ATTEMPTS = 3, WATCH_FALLBACK_INTERVAL_MS = 250, ATOMIC_WRITE_TEMP_PATTERNS2, isAtomicWriteTemp = (filename) => filename.endsWith(".tmp") || filename.includes(".tmp.") || filename.endsWith("~") || filename.startsWith(".#") || isAbsoluteServerEntryCopyPath(filename) || ATOMIC_WRITE_TEMP_PATTERNS2.some((pattern) => pattern.test(filename)), fileHash = (path) => {
|
|
37759
37840
|
try {
|
|
37760
|
-
return createHash12("sha256").update(
|
|
37841
|
+
return createHash12("sha256").update(readFileSync49(path)).digest("hex");
|
|
37761
37842
|
} catch {
|
|
37762
37843
|
return null;
|
|
37763
37844
|
}
|
|
@@ -37797,7 +37878,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
37797
37878
|
let pendingEntryCause = null;
|
|
37798
37879
|
let siblingSequence = 0;
|
|
37799
37880
|
const importFreshEntry = async (attempt = 1) => {
|
|
37800
|
-
const siblingPath =
|
|
37881
|
+
const siblingPath = join70(entryDir, `.absolutejs-hmr-${process.pid}-${siblingSequence++}.ts`);
|
|
37801
37882
|
let failure;
|
|
37802
37883
|
try {
|
|
37803
37884
|
copyFileSync6(entryPath, siblingPath);
|
|
@@ -37929,7 +38010,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
37929
38010
|
continue;
|
|
37930
38011
|
let st;
|
|
37931
38012
|
try {
|
|
37932
|
-
st = statSync13(
|
|
38013
|
+
st = statSync13(join70(dir, entry.name));
|
|
37933
38014
|
} catch {
|
|
37934
38015
|
continue;
|
|
37935
38016
|
}
|
|
@@ -38418,15 +38499,15 @@ import {
|
|
|
38418
38499
|
copyFileSync as copyFileSync5,
|
|
38419
38500
|
existsSync as existsSync50,
|
|
38420
38501
|
mkdirSync as mkdirSync19,
|
|
38421
|
-
readFileSync as
|
|
38502
|
+
readFileSync as readFileSync47,
|
|
38422
38503
|
rmSync as rmSync5
|
|
38423
38504
|
} from "fs";
|
|
38424
38505
|
import { X509Certificate as X509Certificate4 } from "crypto";
|
|
38425
38506
|
import { isIP } from "net";
|
|
38426
|
-
import { join as
|
|
38427
|
-
var CERT_DIR =
|
|
38428
|
-
var CERT_PATH =
|
|
38429
|
-
var KEY_PATH =
|
|
38507
|
+
import { join as join68 } from "path";
|
|
38508
|
+
var CERT_DIR = join68(process.cwd(), ".absolutejs");
|
|
38509
|
+
var CERT_PATH = join68(CERT_DIR, "cert.pem");
|
|
38510
|
+
var KEY_PATH = join68(CERT_DIR, "key.pem");
|
|
38430
38511
|
var CERT_VALIDITY_DAYS = 365;
|
|
38431
38512
|
var DEFAULT_CERTIFICATE_HOSTS = ["localhost", "127.0.0.1", "::1"];
|
|
38432
38513
|
var CERTIFICATE_HOSTNAME_PATTERN = /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)(?:\.(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?))*$/u;
|
|
@@ -38448,7 +38529,7 @@ var normalizeDevCertificateHosts = (hosts = []) => {
|
|
|
38448
38529
|
};
|
|
38449
38530
|
var certificateIsUsable = (hosts) => {
|
|
38450
38531
|
try {
|
|
38451
|
-
const certPem =
|
|
38532
|
+
const certPem = readFileSync47(CERT_PATH, "utf-8");
|
|
38452
38533
|
const certificate = new X509Certificate4(certPem);
|
|
38453
38534
|
if (new Date(certificate.validTo).getTime() <= Date.now())
|
|
38454
38535
|
return false;
|
|
@@ -38540,8 +38621,8 @@ var loadDevCert = (hosts = []) => {
|
|
|
38540
38621
|
return null;
|
|
38541
38622
|
try {
|
|
38542
38623
|
return {
|
|
38543
|
-
cert:
|
|
38544
|
-
key:
|
|
38624
|
+
cert: readFileSync47(paths.cert, "utf-8"),
|
|
38625
|
+
key: readFileSync47(paths.key, "utf-8")
|
|
38545
38626
|
};
|
|
38546
38627
|
} catch {
|
|
38547
38628
|
return null;
|
|
@@ -38580,18 +38661,18 @@ var signalParentPortHandoff = (port) => {
|
|
|
38580
38661
|
// src/utils/instanceRegistry.ts
|
|
38581
38662
|
import {
|
|
38582
38663
|
mkdirSync as mkdirSync20,
|
|
38583
|
-
readFileSync as
|
|
38664
|
+
readFileSync as readFileSync48,
|
|
38584
38665
|
readdirSync as readdirSync15,
|
|
38585
38666
|
unlinkSync as unlinkSync2,
|
|
38586
38667
|
writeFileSync as writeFileSync13
|
|
38587
38668
|
} from "fs";
|
|
38588
38669
|
import { homedir as homedir2 } from "os";
|
|
38589
|
-
import { basename as basename23, join as
|
|
38670
|
+
import { basename as basename23, join as join69 } from "path";
|
|
38590
38671
|
var registeredPids = new Set;
|
|
38591
38672
|
var exitHandlerRegistered = false;
|
|
38592
|
-
var instanceFilePath = (pid) =>
|
|
38593
|
-
var instanceLogPath = (pid) =>
|
|
38594
|
-
var instanceRegistryDir = () =>
|
|
38673
|
+
var instanceFilePath = (pid) => join69(instanceRegistryDir(), `${pid}.json`);
|
|
38674
|
+
var instanceLogPath = (pid) => join69(instanceRegistryDir(), `${pid}.log`);
|
|
38675
|
+
var instanceRegistryDir = () => join69(homedir2(), ".absolutejs", "instances");
|
|
38595
38676
|
var removeInstanceFilesSync = (pid) => {
|
|
38596
38677
|
try {
|
|
38597
38678
|
unlinkSync2(instanceFilePath(pid));
|
|
@@ -38613,7 +38694,7 @@ var registerExitHandlerOnce = () => {
|
|
|
38613
38694
|
};
|
|
38614
38695
|
var readJsonFile = (path) => {
|
|
38615
38696
|
try {
|
|
38616
|
-
return JSON.parse(
|
|
38697
|
+
return JSON.parse(readFileSync48(path, "utf-8"));
|
|
38617
38698
|
} catch {
|
|
38618
38699
|
return null;
|
|
38619
38700
|
}
|
|
@@ -38626,7 +38707,7 @@ var registerInstance = (record) => {
|
|
|
38626
38707
|
return record;
|
|
38627
38708
|
};
|
|
38628
38709
|
var resolveProjectName = (cwd) => {
|
|
38629
|
-
const parsed = readJsonFile(
|
|
38710
|
+
const parsed = readJsonFile(join69(cwd, "package.json"));
|
|
38630
38711
|
if (parsed !== null && typeof parsed === "object" && typeof parsed.name === "string" && parsed.name.trim().length > 0) {
|
|
38631
38712
|
return parsed.name;
|
|
38632
38713
|
}
|
|
@@ -39106,7 +39187,7 @@ var serializeSpeculationRules = (rules) => {
|
|
|
39106
39187
|
};
|
|
39107
39188
|
// src/utils/defineEnv.ts
|
|
39108
39189
|
var {env: bunEnv } = globalThis.Bun;
|
|
39109
|
-
import { existsSync as existsSync52, readFileSync as
|
|
39190
|
+
import { existsSync as existsSync52, readFileSync as readFileSync50 } from "fs";
|
|
39110
39191
|
import { resolve as resolve60 } from "path";
|
|
39111
39192
|
|
|
39112
39193
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
@@ -43640,13 +43721,13 @@ var checkEnvFileSecurity = (properties) => {
|
|
|
43640
43721
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
43641
43722
|
if (sensitiveKeys.length === 0)
|
|
43642
43723
|
return;
|
|
43643
|
-
const envContent =
|
|
43724
|
+
const envContent = readFileSync50(envPath, "utf-8");
|
|
43644
43725
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
43645
43726
|
if (presentKeys.length === 0)
|
|
43646
43727
|
return;
|
|
43647
43728
|
const gitignorePath = resolve60(cwd, ".gitignore");
|
|
43648
43729
|
if (existsSync52(gitignorePath)) {
|
|
43649
|
-
const gitignore =
|
|
43730
|
+
const gitignore = readFileSync50(gitignorePath, "utf-8");
|
|
43650
43731
|
if (gitignore.split(`
|
|
43651
43732
|
`).some((line) => line.trim() === ".env"))
|
|
43652
43733
|
return;
|
|
@@ -43967,5 +44048,5 @@ export {
|
|
|
43967
44048
|
wrapPageHandlerWithStreamingSlots
|
|
43968
44049
|
};
|
|
43969
44050
|
|
|
43970
|
-
//# debugId=
|
|
44051
|
+
//# debugId=7012B9CD76254FFB64756E2164756E21
|
|
43971
44052
|
//# sourceMappingURL=index.js.map
|