@absolutejs/absolute 0.20.0-beta.45 → 0.20.0-beta.47
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/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/build.js +141 -123
- package/dist/build.js.map +3 -3
- package/dist/cli/index.js +1069 -803
- package/dist/index.js +208 -150
- package/dist/index.js.map +5 -5
- package/dist/mobile/index.js +419 -112
- package/dist/mobile/index.js.map +8 -8
- package/dist/mobile/remoteMacAgentEntry.js +609 -85
- package/dist/mobile/shellExpoAuth.js +20 -41
- package/dist/mobile/shellExpoDevices.js +20 -41
- package/dist/src/mobile/deviceCapabilities.d.ts +4 -2
- package/dist/src/mobile/expoBridge.d.ts +2 -2
- package/dist/src/mobile/shellExpoDevices.d.ts +2 -2
- package/dist/types/build.d.ts +4 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -9034,7 +9034,7 @@ var init_loadConfig = __esm(() => {
|
|
|
9034
9034
|
|
|
9035
9035
|
// src/mobile/config.ts
|
|
9036
9036
|
import { resolve as resolve11 } from "path";
|
|
9037
|
-
var APP_ID_PATTERN, SCHEME_PATTERN, APPLE_APP_ID_PREFIX_PATTERN, CERTIFICATE_FINGERPRINT_PATTERN, HOSTNAME_PATTERN, resolveProjectPath = (projectRoot, value, field) => {
|
|
9037
|
+
var APP_ID_PATTERN, SCHEME_PATTERN, APPLE_APP_ID_PREFIX_PATTERN, CERTIFICATE_FINGERPRINT_PATTERN, HOSTNAME_PATTERN, EXPO_RESERVED_ROUTE_PREFIXES, resolveProjectPath = (projectRoot, value, field) => {
|
|
9038
9038
|
const root = resolve11(projectRoot);
|
|
9039
9039
|
const path = resolve11(root, value);
|
|
9040
9040
|
if (path !== root && !path.startsWith(`${root}/`)) {
|
|
@@ -9107,11 +9107,31 @@ var APP_ID_PATTERN, SCHEME_PATTERN, APPLE_APP_ID_PREFIX_PATTERN, CERTIFICATE_FIN
|
|
|
9107
9107
|
}
|
|
9108
9108
|
return value.match(/.{2}/g)?.join(":") ?? value;
|
|
9109
9109
|
}))
|
|
9110
|
-
].sort(),
|
|
9110
|
+
].sort(), validateExpoNativeRouteSegment = (path, segment, index, count, parameters) => {
|
|
9111
|
+
if (segment === "*" && (index !== count - 1 || count === 1)) {
|
|
9112
|
+
throw new TypeError(`mobile.routes.native route ${path} must use * once, as the final segment after a static or parameterized prefix.`);
|
|
9113
|
+
}
|
|
9114
|
+
if (segment === "*")
|
|
9115
|
+
return;
|
|
9116
|
+
if (!segment.startsWith(":") && (segment.includes("*") || segment.includes(":"))) {
|
|
9117
|
+
throw new TypeError(`mobile.routes.native route ${path} contains invalid segment ${segment}.`);
|
|
9118
|
+
}
|
|
9119
|
+
if (!segment.startsWith(":"))
|
|
9120
|
+
return;
|
|
9121
|
+
const name = segment.slice(1);
|
|
9122
|
+
if (!/^[A-Za-z][A-Za-z0-9_]*$/u.test(name)) {
|
|
9123
|
+
throw new TypeError(`mobile.routes.native route ${path} has invalid parameter ${segment}.`);
|
|
9124
|
+
}
|
|
9125
|
+
if (parameters.has(name)) {
|
|
9126
|
+
throw new TypeError(`mobile.routes.native route ${path} repeats parameter ${segment}.`);
|
|
9127
|
+
}
|
|
9128
|
+
parameters.add(name);
|
|
9129
|
+
}, normalizeExpoNativeRoutes = (config, projectRoot) => {
|
|
9111
9130
|
if (config.engine !== "expo")
|
|
9112
9131
|
return {};
|
|
9113
9132
|
const routes = config.routes?.native ?? {};
|
|
9114
9133
|
const normalized = {};
|
|
9134
|
+
const ownership = new Map;
|
|
9115
9135
|
for (const [route, module] of Object.entries(routes)) {
|
|
9116
9136
|
const path = normalizeEntry(route);
|
|
9117
9137
|
if (path.includes("?") || path.includes("#") || path !== "/" && path.endsWith("/")) {
|
|
@@ -9120,9 +9140,18 @@ var APP_ID_PATTERN, SCHEME_PATTERN, APPLE_APP_ID_PREFIX_PATTERN, CERTIFICATE_FIN
|
|
|
9120
9140
|
if (path === "/__absolute/native") {
|
|
9121
9141
|
throw new TypeError("mobile.routes.native reserves /__absolute/native for the Expo diagnostic screen.");
|
|
9122
9142
|
}
|
|
9123
|
-
|
|
9124
|
-
|
|
9143
|
+
const segments = path.split("/").filter(Boolean);
|
|
9144
|
+
if (segments[0] && EXPO_RESERVED_ROUTE_PREFIXES.has(segments[0])) {
|
|
9145
|
+
throw new TypeError(`mobile.routes.native route ${path} conflicts with an Expo Router or Metro reserved path.`);
|
|
9125
9146
|
}
|
|
9147
|
+
const parameters = new Set;
|
|
9148
|
+
segments.forEach((segment, index) => validateExpoNativeRouteSegment(path, segment, index, segments.length, parameters));
|
|
9149
|
+
const signature = segments.map((segment) => segment.startsWith(":") ? ":" : segment).join("/");
|
|
9150
|
+
const existing = ownership.get(signature);
|
|
9151
|
+
if (existing) {
|
|
9152
|
+
throw new TypeError(`mobile.routes.native routes ${existing} and ${path} claim the same Expo route pattern.`);
|
|
9153
|
+
}
|
|
9154
|
+
ownership.set(signature, path);
|
|
9126
9155
|
normalized[path] = resolveProjectPath(projectRoot, requireText(module, `mobile.routes.native[${path}]`), `mobile.routes.native[${path}]`);
|
|
9127
9156
|
}
|
|
9128
9157
|
return Object.fromEntries(Object.entries(normalized).sort(([left], [right]) => left.localeCompare(right)));
|
|
@@ -9161,6 +9190,16 @@ var init_config = __esm(() => {
|
|
|
9161
9190
|
APPLE_APP_ID_PREFIX_PATTERN = /^[A-Z0-9]{10}$/;
|
|
9162
9191
|
CERTIFICATE_FINGERPRINT_PATTERN = /^[0-9A-F]{64}$/;
|
|
9163
9192
|
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])?))*$/;
|
|
9193
|
+
EXPO_RESERVED_ROUTE_PREFIXES = new Set([
|
|
9194
|
+
"_expo",
|
|
9195
|
+
"_flight",
|
|
9196
|
+
"_sitemap",
|
|
9197
|
+
"assets",
|
|
9198
|
+
"expo-dev-plugins",
|
|
9199
|
+
"inspector",
|
|
9200
|
+
"manifest",
|
|
9201
|
+
"public"
|
|
9202
|
+
]);
|
|
9164
9203
|
});
|
|
9165
9204
|
|
|
9166
9205
|
// src/cli/scripts/telemetry.ts
|
|
@@ -13352,10 +13391,11 @@ var isTestSourcePath = (file2) => {
|
|
|
13352
13391
|
};
|
|
13353
13392
|
|
|
13354
13393
|
// src/mobile/deviceCapabilities.ts
|
|
13355
|
-
import { readFileSync as readFileSync17 } from "fs";
|
|
13394
|
+
import { existsSync as existsSync23, readFileSync as readFileSync17 } from "fs";
|
|
13356
13395
|
import { extname as extname7, join as join29, relative as relative11, resolve as resolve25 } from "path";
|
|
13396
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
13357
13397
|
import ts8 from "typescript";
|
|
13358
|
-
var DEVICES_PACKAGE = "@absolutejs/devices",
|
|
13398
|
+
var DEVICES_PACKAGE = "@absolutejs/devices", 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) => {
|
|
13359
13399
|
const value = JSON.parse(readFileSync17(path, "utf8"));
|
|
13360
13400
|
if (!object(value))
|
|
13361
13401
|
throw new TypeError(`${path} must contain an object.`);
|
|
@@ -13415,7 +13455,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
|
|
|
13415
13455
|
...systemBars === true ? { systemBars: true } : {},
|
|
13416
13456
|
...usageDescriptions === undefined ? {} : { usageDescriptions: [...usageDescriptions] }
|
|
13417
13457
|
};
|
|
13418
|
-
}, parseProvider = (name, value) => {
|
|
13458
|
+
}, parseProvider = (name, value, providerName) => {
|
|
13419
13459
|
if (!IDENTIFIER_PATTERN.test(name))
|
|
13420
13460
|
throw new TypeError("Device capability names must be identifiers.");
|
|
13421
13461
|
if (!object(value))
|
|
@@ -13424,10 +13464,13 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
|
|
|
13424
13464
|
const module = text(value.module, `${name}.module`);
|
|
13425
13465
|
if (!IDENTIFIER_PATTERN.test(factory))
|
|
13426
13466
|
throw new TypeError(`${name}.factory must be a JavaScript identifier.`);
|
|
13427
|
-
if (!
|
|
13428
|
-
throw new TypeError(`${name}.module must be an official devices
|
|
13429
|
-
if (!Array.isArray(value.packages) || !value.packages.every((spec) => typeof spec === "string" &&
|
|
13430
|
-
throw new TypeError(`${name}.packages must contain exact official
|
|
13467
|
+
if (!providerModulePattern(providerName).test(module))
|
|
13468
|
+
throw new TypeError(`${name}.module must be an official devices-${providerName} subpath.`);
|
|
13469
|
+
if (!Array.isArray(value.packages) || !value.packages.every((spec) => typeof spec === "string" && providerPackagePattern(providerName).test(spec)))
|
|
13470
|
+
throw new TypeError(`${name}.packages must contain exact official ${providerLabel(providerName)} package versions.`);
|
|
13471
|
+
const { plugins } = value;
|
|
13472
|
+
if (plugins !== undefined && (!Array.isArray(plugins) || !plugins.every((plugin) => typeof plugin === "string" && /^expo-[a-z][a-z0-9-]*$/u.test(plugin))))
|
|
13473
|
+
throw new TypeError(`${name}.plugins must contain Expo config plugin names.`);
|
|
13431
13474
|
let native;
|
|
13432
13475
|
const { native: nativeMetadata } = value;
|
|
13433
13476
|
if (nativeMetadata !== undefined) {
|
|
@@ -13445,6 +13488,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
|
|
|
13445
13488
|
factory,
|
|
13446
13489
|
module,
|
|
13447
13490
|
...native === undefined ? {} : { native },
|
|
13491
|
+
...plugins === undefined ? {} : { plugins: [...plugins] },
|
|
13448
13492
|
packages: [...value.packages]
|
|
13449
13493
|
};
|
|
13450
13494
|
}, absoluteDeviceNativeRequirements = (plan) => {
|
|
@@ -13474,18 +13518,27 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
|
|
|
13474
13518
|
...new Set(plan.capabilities.flatMap((name) => plan.providers[name]?.native?.ios?.usageDescriptions ?? []))
|
|
13475
13519
|
].sort()
|
|
13476
13520
|
};
|
|
13477
|
-
}, loadAbsoluteDeviceCapabilityProviders = (projectRoot) => {
|
|
13478
|
-
const
|
|
13521
|
+
}, loadAbsoluteDeviceCapabilityProviders = (projectRoot, provider = "capacitor") => {
|
|
13522
|
+
const adapter = ADAPTERS[provider];
|
|
13523
|
+
let path = join29(resolve25(projectRoot), "node_modules", adapter, "package.json");
|
|
13524
|
+
try {
|
|
13525
|
+
readFileSync17(path, "utf8");
|
|
13526
|
+
} catch {
|
|
13527
|
+
path = fileURLToPath2(import.meta.resolve(`${adapter}/package.json`));
|
|
13528
|
+
}
|
|
13479
13529
|
const manifest = readJson(path);
|
|
13480
13530
|
const { absolutejs } = manifest;
|
|
13481
13531
|
const devices = object(absolutejs) ? absolutejs.devices : undefined;
|
|
13482
|
-
if (!object(devices) || devices.format !== 1 || devices.provider !==
|
|
13483
|
-
throw new TypeError(`${
|
|
13484
|
-
const entries = Object.entries(devices.capabilities).map(([name,
|
|
13532
|
+
if (!object(devices) || devices.format !== 1 || devices.provider !== provider || !object(devices.capabilities))
|
|
13533
|
+
throw new TypeError(`${adapter} does not publish supported capability metadata.`);
|
|
13534
|
+
const entries = Object.entries(devices.capabilities).map(([name, capability]) => ({
|
|
13485
13535
|
name,
|
|
13486
|
-
provider: parseProvider(name, provider)
|
|
13536
|
+
provider: parseProvider(name, capability, provider)
|
|
13487
13537
|
}));
|
|
13488
|
-
return Object.fromEntries(entries.sort((left, right) => left.name.localeCompare(right.name)).map(({ name, provider }) => [
|
|
13538
|
+
return Object.fromEntries(entries.sort((left, right) => left.name.localeCompare(right.name)).map(({ name, provider: capabilityProvider }) => [
|
|
13539
|
+
name,
|
|
13540
|
+
capabilityProvider
|
|
13541
|
+
]));
|
|
13489
13542
|
}, isIgnored = (path) => path.split("/").some((segment) => IGNORED_DIRECTORIES.has(segment)), importedCapabilities = (source, file2) => {
|
|
13490
13543
|
const names = new Set;
|
|
13491
13544
|
const namespaces = new Set;
|
|
@@ -13542,6 +13595,8 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
|
|
|
13542
13595
|
return packages;
|
|
13543
13596
|
}, discoverAbsoluteDeviceCapabilities = (projectRoot, providers = loadAbsoluteDeviceCapabilityProviders(projectRoot)) => {
|
|
13544
13597
|
const root = resolve25(projectRoot);
|
|
13598
|
+
if (!existsSync23(root))
|
|
13599
|
+
return [];
|
|
13545
13600
|
const known = new Set(Object.keys(providers));
|
|
13546
13601
|
const capabilities = new Set;
|
|
13547
13602
|
for (const path of SOURCE_GLOB.scanSync({ cwd: root })) {
|
|
@@ -13568,14 +13623,14 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
|
|
|
13568
13623
|
return true;
|
|
13569
13624
|
}
|
|
13570
13625
|
return false;
|
|
13571
|
-
}, resolveAbsoluteDeviceCapabilityPlan = (projectRoot) => {
|
|
13572
|
-
const allProviders = loadAbsoluteDeviceCapabilityProviders(projectRoot);
|
|
13626
|
+
}, resolveAbsoluteDeviceCapabilityPlan = (projectRoot, provider = "capacitor") => {
|
|
13627
|
+
const allProviders = loadAbsoluteDeviceCapabilityProviders(projectRoot, provider);
|
|
13573
13628
|
const capabilities = discoverAbsoluteDeviceCapabilities(projectRoot, allProviders);
|
|
13574
13629
|
const providers = {};
|
|
13575
13630
|
for (const name of capabilities) {
|
|
13576
|
-
const
|
|
13577
|
-
if (
|
|
13578
|
-
providers[name] =
|
|
13631
|
+
const capabilityProvider = allProviders[name];
|
|
13632
|
+
if (capabilityProvider)
|
|
13633
|
+
providers[name] = capabilityProvider;
|
|
13579
13634
|
}
|
|
13580
13635
|
return {
|
|
13581
13636
|
capabilities,
|
|
@@ -13586,6 +13641,10 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
|
|
|
13586
13641
|
};
|
|
13587
13642
|
};
|
|
13588
13643
|
var init_deviceCapabilities = __esm(() => {
|
|
13644
|
+
ADAPTERS = {
|
|
13645
|
+
capacitor: "@absolutejs/devices-capacitor",
|
|
13646
|
+
expo: "@absolutejs/devices-expo"
|
|
13647
|
+
};
|
|
13589
13648
|
SOURCE_GLOB = new Bun.Glob("**/*.{js,jsx,ts,tsx,svelte,vue}");
|
|
13590
13649
|
IGNORED_DIRECTORIES = new Set([
|
|
13591
13650
|
".absolutejs",
|
|
@@ -13599,8 +13658,6 @@ var init_deviceCapabilities = __esm(() => {
|
|
|
13599
13658
|
"tests"
|
|
13600
13659
|
]);
|
|
13601
13660
|
IDENTIFIER_PATTERN = /^[A-Za-z_$][\w$]*$/u;
|
|
13602
|
-
CAPACITOR_MODULE_PATTERN = /^@absolutejs\/devices-capacitor\/[a-z][a-z0-9-]*$/u;
|
|
13603
|
-
CAPACITOR_PACKAGE_PATTERN = /^@capacitor\/[a-z][a-z0-9-]*@\d+\.\d+\.\d+$/u;
|
|
13604
13661
|
ANDROID_PERMISSION_PATTERN = /^android\.permission\.[A-Z][A-Z0-9_]*$/u;
|
|
13605
13662
|
IOS_USAGE_DESCRIPTIONS = new Set([
|
|
13606
13663
|
"camera",
|
|
@@ -14612,7 +14669,7 @@ var exports_parseAngularConfigImports = {};
|
|
|
14612
14669
|
__export(exports_parseAngularConfigImports, {
|
|
14613
14670
|
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
14614
14671
|
});
|
|
14615
|
-
import { existsSync as
|
|
14672
|
+
import { existsSync as existsSync24, readFileSync as readFileSync22 } from "fs";
|
|
14616
14673
|
import { dirname as dirname18, isAbsolute as isAbsolute3, join as join35 } from "path";
|
|
14617
14674
|
import ts12 from "typescript";
|
|
14618
14675
|
var findDefineConfigCall = (sf) => {
|
|
@@ -14669,7 +14726,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
14669
14726
|
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
14670
14727
|
if (envOverride) {
|
|
14671
14728
|
const resolved = isAbsolute3(envOverride) ? envOverride : join35(projectRoot, envOverride);
|
|
14672
|
-
if (
|
|
14729
|
+
if (existsSync24(resolved))
|
|
14673
14730
|
return resolved;
|
|
14674
14731
|
}
|
|
14675
14732
|
const candidates = [
|
|
@@ -14679,7 +14736,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
14679
14736
|
join35(projectRoot, "absolute.config.mjs")
|
|
14680
14737
|
];
|
|
14681
14738
|
for (const candidate of candidates) {
|
|
14682
|
-
if (
|
|
14739
|
+
if (existsSync24(candidate))
|
|
14683
14740
|
return candidate;
|
|
14684
14741
|
}
|
|
14685
14742
|
return null;
|
|
@@ -14780,7 +14837,7 @@ __export(exports_compileSvelte, {
|
|
|
14780
14837
|
clearSvelteCompilerCache: () => clearSvelteCompilerCache,
|
|
14781
14838
|
compileSvelte: () => compileSvelte
|
|
14782
14839
|
});
|
|
14783
|
-
import { existsSync as
|
|
14840
|
+
import { existsSync as existsSync25 } from "fs";
|
|
14784
14841
|
import { mkdir as mkdir9, stat as stat2 } from "fs/promises";
|
|
14785
14842
|
import {
|
|
14786
14843
|
dirname as dirname19,
|
|
@@ -14796,11 +14853,11 @@ var {write: write2, file: file2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
|
14796
14853
|
var resolveDevClientDir2 = () => {
|
|
14797
14854
|
const projectRoot = process.cwd();
|
|
14798
14855
|
const fromSource = resolve27(import.meta.dir, "../dev/client");
|
|
14799
|
-
if (
|
|
14856
|
+
if (existsSync25(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
14800
14857
|
return fromSource;
|
|
14801
14858
|
}
|
|
14802
14859
|
const fromNodeModules = resolve27(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
14803
|
-
if (
|
|
14860
|
+
if (existsSync25(fromNodeModules))
|
|
14804
14861
|
return fromNodeModules;
|
|
14805
14862
|
return resolve27(import.meta.dir, "./dev/client");
|
|
14806
14863
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
@@ -14903,7 +14960,7 @@ var resolveDevClientDir2 = () => {
|
|
|
14903
14960
|
const contentHash = Bun.hash(raw).toString(BASE_36_RADIX);
|
|
14904
14961
|
const prevHash = sourceHashCache.get(src);
|
|
14905
14962
|
const persistent = persistentCache.get(src);
|
|
14906
|
-
if (prevHash === contentHash && persistent &&
|
|
14963
|
+
if (prevHash === contentHash && persistent && existsSync25(persistent.ssr) && existsSync25(persistent.client)) {
|
|
14907
14964
|
cache.set(src, persistent);
|
|
14908
14965
|
return persistent;
|
|
14909
14966
|
}
|
|
@@ -15625,7 +15682,7 @@ __export(exports_compileVue, {
|
|
|
15625
15682
|
generateVueHmrId: () => generateVueHmrId,
|
|
15626
15683
|
vueHmrMetadata: () => vueHmrMetadata
|
|
15627
15684
|
});
|
|
15628
|
-
import { existsSync as
|
|
15685
|
+
import { existsSync as existsSync26, readFileSync as readFileSync24, realpathSync as realpathSync2 } from "fs";
|
|
15629
15686
|
import { mkdir as mkdir10 } from "fs/promises";
|
|
15630
15687
|
import {
|
|
15631
15688
|
basename as basename11,
|
|
@@ -15639,11 +15696,11 @@ var {file: file3, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
|
15639
15696
|
var resolveDevClientDir3 = () => {
|
|
15640
15697
|
const projectRoot = process.cwd();
|
|
15641
15698
|
const fromSource = resolve28(import.meta.dir, "../dev/client");
|
|
15642
|
-
if (
|
|
15699
|
+
if (existsSync26(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
15643
15700
|
return fromSource;
|
|
15644
15701
|
}
|
|
15645
15702
|
const fromNodeModules = resolve28(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
15646
|
-
if (
|
|
15703
|
+
if (existsSync26(fromNodeModules))
|
|
15647
15704
|
return fromNodeModules;
|
|
15648
15705
|
return resolve28(import.meta.dir, "./dev/client");
|
|
15649
15706
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
@@ -15696,7 +15753,7 @@ var resolveDevClientDir3 = () => {
|
|
|
15696
15753
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
15697
15754
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
15698
15755
|
const importedPath = resolve28(dirname20(cssFilePath), relPath);
|
|
15699
|
-
if (!
|
|
15756
|
+
if (!existsSync26(importedPath))
|
|
15700
15757
|
return match;
|
|
15701
15758
|
const importedContent = readFileSync24(importedPath, "utf-8");
|
|
15702
15759
|
return inlineCssImports(importedContent, importedPath, visited);
|
|
@@ -15705,10 +15762,10 @@ var resolveDevClientDir3 = () => {
|
|
|
15705
15762
|
if (helper.endsWith(".ts"))
|
|
15706
15763
|
return resolve28(sourceDir, helper);
|
|
15707
15764
|
const direct = resolve28(sourceDir, `${helper}.ts`);
|
|
15708
|
-
if (
|
|
15765
|
+
if (existsSync26(direct))
|
|
15709
15766
|
return direct;
|
|
15710
15767
|
const indexed = resolve28(sourceDir, helper, "index.ts");
|
|
15711
|
-
if (
|
|
15768
|
+
if (existsSync26(indexed))
|
|
15712
15769
|
return indexed;
|
|
15713
15770
|
return direct;
|
|
15714
15771
|
}, toJs = (filePath, sourceDir) => {
|
|
@@ -15724,10 +15781,10 @@ var resolveDevClientDir3 = () => {
|
|
|
15724
15781
|
}
|
|
15725
15782
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
15726
15783
|
const directTs = resolve28(sourceDir, `${filePath}.ts`);
|
|
15727
|
-
if (
|
|
15784
|
+
if (existsSync26(directTs))
|
|
15728
15785
|
return `${filePath}.js`;
|
|
15729
15786
|
const indexedTs = resolve28(sourceDir, filePath, "index.ts");
|
|
15730
|
-
if (
|
|
15787
|
+
if (existsSync26(indexedTs))
|
|
15731
15788
|
return `${filePath}/index.js`;
|
|
15732
15789
|
}
|
|
15733
15790
|
return `${filePath}.js`;
|
|
@@ -15788,7 +15845,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
15788
15845
|
const contentHash = Bun.hash(sourceContent).toString(BASE_36_RADIX);
|
|
15789
15846
|
const prevHash = vueSourceHashCache.get(sourceFilePath);
|
|
15790
15847
|
const persistent = persistentBuildCache.get(sourceFilePath);
|
|
15791
|
-
if (prevHash === contentHash && persistent &&
|
|
15848
|
+
if (prevHash === contentHash && persistent && existsSync26(persistent.clientPath) && existsSync26(persistent.serverPath)) {
|
|
15792
15849
|
cacheMap.set(sourceFilePath, persistent);
|
|
15793
15850
|
return persistent;
|
|
15794
15851
|
}
|
|
@@ -15828,8 +15885,8 @@ const ${localName} = (source) => ${importedName}(
|
|
|
15828
15885
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
15829
15886
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
15830
15887
|
fs: {
|
|
15831
|
-
fileExists:
|
|
15832
|
-
readFile: (file4) =>
|
|
15888
|
+
fileExists: existsSync26,
|
|
15889
|
+
readFile: (file4) => existsSync26(file4) ? readFileSync24(file4, "utf-8") : undefined,
|
|
15833
15890
|
realpath: realpathSync2
|
|
15834
15891
|
},
|
|
15835
15892
|
id: componentId,
|
|
@@ -15991,7 +16048,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15991
16048
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
15992
16049
|
for (const { importPath } of routes) {
|
|
15993
16050
|
const childPath = resolve28(dirname20(entryPath), importPath);
|
|
15994
|
-
if (expanded.has(childPath) || !
|
|
16051
|
+
if (expanded.has(childPath) || !existsSync26(childPath)) {
|
|
15995
16052
|
continue;
|
|
15996
16053
|
}
|
|
15997
16054
|
expanded.add(childPath);
|
|
@@ -16197,7 +16254,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
16197
16254
|
continue;
|
|
16198
16255
|
}
|
|
16199
16256
|
const resolved = resolveHelperTsPath(helperDir, dep);
|
|
16200
|
-
if (!
|
|
16257
|
+
if (!existsSync26(resolved))
|
|
16201
16258
|
continue;
|
|
16202
16259
|
if (allTsHelperPaths.has(resolved))
|
|
16203
16260
|
continue;
|
|
@@ -16724,7 +16781,7 @@ __export(exports_compileAngular, {
|
|
|
16724
16781
|
compileAngularFiles: () => compileAngularFiles,
|
|
16725
16782
|
invalidateAngularJitCache: () => invalidateAngularJitCache
|
|
16726
16783
|
});
|
|
16727
|
-
import { existsSync as
|
|
16784
|
+
import { existsSync as existsSync27, readFileSync as readFileSync25, promises as fs5 } from "fs";
|
|
16728
16785
|
import { join as join38, basename as basename12, sep as sep3, dirname as dirname21, resolve as resolve29, relative as relative14 } from "path";
|
|
16729
16786
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
16730
16787
|
import ts14 from "typescript";
|
|
@@ -16781,7 +16838,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16781
16838
|
join38(candidate, "index.js"),
|
|
16782
16839
|
join38(candidate, "index.jsx")
|
|
16783
16840
|
];
|
|
16784
|
-
return candidates.find((file4) =>
|
|
16841
|
+
return candidates.find((file4) => existsSync27(file4));
|
|
16785
16842
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
16786
16843
|
const baseDir = resolve29(rootDir);
|
|
16787
16844
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
@@ -16862,11 +16919,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16862
16919
|
}, resolveDevClientDir4 = () => {
|
|
16863
16920
|
const projectRoot = process.cwd();
|
|
16864
16921
|
const fromSource = resolve29(import.meta.dir, "../dev/client");
|
|
16865
|
-
if (
|
|
16922
|
+
if (existsSync27(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
16866
16923
|
return fromSource;
|
|
16867
16924
|
}
|
|
16868
16925
|
const fromNodeModules = resolve29(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
16869
|
-
if (
|
|
16926
|
+
if (existsSync27(fromNodeModules))
|
|
16870
16927
|
return fromNodeModules;
|
|
16871
16928
|
return resolve29(import.meta.dir, "./dev/client");
|
|
16872
16929
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
@@ -16912,11 +16969,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16912
16969
|
return `${path}${query}`;
|
|
16913
16970
|
const importerDir = dirname21(importerOutputPath);
|
|
16914
16971
|
const fileCandidate = resolve29(importerDir, `${path}.js`);
|
|
16915
|
-
if (outputFiles?.has(fileCandidate) ||
|
|
16972
|
+
if (outputFiles?.has(fileCandidate) || existsSync27(fileCandidate)) {
|
|
16916
16973
|
return `${path}.js${query}`;
|
|
16917
16974
|
}
|
|
16918
16975
|
const indexCandidate = resolve29(importerDir, path, "index.js");
|
|
16919
|
-
if (outputFiles?.has(indexCandidate) ||
|
|
16976
|
+
if (outputFiles?.has(indexCandidate) || existsSync27(indexCandidate)) {
|
|
16920
16977
|
return `${path}/index.js${query}`;
|
|
16921
16978
|
}
|
|
16922
16979
|
return `${path}.js${query}`;
|
|
@@ -16954,7 +17011,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16954
17011
|
join38(basePath, "index.mts"),
|
|
16955
17012
|
join38(basePath, "index.cts")
|
|
16956
17013
|
];
|
|
16957
|
-
return candidates.map((candidate) => resolve29(candidate)).find((candidate) =>
|
|
17014
|
+
return candidates.map((candidate) => resolve29(candidate)).find((candidate) => existsSync27(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
16958
17015
|
}, readFileForAotTransform = async (fileName, readFile9) => {
|
|
16959
17016
|
const hostSource = readFile9?.(fileName);
|
|
16960
17017
|
if (typeof hostSource === "string")
|
|
@@ -17035,7 +17092,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17035
17092
|
if (visited.has(resolvedPath))
|
|
17036
17093
|
return;
|
|
17037
17094
|
visited.add(resolvedPath);
|
|
17038
|
-
if (!
|
|
17095
|
+
if (!existsSync27(resolvedPath) || resolvedPath.endsWith(".d.ts"))
|
|
17039
17096
|
return;
|
|
17040
17097
|
stats.filesVisited += 1;
|
|
17041
17098
|
const source = await readFileForAotTransform(resolvedPath, readFile9);
|
|
@@ -17209,7 +17266,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17209
17266
|
return null;
|
|
17210
17267
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
17211
17268
|
const sourceEntry = resolve29(import.meta.dir, "../angular/components/index.ts");
|
|
17212
|
-
if (
|
|
17269
|
+
if (existsSync27(sourceEntry)) {
|
|
17213
17270
|
return sourceEntry.replace(/\\/g, "/");
|
|
17214
17271
|
}
|
|
17215
17272
|
return "@absolutejs/absolute/angular/components";
|
|
@@ -17337,7 +17394,7 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
|
|
|
17337
17394
|
${fields}
|
|
17338
17395
|
`);
|
|
17339
17396
|
}, readAndEscapeFile = async (filePath, stylePreprocessors) => {
|
|
17340
|
-
if (!
|
|
17397
|
+
if (!existsSync27(filePath)) {
|
|
17341
17398
|
throw new Error(`Unable to inline Angular style resource: file not found at ${filePath}`);
|
|
17342
17399
|
}
|
|
17343
17400
|
const content = await compileStyleFileIfNeeded(filePath, stylePreprocessors);
|
|
@@ -17346,7 +17403,7 @@ ${fields}
|
|
|
17346
17403
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
17347
17404
|
if (templateUrlMatch?.[1]) {
|
|
17348
17405
|
const templatePath = join38(fileDir, templateUrlMatch[1]);
|
|
17349
|
-
if (!
|
|
17406
|
+
if (!existsSync27(templatePath)) {
|
|
17350
17407
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
17351
17408
|
}
|
|
17352
17409
|
const templateRaw2 = await fs5.readFile(templatePath, "utf-8");
|
|
@@ -17377,7 +17434,7 @@ ${fields}
|
|
|
17377
17434
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
17378
17435
|
if (templateUrlMatch?.[1]) {
|
|
17379
17436
|
const templatePath = join38(fileDir, templateUrlMatch[1]);
|
|
17380
|
-
if (!
|
|
17437
|
+
if (!existsSync27(templatePath)) {
|
|
17381
17438
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
17382
17439
|
}
|
|
17383
17440
|
const templateRaw2 = readFileSync25(templatePath, "utf-8");
|
|
@@ -17525,7 +17582,7 @@ ${fields}
|
|
|
17525
17582
|
join38(candidate, "index.js"),
|
|
17526
17583
|
join38(candidate, "index.jsx")
|
|
17527
17584
|
];
|
|
17528
|
-
return candidates.find((file4) =>
|
|
17585
|
+
return candidates.find((file4) => existsSync27(file4));
|
|
17529
17586
|
};
|
|
17530
17587
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
17531
17588
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
@@ -17600,7 +17657,7 @@ ${fields}
|
|
|
17600
17657
|
if (visited.has(resolved))
|
|
17601
17658
|
return;
|
|
17602
17659
|
visited.add(resolved);
|
|
17603
|
-
if (resolved.endsWith(".json") &&
|
|
17660
|
+
if (resolved.endsWith(".json") && existsSync27(resolved)) {
|
|
17604
17661
|
const inputDir2 = dirname21(resolved);
|
|
17605
17662
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
17606
17663
|
const targetDir2 = join38(outDir, relativeDir2);
|
|
@@ -17613,7 +17670,7 @@ ${fields}
|
|
|
17613
17670
|
let actualPath = resolved;
|
|
17614
17671
|
if (!actualPath.endsWith(".ts"))
|
|
17615
17672
|
actualPath += ".ts";
|
|
17616
|
-
if (!
|
|
17673
|
+
if (!existsSync27(actualPath))
|
|
17617
17674
|
return;
|
|
17618
17675
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
17619
17676
|
const inlined = await inlineResources(sourceCode, dirname21(actualPath), stylePreprocessors);
|
|
@@ -17651,7 +17708,7 @@ ${fields}
|
|
|
17651
17708
|
const isEntry = resolve29(actualPath) === resolve29(entryPath);
|
|
17652
17709
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
17653
17710
|
const cacheKey2 = actualPath;
|
|
17654
|
-
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !
|
|
17711
|
+
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync27(targetPath);
|
|
17655
17712
|
if (shouldWriteFile) {
|
|
17656
17713
|
const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
|
|
17657
17714
|
const preservedInjection = await readPreservedInjection(targetPath);
|
|
@@ -17664,7 +17721,7 @@ ${fields}
|
|
|
17664
17721
|
};
|
|
17665
17722
|
await transpileFile(inputPath);
|
|
17666
17723
|
const entryOutputPath = toOutputPath(entryPath);
|
|
17667
|
-
if (
|
|
17724
|
+
if (existsSync27(entryOutputPath)) {
|
|
17668
17725
|
const entryOutput = await fs5.readFile(entryOutputPath, "utf-8");
|
|
17669
17726
|
const withoutLegacyFlag = entryOutput.replace(/\nexport const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;\n?/g, `
|
|
17670
17727
|
`);
|
|
@@ -17690,7 +17747,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17690
17747
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
17691
17748
|
const cwd = process.cwd();
|
|
17692
17749
|
const angularSrcDir = resolve29(outRoot);
|
|
17693
|
-
if (!
|
|
17750
|
+
if (!existsSync27(angularSrcDir))
|
|
17694
17751
|
return;
|
|
17695
17752
|
const jsonGlob = new Glob6("**/*.json");
|
|
17696
17753
|
for (const rel of jsonGlob.scanSync({
|
|
@@ -17725,15 +17782,15 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17725
17782
|
...candidatePaths.map((file4) => resolve29(file4)),
|
|
17726
17783
|
...compiledFallbackPaths
|
|
17727
17784
|
];
|
|
17728
|
-
let candidate = normalizedCandidates.find((file4) =>
|
|
17785
|
+
let candidate = normalizedCandidates.find((file4) => existsSync27(file4) && file4.endsWith(`${sep3}${relativeEntry}`));
|
|
17729
17786
|
if (!candidate) {
|
|
17730
|
-
candidate = normalizedCandidates.find((file4) =>
|
|
17787
|
+
candidate = normalizedCandidates.find((file4) => existsSync27(file4) && file4.endsWith(`${sep3}pages${sep3}${jsName}`));
|
|
17731
17788
|
}
|
|
17732
17789
|
if (!candidate) {
|
|
17733
|
-
candidate = normalizedCandidates.find((file4) =>
|
|
17790
|
+
candidate = normalizedCandidates.find((file4) => existsSync27(file4) && file4.endsWith(`${sep3}${jsName}`));
|
|
17734
17791
|
}
|
|
17735
17792
|
if (!candidate) {
|
|
17736
|
-
candidate = normalizedCandidates.find((file4) =>
|
|
17793
|
+
candidate = normalizedCandidates.find((file4) => existsSync27(file4));
|
|
17737
17794
|
}
|
|
17738
17795
|
return candidate;
|
|
17739
17796
|
};
|
|
@@ -17741,11 +17798,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17741
17798
|
if (!rawServerFile) {
|
|
17742
17799
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-fallback", () => resolveRawServerFile([]), { entry: resolvedEntry });
|
|
17743
17800
|
}
|
|
17744
|
-
if (rawServerFile && !
|
|
17801
|
+
if (rawServerFile && !existsSync27(rawServerFile)) {
|
|
17745
17802
|
outputs = hmr ? await compileEntry() : aotOutputs;
|
|
17746
17803
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-retry", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
|
|
17747
17804
|
}
|
|
17748
|
-
if (!rawServerFile || !
|
|
17805
|
+
if (!rawServerFile || !existsSync27(rawServerFile)) {
|
|
17749
17806
|
throw new Error(`Compiled output not found for ${entry}. Looking for: ${jsName}. Available: ${[
|
|
17750
17807
|
...outputs,
|
|
17751
17808
|
...compiledFallbackPaths
|
|
@@ -17781,7 +17838,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17781
17838
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
17782
17839
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
17783
17840
|
const clientFile = join38(indexesDir, jsName);
|
|
17784
|
-
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash &&
|
|
17841
|
+
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync27(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
17785
17842
|
return {
|
|
17786
17843
|
clientPath: clientFile,
|
|
17787
17844
|
indexUnchanged: true,
|
|
@@ -18786,7 +18843,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
18786
18843
|
takePendingModule: () => takePendingModule,
|
|
18787
18844
|
tryFastHmr: () => tryFastHmr
|
|
18788
18845
|
});
|
|
18789
|
-
import { existsSync as
|
|
18846
|
+
import { existsSync as existsSync28, readFileSync as readFileSync26, statSync as statSync2 } from "fs";
|
|
18790
18847
|
import { dirname as dirname22, extname as extname9, relative as relative15, resolve as resolve30 } from "path";
|
|
18791
18848
|
import ts18 from "typescript";
|
|
18792
18849
|
var fail = (reason, detail, location) => ({
|
|
@@ -19110,7 +19167,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19110
19167
|
`${base}/index.tsx`
|
|
19111
19168
|
];
|
|
19112
19169
|
for (const candidate of candidates) {
|
|
19113
|
-
if (!
|
|
19170
|
+
if (!existsSync28(candidate))
|
|
19114
19171
|
continue;
|
|
19115
19172
|
let content;
|
|
19116
19173
|
try {
|
|
@@ -19875,7 +19932,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19875
19932
|
if (visited.has(startDtsPath))
|
|
19876
19933
|
return null;
|
|
19877
19934
|
visited.add(startDtsPath);
|
|
19878
|
-
if (!
|
|
19935
|
+
if (!existsSync28(startDtsPath))
|
|
19879
19936
|
return null;
|
|
19880
19937
|
let content;
|
|
19881
19938
|
try {
|
|
@@ -19928,16 +19985,16 @@ var fail = (reason, detail, location) => ({
|
|
|
19928
19985
|
`${base}/index.d.cts`
|
|
19929
19986
|
];
|
|
19930
19987
|
for (const c of candidates) {
|
|
19931
|
-
if (
|
|
19988
|
+
if (existsSync28(c))
|
|
19932
19989
|
return c;
|
|
19933
19990
|
}
|
|
19934
19991
|
return null;
|
|
19935
19992
|
}, findPackageDtsForJs = (jsPath) => {
|
|
19936
19993
|
const sibling = jsPath.replace(/\.[mc]?js$/, ".d.ts");
|
|
19937
|
-
if (
|
|
19994
|
+
if (existsSync28(sibling))
|
|
19938
19995
|
return sibling;
|
|
19939
19996
|
const mirror = jsPath.replace(/\/dist\//, "/dist/src/").replace(/\.[mc]?js$/, ".d.ts");
|
|
19940
|
-
if (
|
|
19997
|
+
if (existsSync28(mirror))
|
|
19941
19998
|
return mirror;
|
|
19942
19999
|
return null;
|
|
19943
20000
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
@@ -19950,7 +20007,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19950
20007
|
`${base}/index.tsx`
|
|
19951
20008
|
];
|
|
19952
20009
|
for (const candidate of candidates) {
|
|
19953
|
-
if (!
|
|
20010
|
+
if (!existsSync28(candidate))
|
|
19954
20011
|
continue;
|
|
19955
20012
|
const info = getChildComponentInfoFromTsSource(candidate, className);
|
|
19956
20013
|
if (info)
|
|
@@ -20164,11 +20221,11 @@ var fail = (reason, detail, location) => ({
|
|
|
20164
20221
|
const resolved = resolve30(componentDir, spec);
|
|
20165
20222
|
for (const ext of TS_EXTENSIONS) {
|
|
20166
20223
|
const candidate = resolved + ext;
|
|
20167
|
-
if (
|
|
20224
|
+
if (existsSync28(candidate))
|
|
20168
20225
|
return candidate;
|
|
20169
20226
|
}
|
|
20170
20227
|
const indexCandidate = resolve30(resolved, "index.ts");
|
|
20171
|
-
if (
|
|
20228
|
+
if (existsSync28(indexCandidate))
|
|
20172
20229
|
return indexCandidate;
|
|
20173
20230
|
}
|
|
20174
20231
|
return null;
|
|
@@ -20406,7 +20463,7 @@ ${transpiled}
|
|
|
20406
20463
|
}${staticPatch}`;
|
|
20407
20464
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
20408
20465
|
const abs = resolve30(componentDir, url);
|
|
20409
|
-
if (!
|
|
20466
|
+
if (!existsSync28(abs))
|
|
20410
20467
|
return null;
|
|
20411
20468
|
const ext = extname9(abs).toLowerCase();
|
|
20412
20469
|
if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
|
|
@@ -20446,7 +20503,7 @@ ${block}
|
|
|
20446
20503
|
return cached;
|
|
20447
20504
|
const tsconfigPath = resolve30(projectRoot, "tsconfig.json");
|
|
20448
20505
|
const opts = {};
|
|
20449
|
-
if (
|
|
20506
|
+
if (existsSync28(tsconfigPath)) {
|
|
20450
20507
|
try {
|
|
20451
20508
|
const text2 = readFileSync26(tsconfigPath, "utf8");
|
|
20452
20509
|
const parsed = ts18.parseConfigFileTextToJson(tsconfigPath, text2);
|
|
@@ -20473,7 +20530,7 @@ ${block}
|
|
|
20473
20530
|
}, tryFastHmr = async (params) => {
|
|
20474
20531
|
const { componentFilePath, className } = params;
|
|
20475
20532
|
const projectRoot = params.projectRoot ?? process.cwd();
|
|
20476
|
-
if (!
|
|
20533
|
+
if (!existsSync28(componentFilePath)) {
|
|
20477
20534
|
return fail("file-not-found", componentFilePath);
|
|
20478
20535
|
}
|
|
20479
20536
|
let compiler;
|
|
@@ -20529,7 +20586,7 @@ ${block}
|
|
|
20529
20586
|
templatePath = componentFilePath;
|
|
20530
20587
|
} else if (decoratorMeta.templateUrl) {
|
|
20531
20588
|
const tplAbs = resolve30(componentDir, decoratorMeta.templateUrl);
|
|
20532
|
-
if (!
|
|
20589
|
+
if (!existsSync28(tplAbs)) {
|
|
20533
20590
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
20534
20591
|
}
|
|
20535
20592
|
templateText = readFileSync26(tplAbs, "utf8");
|
|
@@ -21298,7 +21355,7 @@ __export(exports_compileEmber, {
|
|
|
21298
21355
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
21299
21356
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir
|
|
21300
21357
|
});
|
|
21301
|
-
import { existsSync as
|
|
21358
|
+
import { existsSync as existsSync29 } from "fs";
|
|
21302
21359
|
import { mkdir as mkdir11, rm as rm8 } from "fs/promises";
|
|
21303
21360
|
import { basename as basename13, dirname as dirname23, extname as extname10, join as join39, resolve as resolve31 } from "path";
|
|
21304
21361
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file4 } = globalThis.Bun;
|
|
@@ -21400,7 +21457,7 @@ export const importSync = (specifier) => {
|
|
|
21400
21457
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
21401
21458
|
for (const ext of extensionsToTry) {
|
|
21402
21459
|
const candidate = candidateBase + ext;
|
|
21403
|
-
if (
|
|
21460
|
+
if (existsSync29(candidate))
|
|
21404
21461
|
return { path: candidate };
|
|
21405
21462
|
}
|
|
21406
21463
|
return;
|
|
@@ -21420,7 +21477,7 @@ export const importSync = (specifier) => {
|
|
|
21420
21477
|
if (standalonePackages.has(args.path))
|
|
21421
21478
|
return;
|
|
21422
21479
|
const internal = join39(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
21423
|
-
if (
|
|
21480
|
+
if (existsSync29(internal))
|
|
21424
21481
|
return { path: internal };
|
|
21425
21482
|
return;
|
|
21426
21483
|
});
|
|
@@ -21550,7 +21607,7 @@ __export(exports_buildReactVendor, {
|
|
|
21550
21607
|
buildReactVendor: () => buildReactVendor,
|
|
21551
21608
|
computeVendorPaths: () => computeVendorPaths
|
|
21552
21609
|
});
|
|
21553
|
-
import { existsSync as
|
|
21610
|
+
import { existsSync as existsSync30, mkdirSync as mkdirSync8 } from "fs";
|
|
21554
21611
|
import { join as join40, resolve as resolve32 } from "path";
|
|
21555
21612
|
import { rm as rm9 } from "fs/promises";
|
|
21556
21613
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
@@ -21564,7 +21621,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
21564
21621
|
resolve32(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
21565
21622
|
];
|
|
21566
21623
|
for (const candidate of candidates) {
|
|
21567
|
-
if (
|
|
21624
|
+
if (existsSync30(candidate)) {
|
|
21568
21625
|
return candidate.replace(/\\/g, "/");
|
|
21569
21626
|
}
|
|
21570
21627
|
}
|
|
@@ -22031,7 +22088,7 @@ var init_buildSvelteVendor = __esm(() => {
|
|
|
22031
22088
|
import {
|
|
22032
22089
|
copyFileSync as copyFileSync2,
|
|
22033
22090
|
cpSync,
|
|
22034
|
-
existsSync as
|
|
22091
|
+
existsSync as existsSync31,
|
|
22035
22092
|
mkdirSync as mkdirSync12,
|
|
22036
22093
|
readdirSync as readdirSync5,
|
|
22037
22094
|
readFileSync as readFileSync27,
|
|
@@ -22264,7 +22321,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22264
22321
|
copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
|
|
22265
22322
|
}
|
|
22266
22323
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
22267
|
-
if (!
|
|
22324
|
+
if (!existsSync31(reactIndexesPath)) {
|
|
22268
22325
|
return;
|
|
22269
22326
|
}
|
|
22270
22327
|
const indexFiles = readDir(reactIndexesPath).filter((file5) => file5.endsWith(".tsx"));
|
|
@@ -22280,7 +22337,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22280
22337
|
for (const entry of sveltePageEntries) {
|
|
22281
22338
|
const name = basename14(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
22282
22339
|
const indexFile = join44(svelteIndexDir, "pages", `${name}.js`);
|
|
22283
|
-
if (!
|
|
22340
|
+
if (!existsSync31(indexFile))
|
|
22284
22341
|
continue;
|
|
22285
22342
|
let content = readFileSync27(indexFile, "utf-8");
|
|
22286
22343
|
const srcRel = relative16(process.cwd(), resolve33(entry)).replace(/\\/g, "/");
|
|
@@ -22293,7 +22350,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22293
22350
|
for (const entry of vuePageEntries) {
|
|
22294
22351
|
const name = basename14(entry, ".vue");
|
|
22295
22352
|
const indexFile = join44(vueIndexDir, `${name}.js`);
|
|
22296
|
-
if (!
|
|
22353
|
+
if (!existsSync31(indexFile))
|
|
22297
22354
|
continue;
|
|
22298
22355
|
let content = readFileSync27(indexFile, "utf-8");
|
|
22299
22356
|
const srcRel = relative16(process.cwd(), resolve33(entry)).replace(/\\/g, "/");
|
|
@@ -23537,7 +23594,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23537
23594
|
}
|
|
23538
23595
|
if (!hmr) {
|
|
23539
23596
|
const reactVendorDir = join44(buildPath, "react", "vendor");
|
|
23540
|
-
const vendorChunkPaths =
|
|
23597
|
+
const vendorChunkPaths = existsSync31(reactVendorDir) ? [
|
|
23541
23598
|
...new Glob8("**/*.js").scanSync({
|
|
23542
23599
|
absolute: true,
|
|
23543
23600
|
cwd: reactVendorDir
|
|
@@ -23963,7 +24020,7 @@ var init_build = __esm(() => {
|
|
|
23963
24020
|
});
|
|
23964
24021
|
|
|
23965
24022
|
// src/build/buildEmberVendor.ts
|
|
23966
|
-
import { mkdirSync as mkdirSync13, existsSync as
|
|
24023
|
+
import { mkdirSync as mkdirSync13, existsSync as existsSync32 } from "fs";
|
|
23967
24024
|
import { join as join45 } from "path";
|
|
23968
24025
|
import { rm as rm13 } from "fs/promises";
|
|
23969
24026
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
@@ -24017,7 +24074,7 @@ export const importSync = (specifier) => {
|
|
|
24017
24074
|
return { resolveTo: specifier, specifier };
|
|
24018
24075
|
}
|
|
24019
24076
|
const emberInternalPath = join45(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
24020
|
-
if (!
|
|
24077
|
+
if (!existsSync32(emberInternalPath)) {
|
|
24021
24078
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
24022
24079
|
}
|
|
24023
24080
|
return { resolveTo: emberInternalPath, specifier };
|
|
@@ -24049,7 +24106,7 @@ export const importSync = (specifier) => {
|
|
|
24049
24106
|
return;
|
|
24050
24107
|
}
|
|
24051
24108
|
const internal = join45(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
24052
|
-
if (
|
|
24109
|
+
if (existsSync32(internal)) {
|
|
24053
24110
|
return { path: internal };
|
|
24054
24111
|
}
|
|
24055
24112
|
return;
|
|
@@ -24221,7 +24278,7 @@ __export(exports_dependencyGraph, {
|
|
|
24221
24278
|
getAffectedFiles: () => getAffectedFiles,
|
|
24222
24279
|
removeFileFromGraph: () => removeFileFromGraph
|
|
24223
24280
|
});
|
|
24224
|
-
import { existsSync as
|
|
24281
|
+
import { existsSync as existsSync33, readFileSync as readFileSync28 } from "fs";
|
|
24225
24282
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
24226
24283
|
import { resolve as resolve34 } from "path";
|
|
24227
24284
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
@@ -24251,10 +24308,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
24251
24308
|
];
|
|
24252
24309
|
for (const ext of extensions) {
|
|
24253
24310
|
const withExt = normalized + ext;
|
|
24254
|
-
if (
|
|
24311
|
+
if (existsSync33(withExt))
|
|
24255
24312
|
return withExt;
|
|
24256
24313
|
}
|
|
24257
|
-
if (
|
|
24314
|
+
if (existsSync33(normalized))
|
|
24258
24315
|
return normalized;
|
|
24259
24316
|
return null;
|
|
24260
24317
|
}, clearExistingDependents = (graph, normalizedPath) => {
|
|
@@ -24269,7 +24326,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
24269
24326
|
}
|
|
24270
24327
|
}, addFileToGraph = (graph, filePath) => {
|
|
24271
24328
|
const normalizedPath = resolve34(filePath);
|
|
24272
|
-
if (!
|
|
24329
|
+
if (!existsSync33(normalizedPath))
|
|
24273
24330
|
return;
|
|
24274
24331
|
const dependencies = extractDependencies(normalizedPath);
|
|
24275
24332
|
clearExistingDependents(graph, normalizedPath);
|
|
@@ -24295,7 +24352,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
24295
24352
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
24296
24353
|
const processedFiles = new Set;
|
|
24297
24354
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
24298
|
-
const resolvedDirs = directories.map((dir) => resolve34(dir)).filter((dir) =>
|
|
24355
|
+
const resolvedDirs = directories.map((dir) => resolve34(dir)).filter((dir) => existsSync33(dir));
|
|
24299
24356
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
24300
24357
|
for (const file5 of allFiles) {
|
|
24301
24358
|
const fullPath = resolve34(file5);
|
|
@@ -24549,7 +24606,7 @@ var init_clientManager = __esm(() => {
|
|
|
24549
24606
|
});
|
|
24550
24607
|
|
|
24551
24608
|
// src/dev/pathUtils.ts
|
|
24552
|
-
import { existsSync as
|
|
24609
|
+
import { existsSync as existsSync34, readdirSync as readdirSync6, readFileSync as readFileSync29 } from "fs";
|
|
24553
24610
|
import { dirname as dirname25, resolve as resolve36 } from "path";
|
|
24554
24611
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
24555
24612
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
@@ -24723,7 +24780,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
24723
24780
|
push(cfg.stylesDir);
|
|
24724
24781
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
24725
24782
|
const abs = normalizePath2(resolve36(cwd2, candidate));
|
|
24726
|
-
if (
|
|
24783
|
+
if (existsSync34(abs) && !roots.includes(abs))
|
|
24727
24784
|
roots.push(abs);
|
|
24728
24785
|
}
|
|
24729
24786
|
try {
|
|
@@ -24816,7 +24873,7 @@ var init_pathUtils = __esm(() => {
|
|
|
24816
24873
|
|
|
24817
24874
|
// src/dev/fileWatcher.ts
|
|
24818
24875
|
import { watch } from "fs";
|
|
24819
|
-
import { existsSync as
|
|
24876
|
+
import { existsSync as existsSync35, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
|
|
24820
24877
|
import { dirname as dirname26, join as join46, resolve as resolve37 } from "path";
|
|
24821
24878
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
24822
24879
|
try {
|
|
@@ -24883,12 +24940,12 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24883
24940
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
24884
24941
|
return;
|
|
24885
24942
|
}
|
|
24886
|
-
if (event === "rename" && !
|
|
24943
|
+
if (event === "rename" && !existsSync35(fullPath)) {
|
|
24887
24944
|
safeRemoveFromGraph(state.dependencyGraph, fullPath);
|
|
24888
24945
|
onFileChange(fullPath);
|
|
24889
24946
|
return;
|
|
24890
24947
|
}
|
|
24891
|
-
if (
|
|
24948
|
+
if (existsSync35(fullPath)) {
|
|
24892
24949
|
onFileChange(fullPath);
|
|
24893
24950
|
safeAddToGraph(state.dependencyGraph, fullPath);
|
|
24894
24951
|
}
|
|
@@ -24898,7 +24955,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24898
24955
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
24899
24956
|
paths.forEach((path) => {
|
|
24900
24957
|
const absolutePath = resolve37(path).replace(/\\/g, "/");
|
|
24901
|
-
if (!
|
|
24958
|
+
if (!existsSync35(absolutePath)) {
|
|
24902
24959
|
return;
|
|
24903
24960
|
}
|
|
24904
24961
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -24909,7 +24966,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24909
24966
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
24910
24967
|
watchPaths.forEach((path) => {
|
|
24911
24968
|
const absolutePath = resolve37(path).replace(/\\/g, "/");
|
|
24912
|
-
if (!
|
|
24969
|
+
if (!existsSync35(absolutePath)) {
|
|
24913
24970
|
return;
|
|
24914
24971
|
}
|
|
24915
24972
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -25848,7 +25905,7 @@ __export(exports_moduleServer, {
|
|
|
25848
25905
|
warmCompilers: () => warmCompilers,
|
|
25849
25906
|
warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
|
|
25850
25907
|
});
|
|
25851
|
-
import { existsSync as
|
|
25908
|
+
import { existsSync as existsSync36, readFileSync as readFileSync32, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
|
|
25852
25909
|
import { basename as basename16, dirname as dirname29, extname as extname13, join as join48, resolve as resolve43, relative as relative17 } from "path";
|
|
25853
25910
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
25854
25911
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
@@ -25869,10 +25926,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
|
|
|
25869
25926
|
${stubs}
|
|
25870
25927
|
`;
|
|
25871
25928
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
25872
|
-
const directHit = extensions.find((ext) =>
|
|
25929
|
+
const directHit = extensions.find((ext) => existsSync36(resolve43(projectRoot, srcPath + ext)));
|
|
25873
25930
|
if (directHit)
|
|
25874
25931
|
return srcPath + directHit;
|
|
25875
|
-
const indexHit = extensions.find((ext) =>
|
|
25932
|
+
const indexHit = extensions.find((ext) => existsSync36(resolve43(projectRoot, srcPath, `index${ext}`)));
|
|
25876
25933
|
if (indexHit)
|
|
25877
25934
|
return `${srcPath}/index${indexHit}`;
|
|
25878
25935
|
return srcPath;
|
|
@@ -25933,12 +25990,12 @@ ${stubs}
|
|
|
25933
25990
|
if (!subpath) {
|
|
25934
25991
|
const pkgDir = resolve43(projectRoot, "node_modules", packageName ?? "");
|
|
25935
25992
|
const pkgJsonPath = join48(pkgDir, "package.json");
|
|
25936
|
-
if (
|
|
25993
|
+
if (existsSync36(pkgJsonPath)) {
|
|
25937
25994
|
const pkg = JSON.parse(readFileSync32(pkgJsonPath, "utf-8"));
|
|
25938
25995
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
25939
25996
|
if (esmEntry) {
|
|
25940
25997
|
const resolved = resolve43(pkgDir, esmEntry);
|
|
25941
|
-
if (
|
|
25998
|
+
if (existsSync36(resolved))
|
|
25942
25999
|
return relative17(projectRoot, resolved);
|
|
25943
26000
|
}
|
|
25944
26001
|
}
|
|
@@ -26300,9 +26357,9 @@ ${code}`;
|
|
|
26300
26357
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
26301
26358
|
const compiledScript = hasScript ? vueCompiler.compileScript(descriptor, {
|
|
26302
26359
|
fs: {
|
|
26303
|
-
fileExists:
|
|
26360
|
+
fileExists: existsSync36,
|
|
26304
26361
|
realpath: realpathSync3,
|
|
26305
|
-
readFile: (file5) =>
|
|
26362
|
+
readFile: (file5) => existsSync36(file5) ? readFileSync32(file5, "utf-8") : undefined
|
|
26306
26363
|
},
|
|
26307
26364
|
id: componentId,
|
|
26308
26365
|
inlineTemplate: false
|
|
@@ -26332,11 +26389,11 @@ ${code}`;
|
|
|
26332
26389
|
`);
|
|
26333
26390
|
return result;
|
|
26334
26391
|
}, resolveSvelteModulePath = (path) => {
|
|
26335
|
-
if (
|
|
26392
|
+
if (existsSync36(path))
|
|
26336
26393
|
return path;
|
|
26337
|
-
if (
|
|
26394
|
+
if (existsSync36(`${path}.ts`))
|
|
26338
26395
|
return `${path}.ts`;
|
|
26339
|
-
if (
|
|
26396
|
+
if (existsSync36(`${path}.js`))
|
|
26340
26397
|
return `${path}.js`;
|
|
26341
26398
|
return path;
|
|
26342
26399
|
}, jsResponse = (body) => {
|
|
@@ -26487,7 +26544,7 @@ export default {};
|
|
|
26487
26544
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
26488
26545
|
if (ext)
|
|
26489
26546
|
return { ext, filePath };
|
|
26490
|
-
const found = MODULE_EXTENSIONS.find((candidate) =>
|
|
26547
|
+
const found = MODULE_EXTENSIONS.find((candidate) => existsSync36(filePath + candidate));
|
|
26491
26548
|
if (!found)
|
|
26492
26549
|
return { ext, filePath };
|
|
26493
26550
|
const resolved = filePath + found;
|
|
@@ -27035,7 +27092,7 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
27035
27092
|
var init_simpleHTMXHMR = () => {};
|
|
27036
27093
|
|
|
27037
27094
|
// src/dev/rebuildTrigger.ts
|
|
27038
|
-
import { existsSync as
|
|
27095
|
+
import { existsSync as existsSync37, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
27039
27096
|
import {
|
|
27040
27097
|
basename as basename17,
|
|
27041
27098
|
dirname as dirname31,
|
|
@@ -27149,7 +27206,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27149
27206
|
detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
|
|
27150
27207
|
}
|
|
27151
27208
|
return { ...parsed, framework: detectedFw };
|
|
27152
|
-
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) &&
|
|
27209
|
+
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync37(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
27153
27210
|
const { config } = state;
|
|
27154
27211
|
const cwd2 = process.cwd();
|
|
27155
27212
|
const absDeleted = resolvePath3(deletedFile).replace(/\\/g, "/");
|
|
@@ -27195,7 +27252,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27195
27252
|
if (!dependents || dependents.size === 0) {
|
|
27196
27253
|
return;
|
|
27197
27254
|
}
|
|
27198
|
-
const dependentFiles = Array.from(dependents).filter((file5) =>
|
|
27255
|
+
const dependentFiles = Array.from(dependents).filter((file5) => existsSync37(file5));
|
|
27199
27256
|
if (dependentFiles.length === 0) {
|
|
27200
27257
|
return;
|
|
27201
27258
|
}
|
|
@@ -27211,7 +27268,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27211
27268
|
try {
|
|
27212
27269
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
|
|
27213
27270
|
affectedFiles.forEach((affectedFile) => {
|
|
27214
|
-
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath &&
|
|
27271
|
+
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync37(affectedFile)) {
|
|
27215
27272
|
validFiles.push(affectedFile);
|
|
27216
27273
|
processedFiles.add(affectedFile);
|
|
27217
27274
|
}
|
|
@@ -27236,7 +27293,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27236
27293
|
collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
|
|
27237
27294
|
}, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
|
|
27238
27295
|
filePathSet.forEach((filePathInSet) => {
|
|
27239
|
-
if (!
|
|
27296
|
+
if (!existsSync37(filePathInSet)) {
|
|
27240
27297
|
collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
|
|
27241
27298
|
return;
|
|
27242
27299
|
}
|
|
@@ -27501,7 +27558,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27501
27558
|
return componentFile;
|
|
27502
27559
|
}
|
|
27503
27560
|
const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
|
|
27504
|
-
if (
|
|
27561
|
+
if (existsSync37(tsCounterpart)) {
|
|
27505
27562
|
return tsCounterpart;
|
|
27506
27563
|
}
|
|
27507
27564
|
if (!graph)
|
|
@@ -28371,7 +28428,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28371
28428
|
}
|
|
28372
28429
|
return ctx;
|
|
28373
28430
|
}, runSvelteBundleRebuild = async (state, svelteFiles, config) => {
|
|
28374
|
-
const existingSvelteFiles = svelteFiles.filter((file5) =>
|
|
28431
|
+
const existingSvelteFiles = svelteFiles.filter((file5) => existsSync37(file5));
|
|
28375
28432
|
if (existingSvelteFiles.length === 0)
|
|
28376
28433
|
return;
|
|
28377
28434
|
const svelteDir = config.svelteDirectory ?? "";
|
|
@@ -30726,14 +30783,14 @@ __export(exports_devtoolsJson, {
|
|
|
30726
30783
|
normalizeDevtoolsWorkspaceRoot: () => normalizeDevtoolsWorkspaceRoot,
|
|
30727
30784
|
resolveDevtoolsUuidCachePath: () => resolveDevtoolsUuidCachePath
|
|
30728
30785
|
});
|
|
30729
|
-
import { existsSync as
|
|
30786
|
+
import { existsSync as existsSync38, mkdirSync as mkdirSync15, readFileSync as readFileSync33, writeFileSync as writeFileSync10 } from "fs";
|
|
30730
30787
|
import { dirname as dirname32, join as join51, resolve as resolve48 } from "path";
|
|
30731
30788
|
import { Elysia as Elysia7 } from "elysia";
|
|
30732
30789
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
30733
30790
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
30734
30791
|
return uuid;
|
|
30735
30792
|
}, 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) => resolve48(uuidCachePath ?? join51(buildDir, ".absolute", "chrome-devtools-workspace-uuid")), readCachedUuid = (cachePath) => {
|
|
30736
|
-
if (!
|
|
30793
|
+
if (!existsSync38(cachePath))
|
|
30737
30794
|
return null;
|
|
30738
30795
|
try {
|
|
30739
30796
|
const value = readFileSync33(cachePath, "utf-8").trim();
|
|
@@ -30786,13 +30843,13 @@ var exports_imageOptimizer = {};
|
|
|
30786
30843
|
__export(exports_imageOptimizer, {
|
|
30787
30844
|
imageOptimizer: () => imageOptimizer
|
|
30788
30845
|
});
|
|
30789
|
-
import { existsSync as
|
|
30846
|
+
import { existsSync as existsSync39 } from "fs";
|
|
30790
30847
|
import { resolve as resolve49 } from "path";
|
|
30791
30848
|
import { Elysia as Elysia8 } from "elysia";
|
|
30792
30849
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
30793
30850
|
try {
|
|
30794
30851
|
const resolved = validateSafePath(path, baseDir);
|
|
30795
|
-
if (
|
|
30852
|
+
if (existsSync39(resolved))
|
|
30796
30853
|
return resolved;
|
|
30797
30854
|
return null;
|
|
30798
30855
|
} catch {
|
|
@@ -31123,6 +31180,7 @@ import { join as join53 } from "path";
|
|
|
31123
31180
|
import { tmpdir } from "os";
|
|
31124
31181
|
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") => {
|
|
31125
31182
|
if ((mobile.engine ?? "capacitor") === "expo") {
|
|
31183
|
+
const plan2 = resolveAbsoluteDeviceCapabilityPlan(projectRoot, "expo");
|
|
31126
31184
|
const normalized = normalizeAbsoluteMobileConfig(mobile, projectRoot);
|
|
31127
31185
|
const auth = projectUsesAbsoluteAuth(projectRoot) ? resolveAbsoluteMobileAuthManifest(projectRoot, normalized) : undefined;
|
|
31128
31186
|
const sync = Boolean(auth && projectUsesAbsoluteSync(projectRoot));
|
|
@@ -31137,10 +31195,10 @@ var absoluteNativeDevAdapterSource = (projectRoot, mobile, resolveModule = (spec
|
|
|
31137
31195
|
return `import { installAbsoluteExpoWebDeviceAdapter } from ${JSON.stringify(expoAdapterModule)};
|
|
31138
31196
|
${auth ? `import { createAbsoluteExpoShellAuth } from ${JSON.stringify(expoAuthModule)};` : ""}
|
|
31139
31197
|
${sync ? `import { installAbsoluteExpoShellSync } from ${JSON.stringify(expoSyncModule)};` : ""}
|
|
31140
|
-
installAbsoluteExpoWebDeviceAdapter();
|
|
31198
|
+
installAbsoluteExpoWebDeviceAdapter(${JSON.stringify(plan2.capabilities)});
|
|
31141
31199
|
${auth ? `void createAbsoluteExpoShellAuth(${JSON.stringify(auth)}).then(auth => { ${sync ? `installAbsoluteExpoShellSync(auth, ${JSON.stringify(syncConfig)});` : ""} }).catch(error => console.error('[Absolute Mobile] Expo runtime initialization failed:', error));` : ""}`;
|
|
31142
31200
|
}
|
|
31143
|
-
const plan = resolveAbsoluteDeviceCapabilityPlan(projectRoot);
|
|
31201
|
+
const plan = resolveAbsoluteDeviceCapabilityPlan(projectRoot, "capacitor");
|
|
31144
31202
|
const imports = plan.capabilities.map((name, index) => {
|
|
31145
31203
|
const provider = plan.providers[name];
|
|
31146
31204
|
if (!provider)
|
|
@@ -31458,7 +31516,7 @@ __export(exports_serverEntryWatcher, {
|
|
|
31458
31516
|
});
|
|
31459
31517
|
import {
|
|
31460
31518
|
copyFileSync as copyFileSync4,
|
|
31461
|
-
existsSync as
|
|
31519
|
+
existsSync as existsSync42,
|
|
31462
31520
|
readdirSync as readdirSync12,
|
|
31463
31521
|
readFileSync as readFileSync39,
|
|
31464
31522
|
statSync as statSync8,
|
|
@@ -31489,7 +31547,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
31489
31547
|
if (globalThis.__absoluteEntryWatcherStarted)
|
|
31490
31548
|
return;
|
|
31491
31549
|
const originalEntry = process.env.ABSOLUTE_SERVER_ENTRY ?? Bun.main;
|
|
31492
|
-
if (!originalEntry || !
|
|
31550
|
+
if (!originalEntry || !existsSync42(originalEntry))
|
|
31493
31551
|
return;
|
|
31494
31552
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
31495
31553
|
globalThis.__absoluteEntryWatcherReady = false;
|
|
@@ -32488,7 +32546,7 @@ var handleHTMXPageRequest = async (pagePath, options = {}) => {
|
|
|
32488
32546
|
};
|
|
32489
32547
|
// src/core/prepare.ts
|
|
32490
32548
|
import { createHash as createHash8 } from "crypto";
|
|
32491
|
-
import { existsSync as
|
|
32549
|
+
import { existsSync as existsSync40, readdirSync as readdirSync10, readFileSync as readFileSync36 } from "fs";
|
|
32492
32550
|
import { basename as basename18, join as join55, relative as relative20, resolve as resolvePath4 } from "path";
|
|
32493
32551
|
import { Elysia as Elysia10, NotFound } from "elysia";
|
|
32494
32552
|
|
|
@@ -33834,7 +33892,7 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
|
|
|
33834
33892
|
if (!fileName)
|
|
33835
33893
|
continue;
|
|
33836
33894
|
const srcPath = resolvePath4(devIndexDir, fileName);
|
|
33837
|
-
if (!
|
|
33895
|
+
if (!existsSync40(srcPath))
|
|
33838
33896
|
continue;
|
|
33839
33897
|
const rel = relative20(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
33840
33898
|
manifest[key] = `${SRC_URL_PREFIX2}${rel}`;
|
|
@@ -33852,7 +33910,7 @@ var registerIconVersioning = (buildDir) => {
|
|
|
33852
33910
|
const path = href.split("?")[0] ?? href;
|
|
33853
33911
|
const filePath = join55(buildDir, path);
|
|
33854
33912
|
let versioned = href;
|
|
33855
|
-
if (
|
|
33913
|
+
if (existsSync40(filePath)) {
|
|
33856
33914
|
const hash = createHash8("sha256").update(readFileSync36(filePath)).digest("hex").slice(0, ICON_HASH_LENGTH);
|
|
33857
33915
|
versioned = href.includes("?") ? `${href}&v=${hash}` : `${href}?v=${hash}`;
|
|
33858
33916
|
}
|
|
@@ -33976,7 +34034,7 @@ var prepareDev = async (config, buildDir) => {
|
|
|
33976
34034
|
};
|
|
33977
34035
|
var loadPrerenderMap = (prerenderDir) => {
|
|
33978
34036
|
const map = new Map;
|
|
33979
|
-
if (!
|
|
34037
|
+
if (!existsSync40(prerenderDir))
|
|
33980
34038
|
return map;
|
|
33981
34039
|
let entries;
|
|
33982
34040
|
try {
|
|
@@ -33995,7 +34053,7 @@ var loadPrerenderMap = (prerenderDir) => {
|
|
|
33995
34053
|
};
|
|
33996
34054
|
var loadMobileCompatibilityPlugin = async (buildDir) => {
|
|
33997
34055
|
const root = join55(buildDir, ".absolutejs", "mobile-compatibility");
|
|
33998
|
-
if (!
|
|
34056
|
+
if (!existsSync40(join55(root, "current.json"))) {
|
|
33999
34057
|
return new Elysia10({ name: "absolutejs-mobile-compatibility-empty" });
|
|
34000
34058
|
}
|
|
34001
34059
|
const options = await loadAbsoluteMobileMaterializedBundle(root);
|
|
@@ -34057,12 +34115,12 @@ var prepare = async (configOrPath) => {
|
|
|
34057
34115
|
recordStep("load production manifest and island metadata", stepStartedAt);
|
|
34058
34116
|
stepStartedAt = performance.now();
|
|
34059
34117
|
const conventionsPath = join55(buildDir, "conventions.json");
|
|
34060
|
-
if (
|
|
34118
|
+
if (existsSync40(conventionsPath)) {
|
|
34061
34119
|
const conventions2 = JSON.parse(readFileSync36(conventionsPath, "utf-8"));
|
|
34062
34120
|
setConventions(conventions2);
|
|
34063
34121
|
}
|
|
34064
34122
|
const spaRoutesPath = join55(buildDir, "spa-routes.json");
|
|
34065
|
-
if (
|
|
34123
|
+
if (existsSync40(spaRoutesPath)) {
|
|
34066
34124
|
setSpaRouteManifest(JSON.parse(readFileSync36(spaRoutesPath, "utf-8")));
|
|
34067
34125
|
}
|
|
34068
34126
|
recordStep("load production conventions", stepStartedAt);
|
|
@@ -34180,7 +34238,7 @@ import { buildGlobalWSHandler } from "elysia/ws";
|
|
|
34180
34238
|
// src/dev/devCert.ts
|
|
34181
34239
|
import {
|
|
34182
34240
|
copyFileSync as copyFileSync3,
|
|
34183
|
-
existsSync as
|
|
34241
|
+
existsSync as existsSync41,
|
|
34184
34242
|
mkdirSync as mkdirSync17,
|
|
34185
34243
|
readFileSync as readFileSync37,
|
|
34186
34244
|
rmSync as rmSync4
|
|
@@ -34196,7 +34254,7 @@ var DEFAULT_CERTIFICATE_HOSTS = ["localhost", "127.0.0.1", "::1"];
|
|
|
34196
34254
|
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;
|
|
34197
34255
|
var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
|
|
34198
34256
|
var devWarn = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[33m[dev]\x1B[0m \x1B[33m${msg}\x1B[0m`);
|
|
34199
|
-
var certFilesExist = () =>
|
|
34257
|
+
var certFilesExist = () => existsSync41(CERT_PATH) && existsSync41(KEY_PATH);
|
|
34200
34258
|
var normalizeDevCertificateHosts = (hosts = []) => {
|
|
34201
34259
|
const normalized = new Set(DEFAULT_CERTIFICATE_HOSTS);
|
|
34202
34260
|
for (const host2 of hosts) {
|
|
@@ -34673,7 +34731,7 @@ var generateHeadElement = ({
|
|
|
34673
34731
|
};
|
|
34674
34732
|
// src/utils/defineEnv.ts
|
|
34675
34733
|
var {env: bunEnv } = globalThis.Bun;
|
|
34676
|
-
import { existsSync as
|
|
34734
|
+
import { existsSync as existsSync43, readFileSync as readFileSync40 } from "fs";
|
|
34677
34735
|
import { resolve as resolve51 } from "path";
|
|
34678
34736
|
|
|
34679
34737
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
@@ -40710,7 +40768,7 @@ ${lines.join(`
|
|
|
40710
40768
|
var checkEnvFileSecurity = (properties) => {
|
|
40711
40769
|
const cwd2 = process.cwd();
|
|
40712
40770
|
const envPath = resolve51(cwd2, ".env");
|
|
40713
|
-
if (!
|
|
40771
|
+
if (!existsSync43(envPath))
|
|
40714
40772
|
return;
|
|
40715
40773
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
40716
40774
|
if (sensitiveKeys.length === 0)
|
|
@@ -40720,7 +40778,7 @@ var checkEnvFileSecurity = (properties) => {
|
|
|
40720
40778
|
if (presentKeys.length === 0)
|
|
40721
40779
|
return;
|
|
40722
40780
|
const gitignorePath = resolve51(cwd2, ".gitignore");
|
|
40723
|
-
if (
|
|
40781
|
+
if (existsSync43(gitignorePath)) {
|
|
40724
40782
|
const gitignore = readFileSync40(gitignorePath, "utf-8");
|
|
40725
40783
|
if (gitignore.split(`
|
|
40726
40784
|
`).some((line) => line.trim() === ".env"))
|
|
@@ -40753,7 +40811,7 @@ var getEnv = (key) => {
|
|
|
40753
40811
|
return environmentVariable;
|
|
40754
40812
|
};
|
|
40755
40813
|
// src/utils/projectRoot.ts
|
|
40756
|
-
import { existsSync as
|
|
40814
|
+
import { existsSync as existsSync44 } from "fs";
|
|
40757
40815
|
import { dirname as dirname34, resolve as resolve52 } from "path";
|
|
40758
40816
|
var CONFIG_CANDIDATES = [
|
|
40759
40817
|
"absolute.config.ts",
|
|
@@ -40763,7 +40821,7 @@ var CONFIG_CANDIDATES = [
|
|
|
40763
40821
|
"absolute.config.mts",
|
|
40764
40822
|
"absolute.config.cts"
|
|
40765
40823
|
];
|
|
40766
|
-
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) =>
|
|
40824
|
+
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync44(resolve52(directory, name)));
|
|
40767
40825
|
var findProjectRoot = () => {
|
|
40768
40826
|
const start = process.cwd();
|
|
40769
40827
|
let packageRoot = null;
|
|
@@ -40772,7 +40830,7 @@ var findProjectRoot = () => {
|
|
|
40772
40830
|
if (hasAbsoluteConfig(directory)) {
|
|
40773
40831
|
return directory;
|
|
40774
40832
|
}
|
|
40775
|
-
if (packageRoot === null &&
|
|
40833
|
+
if (packageRoot === null && existsSync44(resolve52(directory, "package.json"))) {
|
|
40776
40834
|
packageRoot = directory;
|
|
40777
40835
|
}
|
|
40778
40836
|
const parent = dirname34(directory);
|
|
@@ -41021,5 +41079,5 @@ export {
|
|
|
41021
41079
|
wrapPageHandlerWithStreamingSlots
|
|
41022
41080
|
};
|
|
41023
41081
|
|
|
41024
|
-
//# debugId=
|
|
41082
|
+
//# debugId=4071543943813FF564756E2164756E21
|
|
41025
41083
|
//# sourceMappingURL=index.js.map
|