@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/build.js CHANGED
@@ -12882,10 +12882,11 @@ var isTestSourcePath = (file) => {
12882
12882
  };
12883
12883
 
12884
12884
  // src/mobile/deviceCapabilities.ts
12885
- import { readFileSync as readFileSync13 } from "fs";
12885
+ import { existsSync as existsSync20, readFileSync as readFileSync13 } from "fs";
12886
12886
  import { extname as extname7, join as join24, relative as relative11, resolve as resolve20 } from "path";
12887
+ import { fileURLToPath as fileURLToPath2 } from "url";
12887
12888
  import ts8 from "typescript";
12888
- var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/devices-capacitor", SOURCE_GLOB, IGNORED_DIRECTORIES, IDENTIFIER_PATTERN, CAPACITOR_MODULE_PATTERN, CAPACITOR_PACKAGE_PATTERN, 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) => {
12889
+ 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) => {
12889
12890
  const value = JSON.parse(readFileSync13(path, "utf8"));
12890
12891
  if (!object(value))
12891
12892
  throw new TypeError(`${path} must contain an object.`);
@@ -12945,7 +12946,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
12945
12946
  ...systemBars === true ? { systemBars: true } : {},
12946
12947
  ...usageDescriptions === undefined ? {} : { usageDescriptions: [...usageDescriptions] }
12947
12948
  };
12948
- }, parseProvider = (name, value) => {
12949
+ }, parseProvider = (name, value, providerName) => {
12949
12950
  if (!IDENTIFIER_PATTERN.test(name))
12950
12951
  throw new TypeError("Device capability names must be identifiers.");
12951
12952
  if (!object(value))
@@ -12954,10 +12955,13 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
12954
12955
  const module = text(value.module, `${name}.module`);
12955
12956
  if (!IDENTIFIER_PATTERN.test(factory))
12956
12957
  throw new TypeError(`${name}.factory must be a JavaScript identifier.`);
12957
- if (!CAPACITOR_MODULE_PATTERN.test(module))
12958
- throw new TypeError(`${name}.module must be an official devices-capacitor subpath.`);
12959
- if (!Array.isArray(value.packages) || !value.packages.every((spec) => typeof spec === "string" && CAPACITOR_PACKAGE_PATTERN.test(spec)))
12960
- throw new TypeError(`${name}.packages must contain exact official Capacitor package versions.`);
12958
+ if (!providerModulePattern(providerName).test(module))
12959
+ throw new TypeError(`${name}.module must be an official devices-${providerName} subpath.`);
12960
+ if (!Array.isArray(value.packages) || !value.packages.every((spec) => typeof spec === "string" && providerPackagePattern(providerName).test(spec)))
12961
+ throw new TypeError(`${name}.packages must contain exact official ${providerLabel(providerName)} package versions.`);
12962
+ const { plugins } = value;
12963
+ if (plugins !== undefined && (!Array.isArray(plugins) || !plugins.every((plugin) => typeof plugin === "string" && /^expo-[a-z][a-z0-9-]*$/u.test(plugin))))
12964
+ throw new TypeError(`${name}.plugins must contain Expo config plugin names.`);
12961
12965
  let native;
12962
12966
  const { native: nativeMetadata } = value;
12963
12967
  if (nativeMetadata !== undefined) {
@@ -12975,6 +12979,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
12975
12979
  factory,
12976
12980
  module,
12977
12981
  ...native === undefined ? {} : { native },
12982
+ ...plugins === undefined ? {} : { plugins: [...plugins] },
12978
12983
  packages: [...value.packages]
12979
12984
  };
12980
12985
  }, absoluteDeviceNativeRequirements = (plan) => {
@@ -13004,18 +13009,27 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
13004
13009
  ...new Set(plan.capabilities.flatMap((name) => plan.providers[name]?.native?.ios?.usageDescriptions ?? []))
13005
13010
  ].sort()
13006
13011
  };
13007
- }, loadAbsoluteDeviceCapabilityProviders = (projectRoot) => {
13008
- const path = join24(resolve20(projectRoot), "node_modules", CAPACITOR_ADAPTER, "package.json");
13012
+ }, loadAbsoluteDeviceCapabilityProviders = (projectRoot, provider = "capacitor") => {
13013
+ const adapter = ADAPTERS[provider];
13014
+ let path = join24(resolve20(projectRoot), "node_modules", adapter, "package.json");
13015
+ try {
13016
+ readFileSync13(path, "utf8");
13017
+ } catch {
13018
+ path = fileURLToPath2(import.meta.resolve(`${adapter}/package.json`));
13019
+ }
13009
13020
  const manifest = readJson(path);
13010
13021
  const { absolutejs } = manifest;
13011
13022
  const devices = object(absolutejs) ? absolutejs.devices : undefined;
13012
- if (!object(devices) || devices.format !== 1 || devices.provider !== "capacitor" || !object(devices.capabilities))
13013
- throw new TypeError(`${CAPACITOR_ADAPTER} does not publish supported capability metadata.`);
13014
- const entries = Object.entries(devices.capabilities).map(([name, provider]) => ({
13023
+ if (!object(devices) || devices.format !== 1 || devices.provider !== provider || !object(devices.capabilities))
13024
+ throw new TypeError(`${adapter} does not publish supported capability metadata.`);
13025
+ const entries = Object.entries(devices.capabilities).map(([name, capability]) => ({
13015
13026
  name,
13016
- provider: parseProvider(name, provider)
13027
+ provider: parseProvider(name, capability, provider)
13017
13028
  }));
13018
- return Object.fromEntries(entries.sort((left, right) => left.name.localeCompare(right.name)).map(({ name, provider }) => [name, provider]));
13029
+ return Object.fromEntries(entries.sort((left, right) => left.name.localeCompare(right.name)).map(({ name, provider: capabilityProvider }) => [
13030
+ name,
13031
+ capabilityProvider
13032
+ ]));
13019
13033
  }, isIgnored = (path) => path.split("/").some((segment) => IGNORED_DIRECTORIES.has(segment)), importedCapabilities = (source, file) => {
13020
13034
  const names = new Set;
13021
13035
  const namespaces = new Set;
@@ -13072,6 +13086,8 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
13072
13086
  return packages;
13073
13087
  }, discoverAbsoluteDeviceCapabilities = (projectRoot, providers = loadAbsoluteDeviceCapabilityProviders(projectRoot)) => {
13074
13088
  const root = resolve20(projectRoot);
13089
+ if (!existsSync20(root))
13090
+ return [];
13075
13091
  const known = new Set(Object.keys(providers));
13076
13092
  const capabilities = new Set;
13077
13093
  for (const path of SOURCE_GLOB.scanSync({ cwd: root })) {
@@ -13098,14 +13114,14 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
13098
13114
  return true;
13099
13115
  }
13100
13116
  return false;
13101
- }, resolveAbsoluteDeviceCapabilityPlan = (projectRoot) => {
13102
- const allProviders = loadAbsoluteDeviceCapabilityProviders(projectRoot);
13117
+ }, resolveAbsoluteDeviceCapabilityPlan = (projectRoot, provider = "capacitor") => {
13118
+ const allProviders = loadAbsoluteDeviceCapabilityProviders(projectRoot, provider);
13103
13119
  const capabilities = discoverAbsoluteDeviceCapabilities(projectRoot, allProviders);
13104
13120
  const providers = {};
13105
13121
  for (const name of capabilities) {
13106
- const provider = allProviders[name];
13107
- if (provider)
13108
- providers[name] = provider;
13122
+ const capabilityProvider = allProviders[name];
13123
+ if (capabilityProvider)
13124
+ providers[name] = capabilityProvider;
13109
13125
  }
13110
13126
  return {
13111
13127
  capabilities,
@@ -13116,6 +13132,10 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
13116
13132
  };
13117
13133
  };
13118
13134
  var init_deviceCapabilities = __esm(() => {
13135
+ ADAPTERS = {
13136
+ capacitor: "@absolutejs/devices-capacitor",
13137
+ expo: "@absolutejs/devices-expo"
13138
+ };
13119
13139
  SOURCE_GLOB = new Bun.Glob("**/*.{js,jsx,ts,tsx,svelte,vue}");
13120
13140
  IGNORED_DIRECTORIES = new Set([
13121
13141
  ".absolutejs",
@@ -13129,8 +13149,6 @@ var init_deviceCapabilities = __esm(() => {
13129
13149
  "tests"
13130
13150
  ]);
13131
13151
  IDENTIFIER_PATTERN = /^[A-Za-z_$][\w$]*$/u;
13132
- CAPACITOR_MODULE_PATTERN = /^@absolutejs\/devices-capacitor\/[a-z][a-z0-9-]*$/u;
13133
- CAPACITOR_PACKAGE_PATTERN = /^@capacitor\/[a-z][a-z0-9-]*@\d+\.\d+\.\d+$/u;
13134
13152
  ANDROID_PERMISSION_PATTERN = /^android\.permission\.[A-Z][A-Z0-9_]*$/u;
13135
13153
  IOS_USAGE_DESCRIPTIONS = new Set([
13136
13154
  "camera",
@@ -14142,7 +14160,7 @@ var exports_parseAngularConfigImports = {};
14142
14160
  __export(exports_parseAngularConfigImports, {
14143
14161
  parseAngularProvidersImport: () => parseAngularProvidersImport
14144
14162
  });
14145
- import { existsSync as existsSync20, readFileSync as readFileSync18 } from "fs";
14163
+ import { existsSync as existsSync21, readFileSync as readFileSync18 } from "fs";
14146
14164
  import { dirname as dirname15, isAbsolute as isAbsolute3, join as join30 } from "path";
14147
14165
  import ts12 from "typescript";
14148
14166
  var findDefineConfigCall = (sf) => {
@@ -14199,7 +14217,7 @@ var findDefineConfigCall = (sf) => {
14199
14217
  const envOverride = process.env.ABSOLUTE_CONFIG;
14200
14218
  if (envOverride) {
14201
14219
  const resolved = isAbsolute3(envOverride) ? envOverride : join30(projectRoot, envOverride);
14202
- if (existsSync20(resolved))
14220
+ if (existsSync21(resolved))
14203
14221
  return resolved;
14204
14222
  }
14205
14223
  const candidates = [
@@ -14209,7 +14227,7 @@ var findDefineConfigCall = (sf) => {
14209
14227
  join30(projectRoot, "absolute.config.mjs")
14210
14228
  ];
14211
14229
  for (const candidate of candidates) {
14212
- if (existsSync20(candidate))
14230
+ if (existsSync21(candidate))
14213
14231
  return candidate;
14214
14232
  }
14215
14233
  return null;
@@ -14387,7 +14405,7 @@ __export(exports_compileSvelte, {
14387
14405
  clearSvelteCompilerCache: () => clearSvelteCompilerCache,
14388
14406
  compileSvelte: () => compileSvelte
14389
14407
  });
14390
- import { existsSync as existsSync21 } from "fs";
14408
+ import { existsSync as existsSync22 } from "fs";
14391
14409
  import { mkdir as mkdir6, stat as stat2 } from "fs/promises";
14392
14410
  import {
14393
14411
  dirname as dirname16,
@@ -14403,11 +14421,11 @@ var {write: write2, file, Transpiler: Transpiler2 } = globalThis.Bun;
14403
14421
  var resolveDevClientDir2 = () => {
14404
14422
  const projectRoot = process.cwd();
14405
14423
  const fromSource = resolve22(import.meta.dir, "../dev/client");
14406
- if (existsSync21(fromSource) && fromSource.startsWith(projectRoot)) {
14424
+ if (existsSync22(fromSource) && fromSource.startsWith(projectRoot)) {
14407
14425
  return fromSource;
14408
14426
  }
14409
14427
  const fromNodeModules = resolve22(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
14410
- if (existsSync21(fromNodeModules))
14428
+ if (existsSync22(fromNodeModules))
14411
14429
  return fromNodeModules;
14412
14430
  return resolve22(import.meta.dir, "./dev/client");
14413
14431
  }, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
@@ -14510,7 +14528,7 @@ var resolveDevClientDir2 = () => {
14510
14528
  const contentHash = Bun.hash(raw).toString(BASE_36_RADIX);
14511
14529
  const prevHash = sourceHashCache.get(src);
14512
14530
  const persistent = persistentCache.get(src);
14513
- if (prevHash === contentHash && persistent && existsSync21(persistent.ssr) && existsSync21(persistent.client)) {
14531
+ if (prevHash === contentHash && persistent && existsSync22(persistent.ssr) && existsSync22(persistent.client)) {
14514
14532
  cache.set(src, persistent);
14515
14533
  return persistent;
14516
14534
  }
@@ -15232,7 +15250,7 @@ __export(exports_compileVue, {
15232
15250
  generateVueHmrId: () => generateVueHmrId,
15233
15251
  vueHmrMetadata: () => vueHmrMetadata
15234
15252
  });
15235
- import { existsSync as existsSync22, readFileSync as readFileSync20, realpathSync as realpathSync2 } from "fs";
15253
+ import { existsSync as existsSync23, readFileSync as readFileSync20, realpathSync as realpathSync2 } from "fs";
15236
15254
  import { mkdir as mkdir7 } from "fs/promises";
15237
15255
  import {
15238
15256
  basename as basename11,
@@ -15246,11 +15264,11 @@ var {file: file2, write: write3, Transpiler: Transpiler3 } = globalThis.Bun;
15246
15264
  var resolveDevClientDir3 = () => {
15247
15265
  const projectRoot = process.cwd();
15248
15266
  const fromSource = resolve23(import.meta.dir, "../dev/client");
15249
- if (existsSync22(fromSource) && fromSource.startsWith(projectRoot)) {
15267
+ if (existsSync23(fromSource) && fromSource.startsWith(projectRoot)) {
15250
15268
  return fromSource;
15251
15269
  }
15252
15270
  const fromNodeModules = resolve23(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
15253
- if (existsSync22(fromNodeModules))
15271
+ if (existsSync23(fromNodeModules))
15254
15272
  return fromNodeModules;
15255
15273
  return resolve23(import.meta.dir, "./dev/client");
15256
15274
  }, devClientDir3, hmrClientPath4, transpiler4, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
@@ -15303,7 +15321,7 @@ var resolveDevClientDir3 = () => {
15303
15321
  const importRegex = /@import\s+(?:url\(\s*)?(['"])(\.{1,2}\/[^'"]+)\1\s*\)?\s*;?/g;
15304
15322
  return cssContent.replace(importRegex, (match, _quote, relPath) => {
15305
15323
  const importedPath = resolve23(dirname17(cssFilePath), relPath);
15306
- if (!existsSync22(importedPath))
15324
+ if (!existsSync23(importedPath))
15307
15325
  return match;
15308
15326
  const importedContent = readFileSync20(importedPath, "utf-8");
15309
15327
  return inlineCssImports(importedContent, importedPath, visited);
@@ -15312,10 +15330,10 @@ var resolveDevClientDir3 = () => {
15312
15330
  if (helper.endsWith(".ts"))
15313
15331
  return resolve23(sourceDir, helper);
15314
15332
  const direct = resolve23(sourceDir, `${helper}.ts`);
15315
- if (existsSync22(direct))
15333
+ if (existsSync23(direct))
15316
15334
  return direct;
15317
15335
  const indexed = resolve23(sourceDir, helper, "index.ts");
15318
- if (existsSync22(indexed))
15336
+ if (existsSync23(indexed))
15319
15337
  return indexed;
15320
15338
  return direct;
15321
15339
  }, toJs = (filePath, sourceDir) => {
@@ -15331,10 +15349,10 @@ var resolveDevClientDir3 = () => {
15331
15349
  }
15332
15350
  if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
15333
15351
  const directTs = resolve23(sourceDir, `${filePath}.ts`);
15334
- if (existsSync22(directTs))
15352
+ if (existsSync23(directTs))
15335
15353
  return `${filePath}.js`;
15336
15354
  const indexedTs = resolve23(sourceDir, filePath, "index.ts");
15337
- if (existsSync22(indexedTs))
15355
+ if (existsSync23(indexedTs))
15338
15356
  return `${filePath}/index.js`;
15339
15357
  }
15340
15358
  return `${filePath}.js`;
@@ -15395,7 +15413,7 @@ const ${localName} = (source) => ${importedName}(
15395
15413
  const contentHash = Bun.hash(sourceContent).toString(BASE_36_RADIX);
15396
15414
  const prevHash = vueSourceHashCache.get(sourceFilePath);
15397
15415
  const persistent = persistentBuildCache.get(sourceFilePath);
15398
- if (prevHash === contentHash && persistent && existsSync22(persistent.clientPath) && existsSync22(persistent.serverPath)) {
15416
+ if (prevHash === contentHash && persistent && existsSync23(persistent.clientPath) && existsSync23(persistent.serverPath)) {
15399
15417
  cacheMap.set(sourceFilePath, persistent);
15400
15418
  return persistent;
15401
15419
  }
@@ -15435,8 +15453,8 @@ const ${localName} = (source) => ${importedName}(
15435
15453
  const hasScript = descriptor.script || descriptor.scriptSetup;
15436
15454
  const compiledScript = hasScript ? compiler.compileScript(descriptor, {
15437
15455
  fs: {
15438
- fileExists: existsSync22,
15439
- readFile: (file3) => existsSync22(file3) ? readFileSync20(file3, "utf-8") : undefined,
15456
+ fileExists: existsSync23,
15457
+ readFile: (file3) => existsSync23(file3) ? readFileSync20(file3, "utf-8") : undefined,
15440
15458
  realpath: realpathSync2
15441
15459
  },
15442
15460
  id: componentId,
@@ -15598,7 +15616,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
15598
15616
  const routes = parseVueSpaRoutes(descriptor.script?.content ?? "");
15599
15617
  for (const { importPath } of routes) {
15600
15618
  const childPath = resolve23(dirname17(entryPath), importPath);
15601
- if (expanded.has(childPath) || !existsSync22(childPath)) {
15619
+ if (expanded.has(childPath) || !existsSync23(childPath)) {
15602
15620
  continue;
15603
15621
  }
15604
15622
  expanded.add(childPath);
@@ -15804,7 +15822,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
15804
15822
  continue;
15805
15823
  }
15806
15824
  const resolved = resolveHelperTsPath(helperDir, dep);
15807
- if (!existsSync22(resolved))
15825
+ if (!existsSync23(resolved))
15808
15826
  continue;
15809
15827
  if (allTsHelperPaths.has(resolved))
15810
15828
  continue;
@@ -16331,7 +16349,7 @@ __export(exports_compileAngular, {
16331
16349
  compileAngularFiles: () => compileAngularFiles,
16332
16350
  invalidateAngularJitCache: () => invalidateAngularJitCache
16333
16351
  });
16334
- import { existsSync as existsSync23, readFileSync as readFileSync21, promises as fs5 } from "fs";
16352
+ import { existsSync as existsSync24, readFileSync as readFileSync21, promises as fs5 } from "fs";
16335
16353
  import { join as join33, basename as basename12, sep as sep3, dirname as dirname18, resolve as resolve24, relative as relative14 } from "path";
16336
16354
  var {Glob: Glob6 } = globalThis.Bun;
16337
16355
  import ts14 from "typescript";
@@ -16388,7 +16406,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
16388
16406
  join33(candidate, "index.js"),
16389
16407
  join33(candidate, "index.jsx")
16390
16408
  ];
16391
- return candidates.find((file3) => existsSync23(file3));
16409
+ return candidates.find((file3) => existsSync24(file3));
16392
16410
  }, createLegacyAngularAnimationUsageResolver = (rootDir) => {
16393
16411
  const baseDir = resolve24(rootDir);
16394
16412
  const tsconfigAliases = readTsconfigPathAliases();
@@ -16469,11 +16487,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
16469
16487
  }, resolveDevClientDir4 = () => {
16470
16488
  const projectRoot = process.cwd();
16471
16489
  const fromSource = resolve24(import.meta.dir, "../dev/client");
16472
- if (existsSync23(fromSource) && fromSource.startsWith(projectRoot)) {
16490
+ if (existsSync24(fromSource) && fromSource.startsWith(projectRoot)) {
16473
16491
  return fromSource;
16474
16492
  }
16475
16493
  const fromNodeModules = resolve24(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
16476
- if (existsSync23(fromNodeModules))
16494
+ if (existsSync24(fromNodeModules))
16477
16495
  return fromNodeModules;
16478
16496
  return resolve24(import.meta.dir, "./dev/client");
16479
16497
  }, devClientDir4, hmrClientPath5, formatDiagnosticMessage = (diagnostic) => {
@@ -16519,11 +16537,11 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
16519
16537
  return `${path}${query}`;
16520
16538
  const importerDir = dirname18(importerOutputPath);
16521
16539
  const fileCandidate = resolve24(importerDir, `${path}.js`);
16522
- if (outputFiles?.has(fileCandidate) || existsSync23(fileCandidate)) {
16540
+ if (outputFiles?.has(fileCandidate) || existsSync24(fileCandidate)) {
16523
16541
  return `${path}.js${query}`;
16524
16542
  }
16525
16543
  const indexCandidate = resolve24(importerDir, path, "index.js");
16526
- if (outputFiles?.has(indexCandidate) || existsSync23(indexCandidate)) {
16544
+ if (outputFiles?.has(indexCandidate) || existsSync24(indexCandidate)) {
16527
16545
  return `${path}/index.js${query}`;
16528
16546
  }
16529
16547
  return `${path}.js${query}`;
@@ -16561,7 +16579,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
16561
16579
  join33(basePath, "index.mts"),
16562
16580
  join33(basePath, "index.cts")
16563
16581
  ];
16564
- return candidates.map((candidate) => resolve24(candidate)).find((candidate) => existsSync23(candidate) && !candidate.endsWith(".d.ts")) ?? null;
16582
+ return candidates.map((candidate) => resolve24(candidate)).find((candidate) => existsSync24(candidate) && !candidate.endsWith(".d.ts")) ?? null;
16565
16583
  }, readFileForAotTransform = async (fileName, readFile6) => {
16566
16584
  const hostSource = readFile6?.(fileName);
16567
16585
  if (typeof hostSource === "string")
@@ -16642,7 +16660,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
16642
16660
  if (visited.has(resolvedPath))
16643
16661
  return;
16644
16662
  visited.add(resolvedPath);
16645
- if (!existsSync23(resolvedPath) || resolvedPath.endsWith(".d.ts"))
16663
+ if (!existsSync24(resolvedPath) || resolvedPath.endsWith(".d.ts"))
16646
16664
  return;
16647
16665
  stats.filesVisited += 1;
16648
16666
  const source = await readFileForAotTransform(resolvedPath, readFile6);
@@ -16816,7 +16834,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
16816
16834
  return null;
16817
16835
  }, resolveAngularDeferImportSpecifier = () => {
16818
16836
  const sourceEntry = resolve24(import.meta.dir, "../angular/components/index.ts");
16819
- if (existsSync23(sourceEntry)) {
16837
+ if (existsSync24(sourceEntry)) {
16820
16838
  return sourceEntry.replace(/\\/g, "/");
16821
16839
  }
16822
16840
  return "@absolutejs/absolute/angular/components";
@@ -16944,7 +16962,7 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
16944
16962
  ${fields}
16945
16963
  `);
16946
16964
  }, readAndEscapeFile = async (filePath, stylePreprocessors) => {
16947
- if (!existsSync23(filePath)) {
16965
+ if (!existsSync24(filePath)) {
16948
16966
  throw new Error(`Unable to inline Angular style resource: file not found at ${filePath}`);
16949
16967
  }
16950
16968
  const content = await compileStyleFileIfNeeded(filePath, stylePreprocessors);
@@ -16953,7 +16971,7 @@ ${fields}
16953
16971
  const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
16954
16972
  if (templateUrlMatch?.[1]) {
16955
16973
  const templatePath = join33(fileDir, templateUrlMatch[1]);
16956
- if (!existsSync23(templatePath)) {
16974
+ if (!existsSync24(templatePath)) {
16957
16975
  throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
16958
16976
  }
16959
16977
  const templateRaw2 = await fs5.readFile(templatePath, "utf-8");
@@ -16984,7 +17002,7 @@ ${fields}
16984
17002
  const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
16985
17003
  if (templateUrlMatch?.[1]) {
16986
17004
  const templatePath = join33(fileDir, templateUrlMatch[1]);
16987
- if (!existsSync23(templatePath)) {
17005
+ if (!existsSync24(templatePath)) {
16988
17006
  throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
16989
17007
  }
16990
17008
  const templateRaw2 = readFileSync21(templatePath, "utf-8");
@@ -17132,7 +17150,7 @@ ${fields}
17132
17150
  join33(candidate, "index.js"),
17133
17151
  join33(candidate, "index.jsx")
17134
17152
  ];
17135
- return candidates.find((file3) => existsSync23(file3));
17153
+ return candidates.find((file3) => existsSync24(file3));
17136
17154
  };
17137
17155
  const resolveLocalImport = (specifier, fromDir) => {
17138
17156
  if (specifier.startsWith(".") || specifier.startsWith("/")) {
@@ -17207,7 +17225,7 @@ ${fields}
17207
17225
  if (visited.has(resolved))
17208
17226
  return;
17209
17227
  visited.add(resolved);
17210
- if (resolved.endsWith(".json") && existsSync23(resolved)) {
17228
+ if (resolved.endsWith(".json") && existsSync24(resolved)) {
17211
17229
  const inputDir2 = dirname18(resolved);
17212
17230
  const relativeDir2 = inputDir2.startsWith(baseDir) ? inputDir2.substring(baseDir.length + 1) : inputDir2;
17213
17231
  const targetDir2 = join33(outDir, relativeDir2);
@@ -17220,7 +17238,7 @@ ${fields}
17220
17238
  let actualPath = resolved;
17221
17239
  if (!actualPath.endsWith(".ts"))
17222
17240
  actualPath += ".ts";
17223
- if (!existsSync23(actualPath))
17241
+ if (!existsSync24(actualPath))
17224
17242
  return;
17225
17243
  let sourceCode = await fs5.readFile(actualPath, "utf-8");
17226
17244
  const inlined = await inlineResources(sourceCode, dirname18(actualPath), stylePreprocessors);
@@ -17258,7 +17276,7 @@ ${fields}
17258
17276
  const isEntry = resolve24(actualPath) === resolve24(entryPath);
17259
17277
  const contentHash = Bun.hash(sourceCode).toString(BASE_36_RADIX);
17260
17278
  const cacheKey2 = actualPath;
17261
- const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync23(targetPath);
17279
+ const shouldWriteFile = cacheBuster && isEntry ? true : jitContentCache.get(cacheKey2) !== contentHash || !existsSync24(targetPath);
17262
17280
  if (shouldWriteFile) {
17263
17281
  const processedContent = transpileAndRewrite(sourceCode, relativeDir, actualPath, importRewrites);
17264
17282
  const preservedInjection = await readPreservedInjection(targetPath);
@@ -17271,7 +17289,7 @@ ${fields}
17271
17289
  };
17272
17290
  await transpileFile(inputPath);
17273
17291
  const entryOutputPath = toOutputPath(entryPath);
17274
- if (existsSync23(entryOutputPath)) {
17292
+ if (existsSync24(entryOutputPath)) {
17275
17293
  const entryOutput = await fs5.readFile(entryOutputPath, "utf-8");
17276
17294
  const withoutLegacyFlag = entryOutput.replace(/\nexport const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;\n?/g, `
17277
17295
  `);
@@ -17297,7 +17315,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
17297
17315
  await traceAngularPhase("aot/copy-json-resources", async () => {
17298
17316
  const cwd = process.cwd();
17299
17317
  const angularSrcDir = resolve24(outRoot);
17300
- if (!existsSync23(angularSrcDir))
17318
+ if (!existsSync24(angularSrcDir))
17301
17319
  return;
17302
17320
  const jsonGlob = new Glob6("**/*.json");
17303
17321
  for (const rel of jsonGlob.scanSync({
@@ -17332,15 +17350,15 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
17332
17350
  ...candidatePaths.map((file3) => resolve24(file3)),
17333
17351
  ...compiledFallbackPaths
17334
17352
  ];
17335
- let candidate = normalizedCandidates.find((file3) => existsSync23(file3) && file3.endsWith(`${sep3}${relativeEntry}`));
17353
+ let candidate = normalizedCandidates.find((file3) => existsSync24(file3) && file3.endsWith(`${sep3}${relativeEntry}`));
17336
17354
  if (!candidate) {
17337
- candidate = normalizedCandidates.find((file3) => existsSync23(file3) && file3.endsWith(`${sep3}pages${sep3}${jsName}`));
17355
+ candidate = normalizedCandidates.find((file3) => existsSync24(file3) && file3.endsWith(`${sep3}pages${sep3}${jsName}`));
17338
17356
  }
17339
17357
  if (!candidate) {
17340
- candidate = normalizedCandidates.find((file3) => existsSync23(file3) && file3.endsWith(`${sep3}${jsName}`));
17358
+ candidate = normalizedCandidates.find((file3) => existsSync24(file3) && file3.endsWith(`${sep3}${jsName}`));
17341
17359
  }
17342
17360
  if (!candidate) {
17343
- candidate = normalizedCandidates.find((file3) => existsSync23(file3));
17361
+ candidate = normalizedCandidates.find((file3) => existsSync24(file3));
17344
17362
  }
17345
17363
  return candidate;
17346
17364
  };
@@ -17348,11 +17366,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
17348
17366
  if (!rawServerFile) {
17349
17367
  rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-fallback", () => resolveRawServerFile([]), { entry: resolvedEntry });
17350
17368
  }
17351
- if (rawServerFile && !existsSync23(rawServerFile)) {
17369
+ if (rawServerFile && !existsSync24(rawServerFile)) {
17352
17370
  outputs = hmr ? await compileEntry() : aotOutputs;
17353
17371
  rawServerFile = await traceAngularPhase("wrapper/resolve-server-output-retry", () => resolveRawServerFile(outputs), { entry: resolvedEntry });
17354
17372
  }
17355
- if (!rawServerFile || !existsSync23(rawServerFile)) {
17373
+ if (!rawServerFile || !existsSync24(rawServerFile)) {
17356
17374
  throw new Error(`Compiled output not found for ${entry}. Looking for: ${jsName}. Available: ${[
17357
17375
  ...outputs,
17358
17376
  ...compiledFallbackPaths
@@ -17388,7 +17406,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
17388
17406
  const serverContentHash = `${Bun.hash(original).toString(BASE_36_RADIX)}.${Bun.hash(providersHashInput).toString(BASE_36_RADIX)}`;
17389
17407
  const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
17390
17408
  const clientFile = join33(indexesDir, jsName);
17391
- if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync23(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
17409
+ if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync24(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
17392
17410
  return {
17393
17411
  clientPath: clientFile,
17394
17412
  indexUnchanged: true,
@@ -18393,7 +18411,7 @@ __export(exports_fastHmrCompiler, {
18393
18411
  takePendingModule: () => takePendingModule,
18394
18412
  tryFastHmr: () => tryFastHmr
18395
18413
  });
18396
- import { existsSync as existsSync24, readFileSync as readFileSync22, statSync as statSync2 } from "fs";
18414
+ import { existsSync as existsSync25, readFileSync as readFileSync22, statSync as statSync2 } from "fs";
18397
18415
  import { dirname as dirname19, extname as extname9, relative as relative15, resolve as resolve25 } from "path";
18398
18416
  import ts18 from "typescript";
18399
18417
  var fail = (reason, detail, location) => ({
@@ -18717,7 +18735,7 @@ var fail = (reason, detail, location) => ({
18717
18735
  `${base}/index.tsx`
18718
18736
  ];
18719
18737
  for (const candidate of candidates) {
18720
- if (!existsSync24(candidate))
18738
+ if (!existsSync25(candidate))
18721
18739
  continue;
18722
18740
  let content;
18723
18741
  try {
@@ -19482,7 +19500,7 @@ var fail = (reason, detail, location) => ({
19482
19500
  if (visited.has(startDtsPath))
19483
19501
  return null;
19484
19502
  visited.add(startDtsPath);
19485
- if (!existsSync24(startDtsPath))
19503
+ if (!existsSync25(startDtsPath))
19486
19504
  return null;
19487
19505
  let content;
19488
19506
  try {
@@ -19535,16 +19553,16 @@ var fail = (reason, detail, location) => ({
19535
19553
  `${base}/index.d.cts`
19536
19554
  ];
19537
19555
  for (const c of candidates) {
19538
- if (existsSync24(c))
19556
+ if (existsSync25(c))
19539
19557
  return c;
19540
19558
  }
19541
19559
  return null;
19542
19560
  }, findPackageDtsForJs = (jsPath) => {
19543
19561
  const sibling = jsPath.replace(/\.[mc]?js$/, ".d.ts");
19544
- if (existsSync24(sibling))
19562
+ if (existsSync25(sibling))
19545
19563
  return sibling;
19546
19564
  const mirror = jsPath.replace(/\/dist\//, "/dist/src/").replace(/\.[mc]?js$/, ".d.ts");
19547
- if (existsSync24(mirror))
19565
+ if (existsSync25(mirror))
19548
19566
  return mirror;
19549
19567
  return null;
19550
19568
  }, resolveChildComponentInfo = (className, spec, componentDir, projectRoot) => {
@@ -19557,7 +19575,7 @@ var fail = (reason, detail, location) => ({
19557
19575
  `${base}/index.tsx`
19558
19576
  ];
19559
19577
  for (const candidate of candidates) {
19560
- if (!existsSync24(candidate))
19578
+ if (!existsSync25(candidate))
19561
19579
  continue;
19562
19580
  const info = getChildComponentInfoFromTsSource(candidate, className);
19563
19581
  if (info)
@@ -19771,11 +19789,11 @@ var fail = (reason, detail, location) => ({
19771
19789
  const resolved = resolve25(componentDir, spec);
19772
19790
  for (const ext of TS_EXTENSIONS) {
19773
19791
  const candidate = resolved + ext;
19774
- if (existsSync24(candidate))
19792
+ if (existsSync25(candidate))
19775
19793
  return candidate;
19776
19794
  }
19777
19795
  const indexCandidate = resolve25(resolved, "index.ts");
19778
- if (existsSync24(indexCandidate))
19796
+ if (existsSync25(indexCandidate))
19779
19797
  return indexCandidate;
19780
19798
  }
19781
19799
  return null;
@@ -20013,7 +20031,7 @@ ${transpiled}
20013
20031
  }${staticPatch}`;
20014
20032
  }, STYLE_PREPROCESSED_EXT, resolveAndReadStyleResource = (componentDir, url) => {
20015
20033
  const abs = resolve25(componentDir, url);
20016
- if (!existsSync24(abs))
20034
+ if (!existsSync25(abs))
20017
20035
  return null;
20018
20036
  const ext = extname9(abs).toLowerCase();
20019
20037
  if (!STYLE_PREPROCESSED_EXT.has(ext) || ext === ".css") {
@@ -20053,7 +20071,7 @@ ${block}
20053
20071
  return cached;
20054
20072
  const tsconfigPath = resolve25(projectRoot, "tsconfig.json");
20055
20073
  const opts = {};
20056
- if (existsSync24(tsconfigPath)) {
20074
+ if (existsSync25(tsconfigPath)) {
20057
20075
  try {
20058
20076
  const text2 = readFileSync22(tsconfigPath, "utf8");
20059
20077
  const parsed = ts18.parseConfigFileTextToJson(tsconfigPath, text2);
@@ -20080,7 +20098,7 @@ ${block}
20080
20098
  }, tryFastHmr = async (params) => {
20081
20099
  const { componentFilePath, className } = params;
20082
20100
  const projectRoot = params.projectRoot ?? process.cwd();
20083
- if (!existsSync24(componentFilePath)) {
20101
+ if (!existsSync25(componentFilePath)) {
20084
20102
  return fail("file-not-found", componentFilePath);
20085
20103
  }
20086
20104
  let compiler;
@@ -20136,7 +20154,7 @@ ${block}
20136
20154
  templatePath = componentFilePath;
20137
20155
  } else if (decoratorMeta.templateUrl) {
20138
20156
  const tplAbs = resolve25(componentDir, decoratorMeta.templateUrl);
20139
- if (!existsSync24(tplAbs)) {
20157
+ if (!existsSync25(tplAbs)) {
20140
20158
  return fail("template-resource-not-found", `Template file not found: ${tplAbs}`, { file: componentFilePath });
20141
20159
  }
20142
20160
  templateText = readFileSync22(tplAbs, "utf8");
@@ -20905,7 +20923,7 @@ __export(exports_compileEmber, {
20905
20923
  getEmberCompiledRoot: () => getEmberCompiledRoot,
20906
20924
  getEmberServerCompiledDir: () => getEmberServerCompiledDir
20907
20925
  });
20908
- import { existsSync as existsSync25 } from "fs";
20926
+ import { existsSync as existsSync26 } from "fs";
20909
20927
  import { mkdir as mkdir8, rm as rm5 } from "fs/promises";
20910
20928
  import { basename as basename13, dirname as dirname20, extname as extname10, join as join34, resolve as resolve26 } from "path";
20911
20929
  var {build: bunBuild2, Transpiler: Transpiler4, write: write4, file: file3 } = globalThis.Bun;
@@ -21007,7 +21025,7 @@ export const importSync = (specifier) => {
21007
21025
  const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
21008
21026
  for (const ext of extensionsToTry) {
21009
21027
  const candidate = candidateBase + ext;
21010
- if (existsSync25(candidate))
21028
+ if (existsSync26(candidate))
21011
21029
  return { path: candidate };
21012
21030
  }
21013
21031
  return;
@@ -21027,7 +21045,7 @@ export const importSync = (specifier) => {
21027
21045
  if (standalonePackages.has(args.path))
21028
21046
  return;
21029
21047
  const internal = join34(cwd, "node_modules/ember-source/dist/packages", args.path, "index.js");
21030
- if (existsSync25(internal))
21048
+ if (existsSync26(internal))
21031
21049
  return { path: internal };
21032
21050
  return;
21033
21051
  });
@@ -21157,7 +21175,7 @@ __export(exports_buildReactVendor, {
21157
21175
  buildReactVendor: () => buildReactVendor,
21158
21176
  computeVendorPaths: () => computeVendorPaths
21159
21177
  });
21160
- import { existsSync as existsSync26, mkdirSync as mkdirSync8 } from "fs";
21178
+ import { existsSync as existsSync27, mkdirSync as mkdirSync8 } from "fs";
21161
21179
  import { join as join35, resolve as resolve27 } from "path";
21162
21180
  import { rm as rm6 } from "fs/promises";
21163
21181
  var {build: bunBuild3 } = globalThis.Bun;
@@ -21171,7 +21189,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
21171
21189
  resolve27(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
21172
21190
  ];
21173
21191
  for (const candidate of candidates) {
21174
- if (existsSync26(candidate)) {
21192
+ if (existsSync27(candidate)) {
21175
21193
  return candidate.replace(/\\/g, "/");
21176
21194
  }
21177
21195
  }
@@ -21638,7 +21656,7 @@ var init_buildSvelteVendor = __esm(() => {
21638
21656
  import {
21639
21657
  copyFileSync as copyFileSync2,
21640
21658
  cpSync,
21641
- existsSync as existsSync27,
21659
+ existsSync as existsSync28,
21642
21660
  mkdirSync as mkdirSync12,
21643
21661
  readdirSync as readdirSync5,
21644
21662
  readFileSync as readFileSync23,
@@ -21871,7 +21889,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
21871
21889
  copyVueDevIndexes(vueDir, vuePagesPath, vueEntries, devIndexDir);
21872
21890
  }
21873
21891
  }, copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDir) => {
21874
- if (!existsSync27(reactIndexesPath)) {
21892
+ if (!existsSync28(reactIndexesPath)) {
21875
21893
  return;
21876
21894
  }
21877
21895
  const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
@@ -21887,7 +21905,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
21887
21905
  for (const entry of sveltePageEntries) {
21888
21906
  const name = basename14(entry).replace(/\.svelte(\.(ts|js))?$/, "");
21889
21907
  const indexFile = join39(svelteIndexDir, "pages", `${name}.js`);
21890
- if (!existsSync27(indexFile))
21908
+ if (!existsSync28(indexFile))
21891
21909
  continue;
21892
21910
  let content = readFileSync23(indexFile, "utf-8");
21893
21911
  const srcRel = relative16(process.cwd(), resolve28(entry)).replace(/\\/g, "/");
@@ -21900,7 +21918,7 @@ ${offenders.map((o3) => ` \u2022 ${o3}`).join(`
21900
21918
  for (const entry of vuePageEntries) {
21901
21919
  const name = basename14(entry, ".vue");
21902
21920
  const indexFile = join39(vueIndexDir, `${name}.js`);
21903
- if (!existsSync27(indexFile))
21921
+ if (!existsSync28(indexFile))
21904
21922
  continue;
21905
21923
  let content = readFileSync23(indexFile, "utf-8");
21906
21924
  const srcRel = relative16(process.cwd(), resolve28(entry)).replace(/\\/g, "/");
@@ -23144,7 +23162,7 @@ ${content.slice(firstUseIdx)}`;
23144
23162
  }
23145
23163
  if (!hmr) {
23146
23164
  const reactVendorDir = join39(buildPath, "react", "vendor");
23147
- const vendorChunkPaths = existsSync27(reactVendorDir) ? [
23165
+ const vendorChunkPaths = existsSync28(reactVendorDir) ? [
23148
23166
  ...new Glob8("**/*.js").scanSync({
23149
23167
  absolute: true,
23150
23168
  cwd: reactVendorDir
@@ -23570,7 +23588,7 @@ var init_build = __esm(() => {
23570
23588
  });
23571
23589
 
23572
23590
  // src/build/buildEmberVendor.ts
23573
- import { mkdirSync as mkdirSync13, existsSync as existsSync28 } from "fs";
23591
+ import { mkdirSync as mkdirSync13, existsSync as existsSync29 } from "fs";
23574
23592
  import { join as join40 } from "path";
23575
23593
  import { rm as rm10 } from "fs/promises";
23576
23594
  var {build: bunBuild8 } = globalThis.Bun;
@@ -23624,7 +23642,7 @@ export const importSync = (specifier) => {
23624
23642
  return { resolveTo: specifier, specifier };
23625
23643
  }
23626
23644
  const emberInternalPath = join40(cwd2, "node_modules/ember-source/dist/packages", specifier, "index.js");
23627
- if (!existsSync28(emberInternalPath)) {
23645
+ if (!existsSync29(emberInternalPath)) {
23628
23646
  throw new Error(`Ember vendor build: cannot find ${specifier} at ${emberInternalPath}. ` + `Is ember-source installed and at least 6.12?`);
23629
23647
  }
23630
23648
  return { resolveTo: emberInternalPath, specifier };
@@ -23656,7 +23674,7 @@ export const importSync = (specifier) => {
23656
23674
  return;
23657
23675
  }
23658
23676
  const internal = join40(cwd2, "node_modules/ember-source/dist/packages", args.path, "index.js");
23659
- if (existsSync28(internal)) {
23677
+ if (existsSync29(internal)) {
23660
23678
  return { path: internal };
23661
23679
  }
23662
23680
  return;
@@ -23828,7 +23846,7 @@ __export(exports_dependencyGraph, {
23828
23846
  getAffectedFiles: () => getAffectedFiles,
23829
23847
  removeFileFromGraph: () => removeFileFromGraph
23830
23848
  });
23831
- import { existsSync as existsSync29, readFileSync as readFileSync24 } from "fs";
23849
+ import { existsSync as existsSync30, readFileSync as readFileSync24 } from "fs";
23832
23850
  var {Glob: Glob9 } = globalThis.Bun;
23833
23851
  import { resolve as resolve29 } from "path";
23834
23852
  var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
@@ -23858,10 +23876,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
23858
23876
  ];
23859
23877
  for (const ext of extensions) {
23860
23878
  const withExt = normalized + ext;
23861
- if (existsSync29(withExt))
23879
+ if (existsSync30(withExt))
23862
23880
  return withExt;
23863
23881
  }
23864
- if (existsSync29(normalized))
23882
+ if (existsSync30(normalized))
23865
23883
  return normalized;
23866
23884
  return null;
23867
23885
  }, clearExistingDependents = (graph, normalizedPath) => {
@@ -23876,7 +23894,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
23876
23894
  }
23877
23895
  }, addFileToGraph = (graph, filePath) => {
23878
23896
  const normalizedPath = resolve29(filePath);
23879
- if (!existsSync29(normalizedPath))
23897
+ if (!existsSync30(normalizedPath))
23880
23898
  return;
23881
23899
  const dependencies = extractDependencies(normalizedPath);
23882
23900
  clearExistingDependents(graph, normalizedPath);
@@ -23902,7 +23920,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
23902
23920
  }, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
23903
23921
  const processedFiles = new Set;
23904
23922
  const glob = new Glob9("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
23905
- const resolvedDirs = directories.map((dir) => resolve29(dir)).filter((dir) => existsSync29(dir));
23923
+ const resolvedDirs = directories.map((dir) => resolve29(dir)).filter((dir) => existsSync30(dir));
23906
23924
  const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
23907
23925
  for (const file4 of allFiles) {
23908
23926
  const fullPath = resolve29(file4);
@@ -24156,7 +24174,7 @@ var init_clientManager = __esm(() => {
24156
24174
  });
24157
24175
 
24158
24176
  // src/dev/pathUtils.ts
24159
- import { existsSync as existsSync30, readdirSync as readdirSync6, readFileSync as readFileSync25 } from "fs";
24177
+ import { existsSync as existsSync31, readdirSync as readdirSync6, readFileSync as readFileSync25 } from "fs";
24160
24178
  import { dirname as dirname22, resolve as resolve31 } from "path";
24161
24179
  var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
24162
24180
  if (shouldIgnorePath(filePath, resolved)) {
@@ -24330,7 +24348,7 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
24330
24348
  push(cfg.stylesDir);
24331
24349
  for (const candidate of ["src", "db", "assets", "styles"]) {
24332
24350
  const abs = normalizePath(resolve31(cwd2, candidate));
24333
- if (existsSync30(abs) && !roots.includes(abs))
24351
+ if (existsSync31(abs) && !roots.includes(abs))
24334
24352
  roots.push(abs);
24335
24353
  }
24336
24354
  try {
@@ -24423,7 +24441,7 @@ var init_pathUtils = __esm(() => {
24423
24441
 
24424
24442
  // src/dev/fileWatcher.ts
24425
24443
  import { watch } from "fs";
24426
- import { existsSync as existsSync31, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
24444
+ import { existsSync as existsSync32, readdirSync as readdirSync7, statSync as statSync4 } from "fs";
24427
24445
  import { dirname as dirname23, join as join41, resolve as resolve32 } from "path";
24428
24446
  var safeRemoveFromGraph = (graph, fullPath) => {
24429
24447
  try {
@@ -24490,12 +24508,12 @@ var safeRemoveFromGraph = (graph, fullPath) => {
24490
24508
  if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
24491
24509
  return;
24492
24510
  }
24493
- if (event === "rename" && !existsSync31(fullPath)) {
24511
+ if (event === "rename" && !existsSync32(fullPath)) {
24494
24512
  safeRemoveFromGraph(state.dependencyGraph, fullPath);
24495
24513
  onFileChange(fullPath);
24496
24514
  return;
24497
24515
  }
24498
- if (existsSync31(fullPath)) {
24516
+ if (existsSync32(fullPath)) {
24499
24517
  onFileChange(fullPath);
24500
24518
  safeAddToGraph(state.dependencyGraph, fullPath);
24501
24519
  }
@@ -24505,7 +24523,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
24505
24523
  const stylesDir = state.resolvedPaths?.stylesDir;
24506
24524
  paths.forEach((path) => {
24507
24525
  const absolutePath = resolve32(path).replace(/\\/g, "/");
24508
- if (!existsSync31(absolutePath)) {
24526
+ if (!existsSync32(absolutePath)) {
24509
24527
  return;
24510
24528
  }
24511
24529
  const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
@@ -24516,7 +24534,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
24516
24534
  const stylesDir = state.resolvedPaths?.stylesDir;
24517
24535
  watchPaths.forEach((path) => {
24518
24536
  const absolutePath = resolve32(path).replace(/\\/g, "/");
24519
- if (!existsSync31(absolutePath)) {
24537
+ if (!existsSync32(absolutePath)) {
24520
24538
  return;
24521
24539
  }
24522
24540
  const isStylesDir = Boolean(stylesDir && absolutePath.startsWith(stylesDir));
@@ -25660,7 +25678,7 @@ __export(exports_moduleServer, {
25660
25678
  warmCompilers: () => warmCompilers,
25661
25679
  warnIfReactFastRefreshUnsupported: () => warnIfReactFastRefreshUnsupported
25662
25680
  });
25663
- import { existsSync as existsSync32, readFileSync as readFileSync29, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
25681
+ import { existsSync as existsSync33, readFileSync as readFileSync29, realpathSync as realpathSync3, statSync as statSync6 } from "fs";
25664
25682
  import { basename as basename16, dirname as dirname27, extname as extname13, join as join43, resolve as resolve40, relative as relative17 } from "path";
25665
25683
  var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfig, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
25666
25684
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
@@ -25681,10 +25699,10 @@ var SRC_PREFIX = "/@src/", BROWSER_DEFINE, jsTranspiler2, legacyDecoratorTsconfi
25681
25699
  ${stubs}
25682
25700
  `;
25683
25701
  }, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
25684
- const directHit = extensions.find((ext) => existsSync32(resolve40(projectRoot, srcPath + ext)));
25702
+ const directHit = extensions.find((ext) => existsSync33(resolve40(projectRoot, srcPath + ext)));
25685
25703
  if (directHit)
25686
25704
  return srcPath + directHit;
25687
- const indexHit = extensions.find((ext) => existsSync32(resolve40(projectRoot, srcPath, `index${ext}`)));
25705
+ const indexHit = extensions.find((ext) => existsSync33(resolve40(projectRoot, srcPath, `index${ext}`)));
25688
25706
  if (indexHit)
25689
25707
  return `${srcPath}/index${indexHit}`;
25690
25708
  return srcPath;
@@ -25745,12 +25763,12 @@ ${stubs}
25745
25763
  if (!subpath) {
25746
25764
  const pkgDir = resolve40(projectRoot, "node_modules", packageName ?? "");
25747
25765
  const pkgJsonPath = join43(pkgDir, "package.json");
25748
- if (existsSync32(pkgJsonPath)) {
25766
+ if (existsSync33(pkgJsonPath)) {
25749
25767
  const pkg = JSON.parse(readFileSync29(pkgJsonPath, "utf-8"));
25750
25768
  const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
25751
25769
  if (esmEntry) {
25752
25770
  const resolved = resolve40(pkgDir, esmEntry);
25753
- if (existsSync32(resolved))
25771
+ if (existsSync33(resolved))
25754
25772
  return relative17(projectRoot, resolved);
25755
25773
  }
25756
25774
  }
@@ -26112,9 +26130,9 @@ ${code}`;
26112
26130
  const hasScript = descriptor.script || descriptor.scriptSetup;
26113
26131
  const compiledScript = hasScript ? vueCompiler.compileScript(descriptor, {
26114
26132
  fs: {
26115
- fileExists: existsSync32,
26133
+ fileExists: existsSync33,
26116
26134
  realpath: realpathSync3,
26117
- readFile: (file4) => existsSync32(file4) ? readFileSync29(file4, "utf-8") : undefined
26135
+ readFile: (file4) => existsSync33(file4) ? readFileSync29(file4, "utf-8") : undefined
26118
26136
  },
26119
26137
  id: componentId,
26120
26138
  inlineTemplate: false
@@ -26144,11 +26162,11 @@ ${code}`;
26144
26162
  `);
26145
26163
  return result;
26146
26164
  }, resolveSvelteModulePath = (path) => {
26147
- if (existsSync32(path))
26165
+ if (existsSync33(path))
26148
26166
  return path;
26149
- if (existsSync32(`${path}.ts`))
26167
+ if (existsSync33(`${path}.ts`))
26150
26168
  return `${path}.ts`;
26151
- if (existsSync32(`${path}.js`))
26169
+ if (existsSync33(`${path}.js`))
26152
26170
  return `${path}.js`;
26153
26171
  return path;
26154
26172
  }, jsResponse = (body) => {
@@ -26299,7 +26317,7 @@ export default {};
26299
26317
  return { ext, filePath: resolveSvelteModulePath(filePath) };
26300
26318
  if (ext)
26301
26319
  return { ext, filePath };
26302
- const found = MODULE_EXTENSIONS.find((candidate) => existsSync32(filePath + candidate));
26320
+ const found = MODULE_EXTENSIONS.find((candidate) => existsSync33(filePath + candidate));
26303
26321
  if (!found)
26304
26322
  return { ext, filePath };
26305
26323
  const resolved = filePath + found;
@@ -26884,7 +26902,7 @@ var handleHTMXUpdate = async (htmxFilePath) => {
26884
26902
  var init_simpleHTMXHMR = () => {};
26885
26903
 
26886
26904
  // src/dev/rebuildTrigger.ts
26887
- import { existsSync as existsSync33, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
26905
+ import { existsSync as existsSync34, readdirSync as readdirSync9, rmSync as rmSync3 } from "fs";
26888
26906
  import {
26889
26907
  basename as basename17,
26890
26908
  dirname as dirname29,
@@ -26998,7 +27016,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
26998
27016
  detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
26999
27017
  }
27000
27018
  return { ...parsed, framework: detectedFw };
27001
- }, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync33(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
27019
+ }, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync34(affectedFile), FRAMEWORK_DIR_KEYS_FOR_CLEANUP, removeStaleGenerated = (state, deletedFile) => {
27002
27020
  const { config } = state;
27003
27021
  const cwd2 = process.cwd();
27004
27022
  const absDeleted = resolvePath(deletedFile).replace(/\\/g, "/");
@@ -27044,7 +27062,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
27044
27062
  if (!dependents || dependents.size === 0) {
27045
27063
  return;
27046
27064
  }
27047
- const dependentFiles = Array.from(dependents).filter((file4) => existsSync33(file4));
27065
+ const dependentFiles = Array.from(dependents).filter((file4) => existsSync34(file4));
27048
27066
  if (dependentFiles.length === 0) {
27049
27067
  return;
27050
27068
  }
@@ -27060,7 +27078,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
27060
27078
  try {
27061
27079
  const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
27062
27080
  affectedFiles.forEach((affectedFile) => {
27063
- if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync33(affectedFile)) {
27081
+ if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync34(affectedFile)) {
27064
27082
  validFiles.push(affectedFile);
27065
27083
  processedFiles.add(affectedFile);
27066
27084
  }
@@ -27085,7 +27103,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
27085
27103
  collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
27086
27104
  }, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
27087
27105
  filePathSet.forEach((filePathInSet) => {
27088
- if (!existsSync33(filePathInSet)) {
27106
+ if (!existsSync34(filePathInSet)) {
27089
27107
  collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
27090
27108
  return;
27091
27109
  }
@@ -27350,7 +27368,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
27350
27368
  return componentFile;
27351
27369
  }
27352
27370
  const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
27353
- if (existsSync33(tsCounterpart)) {
27371
+ if (existsSync34(tsCounterpart)) {
27354
27372
  return tsCounterpart;
27355
27373
  }
27356
27374
  if (!graph)
@@ -28220,7 +28238,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, clearDevSs
28220
28238
  }
28221
28239
  return ctx;
28222
28240
  }, runSvelteBundleRebuild = async (state, svelteFiles, config) => {
28223
- const existingSvelteFiles = svelteFiles.filter((file4) => existsSync33(file4));
28241
+ const existingSvelteFiles = svelteFiles.filter((file4) => existsSync34(file4));
28224
28242
  if (existingSvelteFiles.length === 0)
28225
28243
  return;
28226
28244
  const svelteDir = config.svelteDirectory ?? "";
@@ -30383,5 +30401,5 @@ export {
30383
30401
  devBuild
30384
30402
  };
30385
30403
 
30386
- //# debugId=BF533D895E282A6F64756E2164756E21
30404
+ //# debugId=3CE370EE4B6900BE64756E2164756E21
30387
30405
  //# sourceMappingURL=build.js.map