@absolutejs/absolute 0.20.0-beta.80 → 0.20.0-beta.82

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.
@@ -12,7 +12,7 @@ import {
12
12
  createIslandRegistryDefinitionPlugin,
13
13
  finalizeAbsoluteMobileCompatibilityBuild,
14
14
  resolveServerBundleExternals
15
- } from "./index-w5y7wxn9.js";
15
+ } from "./index-8gksmws3.js";
16
16
  import {
17
17
  loadIslandRegistryBuildInfo
18
18
  } from "./index-bzs19w3r.js";
@@ -35,7 +35,7 @@ import {
35
35
  import"./index-w5vswatm.js";
36
36
  import {
37
37
  normalizeAbsoluteMobileConfig
38
- } from "./index-6fb7k6dg.js";
38
+ } from "./index-czw3jd8f.js";
39
39
  import"./index-p8ezgd5e.js";
40
40
  import {
41
41
  ABSOLUTE_NATIVE_AUTH_CLIENTS_ENV,
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  normalizeAbsoluteMobileConfig
4
- } from "./index-6fb7k6dg.js";
4
+ } from "./index-czw3jd8f.js";
5
5
  import"./index-mywsk201.js";
6
6
  export {
7
7
  normalizeAbsoluteMobileConfig
@@ -1281,7 +1281,7 @@ var loadAbsoluteMobileDevModules = async () => {
1281
1281
  remoteMacProtocol,
1282
1282
  iosNativeWatcher
1283
1283
  ] = await Promise.all([
1284
- import("./config-z8wwxatc.js"),
1284
+ import("./config-naw5fer4.js"),
1285
1285
  import("./expoProject-3mmwtemn.js"),
1286
1286
  import("./expoDevController-n19kb5fr.js"),
1287
1287
  import("./nativeAuth-zx4tsb1f.js"),
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-s2tazax7.js";
5
5
  import {
6
6
  normalizeAbsoluteMobileConfig
7
- } from "./index-6fb7k6dg.js";
7
+ } from "./index-czw3jd8f.js";
8
8
  import {
9
9
  assertAbsoluteDeviceCapabilityPackages,
10
10
  resolveAbsoluteMobileUpdateRuntime,
@@ -9,6 +9,7 @@ var APPLE_APP_ID_PREFIX_PATTERN = /^[A-Z0-9]{10}$/;
9
9
  var CERTIFICATE_FINGERPRINT_PATTERN = /^[0-9A-F]{64}$/;
10
10
  var UPDATE_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/u;
11
11
  var UPDATE_PUBLIC_KEY_PATTERN = /^[A-Za-z0-9+/]+={0,2}$/u;
12
+ var ENVIRONMENT_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/u;
12
13
  var DEFAULT_UPDATE_BOOT_TIMEOUT_MS = 20000;
13
14
  var MINIMUM_UPDATE_BOOT_TIMEOUT_MS = 5000;
14
15
  var MAXIMUM_UPDATE_BOOT_TIMEOUT_MS = 120000;
@@ -220,6 +221,49 @@ var normalizeUpdates = (config, productionOrigin, projectRoot) => {
220
221
  ...expoCodeSigning ? { expoCodeSigning } : {}
221
222
  };
222
223
  };
224
+ var normalizeUpdateServer = (config, productionOrigin, projectRoot, updates) => {
225
+ if (!updates || !config.updates)
226
+ return;
227
+ const registryModule = requireText(config.updates.server?.registry ?? "mobile.update.ts", "mobile.updates.server.registry");
228
+ resolveProjectPath(projectRoot, registryModule, "mobile.updates.server.registry");
229
+ const expoPrivateKeyEnv = requireText(config.updates.server?.expoPrivateKeyEnv ?? "ABSOLUTE_EXPO_UPDATE_PRIVATE_KEY", "mobile.updates.server.expoPrivateKeyEnv");
230
+ if (!ENVIRONMENT_NAME_PATTERN.test(expoPrivateKeyEnv))
231
+ throw new TypeError("mobile.updates.server.expoPrivateKeyEnv must be a valid environment variable name.");
232
+ const autoMount = config.updates.server?.autoMount ?? true;
233
+ if (autoMount) {
234
+ const manifest = new URL(updates.manifestUrl);
235
+ if (manifest.origin !== productionOrigin)
236
+ throw new TypeError("mobile.updates.manifestUrl must use mobile.server.productionOrigin while mobile.updates.server.autoMount is enabled.");
237
+ if (!manifest.pathname.endsWith("/update.json"))
238
+ throw new TypeError("mobile.updates.manifestUrl must end in /update.json while mobile.updates.server.autoMount is enabled.");
239
+ }
240
+ const expoCodeSigningKeys = {};
241
+ if (updates.expoCodeSigning)
242
+ expoCodeSigningKeys[updates.expoCodeSigning.keyId] = {
243
+ certificatePem: updates.expoCodeSigning.certificatePem,
244
+ privateKeyEnv: expoPrivateKeyEnv
245
+ };
246
+ for (const [keyId, key] of Object.entries(config.updates.server?.expoCodeSigningKeys ?? {}).sort(([left], [right]) => left.localeCompare(right))) {
247
+ if (!updates.expoCodeSigning)
248
+ throw new TypeError("mobile.updates.server.expoCodeSigningKeys requires the Expo engine and expoCodeSigning.");
249
+ if (!UPDATE_NAME_PATTERN.test(keyId))
250
+ throw new TypeError("mobile.updates.server.expoCodeSigningKeys contains an invalid key ID.");
251
+ if (expoCodeSigningKeys[keyId])
252
+ throw new TypeError(`mobile.updates.server.expoCodeSigningKeys.${keyId} duplicates the active Expo key.`);
253
+ const privateKeyEnv = requireText(key.privateKeyEnv, `mobile.updates.server.expoCodeSigningKeys.${keyId}.privateKeyEnv`);
254
+ if (!ENVIRONMENT_NAME_PATTERN.test(privateKeyEnv))
255
+ throw new TypeError(`mobile.updates.server.expoCodeSigningKeys.${keyId}.privateKeyEnv must be a valid environment variable name.`);
256
+ const certificatePath = resolveProjectPath(projectRoot, requireText(key.certificatePath, `mobile.updates.server.expoCodeSigningKeys.${keyId}.certificatePath`), `mobile.updates.server.expoCodeSigningKeys.${keyId}.certificatePath`);
257
+ const { certificate, certificatePem } = readExpoCodeSigningCertificate(certificatePath);
258
+ if (certificate.publicKey.asymmetricKeyType !== "rsa" || certificate.issuer !== certificate.subject || !certificate.verify(certificate.publicKey))
259
+ throw new TypeError(`mobile.updates.server.expoCodeSigningKeys.${keyId} certificate must be a self-signed RSA root.`);
260
+ const now = Date.now();
261
+ if (now < Date.parse(certificate.validFrom) || now > Date.parse(certificate.validTo))
262
+ throw new TypeError(`mobile.updates.server.expoCodeSigningKeys.${keyId} certificate is not currently valid.`);
263
+ expoCodeSigningKeys[keyId] = { certificatePem, privateKeyEnv };
264
+ }
265
+ return { autoMount, expoCodeSigningKeys, registryModule };
266
+ };
223
267
  var validateExpoNativeRouteSegment = (path, segment, index, count, parameters) => {
224
268
  if (segment === "*" && (index !== count - 1 || count === 1)) {
225
269
  throw new TypeError(`mobile.routes.native route ${path} must use * once, as the final segment after a static or parameterized prefix.`);
@@ -281,6 +325,7 @@ var normalizeAbsoluteMobileConfig = (config, projectRoot) => {
281
325
  throw new TypeError("mobile.deepLinks.scheme is not a valid URL scheme.");
282
326
  }
283
327
  const updates = normalizeUpdates(config, productionOrigin, projectRoot);
328
+ const updateServer = normalizeUpdateServer(config, productionOrigin, projectRoot, updates);
284
329
  const observability = normalizeObservability(config, productionOrigin);
285
330
  return {
286
331
  androidCertificateFingerprints: normalizeCertificateFingerprints(config.deepLinks?.android?.sha256CertificateFingerprints),
@@ -300,7 +345,8 @@ var normalizeAbsoluteMobileConfig = (config, projectRoot) => {
300
345
  platforms: normalizePlatforms(config.platforms),
301
346
  productionOrigin,
302
347
  pushAndroidGoogleServicesFile: resolveProjectPath(projectRoot, config.pushNotifications?.android?.googleServicesFile ?? "google-services.json", "mobile.pushNotifications.android.googleServicesFile"),
303
- ...updates ? { updates } : {}
348
+ ...updates ? { updates } : {},
349
+ ...updateServer ? { updateServer } : {}
304
350
  };
305
351
  };
306
352
 
@@ -6,7 +6,7 @@ import {
6
6
  createIslandRegistryDefinitionPlugin,
7
7
  finalizeAbsoluteMobileCompatibilityBuild,
8
8
  resolveServerBundleExternals
9
- } from "./index-w5y7wxn9.js";
9
+ } from "./index-8gksmws3.js";
10
10
  import {
11
11
  loadIslandRegistryBuildInfo
12
12
  } from "./index-bzs19w3r.js";
@@ -26,7 +26,7 @@ import {
26
26
  } from "./index-9kwmb3c0.js";
27
27
  import {
28
28
  normalizeAbsoluteMobileConfig
29
- } from "./index-6fb7k6dg.js";
29
+ } from "./index-czw3jd8f.js";
30
30
  import {
31
31
  installAbsoluteMobileAuthEnvironment
32
32
  } from "./index-ar4gz15x.js";
package/dist/cli/index.js CHANGED
@@ -58,7 +58,7 @@ if (command === "dev") {
58
58
  }
59
59
  const positionalArgs = stripNamedArgs("--config", "--android-device", "--ios-device").filter((arg) => arg !== "--no-mobile" && arg !== "--eager");
60
60
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
61
- const { dev } = await import("./dev-8vv459ty.js");
61
+ const { dev } = await import("./dev-skb8dz33.js");
62
62
  await dev(serverEntry, configPath, {
63
63
  androidDevice,
64
64
  eager: args.includes("--eager"),
@@ -71,7 +71,7 @@ if (command === "dev") {
71
71
  const configPath = parseNamedArg("--config");
72
72
  const positionalArgs = stripNamedArgs("--outdir", "--config").filter((arg) => arg !== "--prebuilt");
73
73
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
74
- const { start } = await import("./start-dtrp1pry.js");
74
+ const { start } = await import("./start-jbgfw27x.js");
75
75
  await start(serverEntry, outdir, configPath, {
76
76
  prebuilt: args.includes("--prebuilt")
77
77
  });
@@ -81,7 +81,7 @@ if (command === "dev") {
81
81
  const configPath = parseNamedArg("--config");
82
82
  const positionalArgs = stripNamedArgs("--outdir", "--config");
83
83
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
84
- const { start } = await import("./start-dtrp1pry.js");
84
+ const { start } = await import("./start-jbgfw27x.js");
85
85
  await start(serverEntry, outdir, configPath, { prepareOnly: true });
86
86
  } else if (command === "build") {
87
87
  sendTelemetryEvent("cli:command", { command });
@@ -197,13 +197,13 @@ if (command === "dev") {
197
197
  const configPath = parseNamedArg("--config");
198
198
  const positionalArgs = stripNamedArgs("--outdir", "--outfile", "--config");
199
199
  const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
200
- const { compile } = await import("./compile-x4hfth3p.js");
200
+ const { compile } = await import("./compile-t73ac1zb.js");
201
201
  await compile(serverEntry, outdir, outfile, configPath);
202
202
  } else if (command === "mobile") {
203
203
  sendTelemetryEvent("cli:command", {
204
204
  command: `mobile:${workspaceCommand ?? "unknown"}`
205
205
  });
206
- const { runMobile } = await import("./mobile-mfp26v2d.js");
206
+ const { runMobile } = await import("./mobile-hkxh2ab5.js");
207
207
  try {
208
208
  await runMobile(args);
209
209
  } catch (error) {