@ankhorage/expo-runtime 2.7.0 → 3.0.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ankhorage/expo-runtime
2
2
 
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 8621e2b: Align the root Expo 57 runtime with released ZORA 3 and Surface 3, and make package-wide application peers optional at install time so the public `platform` subpath remains independently consumable by headless planners. Root and feature entrypoints still require consumers to install the peers they execute.
8
+
3
9
  ## 2.7.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # EXPO-RUNTIME
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v2.6.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v2.7.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
7
7
 
8
8
  Declarative runtime integration for Expo apps: maps app capabilities to permissions, packages, config plugins, providers, and adapters
9
9
 
@@ -27,7 +27,7 @@ export interface ExpoRuntimeHintMetadata {
27
27
  }
28
28
  export declare const GENERATED_RUNTIME_DEPENDENCY_VERSIONS: {
29
29
  readonly '@ankhorage/permissions': "^0.2.2";
30
- readonly '@ankhorage/expo-runtime': "^2.7.0";
30
+ readonly '@ankhorage/expo-runtime': "^3.0.0";
31
31
  };
32
32
  export declare const EXPO_RUNTIME_PROVIDER_PACKAGES: {
33
33
  readonly permissions: "@ankhorage/permissions";
@@ -1,7 +1,7 @@
1
1
  import { EXPO_PLATFORM } from './platform';
2
2
  const GENERATED_ANKHORAGE_DEPENDENCY_VERSIONS = {
3
3
  '@ankhorage/permissions': '^0.2.2',
4
- '@ankhorage/expo-runtime': '^2.7.0',
4
+ '@ankhorage/expo-runtime': '^3.0.0',
5
5
  };
6
6
  const GENERATED_EXPO_DEPENDENCY_VERSIONS = Object.fromEntries(Object.values(EXPO_PLATFORM.packages).map((dependency) => [
7
7
  dependency.name,
@@ -1 +1 @@
1
- {"version":3,"file":"expoRuntimePlanningMetadata.js","sourceRoot":"","sources":["../src/expoRuntimePlanningMetadata.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAA4B,MAAM,YAAY,CAAC;AAgCrE,MAAM,uCAAuC,GAAG;IAC9C,wBAAwB,EAAE,QAAQ;IAClC,yBAAyB,EAAE,QAAQ;CACM,CAAC;AAE5C,MAAM,kCAAkC,GAAG,MAAM,CAAC,WAAW,CAC3D,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,UAA+B,EAAE,EAAE,CAAC;IAC7E,UAAU,CAAC,IAAI;IACf,UAAU,CAAC,OAAO;CACnB,CAAC,CACiC,CAAC;AAEtC,MAAM,CAAC,MAAM,qCAAqC,GAAG;IACnD,GAAG,uCAAuC;IAC1C,GAAG,kCAAkC;CACc,CAAC;AAEtD,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,WAAW,EAAE,wBAAwB;CACmB,CAAC;AAE3D,MAAM,yBAAyB,GAAG;IAChC,gBAAgB,EAAE;QAChB,MAAM,EAAE;YACN,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI;YACxC,OAAO,EAAE;gBACP,qBAAqB,EAAE,KAAK;gB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C7C,UAAkB,EAClB,OAA0B;IAE1B,OAAO;QACL,QAAQ,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;QACrD,eAAe,EAAE,YAAY;QAC7B,WAAW,EAAE,UAAU;QACvB,OAAO,EAAE,6BAA6B,UAAU,SAAS,OAAO,IAAI;QACpE,OAAO;KACR,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,UAAkB;IAC5D,OAAO;QACL,QAAQ,EAAE,SAAS;QACnB,eAAe,EAAE,YAAY;QAC7B,WAAW,EAAE,UAAU;QACvB,OAAO,EAAE,0DAA0D,UAAU,IAAI;KAClF,CAAC;AACJ,CAAC","sourcesContent":["import type {\n AnkhorageCapabilityName,\n ScreenCapabilityRequirement,\n ScreenPermissionRequirement,\n} from '@ankhorage/contracts';\nimport type { PermissionSupport } from '@ankhorage/permissions/expo/manifest';\n\nimport { EXPO_PLATFORM, type ExpoPlatformPackage } from './platform';\n\nexport interface ExpoRuntimeConfigPlugin {\n readonly name: string;\n readonly options?: Readonly<Record<string, boolean | string>>;\n}\n\nexport type ExpoRuntimeProviderId = 'permissions';\nexport type ExpoRuntimeAdapterId = 'ExpoBarcodeScannerAdapter';\n\nexport interface ExpoRuntimeDiagnostic {\n readonly severity: 'error' | 'warning';\n readonly requirementType: 'capability' | 'configHint' | 'package' | 'permission';\n readonly requirement: string;\n readonly message: string;\n readonly support?: PermissionSupport;\n}\n\nexport interface ExpoRuntimeCapabilityMetadata {\n readonly impliedPermissions?: readonly ScreenPermissionRequirement[];\n readonly requiredPackages?: readonly string[];\n readonly providers?: readonly ExpoRuntimeProviderId[];\n readonly runtimeAdapters?: readonly ExpoRuntimeAdapterId[];\n readonly androidPermissions?: readonly string[];\n readonly plugins?: readonly ExpoRuntimeConfigPlugin[];\n}\n\nexport interface ExpoRuntimeHintMetadata {\n readonly androidPermissions?: readonly string[];\n readonly plugin?: ExpoRuntimeConfigPlugin;\n}\n\nconst GENERATED_ANKHORAGE_DEPENDENCY_VERSIONS = {\n '@ankhorage/permissions': '^0.2.2',\n '@ankhorage/expo-runtime': '^2.7.0',\n} as const satisfies Record<string, string>;\n\nconst GENERATED_EXPO_DEPENDENCY_VERSIONS = Object.fromEntries(\n Object.values(EXPO_PLATFORM.packages).map((dependency: ExpoPlatformPackage) => [\n dependency.name,\n dependency.version,\n ]),\n) as Readonly<Record<string, string>>;\n\nexport const GENERATED_RUNTIME_DEPENDENCY_VERSIONS = {\n ...GENERATED_ANKHORAGE_DEPENDENCY_VERSIONS,\n ...GENERATED_EXPO_DEPENDENCY_VERSIONS,\n} as const satisfies Readonly<Record<string, string>>;\n\nexport const EXPO_RUNTIME_PROVIDER_PACKAGES = {\n permissions: '@ankhorage/permissions',\n} as const satisfies Record<ExpoRuntimeProviderId, string>;\n\nconst EXPO_RUNTIME_CONFIG_HINTS = {\n cameraPermission: {\n plugin: {\n name: EXPO_PLATFORM.packages.camera.name,\n options: {\n barcodeScannerEnabled: false,\n cameraPermission: 'Allow camera access.',\n microphonePermission: false,\n recordAudioAndroid: false,\n },\n },\n },\n microphonePermission: {\n plugin: {\n name: EXPO_PLATFORM.packages.audio.name,\n options: {\n enableBackgroundPlayback: false,\n enableBackgroundRecording: false,\n microphonePermission: 'Allow microphone access.',\n },\n },\n },\n recordAudioAndroid: {\n plugin: {\n name: EXPO_PLATFORM.packages.audio.name,\n options: {\n enableBackgroundPlayback: false,\n enableBackgroundRecording: false,\n recordAudioAndroid: true,\n },\n },\n },\n mediaLibraryPermission: {\n plugin: {\n name: EXPO_PLATFORM.packages.mediaLibrary.name,\n options: {\n photosPermission: 'Allow photo library access.',\n savePhotosPermission: 'Allow saving to the photo library.',\n },\n },\n },\n locationWhenInUsePermission: {\n plugin: {\n name: EXPO_PLATFORM.packages.location.name,\n options: {\n locationWhenInUsePermission: 'Allow location access while using the app.',\n },\n },\n },\n locationAlwaysAndWhenInUsePermission: {\n plugin: {\n name: EXPO_PLATFORM.packages.location.name,\n options: {\n locationAlwaysAndWhenInUsePermission: 'Allow location access.',\n isAndroidBackgroundLocationEnabled: true,\n isAndroidForegroundServiceEnabled: true,\n isIosBackgroundLocationEnabled: true,\n },\n },\n },\n notificationsPermission: {\n plugin: {\n name: EXPO_PLATFORM.packages.notifications.name,\n },\n },\n} as const satisfies Readonly<Record<string, ExpoRuntimeHintMetadata>>;\n\nexport const EXPO_CAPABILITY_RUNTIME_REGISTRY = {\n barcodeScanner: {\n impliedPermissions: [{ permission: 'camera' }],\n requiredPackages: [EXPO_PLATFORM.packages.camera.name],\n providers: ['permissions'],\n runtimeAdapters: ['ExpoBarcodeScannerAdapter'],\n plugins: [\n {\n name: EXPO_PLATFORM.packages.camera.name,\n options: {\n cameraPermission: 'Allow camera access to scan barcodes.',\n barcodeScannerEnabled: true,\n microphonePermission: false,\n recordAudioAndroid: false,\n },\n },\n ],\n },\n} as const satisfies Readonly<\n Partial<Record<AnkhorageCapabilityName, ExpoRuntimeCapabilityMetadata>>\n>;\n\nexport function findCapabilityMetadata(\n registry: Readonly<Partial<Record<AnkhorageCapabilityName, ExpoRuntimeCapabilityMetadata>>>,\n requirement: ScreenCapabilityRequirement,\n): ExpoRuntimeCapabilityMetadata | undefined {\n return Object.entries(registry).find(([name]) => name === requirement.capability)?.[1];\n}\n\nexport function findConfigHintMetadata(configHint: string): ExpoRuntimeHintMetadata | undefined {\n return Object.entries(EXPO_RUNTIME_CONFIG_HINTS).find(([name]) => name === configHint)?.[1];\n}\n\nexport function unknownPermissionDiagnostic(permission: string): ExpoRuntimeDiagnostic {\n return {\n severity: 'error',\n requirementType: 'permission',\n requirement: permission,\n message: `Unknown permission '${permission}' cannot be resolved for Expo runtime generation.`,\n };\n}\n\nexport function unsupportedPermissionDiagnostic(\n permission: string,\n support: PermissionSupport,\n): ExpoRuntimeDiagnostic {\n return {\n severity: support === 'limited' ? 'warning' : 'error',\n requirementType: 'permission',\n requirement: permission,\n message: `Expo runtime support for '${permission}' is '${support}'.`,\n support,\n };\n}\n\nexport function unknownCapabilityDiagnostic(capability: string): ExpoRuntimeDiagnostic {\n return {\n severity: 'warning',\n requirementType: 'capability',\n requirement: capability,\n message: `No Expo runtime metadata is registered for capability '${capability}'.`,\n };\n}\n"]}
1
+ {"version":3,"file":"expoRuntimePlanningMetadata.js","sourceRoot":"","sources":["../src/expoRuntimePlanningMetadata.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAA4B,MAAM,YAAY,CAAC;AAgCrE,MAAM,uCAAuC,GAAG;IAC9C,wBAAwB,EAAE,QAAQ;IAClC,yBAAyB,EAAE,QAAQ;CACM,CAAC;AAE5C,MAAM,kCAAkC,GAAG,MAAM,CAAC,WAAW,CAC3D,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,UAA+B,EAAE,EAAE,CAAC;IAC7E,UAAU,CAAC,IAAI;IACf,UAAU,CAAC,OAAO;CACnB,CAAC,CACiC,CAAC;AAEtC,MAAM,CAAC,MAAM,qCAAqC,GAAG;IACnD,GAAG,uCAAuC;IAC1C,GAAG,kCAAkC;CACc,CAAC;AAEtD,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,WAAW,EAAE,wBAAwB;CACmB,CAAC;AAE3D,MAAM,yBAAyB,GAAG;IAChC,gBAAgB,EAAE;QAChB,MAAM,EAAE;YACN,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI;YACxC,OAAO,EAAE;gBACP,qBAAqB,EAAE,KAAK;gBAC5B,gBAAgB,EAAE,sBAAsB;gBACxC,oBAAoB,EAAE,KAAK;gBAC3B,kBAAkB,EAAE,KAAK;aAC1B;SACF;KACF;IACD,oBAAoB,EAAE;QACpB,MAAM,EAAE;YACN,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI;YACvC,OAAO,EAAE;gBACP,wBAAwB,EAAE,KAAK;gBAC/B,yBAAyB,EAAE,K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UAAU,2BAA2B,CAAC,UAAkB;IAC5D,OAAO;QACL,QAAQ,EAAE,SAAS;QACnB,eAAe,EAAE,YAAY;QAC7B,WAAW,EAAE,UAAU;QACvB,OAAO,EAAE,0DAA0D,UAAU,IAAI;KAClF,CAAC;AACJ,CAAC","sourcesContent":["import type {\n AnkhorageCapabilityName,\n ScreenCapabilityRequirement,\n ScreenPermissionRequirement,\n} from '@ankhorage/contracts';\nimport type { PermissionSupport } from '@ankhorage/permissions/expo/manifest';\n\nimport { EXPO_PLATFORM, type ExpoPlatformPackage } from './platform';\n\nexport interface ExpoRuntimeConfigPlugin {\n readonly name: string;\n readonly options?: Readonly<Record<string, boolean | string>>;\n}\n\nexport type ExpoRuntimeProviderId = 'permissions';\nexport type ExpoRuntimeAdapterId = 'ExpoBarcodeScannerAdapter';\n\nexport interface ExpoRuntimeDiagnostic {\n readonly severity: 'error' | 'warning';\n readonly requirementType: 'capability' | 'configHint' | 'package' | 'permission';\n readonly requirement: string;\n readonly message: string;\n readonly support?: PermissionSupport;\n}\n\nexport interface ExpoRuntimeCapabilityMetadata {\n readonly impliedPermissions?: readonly ScreenPermissionRequirement[];\n readonly requiredPackages?: readonly string[];\n readonly providers?: readonly ExpoRuntimeProviderId[];\n readonly runtimeAdapters?: readonly ExpoRuntimeAdapterId[];\n readonly androidPermissions?: readonly string[];\n readonly plugins?: readonly ExpoRuntimeConfigPlugin[];\n}\n\nexport interface ExpoRuntimeHintMetadata {\n readonly androidPermissions?: readonly string[];\n readonly plugin?: ExpoRuntimeConfigPlugin;\n}\n\nconst GENERATED_ANKHORAGE_DEPENDENCY_VERSIONS = {\n '@ankhorage/permissions': '^0.2.2',\n '@ankhorage/expo-runtime': '^3.0.0',\n} as const satisfies Record<string, string>;\n\nconst GENERATED_EXPO_DEPENDENCY_VERSIONS = Object.fromEntries(\n Object.values(EXPO_PLATFORM.packages).map((dependency: ExpoPlatformPackage) => [\n dependency.name,\n dependency.version,\n ]),\n) as Readonly<Record<string, string>>;\n\nexport const GENERATED_RUNTIME_DEPENDENCY_VERSIONS = {\n ...GENERATED_ANKHORAGE_DEPENDENCY_VERSIONS,\n ...GENERATED_EXPO_DEPENDENCY_VERSIONS,\n} as const satisfies Readonly<Record<string, string>>;\n\nexport const EXPO_RUNTIME_PROVIDER_PACKAGES = {\n permissions: '@ankhorage/permissions',\n} as const satisfies Record<ExpoRuntimeProviderId, string>;\n\nconst EXPO_RUNTIME_CONFIG_HINTS = {\n cameraPermission: {\n plugin: {\n name: EXPO_PLATFORM.packages.camera.name,\n options: {\n barcodeScannerEnabled: false,\n cameraPermission: 'Allow camera access.',\n microphonePermission: false,\n recordAudioAndroid: false,\n },\n },\n },\n microphonePermission: {\n plugin: {\n name: EXPO_PLATFORM.packages.audio.name,\n options: {\n enableBackgroundPlayback: false,\n enableBackgroundRecording: false,\n microphonePermission: 'Allow microphone access.',\n },\n },\n },\n recordAudioAndroid: {\n plugin: {\n name: EXPO_PLATFORM.packages.audio.name,\n options: {\n enableBackgroundPlayback: false,\n enableBackgroundRecording: false,\n recordAudioAndroid: true,\n },\n },\n },\n mediaLibraryPermission: {\n plugin: {\n name: EXPO_PLATFORM.packages.mediaLibrary.name,\n options: {\n photosPermission: 'Allow photo library access.',\n savePhotosPermission: 'Allow saving to the photo library.',\n },\n },\n },\n locationWhenInUsePermission: {\n plugin: {\n name: EXPO_PLATFORM.packages.location.name,\n options: {\n locationWhenInUsePermission: 'Allow location access while using the app.',\n },\n },\n },\n locationAlwaysAndWhenInUsePermission: {\n plugin: {\n name: EXPO_PLATFORM.packages.location.name,\n options: {\n locationAlwaysAndWhenInUsePermission: 'Allow location access.',\n isAndroidBackgroundLocationEnabled: true,\n isAndroidForegroundServiceEnabled: true,\n isIosBackgroundLocationEnabled: true,\n },\n },\n },\n notificationsPermission: {\n plugin: {\n name: EXPO_PLATFORM.packages.notifications.name,\n },\n },\n} as const satisfies Readonly<Record<string, ExpoRuntimeHintMetadata>>;\n\nexport const EXPO_CAPABILITY_RUNTIME_REGISTRY = {\n barcodeScanner: {\n impliedPermissions: [{ permission: 'camera' }],\n requiredPackages: [EXPO_PLATFORM.packages.camera.name],\n providers: ['permissions'],\n runtimeAdapters: ['ExpoBarcodeScannerAdapter'],\n plugins: [\n {\n name: EXPO_PLATFORM.packages.camera.name,\n options: {\n cameraPermission: 'Allow camera access to scan barcodes.',\n barcodeScannerEnabled: true,\n microphonePermission: false,\n recordAudioAndroid: false,\n },\n },\n ],\n },\n} as const satisfies Readonly<\n Partial<Record<AnkhorageCapabilityName, ExpoRuntimeCapabilityMetadata>>\n>;\n\nexport function findCapabilityMetadata(\n registry: Readonly<Partial<Record<AnkhorageCapabilityName, ExpoRuntimeCapabilityMetadata>>>,\n requirement: ScreenCapabilityRequirement,\n): ExpoRuntimeCapabilityMetadata | undefined {\n return Object.entries(registry).find(([name]) => name === requirement.capability)?.[1];\n}\n\nexport function findConfigHintMetadata(configHint: string): ExpoRuntimeHintMetadata | undefined {\n return Object.entries(EXPO_RUNTIME_CONFIG_HINTS).find(([name]) => name === configHint)?.[1];\n}\n\nexport function unknownPermissionDiagnostic(permission: string): ExpoRuntimeDiagnostic {\n return {\n severity: 'error',\n requirementType: 'permission',\n requirement: permission,\n message: `Unknown permission '${permission}' cannot be resolved for Expo runtime generation.`,\n };\n}\n\nexport function unsupportedPermissionDiagnostic(\n permission: string,\n support: PermissionSupport,\n): ExpoRuntimeDiagnostic {\n return {\n severity: support === 'limited' ? 'warning' : 'error',\n requirementType: 'permission',\n requirement: permission,\n message: `Expo runtime support for '${permission}' is '${support}'.`,\n support,\n };\n}\n\nexport function unknownCapabilityDiagnostic(capability: string): ExpoRuntimeDiagnostic {\n return {\n severity: 'warning',\n requirementType: 'capability',\n requirement: capability,\n message: `No Expo runtime metadata is registered for capability '${capability}'.`,\n };\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/expo-runtime",
3
3
  "type": "module",
4
- "version": "2.7.0",
4
+ "version": "3.0.0",
5
5
  "description": "Declarative runtime integration for Expo apps: maps app capabilities to permissions, packages, config plugins, providers, and adapters",
6
6
  "homepage": "https://github.com/ankhorage/expo-runtime#readme",
7
7
  "bugs": {
@@ -25,8 +25,7 @@
25
25
  "runtime"
26
26
  ],
27
27
  "dependencies": {
28
- "@ankhorage/contracts": "^8.0.0",
29
- "@ankhorage/permissions": "^0.2.2"
28
+ "@ankhorage/contracts": "^8.0.0"
30
29
  },
31
30
  "files": [
32
31
  "dist",
@@ -104,11 +103,14 @@
104
103
  "test": "bun test src",
105
104
  "typecheck": "bun x tsc --noEmit -p tsconfig.json && bun x tsc --noEmit -p tsconfig.scripts.json",
106
105
  "validate:expo-platform": "bun scripts/validateExpoPlatform.ts",
106
+ "validate:headless-platform": "bun scripts/headlessPlatformAcceptance.ts",
107
+ "validate:packed-runtime": "bun scripts/packedRuntimeAcceptance.ts",
107
108
  "validate:web-barcode": "bun scripts/webBarcodeAcceptance.ts",
108
109
  "version-packages": "changeset version"
109
110
  },
110
111
  "peerDependencies": {
111
- "@ankhorage/zora": "^2.13.2",
112
+ "@ankhorage/permissions": "^0.2.2",
113
+ "@ankhorage/zora": "^3.0.0",
112
114
  "expo": "~57.0.15",
113
115
  "expo-camera": "~57.0.4",
114
116
  "expo-constants": "~57.0.13",
@@ -119,6 +121,18 @@
119
121
  "react-native": "0.86.2"
120
122
  },
121
123
  "peerDependenciesMeta": {
124
+ "@ankhorage/permissions": {
125
+ "optional": true
126
+ },
127
+ "@ankhorage/zora": {
128
+ "optional": true
129
+ },
130
+ "expo": {
131
+ "optional": true
132
+ },
133
+ "expo-camera": {
134
+ "optional": true
135
+ },
122
136
  "expo-constants": {
123
137
  "optional": true
124
138
  },
@@ -130,13 +144,25 @@
130
144
  },
131
145
  "expo-image-picker": {
132
146
  "optional": true
147
+ },
148
+ "react": {
149
+ "optional": true
150
+ },
151
+ "react-native": {
152
+ "optional": true
133
153
  }
134
154
  },
135
155
  "devDependencies": {
136
156
  "@ankhorage/devtools": "^1.6.0",
137
157
  "@ankhorage/paradox": "^0.1.21",
138
- "@ankhorage/zora": "^2.13.2",
158
+ "@ankhorage/permissions": "^0.2.2",
159
+ "@ankhorage/zora": "^3.0.0",
139
160
  "@changesets/cli": "^2.31.0",
161
+ "@react-native-picker/picker": "2.11.4",
162
+ "@react-native-vector-icons/fontawesome": "^13.1.3",
163
+ "@react-native-vector-icons/fontawesome5": "^13.1.3",
164
+ "@react-native-vector-icons/fontawesome6": "^13.1.3",
165
+ "@react-native-vector-icons/ionicons": "^13.1.3",
140
166
  "@types/bun": "^1.3.14",
141
167
  "@types/node": "^24.13.3",
142
168
  "@types/pngjs": "^6.0.5",
@@ -149,7 +175,10 @@
149
175
  "expo-file-system": "~57.0.5",
150
176
  "expo-image-picker": "~57.0.12",
151
177
  "react": "19.2.3",
178
+ "react-dom": "19.2.3",
152
179
  "react-native": "0.86.2",
180
+ "react-native-safe-area-context": "~5.7.0",
181
+ "react-native-web": "~0.21.0",
153
182
  "playwright-core": "^1.62.1",
154
183
  "pngjs": "^7.0.0",
155
184
  "typescript": "~6.0.3"
@@ -39,7 +39,7 @@ export interface ExpoRuntimeHintMetadata {
39
39
 
40
40
  const GENERATED_ANKHORAGE_DEPENDENCY_VERSIONS = {
41
41
  '@ankhorage/permissions': '^0.2.2',
42
- '@ankhorage/expo-runtime': '^2.7.0',
42
+ '@ankhorage/expo-runtime': '^3.0.0',
43
43
  } as const satisfies Record<string, string>;
44
44
 
45
45
  const GENERATED_EXPO_DEPENDENCY_VERSIONS = Object.fromEntries(
@@ -195,7 +195,7 @@ describe('resolveExpoRuntimePlan platform-neutral permissions', () => {
195
195
  });
196
196
 
197
197
  const SUPPORTED_PERMISSION_DEPENDENCIES = [
198
- { name: '@ankhorage/expo-runtime', version: '^2.7.0' },
198
+ { name: '@ankhorage/expo-runtime', version: '^3.0.0' },
199
199
  { name: '@ankhorage/permissions', version: '^0.2.2' },
200
200
  { name: 'expo-audio', version: EXPO_PLATFORM.packages.audio.version },
201
201
  { name: 'expo-location', version: EXPO_PLATFORM.packages.location.version },