@absolutejs/absolute 0.20.0-beta.45 → 0.20.0-beta.46
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 +967 -771
- package/dist/index.js +165 -146
- package/dist/index.js.map +4 -4
- package/dist/mobile/index.js +326 -90
- package/dist/mobile/index.js.map +7 -7
- package/dist/mobile/remoteMacAgentEntry.js +595 -84
- 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/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -13352,10 +13352,11 @@ var isTestSourcePath = (file2) => {
|
|
|
13352
13352
|
};
|
|
13353
13353
|
|
|
13354
13354
|
// src/mobile/deviceCapabilities.ts
|
|
13355
|
-
import { readFileSync as readFileSync17 } from "fs";
|
|
13355
|
+
import { existsSync as existsSync23, readFileSync as readFileSync17 } from "fs";
|
|
13356
13356
|
import { extname as extname7, join as join29, relative as relative11, resolve as resolve25 } from "path";
|
|
13357
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
13357
13358
|
import ts8 from "typescript";
|
|
13358
|
-
var DEVICES_PACKAGE = "@absolutejs/devices",
|
|
13359
|
+
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
13360
|
const value = JSON.parse(readFileSync17(path, "utf8"));
|
|
13360
13361
|
if (!object(value))
|
|
13361
13362
|
throw new TypeError(`${path} must contain an object.`);
|
|
@@ -13415,7 +13416,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
|
|
|
13415
13416
|
...systemBars === true ? { systemBars: true } : {},
|
|
13416
13417
|
...usageDescriptions === undefined ? {} : { usageDescriptions: [...usageDescriptions] }
|
|
13417
13418
|
};
|
|
13418
|
-
}, parseProvider = (name, value) => {
|
|
13419
|
+
}, parseProvider = (name, value, providerName) => {
|
|
13419
13420
|
if (!IDENTIFIER_PATTERN.test(name))
|
|
13420
13421
|
throw new TypeError("Device capability names must be identifiers.");
|
|
13421
13422
|
if (!object(value))
|
|
@@ -13424,10 +13425,13 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
|
|
|
13424
13425
|
const module = text(value.module, `${name}.module`);
|
|
13425
13426
|
if (!IDENTIFIER_PATTERN.test(factory))
|
|
13426
13427
|
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
|
|
13428
|
+
if (!providerModulePattern(providerName).test(module))
|
|
13429
|
+
throw new TypeError(`${name}.module must be an official devices-${providerName} subpath.`);
|
|
13430
|
+
if (!Array.isArray(value.packages) || !value.packages.every((spec) => typeof spec === "string" && providerPackagePattern(providerName).test(spec)))
|
|
13431
|
+
throw new TypeError(`${name}.packages must contain exact official ${providerLabel(providerName)} package versions.`);
|
|
13432
|
+
const { plugins } = value;
|
|
13433
|
+
if (plugins !== undefined && (!Array.isArray(plugins) || !plugins.every((plugin) => typeof plugin === "string" && /^expo-[a-z][a-z0-9-]*$/u.test(plugin))))
|
|
13434
|
+
throw new TypeError(`${name}.plugins must contain Expo config plugin names.`);
|
|
13431
13435
|
let native;
|
|
13432
13436
|
const { native: nativeMetadata } = value;
|
|
13433
13437
|
if (nativeMetadata !== undefined) {
|
|
@@ -13445,6 +13449,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
|
|
|
13445
13449
|
factory,
|
|
13446
13450
|
module,
|
|
13447
13451
|
...native === undefined ? {} : { native },
|
|
13452
|
+
...plugins === undefined ? {} : { plugins: [...plugins] },
|
|
13448
13453
|
packages: [...value.packages]
|
|
13449
13454
|
};
|
|
13450
13455
|
}, absoluteDeviceNativeRequirements = (plan) => {
|
|
@@ -13474,18 +13479,27 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
|
|
|
13474
13479
|
...new Set(plan.capabilities.flatMap((name) => plan.providers[name]?.native?.ios?.usageDescriptions ?? []))
|
|
13475
13480
|
].sort()
|
|
13476
13481
|
};
|
|
13477
|
-
}, loadAbsoluteDeviceCapabilityProviders = (projectRoot) => {
|
|
13478
|
-
const
|
|
13482
|
+
}, loadAbsoluteDeviceCapabilityProviders = (projectRoot, provider = "capacitor") => {
|
|
13483
|
+
const adapter = ADAPTERS[provider];
|
|
13484
|
+
let path = join29(resolve25(projectRoot), "node_modules", adapter, "package.json");
|
|
13485
|
+
try {
|
|
13486
|
+
readFileSync17(path, "utf8");
|
|
13487
|
+
} catch {
|
|
13488
|
+
path = fileURLToPath2(import.meta.resolve(`${adapter}/package.json`));
|
|
13489
|
+
}
|
|
13479
13490
|
const manifest = readJson(path);
|
|
13480
13491
|
const { absolutejs } = manifest;
|
|
13481
13492
|
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,
|
|
13493
|
+
if (!object(devices) || devices.format !== 1 || devices.provider !== provider || !object(devices.capabilities))
|
|
13494
|
+
throw new TypeError(`${adapter} does not publish supported capability metadata.`);
|
|
13495
|
+
const entries = Object.entries(devices.capabilities).map(([name, capability]) => ({
|
|
13485
13496
|
name,
|
|
13486
|
-
provider: parseProvider(name, provider)
|
|
13497
|
+
provider: parseProvider(name, capability, provider)
|
|
13487
13498
|
}));
|
|
13488
|
-
return Object.fromEntries(entries.sort((left, right) => left.name.localeCompare(right.name)).map(({ name, provider }) => [
|
|
13499
|
+
return Object.fromEntries(entries.sort((left, right) => left.name.localeCompare(right.name)).map(({ name, provider: capabilityProvider }) => [
|
|
13500
|
+
name,
|
|
13501
|
+
capabilityProvider
|
|
13502
|
+
]));
|
|
13489
13503
|
}, isIgnored = (path) => path.split("/").some((segment) => IGNORED_DIRECTORIES.has(segment)), importedCapabilities = (source, file2) => {
|
|
13490
13504
|
const names = new Set;
|
|
13491
13505
|
const namespaces = new Set;
|
|
@@ -13542,6 +13556,8 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
|
|
|
13542
13556
|
return packages;
|
|
13543
13557
|
}, discoverAbsoluteDeviceCapabilities = (projectRoot, providers = loadAbsoluteDeviceCapabilityProviders(projectRoot)) => {
|
|
13544
13558
|
const root = resolve25(projectRoot);
|
|
13559
|
+
if (!existsSync23(root))
|
|
13560
|
+
return [];
|
|
13545
13561
|
const known = new Set(Object.keys(providers));
|
|
13546
13562
|
const capabilities = new Set;
|
|
13547
13563
|
for (const path of SOURCE_GLOB.scanSync({ cwd: root })) {
|
|
@@ -13568,14 +13584,14 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
|
|
|
13568
13584
|
return true;
|
|
13569
13585
|
}
|
|
13570
13586
|
return false;
|
|
13571
|
-
}, resolveAbsoluteDeviceCapabilityPlan = (projectRoot) => {
|
|
13572
|
-
const allProviders = loadAbsoluteDeviceCapabilityProviders(projectRoot);
|
|
13587
|
+
}, resolveAbsoluteDeviceCapabilityPlan = (projectRoot, provider = "capacitor") => {
|
|
13588
|
+
const allProviders = loadAbsoluteDeviceCapabilityProviders(projectRoot, provider);
|
|
13573
13589
|
const capabilities = discoverAbsoluteDeviceCapabilities(projectRoot, allProviders);
|
|
13574
13590
|
const providers = {};
|
|
13575
13591
|
for (const name of capabilities) {
|
|
13576
|
-
const
|
|
13577
|
-
if (
|
|
13578
|
-
providers[name] =
|
|
13592
|
+
const capabilityProvider = allProviders[name];
|
|
13593
|
+
if (capabilityProvider)
|
|
13594
|
+
providers[name] = capabilityProvider;
|
|
13579
13595
|
}
|
|
13580
13596
|
return {
|
|
13581
13597
|
capabilities,
|
|
@@ -13586,6 +13602,10 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
|
|
|
13586
13602
|
};
|
|
13587
13603
|
};
|
|
13588
13604
|
var init_deviceCapabilities = __esm(() => {
|
|
13605
|
+
ADAPTERS = {
|
|
13606
|
+
capacitor: "@absolutejs/devices-capacitor",
|
|
13607
|
+
expo: "@absolutejs/devices-expo"
|
|
13608
|
+
};
|
|
13589
13609
|
SOURCE_GLOB = new Bun.Glob("**/*.{js,jsx,ts,tsx,svelte,vue}");
|
|
13590
13610
|
IGNORED_DIRECTORIES = new Set([
|
|
13591
13611
|
".absolutejs",
|
|
@@ -13599,8 +13619,6 @@ var init_deviceCapabilities = __esm(() => {
|
|
|
13599
13619
|
"tests"
|
|
13600
13620
|
]);
|
|
13601
13621
|
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
13622
|
ANDROID_PERMISSION_PATTERN = /^android\.permission\.[A-Z][A-Z0-9_]*$/u;
|
|
13605
13623
|
IOS_USAGE_DESCRIPTIONS = new Set([
|
|
13606
13624
|
"camera",
|
|
@@ -14612,7 +14630,7 @@ var exports_parseAngularConfigImports = {};
|
|
|
14612
14630
|
__export(exports_parseAngularConfigImports, {
|
|
14613
14631
|
parseAngularProvidersImport: () => parseAngularProvidersImport
|
|
14614
14632
|
});
|
|
14615
|
-
import { existsSync as
|
|
14633
|
+
import { existsSync as existsSync24, readFileSync as readFileSync22 } from "fs";
|
|
14616
14634
|
import { dirname as dirname18, isAbsolute as isAbsolute3, join as join35 } from "path";
|
|
14617
14635
|
import ts12 from "typescript";
|
|
14618
14636
|
var findDefineConfigCall = (sf) => {
|
|
@@ -14669,7 +14687,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
14669
14687
|
const envOverride = process.env.ABSOLUTE_CONFIG;
|
|
14670
14688
|
if (envOverride) {
|
|
14671
14689
|
const resolved = isAbsolute3(envOverride) ? envOverride : join35(projectRoot, envOverride);
|
|
14672
|
-
if (
|
|
14690
|
+
if (existsSync24(resolved))
|
|
14673
14691
|
return resolved;
|
|
14674
14692
|
}
|
|
14675
14693
|
const candidates = [
|
|
@@ -14679,7 +14697,7 @@ var findDefineConfigCall = (sf) => {
|
|
|
14679
14697
|
join35(projectRoot, "absolute.config.mjs")
|
|
14680
14698
|
];
|
|
14681
14699
|
for (const candidate of candidates) {
|
|
14682
|
-
if (
|
|
14700
|
+
if (existsSync24(candidate))
|
|
14683
14701
|
return candidate;
|
|
14684
14702
|
}
|
|
14685
14703
|
return null;
|
|
@@ -14780,7 +14798,7 @@ __export(exports_compileSvelte, {
|
|
|
14780
14798
|
clearSvelteCompilerCache: () => clearSvelteCompilerCache,
|
|
14781
14799
|
compileSvelte: () => compileSvelte
|
|
14782
14800
|
});
|
|
14783
|
-
import { existsSync as
|
|
14801
|
+
import { existsSync as existsSync25 } from "fs";
|
|
14784
14802
|
import { mkdir as mkdir9, stat as stat2 } from "fs/promises";
|
|
14785
14803
|
import {
|
|
14786
14804
|
dirname as dirname19,
|
|
@@ -14796,11 +14814,11 @@ var {write: write2, file: file2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
|
14796
14814
|
var resolveDevClientDir2 = () => {
|
|
14797
14815
|
const projectRoot = process.cwd();
|
|
14798
14816
|
const fromSource = resolve27(import.meta.dir, "../dev/client");
|
|
14799
|
-
if (
|
|
14817
|
+
if (existsSync25(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
14800
14818
|
return fromSource;
|
|
14801
14819
|
}
|
|
14802
14820
|
const fromNodeModules = resolve27(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
14803
|
-
if (
|
|
14821
|
+
if (existsSync25(fromNodeModules))
|
|
14804
14822
|
return fromNodeModules;
|
|
14805
14823
|
return resolve27(import.meta.dir, "./dev/client");
|
|
14806
14824
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
@@ -14903,7 +14921,7 @@ var resolveDevClientDir2 = () => {
|
|
|
14903
14921
|
const contentHash = Bun.hash(raw).toString(BASE_36_RADIX);
|
|
14904
14922
|
const prevHash = sourceHashCache.get(src);
|
|
14905
14923
|
const persistent = persistentCache.get(src);
|
|
14906
|
-
if (prevHash === contentHash && persistent &&
|
|
14924
|
+
if (prevHash === contentHash && persistent && existsSync25(persistent.ssr) && existsSync25(persistent.client)) {
|
|
14907
14925
|
cache.set(src, persistent);
|
|
14908
14926
|
return persistent;
|
|
14909
14927
|
}
|
|
@@ -15625,7 +15643,7 @@ __export(exports_compileVue, {
|
|
|
15625
15643
|
generateVueHmrId: () => generateVueHmrId,
|
|
15626
15644
|
vueHmrMetadata: () => vueHmrMetadata
|
|
15627
15645
|
});
|
|
15628
|
-
import { existsSync as
|
|
15646
|
+
import { existsSync as existsSync26, readFileSync as readFileSync24, realpathSync as realpathSync2 } from "fs";
|
|
15629
15647
|
import { mkdir as mkdir10 } from "fs/promises";
|
|
15630
15648
|
import {
|
|
15631
15649
|
basename as basename11,
|
|
@@ -15639,11 +15657,11 @@ var {file: file3, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
|
|
|
15639
15657
|
var resolveDevClientDir3 = () => {
|
|
15640
15658
|
const projectRoot = process.cwd();
|
|
15641
15659
|
const fromSource = resolve28(import.meta.dir, "../dev/client");
|
|
15642
|
-
if (
|
|
15660
|
+
if (existsSync26(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
15643
15661
|
return fromSource;
|
|
15644
15662
|
}
|
|
15645
15663
|
const fromNodeModules = resolve28(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
15646
|
-
if (
|
|
15664
|
+
if (existsSync26(fromNodeModules))
|
|
15647
15665
|
return fromNodeModules;
|
|
15648
15666
|
return resolve28(import.meta.dir, "./dev/client");
|
|
15649
15667
|
}, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
@@ -15696,7 +15714,7 @@ var resolveDevClientDir3 = () => {
|
|
|
15696
15714
|
const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
|
|
15697
15715
|
return cssContent.replace(importRegex, (match, _quote, relPath) => {
|
|
15698
15716
|
const importedPath = resolve28(dirname20(cssFilePath), relPath);
|
|
15699
|
-
if (!
|
|
15717
|
+
if (!existsSync26(importedPath))
|
|
15700
15718
|
return match;
|
|
15701
15719
|
const importedContent = readFileSync24(importedPath, "utf-8");
|
|
15702
15720
|
return inlineCssImports(importedContent, importedPath, visited);
|
|
@@ -15705,10 +15723,10 @@ var resolveDevClientDir3 = () => {
|
|
|
15705
15723
|
if (helper.endsWith(".ts"))
|
|
15706
15724
|
return resolve28(sourceDir, helper);
|
|
15707
15725
|
const direct = resolve28(sourceDir, `${helper}.ts`);
|
|
15708
|
-
if (
|
|
15726
|
+
if (existsSync26(direct))
|
|
15709
15727
|
return direct;
|
|
15710
15728
|
const indexed = resolve28(sourceDir, helper, "index.ts");
|
|
15711
|
-
if (
|
|
15729
|
+
if (existsSync26(indexed))
|
|
15712
15730
|
return indexed;
|
|
15713
15731
|
return direct;
|
|
15714
15732
|
}, toJs = (filePath, sourceDir) => {
|
|
@@ -15724,10 +15742,10 @@ var resolveDevClientDir3 = () => {
|
|
|
15724
15742
|
}
|
|
15725
15743
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
15726
15744
|
const directTs = resolve28(sourceDir, `${filePath}.ts`);
|
|
15727
|
-
if (
|
|
15745
|
+
if (existsSync26(directTs))
|
|
15728
15746
|
return `${filePath}.js`;
|
|
15729
15747
|
const indexedTs = resolve28(sourceDir, filePath, "index.ts");
|
|
15730
|
-
if (
|
|
15748
|
+
if (existsSync26(indexedTs))
|
|
15731
15749
|
return `${filePath}/index.js`;
|
|
15732
15750
|
}
|
|
15733
15751
|
return `${filePath}.js`;
|
|
@@ -15788,7 +15806,7 @@ const ${localName} = (source) => ${importedName}(
|
|
|
15788
15806
|
const contentHash = Bun.hash(sourceContent).toString(BASE_36_RADIX);
|
|
15789
15807
|
const prevHash = vueSourceHashCache.get(sourceFilePath);
|
|
15790
15808
|
const persistent = persistentBuildCache.get(sourceFilePath);
|
|
15791
|
-
if (prevHash === contentHash && persistent &&
|
|
15809
|
+
if (prevHash === contentHash && persistent && existsSync26(persistent.clientPath) && existsSync26(persistent.serverPath)) {
|
|
15792
15810
|
cacheMap.set(sourceFilePath, persistent);
|
|
15793
15811
|
return persistent;
|
|
15794
15812
|
}
|
|
@@ -15828,8 +15846,8 @@ const ${localName} = (source) => ${importedName}(
|
|
|
15828
15846
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
15829
15847
|
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
15830
15848
|
fs: {
|
|
15831
|
-
fileExists:
|
|
15832
|
-
readFile: (file4) =>
|
|
15849
|
+
fileExists: existsSync26,
|
|
15850
|
+
readFile: (file4) => existsSync26(file4) ? readFileSync24(file4, "utf-8") : undefined,
|
|
15833
15851
|
realpath: realpathSync2
|
|
15834
15852
|
},
|
|
15835
15853
|
id: componentId,
|
|
@@ -15991,7 +16009,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15991
16009
|
const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
|
|
15992
16010
|
for (const { importPath } of routes) {
|
|
15993
16011
|
const childPath = resolve28(dirname20(entryPath), importPath);
|
|
15994
|
-
if (expanded.has(childPath) || !
|
|
16012
|
+
if (expanded.has(childPath) || !existsSync26(childPath)) {
|
|
15995
16013
|
continue;
|
|
15996
16014
|
}
|
|
15997
16015
|
expanded.add(childPath);
|
|
@@ -16197,7 +16215,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
16197
16215
|
continue;
|
|
16198
16216
|
}
|
|
16199
16217
|
const resolved = resolveHelperTsPath(helperDir, dep);
|
|
16200
|
-
if (!
|
|
16218
|
+
if (!existsSync26(resolved))
|
|
16201
16219
|
continue;
|
|
16202
16220
|
if (allTsHelperPaths.has(resolved))
|
|
16203
16221
|
continue;
|
|
@@ -16724,7 +16742,7 @@ __export(exports_compileAngular, {
|
|
|
16724
16742
|
compileAngularFiles: () => compileAngularFiles,
|
|
16725
16743
|
invalidateAngularJitCache: () => invalidateAngularJitCache
|
|
16726
16744
|
});
|
|
16727
|
-
import { existsSync as
|
|
16745
|
+
import { existsSync as existsSync27, readFileSync as readFileSync25, promises as fs5 } from "fs";
|
|
16728
16746
|
import { join as join38, basename as basename12, sep as sep3, dirname as dirname21, resolve as resolve29, relative as relative14 } from "path";
|
|
16729
16747
|
var {Glob: Glob6 } = globalThis.Bun;
|
|
16730
16748
|
import ts14 from "typescript";
|
|
@@ -16781,7 +16799,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16781
16799
|
join38(candidate, "index.js"),
|
|
16782
16800
|
join38(candidate, "index.jsx")
|
|
16783
16801
|
];
|
|
16784
|
-
return candidates.find((file4) =>
|
|
16802
|
+
return candidates.find((file4) => existsSync27(file4));
|
|
16785
16803
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
16786
16804
|
const baseDir = resolve29(rootDir);
|
|
16787
16805
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
@@ -16862,11 +16880,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16862
16880
|
}, resolveDevClientDir4 = () => {
|
|
16863
16881
|
const projectRoot = process.cwd();
|
|
16864
16882
|
const fromSource = resolve29(import.meta.dir, "../dev/client");
|
|
16865
|
-
if (
|
|
16883
|
+
if (existsSync27(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
16866
16884
|
return fromSource;
|
|
16867
16885
|
}
|
|
16868
16886
|
const fromNodeModules = resolve29(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
16869
|
-
if (
|
|
16887
|
+
if (existsSync27(fromNodeModules))
|
|
16870
16888
|
return fromNodeModules;
|
|
16871
16889
|
return resolve29(import.meta.dir, "./dev/client");
|
|
16872
16890
|
}, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
|
|
@@ -16912,11 +16930,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16912
16930
|
return `${path}${query}`;
|
|
16913
16931
|
const importerDir = dirname21(importerOutputPath);
|
|
16914
16932
|
const fileCandidate = resolve29(importerDir, `${path}.js`);
|
|
16915
|
-
if (outputFiles?.has(fileCandidate) ||
|
|
16933
|
+
if (outputFiles?.has(fileCandidate) || existsSync27(fileCandidate)) {
|
|
16916
16934
|
return `${path}.js${query}`;
|
|
16917
16935
|
}
|
|
16918
16936
|
const indexCandidate = resolve29(importerDir, path, "index.js");
|
|
16919
|
-
if (outputFiles?.has(indexCandidate) ||
|
|
16937
|
+
if (outputFiles?.has(indexCandidate) || existsSync27(indexCandidate)) {
|
|
16920
16938
|
return `${path}/index.js${query}`;
|
|
16921
16939
|
}
|
|
16922
16940
|
return `${path}.js${query}`;
|
|
@@ -16954,7 +16972,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
16954
16972
|
join38(basePath, "index.mts"),
|
|
16955
16973
|
join38(basePath, "index.cts")
|
|
16956
16974
|
];
|
|
16957
|
-
return candidates.map((candidate) => resolve29(candidate)).find((candidate) =>
|
|
16975
|
+
return candidates.map((candidate) => resolve29(candidate)).find((candidate) => existsSync27(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
16958
16976
|
}, readFileForAotTransform = async (fileName, readFile9) => {
|
|
16959
16977
|
const hostSource = readFile9?.(fileName);
|
|
16960
16978
|
if (typeof hostSource === "string")
|
|
@@ -17035,7 +17053,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17035
17053
|
if (visited.has(resolvedPath))
|
|
17036
17054
|
return;
|
|
17037
17055
|
visited.add(resolvedPath);
|
|
17038
|
-
if (!
|
|
17056
|
+
if (!existsSync27(resolvedPath) || resolvedPath.endsWith(".d.ts"))
|
|
17039
17057
|
return;
|
|
17040
17058
|
stats.filesVisited += 1;
|
|
17041
17059
|
const source = await readFileForAotTransform(resolvedPath, readFile9);
|
|
@@ -17209,7 +17227,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
17209
17227
|
return null;
|
|
17210
17228
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
17211
17229
|
const sourceEntry = resolve29(import.meta.dir, "../angular/components/index.ts");
|
|
17212
|
-
if (
|
|
17230
|
+
if (existsSync27(sourceEntry)) {
|
|
17213
17231
|
return sourceEntry.replace(/\\/g, "/");
|
|
17214
17232
|
}
|
|
17215
17233
|
return "@absolutejs/absolute/angular/components";
|
|
@@ -17337,7 +17355,7 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
|
|
|
17337
17355
|
${fields}
|
|
17338
17356
|
`);
|
|
17339
17357
|
}, readAndEscapeFile = async (filePath, stylePreprocessors) => {
|
|
17340
|
-
if (!
|
|
17358
|
+
if (!existsSync27(filePath)) {
|
|
17341
17359
|
throw new Error(`Unable to inline Angular style resource: file not found at ${filePath}`);
|
|
17342
17360
|
}
|
|
17343
17361
|
const content = await compileStyleFileIfNeeded(filePath, stylePreprocessors);
|
|
@@ -17346,7 +17364,7 @@ ${fields}
|
|
|
17346
17364
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
17347
17365
|
if (templateUrlMatch?.[1]) {
|
|
17348
17366
|
const templatePath = join38(fileDir, templateUrlMatch[1]);
|
|
17349
|
-
if (!
|
|
17367
|
+
if (!existsSync27(templatePath)) {
|
|
17350
17368
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
17351
17369
|
}
|
|
17352
17370
|
const templateRaw2 = await fs5.readFile(templatePath, "utf-8");
|
|
@@ -17377,7 +17395,7 @@ ${fields}
|
|
|
17377
17395
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
17378
17396
|
if (templateUrlMatch?.[1]) {
|
|
17379
17397
|
const templatePath = join38(fileDir, templateUrlMatch[1]);
|
|
17380
|
-
if (!
|
|
17398
|
+
if (!existsSync27(templatePath)) {
|
|
17381
17399
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
17382
17400
|
}
|
|
17383
17401
|
const templateRaw2 = readFileSync25(templatePath, "utf-8");
|
|
@@ -17525,7 +17543,7 @@ ${fields}
|
|
|
17525
17543
|
join38(candidate, "index.js"),
|
|
17526
17544
|
join38(candidate, "index.jsx")
|
|
17527
17545
|
];
|
|
17528
|
-
return candidates.find((file4) =>
|
|
17546
|
+
return candidates.find((file4) => existsSync27(file4));
|
|
17529
17547
|
};
|
|
17530
17548
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
17531
17549
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
@@ -17600,7 +17618,7 @@ ${fields}
|
|
|
17600
17618
|
if (visited.has(resolved))
|
|
17601
17619
|
return;
|
|
17602
17620
|
visited.add(resolved);
|
|
17603
|
-
if (resolved.endsWith(".json") &&
|
|
17621
|
+
if (resolved.endsWith(".json") && existsSync27(resolved)) {
|
|
17604
17622
|
const inputDir2 = dirname21(resolved);
|
|
17605
17623
|
const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
|
|
17606
17624
|
const targetDir2 = join38(outDir, relativeDir2);
|
|
@@ -17613,7 +17631,7 @@ ${fields}
|
|
|
17613
17631
|
let actualPath = resolved;
|
|
17614
17632
|
if (!actualPath.endsWith(".ts"))
|
|
17615
17633
|
actualPath += ".ts";
|
|
17616
|
-
if (!
|
|
17634
|
+
if (!existsSync27(actualPath))
|
|
17617
17635
|
return;
|
|
17618
17636
|
let sourceCode = await fs5.readFile(actualPath, "utf-8");
|
|
17619
17637
|
const inlined = await inlineResources(sourceCode, dirname21(actualPath), stylePreprocessors);
|
|
@@ -17651,7 +17669,7 @@ ${fields}
|
|
|
17651
17669
|
const isEntry = resolve29(actualPath) === resolve29(entryPath);
|
|
17652
17670
|
const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
|
|
17653
17671
|
const cacheKey2 = actualPath;
|
|
17654
|
-
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !
|
|
17672
|
+
const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync27(targetPath);
|
|
17655
17673
|
if (shouldWriteFile) {
|
|
17656
17674
|
const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
|
|
17657
17675
|
const preservedInjection = await readPreservedInjection(targetPath);
|
|
@@ -17664,7 +17682,7 @@ ${fields}
|
|
|
17664
17682
|
};
|
|
17665
17683
|
await transpileFile(inputPath);
|
|
17666
17684
|
const entryOutputPath = toOutputPath(entryPath);
|
|
17667
|
-
if (
|
|
17685
|
+
if (existsSync27(entryOutputPath)) {
|
|
17668
17686
|
const entryOutput = await fs5.readFile(entryOutputPath, "utf-8");
|
|
17669
17687
|
const withoutLegacyFlag = entryOutput.replace(/\nexport const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;\n?/g, `
|
|
17670
17688
|
`);
|
|
@@ -17690,7 +17708,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17690
17708
|
await traceAngularPhase("aot/copy-json-resources", async () => {
|
|
17691
17709
|
const cwd = process.cwd();
|
|
17692
17710
|
const angularSrcDir = resolve29(outRoot);
|
|
17693
|
-
if (!
|
|
17711
|
+
if (!existsSync27(angularSrcDir))
|
|
17694
17712
|
return;
|
|
17695
17713
|
const jsonGlob = new Glob6("**/*.json");
|
|
17696
17714
|
for (const rel of jsonGlob.scanSync({
|
|
@@ -17725,15 +17743,15 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17725
17743
|
...candidatePaths.map((file4) => resolve29(file4)),
|
|
17726
17744
|
...compiledFallbackPaths
|
|
17727
17745
|
];
|
|
17728
|
-
let candidate = normalizedCandidates.find((file4) =>
|
|
17746
|
+
let candidate = normalizedCandidates.find((file4) => existsSync27(file4) && file4.endsWith(`${sep3}${relativeEntry}`));
|
|
17729
17747
|
if (!candidate) {
|
|
17730
|
-
candidate = normalizedCandidates.find((file4) =>
|
|
17748
|
+
candidate = normalizedCandidates.find((file4) => existsSync27(file4) && file4.endsWith(`${sep3}pages${sep3}${jsName}`));
|
|
17731
17749
|
}
|
|
17732
17750
|
if (!candidate) {
|
|
17733
|
-
candidate = normalizedCandidates.find((file4) =>
|
|
17751
|
+
candidate = normalizedCandidates.find((file4) => existsSync27(file4) && file4.endsWith(`${sep3}${jsName}`));
|
|
17734
17752
|
}
|
|
17735
17753
|
if (!candidate) {
|
|
17736
|
-
candidate = normalizedCandidates.find((file4) =>
|
|
17754
|
+
candidate = normalizedCandidates.find((file4) => existsSync27(file4));
|
|
17737
17755
|
}
|
|
17738
17756
|
return candidate;
|
|
17739
17757
|
};
|
|
@@ -17741,11 +17759,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17741
17759
|
if (!rawServerFile) {
|
|
17742
17760
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-fallback", () => resolveRawServerFile([]), { entry: resolvedEntry });
|
|
17743
17761
|
}
|
|
17744
|
-
if (rawServerFile && !
|
|
17762
|
+
if (rawServerFile && !existsSync27(rawServerFile)) {
|
|
17745
17763
|
outputs = hmr ? await compileEntry() : aotOutputs;
|
|
17746
17764
|
rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-retry", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
|
|
17747
17765
|
}
|
|
17748
|
-
if (!rawServerFile || !
|
|
17766
|
+
if (!rawServerFile || !existsSync27(rawServerFile)) {
|
|
17749
17767
|
throw new Error(`Compiled output not found for ${entry}. Looking for: ${jsName}. Available: ${[
|
|
17750
17768
|
...outputs,
|
|
17751
17769
|
...compiledFallbackPaths
|
|
@@ -17781,7 +17799,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
17781
17799
|
const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
|
|
17782
17800
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
17783
17801
|
const clientFile = join38(indexesDir, jsName);
|
|
17784
|
-
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash &&
|
|
17802
|
+
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
17803
|
return {
|
|
17786
17804
|
clientPath: clientFile,
|
|
17787
17805
|
indexUnchanged: true,
|
|
@@ -18786,7 +18804,7 @@ __export(exports_fastHmrCompiler, {
|
|
|
18786
18804
|
takePendingModule: () => takePendingModule,
|
|
18787
18805
|
tryFastHmr: () => tryFastHmr
|
|
18788
18806
|
});
|
|
18789
|
-
import { existsSync as
|
|
18807
|
+
import { existsSync as existsSync28, readFileSync as readFileSync26, statSync as statSync2 } from "fs";
|
|
18790
18808
|
import { dirname as dirname22, extname as extname9, relative as relative15, resolve as resolve30 } from "path";
|
|
18791
18809
|
import ts18 from "typescript";
|
|
18792
18810
|
var fail = (reason, detail, location) => ({
|
|
@@ -19110,7 +19128,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19110
19128
|
`${base}/index.tsx`
|
|
19111
19129
|
];
|
|
19112
19130
|
for (const candidate of candidates) {
|
|
19113
|
-
if (!
|
|
19131
|
+
if (!existsSync28(candidate))
|
|
19114
19132
|
continue;
|
|
19115
19133
|
let content;
|
|
19116
19134
|
try {
|
|
@@ -19875,7 +19893,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19875
19893
|
if (visited.has(startDtsPath))
|
|
19876
19894
|
return null;
|
|
19877
19895
|
visited.add(startDtsPath);
|
|
19878
|
-
if (!
|
|
19896
|
+
if (!existsSync28(startDtsPath))
|
|
19879
19897
|
return null;
|
|
19880
19898
|
let content;
|
|
19881
19899
|
try {
|
|
@@ -19928,16 +19946,16 @@ var fail = (reason, detail, location) => ({
|
|
|
19928
19946
|
`${base}/index.d.cts`
|
|
19929
19947
|
];
|
|
19930
19948
|
for (const c of candidates) {
|
|
19931
|
-
if (
|
|
19949
|
+
if (existsSync28(c))
|
|
19932
19950
|
return c;
|
|
19933
19951
|
}
|
|
19934
19952
|
return null;
|
|
19935
19953
|
}, findPackageDtsForJs = (jsPath) => {
|
|
19936
19954
|
const sibling = jsPath.replace(/\.[mc]?js$/, ".d.ts");
|
|
19937
|
-
if (
|
|
19955
|
+
if (existsSync28(sibling))
|
|
19938
19956
|
return sibling;
|
|
19939
19957
|
const mirror = jsPath.replace(/\/dist\//, "/dist/src/").replace(/\.[mc]?js$/, ".d.ts");
|
|
19940
|
-
if (
|
|
19958
|
+
if (existsSync28(mirror))
|
|
19941
19959
|
return mirror;
|
|
19942
19960
|
return null;
|
|
19943
19961
|
}, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
|
|
@@ -19950,7 +19968,7 @@ var fail = (reason, detail, location) => ({
|
|
|
19950
19968
|
`${base}/index.tsx`
|
|
19951
19969
|
];
|
|
19952
19970
|
for (const candidate of candidates) {
|
|
19953
|
-
if (!
|
|
19971
|
+
if (!existsSync28(candidate))
|
|
19954
19972
|
continue;
|
|
19955
19973
|
const info = getChildComponentInfoFromTsSource(candidate, className);
|
|
19956
19974
|
if (info)
|
|
@@ -20164,11 +20182,11 @@ var fail = (reason, detail, location) => ({
|
|
|
20164
20182
|
const resolved = resolve30(componentDir, spec);
|
|
20165
20183
|
for (const ext of TS_EXTENSIONS) {
|
|
20166
20184
|
const candidate = resolved + ext;
|
|
20167
|
-
if (
|
|
20185
|
+
if (existsSync28(candidate))
|
|
20168
20186
|
return candidate;
|
|
20169
20187
|
}
|
|
20170
20188
|
const indexCandidate = resolve30(resolved, "index.ts");
|
|
20171
|
-
if (
|
|
20189
|
+
if (existsSync28(indexCandidate))
|
|
20172
20190
|
return indexCandidate;
|
|
20173
20191
|
}
|
|
20174
20192
|
return null;
|
|
@@ -20406,7 +20424,7 @@ ${transpiled}
|
|
|
20406
20424
|
}${staticPatch}`;
|
|
20407
20425
|
}, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
|
|
20408
20426
|
const abs = resolve30(componentDir, url);
|
|
20409
|
-
if (!
|
|
20427
|
+
if (!existsSync28(abs))
|
|
20410
20428
|
return null;
|
|
20411
20429
|
const ext = extname9(abs).toLowerCase();
|
|
20412
20430
|
if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
|
|
@@ -20446,7 +20464,7 @@ ${block}
|
|
|
20446
20464
|
return cached;
|
|
20447
20465
|
const tsconfigPath = resolve30(projectRoot, "tsconfig.json");
|
|
20448
20466
|
const opts = {};
|
|
20449
|
-
if (
|
|
20467
|
+
if (existsSync28(tsconfigPath)) {
|
|
20450
20468
|
try {
|
|
20451
20469
|
const text2 = readFileSync26(tsconfigPath, "utf8");
|
|
20452
20470
|
const parsed = ts18.parseConfigFileTextToJson(tsconfigPath, text2);
|
|
@@ -20473,7 +20491,7 @@ ${block}
|
|
|
20473
20491
|
}, tryFastHmr = async (params) => {
|
|
20474
20492
|
const { componentFilePath, className } = params;
|
|
20475
20493
|
const projectRoot = params.projectRoot ?? process.cwd();
|
|
20476
|
-
if (!
|
|
20494
|
+
if (!existsSync28(componentFilePath)) {
|
|
20477
20495
|
return fail("file-not-found", componentFilePath);
|
|
20478
20496
|
}
|
|
20479
20497
|
let compiler;
|
|
@@ -20529,7 +20547,7 @@ ${block}
|
|
|
20529
20547
|
templatePath = componentFilePath;
|
|
20530
20548
|
} else if (decoratorMeta.templateUrl) {
|
|
20531
20549
|
const tplAbs = resolve30(componentDir, decoratorMeta.templateUrl);
|
|
20532
|
-
if (!
|
|
20550
|
+
if (!existsSync28(tplAbs)) {
|
|
20533
20551
|
return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
|
|
20534
20552
|
}
|
|
20535
20553
|
templateText = readFileSync26(tplAbs, "utf8");
|
|
@@ -21298,7 +21316,7 @@ __export(exports_compileEmber, {
|
|
|
21298
21316
|
getEmberCompiledRoot: () => getEmberCompiledRoot,
|
|
21299
21317
|
getEmberServerCompiledDir: () => getEmberServerCompiledDir
|
|
21300
21318
|
});
|
|
21301
|
-
import { existsSync as
|
|
21319
|
+
import { existsSync as existsSync29 } from "fs";
|
|
21302
21320
|
import { mkdir as mkdir11, rm as rm8 } from "fs/promises";
|
|
21303
21321
|
import { basename as basename13, dirname as dirname23, extname as extname10, join as join39, resolve as resolve31 } from "path";
|
|
21304
21322
|
var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file4 } = globalThis.Bun;
|
|
@@ -21400,7 +21418,7 @@ export const importSync = (specifier) => {
|
|
|
21400
21418
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
21401
21419
|
for (const ext of extensionsToTry) {
|
|
21402
21420
|
const candidate = candidateBase + ext;
|
|
21403
|
-
if (
|
|
21421
|
+
if (existsSync29(candidate))
|
|
21404
21422
|
return { path: candidate };
|
|
21405
21423
|
}
|
|
21406
21424
|
return;
|
|
@@ -21420,7 +21438,7 @@ export const importSync = (specifier) => {
|
|
|
21420
21438
|
if (standalonePackages.has(args.path))
|
|
21421
21439
|
return;
|
|
21422
21440
|
const internal = join39(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
21423
|
-
if (
|
|
21441
|
+
if (existsSync29(internal))
|
|
21424
21442
|
return { path: internal };
|
|
21425
21443
|
return;
|
|
21426
21444
|
});
|
|
@@ -21550,7 +21568,7 @@ __export(exports_buildReactVendor, {
|
|
|
21550
21568
|
buildReactVendor: () => buildReactVendor,
|
|
21551
21569
|
computeVendorPaths: () => computeVendorPaths
|
|
21552
21570
|
});
|
|
21553
|
-
import { existsSync as
|
|
21571
|
+
import { existsSync as existsSync30, mkdirSync as mkdirSync8 } from "fs";
|
|
21554
21572
|
import { join as join40, resolve as resolve32 } from "path";
|
|
21555
21573
|
import { rm as rm9 } from "fs/promises";
|
|
21556
21574
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
@@ -21564,7 +21582,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
21564
21582
|
resolve32(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
21565
21583
|
];
|
|
21566
21584
|
for (const candidate of candidates) {
|
|
21567
|
-
if (
|
|
21585
|
+
if (existsSync30(candidate)) {
|
|
21568
21586
|
return candidate.replace(/\\/g, "/");
|
|
21569
21587
|
}
|
|
21570
21588
|
}
|
|
@@ -22031,7 +22049,7 @@ var init_buildSvelteVendor = __esm(() => {
|
|
|
22031
22049
|
import {
|
|
22032
22050
|
copyFileSync as copyFileSync2,
|
|
22033
22051
|
cpSync,
|
|
22034
|
-
existsSync as
|
|
22052
|
+
existsSync as existsSync31,
|
|
22035
22053
|
mkdirSync as mkdirSync12,
|
|
22036
22054
|
readdirSync as readdirSync5,
|
|
22037
22055
|
readFileSync as readFileSync27,
|
|
@@ -22264,7 +22282,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22264
22282
|
copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
|
|
22265
22283
|
}
|
|
22266
22284
|
}, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
|
|
22267
|
-
if (!
|
|
22285
|
+
if (!existsSync31(reactIndexesPath)) {
|
|
22268
22286
|
return;
|
|
22269
22287
|
}
|
|
22270
22288
|
const indexFiles = readDir(reactIndexesPath).filter((file5) => file5.endsWith(".tsx"));
|
|
@@ -22280,7 +22298,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22280
22298
|
for (const entry of sveltePageEntries) {
|
|
22281
22299
|
const name = basename14(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
22282
22300
|
const indexFile = join44(svelteIndexDir, "pages", `${name}.js`);
|
|
22283
|
-
if (!
|
|
22301
|
+
if (!existsSync31(indexFile))
|
|
22284
22302
|
continue;
|
|
22285
22303
|
let content = readFileSync27(indexFile, "utf-8");
|
|
22286
22304
|
const srcRel = relative16(process.cwd(), resolve33(entry)).replace(/\\/g, "/");
|
|
@@ -22293,7 +22311,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
|
|
|
22293
22311
|
for (const entry of vuePageEntries) {
|
|
22294
22312
|
const name = basename14(entry, ".vue");
|
|
22295
22313
|
const indexFile = join44(vueIndexDir, `${name}.js`);
|
|
22296
|
-
if (!
|
|
22314
|
+
if (!existsSync31(indexFile))
|
|
22297
22315
|
continue;
|
|
22298
22316
|
let content = readFileSync27(indexFile, "utf-8");
|
|
22299
22317
|
const srcRel = relative16(process.cwd(), resolve33(entry)).replace(/\\/g, "/");
|
|
@@ -23537,7 +23555,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
23537
23555
|
}
|
|
23538
23556
|
if (!hmr) {
|
|
23539
23557
|
const reactVendorDir = join44(buildPath, "react", "vendor");
|
|
23540
|
-
const vendorChunkPaths =
|
|
23558
|
+
const vendorChunkPaths = existsSync31(reactVendorDir) ? [
|
|
23541
23559
|
...new Glob8("**/*.js").scanSync({
|
|
23542
23560
|
absolute: true,
|
|
23543
23561
|
cwd: reactVendorDir
|
|
@@ -23963,7 +23981,7 @@ var init_build = __esm(() => {
|
|
|
23963
23981
|
});
|
|
23964
23982
|
|
|
23965
23983
|
// src/build/buildEmberVendor.ts
|
|
23966
|
-
import { mkdirSync as mkdirSync13, existsSync as
|
|
23984
|
+
import { mkdirSync as mkdirSync13, existsSync as existsSync32 } from "fs";
|
|
23967
23985
|
import { join as join45 } from "path";
|
|
23968
23986
|
import { rm as rm13 } from "fs/promises";
|
|
23969
23987
|
var {build: bunBuild8 } = globalThis.Bun;
|
|
@@ -24017,7 +24035,7 @@ export const importSync = (specifier) => {
|
|
|
24017
24035
|
return { resolveTo: specifier, specifier };
|
|
24018
24036
|
}
|
|
24019
24037
|
const emberInternalPath = join45(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
|
|
24020
|
-
if (!
|
|
24038
|
+
if (!existsSync32(emberInternalPath)) {
|
|
24021
24039
|
throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
|
|
24022
24040
|
}
|
|
24023
24041
|
return { resolveTo: emberInternalPath, specifier };
|
|
@@ -24049,7 +24067,7 @@ export const importSync = (specifier) => {
|
|
|
24049
24067
|
return;
|
|
24050
24068
|
}
|
|
24051
24069
|
const internal = join45(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
|
|
24052
|
-
if (
|
|
24070
|
+
if (existsSync32(internal)) {
|
|
24053
24071
|
return { path: internal };
|
|
24054
24072
|
}
|
|
24055
24073
|
return;
|
|
@@ -24221,7 +24239,7 @@ __export(exports_dependencyGraph, {
|
|
|
24221
24239
|
getAffectedFiles: () => getAffectedFiles,
|
|
24222
24240
|
removeFileFromGraph: () => removeFileFromGraph
|
|
24223
24241
|
});
|
|
24224
|
-
import { existsSync as
|
|
24242
|
+
import { existsSync as existsSync33, readFileSync as readFileSync28 } from "fs";
|
|
24225
24243
|
var {Glob: Glob9 } = globalThis.Bun;
|
|
24226
24244
|
import { resolve as resolve34 } from "path";
|
|
24227
24245
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
@@ -24251,10 +24269,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
24251
24269
|
];
|
|
24252
24270
|
for (const ext of extensions) {
|
|
24253
24271
|
const withExt = normalized + ext;
|
|
24254
|
-
if (
|
|
24272
|
+
if (existsSync33(withExt))
|
|
24255
24273
|
return withExt;
|
|
24256
24274
|
}
|
|
24257
|
-
if (
|
|
24275
|
+
if (existsSync33(normalized))
|
|
24258
24276
|
return normalized;
|
|
24259
24277
|
return null;
|
|
24260
24278
|
}, clearExistingDependents = (graph, normalizedPath) => {
|
|
@@ -24269,7 +24287,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
24269
24287
|
}
|
|
24270
24288
|
}, addFileToGraph = (graph, filePath) => {
|
|
24271
24289
|
const normalizedPath = resolve34(filePath);
|
|
24272
|
-
if (!
|
|
24290
|
+
if (!existsSync33(normalizedPath))
|
|
24273
24291
|
return;
|
|
24274
24292
|
const dependencies = extractDependencies(normalizedPath);
|
|
24275
24293
|
clearExistingDependents(graph, normalizedPath);
|
|
@@ -24295,7 +24313,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
24295
24313
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
24296
24314
|
const processedFiles = new Set;
|
|
24297
24315
|
const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
24298
|
-
const resolvedDirs = directories.map((dir) => resolve34(dir)).filter((dir) =>
|
|
24316
|
+
const resolvedDirs = directories.map((dir) => resolve34(dir)).filter((dir) => existsSync33(dir));
|
|
24299
24317
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
24300
24318
|
for (const file5 of allFiles) {
|
|
24301
24319
|
const fullPath = resolve34(file5);
|
|
@@ -24549,7 +24567,7 @@ var init_clientManager = __esm(() => {
|
|
|
24549
24567
|
});
|
|
24550
24568
|
|
|
24551
24569
|
// src/dev/pathUtils.ts
|
|
24552
|
-
import { existsSync as
|
|
24570
|
+
import { existsSync as existsSync34, readdirSync as readdirSync6, readFileSync as readFileSync29 } from "fs";
|
|
24553
24571
|
import { dirname as dirname25, resolve as resolve36 } from "path";
|
|
24554
24572
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
24555
24573
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
@@ -24723,7 +24741,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
24723
24741
|
push(cfg.stylesDir);
|
|
24724
24742
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
24725
24743
|
const abs = normalizePath2(resolve36(cwd2, candidate));
|
|
24726
|
-
if (
|
|
24744
|
+
if (existsSync34(abs) && !roots.includes(abs))
|
|
24727
24745
|
roots.push(abs);
|
|
24728
24746
|
}
|
|
24729
24747
|
try {
|
|
@@ -24816,7 +24834,7 @@ var init_pathUtils = __esm(() => {
|
|
|
24816
24834
|
|
|
24817
24835
|
// src/dev/fileWatcher.ts
|
|
24818
24836
|
import { watch } from "fs";
|
|
24819
|
-
import { existsSync as
|
|
24837
|
+
import { existsSync as existsSync35, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
|
|
24820
24838
|
import { dirname as dirname26, join as join46, resolve as resolve37 } from "path";
|
|
24821
24839
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
24822
24840
|
try {
|
|
@@ -24883,12 +24901,12 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24883
24901
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
24884
24902
|
return;
|
|
24885
24903
|
}
|
|
24886
|
-
if (event === "rename" && !
|
|
24904
|
+
if (event === "rename" && !existsSync35(fullPath)) {
|
|
24887
24905
|
safeRemoveFromGraph(state.dependencyGraph, fullPath);
|
|
24888
24906
|
onFileChange(fullPath);
|
|
24889
24907
|
return;
|
|
24890
24908
|
}
|
|
24891
|
-
if (
|
|
24909
|
+
if (existsSync35(fullPath)) {
|
|
24892
24910
|
onFileChange(fullPath);
|
|
24893
24911
|
safeAddToGraph(state.dependencyGraph, fullPath);
|
|
24894
24912
|
}
|
|
@@ -24898,7 +24916,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24898
24916
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
24899
24917
|
paths.forEach((path) => {
|
|
24900
24918
|
const absolutePath = resolve37(path).replace(/\\/g, "/");
|
|
24901
|
-
if (!
|
|
24919
|
+
if (!existsSync35(absolutePath)) {
|
|
24902
24920
|
return;
|
|
24903
24921
|
}
|
|
24904
24922
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -24909,7 +24927,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
24909
24927
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
24910
24928
|
watchPaths.forEach((path) => {
|
|
24911
24929
|
const absolutePath = resolve37(path).replace(/\\/g, "/");
|
|
24912
|
-
if (!
|
|
24930
|
+
if (!existsSync35(absolutePath)) {
|
|
24913
24931
|
return;
|
|
24914
24932
|
}
|
|
24915
24933
|
const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
|
|
@@ -25848,7 +25866,7 @@ __export(exports_moduleServer, {
|
|
|
25848
25866
|
warmCompilers: () => warmCompilers,
|
|
25849
25867
|
warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
|
|
25850
25868
|
});
|
|
25851
|
-
import { existsSync as
|
|
25869
|
+
import { existsSync as existsSync36, readFileSync as readFileSync32, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
|
|
25852
25870
|
import { basename as basename16, dirname as dirname29, extname as extname13, join as join48, resolve as resolve43, relative as relative17 } from "path";
|
|
25853
25871
|
var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
25854
25872
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
@@ -25869,10 +25887,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
|
|
|
25869
25887
|
${stubs}
|
|
25870
25888
|
`;
|
|
25871
25889
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
25872
|
-
const directHit = extensions.find((ext) =>
|
|
25890
|
+
const directHit = extensions.find((ext) => existsSync36(resolve43(projectRoot, srcPath + ext)));
|
|
25873
25891
|
if (directHit)
|
|
25874
25892
|
return srcPath + directHit;
|
|
25875
|
-
const indexHit = extensions.find((ext) =>
|
|
25893
|
+
const indexHit = extensions.find((ext) => existsSync36(resolve43(projectRoot, srcPath, `index${ext}`)));
|
|
25876
25894
|
if (indexHit)
|
|
25877
25895
|
return `${srcPath}/index${indexHit}`;
|
|
25878
25896
|
return srcPath;
|
|
@@ -25933,12 +25951,12 @@ ${stubs}
|
|
|
25933
25951
|
if (!subpath) {
|
|
25934
25952
|
const pkgDir = resolve43(projectRoot, "node_modules", packageName ?? "");
|
|
25935
25953
|
const pkgJsonPath = join48(pkgDir, "package.json");
|
|
25936
|
-
if (
|
|
25954
|
+
if (existsSync36(pkgJsonPath)) {
|
|
25937
25955
|
const pkg = JSON.parse(readFileSync32(pkgJsonPath, "utf-8"));
|
|
25938
25956
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
25939
25957
|
if (esmEntry) {
|
|
25940
25958
|
const resolved = resolve43(pkgDir, esmEntry);
|
|
25941
|
-
if (
|
|
25959
|
+
if (existsSync36(resolved))
|
|
25942
25960
|
return relative17(projectRoot, resolved);
|
|
25943
25961
|
}
|
|
25944
25962
|
}
|
|
@@ -26300,9 +26318,9 @@ ${code}`;
|
|
|
26300
26318
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
26301
26319
|
const compiledScript = hasScript ? vueCompiler.compileScript(descriptor, {
|
|
26302
26320
|
fs: {
|
|
26303
|
-
fileExists:
|
|
26321
|
+
fileExists: existsSync36,
|
|
26304
26322
|
realpath: realpathSync3,
|
|
26305
|
-
readFile: (file5) =>
|
|
26323
|
+
readFile: (file5) => existsSync36(file5) ? readFileSync32(file5, "utf-8") : undefined
|
|
26306
26324
|
},
|
|
26307
26325
|
id: componentId,
|
|
26308
26326
|
inlineTemplate: false
|
|
@@ -26332,11 +26350,11 @@ ${code}`;
|
|
|
26332
26350
|
`);
|
|
26333
26351
|
return result;
|
|
26334
26352
|
}, resolveSvelteModulePath = (path) => {
|
|
26335
|
-
if (
|
|
26353
|
+
if (existsSync36(path))
|
|
26336
26354
|
return path;
|
|
26337
|
-
if (
|
|
26355
|
+
if (existsSync36(`${path}.ts`))
|
|
26338
26356
|
return `${path}.ts`;
|
|
26339
|
-
if (
|
|
26357
|
+
if (existsSync36(`${path}.js`))
|
|
26340
26358
|
return `${path}.js`;
|
|
26341
26359
|
return path;
|
|
26342
26360
|
}, jsResponse = (body) => {
|
|
@@ -26487,7 +26505,7 @@ export default {};
|
|
|
26487
26505
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
26488
26506
|
if (ext)
|
|
26489
26507
|
return { ext, filePath };
|
|
26490
|
-
const found = MODULE_EXTENSIONS.find((candidate) =>
|
|
26508
|
+
const found = MODULE_EXTENSIONS.find((candidate) => existsSync36(filePath + candidate));
|
|
26491
26509
|
if (!found)
|
|
26492
26510
|
return { ext, filePath };
|
|
26493
26511
|
const resolved = filePath + found;
|
|
@@ -27035,7 +27053,7 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
27035
27053
|
var init_simpleHTMXHMR = () => {};
|
|
27036
27054
|
|
|
27037
27055
|
// src/dev/rebuildTrigger.ts
|
|
27038
|
-
import { existsSync as
|
|
27056
|
+
import { existsSync as existsSync37, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
|
|
27039
27057
|
import {
|
|
27040
27058
|
basename as basename17,
|
|
27041
27059
|
dirname as dirname31,
|
|
@@ -27149,7 +27167,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27149
27167
|
detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
|
|
27150
27168
|
}
|
|
27151
27169
|
return { ...parsed, framework: detectedFw };
|
|
27152
|
-
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) &&
|
|
27170
|
+
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync37(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
|
|
27153
27171
|
const { config } = state;
|
|
27154
27172
|
const cwd2 = process.cwd();
|
|
27155
27173
|
const absDeleted = resolvePath3(deletedFile).replace(/\\/g, "/");
|
|
@@ -27195,7 +27213,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27195
27213
|
if (!dependents || dependents.size === 0) {
|
|
27196
27214
|
return;
|
|
27197
27215
|
}
|
|
27198
|
-
const dependentFiles = Array.from(dependents).filter((file5) =>
|
|
27216
|
+
const dependentFiles = Array.from(dependents).filter((file5) => existsSync37(file5));
|
|
27199
27217
|
if (dependentFiles.length === 0) {
|
|
27200
27218
|
return;
|
|
27201
27219
|
}
|
|
@@ -27211,7 +27229,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27211
27229
|
try {
|
|
27212
27230
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
|
|
27213
27231
|
affectedFiles.forEach((affectedFile) => {
|
|
27214
|
-
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath &&
|
|
27232
|
+
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync37(affectedFile)) {
|
|
27215
27233
|
validFiles.push(affectedFile);
|
|
27216
27234
|
processedFiles.add(affectedFile);
|
|
27217
27235
|
}
|
|
@@ -27236,7 +27254,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27236
27254
|
collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
|
|
27237
27255
|
}, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
|
|
27238
27256
|
filePathSet.forEach((filePathInSet) => {
|
|
27239
|
-
if (!
|
|
27257
|
+
if (!existsSync37(filePathInSet)) {
|
|
27240
27258
|
collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
|
|
27241
27259
|
return;
|
|
27242
27260
|
}
|
|
@@ -27501,7 +27519,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
27501
27519
|
return componentFile;
|
|
27502
27520
|
}
|
|
27503
27521
|
const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
|
|
27504
|
-
if (
|
|
27522
|
+
if (existsSync37(tsCounterpart)) {
|
|
27505
27523
|
return tsCounterpart;
|
|
27506
27524
|
}
|
|
27507
27525
|
if (!graph)
|
|
@@ -28371,7 +28389,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
|
|
|
28371
28389
|
}
|
|
28372
28390
|
return ctx;
|
|
28373
28391
|
}, runSvelteBundleRebuild = async (state, svelteFiles, config) => {
|
|
28374
|
-
const existingSvelteFiles = svelteFiles.filter((file5) =>
|
|
28392
|
+
const existingSvelteFiles = svelteFiles.filter((file5) => existsSync37(file5));
|
|
28375
28393
|
if (existingSvelteFiles.length === 0)
|
|
28376
28394
|
return;
|
|
28377
28395
|
const svelteDir = config.svelteDirectory ?? "";
|
|
@@ -30726,14 +30744,14 @@ __export(exports_devtoolsJson, {
|
|
|
30726
30744
|
normalizeDevtoolsWorkspaceRoot: () => normalizeDevtoolsWorkspaceRoot,
|
|
30727
30745
|
resolveDevtoolsUuidCachePath: () => resolveDevtoolsUuidCachePath
|
|
30728
30746
|
});
|
|
30729
|
-
import { existsSync as
|
|
30747
|
+
import { existsSync as existsSync38, mkdirSync as mkdirSync15, readFileSync as readFileSync33, writeFileSync as writeFileSync10 } from "fs";
|
|
30730
30748
|
import { dirname as dirname32, join as join51, resolve as resolve48 } from "path";
|
|
30731
30749
|
import { Elysia as Elysia7 } from "elysia";
|
|
30732
30750
|
var ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json", UUID_CACHE_KEY = "__absoluteDevtoolsWorkspaceUuid", getGlobalUuid = () => Reflect.get(globalThis, UUID_CACHE_KEY), setGlobalUuid = (uuid) => {
|
|
30733
30751
|
Reflect.set(globalThis, UUID_CACHE_KEY, uuid);
|
|
30734
30752
|
return uuid;
|
|
30735
30753
|
}, 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 (!
|
|
30754
|
+
if (!existsSync38(cachePath))
|
|
30737
30755
|
return null;
|
|
30738
30756
|
try {
|
|
30739
30757
|
const value = readFileSync33(cachePath, "utf-8").trim();
|
|
@@ -30786,13 +30804,13 @@ var exports_imageOptimizer = {};
|
|
|
30786
30804
|
__export(exports_imageOptimizer, {
|
|
30787
30805
|
imageOptimizer: () => imageOptimizer
|
|
30788
30806
|
});
|
|
30789
|
-
import { existsSync as
|
|
30807
|
+
import { existsSync as existsSync39 } from "fs";
|
|
30790
30808
|
import { resolve as resolve49 } from "path";
|
|
30791
30809
|
import { Elysia as Elysia8 } from "elysia";
|
|
30792
30810
|
var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avifInProgress, safeResolve = (path, baseDir) => {
|
|
30793
30811
|
try {
|
|
30794
30812
|
const resolved = validateSafePath(path, baseDir);
|
|
30795
|
-
if (
|
|
30813
|
+
if (existsSync39(resolved))
|
|
30796
30814
|
return resolved;
|
|
30797
30815
|
return null;
|
|
30798
30816
|
} catch {
|
|
@@ -31123,6 +31141,7 @@ import { join as join53 } from "path";
|
|
|
31123
31141
|
import { tmpdir } from "os";
|
|
31124
31142
|
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
31143
|
if ((mobile.engine ?? "capacitor") === "expo") {
|
|
31144
|
+
const plan2 = resolveAbsoluteDeviceCapabilityPlan(projectRoot, "expo");
|
|
31126
31145
|
const normalized = normalizeAbsoluteMobileConfig(mobile, projectRoot);
|
|
31127
31146
|
const auth = projectUsesAbsoluteAuth(projectRoot) ? resolveAbsoluteMobileAuthManifest(projectRoot, normalized) : undefined;
|
|
31128
31147
|
const sync = Boolean(auth && projectUsesAbsoluteSync(projectRoot));
|
|
@@ -31137,10 +31156,10 @@ var absoluteNativeDevAdapterSource = (projectRoot, mobile, resolveModule = (spec
|
|
|
31137
31156
|
return `import { installAbsoluteExpoWebDeviceAdapter } from ${JSON.stringify(expoAdapterModule)};
|
|
31138
31157
|
${auth ? `import { createAbsoluteExpoShellAuth } from ${JSON.stringify(expoAuthModule)};` : ""}
|
|
31139
31158
|
${sync ? `import { installAbsoluteExpoShellSync } from ${JSON.stringify(expoSyncModule)};` : ""}
|
|
31140
|
-
installAbsoluteExpoWebDeviceAdapter();
|
|
31159
|
+
installAbsoluteExpoWebDeviceAdapter(${JSON.stringify(plan2.capabilities)});
|
|
31141
31160
|
${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
31161
|
}
|
|
31143
|
-
const plan = resolveAbsoluteDeviceCapabilityPlan(projectRoot);
|
|
31162
|
+
const plan = resolveAbsoluteDeviceCapabilityPlan(projectRoot, "capacitor");
|
|
31144
31163
|
const imports = plan.capabilities.map((name, index) => {
|
|
31145
31164
|
const provider = plan.providers[name];
|
|
31146
31165
|
if (!provider)
|
|
@@ -31458,7 +31477,7 @@ __export(exports_serverEntryWatcher, {
|
|
|
31458
31477
|
});
|
|
31459
31478
|
import {
|
|
31460
31479
|
copyFileSync as copyFileSync4,
|
|
31461
|
-
existsSync as
|
|
31480
|
+
existsSync as existsSync42,
|
|
31462
31481
|
readdirSync as readdirSync12,
|
|
31463
31482
|
readFileSync as readFileSync39,
|
|
31464
31483
|
statSync as statSync8,
|
|
@@ -31489,7 +31508,7 @@ var ATOMIC_RECOVERY_WINDOW_MS = 1000, RELOAD_DEBOUNCE_MS = 80, ENTRY_IMPORT_RETR
|
|
|
31489
31508
|
if (globalThis.__absoluteEntryWatcherStarted)
|
|
31490
31509
|
return;
|
|
31491
31510
|
const originalEntry = process.env.ABSOLUTE_SERVER_ENTRY ?? Bun.main;
|
|
31492
|
-
if (!originalEntry || !
|
|
31511
|
+
if (!originalEntry || !existsSync42(originalEntry))
|
|
31493
31512
|
return;
|
|
31494
31513
|
globalThis.__absoluteEntryWatcherStarted = true;
|
|
31495
31514
|
globalThis.__absoluteEntryWatcherReady = false;
|
|
@@ -32488,7 +32507,7 @@ var handleHTMXPageRequest = async (pagePath, options = {}) => {
|
|
|
32488
32507
|
};
|
|
32489
32508
|
// src/core/prepare.ts
|
|
32490
32509
|
import { createHash as createHash8 } from "crypto";
|
|
32491
|
-
import { existsSync as
|
|
32510
|
+
import { existsSync as existsSync40, readdirSync as readdirSync10, readFileSync as readFileSync36 } from "fs";
|
|
32492
32511
|
import { basename as basename18, join as join55, relative as relative20, resolve as resolvePath4 } from "path";
|
|
32493
32512
|
import { Elysia as Elysia10, NotFound } from "elysia";
|
|
32494
32513
|
|
|
@@ -33834,7 +33853,7 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
|
|
|
33834
33853
|
if (!fileName)
|
|
33835
33854
|
continue;
|
|
33836
33855
|
const srcPath = resolvePath4(devIndexDir, fileName);
|
|
33837
|
-
if (!
|
|
33856
|
+
if (!existsSync40(srcPath))
|
|
33838
33857
|
continue;
|
|
33839
33858
|
const rel = relative20(process.cwd(), srcPath).replace(/\\/g, "/");
|
|
33840
33859
|
manifest[key] = `${SRC_URL_PREFIX2}${rel}`;
|
|
@@ -33852,7 +33871,7 @@ var registerIconVersioning = (buildDir) => {
|
|
|
33852
33871
|
const path = href.split("?")[0] ?? href;
|
|
33853
33872
|
const filePath = join55(buildDir, path);
|
|
33854
33873
|
let versioned = href;
|
|
33855
|
-
if (
|
|
33874
|
+
if (existsSync40(filePath)) {
|
|
33856
33875
|
const hash = createHash8("sha256").update(readFileSync36(filePath)).digest("hex").slice(0, ICON_HASH_LENGTH);
|
|
33857
33876
|
versioned = href.includes("?") ? `${href}&v=${hash}` : `${href}?v=${hash}`;
|
|
33858
33877
|
}
|
|
@@ -33976,7 +33995,7 @@ var prepareDev = async (config, buildDir) => {
|
|
|
33976
33995
|
};
|
|
33977
33996
|
var loadPrerenderMap = (prerenderDir) => {
|
|
33978
33997
|
const map = new Map;
|
|
33979
|
-
if (!
|
|
33998
|
+
if (!existsSync40(prerenderDir))
|
|
33980
33999
|
return map;
|
|
33981
34000
|
let entries;
|
|
33982
34001
|
try {
|
|
@@ -33995,7 +34014,7 @@ var loadPrerenderMap = (prerenderDir) => {
|
|
|
33995
34014
|
};
|
|
33996
34015
|
var loadMobileCompatibilityPlugin = async (buildDir) => {
|
|
33997
34016
|
const root = join55(buildDir, ".absolutejs", "mobile-compatibility");
|
|
33998
|
-
if (!
|
|
34017
|
+
if (!existsSync40(join55(root, "current.json"))) {
|
|
33999
34018
|
return new Elysia10({ name: "absolutejs-mobile-compatibility-empty" });
|
|
34000
34019
|
}
|
|
34001
34020
|
const options = await loadAbsoluteMobileMaterializedBundle(root);
|
|
@@ -34057,12 +34076,12 @@ var prepare = async (configOrPath) => {
|
|
|
34057
34076
|
recordStep("load production manifest and island metadata", stepStartedAt);
|
|
34058
34077
|
stepStartedAt = performance.now();
|
|
34059
34078
|
const conventionsPath = join55(buildDir, "conventions.json");
|
|
34060
|
-
if (
|
|
34079
|
+
if (existsSync40(conventionsPath)) {
|
|
34061
34080
|
const conventions2 = JSON.parse(readFileSync36(conventionsPath, "utf-8"));
|
|
34062
34081
|
setConventions(conventions2);
|
|
34063
34082
|
}
|
|
34064
34083
|
const spaRoutesPath = join55(buildDir, "spa-routes.json");
|
|
34065
|
-
if (
|
|
34084
|
+
if (existsSync40(spaRoutesPath)) {
|
|
34066
34085
|
setSpaRouteManifest(JSON.parse(readFileSync36(spaRoutesPath, "utf-8")));
|
|
34067
34086
|
}
|
|
34068
34087
|
recordStep("load production conventions", stepStartedAt);
|
|
@@ -34180,7 +34199,7 @@ import { buildGlobalWSHandler } from "elysia/ws";
|
|
|
34180
34199
|
// src/dev/devCert.ts
|
|
34181
34200
|
import {
|
|
34182
34201
|
copyFileSync as copyFileSync3,
|
|
34183
|
-
existsSync as
|
|
34202
|
+
existsSync as existsSync41,
|
|
34184
34203
|
mkdirSync as mkdirSync17,
|
|
34185
34204
|
readFileSync as readFileSync37,
|
|
34186
34205
|
rmSync as rmSync4
|
|
@@ -34196,7 +34215,7 @@ var DEFAULT_CERTIFICATE_HOSTS = ["localhost", "127.0.0.1", "::1"];
|
|
|
34196
34215
|
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
34216
|
var devLog = (msg) => console.log(`\x1B[2m${new Date().toLocaleTimeString()}\x1B[0m \x1B[36m[dev]\x1B[0m ${msg}`);
|
|
34198
34217
|
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 = () =>
|
|
34218
|
+
var certFilesExist = () => existsSync41(CERT_PATH) && existsSync41(KEY_PATH);
|
|
34200
34219
|
var normalizeDevCertificateHosts = (hosts = []) => {
|
|
34201
34220
|
const normalized = new Set(DEFAULT_CERTIFICATE_HOSTS);
|
|
34202
34221
|
for (const host2 of hosts) {
|
|
@@ -34673,7 +34692,7 @@ var generateHeadElement = ({
|
|
|
34673
34692
|
};
|
|
34674
34693
|
// src/utils/defineEnv.ts
|
|
34675
34694
|
var {env: bunEnv } = globalThis.Bun;
|
|
34676
|
-
import { existsSync as
|
|
34695
|
+
import { existsSync as existsSync43, readFileSync as readFileSync40 } from "fs";
|
|
34677
34696
|
import { resolve as resolve51 } from "path";
|
|
34678
34697
|
|
|
34679
34698
|
// node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
|
|
@@ -40710,7 +40729,7 @@ ${lines.join(`
|
|
|
40710
40729
|
var checkEnvFileSecurity = (properties) => {
|
|
40711
40730
|
const cwd2 = process.cwd();
|
|
40712
40731
|
const envPath = resolve51(cwd2, ".env");
|
|
40713
|
-
if (!
|
|
40732
|
+
if (!existsSync43(envPath))
|
|
40714
40733
|
return;
|
|
40715
40734
|
const sensitiveKeys = Object.keys(properties).filter(isSensitive);
|
|
40716
40735
|
if (sensitiveKeys.length === 0)
|
|
@@ -40720,7 +40739,7 @@ var checkEnvFileSecurity = (properties) => {
|
|
|
40720
40739
|
if (presentKeys.length === 0)
|
|
40721
40740
|
return;
|
|
40722
40741
|
const gitignorePath = resolve51(cwd2, ".gitignore");
|
|
40723
|
-
if (
|
|
40742
|
+
if (existsSync43(gitignorePath)) {
|
|
40724
40743
|
const gitignore = readFileSync40(gitignorePath, "utf-8");
|
|
40725
40744
|
if (gitignore.split(`
|
|
40726
40745
|
`).some((line) => line.trim() === ".env"))
|
|
@@ -40753,7 +40772,7 @@ var getEnv = (key) => {
|
|
|
40753
40772
|
return environmentVariable;
|
|
40754
40773
|
};
|
|
40755
40774
|
// src/utils/projectRoot.ts
|
|
40756
|
-
import { existsSync as
|
|
40775
|
+
import { existsSync as existsSync44 } from "fs";
|
|
40757
40776
|
import { dirname as dirname34, resolve as resolve52 } from "path";
|
|
40758
40777
|
var CONFIG_CANDIDATES = [
|
|
40759
40778
|
"absolute.config.ts",
|
|
@@ -40763,7 +40782,7 @@ var CONFIG_CANDIDATES = [
|
|
|
40763
40782
|
"absolute.config.mts",
|
|
40764
40783
|
"absolute.config.cts"
|
|
40765
40784
|
];
|
|
40766
|
-
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) =>
|
|
40785
|
+
var hasAbsoluteConfig = (directory) => CONFIG_CANDIDATES.some((name) => existsSync44(resolve52(directory, name)));
|
|
40767
40786
|
var findProjectRoot = () => {
|
|
40768
40787
|
const start = process.cwd();
|
|
40769
40788
|
let packageRoot = null;
|
|
@@ -40772,7 +40791,7 @@ var findProjectRoot = () => {
|
|
|
40772
40791
|
if (hasAbsoluteConfig(directory)) {
|
|
40773
40792
|
return directory;
|
|
40774
40793
|
}
|
|
40775
|
-
if (packageRoot === null &&
|
|
40794
|
+
if (packageRoot === null && existsSync44(resolve52(directory, "package.json"))) {
|
|
40776
40795
|
packageRoot = directory;
|
|
40777
40796
|
}
|
|
40778
40797
|
const parent = dirname34(directory);
|
|
@@ -41021,5 +41040,5 @@ export {
|
|
|
41021
41040
|
wrapPageHandlerWithStreamingSlots
|
|
41022
41041
|
};
|
|
41023
41042
|
|
|
41024
|
-
//# debugId=
|
|
41043
|
+
//# debugId=F434733973E11FBE64756E2164756E21
|
|
41025
41044
|
//# sourceMappingURL=index.js.map
|