@ankhorage/expo-runtime 2.5.0 → 2.5.1

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
+ ## 2.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f616cdf: Fix brokered OAuth host detection so custom native, development-client, and standalone builds are not misclassified as Expo Go.
8
+
3
9
  ## 2.5.0
4
10
 
5
11
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"oauthBrowserRuntime.d.ts","sourceRoot":"","sources":["../src/oauthBrowserRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,gCAAgC,EAEtC,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAElF,wBAAgB,uCAAuC,IAAI,gCAAgC,CAE1F"}
1
+ {"version":3,"file":"oauthBrowserRuntime.d.ts","sourceRoot":"","sources":["../src/oauthBrowserRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,gCAAgC,EAEtC,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAElF,wBAAgB,uCAAuC,IAAI,gCAAgC,CAM1F"}
@@ -1,6 +1,10 @@
1
1
  import Constants from 'expo-constants';
2
- import { resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig, } from './oauthBrowserRuntimeCore';
2
+ import { resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment, } from './oauthBrowserRuntimeCore';
3
3
  export function resolveExpoOAuthBrowserRuntimeReadiness() {
4
- return resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig(Constants.expoGoConfig);
4
+ return resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment({
5
+ appOwnership: Constants.appOwnership,
6
+ executionEnvironment: Constants.executionEnvironment,
7
+ expoGoConfig: Constants.expoGoConfig,
8
+ });
5
9
  }
6
10
  //# sourceMappingURL=oauthBrowserRuntime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauthBrowserRuntime.js","sourceRoot":"","sources":["../src/oauthBrowserRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAEL,uDAAuD,GACxD,MAAM,2BAA2B,CAAC;AAInC,MAAM,UAAU,uCAAuC;IACrD,OAAO,uDAAuD,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;AACzF,CAAC","sourcesContent":["import Constants from 'expo-constants';\n\nimport {\n type ExpoOAuthBrowserRuntimeReadiness,\n resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig,\n} from './oauthBrowserRuntimeCore';\n\nexport type { ExpoOAuthBrowserRuntimeReadiness } from './oauthBrowserRuntimeCore';\n\nexport function resolveExpoOAuthBrowserRuntimeReadiness(): ExpoOAuthBrowserRuntimeReadiness {\n return resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig(Constants.expoGoConfig);\n}\n"]}
1
+ {"version":3,"file":"oauthBrowserRuntime.js","sourceRoot":"","sources":["../src/oauthBrowserRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAEL,sDAAsD,GACvD,MAAM,2BAA2B,CAAC;AAInC,MAAM,UAAU,uCAAuC;IACrD,OAAO,sDAAsD,CAAC;QAC5D,YAAY,EAAE,SAAS,CAAC,YAAY;QACpC,oBAAoB,EAAE,SAAS,CAAC,oBAAoB;QACpD,YAAY,EAAE,SAAS,CAAC,YAAY;KACrC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import Constants from 'expo-constants';\n\nimport {\n type ExpoOAuthBrowserRuntimeReadiness,\n resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment,\n} from './oauthBrowserRuntimeCore';\n\nexport type { ExpoOAuthBrowserRuntimeReadiness } from './oauthBrowserRuntimeCore';\n\nexport function resolveExpoOAuthBrowserRuntimeReadiness(): ExpoOAuthBrowserRuntimeReadiness {\n return resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment({\n appOwnership: Constants.appOwnership,\n executionEnvironment: Constants.executionEnvironment,\n expoGoConfig: Constants.expoGoConfig,\n });\n}\n"]}
@@ -5,5 +5,10 @@ export type ExpoOAuthBrowserRuntimeReadiness = {
5
5
  readonly reason: 'expo-go';
6
6
  readonly message: string;
7
7
  };
8
- export declare function resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig(expoGoConfig: unknown): ExpoOAuthBrowserRuntimeReadiness;
8
+ export interface ExpoOAuthBrowserRuntimeEnvironment {
9
+ readonly appOwnership: unknown;
10
+ readonly executionEnvironment: unknown;
11
+ readonly expoGoConfig: unknown;
12
+ }
13
+ export declare function resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment(environment: ExpoOAuthBrowserRuntimeEnvironment): ExpoOAuthBrowserRuntimeReadiness;
9
14
  //# sourceMappingURL=oauthBrowserRuntimeCore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oauthBrowserRuntimeCore.d.ts","sourceRoot":"","sources":["../src/oauthBrowserRuntimeCore.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gCAAgC,GACxC;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAC5B;IACE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEN,wBAAgB,uDAAuD,CACrE,YAAY,EAAE,OAAO,GACpB,gCAAgC,CAWlC"}
1
+ {"version":3,"file":"oauthBrowserRuntimeCore.d.ts","sourceRoot":"","sources":["../src/oauthBrowserRuntimeCore.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gCAAgC,GACxC;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAC5B;IACE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEN,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;IACvC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAChC;AAED,wBAAgB,sDAAsD,CACpE,WAAW,EAAE,kCAAkC,GAC9C,gCAAgC,CAWlC"}
@@ -1,5 +1,5 @@
1
- export function resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig(expoGoConfig) {
2
- if (expoGoConfig === null) {
1
+ export function resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment(environment) {
2
+ if (environment.appOwnership !== 'expo') {
3
3
  return { status: 'ready' };
4
4
  }
5
5
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"oauthBrowserRuntimeCore.js","sourceRoot":"","sources":["../src/oauthBrowserRuntimeCore.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,uDAAuD,CACrE,YAAqB;IAErB,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;QAC1B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,OAAO;QACL,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,SAAS;QACjB,OAAO,EACL,kJAAkJ;KACrJ,CAAC;AACJ,CAAC","sourcesContent":["export type ExpoOAuthBrowserRuntimeReadiness =\n | { readonly status: 'ready' }\n | {\n readonly status: 'unsupported';\n readonly reason: 'expo-go';\n readonly message: string;\n };\n\nexport function resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig(\n expoGoConfig: unknown,\n): ExpoOAuthBrowserRuntimeReadiness {\n if (expoGoConfig === null) {\n return { status: 'ready' };\n }\n\n return {\n status: 'unsupported',\n reason: 'expo-go',\n message:\n 'Brokered OAuth requires a development or standalone build with the configured app scheme; Expo Go cannot provide a stable OAuth callback scheme.',\n };\n}\n"]}
1
+ {"version":3,"file":"oauthBrowserRuntimeCore.js","sourceRoot":"","sources":["../src/oauthBrowserRuntimeCore.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,sDAAsD,CACpE,WAA+C;IAE/C,IAAI,WAAW,CAAC,YAAY,KAAK,MAAM,EAAE,CAAC;QACxC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,OAAO;QACL,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,SAAS;QACjB,OAAO,EACL,kJAAkJ;KACrJ,CAAC;AACJ,CAAC","sourcesContent":["export type ExpoOAuthBrowserRuntimeReadiness =\n | { readonly status: 'ready' }\n | {\n readonly status: 'unsupported';\n readonly reason: 'expo-go';\n readonly message: string;\n };\n\nexport interface ExpoOAuthBrowserRuntimeEnvironment {\n readonly appOwnership: unknown;\n readonly executionEnvironment: unknown;\n readonly expoGoConfig: unknown;\n}\n\nexport function resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment(\n environment: ExpoOAuthBrowserRuntimeEnvironment,\n): ExpoOAuthBrowserRuntimeReadiness {\n if (environment.appOwnership !== 'expo') {\n return { status: 'ready' };\n }\n\n return {\n status: 'unsupported',\n reason: 'expo-go',\n message:\n 'Brokered OAuth requires a development or standalone build with the configured app scheme; Expo Go cannot provide a stable OAuth callback scheme.',\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.5.0",
4
+ "version": "2.5.1",
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": {
@@ -1,17 +1,45 @@
1
1
  import { describe, expect, test } from 'bun:test';
2
2
 
3
- import { resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig } from './oauthBrowserRuntimeCore';
3
+ import { resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment } from './oauthBrowserRuntimeCore';
4
4
 
5
5
  describe('Expo OAuth browser runtime readiness', () => {
6
- test('allows a custom native application build', () => {
7
- expect(resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig(null)).toEqual({
8
- status: 'ready',
9
- });
6
+ test('allows an SDK 54 custom native build with an embedded Expo config', () => {
7
+ expect(
8
+ resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment({
9
+ appOwnership: null,
10
+ executionEnvironment: 'bare',
11
+ expoGoConfig: { name: 'Auth5 Native OAuth Smoke' },
12
+ }),
13
+ ).toEqual({ status: 'ready' });
14
+ });
15
+
16
+ test('allows a development client store-client runtime', () => {
17
+ expect(
18
+ resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment({
19
+ appOwnership: null,
20
+ executionEnvironment: 'storeClient',
21
+ expoGoConfig: null,
22
+ }),
23
+ ).toEqual({ status: 'ready' });
24
+ });
25
+
26
+ test('allows a standalone runtime', () => {
27
+ expect(
28
+ resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment({
29
+ appOwnership: null,
30
+ executionEnvironment: 'standalone',
31
+ expoGoConfig: null,
32
+ }),
33
+ ).toEqual({ status: 'ready' });
10
34
  });
11
35
 
12
36
  test('rejects Expo Go with an actionable development-build requirement', () => {
13
37
  expect(
14
- resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig({ debuggerHost: '127.0.0.1:8081' }),
38
+ resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment({
39
+ appOwnership: 'expo',
40
+ executionEnvironment: 'storeClient',
41
+ expoGoConfig: { debuggerHost: '127.0.0.1:8081' },
42
+ }),
15
43
  ).toEqual({
16
44
  status: 'unsupported',
17
45
  reason: 'expo-go',
@@ -20,9 +48,11 @@ describe('Expo OAuth browser runtime readiness', () => {
20
48
  });
21
49
  });
22
50
 
23
- test('does not serialize Expo Go configuration into readiness output', () => {
24
- const readiness = resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig({
25
- secretLikeValue: 'do-not-echo',
51
+ test('does not serialize Expo runtime configuration into readiness output', () => {
52
+ const readiness = resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment({
53
+ appOwnership: 'expo',
54
+ executionEnvironment: 'storeClient',
55
+ expoGoConfig: { secretLikeValue: 'do-not-echo' },
26
56
  });
27
57
 
28
58
  expect(JSON.stringify(readiness)).not.toContain('do-not-echo');
@@ -2,11 +2,15 @@ import Constants from 'expo-constants';
2
2
 
3
3
  import {
4
4
  type ExpoOAuthBrowserRuntimeReadiness,
5
- resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig,
5
+ resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment,
6
6
  } from './oauthBrowserRuntimeCore';
7
7
 
8
8
  export type { ExpoOAuthBrowserRuntimeReadiness } from './oauthBrowserRuntimeCore';
9
9
 
10
10
  export function resolveExpoOAuthBrowserRuntimeReadiness(): ExpoOAuthBrowserRuntimeReadiness {
11
- return resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig(Constants.expoGoConfig);
11
+ return resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment({
12
+ appOwnership: Constants.appOwnership,
13
+ executionEnvironment: Constants.executionEnvironment,
14
+ expoGoConfig: Constants.expoGoConfig,
15
+ });
12
16
  }
@@ -6,10 +6,16 @@ export type ExpoOAuthBrowserRuntimeReadiness =
6
6
  readonly message: string;
7
7
  };
8
8
 
9
- export function resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig(
10
- expoGoConfig: unknown,
9
+ export interface ExpoOAuthBrowserRuntimeEnvironment {
10
+ readonly appOwnership: unknown;
11
+ readonly executionEnvironment: unknown;
12
+ readonly expoGoConfig: unknown;
13
+ }
14
+
15
+ export function resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment(
16
+ environment: ExpoOAuthBrowserRuntimeEnvironment,
11
17
  ): ExpoOAuthBrowserRuntimeReadiness {
12
- if (expoGoConfig === null) {
18
+ if (environment.appOwnership !== 'expo') {
13
19
  return { status: 'ready' };
14
20
  }
15
21