@ankhorage/expo-runtime 2.4.0 → 2.5.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 +6 -0
- package/README.md +1 -1
- package/dist/oauthBrowserRuntime.d.ts +4 -0
- package/dist/oauthBrowserRuntime.d.ts.map +1 -0
- package/dist/oauthBrowserRuntime.js +6 -0
- package/dist/oauthBrowserRuntime.js.map +1 -0
- package/dist/oauthBrowserRuntimeCore.d.ts +9 -0
- package/dist/oauthBrowserRuntimeCore.d.ts.map +1 -0
- package/dist/oauthBrowserRuntimeCore.js +11 -0
- package/dist/oauthBrowserRuntimeCore.js.map +1 -0
- package/package.json +13 -1
- package/src/oauthBrowserRuntime.test.ts +30 -0
- package/src/oauthBrowserRuntime.ts +12 -0
- package/src/oauthBrowserRuntimeCore.ts +22 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @ankhorage/expo-runtime
|
|
2
2
|
|
|
3
|
+
## 2.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- b6541d8: Add runtime readiness detection that rejects Expo Go for brokered native OAuth and requires a custom development or standalone build with the configured app scheme.
|
|
8
|
+
|
|
3
9
|
## 2.4.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# EXPO-RUNTIME
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Declarative runtime integration for Expo apps: maps app capabilities to permissions, packages, config plugins, providers, and adapters
|
|
9
9
|
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ExpoOAuthBrowserRuntimeReadiness } from './oauthBrowserRuntimeCore';
|
|
2
|
+
export type { ExpoOAuthBrowserRuntimeReadiness } from './oauthBrowserRuntimeCore';
|
|
3
|
+
export declare function resolveExpoOAuthBrowserRuntimeReadiness(): ExpoOAuthBrowserRuntimeReadiness;
|
|
4
|
+
//# sourceMappingURL=oauthBrowserRuntime.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import Constants from 'expo-constants';
|
|
2
|
+
import { resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig, } from './oauthBrowserRuntimeCore';
|
|
3
|
+
export function resolveExpoOAuthBrowserRuntimeReadiness() {
|
|
4
|
+
return resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig(Constants.expoGoConfig);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=oauthBrowserRuntime.js.map
|
|
@@ -0,0 +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"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type ExpoOAuthBrowserRuntimeReadiness = {
|
|
2
|
+
readonly status: 'ready';
|
|
3
|
+
} | {
|
|
4
|
+
readonly status: 'unsupported';
|
|
5
|
+
readonly reason: 'expo-go';
|
|
6
|
+
readonly message: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig(expoGoConfig: unknown): ExpoOAuthBrowserRuntimeReadiness;
|
|
9
|
+
//# sourceMappingURL=oauthBrowserRuntimeCore.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig(expoGoConfig) {
|
|
2
|
+
if (expoGoConfig === null) {
|
|
3
|
+
return { status: 'ready' };
|
|
4
|
+
}
|
|
5
|
+
return {
|
|
6
|
+
status: 'unsupported',
|
|
7
|
+
reason: 'expo-go',
|
|
8
|
+
message: 'Brokered OAuth requires a development or standalone build with the configured app scheme; Expo Go cannot provide a stable OAuth callback scheme.',
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=oauthBrowserRuntimeCore.js.map
|
|
@@ -0,0 +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"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/expo-runtime",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.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": {
|
|
@@ -55,6 +55,13 @@
|
|
|
55
55
|
"import": "./dist/oauthBrowserTransport.js",
|
|
56
56
|
"default": "./dist/oauthBrowserTransport.js"
|
|
57
57
|
},
|
|
58
|
+
"./oauth-browser-runtime": {
|
|
59
|
+
"react-native": "./src/oauthBrowserRuntime.ts",
|
|
60
|
+
"browser": "./src/oauthBrowserRuntime.ts",
|
|
61
|
+
"types": "./src/oauthBrowserRuntime.ts",
|
|
62
|
+
"import": "./dist/oauthBrowserRuntime.js",
|
|
63
|
+
"default": "./dist/oauthBrowserRuntime.js"
|
|
64
|
+
},
|
|
58
65
|
"./media-picker": {
|
|
59
66
|
"react-native": "./src/mediaPicker/index.ts",
|
|
60
67
|
"browser": "./src/mediaPicker/index.ts",
|
|
@@ -92,6 +99,7 @@
|
|
|
92
99
|
"@ankhorage/zora": "^2.8.7",
|
|
93
100
|
"expo": "~54.0.34",
|
|
94
101
|
"expo-camera": "~17.0.10",
|
|
102
|
+
"expo-constants": "~18.0.13",
|
|
95
103
|
"expo-document-picker": "~14.0.8",
|
|
96
104
|
"expo-file-system": "~19.0.23",
|
|
97
105
|
"expo-image-picker": "~17.0.11",
|
|
@@ -99,6 +107,9 @@
|
|
|
99
107
|
"react-native": "0.81.5"
|
|
100
108
|
},
|
|
101
109
|
"peerDependenciesMeta": {
|
|
110
|
+
"expo-constants": {
|
|
111
|
+
"optional": true
|
|
112
|
+
},
|
|
102
113
|
"expo-document-picker": {
|
|
103
114
|
"optional": true
|
|
104
115
|
},
|
|
@@ -119,6 +130,7 @@
|
|
|
119
130
|
"@types/react": "^19.2.14",
|
|
120
131
|
"expo": "~54.0.34",
|
|
121
132
|
"expo-camera": "~17.0.10",
|
|
133
|
+
"expo-constants": "~18.0.13",
|
|
122
134
|
"expo-document-picker": "~14.0.8",
|
|
123
135
|
"expo-file-system": "~19.0.23",
|
|
124
136
|
"expo-image-picker": "~17.0.11",
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
|
|
3
|
+
import { resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig } from './oauthBrowserRuntimeCore';
|
|
4
|
+
|
|
5
|
+
describe('Expo OAuth browser runtime readiness', () => {
|
|
6
|
+
test('allows a custom native application build', () => {
|
|
7
|
+
expect(resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig(null)).toEqual({
|
|
8
|
+
status: 'ready',
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('rejects Expo Go with an actionable development-build requirement', () => {
|
|
13
|
+
expect(
|
|
14
|
+
resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig({ debuggerHost: '127.0.0.1:8081' }),
|
|
15
|
+
).toEqual({
|
|
16
|
+
status: 'unsupported',
|
|
17
|
+
reason: 'expo-go',
|
|
18
|
+
message:
|
|
19
|
+
'Brokered OAuth requires a development or standalone build with the configured app scheme; Expo Go cannot provide a stable OAuth callback scheme.',
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test('does not serialize Expo Go configuration into readiness output', () => {
|
|
24
|
+
const readiness = resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig({
|
|
25
|
+
secretLikeValue: 'do-not-echo',
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
expect(JSON.stringify(readiness)).not.toContain('do-not-echo');
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Constants from 'expo-constants';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type ExpoOAuthBrowserRuntimeReadiness,
|
|
5
|
+
resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig,
|
|
6
|
+
} from './oauthBrowserRuntimeCore';
|
|
7
|
+
|
|
8
|
+
export type { ExpoOAuthBrowserRuntimeReadiness } from './oauthBrowserRuntimeCore';
|
|
9
|
+
|
|
10
|
+
export function resolveExpoOAuthBrowserRuntimeReadiness(): ExpoOAuthBrowserRuntimeReadiness {
|
|
11
|
+
return resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig(Constants.expoGoConfig);
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type ExpoOAuthBrowserRuntimeReadiness =
|
|
2
|
+
| { readonly status: 'ready' }
|
|
3
|
+
| {
|
|
4
|
+
readonly status: 'unsupported';
|
|
5
|
+
readonly reason: 'expo-go';
|
|
6
|
+
readonly message: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export function resolveExpoOAuthBrowserRuntimeReadinessFromExpoGoConfig(
|
|
10
|
+
expoGoConfig: unknown,
|
|
11
|
+
): ExpoOAuthBrowserRuntimeReadiness {
|
|
12
|
+
if (expoGoConfig === null) {
|
|
13
|
+
return { status: 'ready' };
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
status: 'unsupported',
|
|
18
|
+
reason: 'expo-go',
|
|
19
|
+
message:
|
|
20
|
+
'Brokered OAuth requires a development or standalone build with the configured app scheme; Expo Go cannot provide a stable OAuth callback scheme.',
|
|
21
|
+
};
|
|
22
|
+
}
|