@absolutejs/absolute 0.20.0-beta.40 → 0.20.0-beta.42

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.
@@ -15,6 +15,8 @@ const isHmrTarget = (value: unknown): value is HMRClientTarget =>
15
15
  value === 'capacitor-android' ||
16
16
  value === 'capacitor-ios' ||
17
17
  value === 'capacitor-native' ||
18
+ value === 'expo-android' ||
19
+ value === 'expo-ios' ||
18
20
  value === 'mobile-preview' ||
19
21
  value === 'web';
20
22
 
@@ -70,6 +72,8 @@ export const absoluteHmrClientTarget = () => {
70
72
  const marker = new URLSearchParams(search).get('__absolute_target');
71
73
  if (marker === 'capacitor-android') return marker;
72
74
  if (marker === 'capacitor-ios') return marker;
75
+ if (marker === 'expo-android') return marker;
76
+ if (marker === 'expo-ios') return marker;
73
77
  if (marker === 'mobile-preview') return marker;
74
78
  }
75
79
  }
package/dist/index.js CHANGED
@@ -25535,6 +25535,10 @@ var MAX_RETAINED_HMR_UPDATES = 100, normalizedHmrTarget = (value) => {
25535
25535
  return value;
25536
25536
  if (value === "capacitor-native")
25537
25537
  return value;
25538
+ if (value === "expo-android")
25539
+ return value;
25540
+ if (value === "expo-ios")
25541
+ return value;
25538
25542
  if (value === "mobile-preview")
25539
25543
  return value;
25540
25544
  return "web";
@@ -30942,10 +30946,14 @@ __export(exports_devDeviceAdapter, {
30942
30946
  buildAbsoluteNativeDevAdapter: () => buildAbsoluteNativeDevAdapter,
30943
30947
  absoluteNativeDevAdapterSource: () => absoluteNativeDevAdapterSource
30944
30948
  });
30945
- import { mkdtemp as mkdtemp3, rm as rm15, writeFile as writeFile9 } from "fs/promises";
30949
+ import { access as access3, mkdtemp as mkdtemp3, rm as rm15, writeFile as writeFile9 } from "fs/promises";
30946
30950
  import { join as join52 } from "path";
30947
30951
  import { tmpdir } from "os";
30948
- var absoluteNativeDevAdapterSource = (projectRoot, mobile, resolveModule = (specifier) => specifier) => {
30952
+ var absoluteNativeDevAdapterSource = (projectRoot, mobile, resolveModule = (specifier) => specifier, expoAdapterModule = "@absolutejs/absolute/mobile/expo-devices") => {
30953
+ if ((mobile.engine ?? "capacitor") === "expo") {
30954
+ return `import { installAbsoluteExpoWebDeviceAdapter } from ${JSON.stringify(expoAdapterModule)};
30955
+ installAbsoluteExpoWebDeviceAdapter();`;
30956
+ }
30949
30957
  const plan = resolveAbsoluteDeviceCapabilityPlan(projectRoot);
30950
30958
  const imports = plan.capabilities.map((name, index) => {
30951
30959
  const provider = plan.providers[name];
@@ -30960,11 +30968,25 @@ var absoluteNativeDevAdapterSource = (projectRoot, mobile, resolveModule = (spec
30960
30968
  `installCapacitorDeviceAdapterIfNative({ storagePrefix: ${JSON.stringify(`absolutejs.${mobile.appId}.`)}${capabilities ? `, ${capabilities}` : ""} });`
30961
30969
  ].join(`
30962
30970
  `);
30971
+ }, expoAdapterPath = async () => {
30972
+ const candidates = await Promise.all(["ts", "js"].map(async (extension) => {
30973
+ const path2 = join52(import.meta.dir, `shellExpoDevices.${extension}`);
30974
+ try {
30975
+ await access3(path2);
30976
+ return path2;
30977
+ } catch {
30978
+ return;
30979
+ }
30980
+ }));
30981
+ const path = candidates.find((candidate) => candidate !== undefined);
30982
+ if (path)
30983
+ return path;
30984
+ throw new TypeError("The AbsoluteJS Expo development adapter is missing.");
30963
30985
  }, buildAbsoluteNativeDevAdapter = async (projectRoot, mobile) => {
30964
30986
  const temporaryDirectory = await mkdtemp3(join52(tmpdir(), "absolutejs-native-dev-adapter-"));
30965
30987
  const entry = join52(temporaryDirectory, "entry.ts");
30966
30988
  try {
30967
- await writeFile9(entry, absoluteNativeDevAdapterSource(projectRoot, mobile, (specifier) => Bun.resolveSync(specifier, projectRoot)));
30989
+ await writeFile9(entry, absoluteNativeDevAdapterSource(projectRoot, mobile, (specifier) => Bun.resolveSync(specifier, projectRoot), await expoAdapterPath()));
30968
30990
  const result = await Bun.build({
30969
30991
  entrypoints: [entry],
30970
30992
  format: "esm",
@@ -40922,5 +40944,5 @@ export {
40922
40944
  ANGULAR_INIT_TIMEOUT_MS
40923
40945
  };
40924
40946
 
40925
- //# debugId=2A78018C8C89407164756E2164756E21
40947
+ //# debugId=4CB192ABCD84168364756E2164756E21
40926
40948
  //# sourceMappingURL=index.js.map