@absolutejs/absolute 0.20.0-beta.132 → 0.20.0-beta.134

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/changelog.json +35 -0
  3. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  4. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  5. package/dist/build.js +25 -4
  6. package/dist/build.js.map +5 -5
  7. package/dist/cli/{compile-nf4qsqyd.js → compile-dae4qez4.js} +3 -2
  8. package/dist/cli/{config-3te1fbry.js → config-hy5dkexz.js} +1 -1
  9. package/dist/cli/{dev-6f0gry3y.js → dev-wv69we44.js} +2 -2
  10. package/dist/cli/{index-r915cvqp.js → index-cc8eay5y.js} +79 -157
  11. package/dist/cli/{index-c3tqbpkq.js → index-f0bjr9s0.js} +2 -2
  12. package/dist/cli/{index-hfvxsgf4.js → index-gy8rm8hs.js} +199 -64
  13. package/dist/cli/{index-rrxeqrbn.js → index-t7yf3vxs.js} +8 -0
  14. package/dist/cli/index.js +7 -7
  15. package/dist/cli/{mobile-m0cdh8cf.js → mobile-5tx2cfm5.js} +3 -3
  16. package/dist/cli/{patchedBun-m7vj5sks.js → patchedBun-541bbnee.js} +1 -1
  17. package/dist/cli/{start-3z3gtgm0.js → start-tpebqwc0.js} +3 -3
  18. package/dist/dev/serverBootstrap.js +1 -1
  19. package/dist/index.js +25 -4
  20. package/dist/index.js.map +5 -5
  21. package/dist/mobile/index.js +46 -14
  22. package/dist/mobile/index.js.map +6 -6
  23. package/dist/mobile/remoteMacAgentEntry.js +66 -66
  24. package/dist/mobile/shellBootstrap.js +23 -0
  25. package/dist/src/cli/patchedBun.d.ts +28 -40
  26. package/dist/src/mobile/artifactStore.d.ts +4 -0
  27. package/dist/src/mobile/config.d.ts +4 -0
  28. package/dist/src/mobile/pushDeepLinks.d.ts +16 -0
  29. package/dist/types/build.d.ts +11 -0
  30. package/package.json +2 -1
@@ -310,6 +310,7 @@ import {
310
310
  writeFile
311
311
  } from "fs/promises";
312
312
  import { join, resolve as resolvePath } from "path";
313
+ import { pathToFileURL } from "url";
313
314
  var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE = "artifact.json", RELEASE_ID_PATTERN, DEFAULT_BLOB_PREFIX = "absolutejs/mobile-compatibility", hashBlob = async (blob) => {
314
315
  const bytes = new Uint8Array(await blob.arrayBuffer());
315
316
  return createHash2(SHA_2562).update(bytes).digest("hex");
@@ -488,6 +489,17 @@ var DEFAULT_MAX_PRODUCER_BYTES = 134217728, SHA_2562 = "sha256", ARTIFACT_FILE =
488
489
  }
489
490
  }
490
491
  };
492
+ }, isFunctionRecord = (value, keys) => typeof value === "object" && value !== null && keys.every((key) => typeof Reflect.get(value, key) === "function"), isArtifactStore = (value) => isFunctionRecord(value, ["delete", "list", "read", "write"]), isBlobStore = (value) => isFunctionRecord(value, ["delete", "get", "list", "put"]), loadAbsoluteMobileCompatibilityStore = async (options) => {
493
+ const loaded = await import(pathToFileURL(options.modulePath).href);
494
+ const exported = typeof loaded === "object" && loaded !== null ? Reflect.get(loaded, "default") ?? Reflect.get(loaded, "store") : undefined;
495
+ if (isArtifactStore(exported))
496
+ return exported;
497
+ if (isBlobStore(exported))
498
+ return createAbsoluteMobileBlobArtifactStore({
499
+ ...options.prefix === undefined ? {} : { prefix: options.prefix },
500
+ store: exported
501
+ });
502
+ throw new TypeError(`mobile.compatibility.store (${options.modulePath}) must export a blob store with get, put, list and delete.`);
491
503
  }, verifyAbsoluteMobileCompatibilityProducer = async (release, maxProducerBytes = DEFAULT_MAX_PRODUCER_BYTES) => {
492
504
  const { artifact, producer } = release;
493
505
  if (producer.size !== artifact.producer.bytes || producer.size > maxProducerBytes) {
@@ -1072,6 +1084,14 @@ var APP_ID_PATTERN, SCHEME_PATTERN, APPLE_APP_ID_PREFIX_PATTERN, CERTIFICATE_FIN
1072
1084
  appName: requireText(config.appName, "mobile.appName"),
1073
1085
  ...branding ? { branding } : {},
1074
1086
  bundleDirectory: resolveProjectPath(projectRoot, config.bundleDirectory ?? ".absolutejs/mobile/web", "mobile.bundleDirectory"),
1087
+ ...config.compatibility ? {
1088
+ compatibilityStore: {
1089
+ modulePath: resolveProjectPath(projectRoot, requireText(config.compatibility.store, "mobile.compatibility.store"), "mobile.compatibility.store"),
1090
+ ...config.compatibility.prefix === undefined ? {} : {
1091
+ prefix: requireText(config.compatibility.prefix, "mobile.compatibility.prefix")
1092
+ }
1093
+ }
1094
+ } : {},
1075
1095
  deepLinkHosts: normalizeHosts(config.deepLinks?.hosts, productionOrigin),
1076
1096
  deepLinkScheme,
1077
1097
  engine: config.engine ?? "capacitor",
@@ -1730,7 +1750,7 @@ import {
1730
1750
  writeFile as writeFile13
1731
1751
  } from "fs/promises";
1732
1752
  import { dirname as dirname11, join as join14, resolve as resolvePath4 } from "path";
1733
- import { pathToFileURL } from "url";
1753
+ import { pathToFileURL as pathToFileURL2 } from "url";
1734
1754
  var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "current.json", BUNDLES_DIRECTORY = "bundles", ARTIFACT_FILE2 = "artifact.json", BUNDLE_ID_PATTERN, isRecord8 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), errorHasCode3 = (error, code) => typeof error === "object" && error !== null && Reflect.get(error, "code") === code, bundleIdFor = (currentReleaseId, releases) => {
1735
1755
  const identity = JSON.stringify({
1736
1756
  currentReleaseId,
@@ -1789,7 +1809,7 @@ var ABSOLUTE_MOBILE_MATERIALIZED_BUNDLE_FORMAT = 1, CURRENT_BUNDLE_FILE = "curre
1789
1809
  throw error;
1790
1810
  }
1791
1811
  return destination;
1792
- }, readCompatibilityModule = (modulePath) => import(pathToFileURL(modulePath).href), resolveProducerHandler = (loaded, exportName) => {
1812
+ }, readCompatibilityModule = (modulePath) => import(pathToFileURL2(modulePath).href), resolveProducerHandler = (loaded, exportName) => {
1793
1813
  const value = loaded[exportName];
1794
1814
  if (!isRecord8(value) || typeof value.handle !== "function") {
1795
1815
  throw new TypeError(`Compatibility producer export ${exportName} must expose handle(request).`);
@@ -20605,7 +20625,7 @@ import {
20605
20625
  } from "crypto";
20606
20626
  import { access as access24, mkdir as mkdir27 } from "fs/promises";
20607
20627
  import { dirname as dirname26, isAbsolute as isAbsolute15, relative as relative25, resolve as resolve27, sep as sep17 } from "path";
20608
- import { pathToFileURL as pathToFileURL4 } from "url";
20628
+ import { pathToFileURL as pathToFileURL5 } from "url";
20609
20629
  import { Elysia as Elysia4 } from "elysia";
20610
20630
  var ABSOLUTE_MOBILE_UPDATE_SERVER_FORMAT = 1, DEFAULT_MOBILE_UPDATE_REGISTRY_MODULE = "mobile.update.ts", object7 = (value) => typeof value === "object" && value !== null && !Array.isArray(value), projectPath4 = (projectRoot, requested) => {
20611
20631
  const root = resolve27(projectRoot);
@@ -20637,7 +20657,7 @@ var ABSOLUTE_MOBILE_UPDATE_SERVER_FORMAT = 1, DEFAULT_MOBILE_UPDATE_REGISTRY_MOD
20637
20657
  await access24(modulePath).catch(() => {
20638
20658
  throw new TypeError(`Mobile update server registry does not exist: ${modulePath}. Run \`absolute mobile update provision\`.`);
20639
20659
  });
20640
- const loaded = await import(pathToFileURL4(modulePath).href);
20660
+ const loaded = await import(pathToFileURL5(modulePath).href);
20641
20661
  if (!object7(loaded))
20642
20662
  throw new TypeError("Mobile update registry module has no exports.");
20643
20663
  const registry = loaded.default ?? loaded.registry;
@@ -28283,6 +28303,7 @@ var parseAbsoluteMobileBuildPageMetadata = (value) => {
28283
28303
  };
28284
28304
  };
28285
28305
  // src/mobile/buildPipeline.ts
28306
+ init_artifactStore();
28286
28307
  import { readFile as readFile18 } from "fs/promises";
28287
28308
  import { join as join22, resolve as resolve16 } from "path";
28288
28309
 
@@ -32140,12 +32161,19 @@ var finalizeAbsoluteMobileCompatibilityBuild = async (options) => {
32140
32161
  restoreEnvironmentVariable("ABSOLUTE_COMPILED_RUNTIME", previousCompiledRuntime);
32141
32162
  restoreEnvironmentVariable("ABSOLUTE_CONFIG", previousConfigPath);
32142
32163
  }
32164
+ const compatibilityStore = mobile.compatibilityStore ? await loadAbsoluteMobileCompatibilityStore(mobile.compatibilityStore) : undefined;
32165
+ const storedArtifacts = compatibilityStore ? await compatibilityStore.list(mobile.appId) : [];
32166
+ const storedReleaseIds = new Set(storedArtifacts.map(({ releaseId }) => releaseId));
32167
+ const localOnly = previous.filter(({ artifact }) => !storedReleaseIds.has(artifact.releaseId));
32143
32168
  const current = await buildAbsoluteMobileCompatibilityRelease({
32144
32169
  app: loaded.app,
32145
32170
  appId: mobile.appId,
32146
32171
  buildDirectory,
32147
32172
  manifest,
32148
- previousArtifacts: previous.map(({ artifact }) => artifact),
32173
+ previousArtifacts: [
32174
+ ...storedArtifacts,
32175
+ ...localOnly.map(({ artifact }) => artifact)
32176
+ ],
32149
32177
  producerExport: loaded.exportName,
32150
32178
  producerPath: resolve16(options.producerPath),
32151
32179
  runtime: String(ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION)
@@ -32168,10 +32196,13 @@ var finalizeAbsoluteMobileCompatibilityBuild = async (options) => {
32168
32196
  if (auth && !loaded.app.routes.some((route) => route.path === "/.well-known/openid-configuration")) {
32169
32197
  throw new TypeError("@absolutejs/auth is installed, but its OIDC provider is not mounted. Native authentication requires the auth oidc configuration so AbsoluteJS can provision a public PKCE client.");
32170
32198
  }
32171
- const releasesById = new Map([current, ...previous].map((release) => [
32172
- release.artifact.releaseId,
32173
- release
32174
- ]));
32199
+ if (compatibilityStore)
32200
+ await Promise.all(localOnly.map((release) => compatibilityStore.write(release)));
32201
+ const candidates = compatibilityStore ? await carryForwardAbsoluteMobileCompatibilityReleases({
32202
+ current,
32203
+ store: compatibilityStore
32204
+ }) : [current, ...previous];
32205
+ const releasesById = new Map(candidates.map((release) => [release.artifact.releaseId, release]));
32175
32206
  const retained = retainAbsoluteMobileCompatibilityArtifacts([...releasesById.values()].map(({ artifact }) => artifact));
32176
32207
  await materializeAbsoluteMobileCompatibilityBundle({
32177
32208
  currentReleaseId: current.artifact.releaseId,
@@ -36724,7 +36755,7 @@ init_releaseArtifact();
36724
36755
  // src/mobile/releasePublisher.ts
36725
36756
  import { access as access22 } from "fs/promises";
36726
36757
  import { isAbsolute as isAbsolute13, relative as relative21, resolve as resolve23, sep as sep15 } from "path";
36727
- import { pathToFileURL as pathToFileURL2 } from "url";
36758
+ import { pathToFileURL as pathToFileURL3 } from "url";
36728
36759
  var prepareAbsoluteIosRelease = async (publisher, options) => {
36729
36760
  if (typeof publisher.prepareIosRelease !== "function") {
36730
36761
  throw new TypeError("App Store Connect publishing requires a registry module created with @absolutejs/deploy/app-store-connect.");
@@ -36773,7 +36804,7 @@ var loadAbsoluteNativeReleasePublisher = async (projectRoot, requestedModulePath
36773
36804
  await access22(modulePath).catch(() => {
36774
36805
  throw new TypeError(`Native release registry module does not exist: ${modulePath}`);
36775
36806
  });
36776
- const loaded = await import(pathToFileURL2(modulePath).href);
36807
+ const loaded = await import(pathToFileURL3(modulePath).href);
36777
36808
  const publisher = isRecord18(loaded) ? loaded.default ?? loaded.registry : undefined;
36778
36809
  if (!isPublisher(publisher)) {
36779
36810
  throw new TypeError("Native release registry module must default-export a registry with publish(options).");
@@ -43575,7 +43606,7 @@ var createAbsoluteMobileUpdateClient = (options) => {
43575
43606
  // src/mobile/updatePublisher.ts
43576
43607
  import { access as access23 } from "fs/promises";
43577
43608
  import { isAbsolute as isAbsolute14, relative as relative24, resolve as resolve26, sep as sep16 } from "path";
43578
- import { pathToFileURL as pathToFileURL3 } from "url";
43609
+ import { pathToFileURL as pathToFileURL4 } from "url";
43579
43610
 
43580
43611
  // src/mobile/updateSigning.ts
43581
43612
  import { createHash as createHash18, sign, verify } from "crypto";
@@ -43805,7 +43836,7 @@ var loadAbsoluteMobileUpdatePublisher = async (projectRoot, requestedModulePath)
43805
43836
  await access23(modulePath).catch(() => {
43806
43837
  throw new TypeError(`Mobile update registry does not exist: ${modulePath}`);
43807
43838
  });
43808
- const loaded = await import(pathToFileURL3(modulePath).href);
43839
+ const loaded = await import(pathToFileURL4(modulePath).href);
43809
43840
  const publisher = object5(loaded) ? loaded.default ?? loaded.registry : undefined;
43810
43841
  if (!isPublisher2(publisher))
43811
43842
  throw new TypeError("Mobile update registry must implement publishUpdate, promoteUpdate, and rollbackUpdate.");
@@ -44076,6 +44107,7 @@ export {
44076
44107
  listAbsoluteMobilePromotionOperations,
44077
44108
  listAbsoluteRemoteMacProfiles,
44078
44109
  loadAbsoluteDeviceCapabilityProviders,
44110
+ loadAbsoluteMobileCompatibilityStore,
44079
44111
  loadAbsoluteMobileMaterializedBundle,
44080
44112
  loadAbsoluteMobileUpdatePublisher,
44081
44113
  loadAbsoluteMobileUpdateServerModule,
@@ -44202,5 +44234,5 @@ export {
44202
44234
  writeAbsoluteMobileUpdateRegistry
44203
44235
  };
44204
44236
 
44205
- //# debugId=EE5D13E062D6637864756E2164756E21
44237
+ //# debugId=41E4F4563156A38C64756E2164756E21
44206
44238
  //# sourceMappingURL=index.js.map