@absolutejs/absolute 0.20.0-beta.160 → 0.20.0-beta.161
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 +7 -0
- package/changelog.json +14 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/build.js +155 -138
- package/dist/build.js.map +5 -4
- package/dist/cli/{index-55k7vn84.js → index-f82hvr9c.js} +65 -10
- package/dist/cli/index.js +3 -3
- package/dist/cli/{mobile-0r1y2hwc.js → mobile-2f54v4by.js} +1 -1
- package/dist/cli/{start-4rpdy8hg.js → start-0bx1rkx4.js} +1 -1
- package/dist/index.js +671 -654
- package/dist/index.js.map +5 -4
- package/dist/src/core/productionRuntime.d.ts +11 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9828,6 +9828,21 @@ var init_loadConfig = __esm(() => {
|
|
|
9828
9828
|
]);
|
|
9829
9829
|
});
|
|
9830
9830
|
|
|
9831
|
+
// src/core/productionRuntime.ts
|
|
9832
|
+
import { existsSync as existsSync8, readFileSync as readFileSync10, writeFileSync as writeFileSync4 } from "fs";
|
|
9833
|
+
import { join as join13 } from "path";
|
|
9834
|
+
var PRODUCTION_RUNTIME_FILE = "absolute-runtime.json", PRODUCTION_RUNTIME_VERSION = 1, isRuntimeFile = (value) => typeof value === "object" && value !== null && ("version" in value) && value.version === PRODUCTION_RUNTIME_VERSION && ("config" in value) && typeof value.config === "object" && value.config !== null, readProductionRuntime = (buildDirectory) => {
|
|
9835
|
+
const path = join13(buildDirectory, PRODUCTION_RUNTIME_FILE);
|
|
9836
|
+
if (!existsSync8(path))
|
|
9837
|
+
return null;
|
|
9838
|
+
const parsed = JSON.parse(readFileSync10(path, "utf-8"));
|
|
9839
|
+
if (!isRuntimeFile(parsed))
|
|
9840
|
+
return null;
|
|
9841
|
+
const config = { ...parsed.config, buildDirectory };
|
|
9842
|
+
return config;
|
|
9843
|
+
};
|
|
9844
|
+
var init_productionRuntime = () => {};
|
|
9845
|
+
|
|
9831
9846
|
// src/utils/iconVersion.ts
|
|
9832
9847
|
var iconMimeType = (icon) => {
|
|
9833
9848
|
if (icon.endsWith(".svg"))
|
|
@@ -9868,10 +9883,10 @@ var init_loadIslandRegistry = __esm(() => {
|
|
|
9868
9883
|
});
|
|
9869
9884
|
|
|
9870
9885
|
// src/build/scanEntryPoints.ts
|
|
9871
|
-
import { existsSync as
|
|
9886
|
+
import { existsSync as existsSync9 } from "fs";
|
|
9872
9887
|
var {Glob } = globalThis.Bun;
|
|
9873
9888
|
var scanEntryPoints = async (dir, pattern) => {
|
|
9874
|
-
if (!
|
|
9889
|
+
if (!existsSync9(dir))
|
|
9875
9890
|
return [];
|
|
9876
9891
|
const entryPaths = [];
|
|
9877
9892
|
const glob = new Glob(pattern);
|
|
@@ -9960,7 +9975,7 @@ var init_sourceMetadata = __esm(() => {
|
|
|
9960
9975
|
});
|
|
9961
9976
|
|
|
9962
9977
|
// src/islands/pageMetadata.ts
|
|
9963
|
-
import { readFileSync as
|
|
9978
|
+
import { readFileSync as readFileSync11 } from "fs";
|
|
9964
9979
|
import { dirname as dirname9, resolve as resolve11 } from "path";
|
|
9965
9980
|
var pagePatterns, getPageDirs = (config) => [
|
|
9966
9981
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
@@ -10003,7 +10018,7 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
10003
10018
|
return;
|
|
10004
10019
|
const files = await scanEntryPoints(resolve11(entry.dir), pattern);
|
|
10005
10020
|
for (const filePath of files) {
|
|
10006
|
-
const source =
|
|
10021
|
+
const source = readFileSync11(filePath, "utf-8");
|
|
10007
10022
|
const islands = extractIslandUsagesFromSource(source);
|
|
10008
10023
|
pageMetadata.set(resolve11(filePath), {
|
|
10009
10024
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
@@ -10566,14 +10581,14 @@ var init_bootLifecycle = __esm(() => {
|
|
|
10566
10581
|
|
|
10567
10582
|
// src/core/precompressed.ts
|
|
10568
10583
|
import { readdir as readdir3, readFile as readFile3, stat as stat2, writeFile } from "fs/promises";
|
|
10569
|
-
import { extname as extname5, join as
|
|
10584
|
+
import { extname as extname5, join as join14, relative as relative6, resolve as resolve12, sep } from "path";
|
|
10570
10585
|
import { promisify } from "util";
|
|
10571
10586
|
import { brotliCompress, constants, gzip } from "zlib";
|
|
10572
10587
|
import { Elysia as Elysia2 } from "elysia";
|
|
10573
10588
|
var COMPRESSIBLE_EXTENSIONS, MIN_COMPRESSIBLE_BYTES = 1024, MIN_SAVING_RATIO = 0.9, BROTLI_QUALITY = 9, GZIP_LEVEL = 9, brotliAsync, gzipAsync, ENCODINGS, listFiles = async (directory) => {
|
|
10574
10589
|
const entries = await readdir3(directory, { withFileTypes: true }).catch(() => []);
|
|
10575
10590
|
const nested = await Promise.all(entries.map((entry) => {
|
|
10576
|
-
const path =
|
|
10591
|
+
const path = join14(directory, entry.name);
|
|
10577
10592
|
return entry.isDirectory() ? listFiles(path) : Promise.resolve(entry.isFile() ? [path] : []);
|
|
10578
10593
|
}));
|
|
10579
10594
|
return nested.flat();
|
|
@@ -10611,8 +10626,8 @@ var COMPRESSIBLE_EXTENSIONS, MIN_COMPRESSIBLE_BYTES = 1024, MIN_SAVING_RATIO = 0
|
|
|
10611
10626
|
const chosen = acceptedEncodings(request.headers.get("accept-encoding")).find(({ encoding }) => available.has(encoding));
|
|
10612
10627
|
if (!chosen)
|
|
10613
10628
|
return;
|
|
10614
|
-
const original = Bun.file(
|
|
10615
|
-
return new Response(Bun.file(`${
|
|
10629
|
+
const original = Bun.file(join14(root, decodedPathname));
|
|
10630
|
+
return new Response(Bun.file(`${join14(root, decodedPathname)}${chosen.suffix}`), {
|
|
10616
10631
|
headers: {
|
|
10617
10632
|
"cache-control": assetCacheControl(pathname),
|
|
10618
10633
|
"content-encoding": chosen.encoding,
|
|
@@ -10798,7 +10813,7 @@ var exports_config = {};
|
|
|
10798
10813
|
__export(exports_config, {
|
|
10799
10814
|
normalizeAbsoluteMobileConfig: () => normalizeAbsoluteMobileConfig
|
|
10800
10815
|
});
|
|
10801
|
-
import { readFileSync as
|
|
10816
|
+
import { readFileSync as readFileSync12 } from "fs";
|
|
10802
10817
|
import { resolve as resolve13 } from "path";
|
|
10803
10818
|
import { createHash as createHash3, createPublicKey, X509Certificate } from "crypto";
|
|
10804
10819
|
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) => {
|
|
@@ -10997,7 +11012,7 @@ var APP_ID_PATTERN, SCHEME_PATTERN, APPLE_APP_ID_PREFIX_PATTERN, CERTIFICATE_FIN
|
|
|
10997
11012
|
}))
|
|
10998
11013
|
].sort(), readExpoCodeSigningCertificate = (certificatePath) => {
|
|
10999
11014
|
try {
|
|
11000
|
-
const certificateSource =
|
|
11015
|
+
const certificateSource = readFileSync12(certificatePath, "utf8");
|
|
11001
11016
|
const certificatePem = certificateSource.endsWith(`
|
|
11002
11017
|
`) ? certificateSource : `${certificateSource}
|
|
11003
11018
|
`;
|
|
@@ -11524,14 +11539,14 @@ var init_associationFiles = __esm(() => {
|
|
|
11524
11539
|
});
|
|
11525
11540
|
|
|
11526
11541
|
// src/cli/scripts/telemetry.ts
|
|
11527
|
-
import { existsSync as
|
|
11542
|
+
import { existsSync as existsSync10, mkdirSync as mkdirSync2, readFileSync as readFileSync13, writeFileSync as writeFileSync5 } from "fs";
|
|
11528
11543
|
import { homedir } from "os";
|
|
11529
|
-
import { join as
|
|
11544
|
+
import { join as join15 } from "path";
|
|
11530
11545
|
var configDir, configPath, getTelemetryConfig = () => {
|
|
11531
11546
|
try {
|
|
11532
|
-
if (!
|
|
11547
|
+
if (!existsSync10(configPath))
|
|
11533
11548
|
return null;
|
|
11534
|
-
const raw =
|
|
11549
|
+
const raw = readFileSync13(configPath, "utf-8");
|
|
11535
11550
|
const config = JSON.parse(raw);
|
|
11536
11551
|
return config;
|
|
11537
11552
|
} catch {
|
|
@@ -11539,19 +11554,19 @@ var configDir, configPath, getTelemetryConfig = () => {
|
|
|
11539
11554
|
}
|
|
11540
11555
|
};
|
|
11541
11556
|
var init_telemetry = __esm(() => {
|
|
11542
|
-
configDir =
|
|
11543
|
-
configPath =
|
|
11557
|
+
configDir = join15(homedir(), ".absolutejs");
|
|
11558
|
+
configPath = join15(configDir, "telemetry.json");
|
|
11544
11559
|
});
|
|
11545
11560
|
|
|
11546
11561
|
// src/cli/telemetryEvent.ts
|
|
11547
|
-
import { existsSync as
|
|
11562
|
+
import { existsSync as existsSync11, readFileSync as readFileSync14 } from "fs";
|
|
11548
11563
|
import { arch, platform } from "os";
|
|
11549
|
-
import { dirname as dirname10, join as
|
|
11564
|
+
import { dirname as dirname10, join as join16, parse } from "path";
|
|
11550
11565
|
var checkCandidate = (candidate) => {
|
|
11551
|
-
if (!
|
|
11566
|
+
if (!existsSync11(candidate)) {
|
|
11552
11567
|
return null;
|
|
11553
11568
|
}
|
|
11554
|
-
const pkg = JSON.parse(
|
|
11569
|
+
const pkg = JSON.parse(readFileSync14(candidate, "utf-8"));
|
|
11555
11570
|
if (pkg.name === "@absolutejs/absolute") {
|
|
11556
11571
|
const ver = pkg.version;
|
|
11557
11572
|
return ver;
|
|
@@ -11566,7 +11581,7 @@ var checkCandidate = (candidate) => {
|
|
|
11566
11581
|
}, findPackageVersion = () => {
|
|
11567
11582
|
let { dir } = import.meta;
|
|
11568
11583
|
while (dir !== parse(dir).root) {
|
|
11569
|
-
const candidate =
|
|
11584
|
+
const candidate = join16(dir, "package.json");
|
|
11570
11585
|
const version = checkCandidate(candidate);
|
|
11571
11586
|
if (version) {
|
|
11572
11587
|
return version;
|
|
@@ -11680,12 +11695,12 @@ var init_mobilePreview = __esm(() => {
|
|
|
11680
11695
|
});
|
|
11681
11696
|
|
|
11682
11697
|
// src/mobile/deviceCapabilities.ts
|
|
11683
|
-
import { existsSync as
|
|
11684
|
-
import { extname as extname6, join as
|
|
11698
|
+
import { existsSync as existsSync12, readFileSync as readFileSync15 } from "fs";
|
|
11699
|
+
import { extname as extname6, join as join17, relative as relative7, resolve as resolve15 } from "path";
|
|
11685
11700
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
11686
11701
|
import ts2 from "typescript";
|
|
11687
11702
|
var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABILITIES, ADAPTERS, SOURCE_GLOB, IGNORED_DIRECTORIES, IDENTIFIER_PATTERN, providerModulePattern = (provider) => new RegExp(`^@absolutejs/devices-${provider}/[a-z][a-z0-9-]*$`, "u"), providerPackagePattern = (provider) => provider === "capacitor" ? /^@capacitor\/[a-z][a-z0-9-]*@\d+\.\d+\.\d+$/u : /^(?:expo-[a-z][a-z0-9-]*|@react-native-[a-z0-9-]+\/[a-z][a-z0-9-]*)@\d+\.\d+\.\d+$/u, providerLabel = (provider) => provider === "capacitor" ? "Capacitor" : "Expo", ANDROID_PERMISSION_PATTERN, IOS_USAGE_DESCRIPTIONS, IOS_PRIVACY_ACCESSED_API_REASONS, IOS_PRIVACY_ACCESSED_APIS, object = (value) => typeof value === "object" && value !== null && !Array.isArray(value), readJson = (path) => {
|
|
11688
|
-
const value = JSON.parse(
|
|
11703
|
+
const value = JSON.parse(readFileSync15(path, "utf8"));
|
|
11689
11704
|
if (!object(value))
|
|
11690
11705
|
throw new TypeError(`${path} must contain an object.`);
|
|
11691
11706
|
return value;
|
|
@@ -11815,9 +11830,9 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
|
|
|
11815
11830
|
}
|
|
11816
11831
|
}, loadAbsoluteDeviceCapabilityProviders = (projectRoot, provider = "capacitor") => {
|
|
11817
11832
|
const adapter = ADAPTERS[provider];
|
|
11818
|
-
let path =
|
|
11833
|
+
let path = join17(resolve15(projectRoot), "node_modules", adapter, "package.json");
|
|
11819
11834
|
try {
|
|
11820
|
-
|
|
11835
|
+
readFileSync15(path, "utf8");
|
|
11821
11836
|
} catch {
|
|
11822
11837
|
path = resolveAdapterManifest(adapter, provider);
|
|
11823
11838
|
}
|
|
@@ -11870,7 +11885,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
|
|
|
11870
11885
|
if (missing.includes(spec))
|
|
11871
11886
|
return false;
|
|
11872
11887
|
try {
|
|
11873
|
-
return readJson(
|
|
11888
|
+
return readJson(join17(resolve15(projectRoot), "node_modules", packageName, "package.json")).version !== spec.slice(separator + 1);
|
|
11874
11889
|
} catch {
|
|
11875
11890
|
return true;
|
|
11876
11891
|
}
|
|
@@ -11879,7 +11894,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
|
|
|
11879
11894
|
if (unmet.length > 0)
|
|
11880
11895
|
throw new TypeError(`Device capabilities ${plan.capabilities.join(", ")} require ${unmet.join(", ")}. Run absolute mobile sync and approve the detected capability plugins.`);
|
|
11881
11896
|
}, directAbsoluteProjectPackages = (projectRoot) => {
|
|
11882
|
-
const manifest = readJson(
|
|
11897
|
+
const manifest = readJson(join17(resolve15(projectRoot), "package.json"));
|
|
11883
11898
|
const packages = new Set;
|
|
11884
11899
|
for (const field of ["dependencies", "devDependencies"]) {
|
|
11885
11900
|
const dependencies = manifest[field];
|
|
@@ -11890,7 +11905,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
|
|
|
11890
11905
|
return packages;
|
|
11891
11906
|
}, discoverAbsoluteDeviceCapabilities = (projectRoot, providers = loadAbsoluteDeviceCapabilityProviders(projectRoot)) => {
|
|
11892
11907
|
const root = resolve15(projectRoot);
|
|
11893
|
-
if (!
|
|
11908
|
+
if (!existsSync12(root))
|
|
11894
11909
|
return [];
|
|
11895
11910
|
const known = new Set(Object.keys(providers));
|
|
11896
11911
|
const capabilities = new Set;
|
|
@@ -11898,7 +11913,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
|
|
|
11898
11913
|
const portable = relative7(root, resolve15(root, path)).replaceAll("\\", "/");
|
|
11899
11914
|
if (isIgnored(portable))
|
|
11900
11915
|
continue;
|
|
11901
|
-
const source =
|
|
11916
|
+
const source = readFileSync15(resolve15(root, portable), "utf8");
|
|
11902
11917
|
for (const name of importedCapabilities(source, portable))
|
|
11903
11918
|
if (known.has(name))
|
|
11904
11919
|
capabilities.add(name);
|
|
@@ -11913,7 +11928,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABI
|
|
|
11913
11928
|
const portable = relative7(root, resolve15(root, path)).replaceAll("\\", "/");
|
|
11914
11929
|
if (isIgnored(portable))
|
|
11915
11930
|
continue;
|
|
11916
|
-
const source =
|
|
11931
|
+
const source = readFileSync15(resolve15(root, portable), "utf8");
|
|
11917
11932
|
if (importedCapabilities(source, portable).has(capability))
|
|
11918
11933
|
return true;
|
|
11919
11934
|
}
|
|
@@ -11979,11 +11994,11 @@ var init_deviceCapabilities = __esm(() => {
|
|
|
11979
11994
|
});
|
|
11980
11995
|
|
|
11981
11996
|
// src/mobile/nativeAuth.ts
|
|
11982
|
-
import { readFileSync as
|
|
11983
|
-
import { join as
|
|
11997
|
+
import { readFileSync as readFileSync16 } from "fs";
|
|
11998
|
+
import { join as join18 } from "path";
|
|
11984
11999
|
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) => {
|
|
11985
12000
|
try {
|
|
11986
|
-
return JSON.parse(
|
|
12001
|
+
return JSON.parse(readFileSync16(join18(projectRoot, "package.json"), "utf8"));
|
|
11987
12002
|
} catch {
|
|
11988
12003
|
return;
|
|
11989
12004
|
}
|
|
@@ -12152,11 +12167,11 @@ var init_client = __esm(() => {
|
|
|
12152
12167
|
});
|
|
12153
12168
|
|
|
12154
12169
|
// src/mobile/syncSchema.ts
|
|
12155
|
-
import { readFileSync as
|
|
12156
|
-
import { dirname as dirname11, join as
|
|
12170
|
+
import { readFileSync as readFileSync17 } from "fs";
|
|
12171
|
+
import { dirname as dirname11, join as join19, resolve as resolve16 } from "path";
|
|
12157
12172
|
var object2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), manifestAt = (path) => {
|
|
12158
12173
|
try {
|
|
12159
|
-
const value = JSON.parse(
|
|
12174
|
+
const value = JSON.parse(readFileSync17(path, "utf8"));
|
|
12160
12175
|
return object2(value) ? value : undefined;
|
|
12161
12176
|
} catch {
|
|
12162
12177
|
return;
|
|
@@ -12172,7 +12187,7 @@ var object2 = (value) => typeof value === "object" && value !== null && !Array.i
|
|
|
12172
12187
|
}, packageManifestPath = (projectRoot, packageName) => {
|
|
12173
12188
|
let directory = resolve16(projectRoot);
|
|
12174
12189
|
while (true) {
|
|
12175
|
-
const candidate =
|
|
12190
|
+
const candidate = join19(directory, "node_modules", packageName, "package.json");
|
|
12176
12191
|
const manifest = manifestAt(candidate);
|
|
12177
12192
|
if (manifest && Reflect.get(manifest, "name") === packageName)
|
|
12178
12193
|
return candidate;
|
|
@@ -12403,7 +12418,7 @@ var object2 = (value) => typeof value === "object" && value !== null && !Array.i
|
|
|
12403
12418
|
Reflect.get(manifest, "devDependencies"),
|
|
12404
12419
|
Reflect.get(manifest, "peerDependencies")
|
|
12405
12420
|
].flatMap((dependencies) => object2(dependencies) ? Object.keys(dependencies) : []).filter((name, index, names) => names.indexOf(name) === index).sort(), discoverAbsoluteSyncSchema = (projectRoot) => {
|
|
12406
|
-
const appManifestPath =
|
|
12421
|
+
const appManifestPath = join19(resolve16(projectRoot), "package.json");
|
|
12407
12422
|
const appManifest = manifestAt(appManifestPath);
|
|
12408
12423
|
if (!appManifest)
|
|
12409
12424
|
return {
|
|
@@ -12447,7 +12462,7 @@ var init_syncSchema = __esm(() => {
|
|
|
12447
12462
|
|
|
12448
12463
|
// src/mobile/devDeviceAdapter.ts
|
|
12449
12464
|
import { access as access2, mkdtemp, rm as rm2, writeFile as writeFile3 } from "fs/promises";
|
|
12450
|
-
import { join as
|
|
12465
|
+
import { join as join20 } from "path";
|
|
12451
12466
|
import { tmpdir } from "os";
|
|
12452
12467
|
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") => {
|
|
12453
12468
|
if ((mobile.engine ?? "capacitor") === "expo") {
|
|
@@ -12485,7 +12500,7 @@ ${auth ? `void createAbsoluteExpoShellAuth(${JSON.stringify(auth)}).then(auth =>
|
|
|
12485
12500
|
`);
|
|
12486
12501
|
}, expoAdapterPath = async () => {
|
|
12487
12502
|
const candidates = await Promise.all(["ts", "js"].map(async (extension) => {
|
|
12488
|
-
const path =
|
|
12503
|
+
const path = join20(import.meta.dir, `shellExpoDevices.${extension}`);
|
|
12489
12504
|
try {
|
|
12490
12505
|
await access2(path);
|
|
12491
12506
|
return path;
|
|
@@ -12499,7 +12514,7 @@ ${auth ? `void createAbsoluteExpoShellAuth(${JSON.stringify(auth)}).then(auth =>
|
|
|
12499
12514
|
throw new TypeError("The AbsoluteJS Expo development adapter is missing.");
|
|
12500
12515
|
}, expoAuthPath = async () => {
|
|
12501
12516
|
const candidates = await Promise.all(["ts", "js"].map(async (extension) => {
|
|
12502
|
-
const path =
|
|
12517
|
+
const path = join20(import.meta.dir, `shellExpoAuth.${extension}`);
|
|
12503
12518
|
try {
|
|
12504
12519
|
await access2(path);
|
|
12505
12520
|
return path;
|
|
@@ -12513,7 +12528,7 @@ ${auth ? `void createAbsoluteExpoShellAuth(${JSON.stringify(auth)}).then(auth =>
|
|
|
12513
12528
|
throw new TypeError("The AbsoluteJS Expo Auth development adapter is missing.");
|
|
12514
12529
|
}, expoSyncPath = async () => {
|
|
12515
12530
|
const candidates = await Promise.all(["ts", "js"].map(async (extension) => {
|
|
12516
|
-
const path =
|
|
12531
|
+
const path = join20(import.meta.dir, `shellExpoSync.${extension}`);
|
|
12517
12532
|
try {
|
|
12518
12533
|
await access2(path);
|
|
12519
12534
|
return path;
|
|
@@ -12526,8 +12541,8 @@ ${auth ? `void createAbsoluteExpoShellAuth(${JSON.stringify(auth)}).then(auth =>
|
|
|
12526
12541
|
return path;
|
|
12527
12542
|
throw new TypeError("The AbsoluteJS Expo Sync development adapter is missing.");
|
|
12528
12543
|
}, buildAbsoluteNativeDevAdapter = async (projectRoot, mobile) => {
|
|
12529
|
-
const temporaryDirectory = await mkdtemp(
|
|
12530
|
-
const entry =
|
|
12544
|
+
const temporaryDirectory = await mkdtemp(join20(tmpdir(), "absolutejs-native-dev-adapter-"));
|
|
12545
|
+
const entry = join20(temporaryDirectory, "entry.ts");
|
|
12531
12546
|
try {
|
|
12532
12547
|
await writeFile3(entry, absoluteNativeDevAdapterSource(projectRoot, mobile, (specifier) => Bun.resolveSync(specifier, projectRoot), await expoAdapterPath(), await expoAuthPath(), await expoSyncPath()));
|
|
12533
12548
|
const result = await Bun.build({
|
|
@@ -12553,11 +12568,11 @@ var init_devDeviceAdapter = __esm(() => {
|
|
|
12553
12568
|
|
|
12554
12569
|
// src/mobile/mobilePreviewClientBundle.ts
|
|
12555
12570
|
import { access as access3 } from "fs/promises";
|
|
12556
|
-
import { join as
|
|
12571
|
+
import { join as join21 } from "path";
|
|
12557
12572
|
var PREVIEW_CLIENT_FILE = "mobilePreviewClient.ts", fileExists = (path) => access3(path).then(() => true, () => false), resolveAbsoluteMobilePreviewClientEntry = async () => {
|
|
12558
12573
|
const candidates = [
|
|
12559
|
-
|
|
12560
|
-
|
|
12574
|
+
join21(import.meta.dir, PREVIEW_CLIENT_FILE),
|
|
12575
|
+
join21(import.meta.dir, "mobile", PREVIEW_CLIENT_FILE)
|
|
12561
12576
|
];
|
|
12562
12577
|
const present = await Promise.all(candidates.map(fileExists));
|
|
12563
12578
|
const entry = candidates.find((_candidate, index) => present[index]);
|
|
@@ -13410,7 +13425,7 @@ var init_devRouteRegistrationCallsite = __esm(() => {
|
|
|
13410
13425
|
});
|
|
13411
13426
|
|
|
13412
13427
|
// src/dev/runtimePaths.ts
|
|
13413
|
-
import { existsSync as
|
|
13428
|
+
import { existsSync as existsSync13 } from "fs";
|
|
13414
13429
|
import { resolve as resolve18 } from "path";
|
|
13415
13430
|
var resolveDevClientDirectory = () => {
|
|
13416
13431
|
const candidates = [
|
|
@@ -13418,7 +13433,7 @@ var resolveDevClientDirectory = () => {
|
|
|
13418
13433
|
resolve18(import.meta.dir, "dev/client"),
|
|
13419
13434
|
resolve18(import.meta.dir, "../dev/client")
|
|
13420
13435
|
];
|
|
13421
|
-
const directory = candidates.find((candidate) =>
|
|
13436
|
+
const directory = candidates.find((candidate) => existsSync13(resolve18(candidate, "hmrClient.ts")));
|
|
13422
13437
|
if (!directory) {
|
|
13423
13438
|
throw new Error("AbsoluteJS browser HMR sources are missing from the installed package.");
|
|
13424
13439
|
}
|
|
@@ -13587,22 +13602,22 @@ var init_verifyAngularCoreUniqueness = __esm(() => {
|
|
|
13587
13602
|
});
|
|
13588
13603
|
|
|
13589
13604
|
// src/build/generateReactIndexes.ts
|
|
13590
|
-
import { existsSync as
|
|
13605
|
+
import { existsSync as existsSync14, mkdirSync as mkdirSync3 } from "fs";
|
|
13591
13606
|
import { readdir as readdir4, rm as rm3, writeFile as writeFile4 } from "fs/promises";
|
|
13592
|
-
import { basename as basename4, join as
|
|
13607
|
+
import { basename as basename4, join as join22, relative as relative9, resolve as resolve20, sep as sep3 } from "path";
|
|
13593
13608
|
var {Glob: Glob2 } = globalThis.Bun;
|
|
13594
13609
|
var indexContentCache, resolveDevClientDir = () => {
|
|
13595
13610
|
const projectRoot = process.cwd();
|
|
13596
13611
|
const fromPackage = resolve20(import.meta.dir, "../dev/client");
|
|
13597
|
-
if (
|
|
13612
|
+
if (existsSync14(fromPackage)) {
|
|
13598
13613
|
return fromPackage;
|
|
13599
13614
|
}
|
|
13600
13615
|
const fromNodeModules = resolve20(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
13601
|
-
if (
|
|
13616
|
+
if (existsSync14(fromNodeModules))
|
|
13602
13617
|
return fromNodeModules;
|
|
13603
13618
|
return resolve20(import.meta.dir, "./dev/client");
|
|
13604
13619
|
}, devClientDir, errorOverlayPath, hmrClientPath, refreshSetupPath, reactRefreshRuntimePath, generateReactIndexFiles = async (reactPagesDirectory, reactIndexesDirectory, isDev = false) => {
|
|
13605
|
-
if (!
|
|
13620
|
+
if (!existsSync14(reactIndexesDirectory)) {
|
|
13606
13621
|
mkdirSync3(reactIndexesDirectory, { recursive: true });
|
|
13607
13622
|
}
|
|
13608
13623
|
const CONVENTION_RE = /^(?:(.+)\.)?(error|loading|not-found)\.[^.]+$/;
|
|
@@ -13622,8 +13637,8 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
13622
13637
|
});
|
|
13623
13638
|
if (staleIndexes.length > 0) {
|
|
13624
13639
|
await Promise.all(staleIndexes.map((indexFile) => {
|
|
13625
|
-
indexContentCache.delete(
|
|
13626
|
-
return rm3(
|
|
13640
|
+
indexContentCache.delete(join22(reactIndexesDirectory, indexFile));
|
|
13641
|
+
return rm3(join22(reactIndexesDirectory, indexFile), {
|
|
13627
13642
|
force: true
|
|
13628
13643
|
});
|
|
13629
13644
|
}));
|
|
@@ -13946,11 +13961,11 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
13946
13961
|
] : []
|
|
13947
13962
|
].join(`
|
|
13948
13963
|
`);
|
|
13949
|
-
const indexPath =
|
|
13964
|
+
const indexPath = join22(reactIndexesDirectory, `${componentName}.tsx`);
|
|
13950
13965
|
const hasher = new Bun.CryptoHasher("md5");
|
|
13951
13966
|
hasher.update(content);
|
|
13952
13967
|
const contentHash = hasher.digest("hex");
|
|
13953
|
-
if (indexContentCache.get(indexPath) === contentHash &&
|
|
13968
|
+
if (indexContentCache.get(indexPath) === contentHash && existsSync14(indexPath)) {
|
|
13954
13969
|
return;
|
|
13955
13970
|
}
|
|
13956
13971
|
indexContentCache.set(indexPath, contentHash);
|
|
@@ -13960,8 +13975,8 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
13960
13975
|
if (!isDev) {
|
|
13961
13976
|
return;
|
|
13962
13977
|
}
|
|
13963
|
-
const refreshPath =
|
|
13964
|
-
if (!
|
|
13978
|
+
const refreshPath = join22(reactIndexesDirectory, "_refresh.tsx");
|
|
13979
|
+
if (!existsSync14(refreshPath)) {
|
|
13965
13980
|
await writeFile4(refreshPath, `import '${refreshSetupPath}';
|
|
13966
13981
|
import 'react';
|
|
13967
13982
|
import 'react-dom/client';
|
|
@@ -13971,10 +13986,10 @@ import 'react-dom/client';
|
|
|
13971
13986
|
var init_generateReactIndexes = __esm(() => {
|
|
13972
13987
|
indexContentCache = new Map;
|
|
13973
13988
|
devClientDir = resolveDevClientDir();
|
|
13974
|
-
errorOverlayPath =
|
|
13975
|
-
hmrClientPath =
|
|
13976
|
-
refreshSetupPath =
|
|
13977
|
-
reactRefreshRuntimePath =
|
|
13989
|
+
errorOverlayPath = join22(devClientDir, "errorOverlay.ts").replace(/\\/g, "/");
|
|
13990
|
+
hmrClientPath = join22(devClientDir, "hmrClient.ts").replace(/\\/g, "/");
|
|
13991
|
+
refreshSetupPath = join22(devClientDir, "reactRefreshSetup.ts").replace(/\\/g, "/");
|
|
13992
|
+
reactRefreshRuntimePath = join22(devClientDir, "vendor", "reactRefreshRuntime.js").replace(/\\/g, "/");
|
|
13978
13993
|
});
|
|
13979
13994
|
|
|
13980
13995
|
// src/build/wrapHTMLScript.ts
|
|
@@ -14079,7 +14094,7 @@ var init_stampedFileCache = () => {};
|
|
|
14079
14094
|
// src/build/scanConventions.ts
|
|
14080
14095
|
import { basename as basename5 } from "path";
|
|
14081
14096
|
var {Glob: Glob3 } = globalThis.Bun;
|
|
14082
|
-
import { existsSync as
|
|
14097
|
+
import { existsSync as existsSync15 } from "fs";
|
|
14083
14098
|
var CONVENTION_RE, classifyFile = (file, pageFiles, defaults, pages) => {
|
|
14084
14099
|
const fileName = basename5(file);
|
|
14085
14100
|
const match = CONVENTION_RE.exec(fileName);
|
|
@@ -14104,7 +14119,7 @@ var CONVENTION_RE, classifyFile = (file, pageFiles, defaults, pages) => {
|
|
|
14104
14119
|
else if (kind === "loading")
|
|
14105
14120
|
pages[pageName].loading = file;
|
|
14106
14121
|
}, scanConventions = async (pagesDir, pattern) => {
|
|
14107
|
-
if (!
|
|
14122
|
+
if (!existsSync15(pagesDir)) {
|
|
14108
14123
|
const pageFiles = [];
|
|
14109
14124
|
return { conventions: undefined, pageFiles };
|
|
14110
14125
|
}
|
|
@@ -14163,9 +14178,9 @@ __export(exports_serverExternals, {
|
|
|
14163
14178
|
buildServerBundleExternals: () => buildServerBundleExternals,
|
|
14164
14179
|
createDevServerExternalsPlugin: () => createDevServerExternalsPlugin
|
|
14165
14180
|
});
|
|
14166
|
-
import { existsSync as
|
|
14181
|
+
import { existsSync as existsSync16, readdirSync, readFileSync as readFileSync18 } from "fs";
|
|
14167
14182
|
import { isBuiltin } from "module";
|
|
14168
|
-
import { dirname as dirname14, extname as extname8, join as
|
|
14183
|
+
import { dirname as dirname14, extname as extname8, join as join23 } from "path";
|
|
14169
14184
|
var DEFAULT_BUNDLED_SERVER_DEPENDENCIES, buildServerBundleExternals = (angularVendorPaths) => {
|
|
14170
14185
|
const angularPartialDeclSpecs = Object.keys(angularVendorPaths ?? {}).filter((spec) => !spec.startsWith("@angular/")).flatMap((spec) => [spec, `${spec}/*`]);
|
|
14171
14186
|
return [
|
|
@@ -14213,7 +14228,7 @@ var DEFAULT_BUNDLED_SERVER_DEPENDENCIES, buildServerBundleExternals = (angularVe
|
|
|
14213
14228
|
}
|
|
14214
14229
|
}, hasPackageName = (manifestPath) => {
|
|
14215
14230
|
try {
|
|
14216
|
-
const parsed = JSON.parse(
|
|
14231
|
+
const parsed = JSON.parse(readFileSync18(manifestPath, "utf-8"));
|
|
14217
14232
|
return typeof parsed.name === "string";
|
|
14218
14233
|
} catch {
|
|
14219
14234
|
return false;
|
|
@@ -14221,8 +14236,8 @@ var DEFAULT_BUNDLED_SERVER_DEPENDENCIES, buildServerBundleExternals = (angularVe
|
|
|
14221
14236
|
}, findPackageRoot = (filePath) => {
|
|
14222
14237
|
let dir = dirname14(filePath);
|
|
14223
14238
|
while (true) {
|
|
14224
|
-
const manifestPath =
|
|
14225
|
-
if (
|
|
14239
|
+
const manifestPath = join23(dir, "package.json");
|
|
14240
|
+
if (existsSync16(manifestPath) && hasPackageName(manifestPath))
|
|
14226
14241
|
return dir;
|
|
14227
14242
|
const parent = dirname14(dir);
|
|
14228
14243
|
if (parent === dir)
|
|
@@ -14231,7 +14246,7 @@ var DEFAULT_BUNDLED_SERVER_DEPENDENCIES, buildServerBundleExternals = (angularVe
|
|
|
14231
14246
|
}
|
|
14232
14247
|
}, readManifest = (packageRoot) => {
|
|
14233
14248
|
try {
|
|
14234
|
-
const parsed = JSON.parse(
|
|
14249
|
+
const parsed = JSON.parse(readFileSync18(join23(packageRoot, "package.json"), "utf-8"));
|
|
14235
14250
|
return parsed;
|
|
14236
14251
|
} catch {
|
|
14237
14252
|
return null;
|
|
@@ -14254,7 +14269,7 @@ var DEFAULT_BUNDLED_SERVER_DEPENDENCIES, buildServerBundleExternals = (angularVe
|
|
|
14254
14269
|
} catch {
|
|
14255
14270
|
return [];
|
|
14256
14271
|
}
|
|
14257
|
-
}, isSfcFile = (entry) => entry.isFile() && SFC_EXTENSIONS.has(extname8(entry.name)), subdirectoriesOf = (dir, entries) => entries.filter((entry) => entry.isDirectory() && entry.name !== "node_modules").map((entry) =>
|
|
14272
|
+
}, isSfcFile = (entry) => entry.isFile() && SFC_EXTENSIONS.has(extname8(entry.name)), subdirectoriesOf = (dir, entries) => entries.filter((entry) => entry.isDirectory() && entry.name !== "node_modules").map((entry) => join23(dir, entry.name)), scanForSfc = (root, budget) => {
|
|
14258
14273
|
const pending = [root];
|
|
14259
14274
|
let visited = 0;
|
|
14260
14275
|
for (let dir = pending.pop();dir !== undefined; dir = pending.pop()) {
|
|
@@ -14364,8 +14379,8 @@ var init_serverExternals = __esm(() => {
|
|
|
14364
14379
|
});
|
|
14365
14380
|
|
|
14366
14381
|
// src/build/scanRouteRegistrations.ts
|
|
14367
|
-
import { readdirSync as readdirSync2, readFileSync as
|
|
14368
|
-
import { join as
|
|
14382
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync19 } from "fs";
|
|
14383
|
+
import { join as join24 } from "path";
|
|
14369
14384
|
import ts3 from "typescript";
|
|
14370
14385
|
var ELYSIA_ROUTE_METHODS, SKIP_DIRS, SOURCE_EXTENSIONS, getScriptKind = (filePath) => {
|
|
14371
14386
|
if (filePath.endsWith(".tsx"))
|
|
@@ -14402,9 +14417,9 @@ var ELYSIA_ROUTE_METHODS, SKIP_DIRS, SOURCE_EXTENSIONS, getScriptKind = (filePat
|
|
|
14402
14417
|
continue;
|
|
14403
14418
|
if (entry.name.startsWith("."))
|
|
14404
14419
|
continue;
|
|
14405
|
-
stack.push(
|
|
14420
|
+
stack.push(join24(dir, entry.name));
|
|
14406
14421
|
} else if (entry.isFile() && hasSourceExtension(entry.name)) {
|
|
14407
|
-
out.push(
|
|
14422
|
+
out.push(join24(dir, entry.name));
|
|
14408
14423
|
}
|
|
14409
14424
|
}
|
|
14410
14425
|
}
|
|
@@ -14418,7 +14433,7 @@ var ELYSIA_ROUTE_METHODS, SKIP_DIRS, SOURCE_EXTENSIONS, getScriptKind = (filePat
|
|
|
14418
14433
|
}, extractRoutesFromFile = (filePath, out) => {
|
|
14419
14434
|
let source;
|
|
14420
14435
|
try {
|
|
14421
|
-
source =
|
|
14436
|
+
source = readFileSync19(filePath, "utf-8");
|
|
14422
14437
|
} catch {
|
|
14423
14438
|
return;
|
|
14424
14439
|
}
|
|
@@ -14487,8 +14502,8 @@ var init_scanRouteRegistrations = __esm(() => {
|
|
|
14487
14502
|
});
|
|
14488
14503
|
|
|
14489
14504
|
// src/angular/staticAnalyzeSpaRoutes.ts
|
|
14490
|
-
import { existsSync as
|
|
14491
|
-
import { join as
|
|
14505
|
+
import { existsSync as existsSync17, promises as fs } from "fs";
|
|
14506
|
+
import { join as join25 } from "path";
|
|
14492
14507
|
import ts4 from "typescript";
|
|
14493
14508
|
var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN.test(seg) || seg === "**"), importsSymbolFrom = (sourceFile, localName, moduleSpecifier) => {
|
|
14494
14509
|
for (const statement of sourceFile.statements) {
|
|
@@ -14685,7 +14700,7 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
14685
14700
|
continue;
|
|
14686
14701
|
if (item.name.startsWith("."))
|
|
14687
14702
|
continue;
|
|
14688
|
-
const full =
|
|
14703
|
+
const full = join25(dir, item.name);
|
|
14689
14704
|
if (item.isDirectory()) {
|
|
14690
14705
|
directories.push(full);
|
|
14691
14706
|
} else if (item.isFile() && item.name.endsWith(".ts") && !item.name.endsWith(".d.ts")) {
|
|
@@ -14694,7 +14709,7 @@ var DYNAMIC_SEGMENT_PATTERN, pathHasDynamic = (path) => path.split("/").some((se
|
|
|
14694
14709
|
}
|
|
14695
14710
|
await Promise.all(directories.map((directory) => walkTsFiles(directory, files)));
|
|
14696
14711
|
}, analyzeAngularSpaRoutes = async (angularDirectory) => {
|
|
14697
|
-
if (!
|
|
14712
|
+
if (!existsSync17(angularDirectory))
|
|
14698
14713
|
return [];
|
|
14699
14714
|
const tsFiles = [];
|
|
14700
14715
|
await walkTsFiles(angularDirectory, tsFiles);
|
|
@@ -14715,8 +14730,8 @@ var init_staticAnalyzeSpaRoutes = __esm(() => {
|
|
|
14715
14730
|
});
|
|
14716
14731
|
|
|
14717
14732
|
// src/react/staticAnalyzeSpaRoutes.ts
|
|
14718
|
-
import { existsSync as
|
|
14719
|
-
import { join as
|
|
14733
|
+
import { existsSync as existsSync18, promises as fs2 } from "fs";
|
|
14734
|
+
import { join as join26 } from "path";
|
|
14720
14735
|
import ts5 from "typescript";
|
|
14721
14736
|
var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN2.test(seg) || seg === "**"), readStringLiteral2 = (expression) => {
|
|
14722
14737
|
if (ts5.isStringLiteral(expression) || ts5.isNoSubstitutionTemplateLiteral(expression)) {
|
|
@@ -14895,7 +14910,7 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
14895
14910
|
for (const item of items) {
|
|
14896
14911
|
if (item.name === "node_modules" || item.name.startsWith("."))
|
|
14897
14912
|
continue;
|
|
14898
|
-
const full =
|
|
14913
|
+
const full = join26(dir, item.name);
|
|
14899
14914
|
if (item.isDirectory()) {
|
|
14900
14915
|
directories.push(full);
|
|
14901
14916
|
} else if (item.isFile() && (item.name.endsWith(".tsx") || item.name.endsWith(".ts") || item.name.endsWith(".jsx") || item.name.endsWith(".js")) && !item.name.endsWith(".d.ts")) {
|
|
@@ -14904,7 +14919,7 @@ var DYNAMIC_SEGMENT_PATTERN2, pathHasDynamic2 = (path) => path.split("/").some((
|
|
|
14904
14919
|
}
|
|
14905
14920
|
await Promise.all(directories.map((directory) => walkSourceFiles(directory, files)));
|
|
14906
14921
|
}, analyzeReactSpaRoutes = async (reactDirectory) => {
|
|
14907
|
-
if (!
|
|
14922
|
+
if (!existsSync18(reactDirectory))
|
|
14908
14923
|
return [];
|
|
14909
14924
|
const files = [];
|
|
14910
14925
|
await walkSourceFiles(reactDirectory, files);
|
|
@@ -14925,8 +14940,8 @@ var init_staticAnalyzeSpaRoutes2 = __esm(() => {
|
|
|
14925
14940
|
});
|
|
14926
14941
|
|
|
14927
14942
|
// src/svelte/staticAnalyzeSpaRoutes.ts
|
|
14928
|
-
import { existsSync as
|
|
14929
|
-
import { join as
|
|
14943
|
+
import { existsSync as existsSync19, promises as fs3 } from "fs";
|
|
14944
|
+
import { join as join27 } from "path";
|
|
14930
14945
|
var DYNAMIC_SEGMENT_PATTERN3, pathHasDynamic3 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN3.test(seg) || seg === "**"), joinSegments3 = (parent, child) => {
|
|
14931
14946
|
if (!child)
|
|
14932
14947
|
return parent;
|
|
@@ -14999,7 +15014,7 @@ var DYNAMIC_SEGMENT_PATTERN3, pathHasDynamic3 = (path) => path.split("/").some((
|
|
|
14999
15014
|
for (const item of items) {
|
|
15000
15015
|
if (item.name === "node_modules" || item.name.startsWith("."))
|
|
15001
15016
|
continue;
|
|
15002
|
-
const full =
|
|
15017
|
+
const full = join27(dir, item.name);
|
|
15003
15018
|
if (item.isDirectory()) {
|
|
15004
15019
|
directories.push(full);
|
|
15005
15020
|
} else if (item.isFile() && item.name.endsWith(".svelte")) {
|
|
@@ -15008,7 +15023,7 @@ var DYNAMIC_SEGMENT_PATTERN3, pathHasDynamic3 = (path) => path.split("/").some((
|
|
|
15008
15023
|
}
|
|
15009
15024
|
await Promise.all(directories.map((directory) => walkSvelteFiles(directory, files)));
|
|
15010
15025
|
}, analyzeSvelteSpaRoutes = async (svelteDirectory) => {
|
|
15011
|
-
if (!
|
|
15026
|
+
if (!existsSync19(svelteDirectory))
|
|
15012
15027
|
return [];
|
|
15013
15028
|
const files = [];
|
|
15014
15029
|
await walkSvelteFiles(svelteDirectory, files);
|
|
@@ -15031,8 +15046,8 @@ var init_staticAnalyzeSpaRoutes3 = __esm(() => {
|
|
|
15031
15046
|
});
|
|
15032
15047
|
|
|
15033
15048
|
// src/vue/staticAnalyzeSpaRoutes.ts
|
|
15034
|
-
import { existsSync as
|
|
15035
|
-
import { join as
|
|
15049
|
+
import { existsSync as existsSync20, promises as fs4 } from "fs";
|
|
15050
|
+
import { join as join28 } from "path";
|
|
15036
15051
|
import ts6 from "typescript";
|
|
15037
15052
|
var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((seg) => DYNAMIC_SEGMENT_PATTERN4.test(seg) || seg === "**"), readStringLiteral3 = (expression) => {
|
|
15038
15053
|
if (ts6.isStringLiteral(expression) || ts6.isNoSubstitutionTemplateLiteral(expression)) {
|
|
@@ -15265,7 +15280,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
15265
15280
|
for (const item of items) {
|
|
15266
15281
|
if (item.name === "node_modules" || item.name.startsWith("."))
|
|
15267
15282
|
continue;
|
|
15268
|
-
const full =
|
|
15283
|
+
const full = join28(dir, item.name);
|
|
15269
15284
|
if (item.isDirectory()) {
|
|
15270
15285
|
directories.push(full);
|
|
15271
15286
|
} else if (item.isFile() && (item.name.endsWith(".ts") || item.name.endsWith(".js") || item.name.endsWith(".vue")) && !item.name.endsWith(".d.ts")) {
|
|
@@ -15274,7 +15289,7 @@ var DYNAMIC_SEGMENT_PATTERN4, pathHasDynamic4 = (path) => path.split("/").some((
|
|
|
15274
15289
|
}
|
|
15275
15290
|
await Promise.all(directories.map((directory) => walkSourceFiles2(directory, files)));
|
|
15276
15291
|
}, analyzeVueSpaRoutes = async (vueDirectory) => {
|
|
15277
|
-
if (!
|
|
15292
|
+
if (!existsSync20(vueDirectory))
|
|
15278
15293
|
return [];
|
|
15279
15294
|
const files = [];
|
|
15280
15295
|
await walkSourceFiles2(vueDirectory, files);
|
|
@@ -15531,10 +15546,10 @@ var init_generateSitemap = __esm(() => {
|
|
|
15531
15546
|
});
|
|
15532
15547
|
|
|
15533
15548
|
// src/build/scanCssEntryPoints.ts
|
|
15534
|
-
import { existsSync as
|
|
15549
|
+
import { existsSync as existsSync21 } from "fs";
|
|
15535
15550
|
var {Glob: Glob4 } = globalThis.Bun;
|
|
15536
15551
|
var scanCssEntryPoints = async (dir, ignore) => {
|
|
15537
|
-
if (!
|
|
15552
|
+
if (!existsSync21(dir))
|
|
15538
15553
|
return [];
|
|
15539
15554
|
const entryPaths = [];
|
|
15540
15555
|
const glob = new Glob4("**/*.{css,scss,sass,less,styl,stylus}");
|
|
@@ -15551,8 +15566,8 @@ var init_scanCssEntryPoints = __esm(() => {
|
|
|
15551
15566
|
});
|
|
15552
15567
|
|
|
15553
15568
|
// src/utils/imageProcessing.ts
|
|
15554
|
-
import { existsSync as
|
|
15555
|
-
import { join as
|
|
15569
|
+
import { existsSync as existsSync22, mkdirSync as mkdirSync4, readFileSync as readFileSync20, writeFileSync as writeFileSync6 } from "fs";
|
|
15570
|
+
import { join as join29, resolve as resolve22 } from "path";
|
|
15556
15571
|
var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_ENDPOINT = "/_absolute/image", BLUR_DEVIATION = 20, sharpModule = undefined, sharpLoaded = false, sharpWarned = false, snapToSize = (target, sizes) => {
|
|
15557
15572
|
for (const size of sizes) {
|
|
15558
15573
|
if (size >= target)
|
|
@@ -15609,8 +15624,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
15609
15624
|
const image = config?.imageSizes ?? DEFAULT_IMAGE_SIZES;
|
|
15610
15625
|
return [...device, ...image].sort((left, right) => left - right);
|
|
15611
15626
|
}, getCacheDir = (buildDir, cacheDirectory) => {
|
|
15612
|
-
const dir = cacheDirectory ? resolve22(cacheDirectory) :
|
|
15613
|
-
if (!
|
|
15627
|
+
const dir = cacheDirectory ? resolve22(cacheDirectory) : join29(buildDir, ".cache", "images");
|
|
15628
|
+
if (!existsSync22(dir))
|
|
15614
15629
|
mkdirSync4(dir, { recursive: true });
|
|
15615
15630
|
return dir;
|
|
15616
15631
|
}, getCacheKey = (url, width, quality, format) => {
|
|
@@ -15700,13 +15715,13 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
15700
15715
|
return optimizeUnsupportedAvif(err, input, width, quality, format);
|
|
15701
15716
|
}
|
|
15702
15717
|
}, readFromCache = (cacheDir, cacheKey) => {
|
|
15703
|
-
const metaPath =
|
|
15704
|
-
const dataPath =
|
|
15705
|
-
if (!
|
|
15718
|
+
const metaPath = join29(cacheDir, `${cacheKey}.meta`);
|
|
15719
|
+
const dataPath = join29(cacheDir, `${cacheKey}.data`);
|
|
15720
|
+
if (!existsSync22(metaPath) || !existsSync22(dataPath))
|
|
15706
15721
|
return null;
|
|
15707
15722
|
try {
|
|
15708
|
-
const meta = JSON.parse(
|
|
15709
|
-
const buffer =
|
|
15723
|
+
const meta = JSON.parse(readFileSync20(metaPath, "utf-8"));
|
|
15724
|
+
const buffer = readFileSync20(dataPath);
|
|
15710
15725
|
return { buffer, meta };
|
|
15711
15726
|
} catch {
|
|
15712
15727
|
return null;
|
|
@@ -15728,10 +15743,10 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
|
|
|
15728
15743
|
return null;
|
|
15729
15744
|
}
|
|
15730
15745
|
}, writeToCache = (cacheDir, cacheKey, buffer, meta) => {
|
|
15731
|
-
const metaPath =
|
|
15732
|
-
const dataPath =
|
|
15733
|
-
|
|
15734
|
-
|
|
15746
|
+
const metaPath = join29(cacheDir, `${cacheKey}.meta`);
|
|
15747
|
+
const dataPath = join29(cacheDir, `${cacheKey}.data`);
|
|
15748
|
+
writeFileSync6(dataPath, buffer);
|
|
15749
|
+
writeFileSync6(metaPath, JSON.stringify(meta));
|
|
15735
15750
|
};
|
|
15736
15751
|
var init_imageProcessing = __esm(() => {
|
|
15737
15752
|
init_constants();
|
|
@@ -15861,17 +15876,17 @@ var init_updateAssetPaths = __esm(() => {
|
|
|
15861
15876
|
});
|
|
15862
15877
|
|
|
15863
15878
|
// src/dev/buildHMRClient.ts
|
|
15864
|
-
import { existsSync as
|
|
15879
|
+
import { existsSync as existsSync23 } from "fs";
|
|
15865
15880
|
import { resolve as resolve23 } from "path";
|
|
15866
15881
|
var {build: bunBuild } = globalThis.Bun;
|
|
15867
15882
|
var resolveHmrClientPath = () => {
|
|
15868
15883
|
const projectRoot = process.cwd();
|
|
15869
15884
|
const fromSource = resolve23(import.meta.dir, "client/hmrClient.ts");
|
|
15870
|
-
if (
|
|
15885
|
+
if (existsSync23(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
15871
15886
|
return fromSource;
|
|
15872
15887
|
}
|
|
15873
15888
|
const fromNodeModules = resolve23(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
|
|
15874
|
-
if (
|
|
15889
|
+
if (existsSync23(fromNodeModules))
|
|
15875
15890
|
return fromNodeModules;
|
|
15876
15891
|
return resolve23(import.meta.dir, "dev/client/hmrClient.ts");
|
|
15877
15892
|
}, hmrClientPath2, buildHMRClient = async () => {
|
|
@@ -16020,11 +16035,11 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
16020
16035
|
};
|
|
16021
16036
|
|
|
16022
16037
|
// src/dev/lazyPages.ts
|
|
16023
|
-
import { existsSync as
|
|
16024
|
-
import { basename as basename8, extname as extname9, isAbsolute as isAbsolute4, join as
|
|
16038
|
+
import { existsSync as existsSync24 } from "fs";
|
|
16039
|
+
import { basename as basename8, extname as extname9, isAbsolute as isAbsolute4, join as join30, resolve as resolve24 } from "path";
|
|
16025
16040
|
var PAGE_EXTENSIONS, KEY_SUFFIXES, SRC_URL_PREFIX = "/@src/", isTruthyFlag2 = (value) => value === "1" || value === "true", looksLikePath = (value) => value.includes("/") || value.includes("\\") || value.startsWith("."), probeDirForName = ({ dir, framework }, name) => {
|
|
16026
|
-
const extension = PAGE_EXTENSIONS[framework].find((ext) =>
|
|
16027
|
-
return extension === undefined ? undefined : toDevPageEntry(framework,
|
|
16041
|
+
const extension = PAGE_EXTENSIONS[framework].find((ext) => existsSync24(join30(dir, `${name}${ext}`)));
|
|
16042
|
+
return extension === undefined ? undefined : toDevPageEntry(framework, join30(dir, `${name}${extension}`));
|
|
16028
16043
|
}, resolveSourcePath = (keyOrPath) => {
|
|
16029
16044
|
const stripped = keyOrPath.startsWith(SRC_URL_PREFIX) ? decodeSrcPath(keyOrPath.slice(SRC_URL_PREFIX.length).split("?")[0] ?? "") : keyOrPath;
|
|
16030
16045
|
return isAbsolute4(stripped) ? stripped : resolve24(stripped);
|
|
@@ -16063,7 +16078,7 @@ var PAGE_EXTENSIONS, KEY_SUFFIXES, SRC_URL_PREFIX = "/@src/", isTruthyFlag2 = (v
|
|
|
16063
16078
|
const dirs = [];
|
|
16064
16079
|
const push = (dir, framework) => {
|
|
16065
16080
|
if (dir)
|
|
16066
|
-
dirs.push({ dir:
|
|
16081
|
+
dirs.push({ dir: join30(resolve24(dir), "pages"), framework });
|
|
16067
16082
|
};
|
|
16068
16083
|
push(config.reactDirectory, "react");
|
|
16069
16084
|
push(config.svelteDirectory, "svelte");
|
|
@@ -16131,8 +16146,8 @@ var init_lazyPages = __esm(() => {
|
|
|
16131
16146
|
});
|
|
16132
16147
|
|
|
16133
16148
|
// src/build/angularLinkerPlugin.ts
|
|
16134
|
-
import { existsSync as
|
|
16135
|
-
import { dirname as dirname15, join as
|
|
16149
|
+
import { existsSync as existsSync25, mkdirSync as mkdirSync5, readFileSync as readFileSync21, writeFileSync as writeFileSync7 } from "fs";
|
|
16150
|
+
import { dirname as dirname15, join as join31, relative as relative11, resolve as resolve25 } from "path";
|
|
16136
16151
|
import { createHash as createHash5 } from "crypto";
|
|
16137
16152
|
var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
16138
16153
|
name: "angular-linker",
|
|
@@ -16140,7 +16155,7 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
16140
16155
|
let needsLinking;
|
|
16141
16156
|
let babelTransform;
|
|
16142
16157
|
let linkerPlugin;
|
|
16143
|
-
const cacheDir =
|
|
16158
|
+
const cacheDir = join31(CACHE_ROOT, linkerJitMode ? "jit" : "aot");
|
|
16144
16159
|
bld.onLoad({ filter: ANGULAR_LINKER_CANDIDATE_RE }, async (args) => {
|
|
16145
16160
|
const source = await Bun.file(args.path).text();
|
|
16146
16161
|
if (!needsLinking) {
|
|
@@ -16153,10 +16168,10 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
16153
16168
|
return;
|
|
16154
16169
|
}
|
|
16155
16170
|
const hash = createHash5("md5").update(source).digest("hex");
|
|
16156
|
-
const cachePath =
|
|
16157
|
-
if (
|
|
16171
|
+
const cachePath = join31(cacheDir, `${hash}.js`);
|
|
16172
|
+
if (existsSync25(cachePath)) {
|
|
16158
16173
|
return {
|
|
16159
|
-
contents:
|
|
16174
|
+
contents: readFileSync21(cachePath, "utf-8"),
|
|
16160
16175
|
loader: "js"
|
|
16161
16176
|
};
|
|
16162
16177
|
}
|
|
@@ -16171,8 +16186,8 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
16171
16186
|
linkerPlugin = mod.createEs2015LinkerPlugin({
|
|
16172
16187
|
fileSystem: {
|
|
16173
16188
|
dirname: dirname15,
|
|
16174
|
-
exists:
|
|
16175
|
-
readFile:
|
|
16189
|
+
exists: existsSync25,
|
|
16190
|
+
readFile: readFileSync21,
|
|
16176
16191
|
relative: relative11,
|
|
16177
16192
|
resolve: resolve25
|
|
16178
16193
|
},
|
|
@@ -16199,7 +16214,7 @@ var CACHE_ROOT, ANGULAR_LINKER_CANDIDATE_RE, createAngularLinkerPlugin = (linker
|
|
|
16199
16214
|
});
|
|
16200
16215
|
const linked = result?.code ?? source;
|
|
16201
16216
|
mkdirSync5(cacheDir, { recursive: true });
|
|
16202
|
-
|
|
16217
|
+
writeFileSync7(cachePath, linked, "utf-8");
|
|
16203
16218
|
return { contents: linked, loader: "js" };
|
|
16204
16219
|
});
|
|
16205
16220
|
}
|
|
@@ -16286,8 +16301,8 @@ var init_bunStringRawUnicodePlugin = __esm(() => {
|
|
|
16286
16301
|
});
|
|
16287
16302
|
|
|
16288
16303
|
// src/build/externalAssetPlugin.ts
|
|
16289
|
-
import { copyFileSync, existsSync as
|
|
16290
|
-
import { basename as basename9, dirname as dirname16, join as
|
|
16304
|
+
import { copyFileSync, existsSync as existsSync26, mkdirSync as mkdirSync6, statSync as statSync3 } from "fs";
|
|
16305
|
+
import { basename as basename9, dirname as dirname16, join as join32, resolve as resolve26 } from "path";
|
|
16291
16306
|
var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
16292
16307
|
name: "absolute-external-asset",
|
|
16293
16308
|
setup(bld) {
|
|
@@ -16308,12 +16323,12 @@ var createExternalAssetPlugin = (outDir, userSourceRoots = []) => ({
|
|
|
16308
16323
|
if (!relPath)
|
|
16309
16324
|
continue;
|
|
16310
16325
|
const assetPath = resolve26(sourceDir, relPath);
|
|
16311
|
-
if (!
|
|
16326
|
+
if (!existsSync26(assetPath))
|
|
16312
16327
|
continue;
|
|
16313
16328
|
if (!statSync3(assetPath).isFile())
|
|
16314
16329
|
continue;
|
|
16315
|
-
const targetPath =
|
|
16316
|
-
if (
|
|
16330
|
+
const targetPath = join32(outDir, basename9(assetPath));
|
|
16331
|
+
if (existsSync26(targetPath))
|
|
16317
16332
|
continue;
|
|
16318
16333
|
mkdirSync6(dirname16(targetPath), { recursive: true });
|
|
16319
16334
|
copyFileSync(assetPath, targetPath);
|
|
@@ -16517,11 +16532,11 @@ var init_islandRegistryTransform = __esm(() => {
|
|
|
16517
16532
|
});
|
|
16518
16533
|
|
|
16519
16534
|
// src/build/vueModuleOutputPath.ts
|
|
16520
|
-
import { isAbsolute as isAbsolute5, join as
|
|
16535
|
+
import { isAbsolute as isAbsolute5, join as join33, parse as parse2, relative as relative12, resolve as resolve27, sep as sep4 } from "path";
|
|
16521
16536
|
var vueModuleOutputPath = (outputDir, sourcePath) => {
|
|
16522
16537
|
const absolutePath = resolve27(sourcePath);
|
|
16523
16538
|
const { root } = parse2(absolutePath);
|
|
16524
|
-
return
|
|
16539
|
+
return join33(outputDir, "sources", encodeURIComponent(root), relative12(root, absolutePath).replace(/\.(vue|ts)$/, ".js"));
|
|
16525
16540
|
}, vueModuleSourcePath = (outputDir, outputPath) => {
|
|
16526
16541
|
const within = relative12(outputDir, outputPath);
|
|
16527
16542
|
if (isAbsolute5(within) || within === ".." || within.startsWith(`..${sep4}`))
|
|
@@ -16533,7 +16548,7 @@ var vueModuleOutputPath = (outputDir, sourcePath) => {
|
|
|
16533
16548
|
const root = decodeURIComponent(encodedRoot);
|
|
16534
16549
|
if (parse2(root).root !== root || !isAbsolute5(root))
|
|
16535
16550
|
return null;
|
|
16536
|
-
return
|
|
16551
|
+
return join33(root, ...parts);
|
|
16537
16552
|
} catch {
|
|
16538
16553
|
return null;
|
|
16539
16554
|
}
|
|
@@ -16541,7 +16556,7 @@ var vueModuleOutputPath = (outputDir, sourcePath) => {
|
|
|
16541
16556
|
var init_vueModuleOutputPath = () => {};
|
|
16542
16557
|
|
|
16543
16558
|
// src/build/injectVueComposableTracking.ts
|
|
16544
|
-
import { existsSync as
|
|
16559
|
+
import { existsSync as existsSync27, readFileSync as readFileSync22, writeFileSync as writeFileSync8 } from "fs";
|
|
16545
16560
|
import { basename as basename11, isAbsolute as isAbsolute6, relative as relative13, resolve as resolve28 } from "path";
|
|
16546
16561
|
var VUE_HMR_RUNTIME, USE_DECLARATION, MODULE_COMMENT, LINE_TERMINATOR, STATEMENT_OPENER, SOURCE_EXTENSIONS2, CHUNK_REFERENCE, isSharedChunkFile = (fileName) => fileName.startsWith("chunk-") && fileName.endsWith(".js"), collectModuleComments = (content) => Array.from(content.matchAll(MODULE_COMMENT), (match) => ({
|
|
16547
16562
|
index: match.index,
|
|
@@ -16589,7 +16604,7 @@ var VUE_HMR_RUNTIME, USE_DECLARATION, MODULE_COMMENT, LINE_TERMINATOR, STATEMENT
|
|
|
16589
16604
|
return [...selected];
|
|
16590
16605
|
const readChunkReferences = (path) => {
|
|
16591
16606
|
try {
|
|
16592
|
-
return Array.from(
|
|
16607
|
+
return Array.from(readFileSync22(path, "utf-8").matchAll(CHUNK_REFERENCE), (match) => match[1] ?? "");
|
|
16593
16608
|
} catch {
|
|
16594
16609
|
return [];
|
|
16595
16610
|
}
|
|
@@ -16624,10 +16639,10 @@ var VUE_HMR_RUNTIME, USE_DECLARATION, MODULE_COMMENT, LINE_TERMINATOR, STATEMENT
|
|
|
16624
16639
|
}
|
|
16625
16640
|
return UNFOUND_INDEX;
|
|
16626
16641
|
}, injectVueComposableTracking = (outputPath, options) => {
|
|
16627
|
-
const content =
|
|
16642
|
+
const content = readFileSync22(outputPath, "utf-8");
|
|
16628
16643
|
const next = injectVueComposableTrackingIntoContent(content, (commentPath) => commentPath ? resolveVueComposableModuleId(commentPath, options) : outputPath);
|
|
16629
16644
|
if (next !== content)
|
|
16630
|
-
|
|
16645
|
+
writeFileSync8(outputPath, next);
|
|
16631
16646
|
}, injectVueComposableTrackingIntoContent = (content, resolveModuleId) => {
|
|
16632
16647
|
const sourceByName = mapComposablesToSourceComments(content);
|
|
16633
16648
|
if (sourceByName.size === 0)
|
|
@@ -16656,7 +16671,7 @@ ${wrapped.slice(insertAt)}`);
|
|
|
16656
16671
|
if (!sourcePath)
|
|
16657
16672
|
return absolutePath;
|
|
16658
16673
|
const stem = sourcePath.replace(/\.[cm]?js$/, "");
|
|
16659
|
-
const existing = SOURCE_EXTENSIONS2.map((extension) => `${stem}${extension}`).find((candidate) =>
|
|
16674
|
+
const existing = SOURCE_EXTENSIONS2.map((extension) => `${stem}${extension}`).find((candidate) => existsSync27(candidate));
|
|
16660
16675
|
return existing ?? `${stem}.ts`;
|
|
16661
16676
|
};
|
|
16662
16677
|
var init_injectVueComposableTracking = __esm(() => {
|
|
@@ -16952,13 +16967,13 @@ __export(exports_generatedDir, {
|
|
|
16952
16967
|
getFrameworkGeneratedDir: () => getFrameworkGeneratedDir,
|
|
16953
16968
|
getGeneratedRoot: () => getGeneratedRoot
|
|
16954
16969
|
});
|
|
16955
|
-
import { join as
|
|
16956
|
-
var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", getFrameworkGeneratedDir = (framework, projectRoot = process.cwd()) =>
|
|
16970
|
+
import { join as join34 } from "path";
|
|
16971
|
+
var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", getFrameworkGeneratedDir = (framework, projectRoot = process.cwd()) => join34(getGeneratedRoot(projectRoot), framework), getGeneratedRoot = (projectRoot = process.cwd()) => join34(projectRoot, ABSOLUTE_CACHE_DIR_NAME, GENERATED_DIR_NAME);
|
|
16957
16972
|
var init_generatedDir = () => {};
|
|
16958
16973
|
|
|
16959
16974
|
// src/utils/cleanup.ts
|
|
16960
16975
|
import { lstat, rm as rm5 } from "fs/promises";
|
|
16961
|
-
import { join as
|
|
16976
|
+
import { join as join35 } from "path";
|
|
16962
16977
|
var isNotFoundError = (error) => error instanceof Error && ("code" in error) && Reflect.get(error, "code") === "ENOENT", removeIfExists = async (path) => {
|
|
16963
16978
|
try {
|
|
16964
16979
|
await lstat(path);
|
|
@@ -16975,9 +16990,9 @@ var isNotFoundError = (error) => error instanceof Error && ("code" in error) &&
|
|
|
16975
16990
|
}
|
|
16976
16991
|
if (!frameworkDir)
|
|
16977
16992
|
return Promise.all(tasks);
|
|
16978
|
-
tasks.push(removeIfExists(
|
|
16993
|
+
tasks.push(removeIfExists(join35(frameworkDir, "generated")));
|
|
16979
16994
|
if (framework === "angular") {
|
|
16980
|
-
tasks.push(removeIfExists(
|
|
16995
|
+
tasks.push(removeIfExists(join35(frameworkDir, "compiled")), removeIfExists(join35(frameworkDir, "indexes")));
|
|
16981
16996
|
}
|
|
16982
16997
|
return Promise.all(tasks);
|
|
16983
16998
|
}, cleanup = async ({
|
|
@@ -17019,8 +17034,8 @@ var commonAncestor = (paths, fallback) => {
|
|
|
17019
17034
|
var init_commonAncestor = () => {};
|
|
17020
17035
|
|
|
17021
17036
|
// src/utils/buildDirectoryLock.ts
|
|
17022
|
-
import { mkdirSync as mkdirSync7, unlinkSync, writeFileSync as
|
|
17023
|
-
import { dirname as dirname17, join as
|
|
17037
|
+
import { mkdirSync as mkdirSync7, unlinkSync, writeFileSync as writeFileSync9, readFileSync as readFileSync23 } from "fs";
|
|
17038
|
+
import { dirname as dirname17, join as join36 } from "path";
|
|
17024
17039
|
var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandlersRegistered = false, registerExitHandlersOnce = () => {
|
|
17025
17040
|
if (exitHandlersRegistered)
|
|
17026
17041
|
return;
|
|
@@ -17047,7 +17062,7 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
17047
17062
|
console.error(err);
|
|
17048
17063
|
process.exit(1);
|
|
17049
17064
|
});
|
|
17050
|
-
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && Reflect.get(error, "code") === "EEXIST", lockPathForBuildDirectory = (buildDirectory) =>
|
|
17065
|
+
}, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && Reflect.get(error, "code") === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join36(dirname17(buildDirectory), ".absolutejs", "build.lock"), readHeldLockEnv = () => new Set((process.env[HELD_LOCKS_ENV] ?? "").split(`
|
|
17051
17066
|
`).filter((entry) => entry.length > 0)), writeHeldLockEnv = (locks) => {
|
|
17052
17067
|
if (locks.size === 0) {
|
|
17053
17068
|
delete process.env[HELD_LOCKS_ENV];
|
|
@@ -17065,10 +17080,10 @@ var heldLocks, HELD_LOCKS_ENV = "ABSOLUTE_HELD_BUILD_DIRECTORY_LOCKS", exitHandl
|
|
|
17065
17080
|
writeHeldLockEnv(locks);
|
|
17066
17081
|
}, writeLockFileSync = (lockPath, metadata) => {
|
|
17067
17082
|
mkdirSync7(dirname17(lockPath), { recursive: true });
|
|
17068
|
-
|
|
17083
|
+
writeFileSync9(lockPath, JSON.stringify(metadata, null, 2), { flag: "wx" });
|
|
17069
17084
|
}, readLockMetadata = (lockPath) => {
|
|
17070
17085
|
try {
|
|
17071
|
-
const raw =
|
|
17086
|
+
const raw = readFileSync23(lockPath, "utf-8");
|
|
17072
17087
|
const parsed = JSON.parse(raw);
|
|
17073
17088
|
if (typeof parsed === "object" && parsed !== null && typeof parsed.pid === "number") {
|
|
17074
17089
|
return {
|
|
@@ -17204,7 +17219,7 @@ var isTestSourcePath = (file) => {
|
|
|
17204
17219
|
|
|
17205
17220
|
// src/build/pwa.ts
|
|
17206
17221
|
import { mkdir as mkdir7, rm as rm6, writeFile as writeFile8 } from "fs/promises";
|
|
17207
|
-
import { dirname as dirname18, join as
|
|
17222
|
+
import { dirname as dirname18, join as join37 } from "path";
|
|
17208
17223
|
var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "data-absolute-pwa", publicFilePath = (value, fallback, field) => {
|
|
17209
17224
|
const input = value ?? fallback;
|
|
17210
17225
|
if (!input.startsWith("/") || input.startsWith("//")) {
|
|
@@ -17231,7 +17246,7 @@ var BOOTSTRAP_PUBLIC_PATH = "/__absolute/pwa/bootstrap.js", BOOTSTRAP_MARKER = "
|
|
|
17231
17246
|
}
|
|
17232
17247
|
}
|
|
17233
17248
|
return url.pathname;
|
|
17234
|
-
}, destinationFor = (buildPath, publicPath) =>
|
|
17249
|
+
}, destinationFor = (buildPath, publicPath) => join37(buildPath, ...publicPath.split("/").filter(Boolean)), bootstrapEntrySource = ({
|
|
17235
17250
|
clientModule,
|
|
17236
17251
|
manifestPath,
|
|
17237
17252
|
push,
|
|
@@ -17308,8 +17323,8 @@ ${push ? `,
|
|
|
17308
17323
|
await writeFile8(manifestDestination, `${JSON.stringify(createWebAppManifest(manifestConfig), null, "\t")}
|
|
17309
17324
|
`);
|
|
17310
17325
|
}
|
|
17311
|
-
const generatedDirectory =
|
|
17312
|
-
const bootstrapEntry =
|
|
17326
|
+
const generatedDirectory = join37(generatedRoot, "pwa");
|
|
17327
|
+
const bootstrapEntry = join37(generatedDirectory, "bootstrap.ts");
|
|
17313
17328
|
const clientModule = Bun.resolveSync("@absolutejs/pwa/client", import.meta.dir);
|
|
17314
17329
|
await mkdir7(generatedDirectory, { recursive: true });
|
|
17315
17330
|
await writeFile8(bootstrapEntry, bootstrapEntrySource({
|
|
@@ -18055,7 +18070,7 @@ var init_typescript_translator = __esm(() => {
|
|
|
18055
18070
|
});
|
|
18056
18071
|
|
|
18057
18072
|
// src/dev/angular/fastHmrCompiler.ts
|
|
18058
|
-
import { existsSync as
|
|
18073
|
+
import { existsSync as existsSync28, readFileSync as readFileSync24, statSync as statSync4 } from "fs";
|
|
18059
18074
|
import { dirname as dirname19, extname as extname11, relative as relative16, resolve as resolve32 } from "path";
|
|
18060
18075
|
import ts12 from "typescript";
|
|
18061
18076
|
var fail = (reason, detail, location) => ({
|
|
@@ -18377,11 +18392,11 @@ var fail = (reason, detail, location) => ({
|
|
|
18377
18392
|
`${base}/index.tsx`
|
|
18378
18393
|
];
|
|
18379
18394
|
for (const candidate of candidates) {
|
|
18380
|
-
if (!
|
|
18395
|
+
if (!existsSync28(candidate))
|
|
18381
18396
|
continue;
|
|
18382
18397
|
let content;
|
|
18383
18398
|
try {
|
|
18384
|
-
content =
|
|
18399
|
+
content = readFileSync24(candidate, "utf-8");
|
|
18385
18400
|
} catch {
|
|
18386
18401
|
continue;
|
|
18387
18402
|
}
|
|
@@ -18969,7 +18984,7 @@ var fail = (reason, detail, location) => ({
|
|
|
18969
18984
|
return cached.info;
|
|
18970
18985
|
let source;
|
|
18971
18986
|
try {
|
|
18972
|
-
source =
|
|
18987
|
+
source = readFileSync24(filePath, "utf-8");
|
|
18973
18988
|
} catch {
|
|
18974
18989
|
childComponentInfoCache.set(cacheKey, {
|
|
18975
18990
|
info: null,
|
|
@@ -19023,7 +19038,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19023
19038
|
return cached.info;
|
|
19024
19039
|
let content;
|
|
19025
19040
|
try {
|
|
19026
|
-
content =
|
|
19041
|
+
content = readFileSync24(dtsPath, "utf-8");
|
|
19027
19042
|
} catch {
|
|
19028
19043
|
childComponentInfoCache.set(cacheKey, {
|
|
19029
19044
|
info: null,
|
|
@@ -19142,11 +19157,11 @@ var fail = (reason, detail, location) => ({
|
|
|
19142
19157
|
if (visited.has(startDtsPath))
|
|
19143
19158
|
return null;
|
|
19144
19159
|
visited.add(startDtsPath);
|
|
19145
|
-
if (!
|
|
19160
|
+
if (!existsSync28(startDtsPath))
|
|
19146
19161
|
return null;
|
|
19147
19162
|
let content;
|
|
19148
19163
|
try {
|
|
19149
|
-
content =
|
|
19164
|
+
content = readFileSync24(startDtsPath, "utf-8");
|
|
19150
19165
|
} catch {
|
|
19151
19166
|
return null;
|
|
19152
19167
|
}
|
|
@@ -19195,16 +19210,16 @@ var fail = (reason, detail, location) => ({
|
|
|
19195
19210
|
`${base}/index.d.cts`
|
|
19196
19211
|
];
|
|
19197
19212
|
for (const c of candidates) {
|
|
19198
|
-
if (
|
|
19213
|
+
if (existsSync28(c))
|
|
19199
19214
|
return c;
|
|
19200
19215
|
}
|
|
19201
19216
|
return null;
|
|
19202
19217
|
}, findPackageDtsForJs = (jsPath) => {
|
|
19203
19218
|
const sibling = jsPath.replace(/\.[mc]?js$/, ".d.ts");
|
|
19204
|
-
if (
|
|
19219
|
+
if (existsSync28(sibling))
|
|
19205
19220
|
return sibling;
|
|
19206
19221
|
const mirror = jsPath.replace(/\/dist\//, "/dist/src/").replace(/\.[mc]?js$/, ".d.ts");
|
|
19207
|
-
if (
|
|
19222
|
+
if (existsSync28(mirror))
|
|
19208
19223
|
return mirror;
|
|
19209
19224
|
return null;
|
|
19210
19225
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
@@ -19217,7 +19232,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19217
19232
|
`${base}/index.tsx`
|
|
19218
19233
|
];
|
|
19219
19234
|
for (const candidate of candidates) {
|
|
19220
|
-
if (!
|
|
19235
|
+
if (!existsSync28(candidate))
|
|
19221
19236
|
continue;
|
|
19222
19237
|
const info = getChildComponentInfoFromTsSource(candidate, className);
|
|
19223
19238
|
if (info)
|
|
@@ -19364,7 +19379,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19364
19379
|
return cached.hasProviders;
|
|
19365
19380
|
let source;
|
|
19366
19381
|
try {
|
|
19367
|
-
source =
|
|
19382
|
+
source = readFileSync24(filePath, "utf8");
|
|
19368
19383
|
} catch {
|
|
19369
19384
|
return true;
|
|
19370
19385
|
}
|
|
@@ -19431,11 +19446,11 @@ var fail = (reason, detail, location) => ({
|
|
|
19431
19446
|
const resolved = resolve32(componentDir, spec);
|
|
19432
19447
|
for (const ext of TS_EXTENSIONS) {
|
|
19433
19448
|
const candidate = resolved + ext;
|
|
19434
|
-
if (
|
|
19449
|
+
if (existsSync28(candidate))
|
|
19435
19450
|
return candidate;
|
|
19436
19451
|
}
|
|
19437
19452
|
const indexCandidate = resolve32(resolved, "index.ts");
|
|
19438
|
-
if (
|
|
19453
|
+
if (existsSync28(indexCandidate))
|
|
19439
19454
|
return indexCandidate;
|
|
19440
19455
|
}
|
|
19441
19456
|
return null;
|
|
@@ -19673,11 +19688,11 @@ ${transpiled}
|
|
|
19673
19688
|
}${staticPatch}`;
|
|
19674
19689
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
19675
19690
|
const abs = resolve32(componentDir, url);
|
|
19676
|
-
if (!
|
|
19691
|
+
if (!existsSync28(abs))
|
|
19677
19692
|
return null;
|
|
19678
19693
|
const ext = extname11(abs).toLowerCase();
|
|
19679
19694
|
if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
|
|
19680
|
-
return
|
|
19695
|
+
return readFileSync24(abs, "utf8");
|
|
19681
19696
|
}
|
|
19682
19697
|
try {
|
|
19683
19698
|
return compileStyleFileIfNeededSync(abs);
|
|
@@ -19713,9 +19728,9 @@ ${block}
|
|
|
19713
19728
|
return cached;
|
|
19714
19729
|
const tsconfigPath = resolve32(projectRoot, "tsconfig.json");
|
|
19715
19730
|
const opts = {};
|
|
19716
|
-
if (
|
|
19731
|
+
if (existsSync28(tsconfigPath)) {
|
|
19717
19732
|
try {
|
|
19718
|
-
const text =
|
|
19733
|
+
const text = readFileSync24(tsconfigPath, "utf8");
|
|
19719
19734
|
const parsed = ts12.parseConfigFileTextToJson(tsconfigPath, text);
|
|
19720
19735
|
if (!parsed.error && parsed.config) {
|
|
19721
19736
|
const cfg = parsed.config;
|
|
@@ -19740,7 +19755,7 @@ ${block}
|
|
|
19740
19755
|
}, tryFastHmr = async (params) => {
|
|
19741
19756
|
const { componentFilePath, className } = params;
|
|
19742
19757
|
const projectRoot = params.projectRoot ?? process.cwd();
|
|
19743
|
-
if (!
|
|
19758
|
+
if (!existsSync28(componentFilePath)) {
|
|
19744
19759
|
return fail("file-not-found", componentFilePath);
|
|
19745
19760
|
}
|
|
19746
19761
|
let compiler;
|
|
@@ -19749,7 +19764,7 @@ ${block}
|
|
|
19749
19764
|
} catch (err) {
|
|
19750
19765
|
return fail("unexpected-error", `import @angular/compiler: ${err}`);
|
|
19751
19766
|
}
|
|
19752
|
-
const tsSource =
|
|
19767
|
+
const tsSource = readFileSync24(componentFilePath, "utf8");
|
|
19753
19768
|
const sourceFile = ts12.createSourceFile(componentFilePath, tsSource, ts12.ScriptTarget.ES2022, true, ts12.ScriptKind.TS);
|
|
19754
19769
|
const classNode = findClassDeclaration(sourceFile, className);
|
|
19755
19770
|
if (!classNode) {
|
|
@@ -19796,10 +19811,10 @@ ${block}
|
|
|
19796
19811
|
templatePath = componentFilePath;
|
|
19797
19812
|
} else if (decoratorMeta.templateUrl) {
|
|
19798
19813
|
const tplAbs = resolve32(componentDir, decoratorMeta.templateUrl);
|
|
19799
|
-
if (!
|
|
19814
|
+
if (!existsSync28(tplAbs)) {
|
|
19800
19815
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
19801
19816
|
}
|
|
19802
|
-
templateText =
|
|
19817
|
+
templateText = readFileSync24(tplAbs, "utf8");
|
|
19803
19818
|
templatePath = tplAbs;
|
|
19804
19819
|
} else {
|
|
19805
19820
|
return fail("unsupported-decorator-args", "missing template/templateUrl");
|
|
@@ -20119,8 +20134,8 @@ var init_fastHmrCompiler = __esm(() => {
|
|
|
20119
20134
|
});
|
|
20120
20135
|
|
|
20121
20136
|
// src/build/scanVueSsrOnlyPages.ts
|
|
20122
|
-
import { readdirSync as readdirSync3, readFileSync as
|
|
20123
|
-
import { join as
|
|
20137
|
+
import { readdirSync as readdirSync3, readFileSync as readFileSync25 } from "fs";
|
|
20138
|
+
import { join as join38 } from "path";
|
|
20124
20139
|
import ts13 from "typescript";
|
|
20125
20140
|
var SKIP_DIRS2, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
20126
20141
|
if (filePath.endsWith(".tsx"))
|
|
@@ -20153,9 +20168,9 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
|
20153
20168
|
continue;
|
|
20154
20169
|
if (entry.name.startsWith("."))
|
|
20155
20170
|
continue;
|
|
20156
|
-
stack.push(
|
|
20171
|
+
stack.push(join38(dir, entry.name));
|
|
20157
20172
|
} else if (entry.isFile() && hasSourceExtension2(entry.name)) {
|
|
20158
|
-
out.push(
|
|
20173
|
+
out.push(join38(dir, entry.name));
|
|
20159
20174
|
}
|
|
20160
20175
|
}
|
|
20161
20176
|
}
|
|
@@ -20223,7 +20238,7 @@ var SKIP_DIRS2, SOURCE_EXTENSIONS3, getScriptKind3 = (filePath) => {
|
|
|
20223
20238
|
const out = new Set;
|
|
20224
20239
|
let source;
|
|
20225
20240
|
try {
|
|
20226
|
-
source =
|
|
20241
|
+
source = readFileSync25(filePath, "utf-8");
|
|
20227
20242
|
} catch {
|
|
20228
20243
|
return [];
|
|
20229
20244
|
}
|
|
@@ -20274,8 +20289,8 @@ var init_scanVueSsrOnlyPages = __esm(() => {
|
|
|
20274
20289
|
});
|
|
20275
20290
|
|
|
20276
20291
|
// src/build/scanAngularHandlerCalls.ts
|
|
20277
|
-
import { readdirSync as readdirSync4, readFileSync as
|
|
20278
|
-
import { join as
|
|
20292
|
+
import { readdirSync as readdirSync4, readFileSync as readFileSync26 } from "fs";
|
|
20293
|
+
import { join as join39 } from "path";
|
|
20279
20294
|
import ts14 from "typescript";
|
|
20280
20295
|
var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS4, SERVER_ENTRY_COPY_PREFIX = ".absolutejs-hmr-", getScriptKind4 = (filePath) => {
|
|
20281
20296
|
if (filePath.endsWith(".tsx"))
|
|
@@ -20308,9 +20323,9 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS4, SERVER_ENTRY_COPY_PRE
|
|
|
20308
20323
|
continue;
|
|
20309
20324
|
if (entry.name.startsWith("."))
|
|
20310
20325
|
continue;
|
|
20311
|
-
stack.push(
|
|
20326
|
+
stack.push(join39(dir, entry.name));
|
|
20312
20327
|
} else if (entry.isFile() && !entry.name.startsWith(SERVER_ENTRY_COPY_PREFIX) && hasSourceExtension3(entry.name)) {
|
|
20313
|
-
out.push(
|
|
20328
|
+
out.push(join39(dir, entry.name));
|
|
20314
20329
|
}
|
|
20315
20330
|
}
|
|
20316
20331
|
}
|
|
@@ -20345,7 +20360,7 @@ var ELYSIA_ROUTE_METHODS2, SKIP_DIRS3, SOURCE_EXTENSIONS4, SERVER_ENTRY_COPY_PRE
|
|
|
20345
20360
|
}, extractCallsFromFile = (filePath, out) => {
|
|
20346
20361
|
let source;
|
|
20347
20362
|
try {
|
|
20348
|
-
source =
|
|
20363
|
+
source = readFileSync26(filePath, "utf-8");
|
|
20349
20364
|
} catch {
|
|
20350
20365
|
return;
|
|
20351
20366
|
}
|
|
@@ -20424,8 +20439,8 @@ var init_scanAngularHandlerCalls = __esm(() => {
|
|
|
20424
20439
|
});
|
|
20425
20440
|
|
|
20426
20441
|
// src/build/scanAngularPageRoutes.ts
|
|
20427
|
-
import { readdirSync as readdirSync5, readFileSync as
|
|
20428
|
-
import { basename as basename12, join as
|
|
20442
|
+
import { readdirSync as readdirSync5, readFileSync as readFileSync27 } from "fs";
|
|
20443
|
+
import { basename as basename12, join as join40 } from "path";
|
|
20429
20444
|
import ts15 from "typescript";
|
|
20430
20445
|
var SOURCE_EXTENSIONS5, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
20431
20446
|
const idx = filePath.lastIndexOf(".");
|
|
@@ -20465,9 +20480,9 @@ var SOURCE_EXTENSIONS5, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
20465
20480
|
continue;
|
|
20466
20481
|
if (entry.name.startsWith("."))
|
|
20467
20482
|
continue;
|
|
20468
|
-
stack.push(
|
|
20483
|
+
stack.push(join40(dir, entry.name));
|
|
20469
20484
|
} else if (entry.isFile() && isPageFile(entry.name)) {
|
|
20470
|
-
out.push(
|
|
20485
|
+
out.push(join40(dir, entry.name));
|
|
20471
20486
|
}
|
|
20472
20487
|
}
|
|
20473
20488
|
}
|
|
@@ -20496,7 +20511,7 @@ var SOURCE_EXTENSIONS5, SKIP_DIRS4, hasSourceExtension4 = (filePath) => {
|
|
|
20496
20511
|
for (const file of files) {
|
|
20497
20512
|
let source;
|
|
20498
20513
|
try {
|
|
20499
|
-
source =
|
|
20514
|
+
source = readFileSync27(file, "utf-8");
|
|
20500
20515
|
} catch {
|
|
20501
20516
|
continue;
|
|
20502
20517
|
}
|
|
@@ -20535,8 +20550,8 @@ var init_runAngularHandlerScan = __esm(() => {
|
|
|
20535
20550
|
});
|
|
20536
20551
|
|
|
20537
20552
|
// src/build/parseAngularConfigImports.ts
|
|
20538
|
-
import { existsSync as
|
|
20539
|
-
import { dirname as dirname20, isAbsolute as isAbsolute7, join as
|
|
20553
|
+
import { existsSync as existsSync29, readFileSync as readFileSync28 } from "fs";
|
|
20554
|
+
import { dirname as dirname20, isAbsolute as isAbsolute7, join as join41 } from "path";
|
|
20540
20555
|
import ts16 from "typescript";
|
|
20541
20556
|
var findDefineConfigCall = (sf) => {
|
|
20542
20557
|
let result = null;
|
|
@@ -20591,18 +20606,18 @@ var findDefineConfigCall = (sf) => {
|
|
|
20591
20606
|
}, resolveConfigPath = (projectRoot) => {
|
|
20592
20607
|
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
20593
20608
|
if (envOverride) {
|
|
20594
|
-
const resolved = isAbsolute7(envOverride) ? envOverride :
|
|
20595
|
-
if (
|
|
20609
|
+
const resolved = isAbsolute7(envOverride) ? envOverride : join41(projectRoot, envOverride);
|
|
20610
|
+
if (existsSync29(resolved))
|
|
20596
20611
|
return resolved;
|
|
20597
20612
|
}
|
|
20598
20613
|
const candidates = [
|
|
20599
|
-
|
|
20600
|
-
|
|
20601
|
-
|
|
20602
|
-
|
|
20614
|
+
join41(projectRoot, "absolute.config.ts"),
|
|
20615
|
+
join41(projectRoot, "absolute.config.mts"),
|
|
20616
|
+
join41(projectRoot, "absolute.config.js"),
|
|
20617
|
+
join41(projectRoot, "absolute.config.mjs")
|
|
20603
20618
|
];
|
|
20604
20619
|
for (const candidate of candidates) {
|
|
20605
|
-
if (
|
|
20620
|
+
if (existsSync29(candidate))
|
|
20606
20621
|
return candidate;
|
|
20607
20622
|
}
|
|
20608
20623
|
return null;
|
|
@@ -20610,7 +20625,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
20610
20625
|
const configPath = resolveConfigPath(projectRoot);
|
|
20611
20626
|
if (!configPath)
|
|
20612
20627
|
return null;
|
|
20613
|
-
const source =
|
|
20628
|
+
const source = readFileSync28(configPath, "utf-8");
|
|
20614
20629
|
if (!source.includes("angular"))
|
|
20615
20630
|
return null;
|
|
20616
20631
|
if (!source.includes("providers"))
|
|
@@ -20632,7 +20647,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
20632
20647
|
if (!importInfo)
|
|
20633
20648
|
return null;
|
|
20634
20649
|
const configDir = dirname20(configPath);
|
|
20635
|
-
const absolutePath = importInfo.source.startsWith(".") ?
|
|
20650
|
+
const absolutePath = importInfo.source.startsWith(".") ? join41(configDir, importInfo.source).replace(/\.[cm]?[tj]sx?$/, "") : isAbsolute7(importInfo.source) ? importInfo.source.replace(/\.[cm]?[tj]sx?$/, "") : importInfo.source;
|
|
20636
20651
|
return {
|
|
20637
20652
|
absolutePath,
|
|
20638
20653
|
bindingName: binding,
|
|
@@ -20693,11 +20708,11 @@ var init_renderToReadableStream = __esm(() => {
|
|
|
20693
20708
|
});
|
|
20694
20709
|
|
|
20695
20710
|
// src/build/compileSvelte.ts
|
|
20696
|
-
import { existsSync as
|
|
20711
|
+
import { existsSync as existsSync30 } from "fs";
|
|
20697
20712
|
import { mkdir as mkdir8, stat as stat3 } from "fs/promises";
|
|
20698
20713
|
import {
|
|
20699
20714
|
dirname as dirname21,
|
|
20700
|
-
join as
|
|
20715
|
+
join as join42,
|
|
20701
20716
|
basename as basename13,
|
|
20702
20717
|
extname as extname12,
|
|
20703
20718
|
resolve as resolve33,
|
|
@@ -20709,11 +20724,11 @@ var {write: write2, file: file2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
|
20709
20724
|
var resolveDevClientDir2 = () => {
|
|
20710
20725
|
const projectRoot = process.cwd();
|
|
20711
20726
|
const fromSource = resolve33(import.meta.dir, "../dev/client");
|
|
20712
|
-
if (
|
|
20727
|
+
if (existsSync30(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
20713
20728
|
return fromSource;
|
|
20714
20729
|
}
|
|
20715
20730
|
const fromNodeModules = resolve33(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
20716
|
-
if (
|
|
20731
|
+
if (existsSync30(fromNodeModules))
|
|
20717
20732
|
return fromNodeModules;
|
|
20718
20733
|
return resolve33(import.meta.dir, "./dev/client");
|
|
20719
20734
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, transpiler3, removeUnusedRequireHelper = (code) => {
|
|
@@ -20753,14 +20768,14 @@ var resolveDevClientDir2 = () => {
|
|
|
20753
20768
|
`${basePath}.svelte`,
|
|
20754
20769
|
`${basePath}.svelte.ts`,
|
|
20755
20770
|
`${basePath}.svelte.js`,
|
|
20756
|
-
|
|
20757
|
-
|
|
20758
|
-
|
|
20759
|
-
|
|
20760
|
-
|
|
20761
|
-
|
|
20762
|
-
|
|
20763
|
-
|
|
20771
|
+
join42(basePath, "index.ts"),
|
|
20772
|
+
join42(basePath, "index.js"),
|
|
20773
|
+
join42(basePath, "index.mjs"),
|
|
20774
|
+
join42(basePath, "index.cjs"),
|
|
20775
|
+
join42(basePath, "index.json"),
|
|
20776
|
+
join42(basePath, "index.svelte"),
|
|
20777
|
+
join42(basePath, "index.svelte.ts"),
|
|
20778
|
+
join42(basePath, "index.svelte.js")
|
|
20764
20779
|
];
|
|
20765
20780
|
const checks = await Promise.all(candidates.map(exists2));
|
|
20766
20781
|
return candidates.find((_, index) => checks[index]) ?? null;
|
|
@@ -20799,9 +20814,9 @@ var resolveDevClientDir2 = () => {
|
|
|
20799
20814
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false, stylePreprocessors) => {
|
|
20800
20815
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
20801
20816
|
const generatedDir = getFrameworkGeneratedDir("svelte");
|
|
20802
|
-
const clientDir =
|
|
20803
|
-
const indexDir =
|
|
20804
|
-
const serverDir =
|
|
20817
|
+
const clientDir = join42(generatedDir, "client");
|
|
20818
|
+
const indexDir = join42(generatedDir, "indexes");
|
|
20819
|
+
const serverDir = join42(generatedDir, "server");
|
|
20805
20820
|
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir8(dir, { recursive: true })));
|
|
20806
20821
|
const dev = env2.NODE_ENV !== "production";
|
|
20807
20822
|
const build = async (src) => {
|
|
@@ -20813,7 +20828,7 @@ var resolveDevClientDir2 = () => {
|
|
|
20813
20828
|
const contentHash = Bun.hash(raw).toString(BASE_36_RADIX);
|
|
20814
20829
|
const prevHash = sourceHashCache.get(src);
|
|
20815
20830
|
const persistent = persistentCache.get(src);
|
|
20816
|
-
if (prevHash === contentHash && persistent &&
|
|
20831
|
+
if (prevHash === contentHash && persistent && existsSync30(persistent.ssr) && existsSync30(persistent.client)) {
|
|
20817
20832
|
cache.set(src, persistent);
|
|
20818
20833
|
return persistent;
|
|
20819
20834
|
}
|
|
@@ -20839,8 +20854,8 @@ var resolveDevClientDir2 = () => {
|
|
|
20839
20854
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
20840
20855
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
20841
20856
|
const externalRewrites = new Map;
|
|
20842
|
-
const ssrOutputDir = dirname21(
|
|
20843
|
-
const clientOutputDir = dirname21(
|
|
20857
|
+
const ssrOutputDir = dirname21(join42(serverDir, relDir, `${baseName}.js`));
|
|
20858
|
+
const clientOutputDir = dirname21(join42(clientDir, relDir, `${baseName}.js`));
|
|
20844
20859
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
20845
20860
|
const rawSpec = importPaths[idx];
|
|
20846
20861
|
if (!rawSpec)
|
|
@@ -20905,8 +20920,8 @@ var resolveDevClientDir2 = () => {
|
|
|
20905
20920
|
code += islandMetadataExports;
|
|
20906
20921
|
return { code, map: compiledJs.map };
|
|
20907
20922
|
};
|
|
20908
|
-
const ssrPath =
|
|
20909
|
-
const clientPath =
|
|
20923
|
+
const ssrPath = join42(serverDir, relDir, `${baseName}.js`);
|
|
20924
|
+
const clientPath = join42(clientDir, relDir, `${baseName}.js`);
|
|
20910
20925
|
await Promise.all([
|
|
20911
20926
|
mkdir8(dirname21(ssrPath), { recursive: true }),
|
|
20912
20927
|
mkdir8(dirname21(clientPath), { recursive: true })
|
|
@@ -20946,7 +20961,7 @@ var resolveDevClientDir2 = () => {
|
|
|
20946
20961
|
await Promise.all(componentRoots.map(async ({ client, hasAwaitSlot }) => {
|
|
20947
20962
|
const relClientDir = dirname21(relative17(clientDir, client));
|
|
20948
20963
|
const name = basename13(client, extname12(client));
|
|
20949
|
-
const indexPath =
|
|
20964
|
+
const indexPath = join42(indexDir, relClientDir, `${name}.js`);
|
|
20950
20965
|
const importRaw = relative17(dirname21(indexPath), client).split(sep5).join("/");
|
|
20951
20966
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
20952
20967
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
@@ -21049,7 +21064,7 @@ if (typeof window !== "undefined") {
|
|
|
21049
21064
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
21050
21065
|
svelteIndexPaths: componentRoots.map(({ client }) => {
|
|
21051
21066
|
const rel = dirname21(relative17(clientDir, client));
|
|
21052
|
-
return
|
|
21067
|
+
return join42(indexDir, rel, basename13(client));
|
|
21053
21068
|
}),
|
|
21054
21069
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
21055
21070
|
};
|
|
@@ -21064,7 +21079,7 @@ var init_compileSvelte = __esm(() => {
|
|
|
21064
21079
|
init_lowerAwaitSlotSyntax();
|
|
21065
21080
|
init_renderToReadableStream();
|
|
21066
21081
|
devClientDir2 = resolveDevClientDir2();
|
|
21067
|
-
hmrClientPath3 =
|
|
21082
|
+
hmrClientPath3 = join42(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
21068
21083
|
persistentCache = new Map;
|
|
21069
21084
|
sourceHashCache = new Map;
|
|
21070
21085
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
@@ -21220,7 +21235,7 @@ __export(exports_chainInlineSourcemaps, {
|
|
|
21220
21235
|
inlineLineMapComment: () => inlineLineMapComment,
|
|
21221
21236
|
remapGeneratedLines: () => remapGeneratedLines
|
|
21222
21237
|
});
|
|
21223
|
-
import { readFileSync as
|
|
21238
|
+
import { readFileSync as readFileSync29, writeFileSync as writeFileSync10 } from "fs";
|
|
21224
21239
|
var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", BASE64_TO_INT, decodeVlq = (str, startPos) => {
|
|
21225
21240
|
let result = 0;
|
|
21226
21241
|
let shift = 0;
|
|
@@ -21511,7 +21526,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
21511
21526
|
version: 3
|
|
21512
21527
|
};
|
|
21513
21528
|
}, chainBundleInlineSourcemap = (bundleFilePath, { sourcesContent = false } = {}) => {
|
|
21514
|
-
const text =
|
|
21529
|
+
const text = readFileSync29(bundleFilePath, "utf-8");
|
|
21515
21530
|
const outerMap = extractInlineMap(text);
|
|
21516
21531
|
if (!outerMap)
|
|
21517
21532
|
return false;
|
|
@@ -21530,7 +21545,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
21530
21545
|
const stripped = text.replace(SOURCEMAP_INLINE_RE, "");
|
|
21531
21546
|
const inline = `
|
|
21532
21547
|
//# sourceMappingURL=data:application/json;base64,` + Buffer.from(JSON.stringify(chained)).toString("base64");
|
|
21533
|
-
|
|
21548
|
+
writeFileSync10(bundleFilePath, stripped + inline);
|
|
21534
21549
|
return true;
|
|
21535
21550
|
}, chainBundleInlineSourcemaps = async (bundlePaths, { sourcesContent = false } = {}) => {
|
|
21536
21551
|
await Promise.resolve().then(() => init_workerPool());
|
|
@@ -21540,7 +21555,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
21540
21555
|
}, chainExternalSourcemap = (mapFilePath) => {
|
|
21541
21556
|
let outerMap;
|
|
21542
21557
|
try {
|
|
21543
|
-
outerMap = JSON.parse(
|
|
21558
|
+
outerMap = JSON.parse(readFileSync29(mapFilePath, "utf-8"));
|
|
21544
21559
|
} catch {
|
|
21545
21560
|
return;
|
|
21546
21561
|
}
|
|
@@ -21555,7 +21570,7 @@ var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567
|
|
|
21555
21570
|
return null;
|
|
21556
21571
|
return extractInlineMap(content);
|
|
21557
21572
|
});
|
|
21558
|
-
|
|
21573
|
+
writeFileSync10(mapFilePath, JSON.stringify(chained));
|
|
21559
21574
|
};
|
|
21560
21575
|
var init_chainInlineSourcemaps = __esm(() => {
|
|
21561
21576
|
BASE64_TO_INT = new Int8Array(128).fill(-1);
|
|
@@ -21567,9 +21582,9 @@ var init_chainInlineSourcemaps = __esm(() => {
|
|
|
21567
21582
|
|
|
21568
21583
|
// src/build/vueCompileCache.ts
|
|
21569
21584
|
import { createHash as createHash6 } from "crypto";
|
|
21570
|
-
import { existsSync as
|
|
21585
|
+
import { existsSync as existsSync31, readFileSync as readFileSync30 } from "fs";
|
|
21571
21586
|
import { mkdir as mkdir9, rename as rename2, writeFile as writeFile9 } from "fs/promises";
|
|
21572
|
-
import { join as
|
|
21587
|
+
import { join as join43, resolve as resolve34 } from "path";
|
|
21573
21588
|
var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs", CACHE_FORMAT_VERSION = 3, FILE_NAME_HASH_LENGTH = 32, vueCompileCacheEnabled = () => process.env.ABSOLUTE_COMPILE_CACHE !== "0", hashContent = (content) => createHash6("sha256").update(content).digest("hex"), hashParts = (parts) => {
|
|
21574
21589
|
const hash = createHash6("sha256");
|
|
21575
21590
|
for (const part of parts) {
|
|
@@ -21584,7 +21599,7 @@ var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs",
|
|
|
21584
21599
|
];
|
|
21585
21600
|
for (const candidate of candidates) {
|
|
21586
21601
|
try {
|
|
21587
|
-
const pkg = JSON.parse(
|
|
21602
|
+
const pkg = JSON.parse(readFileSync30(candidate, "utf-8"));
|
|
21588
21603
|
if (pkg.name === "@absolutejs/absolute" && pkg.version) {
|
|
21589
21604
|
return pkg.version;
|
|
21590
21605
|
}
|
|
@@ -21595,7 +21610,7 @@ var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs",
|
|
|
21595
21610
|
}, cachedFrameworkVersion, frameworkVersionForCache = () => {
|
|
21596
21611
|
cachedFrameworkVersion ??= readOwnPackageVersion();
|
|
21597
21612
|
return cachedFrameworkVersion;
|
|
21598
|
-
}, vueCompileCacheDir = (projectRoot = process.cwd()) =>
|
|
21613
|
+
}, vueCompileCacheDir = (projectRoot = process.cwd()) => join43(projectRoot, ABSOLUTE_CACHE_DIR_NAME2, CACHE_DIR_NAME, "vue"), entryFileFor = (sourceFilePath, projectRoot) => join43(vueCompileCacheDir(projectRoot), `${hashContent(sourceFilePath).slice(0, FILE_NAME_HASH_LENGTH)}.json`), vueCompileCacheFingerprint = (parts) => {
|
|
21599
21614
|
const frameworkVersion = frameworkVersionForCache();
|
|
21600
21615
|
if (!frameworkVersion)
|
|
21601
21616
|
return null;
|
|
@@ -21612,7 +21627,7 @@ var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs",
|
|
|
21612
21627
|
}, typeDepsUnchanged = (typeDeps) => {
|
|
21613
21628
|
for (const [path, hash] of Object.entries(typeDeps)) {
|
|
21614
21629
|
try {
|
|
21615
|
-
if (hashContent(
|
|
21630
|
+
if (hashContent(readFileSync30(path, "utf-8")) !== hash)
|
|
21616
21631
|
return false;
|
|
21617
21632
|
} catch {
|
|
21618
21633
|
return false;
|
|
@@ -21628,10 +21643,10 @@ var CACHE_DIR_NAME = "compile-cache", ABSOLUTE_CACHE_DIR_NAME2 = ".absolutejs",
|
|
|
21628
21643
|
if (!vueCompileCacheEnabled())
|
|
21629
21644
|
return null;
|
|
21630
21645
|
const entryFile = entryFileFor(sourceFilePath, projectRoot);
|
|
21631
|
-
if (!
|
|
21646
|
+
if (!existsSync31(entryFile))
|
|
21632
21647
|
return null;
|
|
21633
21648
|
try {
|
|
21634
|
-
const parsed = JSON.parse(
|
|
21649
|
+
const parsed = JSON.parse(readFileSync30(entryFile, "utf-8"));
|
|
21635
21650
|
if (!isEntryShape(parsed) || parsed.key !== key)
|
|
21636
21651
|
return null;
|
|
21637
21652
|
if (!typeDepsUnchanged(parsed.typeDeps))
|
|
@@ -21659,10 +21674,10 @@ __export(exports_emitTsHelpers, {
|
|
|
21659
21674
|
emitTsHelpers: () => emitTsHelpers
|
|
21660
21675
|
});
|
|
21661
21676
|
var {file: file3, Transpiler: Transpiler3, write: write3 } = globalThis.Bun;
|
|
21662
|
-
import { copyFileSync as copyFileSync2, existsSync as
|
|
21677
|
+
import { copyFileSync as copyFileSync2, existsSync as existsSync32, readdirSync as readdirSync6 } from "fs";
|
|
21663
21678
|
import { mkdir as mkdir10, rename as rename3, writeFile as writeFile10 } from "fs/promises";
|
|
21664
|
-
import { dirname as dirname22, join as
|
|
21665
|
-
var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 1, HASH_LENGTH = 24, transpiler4, cacheDir = () =>
|
|
21679
|
+
import { dirname as dirname22, join as join44 } from "path";
|
|
21680
|
+
var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 1, HASH_LENGTH = 24, transpiler4, cacheDir = () => join44(process.cwd(), ".absolutejs", "compile-cache", CACHE_DIR_NAME2), cacheKey2 = (sourcePath, sourceCode) => {
|
|
21666
21681
|
const frameworkVersion = frameworkVersionForCache();
|
|
21667
21682
|
if (!frameworkVersion || !vueCompileCacheEnabled())
|
|
21668
21683
|
return null;
|
|
@@ -21695,13 +21710,13 @@ var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 1, HASH_LENGTH = 24
|
|
|
21695
21710
|
}, publishCacheEntry = async (directory, fileName, pathHash, content) => {
|
|
21696
21711
|
try {
|
|
21697
21712
|
await mkdir10(directory, { recursive: true });
|
|
21698
|
-
const target =
|
|
21713
|
+
const target = join44(directory, fileName);
|
|
21699
21714
|
const temporary = `${target}.${process.pid}.tmp`;
|
|
21700
21715
|
await writeFile10(temporary, content);
|
|
21701
21716
|
await rename3(temporary, target);
|
|
21702
21717
|
const superseded = entriesForPath(directory, pathHash).filter((name) => name !== fileName);
|
|
21703
21718
|
existingEntries?.set(pathHash, [fileName]);
|
|
21704
|
-
await Promise.all(superseded.map((name) => Bun.file(
|
|
21719
|
+
await Promise.all(superseded.map((name) => Bun.file(join44(directory, name)).delete().catch(() => {
|
|
21705
21720
|
return;
|
|
21706
21721
|
})));
|
|
21707
21722
|
} catch {}
|
|
@@ -21730,8 +21745,8 @@ var CACHE_DIR_NAME2 = "vue-helpers", CACHE_FORMAT_VERSION2 = 1, HASH_LENGTH = 24
|
|
|
21730
21745
|
const key = cacheKey2(sourcePath, sourceCode);
|
|
21731
21746
|
const directory = cacheDir();
|
|
21732
21747
|
const fileName = key ? `${key.path}-${key.content}.js` : null;
|
|
21733
|
-
const cachedPath = fileName ?
|
|
21734
|
-
if (cachedPath &&
|
|
21748
|
+
const cachedPath = fileName ? join44(directory, fileName) : null;
|
|
21749
|
+
if (cachedPath && existsSync32(cachedPath)) {
|
|
21735
21750
|
await copyBoth(clientOutputPath, serverOutputPath, cachedPath);
|
|
21736
21751
|
return;
|
|
21737
21752
|
}
|
|
@@ -21754,7 +21769,7 @@ var init_emitTsHelpers = __esm(() => {
|
|
|
21754
21769
|
});
|
|
21755
21770
|
|
|
21756
21771
|
// src/build/inlineCssImports.ts
|
|
21757
|
-
import { readFileSync as
|
|
21772
|
+
import { readFileSync as readFileSync31, realpathSync as realpathSync2 } from "fs";
|
|
21758
21773
|
import { dirname as dirname23, resolve as resolve35 } from "path";
|
|
21759
21774
|
var inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
|
|
21760
21775
|
const resolved = realpathSync2(cssFilePath);
|
|
@@ -21766,7 +21781,7 @@ var inlineCssImports = (cssContent, cssFilePath, visited = new Set) => {
|
|
|
21766
21781
|
const importedPath = resolve35(dirname23(cssFilePath), relPath);
|
|
21767
21782
|
if (!isFile(importedPath))
|
|
21768
21783
|
return match;
|
|
21769
|
-
const importedContent =
|
|
21784
|
+
const importedContent = readFileSync31(importedPath, "utf-8");
|
|
21770
21785
|
return inlineCssImports(importedContent, importedPath, visited);
|
|
21771
21786
|
});
|
|
21772
21787
|
};
|
|
@@ -21775,7 +21790,7 @@ var init_inlineCssImports = __esm(() => {
|
|
|
21775
21790
|
});
|
|
21776
21791
|
|
|
21777
21792
|
// src/build/compileVueSfc.ts
|
|
21778
|
-
import { existsSync as
|
|
21793
|
+
import { existsSync as existsSync33, readFileSync as readFileSync32, realpathSync as realpathSync3 } from "fs";
|
|
21779
21794
|
import { dirname as dirname24, relative as relative18, resolve as resolve36 } from "path";
|
|
21780
21795
|
var {Transpiler: Transpiler4 } = globalThis.Bun;
|
|
21781
21796
|
var transpiler5, toJs = (filePath, sourceDir) => {
|
|
@@ -21791,10 +21806,10 @@ var transpiler5, toJs = (filePath, sourceDir) => {
|
|
|
21791
21806
|
}
|
|
21792
21807
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
21793
21808
|
const directTs = resolve36(sourceDir, `${filePath}.ts`);
|
|
21794
|
-
if (
|
|
21809
|
+
if (existsSync33(directTs))
|
|
21795
21810
|
return `${filePath}.js`;
|
|
21796
21811
|
const indexedTs = resolve36(sourceDir, filePath, "index.ts");
|
|
21797
|
-
if (
|
|
21812
|
+
if (existsSync33(indexedTs))
|
|
21798
21813
|
return `${filePath}/index.js`;
|
|
21799
21814
|
}
|
|
21800
21815
|
return `${filePath}.js`;
|
|
@@ -21865,7 +21880,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
21865
21880
|
readFile: (file) => {
|
|
21866
21881
|
if (!isFile(file))
|
|
21867
21882
|
return;
|
|
21868
|
-
const content =
|
|
21883
|
+
const content = readFileSync32(file, "utf-8");
|
|
21869
21884
|
typeDepHashes[file] = hashContent(content);
|
|
21870
21885
|
return content;
|
|
21871
21886
|
}
|
|
@@ -21876,9 +21891,9 @@ const ${localName} = (source) => ${importedName}(
|
|
|
21876
21891
|
}) : { bindings: {}, content: "export default {};", map: undefined };
|
|
21877
21892
|
const typeDependencies = "deps" in compiledScript ? compiledScript.deps ?? [] : [];
|
|
21878
21893
|
for (const dep of typeDependencies) {
|
|
21879
|
-
if (dep in typeDepHashes || !
|
|
21894
|
+
if (dep in typeDepHashes || !existsSync33(dep))
|
|
21880
21895
|
continue;
|
|
21881
|
-
typeDepHashes[dep] = hashContent(
|
|
21896
|
+
typeDepHashes[dep] = hashContent(readFileSync32(dep, "utf-8"));
|
|
21882
21897
|
}
|
|
21883
21898
|
const strippedScript = stripExports2(compiledScript.content);
|
|
21884
21899
|
const sourceDir = dirname24(sourceFilePath);
|
|
@@ -22034,9 +22049,9 @@ var init_workerJobs = __esm(() => {
|
|
|
22034
22049
|
});
|
|
22035
22050
|
|
|
22036
22051
|
// src/build/workerPool.ts
|
|
22037
|
-
import { existsSync as
|
|
22052
|
+
import { existsSync as existsSync34, readFileSync as readFileSync33 } from "fs";
|
|
22038
22053
|
import { availableParallelism, freemem } from "os";
|
|
22039
|
-
import { dirname as dirname25, join as
|
|
22054
|
+
import { dirname as dirname25, join as join45 } from "path";
|
|
22040
22055
|
import { pathToFileURL as pathToFileURL3 } from "url";
|
|
22041
22056
|
var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_MEMORY_BUDGET_BYTES, DEFAULT_IDLE_TIMEOUT_MS = 2000, DEFAULT_MIN_BATCH = 4, PACKAGE_WALK_DEPTH = 6, PERCENT = 100, OWN_PACKAGE_NAME = "@absolutejs/absolute", parseWorkerOverride = (raw) => {
|
|
22042
22057
|
if (raw === undefined || raw.trim() === "")
|
|
@@ -22053,11 +22068,11 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
|
|
|
22053
22068
|
const byMemory = Math.floor(freemem() / WORKER_MEMORY_BUDGET_BYTES);
|
|
22054
22069
|
return Math.max(MIN_WORKERS, Math.min(byCpu, byMemory));
|
|
22055
22070
|
}, isOwnPackageRoot = (dir) => {
|
|
22056
|
-
const packageFile =
|
|
22057
|
-
if (!
|
|
22071
|
+
const packageFile = join45(dir, "package.json");
|
|
22072
|
+
if (!existsSync34(packageFile))
|
|
22058
22073
|
return false;
|
|
22059
22074
|
try {
|
|
22060
|
-
const pkg = JSON.parse(
|
|
22075
|
+
const pkg = JSON.parse(readFileSync33(packageFile, "utf-8"));
|
|
22061
22076
|
return typeof pkg === "object" && pkg !== null && "name" in pkg && pkg.name === OWN_PACKAGE_NAME;
|
|
22062
22077
|
} catch {
|
|
22063
22078
|
return false;
|
|
@@ -22077,11 +22092,11 @@ var MIN_WORKERS = 2, MAX_DEFAULT_WORKERS = 8, MAX_OVERRIDE_WORKERS = 64, WORKER_
|
|
|
22077
22092
|
const root = findOwnPackageRoot(fromDir);
|
|
22078
22093
|
if (!root)
|
|
22079
22094
|
return null;
|
|
22080
|
-
const distEntry =
|
|
22081
|
-
const sourceEntry =
|
|
22082
|
-
const runningFromDist = fromDir.startsWith(
|
|
22095
|
+
const distEntry = join45(root, "dist", "build", "buildWorker.js");
|
|
22096
|
+
const sourceEntry = join45(root, "src", "build", "buildWorker.ts");
|
|
22097
|
+
const runningFromDist = fromDir.startsWith(join45(root, "dist"));
|
|
22083
22098
|
const ordered = runningFromDist ? [distEntry, sourceEntry] : [sourceEntry, distEntry];
|
|
22084
|
-
return ordered.find((candidate) =>
|
|
22099
|
+
return ordered.find((candidate) => existsSync34(candidate)) ?? null;
|
|
22085
22100
|
}, formatPercent = (ratio) => `${Math.round(ratio * PERCENT)}%`, createBuildWorkerPool = (options = {}) => {
|
|
22086
22101
|
const size = options.size ?? resolveBuildWorkerCount();
|
|
22087
22102
|
const entry = options.entry === undefined ? resolveBuildWorkerEntry() : options.entry;
|
|
@@ -22359,13 +22374,13 @@ var init_workerPool = __esm(() => {
|
|
|
22359
22374
|
});
|
|
22360
22375
|
|
|
22361
22376
|
// src/build/compileVue.ts
|
|
22362
|
-
import { existsSync as
|
|
22377
|
+
import { existsSync as existsSync35 } from "fs";
|
|
22363
22378
|
import { mkdir as mkdir11 } from "fs/promises";
|
|
22364
22379
|
import {
|
|
22365
22380
|
basename as basename14,
|
|
22366
22381
|
dirname as dirname26,
|
|
22367
22382
|
isAbsolute as isAbsolute8,
|
|
22368
|
-
join as
|
|
22383
|
+
join as join46,
|
|
22369
22384
|
relative as relative19,
|
|
22370
22385
|
resolve as resolve37
|
|
22371
22386
|
} from "path";
|
|
@@ -22373,11 +22388,11 @@ var {file: file4, write: write4 } = globalThis.Bun;
|
|
|
22373
22388
|
var resolveDevClientDir3 = () => {
|
|
22374
22389
|
const projectRoot = process.cwd();
|
|
22375
22390
|
const fromSource = resolve37(import.meta.dir, "../dev/client");
|
|
22376
|
-
if (
|
|
22391
|
+
if (existsSync35(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
22377
22392
|
return fromSource;
|
|
22378
22393
|
}
|
|
22379
22394
|
const fromNodeModules = resolve37(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
22380
|
-
if (
|
|
22395
|
+
if (existsSync35(fromNodeModules))
|
|
22381
22396
|
return fromNodeModules;
|
|
22382
22397
|
return resolve37(import.meta.dir, "./dev/client");
|
|
22383
22398
|
}, devClientDir3, hmrClientPath4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, detectVueChangeType = (filePath, descriptor) => {
|
|
@@ -22422,10 +22437,10 @@ var resolveDevClientDir3 = () => {
|
|
|
22422
22437
|
if (helper.endsWith(".ts"))
|
|
22423
22438
|
return resolve37(sourceDir, helper);
|
|
22424
22439
|
const direct = resolve37(sourceDir, `${helper}.ts`);
|
|
22425
|
-
if (
|
|
22440
|
+
if (existsSync35(direct))
|
|
22426
22441
|
return direct;
|
|
22427
22442
|
const indexed = resolve37(sourceDir, helper, "index.ts");
|
|
22428
|
-
if (
|
|
22443
|
+
if (existsSync35(indexed))
|
|
22429
22444
|
return indexed;
|
|
22430
22445
|
return direct;
|
|
22431
22446
|
}, HELPER_JOB_MIN_BATCH = 24, runHelperEmit = async (files) => {
|
|
@@ -22492,7 +22507,7 @@ var resolveDevClientDir3 = () => {
|
|
|
22492
22507
|
]);
|
|
22493
22508
|
}, materialiseVueCompileCacheEntry = async (entry, cacheKey, isEntryPoint, outputDirs, fileBaseName) => {
|
|
22494
22509
|
const { result } = entry;
|
|
22495
|
-
const cssOutputFile = isEntryPoint && result.cssCodes.length > 0 ?
|
|
22510
|
+
const cssOutputFile = isEntryPoint && result.cssCodes.length > 0 ? join46(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`) : null;
|
|
22496
22511
|
trackWrite(writeVueOutputs({
|
|
22497
22512
|
clientCode: entry.clientCode,
|
|
22498
22513
|
clientPath: result.clientPath,
|
|
@@ -22555,7 +22570,7 @@ var resolveDevClientDir3 = () => {
|
|
|
22555
22570
|
const contentHash = Bun.hash(sourceContent).toString(BASE_36_RADIX);
|
|
22556
22571
|
const prevHash = vueSourceHashCache.get(sourceFilePath);
|
|
22557
22572
|
const persistent = persistentBuildCache.get(sourceFilePath);
|
|
22558
|
-
if (prevHash === contentHash && persistent &&
|
|
22573
|
+
if (prevHash === contentHash && persistent && existsSync35(persistent.clientPath) && existsSync35(persistent.serverPath)) {
|
|
22559
22574
|
cacheMap.set(sourceFilePath, persistent);
|
|
22560
22575
|
return persistent;
|
|
22561
22576
|
}
|
|
@@ -22640,7 +22655,7 @@ var resolveDevClientDir3 = () => {
|
|
|
22640
22655
|
...localCss,
|
|
22641
22656
|
...childBuildResults.flatMap((result) => result.cssCodes)
|
|
22642
22657
|
]);
|
|
22643
|
-
const cssOutputFile = isEntryPoint && allCss.length ?
|
|
22658
|
+
const cssOutputFile = isEntryPoint && allCss.length ? join46(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`) : null;
|
|
22644
22659
|
const cssOutputPaths = cssOutputFile ? [cssOutputFile] : [];
|
|
22645
22660
|
trackWrite(writeVueOutputs({
|
|
22646
22661
|
clientCode: clientOutput,
|
|
@@ -22684,10 +22699,10 @@ var resolveDevClientDir3 = () => {
|
|
|
22684
22699
|
const compilerLoadMs = performance.now() - compilerLoadStartedAt;
|
|
22685
22700
|
vueCompileProfile.stageCompilerMs = compilerLoadMs;
|
|
22686
22701
|
const generatedDir = getFrameworkGeneratedDir("vue");
|
|
22687
|
-
const clientOutputDir =
|
|
22688
|
-
const indexOutputDir =
|
|
22689
|
-
const serverOutputDir =
|
|
22690
|
-
const cssOutputDir =
|
|
22702
|
+
const clientOutputDir = join46(generatedDir, "client");
|
|
22703
|
+
const indexOutputDir = join46(generatedDir, "indexes");
|
|
22704
|
+
const serverOutputDir = join46(generatedDir, "server");
|
|
22705
|
+
const cssOutputDir = join46(generatedDir, "compiled");
|
|
22691
22706
|
await Promise.all([
|
|
22692
22707
|
mkdir11(clientOutputDir, { recursive: true }),
|
|
22693
22708
|
mkdir11(indexOutputDir, { recursive: true }),
|
|
@@ -22715,7 +22730,7 @@ var resolveDevClientDir3 = () => {
|
|
|
22715
22730
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
22716
22731
|
for (const { importPath } of routes) {
|
|
22717
22732
|
const childPath = resolve37(dirname26(entryPath), importPath);
|
|
22718
|
-
if (expanded.has(childPath) || !
|
|
22733
|
+
if (expanded.has(childPath) || !existsSync35(childPath)) {
|
|
22719
22734
|
continue;
|
|
22720
22735
|
}
|
|
22721
22736
|
expanded.add(childPath);
|
|
@@ -22747,7 +22762,7 @@ var resolveDevClientDir3 = () => {
|
|
|
22747
22762
|
};
|
|
22748
22763
|
}
|
|
22749
22764
|
const entryBaseName = basename14(entryPath, ".vue");
|
|
22750
|
-
const indexOutputFile =
|
|
22765
|
+
const indexOutputFile = join46(indexOutputDir, `${entryBaseName}.js`);
|
|
22751
22766
|
const clientOutputFile = result.clientPath;
|
|
22752
22767
|
await mkdir11(dirname26(indexOutputFile), { recursive: true });
|
|
22753
22768
|
const vueHmrImports = isDev ? [
|
|
@@ -22922,7 +22937,7 @@ var resolveDevClientDir3 = () => {
|
|
|
22922
22937
|
}));
|
|
22923
22938
|
vueCompileProfile.stagePagesMs = performance.now() - stageStartedAt;
|
|
22924
22939
|
stageStartedAt = performance.now();
|
|
22925
|
-
const helperDependencies = (tsPath, sourceCode) => extractImports(sourceCode).filter((dep) => dep.startsWith(".") && !isStylePath(dep) && !dep.endsWith(".vue")).map((dep) => resolveHelperTsPath(dirname26(tsPath), dep)).filter((resolved) =>
|
|
22940
|
+
const helperDependencies = (tsPath, sourceCode) => extractImports(sourceCode).filter((dep) => dep.startsWith(".") && !isStylePath(dep) && !dep.endsWith(".vue")).map((dep) => resolveHelperTsPath(dirname26(tsPath), dep)).filter((resolved) => existsSync35(resolved) && !allTsHelperPaths.has(resolved));
|
|
22926
22941
|
const readHelperWave = (paths) => Promise.all(paths.map((tsPath) => file4(tsPath).text().then((sourceCode) => helperDependencies(tsPath, sourceCode)).catch(() => [])));
|
|
22927
22942
|
const expandHelpers = async (frontier) => {
|
|
22928
22943
|
if (frontier.length === 0)
|
|
@@ -22984,7 +22999,7 @@ var init_compileVue = __esm(() => {
|
|
|
22984
22999
|
init_stylePreprocessor();
|
|
22985
23000
|
init_vueCompileCache();
|
|
22986
23001
|
devClientDir3 = resolveDevClientDir3();
|
|
22987
|
-
hmrClientPath4 =
|
|
23002
|
+
hmrClientPath4 = join46(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
22988
23003
|
scriptCache = new Map;
|
|
22989
23004
|
scriptSetupCache = new Map;
|
|
22990
23005
|
templateCache = new Map;
|
|
@@ -23492,8 +23507,8 @@ __export(exports_compileAngular, {
|
|
|
23492
23507
|
compileAngularFileJIT: () => compileAngularFileJIT,
|
|
23493
23508
|
invalidateAngularJitCache: () => invalidateAngularJitCache
|
|
23494
23509
|
});
|
|
23495
|
-
import { existsSync as
|
|
23496
|
-
import { join as
|
|
23510
|
+
import { existsSync as existsSync36, readFileSync as readFileSync34, promises as fs5 } from "fs";
|
|
23511
|
+
import { join as join47, basename as basename15, sep as sep6, dirname as dirname27, resolve as resolve38, relative as relative20 } from "path";
|
|
23497
23512
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
23498
23513
|
import ts18 from "typescript";
|
|
23499
23514
|
var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
|
|
@@ -23544,12 +23559,12 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23544
23559
|
`${candidate}.tsx`,
|
|
23545
23560
|
`${candidate}.js`,
|
|
23546
23561
|
`${candidate}.jsx`,
|
|
23547
|
-
|
|
23548
|
-
|
|
23549
|
-
|
|
23550
|
-
|
|
23562
|
+
join47(candidate, "index.ts"),
|
|
23563
|
+
join47(candidate, "index.tsx"),
|
|
23564
|
+
join47(candidate, "index.js"),
|
|
23565
|
+
join47(candidate, "index.jsx")
|
|
23551
23566
|
];
|
|
23552
|
-
return candidates.find((file) =>
|
|
23567
|
+
return candidates.find((file) => existsSync36(file));
|
|
23553
23568
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
23554
23569
|
const baseDir = resolve38(rootDir);
|
|
23555
23570
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
@@ -23630,11 +23645,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23630
23645
|
}, resolveDevClientDir4 = () => {
|
|
23631
23646
|
const projectRoot = process.cwd();
|
|
23632
23647
|
const fromSource = resolve38(import.meta.dir, "../dev/client");
|
|
23633
|
-
if (
|
|
23648
|
+
if (existsSync36(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
23634
23649
|
return fromSource;
|
|
23635
23650
|
}
|
|
23636
23651
|
const fromNodeModules = resolve38(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
23637
|
-
if (
|
|
23652
|
+
if (existsSync36(fromNodeModules))
|
|
23638
23653
|
return fromNodeModules;
|
|
23639
23654
|
return resolve38(import.meta.dir, "./dev/client");
|
|
23640
23655
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
@@ -23680,11 +23695,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23680
23695
|
return `${path}${query}`;
|
|
23681
23696
|
const importerDir = dirname27(importerOutputPath);
|
|
23682
23697
|
const fileCandidate = resolve38(importerDir, `${path}.js`);
|
|
23683
|
-
if (outputFiles?.has(fileCandidate) ||
|
|
23698
|
+
if (outputFiles?.has(fileCandidate) || existsSync36(fileCandidate)) {
|
|
23684
23699
|
return `${path}.js${query}`;
|
|
23685
23700
|
}
|
|
23686
23701
|
const indexCandidate = resolve38(importerDir, path, "index.js");
|
|
23687
|
-
if (outputFiles?.has(indexCandidate) ||
|
|
23702
|
+
if (outputFiles?.has(indexCandidate) || existsSync36(indexCandidate)) {
|
|
23688
23703
|
return `${path}/index.js${query}`;
|
|
23689
23704
|
}
|
|
23690
23705
|
return `${path}.js${query}`;
|
|
@@ -23717,12 +23732,12 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23717
23732
|
`${basePath}.tsx`,
|
|
23718
23733
|
`${basePath}.mts`,
|
|
23719
23734
|
`${basePath}.cts`,
|
|
23720
|
-
|
|
23721
|
-
|
|
23722
|
-
|
|
23723
|
-
|
|
23735
|
+
join47(basePath, "index.ts"),
|
|
23736
|
+
join47(basePath, "index.tsx"),
|
|
23737
|
+
join47(basePath, "index.mts"),
|
|
23738
|
+
join47(basePath, "index.cts")
|
|
23724
23739
|
];
|
|
23725
|
-
return candidates.map((candidate) => resolve38(candidate)).find((candidate) =>
|
|
23740
|
+
return candidates.map((candidate) => resolve38(candidate)).find((candidate) => existsSync36(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
23726
23741
|
}, readFileForAotTransform = async (fileName, readFile) => {
|
|
23727
23742
|
const hostSource = readFile?.(fileName);
|
|
23728
23743
|
if (typeof hostSource === "string")
|
|
@@ -23746,15 +23761,15 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23746
23761
|
const paths = [];
|
|
23747
23762
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
23748
23763
|
if (templateUrlMatch?.[1])
|
|
23749
|
-
paths.push(
|
|
23764
|
+
paths.push(join47(fileDir, templateUrlMatch[1]));
|
|
23750
23765
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
23751
23766
|
if (styleUrlMatch?.[1])
|
|
23752
|
-
paths.push(
|
|
23767
|
+
paths.push(join47(fileDir, styleUrlMatch[1]));
|
|
23753
23768
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
23754
23769
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
23755
23770
|
if (urlMatches) {
|
|
23756
23771
|
for (const urlMatch of urlMatches) {
|
|
23757
|
-
paths.push(
|
|
23772
|
+
paths.push(join47(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
23758
23773
|
}
|
|
23759
23774
|
}
|
|
23760
23775
|
return paths.map((path) => resolve38(path));
|
|
@@ -23788,7 +23803,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23788
23803
|
safeStableStringify(stylePreprocessors ?? null)
|
|
23789
23804
|
].join("\x00");
|
|
23790
23805
|
const cacheKey = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
23791
|
-
return
|
|
23806
|
+
return join47(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey}.json`);
|
|
23792
23807
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile, stylePreprocessors) => {
|
|
23793
23808
|
const transformedSources = new Map;
|
|
23794
23809
|
const visited = new Set;
|
|
@@ -23803,7 +23818,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23803
23818
|
if (visited.has(resolvedPath))
|
|
23804
23819
|
return;
|
|
23805
23820
|
visited.add(resolvedPath);
|
|
23806
|
-
if (!
|
|
23821
|
+
if (!existsSync36(resolvedPath) || resolvedPath.endsWith(".d.ts"))
|
|
23807
23822
|
return;
|
|
23808
23823
|
stats.filesVisited += 1;
|
|
23809
23824
|
const source = await readFileForAotTransform(resolvedPath, readFile);
|
|
@@ -23834,10 +23849,10 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23834
23849
|
return { stats, transformedSources };
|
|
23835
23850
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
23836
23851
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
23837
|
-
const outputPath = resolve38(
|
|
23852
|
+
const outputPath = resolve38(join47(outDir, relative20(process.cwd(), resolve38(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
23838
23853
|
return [
|
|
23839
23854
|
outputPath,
|
|
23840
|
-
buildIslandMetadataExports(
|
|
23855
|
+
buildIslandMetadataExports(readFileSync34(inputPath, "utf-8"))
|
|
23841
23856
|
];
|
|
23842
23857
|
})), { entries: inputPaths.length });
|
|
23843
23858
|
await traceAngularPhase("aot/preload-compiler", () => import("@angular/compiler"));
|
|
@@ -23881,7 +23896,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23881
23896
|
const originalGetSourceFile = host.getSourceFile;
|
|
23882
23897
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
23883
23898
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
23884
|
-
const resolvedPath =
|
|
23899
|
+
const resolvedPath = join47(tsLibDir, fileName);
|
|
23885
23900
|
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
23886
23901
|
}
|
|
23887
23902
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
@@ -23936,7 +23951,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23936
23951
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
23937
23952
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
23938
23953
|
content,
|
|
23939
|
-
target:
|
|
23954
|
+
target: join47(outDir, fileName)
|
|
23940
23955
|
}));
|
|
23941
23956
|
const outputFiles = new Set(rawEntries.map(({ target }) => resolve38(target)));
|
|
23942
23957
|
return rawEntries.map(({ content, target }) => {
|
|
@@ -23977,7 +23992,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
23977
23992
|
return null;
|
|
23978
23993
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
23979
23994
|
const sourceEntry = resolve38(import.meta.dir, "../angular/components/index.ts");
|
|
23980
|
-
if (
|
|
23995
|
+
if (existsSync36(sourceEntry)) {
|
|
23981
23996
|
return sourceEntry.replace(/\\/g, "/");
|
|
23982
23997
|
}
|
|
23983
23998
|
return "@absolutejs/absolute/angular/components";
|
|
@@ -24105,7 +24120,7 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
|
|
|
24105
24120
|
${fields}
|
|
24106
24121
|
`);
|
|
24107
24122
|
}, readAndEscapeFile = async (filePath, stylePreprocessors) => {
|
|
24108
|
-
if (!
|
|
24123
|
+
if (!existsSync36(filePath)) {
|
|
24109
24124
|
throw new Error(`Unable to inline Angular style resource: file not found at ${filePath}`);
|
|
24110
24125
|
}
|
|
24111
24126
|
const content = await compileStyleFileIfNeeded(filePath, stylePreprocessors);
|
|
@@ -24113,8 +24128,8 @@ ${fields}
|
|
|
24113
24128
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
24114
24129
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
24115
24130
|
if (templateUrlMatch?.[1]) {
|
|
24116
|
-
const templatePath =
|
|
24117
|
-
if (!
|
|
24131
|
+
const templatePath = join47(fileDir, templateUrlMatch[1]);
|
|
24132
|
+
if (!existsSync36(templatePath)) {
|
|
24118
24133
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
24119
24134
|
}
|
|
24120
24135
|
const templateRaw = await fs5.readFile(templatePath, "utf-8");
|
|
@@ -24144,11 +24159,11 @@ ${fields}
|
|
|
24144
24159
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
24145
24160
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
24146
24161
|
if (templateUrlMatch?.[1]) {
|
|
24147
|
-
const templatePath =
|
|
24148
|
-
if (!
|
|
24162
|
+
const templatePath = join47(fileDir, templateUrlMatch[1]);
|
|
24163
|
+
if (!existsSync36(templatePath)) {
|
|
24149
24164
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
24150
24165
|
}
|
|
24151
|
-
const templateRaw =
|
|
24166
|
+
const templateRaw = readFileSync34(templatePath, "utf-8");
|
|
24152
24167
|
const lowered = lowerAngularDeferSyntax(templateRaw);
|
|
24153
24168
|
const escaped = escapeTemplateContent(lowered.template);
|
|
24154
24169
|
const replacedSource = source.slice(0, templateUrlMatch.index) + `template: \`${escaped}\`` + source.slice(templateUrlMatch.index + templateUrlMatch[0].length);
|
|
@@ -24181,7 +24196,7 @@ ${fields}
|
|
|
24181
24196
|
return source;
|
|
24182
24197
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
24183
24198
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
24184
|
-
return readAndEscapeFile(
|
|
24199
|
+
return readAndEscapeFile(join47(fileDir, styleUrl), stylePreprocessors);
|
|
24185
24200
|
});
|
|
24186
24201
|
const results = await Promise.all(stylePromises);
|
|
24187
24202
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -24192,7 +24207,7 @@ ${fields}
|
|
|
24192
24207
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
24193
24208
|
if (!styleUrlMatch?.[1])
|
|
24194
24209
|
return source;
|
|
24195
|
-
const escaped = await readAndEscapeFile(
|
|
24210
|
+
const escaped = await readAndEscapeFile(join47(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
24196
24211
|
if (!escaped)
|
|
24197
24212
|
return source;
|
|
24198
24213
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -24288,12 +24303,12 @@ ${fields}
|
|
|
24288
24303
|
`${candidate}.js`,
|
|
24289
24304
|
`${candidate}.jsx`,
|
|
24290
24305
|
`${candidate}.json`,
|
|
24291
|
-
|
|
24292
|
-
|
|
24293
|
-
|
|
24294
|
-
|
|
24306
|
+
join47(candidate, "index.ts"),
|
|
24307
|
+
join47(candidate, "index.tsx"),
|
|
24308
|
+
join47(candidate, "index.js"),
|
|
24309
|
+
join47(candidate, "index.jsx")
|
|
24295
24310
|
];
|
|
24296
|
-
return candidates.find((file) =>
|
|
24311
|
+
return candidates.find((file) => existsSync36(file));
|
|
24297
24312
|
};
|
|
24298
24313
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
24299
24314
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
@@ -24318,10 +24333,10 @@ ${fields}
|
|
|
24318
24333
|
const inputDir = dirname27(sourcePath);
|
|
24319
24334
|
const fileBase = basename15(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
24320
24335
|
if (inputDir === outDir || inputDir.startsWith(`${outDir}${sep6}`)) {
|
|
24321
|
-
return
|
|
24336
|
+
return join47(inputDir, fileBase);
|
|
24322
24337
|
}
|
|
24323
24338
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
24324
|
-
return
|
|
24339
|
+
return join47(outDir, relativeDir, fileBase);
|
|
24325
24340
|
};
|
|
24326
24341
|
const withCacheBuster = (specifier) => {
|
|
24327
24342
|
if (!cacheBuster)
|
|
@@ -24368,11 +24383,11 @@ ${fields}
|
|
|
24368
24383
|
if (visited.has(resolved))
|
|
24369
24384
|
return;
|
|
24370
24385
|
visited.add(resolved);
|
|
24371
|
-
if (resolved.endsWith(".json") &&
|
|
24386
|
+
if (resolved.endsWith(".json") && existsSync36(resolved)) {
|
|
24372
24387
|
const inputDir = dirname27(resolved);
|
|
24373
24388
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
24374
|
-
const targetDir =
|
|
24375
|
-
const targetPath =
|
|
24389
|
+
const targetDir = join47(outDir, relativeDir);
|
|
24390
|
+
const targetPath = join47(targetDir, basename15(resolved));
|
|
24376
24391
|
await fs5.mkdir(targetDir, { recursive: true });
|
|
24377
24392
|
await fs5.copyFile(resolved, targetPath);
|
|
24378
24393
|
allOutputs.push(targetPath);
|
|
@@ -24381,7 +24396,7 @@ ${fields}
|
|
|
24381
24396
|
let actualPath = resolved;
|
|
24382
24397
|
if (!actualPath.endsWith(".ts"))
|
|
24383
24398
|
actualPath += ".ts";
|
|
24384
|
-
if (!
|
|
24399
|
+
if (!existsSync36(actualPath))
|
|
24385
24400
|
return;
|
|
24386
24401
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
24387
24402
|
const inlined = await inlineResources(sourceCode, dirname27(actualPath), stylePreprocessors);
|
|
@@ -24419,7 +24434,7 @@ ${fields}
|
|
|
24419
24434
|
const isEntry = resolve38(actualPath) === resolve38(entryPath);
|
|
24420
24435
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
24421
24436
|
const cacheKey = actualPath;
|
|
24422
|
-
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey) !== contentHash || !
|
|
24437
|
+
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey) !== contentHash || !existsSync36(targetPath);
|
|
24423
24438
|
if (shouldWriteFile) {
|
|
24424
24439
|
const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
|
|
24425
24440
|
const preservedInjection = await readPreservedInjection(targetPath);
|
|
@@ -24432,7 +24447,7 @@ ${fields}
|
|
|
24432
24447
|
};
|
|
24433
24448
|
await transpileFile(inputPath);
|
|
24434
24449
|
const entryOutputPath = toOutputPath(entryPath);
|
|
24435
|
-
if (
|
|
24450
|
+
if (existsSync36(entryOutputPath)) {
|
|
24436
24451
|
const entryOutput = await fs5.readFile(entryOutputPath, "utf-8");
|
|
24437
24452
|
const withoutLegacyFlag = entryOutput.replace(/\nexport const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;\n?/g, `
|
|
24438
24453
|
`);
|
|
@@ -24451,23 +24466,23 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24451
24466
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
24452
24467
|
}
|
|
24453
24468
|
const compiledRoot = compiledParent;
|
|
24454
|
-
const indexesDir =
|
|
24469
|
+
const indexesDir = join47(compiledParent, "indexes");
|
|
24455
24470
|
await traceAngularPhase("setup/create-indexes-dir", () => fs5.mkdir(indexesDir, { recursive: true }));
|
|
24456
24471
|
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve38(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
24457
24472
|
if (!hmr) {
|
|
24458
24473
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
24459
24474
|
const cwd = process.cwd();
|
|
24460
24475
|
const angularSrcDir = resolve38(outRoot);
|
|
24461
|
-
if (!
|
|
24476
|
+
if (!existsSync36(angularSrcDir))
|
|
24462
24477
|
return;
|
|
24463
24478
|
const jsonGlob = new Glob6("**/*.json");
|
|
24464
24479
|
for (const rel of jsonGlob.scanSync({
|
|
24465
24480
|
absolute: false,
|
|
24466
24481
|
cwd: angularSrcDir
|
|
24467
24482
|
})) {
|
|
24468
|
-
const sourcePath =
|
|
24483
|
+
const sourcePath = join47(angularSrcDir, rel);
|
|
24469
24484
|
const cwdRel = relative20(cwd, sourcePath);
|
|
24470
|
-
const targetPath =
|
|
24485
|
+
const targetPath = join47(compiledRoot, cwdRel);
|
|
24471
24486
|
await fs5.mkdir(dirname27(targetPath), { recursive: true });
|
|
24472
24487
|
await fs5.copyFile(sourcePath, targetPath);
|
|
24473
24488
|
}
|
|
@@ -24484,24 +24499,24 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24484
24499
|
const fileBase = basename15(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
24485
24500
|
const jsName = `${fileBase}.js`;
|
|
24486
24501
|
const compiledFallbackPaths = [
|
|
24487
|
-
|
|
24488
|
-
|
|
24489
|
-
|
|
24502
|
+
join47(compiledRoot, relativeEntry),
|
|
24503
|
+
join47(compiledRoot, "pages", jsName),
|
|
24504
|
+
join47(compiledRoot, jsName)
|
|
24490
24505
|
].map((file) => resolve38(file));
|
|
24491
24506
|
const resolveRawServerFile = (candidatePaths) => {
|
|
24492
24507
|
const normalizedCandidates = [
|
|
24493
24508
|
...candidatePaths.map((file) => resolve38(file)),
|
|
24494
24509
|
...compiledFallbackPaths
|
|
24495
24510
|
];
|
|
24496
|
-
let candidate = normalizedCandidates.find((file) =>
|
|
24511
|
+
let candidate = normalizedCandidates.find((file) => existsSync36(file) && file.endsWith(`${sep6}${relativeEntry}`));
|
|
24497
24512
|
if (!candidate) {
|
|
24498
|
-
candidate = normalizedCandidates.find((file) =>
|
|
24513
|
+
candidate = normalizedCandidates.find((file) => existsSync36(file) && file.endsWith(`${sep6}pages${sep6}${jsName}`));
|
|
24499
24514
|
}
|
|
24500
24515
|
if (!candidate) {
|
|
24501
|
-
candidate = normalizedCandidates.find((file) =>
|
|
24516
|
+
candidate = normalizedCandidates.find((file) => existsSync36(file) && file.endsWith(`${sep6}${jsName}`));
|
|
24502
24517
|
}
|
|
24503
24518
|
if (!candidate) {
|
|
24504
|
-
candidate = normalizedCandidates.find((file) =>
|
|
24519
|
+
candidate = normalizedCandidates.find((file) => existsSync36(file));
|
|
24505
24520
|
}
|
|
24506
24521
|
return candidate;
|
|
24507
24522
|
};
|
|
@@ -24509,11 +24524,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24509
24524
|
if (!rawServerFile) {
|
|
24510
24525
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-fallback", () => resolveRawServerFile([]), { entry: resolvedEntry });
|
|
24511
24526
|
}
|
|
24512
|
-
if (rawServerFile && !
|
|
24527
|
+
if (rawServerFile && !existsSync36(rawServerFile)) {
|
|
24513
24528
|
outputs = hmr ? await compileEntry() : aotOutputs;
|
|
24514
24529
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-retry", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
|
|
24515
24530
|
}
|
|
24516
|
-
if (!rawServerFile || !
|
|
24531
|
+
if (!rawServerFile || !existsSync36(rawServerFile)) {
|
|
24517
24532
|
throw new Error(`Compiled output not found for ${entry}. Looking for: ${jsName}. Available: ${[
|
|
24518
24533
|
...outputs,
|
|
24519
24534
|
...compiledFallbackPaths
|
|
@@ -24537,7 +24552,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24537
24552
|
let providersSourceContent = "";
|
|
24538
24553
|
if (providersInjection.appProvidersSource) {
|
|
24539
24554
|
try {
|
|
24540
|
-
providersSourceContent =
|
|
24555
|
+
providersSourceContent = readFileSync34(providersInjection.appProvidersSource, "utf-8");
|
|
24541
24556
|
} catch {}
|
|
24542
24557
|
}
|
|
24543
24558
|
return JSON.stringify({
|
|
@@ -24548,8 +24563,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24548
24563
|
})() : "no-providers";
|
|
24549
24564
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
24550
24565
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
24551
|
-
const clientFile =
|
|
24552
|
-
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash &&
|
|
24566
|
+
const clientFile = join47(indexesDir, jsName);
|
|
24567
|
+
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync36(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
24553
24568
|
return {
|
|
24554
24569
|
clientPath: clientFile,
|
|
24555
24570
|
indexUnchanged: true,
|
|
@@ -24583,7 +24598,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
24583
24598
|
const angularDirAbs = resolve38(outRoot);
|
|
24584
24599
|
const appSourceAbs = resolve38(providersInjection.appProvidersSource);
|
|
24585
24600
|
const rel = relative20(angularDirAbs, appSourceAbs).replace(/\\/g, "/");
|
|
24586
|
-
return
|
|
24601
|
+
return join47(compiledParent, rel).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
24587
24602
|
})();
|
|
24588
24603
|
const appProvidersSpec = (() => {
|
|
24589
24604
|
const rel = relative20(dirname27(rawServerFile), compiledAppProvidersPath).replace(/\\/g, "/");
|
|
@@ -24844,7 +24859,7 @@ var init_compileAngular = __esm(() => {
|
|
|
24844
24859
|
init_stylePreprocessor();
|
|
24845
24860
|
init_generatedDir();
|
|
24846
24861
|
devClientDir4 = resolveDevClientDir4();
|
|
24847
|
-
hmrClientPath5 =
|
|
24862
|
+
hmrClientPath5 = join47(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
24848
24863
|
jitContentCache = new Map;
|
|
24849
24864
|
wrapperOutputCache = new Map;
|
|
24850
24865
|
PROVIDERS_INJECTION_BLOCK_RE = /\n\/\* __ABS_PROVIDERS_INJECTION_START \*\/[\s\S]*?\/\* __ABS_PROVIDERS_INJECTION_END \*\/\n?/;
|
|
@@ -25285,9 +25300,9 @@ var require_node = __commonJS(function(exports, module) {
|
|
|
25285
25300
|
});
|
|
25286
25301
|
|
|
25287
25302
|
// src/build/compileEmber.ts
|
|
25288
|
-
import { existsSync as
|
|
25303
|
+
import { existsSync as existsSync37 } from "fs";
|
|
25289
25304
|
import { mkdir as mkdir12, rm as rm7 } from "fs/promises";
|
|
25290
|
-
import { basename as basename16, dirname as dirname28, extname as extname13, join as
|
|
25305
|
+
import { basename as basename16, dirname as dirname28, extname as extname13, join as join48, resolve as resolve39 } from "path";
|
|
25291
25306
|
var {build: bunBuild2, Transpiler: Transpiler5, write: write5, file: file5 } = globalThis.Bun;
|
|
25292
25307
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
25293
25308
|
if (cachedPreprocessor)
|
|
@@ -25387,7 +25402,7 @@ export const importSync = (specifier) => {
|
|
|
25387
25402
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
25388
25403
|
for (const ext of extensionsToTry) {
|
|
25389
25404
|
const candidate = candidateBase + ext;
|
|
25390
|
-
if (
|
|
25405
|
+
if (existsSync37(candidate))
|
|
25391
25406
|
return { path: candidate };
|
|
25392
25407
|
}
|
|
25393
25408
|
return;
|
|
@@ -25406,8 +25421,8 @@ export const importSync = (specifier) => {
|
|
|
25406
25421
|
build.onResolve({ filter: /^@(?:ember|glimmer|simple-dom)\// }, (args) => {
|
|
25407
25422
|
if (standalonePackages.has(args.path))
|
|
25408
25423
|
return;
|
|
25409
|
-
const internal =
|
|
25410
|
-
if (
|
|
25424
|
+
const internal = join48(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
25425
|
+
if (existsSync37(internal))
|
|
25411
25426
|
return { path: internal };
|
|
25412
25427
|
return;
|
|
25413
25428
|
});
|
|
@@ -25454,16 +25469,16 @@ export default PageComponent;
|
|
|
25454
25469
|
}
|
|
25455
25470
|
const transpiled = transpiler6.transformSync(preprocessed);
|
|
25456
25471
|
const baseName = basename16(resolvedEntry).replace(/\.(gjs|gts|ts|js)$/, "");
|
|
25457
|
-
const tmpDir =
|
|
25458
|
-
const serverDir =
|
|
25459
|
-
const clientDir =
|
|
25472
|
+
const tmpDir = join48(compiledRoot, "_tmp");
|
|
25473
|
+
const serverDir = join48(compiledRoot, "server");
|
|
25474
|
+
const clientDir = join48(compiledRoot, "client");
|
|
25460
25475
|
await Promise.all([
|
|
25461
25476
|
mkdir12(tmpDir, { recursive: true }),
|
|
25462
25477
|
mkdir12(serverDir, { recursive: true }),
|
|
25463
25478
|
mkdir12(clientDir, { recursive: true })
|
|
25464
25479
|
]);
|
|
25465
|
-
const tmpPagePath = resolve39(
|
|
25466
|
-
const tmpHarnessPath = resolve39(
|
|
25480
|
+
const tmpPagePath = resolve39(join48(tmpDir, `${baseName}.module.js`));
|
|
25481
|
+
const tmpHarnessPath = resolve39(join48(tmpDir, `${baseName}.harness.js`));
|
|
25467
25482
|
await Promise.all([
|
|
25468
25483
|
write5(tmpPagePath, transpiled),
|
|
25469
25484
|
write5(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -25471,7 +25486,7 @@ export default PageComponent;
|
|
|
25471
25486
|
const stagedSourceMap = new Map([
|
|
25472
25487
|
[tmpPagePath, resolvedEntry]
|
|
25473
25488
|
]);
|
|
25474
|
-
const serverPath =
|
|
25489
|
+
const serverPath = join48(serverDir, `${baseName}.js`);
|
|
25475
25490
|
const buildResult = await bunBuild2({
|
|
25476
25491
|
entrypoints: [tmpHarnessPath],
|
|
25477
25492
|
format: "esm",
|
|
@@ -25486,7 +25501,7 @@ export default PageComponent;
|
|
|
25486
25501
|
console.warn(`\u26A0\uFE0F Ember server build for ${baseName} had errors:`, buildResult.logs);
|
|
25487
25502
|
}
|
|
25488
25503
|
await rm7(tmpDir, { force: true, recursive: true });
|
|
25489
|
-
const clientPath =
|
|
25504
|
+
const clientPath = join48(clientDir, `${baseName}.js`);
|
|
25490
25505
|
await write5(clientPath, transpiled);
|
|
25491
25506
|
return { clientPath, serverPath };
|
|
25492
25507
|
}, compileEmber = async (entries, emberDir, cwd = process.cwd(), _hmr = false) => {
|
|
@@ -25527,8 +25542,8 @@ var importFromProject = (specifier, projectRoot = process.cwd()) => {
|
|
|
25527
25542
|
};
|
|
25528
25543
|
|
|
25529
25544
|
// src/build/buildReactVendor.ts
|
|
25530
|
-
import { existsSync as
|
|
25531
|
-
import { join as
|
|
25545
|
+
import { existsSync as existsSync38, mkdirSync as mkdirSync8 } from "fs";
|
|
25546
|
+
import { join as join49, resolve as resolve40 } from "path";
|
|
25532
25547
|
import { rm as rm8 } from "fs/promises";
|
|
25533
25548
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
25534
25549
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
@@ -25541,7 +25556,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
25541
25556
|
resolve40(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
25542
25557
|
];
|
|
25543
25558
|
for (const candidate of candidates) {
|
|
25544
|
-
if (
|
|
25559
|
+
if (existsSync38(candidate)) {
|
|
25545
25560
|
return candidate.replace(/\\/g, "/");
|
|
25546
25561
|
}
|
|
25547
25562
|
}
|
|
@@ -25578,14 +25593,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
25578
25593
|
`)}
|
|
25579
25594
|
`;
|
|
25580
25595
|
}, buildReactVendor = async (buildDir, { production = false } = {}) => {
|
|
25581
|
-
const vendorDir =
|
|
25596
|
+
const vendorDir = join49(buildDir, "react", "vendor");
|
|
25582
25597
|
mkdirSync8(vendorDir, { recursive: true });
|
|
25583
|
-
const tmpDir =
|
|
25598
|
+
const tmpDir = join49(buildDir, "_vendor_tmp");
|
|
25584
25599
|
mkdirSync8(tmpDir, { recursive: true });
|
|
25585
25600
|
const specifiers = reactSpecifiers;
|
|
25586
25601
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
25587
25602
|
const safeName = toSafeFileName(specifier);
|
|
25588
|
-
const entryPath =
|
|
25603
|
+
const entryPath = join49(tmpDir, `${safeName}.ts`);
|
|
25589
25604
|
const source = await generateEntrySource(specifier);
|
|
25590
25605
|
await Bun.write(entryPath, source);
|
|
25591
25606
|
return entryPath;
|
|
@@ -25645,7 +25660,7 @@ var init_vendorEntrySource = __esm(() => {
|
|
|
25645
25660
|
|
|
25646
25661
|
// src/build/buildAngularVendor.ts
|
|
25647
25662
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
25648
|
-
import { join as
|
|
25663
|
+
import { join as join50 } from "path";
|
|
25649
25664
|
import { rm as rm9 } from "fs/promises";
|
|
25650
25665
|
var {build: bunBuild4, Glob: Glob7 } = globalThis.Bun;
|
|
25651
25666
|
var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => jitMode ? [...REQUIRED_ANGULAR_SPECIFIERS_BASE, "@angular/compiler"] : REQUIRED_ANGULAR_SPECIFIERS_BASE, SERVER_ONLY_ANGULAR_SPECIFIERS, BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES, isBuildOnlyAngularSpecifier = (spec) => BUILD_ONLY_ANGULAR_SPECIFIER_PREFIXES.some((prefix) => spec === prefix || spec.startsWith(`${prefix}/`)), SCAN_SKIP_DIRS, isResolvable = (specifier) => {
|
|
@@ -25742,14 +25757,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
25742
25757
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
25743
25758
|
return Array.from(angular).filter(isResolvable);
|
|
25744
25759
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
25745
|
-
const vendorDir =
|
|
25760
|
+
const vendorDir = join50(buildDir, "angular", "vendor");
|
|
25746
25761
|
mkdirSync9(vendorDir, { recursive: true });
|
|
25747
|
-
const tmpDir =
|
|
25762
|
+
const tmpDir = join50(buildDir, "_angular_vendor_tmp");
|
|
25748
25763
|
mkdirSync9(tmpDir, { recursive: true });
|
|
25749
25764
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
25750
25765
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
25751
25766
|
const safeName = toSafeFileName2(specifier);
|
|
25752
|
-
const entryPath =
|
|
25767
|
+
const entryPath = join50(tmpDir, `${safeName}.ts`);
|
|
25753
25768
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
25754
25769
|
return entryPath;
|
|
25755
25770
|
}));
|
|
@@ -25780,9 +25795,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
25780
25795
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
25781
25796
|
return computeAngularVendorPaths(specifiers);
|
|
25782
25797
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
25783
|
-
const vendorDir =
|
|
25798
|
+
const vendorDir = join50(buildDir, "angular", "vendor", "server");
|
|
25784
25799
|
mkdirSync9(vendorDir, { recursive: true });
|
|
25785
|
-
const tmpDir =
|
|
25800
|
+
const tmpDir = join50(buildDir, "_angular_server_vendor_tmp");
|
|
25786
25801
|
mkdirSync9(tmpDir, { recursive: true });
|
|
25787
25802
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
25788
25803
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -25793,7 +25808,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
25793
25808
|
const specifiers = Array.from(allSpecs);
|
|
25794
25809
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
25795
25810
|
const safeName = toSafeFileName2(specifier);
|
|
25796
|
-
const entryPath =
|
|
25811
|
+
const entryPath = join50(tmpDir, `${safeName}.ts`);
|
|
25797
25812
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
25798
25813
|
return entryPath;
|
|
25799
25814
|
}));
|
|
@@ -25815,9 +25830,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
25815
25830
|
return specifiers;
|
|
25816
25831
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
25817
25832
|
const paths = {};
|
|
25818
|
-
const vendorDir =
|
|
25833
|
+
const vendorDir = join50(buildDir, "angular", "vendor", "server");
|
|
25819
25834
|
for (const specifier of specifiers) {
|
|
25820
|
-
paths[specifier] =
|
|
25835
|
+
paths[specifier] = join50(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
25821
25836
|
}
|
|
25822
25837
|
return paths;
|
|
25823
25838
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -25868,17 +25883,17 @@ var init_buildAngularVendor = __esm(() => {
|
|
|
25868
25883
|
|
|
25869
25884
|
// src/build/buildVueVendor.ts
|
|
25870
25885
|
import { mkdirSync as mkdirSync10 } from "fs";
|
|
25871
|
-
import { join as
|
|
25886
|
+
import { join as join51 } from "path";
|
|
25872
25887
|
import { rm as rm10 } from "fs/promises";
|
|
25873
25888
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
25874
25889
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
25875
|
-
const vendorDir =
|
|
25890
|
+
const vendorDir = join51(buildDir, "vue", "vendor");
|
|
25876
25891
|
mkdirSync10(vendorDir, { recursive: true });
|
|
25877
|
-
const tmpDir =
|
|
25892
|
+
const tmpDir = join51(buildDir, "_vue_vendor_tmp");
|
|
25878
25893
|
mkdirSync10(tmpDir, { recursive: true });
|
|
25879
25894
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
25880
25895
|
const safeName = toSafeFileName3(specifier);
|
|
25881
|
-
const entryPath =
|
|
25896
|
+
const entryPath = join51(tmpDir, `${safeName}.ts`);
|
|
25882
25897
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
25883
25898
|
`);
|
|
25884
25899
|
return entryPath;
|
|
@@ -25906,7 +25921,7 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
25906
25921
|
const { readFileSync, writeFileSync, readdirSync } = await import("fs");
|
|
25907
25922
|
const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
|
|
25908
25923
|
for (const file of files) {
|
|
25909
|
-
const filePath =
|
|
25924
|
+
const filePath = join51(vendorDir, file);
|
|
25910
25925
|
const content = readFileSync(filePath, "utf-8");
|
|
25911
25926
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
25912
25927
|
continue;
|
|
@@ -25928,7 +25943,7 @@ var init_buildVueVendor = __esm(() => {
|
|
|
25928
25943
|
|
|
25929
25944
|
// src/build/buildSvelteVendor.ts
|
|
25930
25945
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
25931
|
-
import { join as
|
|
25946
|
+
import { join as join52 } from "path";
|
|
25932
25947
|
import { rm as rm11 } from "fs/promises";
|
|
25933
25948
|
var {build: bunBuild6 } = globalThis.Bun;
|
|
25934
25949
|
var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
@@ -25942,13 +25957,13 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
|
25942
25957
|
const specifiers = resolveVendorSpecifiers();
|
|
25943
25958
|
if (specifiers.length === 0)
|
|
25944
25959
|
return;
|
|
25945
|
-
const vendorDir =
|
|
25960
|
+
const vendorDir = join52(buildDir, "svelte", "vendor");
|
|
25946
25961
|
mkdirSync11(vendorDir, { recursive: true });
|
|
25947
|
-
const tmpDir =
|
|
25962
|
+
const tmpDir = join52(buildDir, "_svelte_vendor_tmp");
|
|
25948
25963
|
mkdirSync11(tmpDir, { recursive: true });
|
|
25949
25964
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
25950
25965
|
const safeName = toSafeFileName4(specifier);
|
|
25951
|
-
const entryPath =
|
|
25966
|
+
const entryPath = join52(tmpDir, `${safeName}.ts`);
|
|
25952
25967
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
25953
25968
|
`);
|
|
25954
25969
|
return entryPath;
|
|
@@ -25990,16 +26005,16 @@ var init_buildSvelteVendor = __esm(() => {
|
|
|
25990
26005
|
import {
|
|
25991
26006
|
copyFileSync as copyFileSync3,
|
|
25992
26007
|
cpSync,
|
|
25993
|
-
existsSync as
|
|
26008
|
+
existsSync as existsSync39,
|
|
25994
26009
|
mkdirSync as mkdirSync12,
|
|
25995
26010
|
readdirSync as readdirSync7,
|
|
25996
|
-
readFileSync as
|
|
26011
|
+
readFileSync as readFileSync35,
|
|
25997
26012
|
renameSync,
|
|
25998
26013
|
rmSync as rmSync2,
|
|
25999
26014
|
statSync as statSync5,
|
|
26000
|
-
writeFileSync as
|
|
26015
|
+
writeFileSync as writeFileSync11
|
|
26001
26016
|
} from "fs";
|
|
26002
|
-
import { basename as basename17, dirname as dirname29, extname as extname14, join as
|
|
26017
|
+
import { basename as basename17, dirname as dirname29, extname as extname14, join as join53, relative as relative21, resolve as resolve41 } from "path";
|
|
26003
26018
|
import { cwd, env as env3, exit } from "process";
|
|
26004
26019
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
26005
26020
|
var isBuildTraceEnabled = () => {
|
|
@@ -26082,7 +26097,7 @@ var isBuildTraceEnabled = () => {
|
|
|
26082
26097
|
}, REACT_VENDOR_SPECIFIERS, findBareReactImports = (path, importRegex) => {
|
|
26083
26098
|
let content;
|
|
26084
26099
|
try {
|
|
26085
|
-
content =
|
|
26100
|
+
content = readFileSync35(path, "utf-8");
|
|
26086
26101
|
} catch {
|
|
26087
26102
|
return [];
|
|
26088
26103
|
}
|
|
@@ -26133,8 +26148,8 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26133
26148
|
mkdirSync12(htmxDestDir, { recursive: true });
|
|
26134
26149
|
const glob = new Glob8("htmx*.min.js");
|
|
26135
26150
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
26136
|
-
const src =
|
|
26137
|
-
const dest =
|
|
26151
|
+
const src = join53(htmxDir, relPath);
|
|
26152
|
+
const dest = join53(htmxDestDir, "htmx.min.js");
|
|
26138
26153
|
copyFileSync3(src, dest);
|
|
26139
26154
|
return;
|
|
26140
26155
|
}
|
|
@@ -26171,7 +26186,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26171
26186
|
workerPaths.add(absPath);
|
|
26172
26187
|
} catch {}
|
|
26173
26188
|
}, extractWorkerSpecifiers = (file, patterns) => {
|
|
26174
|
-
const content =
|
|
26189
|
+
const content = readFileSync35(file, "utf-8");
|
|
26175
26190
|
const specifiers = [];
|
|
26176
26191
|
for (const pattern of patterns) {
|
|
26177
26192
|
pattern.lastIndex = 0;
|
|
@@ -26218,7 +26233,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26218
26233
|
const out = [];
|
|
26219
26234
|
const directories = [];
|
|
26220
26235
|
for (const entry of entries) {
|
|
26221
|
-
const full =
|
|
26236
|
+
const full = join53(dir, entry.name);
|
|
26222
26237
|
if (entry.isDirectory()) {
|
|
26223
26238
|
directories.push(full);
|
|
26224
26239
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -26244,7 +26259,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26244
26259
|
vuePagesPath
|
|
26245
26260
|
}) => {
|
|
26246
26261
|
const { readdirSync: readDir } = await import("fs");
|
|
26247
|
-
const devIndexDir =
|
|
26262
|
+
const devIndexDir = join53(buildPath, "_src_indexes");
|
|
26248
26263
|
mkdirSync12(devIndexDir, { recursive: true });
|
|
26249
26264
|
if (reactIndexesPath && reactPagesPath) {
|
|
26250
26265
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -26256,41 +26271,41 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26256
26271
|
copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
|
|
26257
26272
|
}
|
|
26258
26273
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
26259
|
-
if (!
|
|
26274
|
+
if (!existsSync39(reactIndexesPath)) {
|
|
26260
26275
|
return;
|
|
26261
26276
|
}
|
|
26262
26277
|
const indexFiles = readDir(reactIndexesPath).filter((file) => file.endsWith(".tsx"));
|
|
26263
26278
|
const pagesRel = relative21(process.cwd(), resolve41(reactPagesPath)).replace(/\\/g, "/");
|
|
26264
26279
|
for (const file of indexFiles) {
|
|
26265
|
-
let content =
|
|
26280
|
+
let content = readFileSync35(join53(reactIndexesPath, file), "utf-8");
|
|
26266
26281
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
26267
|
-
|
|
26282
|
+
writeFileSync11(join53(devIndexDir, file), content);
|
|
26268
26283
|
}
|
|
26269
26284
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
26270
|
-
const svelteIndexDir =
|
|
26285
|
+
const svelteIndexDir = join53(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
26271
26286
|
const sveltePageEntries = svelteEntries.filter((file) => resolve41(file).startsWith(resolve41(sveltePagesPath)));
|
|
26272
26287
|
for (const entry of sveltePageEntries) {
|
|
26273
26288
|
const name = basename17(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
26274
|
-
const indexFile =
|
|
26275
|
-
if (!
|
|
26289
|
+
const indexFile = join53(svelteIndexDir, "pages", `${name}.js`);
|
|
26290
|
+
if (!existsSync39(indexFile))
|
|
26276
26291
|
continue;
|
|
26277
|
-
let content =
|
|
26292
|
+
let content = readFileSync35(indexFile, "utf-8");
|
|
26278
26293
|
const srcRel = relative21(process.cwd(), resolve41(entry)).replace(/\\/g, "/");
|
|
26279
26294
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
26280
|
-
|
|
26295
|
+
writeFileSync11(join53(devIndexDir, `${name}.svelte.js`), content);
|
|
26281
26296
|
}
|
|
26282
26297
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
26283
|
-
const vueIndexDir =
|
|
26298
|
+
const vueIndexDir = join53(getFrameworkGeneratedDir("vue"), "indexes");
|
|
26284
26299
|
const vuePageEntries = vueEntries.filter((file) => resolve41(file).startsWith(resolve41(vuePagesPath)));
|
|
26285
26300
|
for (const entry of vuePageEntries) {
|
|
26286
26301
|
const name = basename17(entry, ".vue");
|
|
26287
|
-
const indexFile =
|
|
26288
|
-
if (!
|
|
26302
|
+
const indexFile = join53(vueIndexDir, `${name}.js`);
|
|
26303
|
+
if (!existsSync39(indexFile))
|
|
26289
26304
|
continue;
|
|
26290
|
-
let content =
|
|
26305
|
+
let content = readFileSync35(indexFile, "utf-8");
|
|
26291
26306
|
const srcRel = relative21(process.cwd(), resolve41(entry)).replace(/\\/g, "/");
|
|
26292
26307
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
26293
|
-
|
|
26308
|
+
writeFileSync11(join53(devIndexDir, `${name}.vue.js`), content);
|
|
26294
26309
|
}
|
|
26295
26310
|
}, buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
26296
26311
|
const urlFileMap = new Map;
|
|
@@ -26453,10 +26468,10 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26453
26468
|
restoreTracePhase();
|
|
26454
26469
|
return;
|
|
26455
26470
|
}
|
|
26456
|
-
const traceDir =
|
|
26471
|
+
const traceDir = join53(buildPath, ".absolute-trace");
|
|
26457
26472
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
26458
26473
|
mkdirSync12(traceDir, { recursive: true });
|
|
26459
|
-
|
|
26474
|
+
writeFileSync11(join53(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
26460
26475
|
events: traceEvents,
|
|
26461
26476
|
frameworks: traceFrameworkNames,
|
|
26462
26477
|
generatedAt: new Date().toISOString(),
|
|
@@ -26487,16 +26502,16 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26487
26502
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
26488
26503
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
26489
26504
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
26490
|
-
const reactIndexesPath = reactDir &&
|
|
26491
|
-
const reactPagesPath = reactDir &&
|
|
26492
|
-
const htmlPagesPath = htmlDir &&
|
|
26493
|
-
const htmlScriptsPath = htmlDir &&
|
|
26494
|
-
const sveltePagesPath = svelteDir &&
|
|
26495
|
-
const vuePagesPath = vueDir &&
|
|
26496
|
-
const htmxPagesPath = htmxDir &&
|
|
26497
|
-
const htmxScriptsPath = htmxDir &&
|
|
26498
|
-
const angularPagesPath = angularDir &&
|
|
26499
|
-
const emberPagesPath = emberDir &&
|
|
26505
|
+
const reactIndexesPath = reactDir && join53(getFrameworkGeneratedDir("react"), "indexes");
|
|
26506
|
+
const reactPagesPath = reactDir && join53(reactDir, "pages");
|
|
26507
|
+
const htmlPagesPath = htmlDir && join53(htmlDir, "pages");
|
|
26508
|
+
const htmlScriptsPath = htmlDir && join53(htmlDir, "scripts");
|
|
26509
|
+
const sveltePagesPath = svelteDir && join53(svelteDir, "pages");
|
|
26510
|
+
const vuePagesPath = vueDir && join53(vueDir, "pages");
|
|
26511
|
+
const htmxPagesPath = htmxDir && join53(htmxDir, "pages");
|
|
26512
|
+
const htmxScriptsPath = htmxDir && join53(htmxDir, "scripts");
|
|
26513
|
+
const angularPagesPath = angularDir && join53(angularDir, "pages");
|
|
26514
|
+
const emberPagesPath = emberDir && join53(emberDir, "pages");
|
|
26500
26515
|
const frontends = [
|
|
26501
26516
|
reactDir,
|
|
26502
26517
|
htmlDir,
|
|
@@ -26557,8 +26572,8 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26557
26572
|
const [firstEntry] = serverDirMap;
|
|
26558
26573
|
if (!firstEntry)
|
|
26559
26574
|
throw new Error("Expected at least one server directory entry");
|
|
26560
|
-
serverRoot =
|
|
26561
|
-
serverOutDir =
|
|
26575
|
+
serverRoot = join53(firstEntry.dir, firstEntry.subdir);
|
|
26576
|
+
serverOutDir = join53(buildPath, basename17(firstEntry.dir));
|
|
26562
26577
|
} else if (serverDirMap.length > 1) {
|
|
26563
26578
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
26564
26579
|
serverOutDir = buildPath;
|
|
@@ -26593,7 +26608,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26593
26608
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
26594
26609
|
}
|
|
26595
26610
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f) => f.includes("/assets/")))) {
|
|
26596
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
26611
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join53(buildPath, "assets"), {
|
|
26597
26612
|
force: true,
|
|
26598
26613
|
recursive: true
|
|
26599
26614
|
}));
|
|
@@ -26707,11 +26722,11 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26707
26722
|
}
|
|
26708
26723
|
}
|
|
26709
26724
|
if (htmlDefaults.error || htmlDefaults.notFound || htmlDefaults.loading || Object.keys(htmlPages).length > 0) {
|
|
26710
|
-
const htmlConventionsOutDir =
|
|
26725
|
+
const htmlConventionsOutDir = join53(buildPath, "conventions", "html");
|
|
26711
26726
|
mkdirSync12(htmlConventionsOutDir, { recursive: true });
|
|
26712
26727
|
const htmlPathRemap = new Map;
|
|
26713
26728
|
for (const sourcePath of htmlConventionSources) {
|
|
26714
|
-
const dest =
|
|
26729
|
+
const dest = join53(htmlConventionsOutDir, basename17(sourcePath));
|
|
26715
26730
|
cpSync(sourcePath, dest, { force: true });
|
|
26716
26731
|
htmlPathRemap.set(sourcePath, dest);
|
|
26717
26732
|
}
|
|
@@ -26765,7 +26780,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26765
26780
|
const mapReactIndexToPage = (entry) => {
|
|
26766
26781
|
if (reactIndexesPath && reactPagesPath && entry.startsWith(resolve41(reactIndexesPath))) {
|
|
26767
26782
|
const pageName = basename17(entry, ".tsx");
|
|
26768
|
-
return
|
|
26783
|
+
return join53(reactPagesPath, `${pageName}.tsx`);
|
|
26769
26784
|
}
|
|
26770
26785
|
return null;
|
|
26771
26786
|
};
|
|
@@ -26945,7 +26960,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26945
26960
|
const compileReactConventions = async () => {
|
|
26946
26961
|
if (reactConventionSources.length === 0)
|
|
26947
26962
|
return emptyStringArray;
|
|
26948
|
-
const destDir =
|
|
26963
|
+
const destDir = join53(buildPath, "conventions", "react");
|
|
26949
26964
|
rmSync2(destDir, { force: true, recursive: true });
|
|
26950
26965
|
mkdirSync12(destDir, { recursive: true });
|
|
26951
26966
|
const destPaths = await Promise.all(reactConventionSources.map(async (source, idx) => {
|
|
@@ -26989,7 +27004,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
26989
27004
|
angularConventionSources.length > 0 && angularDir ? tracePhase("compile/convention-angular", () => Promise.resolve().then(() => (init_compileAngular(), {})).then((mod) => compileAngular(angularConventionSources, angularDir, hmr, styleTransformConfig))) : { serverPaths: emptyStringArray }
|
|
26990
27005
|
]);
|
|
26991
27006
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
26992
|
-
const destDir =
|
|
27007
|
+
const destDir = join53(buildPath, "conventions", framework);
|
|
26993
27008
|
rmSync2(destDir, { force: true, recursive: true });
|
|
26994
27009
|
mkdirSync12(destDir, { recursive: true });
|
|
26995
27010
|
const destPaths = await Promise.all(compiledPaths.map(async (compiledPath, idx) => {
|
|
@@ -27064,7 +27079,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27064
27079
|
}
|
|
27065
27080
|
})) : {
|
|
27066
27081
|
entries: [],
|
|
27067
|
-
generatedRoot:
|
|
27082
|
+
generatedRoot: join53(buildPath, "_island_entries")
|
|
27068
27083
|
};
|
|
27069
27084
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
27070
27085
|
if (!deferPageEntries && serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && urlReferencedFiles.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -27100,7 +27115,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27100
27115
|
return {};
|
|
27101
27116
|
}
|
|
27102
27117
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
27103
|
-
const refreshEntry =
|
|
27118
|
+
const refreshEntry = join53(reactIndexesPath, "_refresh.tsx");
|
|
27104
27119
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
27105
27120
|
reactClientEntryPoints.push(refreshEntry);
|
|
27106
27121
|
}
|
|
@@ -27212,19 +27227,19 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27212
27227
|
throw: false
|
|
27213
27228
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
27214
27229
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
27215
|
-
rmSync2(
|
|
27230
|
+
rmSync2(join53(buildPath, "react", "generated", "indexes"), {
|
|
27216
27231
|
force: true,
|
|
27217
27232
|
recursive: true
|
|
27218
27233
|
});
|
|
27219
27234
|
}
|
|
27220
27235
|
if (angularDir && angularClientPaths.length > 0) {
|
|
27221
|
-
rmSync2(
|
|
27236
|
+
rmSync2(join53(buildPath, "angular", "indexes"), {
|
|
27222
27237
|
force: true,
|
|
27223
27238
|
recursive: true
|
|
27224
27239
|
});
|
|
27225
27240
|
}
|
|
27226
27241
|
if (islandClientEntryPoints.length > 0) {
|
|
27227
|
-
rmSync2(
|
|
27242
|
+
rmSync2(join53(buildPath, "islands"), {
|
|
27228
27243
|
force: true,
|
|
27229
27244
|
recursive: true
|
|
27230
27245
|
});
|
|
@@ -27339,7 +27354,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27339
27354
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
27340
27355
|
entrypoints: globalCssEntries,
|
|
27341
27356
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
27342
|
-
outdir: stylesDir ?
|
|
27357
|
+
outdir: stylesDir ? join53(buildPath, basename17(stylesDir)) : buildPath,
|
|
27343
27358
|
plugins: [stylePreprocessorPlugin],
|
|
27344
27359
|
root: stylesDir || clientRoot,
|
|
27345
27360
|
target: "browser",
|
|
@@ -27348,7 +27363,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27348
27363
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
27349
27364
|
entrypoints: vueCssPaths,
|
|
27350
27365
|
naming: `[name].[hash].[ext]`,
|
|
27351
|
-
outdir:
|
|
27366
|
+
outdir: join53(buildPath, assetsPath ? basename17(assetsPath) : "assets", "css"),
|
|
27352
27367
|
target: "browser",
|
|
27353
27368
|
throw: false
|
|
27354
27369
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -27370,20 +27385,20 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27370
27385
|
}
|
|
27371
27386
|
if (!isDev && resolveClientSourcemap(sourcemaps, isDev) === "external") {
|
|
27372
27387
|
await Promise.resolve().then(() => init_chainInlineSourcemaps());
|
|
27373
|
-
const sourcemapDir =
|
|
27388
|
+
const sourcemapDir = join53(projectRoot, "sourcemaps");
|
|
27374
27389
|
mkdirSync12(sourcemapDir, { recursive: true });
|
|
27375
27390
|
const mapFiles = readdirSync7(buildPath, {
|
|
27376
27391
|
encoding: "utf8",
|
|
27377
27392
|
recursive: true
|
|
27378
|
-
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) =>
|
|
27393
|
+
}).filter((entry) => entry.endsWith(".js.map") && !entry.includes("node_modules")).map((entry) => join53(buildPath, entry));
|
|
27379
27394
|
for (const mapPath of mapFiles) {
|
|
27380
27395
|
chainExternalSourcemap(mapPath);
|
|
27381
|
-
renameSync(mapPath,
|
|
27396
|
+
renameSync(mapPath, join53(sourcemapDir, basename17(mapPath)));
|
|
27382
27397
|
const jsPath = mapPath.slice(0, -4);
|
|
27383
27398
|
try {
|
|
27384
|
-
const javascript =
|
|
27399
|
+
const javascript = readFileSync35(jsPath, "utf-8").replace(/\n?\/\/# sourceMappingURL=[^\n]*\s*$/, `
|
|
27385
27400
|
`);
|
|
27386
|
-
|
|
27401
|
+
writeFileSync11(jsPath, javascript);
|
|
27387
27402
|
} catch {}
|
|
27388
27403
|
}
|
|
27389
27404
|
console.info(`[absolute] sourcemaps: chained + privatized ${mapFiles.length} client maps \u2192 ${relative21(projectRoot, sourcemapDir)}/`);
|
|
@@ -27443,8 +27458,8 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27443
27458
|
};
|
|
27444
27459
|
await tracePhase("postprocess/client-rewrite", rewriteClientGroups, clientRewriteStats);
|
|
27445
27460
|
if (!hmr) {
|
|
27446
|
-
const reactVendorDir =
|
|
27447
|
-
const vendorChunkPaths =
|
|
27461
|
+
const reactVendorDir = join53(buildPath, "react", "vendor");
|
|
27462
|
+
const vendorChunkPaths = existsSync39(reactVendorDir) ? [
|
|
27448
27463
|
...new Glob8("**/*.js").scanSync({
|
|
27449
27464
|
absolute: true,
|
|
27450
27465
|
cwd: reactVendorDir
|
|
@@ -27588,18 +27603,18 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27588
27603
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
27589
27604
|
if (!hmrClientBundle)
|
|
27590
27605
|
return;
|
|
27591
|
-
let html =
|
|
27606
|
+
let html = readFileSync35(filePath, "utf-8");
|
|
27592
27607
|
if (html.includes("data-hmr-client"))
|
|
27593
27608
|
return;
|
|
27594
27609
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
27595
27610
|
const bodyClose = /<\/body\s*>/i.exec(html);
|
|
27596
27611
|
html = bodyClose ? html.slice(0, bodyClose.index) + tag + html.slice(bodyClose.index) : html + tag;
|
|
27597
|
-
|
|
27612
|
+
writeFileSync11(filePath, html);
|
|
27598
27613
|
};
|
|
27599
27614
|
const processHtmlPages = async () => {
|
|
27600
27615
|
if (!(htmlDir && htmlPagesPath))
|
|
27601
27616
|
return;
|
|
27602
|
-
const outputHtmlPages = isSingle ?
|
|
27617
|
+
const outputHtmlPages = isSingle ? join53(buildPath, "pages") : join53(buildPath, basename17(htmlDir), "pages");
|
|
27603
27618
|
mkdirSync12(outputHtmlPages, { recursive: true });
|
|
27604
27619
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
27605
27620
|
force: true,
|
|
@@ -27613,8 +27628,8 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27613
27628
|
if (hmr)
|
|
27614
27629
|
injectHMRIntoHTMLFile(htmlFile, "html");
|
|
27615
27630
|
if (pwaArtifacts) {
|
|
27616
|
-
const source =
|
|
27617
|
-
|
|
27631
|
+
const source = readFileSync35(htmlFile, "utf8");
|
|
27632
|
+
writeFileSync11(htmlFile, injectPwaBootstrapHtml(source));
|
|
27618
27633
|
}
|
|
27619
27634
|
const fileName = basename17(htmlFile, ".html");
|
|
27620
27635
|
if (manifest[fileName] && manifest[fileName] !== htmlFile) {
|
|
@@ -27626,14 +27641,14 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27626
27641
|
const processHtmxPages = async () => {
|
|
27627
27642
|
if (!(htmxDir && htmxPagesPath))
|
|
27628
27643
|
return;
|
|
27629
|
-
const outputHtmxPages = isSingle ?
|
|
27644
|
+
const outputHtmxPages = isSingle ? join53(buildPath, "pages") : join53(buildPath, basename17(htmxDir), "pages");
|
|
27630
27645
|
mkdirSync12(outputHtmxPages, { recursive: true });
|
|
27631
27646
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
27632
27647
|
force: true,
|
|
27633
27648
|
recursive: true
|
|
27634
27649
|
});
|
|
27635
27650
|
if (shouldCopyHtmx) {
|
|
27636
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
27651
|
+
const htmxDestDir = isSingle ? buildPath : join53(buildPath, basename17(htmxDir));
|
|
27637
27652
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
27638
27653
|
}
|
|
27639
27654
|
await updateAssetPaths(manifest, outputHtmxPages);
|
|
@@ -27644,8 +27659,8 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27644
27659
|
if (hmr)
|
|
27645
27660
|
injectHMRIntoHTMLFile(htmxFile, "htmx");
|
|
27646
27661
|
if (pwaArtifacts) {
|
|
27647
|
-
const source =
|
|
27648
|
-
|
|
27662
|
+
const source = readFileSync35(htmxFile, "utf8");
|
|
27663
|
+
writeFileSync11(htmxFile, injectPwaBootstrapHtml(source));
|
|
27649
27664
|
}
|
|
27650
27665
|
const fileName = basename17(htmxFile, ".html");
|
|
27651
27666
|
if (manifest[fileName] && manifest[fileName] !== htmxFile) {
|
|
@@ -27722,7 +27737,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27722
27737
|
}))
|
|
27723
27738
|
];
|
|
27724
27739
|
setSpaRouteManifest(spaRouteHosts);
|
|
27725
|
-
|
|
27740
|
+
writeFileSync11(join53(buildPath, "spa-routes.json"), JSON.stringify(spaRouteHosts, null, "\t"));
|
|
27726
27741
|
if (isIncremental) {
|
|
27727
27742
|
writeBuildTrace(buildPath);
|
|
27728
27743
|
return {
|
|
@@ -27733,9 +27748,9 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27733
27748
|
tailwindChanged: tailwindResult?.cssChanged ?? false
|
|
27734
27749
|
};
|
|
27735
27750
|
}
|
|
27736
|
-
|
|
27751
|
+
writeFileSync11(join53(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
27737
27752
|
if (Object.keys(conventionsMap).length > 0) {
|
|
27738
|
-
|
|
27753
|
+
writeFileSync11(join53(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
27739
27754
|
}
|
|
27740
27755
|
writeBuildTrace(buildPath);
|
|
27741
27756
|
if (mode === "production") {
|
|
@@ -27769,7 +27784,7 @@ ${offenders.map((o) => ` \u2022 ${o}`).join(`
|
|
|
27769
27784
|
pageEntries,
|
|
27770
27785
|
tailwindChanged: tailwindResult?.cssChanged ?? false
|
|
27771
27786
|
};
|
|
27772
|
-
}, projectTsconfig = () =>
|
|
27787
|
+
}, projectTsconfig = () => existsSync39(resolve41("tsconfig.json")) ? { tsconfig: "./tsconfig.json" } : {}, build2 = async (config) => {
|
|
27773
27788
|
const projectRoot = cwd();
|
|
27774
27789
|
const buildPath = validateSafePath(config.buildDirectory ?? "build", projectRoot);
|
|
27775
27790
|
return withBuildDirectoryLock(buildPath, () => buildUnlocked(config));
|
|
@@ -27858,8 +27873,8 @@ var init_build = __esm(() => {
|
|
|
27858
27873
|
});
|
|
27859
27874
|
|
|
27860
27875
|
// src/build/buildEmberVendor.ts
|
|
27861
|
-
import { mkdirSync as mkdirSync13, existsSync as
|
|
27862
|
-
import { join as
|
|
27876
|
+
import { mkdirSync as mkdirSync13, existsSync as existsSync40 } from "fs";
|
|
27877
|
+
import { join as join54 } from "path";
|
|
27863
27878
|
import { rm as rm12 } from "fs/promises";
|
|
27864
27879
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
27865
27880
|
var toSafeFileName5 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), generateMacrosShim = () => `// Generated shim for @embroider/macros \u2014 provides minimal runtime
|
|
@@ -27911,8 +27926,8 @@ export const importSync = (specifier) => {
|
|
|
27911
27926
|
if (standaloneSpecifiers.has(specifier)) {
|
|
27912
27927
|
return { resolveTo: specifier, specifier };
|
|
27913
27928
|
}
|
|
27914
|
-
const emberInternalPath =
|
|
27915
|
-
if (!
|
|
27929
|
+
const emberInternalPath = join54(cwd, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
27930
|
+
if (!existsSync40(emberInternalPath)) {
|
|
27916
27931
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
27917
27932
|
}
|
|
27918
27933
|
return { resolveTo: emberInternalPath, specifier };
|
|
@@ -27945,24 +27960,24 @@ export const importSync = (specifier) => {
|
|
|
27945
27960
|
if (standalonePackages.has(args.path)) {
|
|
27946
27961
|
return;
|
|
27947
27962
|
}
|
|
27948
|
-
const internal =
|
|
27949
|
-
if (
|
|
27963
|
+
const internal = join54(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
27964
|
+
if (existsSync40(internal)) {
|
|
27950
27965
|
return { path: internal };
|
|
27951
27966
|
}
|
|
27952
27967
|
return;
|
|
27953
27968
|
});
|
|
27954
27969
|
}
|
|
27955
27970
|
}), buildEmberVendor = async (buildDir, cwd = process.cwd()) => {
|
|
27956
|
-
const vendorDir =
|
|
27971
|
+
const vendorDir = join54(buildDir, "ember", "vendor");
|
|
27957
27972
|
mkdirSync13(vendorDir, { recursive: true });
|
|
27958
|
-
const tmpDir =
|
|
27973
|
+
const tmpDir = join54(buildDir, "_ember_vendor_tmp");
|
|
27959
27974
|
mkdirSync13(tmpDir, { recursive: true });
|
|
27960
|
-
const macrosShimPath =
|
|
27975
|
+
const macrosShimPath = join54(tmpDir, "embroider_macros_shim.js");
|
|
27961
27976
|
await Bun.write(macrosShimPath, generateMacrosShim());
|
|
27962
27977
|
const resolutions = REQUIRED_EMBER_SPECIFIERS.map((specifier) => resolveEmberSpecifier(specifier, cwd));
|
|
27963
27978
|
const entrypoints = await Promise.all(resolutions.map(async (resolution) => {
|
|
27964
27979
|
const safeName = toSafeFileName5(resolution.specifier);
|
|
27965
|
-
const entryPath =
|
|
27980
|
+
const entryPath = join54(tmpDir, `${safeName}.js`);
|
|
27966
27981
|
const source = resolution.specifier === "@embroider/macros" ? `export * from ${JSON.stringify(macrosShimPath)};
|
|
27967
27982
|
` : generateVendorEntrySource2(resolution);
|
|
27968
27983
|
await Bun.write(entryPath, source);
|
|
@@ -28006,8 +28021,8 @@ var init_buildEmberVendor = __esm(() => {
|
|
|
28006
28021
|
});
|
|
28007
28022
|
|
|
28008
28023
|
// src/build/workspacePackages.ts
|
|
28009
|
-
import { readFileSync as
|
|
28010
|
-
import { join as
|
|
28024
|
+
import { readFileSync as readFileSync36, realpathSync as realpathSync4 } from "fs";
|
|
28025
|
+
import { join as join55, sep as sep7 } from "path";
|
|
28011
28026
|
var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, projectRoot = process.cwd()) => {
|
|
28012
28027
|
const key = `${projectRoot}\x00${specifier}`;
|
|
28013
28028
|
const known = verdicts.get(key);
|
|
@@ -28025,7 +28040,7 @@ var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, pr
|
|
|
28025
28040
|
}, workspacePackageDirs = (projectRoot = process.cwd()) => {
|
|
28026
28041
|
let manifest;
|
|
28027
28042
|
try {
|
|
28028
|
-
manifest = JSON.parse(
|
|
28043
|
+
manifest = JSON.parse(readFileSync36(join55(projectRoot, "package.json"), "utf-8"));
|
|
28029
28044
|
} catch {
|
|
28030
28045
|
return [];
|
|
28031
28046
|
}
|
|
@@ -28040,7 +28055,7 @@ var NODE_MODULES_SEGMENT, verdicts, isWorkspacePackageSpecifier = (specifier, pr
|
|
|
28040
28055
|
const dirs = new Set;
|
|
28041
28056
|
for (const name of names) {
|
|
28042
28057
|
try {
|
|
28043
|
-
const linked = realpathSync4(
|
|
28058
|
+
const linked = realpathSync4(join55(projectRoot, "node_modules", name));
|
|
28044
28059
|
if (!`${linked}${sep7}`.includes(NODE_MODULES_SEGMENT))
|
|
28045
28060
|
dirs.add(linked);
|
|
28046
28061
|
} catch {}
|
|
@@ -28156,7 +28171,7 @@ var stripStringsAndComments = (source) => {
|
|
|
28156
28171
|
};
|
|
28157
28172
|
|
|
28158
28173
|
// src/dev/dependencyGraph.ts
|
|
28159
|
-
import { existsSync as
|
|
28174
|
+
import { existsSync as existsSync41, readFileSync as readFileSync37, realpathSync as realpathSync5 } from "fs";
|
|
28160
28175
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
28161
28176
|
import { resolve as resolve42 } from "path";
|
|
28162
28177
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
@@ -28192,10 +28207,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28192
28207
|
];
|
|
28193
28208
|
for (const ext of extensions) {
|
|
28194
28209
|
const withExt = normalized + ext;
|
|
28195
|
-
if (
|
|
28210
|
+
if (existsSync41(withExt))
|
|
28196
28211
|
return withExt;
|
|
28197
28212
|
}
|
|
28198
|
-
if (
|
|
28213
|
+
if (existsSync41(normalized))
|
|
28199
28214
|
return normalized;
|
|
28200
28215
|
return null;
|
|
28201
28216
|
}, clearExistingDependents = (graph, normalizedPath) => {
|
|
@@ -28210,7 +28225,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28210
28225
|
}
|
|
28211
28226
|
}, addFileToGraph = (graph, filePath) => {
|
|
28212
28227
|
const normalizedPath = resolve42(filePath);
|
|
28213
|
-
if (!
|
|
28228
|
+
if (!existsSync41(normalizedPath))
|
|
28214
28229
|
return;
|
|
28215
28230
|
const dependencies = extractDependencies(normalizedPath);
|
|
28216
28231
|
clearExistingDependents(graph, normalizedPath);
|
|
@@ -28236,7 +28251,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28236
28251
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
28237
28252
|
const processedFiles = new Set;
|
|
28238
28253
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
28239
|
-
const resolvedDirs = directories.map((dir) => resolve42(dir)).filter((dir) =>
|
|
28254
|
+
const resolvedDirs = directories.map((dir) => resolve42(dir)).filter((dir) => existsSync41(dir));
|
|
28240
28255
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
28241
28256
|
for (const file of allFiles) {
|
|
28242
28257
|
const fullPath = resolve42(file);
|
|
@@ -28333,15 +28348,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
28333
28348
|
const lowerPath = filePath.toLowerCase();
|
|
28334
28349
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
28335
28350
|
if (loader === "html") {
|
|
28336
|
-
const content =
|
|
28351
|
+
const content = readFileSync37(filePath, "utf-8");
|
|
28337
28352
|
return extractHtmlDependencies(filePath, content);
|
|
28338
28353
|
}
|
|
28339
28354
|
if (loader === "tsx" || loader === "js") {
|
|
28340
|
-
const content =
|
|
28355
|
+
const content = readFileSync37(filePath, "utf-8");
|
|
28341
28356
|
return extractJsDependencies(filePath, content, loader);
|
|
28342
28357
|
}
|
|
28343
28358
|
if (isSvelteOrVue) {
|
|
28344
|
-
const content =
|
|
28359
|
+
const content = readFileSync37(filePath, "utf-8");
|
|
28345
28360
|
return extractSvelteVueDependencies(filePath, content);
|
|
28346
28361
|
}
|
|
28347
28362
|
return [];
|
|
@@ -28491,7 +28506,7 @@ var init_clientManager = __esm(() => {
|
|
|
28491
28506
|
});
|
|
28492
28507
|
|
|
28493
28508
|
// src/dev/pathUtils.ts
|
|
28494
|
-
import { existsSync as
|
|
28509
|
+
import { existsSync as existsSync42, readdirSync as readdirSync8, readFileSync as readFileSync38 } from "fs";
|
|
28495
28510
|
import { dirname as dirname30, resolve as resolve44 } from "path";
|
|
28496
28511
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
28497
28512
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
@@ -28591,7 +28606,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28591
28606
|
}
|
|
28592
28607
|
let source;
|
|
28593
28608
|
try {
|
|
28594
|
-
source =
|
|
28609
|
+
source = readFileSync38(full, "utf8");
|
|
28595
28610
|
} catch {
|
|
28596
28611
|
continue;
|
|
28597
28612
|
}
|
|
@@ -28665,7 +28680,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
28665
28680
|
push(cfg.stylesDir);
|
|
28666
28681
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
28667
28682
|
const abs = normalizePath2(resolve44(cwd, candidate));
|
|
28668
|
-
if (
|
|
28683
|
+
if (existsSync42(abs) && !roots.includes(abs))
|
|
28669
28684
|
roots.push(abs);
|
|
28670
28685
|
}
|
|
28671
28686
|
if (config.dev?.autoWatchDirectories !== false) {
|
|
@@ -28765,9 +28780,9 @@ var init_pathUtils = __esm(() => {
|
|
|
28765
28780
|
});
|
|
28766
28781
|
|
|
28767
28782
|
// src/dev/devPrescan.ts
|
|
28768
|
-
import { existsSync as
|
|
28783
|
+
import { existsSync as existsSync43, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
28769
28784
|
import { mkdir as mkdir13, readFile as readFile8, rename as rename4, writeFile as writeFile11 } from "fs/promises";
|
|
28770
|
-
import { join as
|
|
28785
|
+
import { join as join56 } from "path";
|
|
28771
28786
|
var PRESCAN_DIR, PAYLOAD_VERSION = 1, POLL_INTERVAL_MS = 10, DEFAULT_WAIT_MS = 2000, collectConfigVendorSourceDirs = (config) => Array.from(new Set([
|
|
28772
28787
|
config.reactDirectory,
|
|
28773
28788
|
config.svelteDirectory,
|
|
@@ -28778,7 +28793,7 @@ var PRESCAN_DIR, PAYLOAD_VERSION = 1, POLL_INTERVAL_MS = 10, DEFAULT_WAIT_MS = 2
|
|
|
28778
28793
|
].filter((dir) => Boolean(dir)))), devPrescanEnabled = () => process.env.ABSOLUTE_DEV_PRESCAN === "1", sleep = (delayMs) => new Promise((resolve) => {
|
|
28779
28794
|
setTimeout(resolve, delayMs);
|
|
28780
28795
|
}), isPayload = (value) => typeof value === "object" && value !== null && ("version" in value) && value.version === PAYLOAD_VERSION, tryReadPrescan = async (path) => {
|
|
28781
|
-
if (!
|
|
28796
|
+
if (!existsSync43(path))
|
|
28782
28797
|
return;
|
|
28783
28798
|
try {
|
|
28784
28799
|
const parsed = JSON.parse(await readFile8(path, "utf8"));
|
|
@@ -28825,7 +28840,7 @@ var init_devPrescan = __esm(() => {
|
|
|
28825
28840
|
init_configResolver();
|
|
28826
28841
|
init_dependencyGraph();
|
|
28827
28842
|
init_pathUtils();
|
|
28828
|
-
PRESCAN_DIR =
|
|
28843
|
+
PRESCAN_DIR = join56(".absolutejs", "dev-prescan");
|
|
28829
28844
|
});
|
|
28830
28845
|
|
|
28831
28846
|
// src/dev/serverEntryCopies.ts
|
|
@@ -28834,8 +28849,8 @@ var init_serverEntryCopies = () => {};
|
|
|
28834
28849
|
|
|
28835
28850
|
// src/dev/fileWatcher.ts
|
|
28836
28851
|
import { watch } from "fs";
|
|
28837
|
-
import { existsSync as
|
|
28838
|
-
import { dirname as dirname31, join as
|
|
28852
|
+
import { existsSync as existsSync44, readdirSync as readdirSync10, statSync as statSync6 } from "fs";
|
|
28853
|
+
import { dirname as dirname31, join as join57, resolve as resolve45 } from "path";
|
|
28839
28854
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
28840
28855
|
try {
|
|
28841
28856
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -28867,7 +28882,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28867
28882
|
for (const name of entries) {
|
|
28868
28883
|
if (shouldSkipFilename(name, isStylesDir))
|
|
28869
28884
|
continue;
|
|
28870
|
-
const child =
|
|
28885
|
+
const child = join57(eventDir, name).replace(/\\/g, "/");
|
|
28871
28886
|
if (shouldIgnorePath(child, state.resolvedPaths))
|
|
28872
28887
|
continue;
|
|
28873
28888
|
let st;
|
|
@@ -28890,7 +28905,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28890
28905
|
return;
|
|
28891
28906
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
28892
28907
|
if (event === "rename") {
|
|
28893
|
-
const eventDir = dirname31(
|
|
28908
|
+
const eventDir = dirname31(join57(absolutePath, filename)).replace(/\\/g, "/");
|
|
28894
28909
|
atomicRecoveryScan(eventDir);
|
|
28895
28910
|
for (const delay of [25, 100]) {
|
|
28896
28911
|
const timer = setTimeout(() => atomicRecoveryScan(eventDir), delay);
|
|
@@ -28899,16 +28914,16 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28899
28914
|
}
|
|
28900
28915
|
return;
|
|
28901
28916
|
}
|
|
28902
|
-
const fullPath =
|
|
28917
|
+
const fullPath = join57(absolutePath, filename).replace(/\\/g, "/");
|
|
28903
28918
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
28904
28919
|
return;
|
|
28905
28920
|
}
|
|
28906
|
-
if (event === "rename" && !
|
|
28921
|
+
if (event === "rename" && !existsSync44(fullPath)) {
|
|
28907
28922
|
safeRemoveFromGraph(state.dependencyGraph, fullPath);
|
|
28908
28923
|
onFileChange(fullPath);
|
|
28909
28924
|
return;
|
|
28910
28925
|
}
|
|
28911
|
-
if (
|
|
28926
|
+
if (existsSync44(fullPath)) {
|
|
28912
28927
|
onFileChange(fullPath);
|
|
28913
28928
|
safeAddToGraph(state.dependencyGraph, fullPath);
|
|
28914
28929
|
}
|
|
@@ -28918,7 +28933,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28918
28933
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
28919
28934
|
paths.forEach((path) => {
|
|
28920
28935
|
const absolutePath = resolve45(path).replace(/\\/g, "/");
|
|
28921
|
-
if (!
|
|
28936
|
+
if (!existsSync44(absolutePath)) {
|
|
28922
28937
|
return;
|
|
28923
28938
|
}
|
|
28924
28939
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -28936,7 +28951,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28936
28951
|
];
|
|
28937
28952
|
const fingerprint = (name) => {
|
|
28938
28953
|
try {
|
|
28939
|
-
const value = statSync6(
|
|
28954
|
+
const value = statSync6(join57(root, name));
|
|
28940
28955
|
return value.isFile() ? `${value.ino}:${value.size}:${value.mtimeMs}:${value.ctimeMs}` : null;
|
|
28941
28956
|
} catch {
|
|
28942
28957
|
return null;
|
|
@@ -28949,7 +28964,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28949
28964
|
if (next === previous.get(name))
|
|
28950
28965
|
continue;
|
|
28951
28966
|
previous.set(name, next);
|
|
28952
|
-
onFileChange(
|
|
28967
|
+
onFileChange(join57(root, name).replace(/\\/g, "/"));
|
|
28953
28968
|
}
|
|
28954
28969
|
};
|
|
28955
28970
|
const timers = new Map;
|
|
@@ -28987,7 +29002,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
28987
29002
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
28988
29003
|
watchPaths.forEach((path) => {
|
|
28989
29004
|
const absolutePath = resolve45(path).replace(/\\/g, "/");
|
|
28990
|
-
if (!
|
|
29005
|
+
if (!existsSync44(absolutePath)) {
|
|
28991
29006
|
return;
|
|
28992
29007
|
}
|
|
28993
29008
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -29154,10 +29169,10 @@ var init_restartScope = __esm(() => {
|
|
|
29154
29169
|
});
|
|
29155
29170
|
|
|
29156
29171
|
// src/dev/fileHashTracker.ts
|
|
29157
|
-
import { readFileSync as
|
|
29172
|
+
import { readFileSync as readFileSync39, statSync as statSync7 } from "fs";
|
|
29158
29173
|
var computeFileHash = (filePath) => {
|
|
29159
29174
|
try {
|
|
29160
|
-
const fileContent =
|
|
29175
|
+
const fileContent = readFileSync39(filePath);
|
|
29161
29176
|
return Number(Bun.hash(fileContent));
|
|
29162
29177
|
} catch {
|
|
29163
29178
|
return UNFOUND_INDEX;
|
|
@@ -29482,8 +29497,8 @@ __export(exports_resolveOwningComponents, {
|
|
|
29482
29497
|
resolveDescendantsOfParent: () => resolveDescendantsOfParent,
|
|
29483
29498
|
resolveOwningComponents: () => resolveOwningComponents
|
|
29484
29499
|
});
|
|
29485
|
-
import { readdirSync as readdirSync11, readFileSync as
|
|
29486
|
-
import { dirname as dirname33, extname as extname15, join as
|
|
29500
|
+
import { readdirSync as readdirSync11, readFileSync as readFileSync40, statSync as statSync8 } from "fs";
|
|
29501
|
+
import { dirname as dirname33, extname as extname15, join as join58, resolve as resolve50 } from "path";
|
|
29487
29502
|
import ts19 from "typescript";
|
|
29488
29503
|
var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || file.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
|
|
29489
29504
|
const out = [];
|
|
@@ -29498,7 +29513,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29498
29513
|
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
29499
29514
|
continue;
|
|
29500
29515
|
}
|
|
29501
|
-
const full =
|
|
29516
|
+
const full = join58(dir, entry.name);
|
|
29502
29517
|
if (entry.isDirectory()) {
|
|
29503
29518
|
visit(full);
|
|
29504
29519
|
} else if (entry.isFile() && isAngularSourceFile(entry.name)) {
|
|
@@ -29542,7 +29557,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29542
29557
|
}, parseDecoratedClasses = (filePath) => {
|
|
29543
29558
|
let source;
|
|
29544
29559
|
try {
|
|
29545
|
-
source =
|
|
29560
|
+
source = readFileSync40(filePath, "utf8");
|
|
29546
29561
|
} catch {
|
|
29547
29562
|
return [];
|
|
29548
29563
|
}
|
|
@@ -29632,7 +29647,7 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file) => file.endsWith(".ts") || f
|
|
|
29632
29647
|
}, indexByRoot, resolveParentClassFile = (parentName, childFilePath, angularRoot) => {
|
|
29633
29648
|
let source;
|
|
29634
29649
|
try {
|
|
29635
|
-
source =
|
|
29650
|
+
source = readFileSync40(childFilePath, "utf8");
|
|
29636
29651
|
} catch {
|
|
29637
29652
|
return null;
|
|
29638
29653
|
}
|
|
@@ -29965,8 +29980,8 @@ __export(exports_moduleServer, {
|
|
|
29965
29980
|
warmPage: () => warmPage,
|
|
29966
29981
|
warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
|
|
29967
29982
|
});
|
|
29968
|
-
import { existsSync as
|
|
29969
|
-
import { basename as basename19, dirname as dirname34, extname as extname16, join as
|
|
29983
|
+
import { existsSync as existsSync45, readFileSync as readFileSync41, realpathSync as realpathSync7, statSync as statSync9 } from "fs";
|
|
29984
|
+
import { basename as basename19, dirname as dirname34, extname as extname16, join as join59, resolve as resolve51, relative as relative22 } from "path";
|
|
29970
29985
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
29971
29986
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
29972
29987
|
const allExports = [];
|
|
@@ -29986,10 +30001,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
|
|
|
29986
30001
|
${stubs}
|
|
29987
30002
|
`;
|
|
29988
30003
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
29989
|
-
const directHit = extensions.find((ext) =>
|
|
30004
|
+
const directHit = extensions.find((ext) => existsSync45(resolve51(projectRoot, srcPath + ext)));
|
|
29990
30005
|
if (directHit)
|
|
29991
30006
|
return srcPath + directHit;
|
|
29992
|
-
const indexHit = extensions.find((ext) =>
|
|
30007
|
+
const indexHit = extensions.find((ext) => existsSync45(resolve51(projectRoot, srcPath, `index${ext}`)));
|
|
29993
30008
|
if (indexHit)
|
|
29994
30009
|
return `${srcPath}/index${indexHit}`;
|
|
29995
30010
|
return srcPath;
|
|
@@ -30055,13 +30070,13 @@ ${stubs}
|
|
|
30055
30070
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
30056
30071
|
if (!subpath) {
|
|
30057
30072
|
const pkgDir = resolve51(projectRoot, "node_modules", packageName ?? "");
|
|
30058
|
-
const pkgJsonPath =
|
|
30059
|
-
if (
|
|
30060
|
-
const pkg = JSON.parse(
|
|
30073
|
+
const pkgJsonPath = join59(pkgDir, "package.json");
|
|
30074
|
+
if (existsSync45(pkgJsonPath)) {
|
|
30075
|
+
const pkg = JSON.parse(readFileSync41(pkgJsonPath, "utf-8"));
|
|
30061
30076
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
30062
30077
|
if (esmEntry) {
|
|
30063
30078
|
const resolved = resolve51(pkgDir, esmEntry);
|
|
30064
|
-
if (
|
|
30079
|
+
if (existsSync45(resolved))
|
|
30065
30080
|
return relative22(projectRoot, resolved);
|
|
30066
30081
|
}
|
|
30067
30082
|
}
|
|
@@ -30109,7 +30124,7 @@ ${stubs}
|
|
|
30109
30124
|
const rel = relative22(projectRoot, absPath).replace(/\\/g, "/");
|
|
30110
30125
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
30111
30126
|
}
|
|
30112
|
-
if (!
|
|
30127
|
+
if (!existsSync45(absPath))
|
|
30113
30128
|
return _match;
|
|
30114
30129
|
const rel = relative22(projectRoot, absPath).replace(/\\/g, "/");
|
|
30115
30130
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
@@ -30168,7 +30183,7 @@ ${code}`;
|
|
|
30168
30183
|
reactFastRefreshWarningEmitted = true;
|
|
30169
30184
|
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.");
|
|
30170
30185
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
30171
|
-
const raw =
|
|
30186
|
+
const raw = readFileSync41(filePath, "utf-8");
|
|
30172
30187
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
30173
30188
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
30174
30189
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -30184,7 +30199,7 @@ ${transpiled}`;
|
|
|
30184
30199
|
transpiled += buildIslandMetadataExports(raw);
|
|
30185
30200
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
30186
30201
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
30187
|
-
const raw =
|
|
30202
|
+
const raw = readFileSync41(filePath, "utf-8");
|
|
30188
30203
|
const ext = extname16(filePath);
|
|
30189
30204
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
30190
30205
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -30350,7 +30365,7 @@ ${code}`;
|
|
|
30350
30365
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
30351
30366
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
30352
30367
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
30353
|
-
const raw =
|
|
30368
|
+
const raw = readFileSync41(filePath, "utf-8");
|
|
30354
30369
|
if (!svelteCompiler) {
|
|
30355
30370
|
svelteCompiler = await import("svelte/compiler");
|
|
30356
30371
|
}
|
|
@@ -30416,7 +30431,7 @@ export default __script__;`;
|
|
|
30416
30431
|
return `${cssInjection}
|
|
30417
30432
|
${code}`;
|
|
30418
30433
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
30419
|
-
const rawSource =
|
|
30434
|
+
const rawSource = readFileSync41(filePath, "utf-8");
|
|
30420
30435
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
30421
30436
|
if (!vueCompiler) {
|
|
30422
30437
|
vueCompiler = await loadVueCompiler();
|
|
@@ -30429,7 +30444,7 @@ ${code}`;
|
|
|
30429
30444
|
fs: {
|
|
30430
30445
|
fileExists: isFile,
|
|
30431
30446
|
realpath: realpathSync7,
|
|
30432
|
-
readFile: (file) => isFile(file) ?
|
|
30447
|
+
readFile: (file) => isFile(file) ? readFileSync41(file, "utf-8") : undefined
|
|
30433
30448
|
},
|
|
30434
30449
|
id: componentId,
|
|
30435
30450
|
inlineTemplate: false
|
|
@@ -30459,11 +30474,11 @@ ${code}`;
|
|
|
30459
30474
|
`);
|
|
30460
30475
|
return result;
|
|
30461
30476
|
}, resolveSvelteModulePath = (path) => {
|
|
30462
|
-
if (
|
|
30477
|
+
if (existsSync45(path))
|
|
30463
30478
|
return path;
|
|
30464
|
-
if (
|
|
30479
|
+
if (existsSync45(`${path}.ts`))
|
|
30465
30480
|
return `${path}.ts`;
|
|
30466
|
-
if (
|
|
30481
|
+
if (existsSync45(`${path}.js`))
|
|
30467
30482
|
return `${path}.js`;
|
|
30468
30483
|
return path;
|
|
30469
30484
|
}, jsResponse = (body) => {
|
|
@@ -30476,7 +30491,7 @@ ${code}`;
|
|
|
30476
30491
|
}
|
|
30477
30492
|
});
|
|
30478
30493
|
}, handleCssRequest = (filePath) => {
|
|
30479
|
-
const raw =
|
|
30494
|
+
const raw = readFileSync41(filePath, "utf-8");
|
|
30480
30495
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
30481
30496
|
return [
|
|
30482
30497
|
`const style = document.createElement('style');`,
|
|
@@ -30611,7 +30626,7 @@ export default {};
|
|
|
30611
30626
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
30612
30627
|
if (ext)
|
|
30613
30628
|
return { ext, filePath };
|
|
30614
|
-
const found = MODULE_EXTENSIONS.find((candidate) =>
|
|
30629
|
+
const found = MODULE_EXTENSIONS.find((candidate) => existsSync45(filePath + candidate));
|
|
30615
30630
|
if (!found)
|
|
30616
30631
|
return { ext, filePath };
|
|
30617
30632
|
const resolved = filePath + found;
|
|
@@ -31168,7 +31183,7 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
31168
31183
|
var init_simpleHTMXHMR = () => {};
|
|
31169
31184
|
|
|
31170
31185
|
// src/dev/backendGraph.ts
|
|
31171
|
-
import { readFileSync as
|
|
31186
|
+
import { readFileSync as readFileSync42, realpathSync as realpathSync8, statSync as statSync10 } from "fs";
|
|
31172
31187
|
import { dirname as dirname36, extname as extname17, resolve as resolve55 } from "path";
|
|
31173
31188
|
var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (path) => {
|
|
31174
31189
|
const loader = LOADERS[extname17(path)] ?? "ts";
|
|
@@ -31203,7 +31218,7 @@ var SOURCE_FILE, VENDORED, LOADERS, fileCache, transpilers, transpilerFor = (pat
|
|
|
31203
31218
|
return cached.imports;
|
|
31204
31219
|
let imports = [];
|
|
31205
31220
|
try {
|
|
31206
|
-
const source =
|
|
31221
|
+
const source = readFileSync42(path, "utf-8");
|
|
31207
31222
|
imports = transpilerFor(path).scanImports(source).map((entry) => resolveImport(entry.path, path)).filter((target) => target !== undefined);
|
|
31208
31223
|
} catch {}
|
|
31209
31224
|
fileCache.set(path, { imports, mtimeMs });
|
|
@@ -32001,8 +32016,8 @@ var init_runtime = __esm(() => {
|
|
|
32001
32016
|
});
|
|
32002
32017
|
|
|
32003
32018
|
// src/dev/hot/plugin.ts
|
|
32004
|
-
import { mkdirSync as mkdirSync14, readFileSync as
|
|
32005
|
-
import { extname as extname19, join as
|
|
32019
|
+
import { mkdirSync as mkdirSync14, readFileSync as readFileSync43, realpathSync as realpathSync9, writeFileSync as writeFileSync12 } from "fs";
|
|
32020
|
+
import { extname as extname19, join as join60, relative as relative24, resolve as resolve56, sep as sep8 } from "path";
|
|
32006
32021
|
var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
32007
32022
|
try {
|
|
32008
32023
|
return realpathSync9(path);
|
|
@@ -32042,12 +32057,12 @@ var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
|
32042
32057
|
if (status === false)
|
|
32043
32058
|
return typeof Reflect.get(value, "reason") === "string";
|
|
32044
32059
|
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"));
|
|
32045
|
-
}, cachePath = (cacheDir, key) =>
|
|
32060
|
+
}, cachePath = (cacheDir, key) => join60(cacheDir, `${key}.json`), readCached = (key) => {
|
|
32046
32061
|
const state = shared.installed;
|
|
32047
32062
|
if (!state)
|
|
32048
32063
|
return;
|
|
32049
32064
|
try {
|
|
32050
|
-
const cached = JSON.parse(
|
|
32065
|
+
const cached = JSON.parse(readFileSync43(cachePath(state.cacheDir, key), "utf-8"));
|
|
32051
32066
|
return isAnalysis(cached) ? cached : undefined;
|
|
32052
32067
|
} catch {
|
|
32053
32068
|
return;
|
|
@@ -32057,7 +32072,7 @@ var SOURCE, TEST_FILE, GENERATED, ABSOLUTE_ROOT, realPath3 = (path) => {
|
|
|
32057
32072
|
if (!state)
|
|
32058
32073
|
return;
|
|
32059
32074
|
try {
|
|
32060
|
-
|
|
32075
|
+
writeFileSync12(cachePath(state.cacheDir, key), JSON.stringify(analysis));
|
|
32061
32076
|
} catch {}
|
|
32062
32077
|
}, analyzeFresh = async (canonicalPath, source) => {
|
|
32063
32078
|
const typescriptModule = await loadTypescript();
|
|
@@ -32090,7 +32105,7 @@ var init_plugin = __esm(() => {
|
|
|
32090
32105
|
});
|
|
32091
32106
|
|
|
32092
32107
|
// src/dev/hot/reload.ts
|
|
32093
|
-
import { readFileSync as
|
|
32108
|
+
import { readFileSync as readFileSync44, realpathSync as realpathSync10 } from "fs";
|
|
32094
32109
|
import { relative as relative25 } from "path";
|
|
32095
32110
|
var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
|
|
32096
32111
|
try {
|
|
@@ -32170,7 +32185,7 @@ var MAX_PROPAGATION_STEPS = 500, realPath4 = (path) => {
|
|
|
32170
32185
|
return { status: "unmanaged" };
|
|
32171
32186
|
let source;
|
|
32172
32187
|
try {
|
|
32173
|
-
source =
|
|
32188
|
+
source = readFileSync44(path, "utf-8");
|
|
32174
32189
|
} catch (error) {
|
|
32175
32190
|
reportFailure(path, error);
|
|
32176
32191
|
return { error, status: "failed" };
|
|
@@ -32263,12 +32278,12 @@ var init_reload = __esm(() => {
|
|
|
32263
32278
|
});
|
|
32264
32279
|
|
|
32265
32280
|
// src/dev/rebuildTrigger.ts
|
|
32266
|
-
import { existsSync as
|
|
32281
|
+
import { existsSync as existsSync46, readdirSync as readdirSync12, rmSync as rmSync4, statSync as statSync11 } from "fs";
|
|
32267
32282
|
import {
|
|
32268
32283
|
basename as basename20,
|
|
32269
32284
|
dirname as dirname38,
|
|
32270
32285
|
isAbsolute as isAbsolute10,
|
|
32271
|
-
join as
|
|
32286
|
+
join as join61,
|
|
32272
32287
|
relative as relative26,
|
|
32273
32288
|
resolve as resolvePath,
|
|
32274
32289
|
sep as sep9
|
|
@@ -32377,7 +32392,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32377
32392
|
detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
|
|
32378
32393
|
}
|
|
32379
32394
|
return { ...parsed, framework: detectedFw };
|
|
32380
|
-
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) &&
|
|
32395
|
+
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync46(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
32381
32396
|
const { config } = state;
|
|
32382
32397
|
const cwd = process.cwd();
|
|
32383
32398
|
const absDeleted = resolvePath(deletedFile).replace(/\\/g, "/");
|
|
@@ -32395,8 +32410,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32395
32410
|
const relJs = `${rel.slice(0, -ext[0].length)}.js`;
|
|
32396
32411
|
const generatedDir = getFrameworkGeneratedDir(framework, cwd);
|
|
32397
32412
|
for (const candidate of [
|
|
32398
|
-
|
|
32399
|
-
`${
|
|
32413
|
+
join61(generatedDir, relJs),
|
|
32414
|
+
`${join61(generatedDir, relJs)}.map`
|
|
32400
32415
|
]) {
|
|
32401
32416
|
try {
|
|
32402
32417
|
rmSync4(candidate, { force: true });
|
|
@@ -32423,7 +32438,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32423
32438
|
if (!dependents || dependents.size === 0) {
|
|
32424
32439
|
return;
|
|
32425
32440
|
}
|
|
32426
|
-
const dependentFiles = Array.from(dependents).filter((file) =>
|
|
32441
|
+
const dependentFiles = Array.from(dependents).filter((file) => existsSync46(file));
|
|
32427
32442
|
if (dependentFiles.length === 0) {
|
|
32428
32443
|
return;
|
|
32429
32444
|
}
|
|
@@ -32439,7 +32454,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32439
32454
|
try {
|
|
32440
32455
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
|
|
32441
32456
|
affectedFiles.forEach((affectedFile) => {
|
|
32442
|
-
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath &&
|
|
32457
|
+
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync46(affectedFile)) {
|
|
32443
32458
|
validFiles.push(affectedFile);
|
|
32444
32459
|
processedFiles.add(affectedFile);
|
|
32445
32460
|
}
|
|
@@ -32464,7 +32479,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32464
32479
|
collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
|
|
32465
32480
|
}, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
|
|
32466
32481
|
filePathSet.forEach((filePathInSet) => {
|
|
32467
|
-
if (!
|
|
32482
|
+
if (!existsSync46(filePathInSet)) {
|
|
32468
32483
|
collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
|
|
32469
32484
|
return;
|
|
32470
32485
|
}
|
|
@@ -32747,7 +32762,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
32747
32762
|
return componentFile;
|
|
32748
32763
|
}
|
|
32749
32764
|
const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
|
|
32750
|
-
if (
|
|
32765
|
+
if (existsSync46(tsCounterpart)) {
|
|
32751
32766
|
return tsCounterpart;
|
|
32752
32767
|
}
|
|
32753
32768
|
if (!graph)
|
|
@@ -33320,7 +33335,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33320
33335
|
const entries = await readdir(dir, { withFileTypes: true });
|
|
33321
33336
|
const files = [];
|
|
33322
33337
|
for (const entry of entries) {
|
|
33323
|
-
const full =
|
|
33338
|
+
const full = join61(dir, entry.name);
|
|
33324
33339
|
if (entry.isDirectory()) {
|
|
33325
33340
|
files.push(...await walk(full));
|
|
33326
33341
|
} else if (entry.isFile() && entry.name.endsWith(".ts") && !entry.name.endsWith(".d.ts")) {
|
|
@@ -33685,7 +33700,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33685
33700
|
}
|
|
33686
33701
|
return ctx;
|
|
33687
33702
|
}, runSvelteBundleRebuild = async (state, svelteFiles, config) => {
|
|
33688
|
-
const existingSvelteFiles = svelteFiles.filter((file) =>
|
|
33703
|
+
const existingSvelteFiles = svelteFiles.filter((file) => existsSync46(file));
|
|
33689
33704
|
if (existingSvelteFiles.length === 0)
|
|
33690
33705
|
return;
|
|
33691
33706
|
const svelteDir = config.svelteDirectory ?? "";
|
|
@@ -33955,7 +33970,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
33955
33970
|
} = await compileVue(vueFiles, vueDir, true, getStyleTransformConfig(state.config));
|
|
33956
33971
|
const serverEntries = [...vueServerPaths];
|
|
33957
33972
|
const clientEntries = [...vueIndexPaths, ...vueClientPaths];
|
|
33958
|
-
const cssOutDir =
|
|
33973
|
+
const cssOutDir = join61(buildDir, state.resolvedPaths.assetsDir ? basename20(state.resolvedPaths.assetsDir) : "assets", "css");
|
|
33959
33974
|
const { serverRoot, serverOutDir } = await computeServerOutPaths(state.resolvedPaths, "vue");
|
|
33960
33975
|
const serverExternals = await getServerBundleExternals();
|
|
33961
33976
|
const serverExternalsPlugins = await getServerBundleExternalsPlugins(state.config);
|
|
@@ -35068,7 +35083,7 @@ var init_rebuildTrigger = __esm(() => {
|
|
|
35068
35083
|
// src/build/buildDepVendor.ts
|
|
35069
35084
|
import { mkdirSync as mkdirSync15 } from "fs";
|
|
35070
35085
|
import { isBuiltin as isBuiltin2 } from "module";
|
|
35071
|
-
import { join as
|
|
35086
|
+
import { join as join62, relative as relative27 } from "path";
|
|
35072
35087
|
import { rm as rm13 } from "fs/promises";
|
|
35073
35088
|
var {build: bunBuild9, Glob: Glob10 } = globalThis.Bun;
|
|
35074
35089
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -35226,7 +35241,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
35226
35241
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
35227
35242
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
35228
35243
|
const safeName = toSafeFileName6(specifier);
|
|
35229
|
-
const entryPath =
|
|
35244
|
+
const entryPath = join62(tmpDir, `${safeName}.ts`);
|
|
35230
35245
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
35231
35246
|
return { entryPath, specifier };
|
|
35232
35247
|
}));
|
|
@@ -35317,9 +35332,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
35317
35332
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories, files);
|
|
35318
35333
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
35319
35334
|
return {};
|
|
35320
|
-
const vendorDir =
|
|
35335
|
+
const vendorDir = join62(buildDir, "vendor");
|
|
35321
35336
|
mkdirSync15(vendorDir, { recursive: true });
|
|
35322
|
-
const tmpDir =
|
|
35337
|
+
const tmpDir = join62(buildDir, "_dep_vendor_tmp");
|
|
35323
35338
|
mkdirSync15(tmpDir, { recursive: true });
|
|
35324
35339
|
const allSpecs = new Set(initialSpecs);
|
|
35325
35340
|
const alreadyScanned = new Set;
|
|
@@ -35406,13 +35421,13 @@ var init_buildDepVendor = __esm(() => {
|
|
|
35406
35421
|
import { createHash as createHash7 } from "crypto";
|
|
35407
35422
|
import {
|
|
35408
35423
|
copyFileSync as copyFileSync4,
|
|
35409
|
-
existsSync as
|
|
35424
|
+
existsSync as existsSync47,
|
|
35410
35425
|
mkdirSync as mkdirSync16,
|
|
35411
35426
|
readdirSync as readdirSync13,
|
|
35412
|
-
readFileSync as
|
|
35427
|
+
readFileSync as readFileSync45
|
|
35413
35428
|
} from "fs";
|
|
35414
35429
|
import { mkdir as mkdir14, readFile as readFile10, rename as rename5, rm as rm14, writeFile as writeFile12 } from "fs/promises";
|
|
35415
|
-
import { basename as basename21, join as
|
|
35430
|
+
import { basename as basename21, join as join63, resolve as resolve57 } from "path";
|
|
35416
35431
|
var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeVendorCacheKey = (inputs) => {
|
|
35417
35432
|
const hash = createHash7("sha256");
|
|
35418
35433
|
hash.update(String(CACHE_FORMAT_VERSION3));
|
|
@@ -35439,19 +35454,19 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35439
35454
|
const hash = createHash7("sha256");
|
|
35440
35455
|
let found = false;
|
|
35441
35456
|
for (const name of LOCKFILES) {
|
|
35442
|
-
const path =
|
|
35443
|
-
if (!
|
|
35457
|
+
const path = join63(projectRoot, name);
|
|
35458
|
+
if (!existsSync47(path))
|
|
35444
35459
|
continue;
|
|
35445
35460
|
found = true;
|
|
35446
35461
|
hash.update(name);
|
|
35447
|
-
hash.update(
|
|
35462
|
+
hash.update(readFileSync45(path));
|
|
35448
35463
|
}
|
|
35449
35464
|
return found ? hash.digest("hex") : null;
|
|
35450
35465
|
}, vendorCacheEnabled = () => process.env.ABSOLUTE_DEV_VENDOR_CACHE !== "0", copyTree = (fromDir, toDir) => {
|
|
35451
35466
|
mkdirSync16(toDir, { recursive: true });
|
|
35452
35467
|
for (const entry of readdirSync13(fromDir, { withFileTypes: true })) {
|
|
35453
|
-
const source =
|
|
35454
|
-
const destination =
|
|
35468
|
+
const source = join63(fromDir, entry.name);
|
|
35469
|
+
const destination = join63(toDir, entry.name);
|
|
35455
35470
|
if (entry.isDirectory())
|
|
35456
35471
|
copyTree(source, destination);
|
|
35457
35472
|
else
|
|
@@ -35459,22 +35474,22 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35459
35474
|
}
|
|
35460
35475
|
}, copySlotsInto = (cacheDir, vendorDirs) => {
|
|
35461
35476
|
for (const [index, dir] of vendorDirs.entries()) {
|
|
35462
|
-
const source =
|
|
35463
|
-
if (!
|
|
35477
|
+
const source = join63(cacheDir, slotName(index, dir));
|
|
35478
|
+
if (!existsSync47(source)) {
|
|
35464
35479
|
throw new Error(`missing cached vendor dir ${source}`);
|
|
35465
35480
|
}
|
|
35466
35481
|
copyTree(source, dir);
|
|
35467
35482
|
}
|
|
35468
35483
|
}, copySlotsFrom = (stagingDir, vendorDirs) => {
|
|
35469
35484
|
for (const [index, dir] of vendorDirs.entries()) {
|
|
35470
|
-
if (!
|
|
35485
|
+
if (!existsSync47(dir))
|
|
35471
35486
|
continue;
|
|
35472
|
-
copyTree(dir,
|
|
35487
|
+
copyTree(dir, join63(stagingDir, slotName(index, dir)));
|
|
35473
35488
|
}
|
|
35474
35489
|
}, 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}-${basename21(resolve57(dir, ".."))}`, restoreVendorCache = async (key, vendorDirs, projectRoot = process.cwd()) => {
|
|
35475
35490
|
const cacheDir = cacheDirFor(key, projectRoot);
|
|
35476
|
-
const payloadPath =
|
|
35477
|
-
if (!
|
|
35491
|
+
const payloadPath = join63(cacheDir, "payload.json");
|
|
35492
|
+
if (!existsSync47(payloadPath))
|
|
35478
35493
|
return null;
|
|
35479
35494
|
try {
|
|
35480
35495
|
const payload = JSON.parse(await readFile10(payloadPath, "utf8"));
|
|
@@ -35487,14 +35502,14 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35487
35502
|
}
|
|
35488
35503
|
}, saveVendorCache = async (key, vendorDirs, payload, projectRoot = process.cwd()) => {
|
|
35489
35504
|
const cacheDir = cacheDirFor(key, projectRoot);
|
|
35490
|
-
if (
|
|
35505
|
+
if (existsSync47(join63(cacheDir, "payload.json")))
|
|
35491
35506
|
return;
|
|
35492
35507
|
const stagingDir = `${cacheDir}.${process.pid}.tmp`;
|
|
35493
35508
|
try {
|
|
35494
35509
|
await rm14(stagingDir, { force: true, recursive: true });
|
|
35495
35510
|
await mkdir14(stagingDir, { recursive: true });
|
|
35496
35511
|
copySlotsFrom(stagingDir, vendorDirs);
|
|
35497
|
-
await writeFile12(
|
|
35512
|
+
await writeFile12(join63(stagingDir, "payload.json"), JSON.stringify(payload));
|
|
35498
35513
|
await rm14(cacheDir, { force: true, recursive: true });
|
|
35499
35514
|
await rename5(stagingDir, cacheDir);
|
|
35500
35515
|
} catch {
|
|
@@ -35504,7 +35519,7 @@ var CACHE_ROOT2, CACHE_FORMAT_VERSION3 = 1, KEY_LENGTH = 32, LOCKFILES, computeV
|
|
|
35504
35519
|
}
|
|
35505
35520
|
};
|
|
35506
35521
|
var init_vendorCache = __esm(() => {
|
|
35507
|
-
CACHE_ROOT2 =
|
|
35522
|
+
CACHE_ROOT2 = join63(".absolutejs", "vendor-cache");
|
|
35508
35523
|
LOCKFILES = [
|
|
35509
35524
|
"bun.lock",
|
|
35510
35525
|
"bun.lockb",
|
|
@@ -35516,7 +35531,7 @@ var init_vendorCache = __esm(() => {
|
|
|
35516
35531
|
|
|
35517
35532
|
// src/core/devBuild.ts
|
|
35518
35533
|
import { readdir as readdir6 } from "fs/promises";
|
|
35519
|
-
import { existsSync as
|
|
35534
|
+
import { existsSync as existsSync48, statSync as statSync12 } from "fs";
|
|
35520
35535
|
import { resolve as resolve58 } from "path";
|
|
35521
35536
|
var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (config) => {
|
|
35522
35537
|
const configuredDirs = [
|
|
@@ -35794,7 +35809,7 @@ var FRAMEWORK_DIR_KEYS, devClientVendorSourceDir, collectDepVendorSourceDirs = (
|
|
|
35794
35809
|
const sourceFiles = await collectDepVendorSourceFiles(config);
|
|
35795
35810
|
const configVendorDirs = collectConfigVendorSourceDirs(config);
|
|
35796
35811
|
const prescannedVendorPaths = prescanVendorPaths(prescan, configVendorDirs);
|
|
35797
|
-
const remainingVendorDirs = prescannedVendorPaths ? sourceDirs.filter((dir) => !configVendorDirs.includes(dir) &&
|
|
35812
|
+
const remainingVendorDirs = prescannedVendorPaths ? sourceDirs.filter((dir) => !configVendorDirs.includes(dir) && existsSync48(dir)) : sourceDirs;
|
|
35798
35813
|
if (prescannedVendorPaths && remainingVendorDirs.length === 0 && sourceFiles.length === 0) {
|
|
35799
35814
|
globalThis.__depVendorPaths = prescannedVendorPaths;
|
|
35800
35815
|
} else {
|
|
@@ -36282,17 +36297,17 @@ var init_hmr = __esm(() => {
|
|
|
36282
36297
|
});
|
|
36283
36298
|
|
|
36284
36299
|
// src/plugins/devtoolsJson.ts
|
|
36285
|
-
import { existsSync as
|
|
36286
|
-
import { dirname as dirname39, join as
|
|
36300
|
+
import { existsSync as existsSync49, mkdirSync as mkdirSync17, readFileSync as readFileSync46, writeFileSync as writeFileSync13 } from "fs";
|
|
36301
|
+
import { dirname as dirname39, join as join64, resolve as resolve59 } from "path";
|
|
36287
36302
|
import { Elysia as Elysia8 } from "elysia";
|
|
36288
36303
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
36289
36304
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
36290
36305
|
return uuid;
|
|
36291
|
-
}, 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) => resolve59(uuidCachePath ??
|
|
36292
|
-
if (!
|
|
36306
|
+
}, 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) => resolve59(uuidCachePath ?? join64(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
36307
|
+
if (!existsSync49(cachePath))
|
|
36293
36308
|
return null;
|
|
36294
36309
|
try {
|
|
36295
|
-
const value =
|
|
36310
|
+
const value = readFileSync46(cachePath, "utf-8").trim();
|
|
36296
36311
|
return isUuidV4(value) ? value : null;
|
|
36297
36312
|
} catch {
|
|
36298
36313
|
return null;
|
|
@@ -36311,7 +36326,7 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
36311
36326
|
return setGlobalUuid(cachedUuid);
|
|
36312
36327
|
const uuid = crypto.randomUUID();
|
|
36313
36328
|
mkdirSync17(dirname39(cachePath), { recursive: true });
|
|
36314
|
-
|
|
36329
|
+
writeFileSync13(cachePath, uuid, "utf-8");
|
|
36315
36330
|
return setGlobalUuid(uuid);
|
|
36316
36331
|
}, devtoolsJson = (buildDir, options = {}) => {
|
|
36317
36332
|
const rootPath = resolve59(options.projectRoot ?? process.cwd());
|
|
@@ -36327,24 +36342,24 @@ var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_K
|
|
|
36327
36342
|
if (process.env.WSL_DISTRO_NAME) {
|
|
36328
36343
|
const distro = process.env.WSL_DISTRO_NAME;
|
|
36329
36344
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
36330
|
-
return
|
|
36345
|
+
return join64("\\\\wsl.localhost", distro, withoutLeadingSlash).replace(/\//g, "\\");
|
|
36331
36346
|
}
|
|
36332
36347
|
if (process.env.DOCKER_DESKTOP && !root.startsWith("\\\\")) {
|
|
36333
36348
|
const withoutLeadingSlash = root.replace(/^\//, "");
|
|
36334
|
-
return
|
|
36349
|
+
return join64("\\\\wsl.localhost", "docker-desktop-data", withoutLeadingSlash).replace(/\//g, "\\");
|
|
36335
36350
|
}
|
|
36336
36351
|
return root;
|
|
36337
36352
|
};
|
|
36338
36353
|
var init_devtoolsJson = () => {};
|
|
36339
36354
|
|
|
36340
36355
|
// src/plugins/imageOptimizer.ts
|
|
36341
|
-
import { existsSync as
|
|
36356
|
+
import { existsSync as existsSync50 } from "fs";
|
|
36342
36357
|
import { resolve as resolve60 } from "path";
|
|
36343
36358
|
import { Elysia as Elysia9 } from "elysia";
|
|
36344
36359
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
36345
36360
|
try {
|
|
36346
36361
|
const resolved = validateSafePath(path, baseDir);
|
|
36347
|
-
if (
|
|
36362
|
+
if (existsSync50(resolved))
|
|
36348
36363
|
return resolved;
|
|
36349
36364
|
return null;
|
|
36350
36365
|
} catch {
|
|
@@ -36855,7 +36870,7 @@ import {
|
|
|
36855
36870
|
rm as rm15,
|
|
36856
36871
|
writeFile as writeFile13
|
|
36857
36872
|
} from "fs/promises";
|
|
36858
|
-
import { join as
|
|
36873
|
+
import { join as join65, resolve as resolvePath2 } from "path";
|
|
36859
36874
|
import { pathToFileURL as pathToFileURL4 } from "url";
|
|
36860
36875
|
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) => {
|
|
36861
36876
|
const bytes = new Uint8Array(await blob.arrayBuffer());
|
|
@@ -36870,7 +36885,7 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
|
|
|
36870
36885
|
}
|
|
36871
36886
|
return releaseId;
|
|
36872
36887
|
}, readStoredArtifact = async (releaseDirectory) => {
|
|
36873
|
-
const serialized = await readFile11(
|
|
36888
|
+
const serialized = await readFile11(join65(releaseDirectory, ARTIFACT_FILE), "utf8");
|
|
36874
36889
|
const parsed = JSON.parse(serialized);
|
|
36875
36890
|
return parseAbsoluteMobileCompatibilityArtifact(parsed);
|
|
36876
36891
|
}, validateStoredIdentity = (artifact, appId, releaseId) => {
|
|
@@ -36965,8 +36980,8 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
|
|
|
36965
36980
|
}, createAbsoluteMobileFileArtifactStore = (options) => {
|
|
36966
36981
|
const root = resolvePath2(options.root);
|
|
36967
36982
|
const maxProducerBytes = options.maxProducerBytes ?? DEFAULT_MAX_PRODUCER_BYTES;
|
|
36968
|
-
const appDirectory = (appId) =>
|
|
36969
|
-
const releaseDirectory = (appId, releaseId) =>
|
|
36983
|
+
const appDirectory = (appId) => join65(root, appDirectoryName(appId));
|
|
36984
|
+
const releaseDirectory = (appId, releaseId) => join65(appDirectory(appId), requireReleaseId(releaseId));
|
|
36970
36985
|
const acceptExistingRelease = async (error, artifact) => {
|
|
36971
36986
|
if (!errorHasCode(error, "EEXIST") && !errorHasCode(error, "ENOTEMPTY")) {
|
|
36972
36987
|
return false;
|
|
@@ -37007,7 +37022,7 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
|
|
|
37007
37022
|
}
|
|
37008
37023
|
return {
|
|
37009
37024
|
artifact,
|
|
37010
|
-
producer: Bun.file(
|
|
37025
|
+
producer: Bun.file(join65(directory, artifact.producer.module))
|
|
37011
37026
|
};
|
|
37012
37027
|
},
|
|
37013
37028
|
write: async (release) => {
|
|
@@ -37015,14 +37030,14 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
|
|
|
37015
37030
|
const validated = await verifyAbsoluteMobileCompatibilityProducer({ artifact: validatedArtifact, producer: release.producer }, maxProducerBytes);
|
|
37016
37031
|
const parent = appDirectory(validated.artifact.appId);
|
|
37017
37032
|
await mkdir15(parent, { recursive: true });
|
|
37018
|
-
const staging = await mkdtemp2(
|
|
37019
|
-
const producerPath =
|
|
37033
|
+
const staging = await mkdtemp2(join65(parent, ".stage-"));
|
|
37034
|
+
const producerPath = join65(staging, validated.artifact.producer.module);
|
|
37020
37035
|
try {
|
|
37021
37036
|
await mkdir15(resolvePath2(producerPath, ".."), {
|
|
37022
37037
|
recursive: true
|
|
37023
37038
|
});
|
|
37024
37039
|
await Promise.all([
|
|
37025
|
-
writeFile13(
|
|
37040
|
+
writeFile13(join65(staging, ARTIFACT_FILE), `${JSON.stringify(validated.artifact, null, "\t")}
|
|
37026
37041
|
`),
|
|
37027
37042
|
writeFile13(producerPath, new Uint8Array(await validated.producer.arrayBuffer()))
|
|
37028
37043
|
]);
|
|
@@ -37079,7 +37094,7 @@ import {
|
|
|
37079
37094
|
rm as rm16,
|
|
37080
37095
|
writeFile as writeFile14
|
|
37081
37096
|
} from "fs/promises";
|
|
37082
|
-
import { dirname as dirname40, join as
|
|
37097
|
+
import { dirname as dirname40, join as join66, resolve as resolvePath3 } from "path";
|
|
37083
37098
|
import { pathToFileURL as pathToFileURL5 } from "url";
|
|
37084
37099
|
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) => {
|
|
37085
37100
|
const identity = JSON.stringify({
|
|
@@ -37110,16 +37125,16 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
37110
37125
|
releases
|
|
37111
37126
|
};
|
|
37112
37127
|
}, writeRelease = async (root, release) => {
|
|
37113
|
-
const directory =
|
|
37114
|
-
const producerPath =
|
|
37128
|
+
const directory = join66(root, release.artifact.releaseId);
|
|
37129
|
+
const producerPath = join66(directory, release.artifact.producer.module);
|
|
37115
37130
|
await mkdir16(dirname40(producerPath), { recursive: true });
|
|
37116
37131
|
await Promise.all([
|
|
37117
|
-
writeFile14(
|
|
37132
|
+
writeFile14(join66(directory, ARTIFACT_FILE2), `${JSON.stringify(release.artifact, null, "\t")}
|
|
37118
37133
|
`),
|
|
37119
37134
|
writeFile14(producerPath, new Uint8Array(await release.producer.arrayBuffer()))
|
|
37120
37135
|
]);
|
|
37121
37136
|
}, installImmutableBundle = async (bundlesRoot, bundleId, releases) => {
|
|
37122
|
-
const destination =
|
|
37137
|
+
const destination = join66(bundlesRoot, bundleId);
|
|
37123
37138
|
try {
|
|
37124
37139
|
await access5(destination);
|
|
37125
37140
|
return destination;
|
|
@@ -37127,7 +37142,7 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
37127
37142
|
if (!errorHasCode2(error, "ENOENT"))
|
|
37128
37143
|
throw error;
|
|
37129
37144
|
}
|
|
37130
|
-
const staging = await mkdtemp3(
|
|
37145
|
+
const staging = await mkdtemp3(join66(bundlesRoot, ".stage-"));
|
|
37131
37146
|
try {
|
|
37132
37147
|
await Promise.all(releases.map((release) => writeRelease(staging, release)));
|
|
37133
37148
|
await rename7(staging, destination);
|
|
@@ -37158,15 +37173,15 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
37158
37173
|
};
|
|
37159
37174
|
}, loadAbsoluteMobileMaterializedBundle = async (root) => {
|
|
37160
37175
|
const resolvedRoot = resolvePath3(root);
|
|
37161
|
-
const serialized = await readFile12(
|
|
37176
|
+
const serialized = await readFile12(join66(resolvedRoot, CURRENT_BUNDLE_FILE), "utf8");
|
|
37162
37177
|
const parsed = JSON.parse(serialized);
|
|
37163
37178
|
const index = parseBundleIndex(parsed);
|
|
37164
|
-
const bundleRoot =
|
|
37179
|
+
const bundleRoot = join66(resolvedRoot, BUNDLES_DIRECTORY, index.bundleId);
|
|
37165
37180
|
return {
|
|
37166
37181
|
artifacts: index.releases,
|
|
37167
37182
|
currentReleaseId: index.currentReleaseId,
|
|
37168
37183
|
loadProducer: async (artifact) => {
|
|
37169
|
-
const modulePath =
|
|
37184
|
+
const modulePath = join66(bundleRoot, artifact.releaseId, artifact.producer.module);
|
|
37170
37185
|
await verifyAbsoluteMobileCompatibilityProducer({
|
|
37171
37186
|
artifact,
|
|
37172
37187
|
producer: Bun.file(modulePath)
|
|
@@ -37192,7 +37207,7 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
37192
37207
|
return release;
|
|
37193
37208
|
});
|
|
37194
37209
|
const root = resolvePath3(input.root);
|
|
37195
|
-
const bundlesRoot =
|
|
37210
|
+
const bundlesRoot = join66(root, BUNDLES_DIRECTORY);
|
|
37196
37211
|
await mkdir16(bundlesRoot, { recursive: true });
|
|
37197
37212
|
const bundleId = bundleIdFor(input.currentReleaseId, artifacts);
|
|
37198
37213
|
await installImmutableBundle(bundlesRoot, bundleId, orderedReleases);
|
|
@@ -37202,8 +37217,8 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
37202
37217
|
format: ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT,
|
|
37203
37218
|
releases: artifacts
|
|
37204
37219
|
};
|
|
37205
|
-
const pointerPath =
|
|
37206
|
-
const temporaryPointerPath =
|
|
37220
|
+
const pointerPath = join66(root, CURRENT_BUNDLE_FILE);
|
|
37221
|
+
const temporaryPointerPath = join66(root, `.current-${crypto.randomUUID()}.json`);
|
|
37207
37222
|
await writeFile14(temporaryPointerPath, `${JSON.stringify(index, null, "\t")}
|
|
37208
37223
|
`, { flag: "wx" });
|
|
37209
37224
|
await rename7(temporaryPointerPath, pointerPath);
|
|
@@ -37211,12 +37226,12 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
|
|
|
37211
37226
|
}, readAbsoluteMobileMaterializedReleases = async (root) => {
|
|
37212
37227
|
const resolvedRoot = resolvePath3(root);
|
|
37213
37228
|
try {
|
|
37214
|
-
const serialized = await readFile12(
|
|
37229
|
+
const serialized = await readFile12(join66(resolvedRoot, CURRENT_BUNDLE_FILE), "utf8");
|
|
37215
37230
|
const parsed = JSON.parse(serialized);
|
|
37216
37231
|
const index = parseBundleIndex(parsed);
|
|
37217
|
-
const bundleRoot =
|
|
37232
|
+
const bundleRoot = join66(resolvedRoot, BUNDLES_DIRECTORY, index.bundleId);
|
|
37218
37233
|
return Promise.all(index.releases.map(async (artifact) => {
|
|
37219
|
-
const producer = Bun.file(
|
|
37234
|
+
const producer = Bun.file(join66(bundleRoot, artifact.releaseId, artifact.producer.module));
|
|
37220
37235
|
await verifyAbsoluteMobileCompatibilityProducer({
|
|
37221
37236
|
artifact,
|
|
37222
37237
|
producer
|
|
@@ -37401,15 +37416,15 @@ var init_compatibilityDispatcher = __esm(() => {
|
|
|
37401
37416
|
});
|
|
37402
37417
|
|
|
37403
37418
|
// src/core/prerender.ts
|
|
37404
|
-
import { mkdirSync as mkdirSync18, readFileSync as
|
|
37405
|
-
import { join as
|
|
37419
|
+
import { mkdirSync as mkdirSync18, readFileSync as readFileSync47 } from "fs";
|
|
37420
|
+
import { join as join67 } from "path";
|
|
37406
37421
|
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) => {
|
|
37407
37422
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
37408
37423
|
await Bun.write(metaPath, String(Date.now()));
|
|
37409
37424
|
}, readTimestamp = (htmlPath) => {
|
|
37410
37425
|
const metaPath = htmlPath.replace(/\.html$/, ".meta");
|
|
37411
37426
|
try {
|
|
37412
|
-
const content =
|
|
37427
|
+
const content = readFileSync47(metaPath, "utf-8");
|
|
37413
37428
|
return Number(content) || 0;
|
|
37414
37429
|
} catch {
|
|
37415
37430
|
return 0;
|
|
@@ -37426,7 +37441,7 @@ var DEFAULT_FETCH_TIMEOUT_MS = 1e4, PRERENDER_BYPASS_HEADER = "X-Absolute-Preren
|
|
|
37426
37441
|
if (!isCompleteHtml(html))
|
|
37427
37442
|
return false;
|
|
37428
37443
|
const fileName = routeToFilename(route);
|
|
37429
|
-
const filePath =
|
|
37444
|
+
const filePath = join67(prerenderDir, fileName);
|
|
37430
37445
|
await Bun.write(filePath, html);
|
|
37431
37446
|
await writeTimestamp(filePath);
|
|
37432
37447
|
return true;
|
|
@@ -37445,8 +37460,8 @@ var init_prerender = () => {};
|
|
|
37445
37460
|
|
|
37446
37461
|
// src/core/prepare.ts
|
|
37447
37462
|
import { createHash as createHash11 } from "crypto";
|
|
37448
|
-
import { existsSync as
|
|
37449
|
-
import { basename as basename22, join as
|
|
37463
|
+
import { existsSync as existsSync51, readdirSync as readdirSync14, readFileSync as readFileSync48 } from "fs";
|
|
37464
|
+
import { basename as basename22, join as join68, relative as relative28, resolve as resolvePath4 } from "path";
|
|
37450
37465
|
import { Elysia as Elysia12, NotFound } from "elysia";
|
|
37451
37466
|
var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_PLUGIN_RETRY_DELAY_MS = 50, waitForStaticPluginRetry = () => new Promise((resolve) => {
|
|
37452
37467
|
setTimeout(resolve, STATIC_PLUGIN_RETRY_DELAY_MS);
|
|
@@ -37574,7 +37589,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37574
37589
|
if (!fileName)
|
|
37575
37590
|
continue;
|
|
37576
37591
|
const srcPath = resolvePath4(devIndexDir, fileName);
|
|
37577
|
-
if (!
|
|
37592
|
+
if (!existsSync51(srcPath))
|
|
37578
37593
|
continue;
|
|
37579
37594
|
manifest[key] = `${SRC_URL_PREFIX}${encodeSrcPath(relative28(process.cwd(), srcPath))}`;
|
|
37580
37595
|
}
|
|
@@ -37587,10 +37602,10 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37587
37602
|
if (cached !== undefined)
|
|
37588
37603
|
return cached;
|
|
37589
37604
|
const path = href.split("?")[0] ?? href;
|
|
37590
|
-
const filePath =
|
|
37605
|
+
const filePath = join68(buildDir, path);
|
|
37591
37606
|
let versioned = href;
|
|
37592
|
-
if (
|
|
37593
|
-
const hash = createHash11("sha256").update(
|
|
37607
|
+
if (existsSync51(filePath)) {
|
|
37608
|
+
const hash = createHash11("sha256").update(readFileSync48(filePath)).digest("hex").slice(0, ICON_HASH_LENGTH);
|
|
37594
37609
|
versioned = href.includes("?") ? `${href}&v=${hash}` : `${href}?v=${hash}`;
|
|
37595
37610
|
}
|
|
37596
37611
|
cache.set(href, versioned);
|
|
@@ -37711,7 +37726,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37711
37726
|
};
|
|
37712
37727
|
}, loadPrerenderMap = (prerenderDir) => {
|
|
37713
37728
|
const map = new Map;
|
|
37714
|
-
if (!
|
|
37729
|
+
if (!existsSync51(prerenderDir))
|
|
37715
37730
|
return map;
|
|
37716
37731
|
let entries;
|
|
37717
37732
|
try {
|
|
@@ -37724,12 +37739,12 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37724
37739
|
continue;
|
|
37725
37740
|
const name = basename22(entry, ".html");
|
|
37726
37741
|
const route = name === "index" ? "/" : `/${name}`;
|
|
37727
|
-
map.set(route,
|
|
37742
|
+
map.set(route, join68(prerenderDir, entry));
|
|
37728
37743
|
}
|
|
37729
37744
|
return map;
|
|
37730
37745
|
}, loadMobileCompatibilityPlugin = async (buildDir) => {
|
|
37731
|
-
const root =
|
|
37732
|
-
if (!
|
|
37746
|
+
const root = join68(buildDir, ".absolutejs", "mobile-compatibility");
|
|
37747
|
+
if (!existsSync51(join68(root, "current.json"))) {
|
|
37733
37748
|
return new Elysia12({ name: "absolutejs-mobile-compatibility-empty" });
|
|
37734
37749
|
}
|
|
37735
37750
|
const [
|
|
@@ -37771,10 +37786,12 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37771
37786
|
});
|
|
37772
37787
|
};
|
|
37773
37788
|
let stepStartedAt = performance.now();
|
|
37774
|
-
const config = await loadConfig(configOrPath);
|
|
37775
|
-
recordStep("load config", stepStartedAt);
|
|
37776
37789
|
const nodeEnv = process.env["NODE_ENV"];
|
|
37777
37790
|
const isDev = nodeEnv === "development";
|
|
37791
|
+
const builtDir = process.env.ABSOLUTE_BUILD_DIR;
|
|
37792
|
+
const built = !isDev && builtDir ? readProductionRuntime(resolvePath4(builtDir)) : null;
|
|
37793
|
+
const config = built ?? await loadConfig(configOrPath);
|
|
37794
|
+
recordStep(built ? "load built config" : "load config", stepStartedAt);
|
|
37778
37795
|
const buildDir = resolvePath4(process.env.ABSOLUTE_BUILD_DIR ?? config.buildDirectory ?? "build");
|
|
37779
37796
|
registerIconVersioning(buildDir);
|
|
37780
37797
|
if (isDev) {
|
|
@@ -37785,22 +37802,21 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37785
37802
|
return result;
|
|
37786
37803
|
}
|
|
37787
37804
|
stepStartedAt = performance.now();
|
|
37788
|
-
const manifest = JSON.parse(
|
|
37805
|
+
const manifest = JSON.parse(readFileSync48(`${buildDir}/manifest.json`, "utf-8"));
|
|
37789
37806
|
setCurrentIslandManifest(manifest);
|
|
37790
37807
|
if (config.islands?.registry) {
|
|
37791
37808
|
setCurrentIslandRegistry(await loadIslandRegistry(config.islands.registry));
|
|
37792
37809
|
}
|
|
37793
|
-
|
|
37794
|
-
recordStep("load production manifest and island metadata", stepStartedAt);
|
|
37810
|
+
recordStep("load production manifest and island registry", stepStartedAt);
|
|
37795
37811
|
stepStartedAt = performance.now();
|
|
37796
|
-
const conventionsPath =
|
|
37797
|
-
if (
|
|
37798
|
-
const conventions = JSON.parse(
|
|
37812
|
+
const conventionsPath = join68(buildDir, "conventions.json");
|
|
37813
|
+
if (existsSync51(conventionsPath)) {
|
|
37814
|
+
const conventions = JSON.parse(readFileSync48(conventionsPath, "utf-8"));
|
|
37799
37815
|
setConventions(conventions);
|
|
37800
37816
|
}
|
|
37801
|
-
const spaRoutesPath =
|
|
37802
|
-
if (
|
|
37803
|
-
setSpaRouteManifest(JSON.parse(
|
|
37817
|
+
const spaRoutesPath = join68(buildDir, "spa-routes.json");
|
|
37818
|
+
if (existsSync51(spaRoutesPath)) {
|
|
37819
|
+
setSpaRouteManifest(JSON.parse(readFileSync48(spaRoutesPath, "utf-8")));
|
|
37804
37820
|
}
|
|
37805
37821
|
recordStep("load production conventions", stepStartedAt);
|
|
37806
37822
|
stepStartedAt = performance.now();
|
|
@@ -37811,7 +37827,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37811
37827
|
prefix: "",
|
|
37812
37828
|
staticLimit: MAX_STATIC_ROUTE_COUNT
|
|
37813
37829
|
});
|
|
37814
|
-
const generatedAssetsRoot =
|
|
37830
|
+
const generatedAssetsRoot = join68(buildDir, ".absolutejs");
|
|
37815
37831
|
const generatedAssetsPlugin = new Elysia12({
|
|
37816
37832
|
name: "absolutejs-generated-assets"
|
|
37817
37833
|
}).get("/.absolutejs/*", async ({ params, set }) => {
|
|
@@ -37843,7 +37859,7 @@ var MS_PER_SECOND2 = 1000, DEFAULT_PORT2 = 3000, MAX_STATIC_ROUTE_COUNT, STATIC_
|
|
|
37843
37859
|
responseValue.headers.set("cache-control", assetCacheControl(pathname));
|
|
37844
37860
|
});
|
|
37845
37861
|
stepStartedAt = performance.now();
|
|
37846
|
-
const prerenderDir =
|
|
37862
|
+
const prerenderDir = join68(buildDir, "_prerendered");
|
|
37847
37863
|
const prerenderMap = loadPrerenderMap(prerenderDir);
|
|
37848
37864
|
const mobileCompatibilityPlugin = await loadMobileCompatibilityPlugin(buildDir);
|
|
37849
37865
|
const mobileAssociationPlugin = await loadMobileAssociationPlugin(config.mobile);
|
|
@@ -37936,6 +37952,7 @@ var init_prepare = __esm(() => {
|
|
|
37936
37952
|
init_openApiPlugin();
|
|
37937
37953
|
init_telemetryPlugin();
|
|
37938
37954
|
init_loadConfig();
|
|
37955
|
+
init_productionRuntime();
|
|
37939
37956
|
init_requestContext();
|
|
37940
37957
|
init_loadIslandRegistry();
|
|
37941
37958
|
init_pageMetadata();
|
|
@@ -37963,17 +37980,17 @@ __export(exports_serverEntryWatcher, {
|
|
|
37963
37980
|
});
|
|
37964
37981
|
import {
|
|
37965
37982
|
copyFileSync as copyFileSync6,
|
|
37966
|
-
existsSync as
|
|
37983
|
+
existsSync as existsSync53,
|
|
37967
37984
|
readdirSync as readdirSync16,
|
|
37968
|
-
readFileSync as
|
|
37985
|
+
readFileSync as readFileSync51,
|
|
37969
37986
|
statSync as statSync13,
|
|
37970
37987
|
watch as watch2
|
|
37971
37988
|
} from "fs";
|
|
37972
37989
|
import { createHash as createHash12 } from "crypto";
|
|
37973
|
-
import { dirname as dirname41, join as
|
|
37990
|
+
import { dirname as dirname41, join as join71, resolve as resolve61 } from "path";
|
|
37974
37991
|
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) => {
|
|
37975
37992
|
try {
|
|
37976
|
-
return createHash12("sha256").update(
|
|
37993
|
+
return createHash12("sha256").update(readFileSync51(path)).digest("hex");
|
|
37977
37994
|
} catch {
|
|
37978
37995
|
return null;
|
|
37979
37996
|
}
|
|
@@ -37994,7 +38011,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
37994
38011
|
if (globalThis.__absoluteEntryWatcherStarted)
|
|
37995
38012
|
return;
|
|
37996
38013
|
const originalEntry = process.env.ABSOLUTE_SERVER_ENTRY ?? Bun.main;
|
|
37997
|
-
if (!originalEntry || !
|
|
38014
|
+
if (!originalEntry || !existsSync53(originalEntry))
|
|
37998
38015
|
return;
|
|
37999
38016
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
38000
38017
|
globalThis.__absoluteEntryWatcherReady = false;
|
|
@@ -38013,7 +38030,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
38013
38030
|
let pendingEntryCause = null;
|
|
38014
38031
|
let siblingSequence = 0;
|
|
38015
38032
|
const importFreshEntry = async (attempt = 1) => {
|
|
38016
|
-
const siblingPath =
|
|
38033
|
+
const siblingPath = join71(entryDir, `.absolutejs-hmr-${process.pid}-${siblingSequence++}.ts`);
|
|
38017
38034
|
let failure;
|
|
38018
38035
|
try {
|
|
38019
38036
|
copyFileSync6(entryPath, siblingPath);
|
|
@@ -38145,7 +38162,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
38145
38162
|
continue;
|
|
38146
38163
|
let st;
|
|
38147
38164
|
try {
|
|
38148
|
-
st = statSync13(
|
|
38165
|
+
st = statSync13(join71(dir, entry.name));
|
|
38149
38166
|
} catch {
|
|
38150
38167
|
continue;
|
|
38151
38168
|
}
|
|
@@ -38632,23 +38649,23 @@ init_hotResources();
|
|
|
38632
38649
|
// src/dev/devCert.ts
|
|
38633
38650
|
import {
|
|
38634
38651
|
copyFileSync as copyFileSync5,
|
|
38635
|
-
existsSync as
|
|
38652
|
+
existsSync as existsSync52,
|
|
38636
38653
|
mkdirSync as mkdirSync19,
|
|
38637
|
-
readFileSync as
|
|
38654
|
+
readFileSync as readFileSync49,
|
|
38638
38655
|
rmSync as rmSync5
|
|
38639
38656
|
} from "fs";
|
|
38640
38657
|
import { X509Certificate as X509Certificate4 } from "crypto";
|
|
38641
38658
|
import { isIP } from "net";
|
|
38642
|
-
import { join as
|
|
38643
|
-
var CERT_DIR =
|
|
38644
|
-
var CERT_PATH =
|
|
38645
|
-
var KEY_PATH =
|
|
38659
|
+
import { join as join69 } from "path";
|
|
38660
|
+
var CERT_DIR = join69(process.cwd(), ".absolutejs");
|
|
38661
|
+
var CERT_PATH = join69(CERT_DIR, "cert.pem");
|
|
38662
|
+
var KEY_PATH = join69(CERT_DIR, "key.pem");
|
|
38646
38663
|
var CERT_VALIDITY_DAYS = 365;
|
|
38647
38664
|
var DEFAULT_CERTIFICATE_HOSTS = ["localhost", "127.0.0.1", "::1"];
|
|
38648
38665
|
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;
|
|
38649
38666
|
var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
|
|
38650
38667
|
var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`);
|
|
38651
|
-
var certFilesExist = () =>
|
|
38668
|
+
var certFilesExist = () => existsSync52(CERT_PATH) && existsSync52(KEY_PATH);
|
|
38652
38669
|
var normalizeDevCertificateHosts = (hosts = []) => {
|
|
38653
38670
|
const normalized = new Set(DEFAULT_CERTIFICATE_HOSTS);
|
|
38654
38671
|
for (const host of hosts) {
|
|
@@ -38664,7 +38681,7 @@ var normalizeDevCertificateHosts = (hosts = []) => {
|
|
|
38664
38681
|
};
|
|
38665
38682
|
var certificateIsUsable = (hosts) => {
|
|
38666
38683
|
try {
|
|
38667
|
-
const certPem =
|
|
38684
|
+
const certPem = readFileSync49(CERT_PATH, "utf-8");
|
|
38668
38685
|
const certificate = new X509Certificate4(certPem);
|
|
38669
38686
|
if (new Date(certificate.validTo).getTime() <= Date.now())
|
|
38670
38687
|
return false;
|
|
@@ -38756,8 +38773,8 @@ var loadDevCert = (hosts = []) => {
|
|
|
38756
38773
|
return null;
|
|
38757
38774
|
try {
|
|
38758
38775
|
return {
|
|
38759
|
-
cert:
|
|
38760
|
-
key:
|
|
38776
|
+
cert: readFileSync49(paths.cert, "utf-8"),
|
|
38777
|
+
key: readFileSync49(paths.key, "utf-8")
|
|
38761
38778
|
};
|
|
38762
38779
|
} catch {
|
|
38763
38780
|
return null;
|
|
@@ -38796,18 +38813,18 @@ var signalParentPortHandoff = (port) => {
|
|
|
38796
38813
|
// src/utils/instanceRegistry.ts
|
|
38797
38814
|
import {
|
|
38798
38815
|
mkdirSync as mkdirSync20,
|
|
38799
|
-
readFileSync as
|
|
38816
|
+
readFileSync as readFileSync50,
|
|
38800
38817
|
readdirSync as readdirSync15,
|
|
38801
38818
|
unlinkSync as unlinkSync2,
|
|
38802
|
-
writeFileSync as
|
|
38819
|
+
writeFileSync as writeFileSync14
|
|
38803
38820
|
} from "fs";
|
|
38804
38821
|
import { homedir as homedir2 } from "os";
|
|
38805
|
-
import { basename as basename23, join as
|
|
38822
|
+
import { basename as basename23, join as join70 } from "path";
|
|
38806
38823
|
var registeredPids = new Set;
|
|
38807
38824
|
var exitHandlerRegistered = false;
|
|
38808
|
-
var instanceFilePath = (pid) =>
|
|
38809
|
-
var instanceLogPath = (pid) =>
|
|
38810
|
-
var instanceRegistryDir = () =>
|
|
38825
|
+
var instanceFilePath = (pid) => join70(instanceRegistryDir(), `${pid}.json`);
|
|
38826
|
+
var instanceLogPath = (pid) => join70(instanceRegistryDir(), `${pid}.log`);
|
|
38827
|
+
var instanceRegistryDir = () => join70(homedir2(), ".absolutejs", "instances");
|
|
38811
38828
|
var removeInstanceFilesSync = (pid) => {
|
|
38812
38829
|
try {
|
|
38813
38830
|
unlinkSync2(instanceFilePath(pid));
|
|
@@ -38829,20 +38846,20 @@ var registerExitHandlerOnce = () => {
|
|
|
38829
38846
|
};
|
|
38830
38847
|
var readJsonFile = (path) => {
|
|
38831
38848
|
try {
|
|
38832
|
-
return JSON.parse(
|
|
38849
|
+
return JSON.parse(readFileSync50(path, "utf-8"));
|
|
38833
38850
|
} catch {
|
|
38834
38851
|
return null;
|
|
38835
38852
|
}
|
|
38836
38853
|
};
|
|
38837
38854
|
var registerInstance = (record) => {
|
|
38838
38855
|
mkdirSync20(instanceRegistryDir(), { recursive: true });
|
|
38839
|
-
|
|
38856
|
+
writeFileSync14(instanceFilePath(record.pid), JSON.stringify(record, null, 2));
|
|
38840
38857
|
registeredPids.add(record.pid);
|
|
38841
38858
|
registerExitHandlerOnce();
|
|
38842
38859
|
return record;
|
|
38843
38860
|
};
|
|
38844
38861
|
var resolveProjectName = (cwd) => {
|
|
38845
|
-
const parsed = readJsonFile(
|
|
38862
|
+
const parsed = readJsonFile(join70(cwd, "package.json"));
|
|
38846
38863
|
if (parsed !== null && typeof parsed === "object" && typeof parsed.name === "string" && parsed.name.trim().length > 0) {
|
|
38847
38864
|
return parsed.name;
|
|
38848
38865
|
}
|
|
@@ -39322,7 +39339,7 @@ var serializeSpeculationRules = (rules) => {
|
|
|
39322
39339
|
};
|
|
39323
39340
|
// src/utils/defineEnv.ts
|
|
39324
39341
|
var {env: bunEnv } = globalThis.Bun;
|
|
39325
|
-
import { existsSync as
|
|
39342
|
+
import { existsSync as existsSync54, readFileSync as readFileSync52 } from "fs";
|
|
39326
39343
|
import { resolve as resolve62 } from "path";
|
|
39327
39344
|
|
|
39328
39345
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
@@ -43851,18 +43868,18 @@ ${lines.join(`
|
|
|
43851
43868
|
var checkEnvFileSecurity = (properties) => {
|
|
43852
43869
|
const cwd = process.cwd();
|
|
43853
43870
|
const envPath = resolve62(cwd, ".env");
|
|
43854
|
-
if (!
|
|
43871
|
+
if (!existsSync54(envPath))
|
|
43855
43872
|
return;
|
|
43856
43873
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
43857
43874
|
if (sensitiveKeys.length === 0)
|
|
43858
43875
|
return;
|
|
43859
|
-
const envContent =
|
|
43876
|
+
const envContent = readFileSync52(envPath, "utf-8");
|
|
43860
43877
|
const presentKeys = sensitiveKeys.filter((key) => envContent.includes(`${key}=`));
|
|
43861
43878
|
if (presentKeys.length === 0)
|
|
43862
43879
|
return;
|
|
43863
43880
|
const gitignorePath = resolve62(cwd, ".gitignore");
|
|
43864
|
-
if (
|
|
43865
|
-
const gitignore =
|
|
43881
|
+
if (existsSync54(gitignorePath)) {
|
|
43882
|
+
const gitignore = readFileSync52(gitignorePath, "utf-8");
|
|
43866
43883
|
if (gitignore.split(`
|
|
43867
43884
|
`).some((line) => line.trim() === ".env"))
|
|
43868
43885
|
return;
|
|
@@ -43894,7 +43911,7 @@ var getEnv = (key) => {
|
|
|
43894
43911
|
return environmentVariable;
|
|
43895
43912
|
};
|
|
43896
43913
|
// src/utils/projectRoot.ts
|
|
43897
|
-
import { existsSync as
|
|
43914
|
+
import { existsSync as existsSync55 } from "fs";
|
|
43898
43915
|
import { dirname as dirname42, resolve as resolve63 } from "path";
|
|
43899
43916
|
var CONFIG_CANDIDATES = [
|
|
43900
43917
|
"absolute.config.ts",
|
|
@@ -43904,7 +43921,7 @@ var CONFIG_CANDIDATES = [
|
|
|
43904
43921
|
"absolute.config.mts",
|
|
43905
43922
|
"absolute.config.cts"
|
|
43906
43923
|
];
|
|
43907
|
-
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) =>
|
|
43924
|
+
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync55(resolve63(directory, name)));
|
|
43908
43925
|
var findProjectRoot = () => {
|
|
43909
43926
|
const start = process.cwd();
|
|
43910
43927
|
let packageRoot = null;
|
|
@@ -43913,7 +43930,7 @@ var findProjectRoot = () => {
|
|
|
43913
43930
|
if (hasAbsoluteConfig(directory)) {
|
|
43914
43931
|
return directory;
|
|
43915
43932
|
}
|
|
43916
|
-
if (packageRoot === null &&
|
|
43933
|
+
if (packageRoot === null && existsSync55(resolve63(directory, "package.json"))) {
|
|
43917
43934
|
packageRoot = directory;
|
|
43918
43935
|
}
|
|
43919
43936
|
const parent = dirname42(directory);
|
|
@@ -44183,5 +44200,5 @@ export {
|
|
|
44183
44200
|
wrapPageHandlerWithStreamingSlots
|
|
44184
44201
|
};
|
|
44185
44202
|
|
|
44186
|
-
//# debugId=
|
|
44203
|
+
//# debugId=213BD413FC42A0A164756E2164756E21
|
|
44187
44204
|
//# sourceMappingURL=index.js.map
|