@ankhorage/expo-runtime 0.0.7 → 0.0.9
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 +12 -0
- package/README.md +3 -1
- package/dist/generatedAppOutput.d.ts +18 -0
- package/dist/generatedAppOutput.d.ts.map +1 -0
- package/dist/generatedAppOutput.js +21 -0
- package/dist/generatedAppOutput.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/planning.d.ts +1 -0
- package/dist/planning.d.ts.map +1 -1
- package/dist/planning.js +1 -0
- package/dist/planning.js.map +1 -1
- package/package.json +2 -2
- package/src/generatedAppOutput.test.ts +120 -0
- package/src/generatedAppOutput.ts +57 -0
- package/src/index.ts +10 -0
- package/src/planning.ts +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ankhorage/expo-runtime
|
|
2
2
|
|
|
3
|
+
## 0.0.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ca0824d: Consume the permissions provider metadata release from `@ankhorage/permissions`.
|
|
8
|
+
|
|
9
|
+
## 0.0.8
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 681f7e1: Add app output model helpers for dependency maps, native plugin output, Android permissions, and combined Expo plan output.
|
|
14
|
+
|
|
3
15
|
## 0.0.7
|
|
4
16
|
|
|
5
17
|
### Patch 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
|
|
|
@@ -18,4 +18,6 @@ Declarative runtime integration for Expo apps: maps app capabilities to permissi
|
|
|
18
18
|
- [createExpoRuntimeRegistry sequence](././paradox/diagrams/sequences/create-expo-runtime-registry.mmd)
|
|
19
19
|
- [executeExpoRuntimeAction sequence](././paradox/diagrams/sequences/execute-expo-runtime-action.mmd)
|
|
20
20
|
- [ExpoBarcodeScannerAdapter sequence](././paradox/diagrams/sequences/expo-barcode-scanner-adapter.mmd)
|
|
21
|
+
- [resolveExpoRuntimeGeneratedAppOutput sequence](././paradox/diagrams/sequences/resolve-expo-runtime-generated-app-output.mmd)
|
|
22
|
+
- [resolveExpoRuntimeNativeOutput sequence](././paradox/diagrams/sequences/resolve-expo-runtime-native-output.mmd)
|
|
21
23
|
- [resolveExpoRuntimePlan sequence](././paradox/diagrams/sequences/resolve-expo-runtime-plan.mmd)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ExpoRuntimeLayoutIntegrationPlan } from './layoutIntegrationPlanning';
|
|
2
|
+
import type { ExpoRuntimePlan } from './resolveExpoRuntimePlan';
|
|
3
|
+
export type ExpoRuntimeDependencyMap = Readonly<Record<string, string>>;
|
|
4
|
+
export type ExpoRuntimeConfigPluginOutput = string | readonly [string, Readonly<Record<string, boolean | string>>];
|
|
5
|
+
export interface ExpoRuntimeNativeOutputPlan {
|
|
6
|
+
readonly androidPermissions: readonly string[];
|
|
7
|
+
readonly configPlugins: readonly ExpoRuntimeConfigPluginOutput[];
|
|
8
|
+
}
|
|
9
|
+
export interface ExpoRuntimeGeneratedAppOutputPlan {
|
|
10
|
+
readonly dependencies: ExpoRuntimeDependencyMap;
|
|
11
|
+
readonly layoutIntegration: ExpoRuntimeLayoutIntegrationPlan;
|
|
12
|
+
readonly native: ExpoRuntimeNativeOutputPlan;
|
|
13
|
+
}
|
|
14
|
+
export declare function resolveExpoRuntimeDependencyMap(runtimePlan: ExpoRuntimePlan | undefined): ExpoRuntimeDependencyMap;
|
|
15
|
+
export declare function resolveExpoRuntimeConfigPluginOutput(runtimePlan: ExpoRuntimePlan | undefined): readonly ExpoRuntimeConfigPluginOutput[];
|
|
16
|
+
export declare function resolveExpoRuntimeNativeOutput(runtimePlan: ExpoRuntimePlan | undefined): ExpoRuntimeNativeOutputPlan;
|
|
17
|
+
export declare function resolveExpoRuntimeGeneratedAppOutput(runtimePlan: ExpoRuntimePlan | undefined): ExpoRuntimeGeneratedAppOutputPlan;
|
|
18
|
+
//# sourceMappingURL=generatedAppOutput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generatedAppOutput.d.ts","sourceRoot":"","sources":["../src/generatedAppOutput.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gCAAgC,EAEtC,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAExE,MAAM,MAAM,6BAA6B,GACrC,MAAM,GACN,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAElE,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,QAAQ,CAAC,aAAa,EAAE,SAAS,6BAA6B,EAAE,CAAC;CAClE;AAED,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,YAAY,EAAE,wBAAwB,CAAC;IAChD,QAAQ,CAAC,iBAAiB,EAAE,gCAAgC,CAAC;IAC7D,QAAQ,CAAC,MAAM,EAAE,2BAA2B,CAAC;CAC9C;AAED,wBAAgB,+BAA+B,CAC7C,WAAW,EAAE,eAAe,GAAG,SAAS,GACvC,wBAAwB,CAI1B;AAED,wBAAgB,oCAAoC,CAClD,WAAW,EAAE,eAAe,GAAG,SAAS,GACvC,SAAS,6BAA6B,EAAE,CAI1C;AAED,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,eAAe,GAAG,SAAS,GACvC,2BAA2B,CAK7B;AAED,wBAAgB,oCAAoC,CAClD,WAAW,EAAE,eAAe,GAAG,SAAS,GACvC,iCAAiC,CAMnC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { resolveExpoRuntimeLayoutIntegration, } from './layoutIntegrationPlanning';
|
|
2
|
+
export function resolveExpoRuntimeDependencyMap(runtimePlan) {
|
|
3
|
+
return Object.fromEntries((runtimePlan?.dependencies ?? []).map((dependency) => [dependency.name, dependency.version]));
|
|
4
|
+
}
|
|
5
|
+
export function resolveExpoRuntimeConfigPluginOutput(runtimePlan) {
|
|
6
|
+
return (runtimePlan?.nativeConfig.plugins ?? []).map((plugin) => plugin.options === undefined ? plugin.name : [plugin.name, plugin.options]);
|
|
7
|
+
}
|
|
8
|
+
export function resolveExpoRuntimeNativeOutput(runtimePlan) {
|
|
9
|
+
return {
|
|
10
|
+
androidPermissions: runtimePlan?.nativeConfig.androidPermissions ?? [],
|
|
11
|
+
configPlugins: resolveExpoRuntimeConfigPluginOutput(runtimePlan),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export function resolveExpoRuntimeGeneratedAppOutput(runtimePlan) {
|
|
15
|
+
return {
|
|
16
|
+
dependencies: resolveExpoRuntimeDependencyMap(runtimePlan),
|
|
17
|
+
layoutIntegration: resolveExpoRuntimeLayoutIntegration(runtimePlan),
|
|
18
|
+
native: resolveExpoRuntimeNativeOutput(runtimePlan),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=generatedAppOutput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generatedAppOutput.js","sourceRoot":"","sources":["../src/generatedAppOutput.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mCAAmC,GACpC,MAAM,6BAA6B,CAAC;AAoBrC,MAAM,UAAU,+BAA+B,CAC7C,WAAwC;IAExC,OAAO,MAAM,CAAC,WAAW,CACvB,CAAC,WAAW,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAC7F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oCAAoC,CAClD,WAAwC;IAExC,OAAO,CAAC,WAAW,EAAE,YAAY,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAC9D,MAAM,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAW,CACtF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,8BAA8B,CAC5C,WAAwC;IAExC,OAAO;QACL,kBAAkB,EAAE,WAAW,EAAE,YAAY,CAAC,kBAAkB,IAAI,EAAE;QACtE,aAAa,EAAE,oCAAoC,CAAC,WAAW,CAAC;KACjE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oCAAoC,CAClD,WAAwC;IAExC,OAAO;QACL,YAAY,EAAE,+BAA+B,CAAC,WAAW,CAAC;QAC1D,iBAAiB,EAAE,mCAAmC,CAAC,WAAW,CAAC;QACnE,MAAM,EAAE,8BAA8B,CAAC,WAAW,CAAC;KACpD,CAAC;AACJ,CAAC","sourcesContent":["import {\n type ExpoRuntimeLayoutIntegrationPlan,\n resolveExpoRuntimeLayoutIntegration,\n} from './layoutIntegrationPlanning';\nimport type { ExpoRuntimePlan } from './resolveExpoRuntimePlan';\n\nexport type ExpoRuntimeDependencyMap = Readonly<Record<string, string>>;\n\nexport type ExpoRuntimeConfigPluginOutput =\n | string\n | readonly [string, Readonly<Record<string, boolean | string>>];\n\nexport interface ExpoRuntimeNativeOutputPlan {\n readonly androidPermissions: readonly string[];\n readonly configPlugins: readonly ExpoRuntimeConfigPluginOutput[];\n}\n\nexport interface ExpoRuntimeGeneratedAppOutputPlan {\n readonly dependencies: ExpoRuntimeDependencyMap;\n readonly layoutIntegration: ExpoRuntimeLayoutIntegrationPlan;\n readonly native: ExpoRuntimeNativeOutputPlan;\n}\n\nexport function resolveExpoRuntimeDependencyMap(\n runtimePlan: ExpoRuntimePlan | undefined,\n): ExpoRuntimeDependencyMap {\n return Object.fromEntries(\n (runtimePlan?.dependencies ?? []).map((dependency) => [dependency.name, dependency.version]),\n );\n}\n\nexport function resolveExpoRuntimeConfigPluginOutput(\n runtimePlan: ExpoRuntimePlan | undefined,\n): readonly ExpoRuntimeConfigPluginOutput[] {\n return (runtimePlan?.nativeConfig.plugins ?? []).map((plugin) =>\n plugin.options === undefined ? plugin.name : ([plugin.name, plugin.options] as const),\n );\n}\n\nexport function resolveExpoRuntimeNativeOutput(\n runtimePlan: ExpoRuntimePlan | undefined,\n): ExpoRuntimeNativeOutputPlan {\n return {\n androidPermissions: runtimePlan?.nativeConfig.androidPermissions ?? [],\n configPlugins: resolveExpoRuntimeConfigPluginOutput(runtimePlan),\n };\n}\n\nexport function resolveExpoRuntimeGeneratedAppOutput(\n runtimePlan: ExpoRuntimePlan | undefined,\n): ExpoRuntimeGeneratedAppOutputPlan {\n return {\n dependencies: resolveExpoRuntimeDependencyMap(runtimePlan),\n layoutIntegration: resolveExpoRuntimeLayoutIntegration(runtimePlan),\n native: resolveExpoRuntimeNativeOutput(runtimePlan),\n };\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { createExpoRuntimeRegistry } from './createExpoRuntimeRegistry';
|
|
|
5
5
|
export { executeExpoRuntimeAction, type ExecuteExpoRuntimeActionArgs, type ExpoRuntimeActionHandlerArgs, type ExpoRuntimeActionHandlers, type ExpoRuntimeRouteResolution, type ExpoRuntimeRouterLike, type ExpoRuntimeThemeMode, resolveExpoRuntimeRoutePath, } from './expoActionBridge';
|
|
6
6
|
export { ExpoBarcodeScannerAdapter } from './ExpoBarcodeScannerAdapter';
|
|
7
7
|
export { ExpoRuntimeProviders, type ExpoRuntimeProvidersProps } from './ExpoRuntimeProviders';
|
|
8
|
+
export { type ExpoRuntimeConfigPluginOutput, type ExpoRuntimeDependencyMap, type ExpoRuntimeGeneratedAppOutputPlan, type ExpoRuntimeNativeOutputPlan, resolveExpoRuntimeConfigPluginOutput, resolveExpoRuntimeDependencyMap, resolveExpoRuntimeGeneratedAppOutput, resolveExpoRuntimeNativeOutput, } from './generatedAppOutput';
|
|
8
9
|
export { getExpoBarcodeScannerViewSource } from './generatedSources';
|
|
9
10
|
export { type ExpoRuntimeLayoutIntegrationPlan, resolveExpoRuntimeLayoutIntegration, } from './layoutIntegrationPlanning';
|
|
10
11
|
export type { ExpoRuntimeAdapterId, ExpoRuntimePlan, ExpoRuntimeProviderId, } from './resolveExpoRuntimePlan';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,2CAA2C,EAC3C,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACL,wBAAwB,EACxB,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,KAAK,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EACL,KAAK,gCAAgC,EACrC,mCAAmC,GACpC,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,2CAA2C,EAC3C,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACL,wBAAwB,EACxB,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,KAAK,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,2BAA2B,EAChC,oCAAoC,EACpC,+BAA+B,EAC/B,oCAAoC,EACpC,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EACL,KAAK,gCAAgC,EACrC,mCAAmC,GACpC,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { createExpoRuntimeRegistry } from './createExpoRuntimeRegistry';
|
|
|
4
4
|
export { executeExpoRuntimeAction, resolveExpoRuntimeRoutePath, } from './expoActionBridge';
|
|
5
5
|
export { ExpoBarcodeScannerAdapter } from './ExpoBarcodeScannerAdapter';
|
|
6
6
|
export { ExpoRuntimeProviders } from './ExpoRuntimeProviders';
|
|
7
|
+
export { resolveExpoRuntimeConfigPluginOutput, resolveExpoRuntimeDependencyMap, resolveExpoRuntimeGeneratedAppOutput, resolveExpoRuntimeNativeOutput, } from './generatedAppOutput';
|
|
7
8
|
export { getExpoBarcodeScannerViewSource } from './generatedSources';
|
|
8
9
|
export { resolveExpoRuntimeLayoutIntegration, } from './layoutIntegrationPlanning';
|
|
9
10
|
export { resolveExpoRuntimePlan } from './resolveExpoRuntimePlan';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EAGrB,2CAA2C,EAC3C,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACL,wBAAwB,EAOxB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAkC,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAEL,mCAAmC,GACpC,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export {\n BARCODE_SCAN_DEDUPE_WINDOW_MS,\n BARCODE_SCANNER_TYPES,\n type BarcodeScanRecord,\n type ExpoBarcodeScanResultLike,\n mapPermissionStatusToCameraPermissionStatus,\n normalizeExpoBarcodeScanResult,\n shouldIgnoreBarcodeScan,\n} from './barcodeScanRuntime';\nexport type { ComponentRegistry } from './componentRegistry';\nexport { createComponentRegistry } from './componentRegistry';\nexport { createExpoRuntimeRegistry } from './createExpoRuntimeRegistry';\nexport {\n executeExpoRuntimeAction,\n type ExecuteExpoRuntimeActionArgs,\n type ExpoRuntimeActionHandlerArgs,\n type ExpoRuntimeActionHandlers,\n type ExpoRuntimeRouteResolution,\n type ExpoRuntimeRouterLike,\n type ExpoRuntimeThemeMode,\n resolveExpoRuntimeRoutePath,\n} from './expoActionBridge';\nexport { ExpoBarcodeScannerAdapter } from './ExpoBarcodeScannerAdapter';\nexport { ExpoRuntimeProviders, type ExpoRuntimeProvidersProps } from './ExpoRuntimeProviders';\nexport { getExpoBarcodeScannerViewSource } from './generatedSources';\nexport {\n type ExpoRuntimeLayoutIntegrationPlan,\n resolveExpoRuntimeLayoutIntegration,\n} from './layoutIntegrationPlanning';\nexport type {\n ExpoRuntimeAdapterId,\n ExpoRuntimePlan,\n ExpoRuntimeProviderId,\n} from './resolveExpoRuntimePlan';\nexport { resolveExpoRuntimePlan } from './resolveExpoRuntimePlan';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EAGrB,2CAA2C,EAC3C,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACL,wBAAwB,EAOxB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAkC,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAKL,oCAAoC,EACpC,+BAA+B,EAC/B,oCAAoC,EACpC,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAEL,mCAAmC,GACpC,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export {\n BARCODE_SCAN_DEDUPE_WINDOW_MS,\n BARCODE_SCANNER_TYPES,\n type BarcodeScanRecord,\n type ExpoBarcodeScanResultLike,\n mapPermissionStatusToCameraPermissionStatus,\n normalizeExpoBarcodeScanResult,\n shouldIgnoreBarcodeScan,\n} from './barcodeScanRuntime';\nexport type { ComponentRegistry } from './componentRegistry';\nexport { createComponentRegistry } from './componentRegistry';\nexport { createExpoRuntimeRegistry } from './createExpoRuntimeRegistry';\nexport {\n executeExpoRuntimeAction,\n type ExecuteExpoRuntimeActionArgs,\n type ExpoRuntimeActionHandlerArgs,\n type ExpoRuntimeActionHandlers,\n type ExpoRuntimeRouteResolution,\n type ExpoRuntimeRouterLike,\n type ExpoRuntimeThemeMode,\n resolveExpoRuntimeRoutePath,\n} from './expoActionBridge';\nexport { ExpoBarcodeScannerAdapter } from './ExpoBarcodeScannerAdapter';\nexport { ExpoRuntimeProviders, type ExpoRuntimeProvidersProps } from './ExpoRuntimeProviders';\nexport {\n type ExpoRuntimeConfigPluginOutput,\n type ExpoRuntimeDependencyMap,\n type ExpoRuntimeGeneratedAppOutputPlan,\n type ExpoRuntimeNativeOutputPlan,\n resolveExpoRuntimeConfigPluginOutput,\n resolveExpoRuntimeDependencyMap,\n resolveExpoRuntimeGeneratedAppOutput,\n resolveExpoRuntimeNativeOutput,\n} from './generatedAppOutput';\nexport { getExpoBarcodeScannerViewSource } from './generatedSources';\nexport {\n type ExpoRuntimeLayoutIntegrationPlan,\n resolveExpoRuntimeLayoutIntegration,\n} from './layoutIntegrationPlanning';\nexport type {\n ExpoRuntimeAdapterId,\n ExpoRuntimePlan,\n ExpoRuntimeProviderId,\n} from './resolveExpoRuntimePlan';\nexport { resolveExpoRuntimePlan } from './resolveExpoRuntimePlan';\n"]}
|
package/dist/planning.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { type ExpoRuntimeConfigPluginOutput, type ExpoRuntimeDependencyMap, type ExpoRuntimeGeneratedAppOutputPlan, type ExpoRuntimeNativeOutputPlan, resolveExpoRuntimeConfigPluginOutput, resolveExpoRuntimeDependencyMap, resolveExpoRuntimeGeneratedAppOutput, resolveExpoRuntimeNativeOutput, } from './generatedAppOutput';
|
|
1
2
|
export { getExpoBarcodeScannerViewSource } from './generatedSources';
|
|
2
3
|
export { type ExpoRuntimeLayoutIntegrationPlan, resolveExpoRuntimeLayoutIntegration, } from './layoutIntegrationPlanning';
|
|
3
4
|
export type { ExpoRuntimeAdapterId, ExpoRuntimePlan, ExpoRuntimeProviderId, } from './resolveExpoRuntimePlan';
|
package/dist/planning.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planning.d.ts","sourceRoot":"","sources":["../src/planning.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EACL,KAAK,gCAAgC,EACrC,mCAAmC,GACpC,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"planning.d.ts","sourceRoot":"","sources":["../src/planning.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,2BAA2B,EAChC,oCAAoC,EACpC,+BAA+B,EAC/B,oCAAoC,EACpC,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EACL,KAAK,gCAAgC,EACrC,mCAAmC,GACpC,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/planning.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { resolveExpoRuntimeConfigPluginOutput, resolveExpoRuntimeDependencyMap, resolveExpoRuntimeGeneratedAppOutput, resolveExpoRuntimeNativeOutput, } from './generatedAppOutput';
|
|
1
2
|
export { getExpoBarcodeScannerViewSource } from './generatedSources';
|
|
2
3
|
export { resolveExpoRuntimeLayoutIntegration, } from './layoutIntegrationPlanning';
|
|
3
4
|
export { resolveExpoRuntimePlan } from './resolveExpoRuntimePlan';
|
package/dist/planning.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planning.js","sourceRoot":"","sources":["../src/planning.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAEL,mCAAmC,GACpC,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export { getExpoBarcodeScannerViewSource } from './generatedSources';\nexport {\n type ExpoRuntimeLayoutIntegrationPlan,\n resolveExpoRuntimeLayoutIntegration,\n} from './layoutIntegrationPlanning';\nexport type {\n ExpoRuntimeAdapterId,\n ExpoRuntimePlan,\n ExpoRuntimeProviderId,\n} from './resolveExpoRuntimePlan';\nexport { resolveExpoRuntimePlan } from './resolveExpoRuntimePlan';\n"]}
|
|
1
|
+
{"version":3,"file":"planning.js","sourceRoot":"","sources":["../src/planning.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,oCAAoC,EACpC,+BAA+B,EAC/B,oCAAoC,EACpC,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAEL,mCAAmC,GACpC,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export {\n type ExpoRuntimeConfigPluginOutput,\n type ExpoRuntimeDependencyMap,\n type ExpoRuntimeGeneratedAppOutputPlan,\n type ExpoRuntimeNativeOutputPlan,\n resolveExpoRuntimeConfigPluginOutput,\n resolveExpoRuntimeDependencyMap,\n resolveExpoRuntimeGeneratedAppOutput,\n resolveExpoRuntimeNativeOutput,\n} from './generatedAppOutput';\nexport { getExpoBarcodeScannerViewSource } from './generatedSources';\nexport {\n type ExpoRuntimeLayoutIntegrationPlan,\n resolveExpoRuntimeLayoutIntegration,\n} from './layoutIntegrationPlanning';\nexport type {\n ExpoRuntimeAdapterId,\n ExpoRuntimePlan,\n ExpoRuntimeProviderId,\n} from './resolveExpoRuntimePlan';\nexport { resolveExpoRuntimePlan } from './resolveExpoRuntimePlan';\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/expo-runtime",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.9",
|
|
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": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@ankhorage/contracts": "^1.18.3",
|
|
26
|
-
"@ankhorage/permissions": "^0.2.
|
|
26
|
+
"@ankhorage/permissions": "^0.2.1",
|
|
27
27
|
"@ankhorage/zora": "^2.8.0"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
resolveExpoRuntimeConfigPluginOutput,
|
|
5
|
+
resolveExpoRuntimeDependencyMap,
|
|
6
|
+
resolveExpoRuntimeGeneratedAppOutput,
|
|
7
|
+
resolveExpoRuntimeNativeOutput,
|
|
8
|
+
} from './generatedAppOutput';
|
|
9
|
+
import type { ExpoRuntimePlan } from './resolveExpoRuntimePlan';
|
|
10
|
+
|
|
11
|
+
const EMPTY_PLAN: ExpoRuntimePlan = {
|
|
12
|
+
permissions: [],
|
|
13
|
+
capabilities: [],
|
|
14
|
+
impliedPermissions: [],
|
|
15
|
+
dependencies: [],
|
|
16
|
+
nativeConfig: {
|
|
17
|
+
androidPermissions: [],
|
|
18
|
+
configHints: [],
|
|
19
|
+
plugins: [],
|
|
20
|
+
},
|
|
21
|
+
providers: [],
|
|
22
|
+
runtimeAdapters: [],
|
|
23
|
+
usesExpoRuntimeRegistry: false,
|
|
24
|
+
needsPermissionsProvider: false,
|
|
25
|
+
diagnostics: [],
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const PROVIDER_START = "<ExpoRuntimeProviders providers={['permissions']}>";
|
|
29
|
+
|
|
30
|
+
const CAMERA_PLAN: ExpoRuntimePlan = {
|
|
31
|
+
...EMPTY_PLAN,
|
|
32
|
+
dependencies: [
|
|
33
|
+
{
|
|
34
|
+
name: 'expo-camera',
|
|
35
|
+
version: '~17.0.10',
|
|
36
|
+
reasons: ['capability:barcodeScanner'],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: '@ankhorage/expo-runtime',
|
|
40
|
+
version: '^0.0.7',
|
|
41
|
+
reasons: ['runtime:expo'],
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
nativeConfig: {
|
|
45
|
+
androidPermissions: ['android.permission.CAMERA'],
|
|
46
|
+
configHints: ['cameraPermission'],
|
|
47
|
+
plugins: [
|
|
48
|
+
{
|
|
49
|
+
name: 'expo-camera',
|
|
50
|
+
options: {
|
|
51
|
+
cameraPermission: 'Allow camera access to scan barcodes.',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'expo-something',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
providers: ['permissions'],
|
|
60
|
+
runtimeAdapters: ['ExpoBarcodeScannerAdapter'],
|
|
61
|
+
usesExpoRuntimeRegistry: true,
|
|
62
|
+
needsPermissionsProvider: true,
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
describe('generatedAppOutput', () => {
|
|
66
|
+
test('returns empty output for missing or empty plans', () => {
|
|
67
|
+
expect(resolveExpoRuntimeDependencyMap(undefined)).toEqual({});
|
|
68
|
+
expect(resolveExpoRuntimeConfigPluginOutput(undefined)).toEqual([]);
|
|
69
|
+
expect(resolveExpoRuntimeNativeOutput(EMPTY_PLAN)).toEqual({
|
|
70
|
+
androidPermissions: [],
|
|
71
|
+
configPlugins: [],
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test('maps runtime dependencies into a package dependency map', () => {
|
|
76
|
+
expect(resolveExpoRuntimeDependencyMap(CAMERA_PLAN)).toEqual({
|
|
77
|
+
'@ankhorage/expo-runtime': '^0.0.7',
|
|
78
|
+
'expo-camera': '~17.0.10',
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
test('maps native plugin metadata into serializable config plugin output', () => {
|
|
83
|
+
expect(resolveExpoRuntimeConfigPluginOutput(CAMERA_PLAN)).toEqual([
|
|
84
|
+
[
|
|
85
|
+
'expo-camera',
|
|
86
|
+
{
|
|
87
|
+
cameraPermission: 'Allow camera access to scan barcodes.',
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
'expo-something',
|
|
91
|
+
]);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test('combines dependency, native and layout output', () => {
|
|
95
|
+
expect(resolveExpoRuntimeGeneratedAppOutput(CAMERA_PLAN)).toEqual({
|
|
96
|
+
dependencies: {
|
|
97
|
+
'@ankhorage/expo-runtime': '^0.0.7',
|
|
98
|
+
'expo-camera': '~17.0.10',
|
|
99
|
+
},
|
|
100
|
+
layoutIntegration: {
|
|
101
|
+
imports: ["import { ExpoRuntimeProviders } from '@ankhorage/expo-runtime';"],
|
|
102
|
+
moduleDeclarations: [],
|
|
103
|
+
providerStart: [PROVIDER_START],
|
|
104
|
+
providerEnd: ['</ExpoRuntimeProviders>'],
|
|
105
|
+
},
|
|
106
|
+
native: {
|
|
107
|
+
androidPermissions: ['android.permission.CAMERA'],
|
|
108
|
+
configPlugins: [
|
|
109
|
+
[
|
|
110
|
+
'expo-camera',
|
|
111
|
+
{
|
|
112
|
+
cameraPermission: 'Allow camera access to scan barcodes.',
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
'expo-something',
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ExpoRuntimeLayoutIntegrationPlan,
|
|
3
|
+
resolveExpoRuntimeLayoutIntegration,
|
|
4
|
+
} from './layoutIntegrationPlanning';
|
|
5
|
+
import type { ExpoRuntimePlan } from './resolveExpoRuntimePlan';
|
|
6
|
+
|
|
7
|
+
export type ExpoRuntimeDependencyMap = Readonly<Record<string, string>>;
|
|
8
|
+
|
|
9
|
+
export type ExpoRuntimeConfigPluginOutput =
|
|
10
|
+
| string
|
|
11
|
+
| readonly [string, Readonly<Record<string, boolean | string>>];
|
|
12
|
+
|
|
13
|
+
export interface ExpoRuntimeNativeOutputPlan {
|
|
14
|
+
readonly androidPermissions: readonly string[];
|
|
15
|
+
readonly configPlugins: readonly ExpoRuntimeConfigPluginOutput[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ExpoRuntimeGeneratedAppOutputPlan {
|
|
19
|
+
readonly dependencies: ExpoRuntimeDependencyMap;
|
|
20
|
+
readonly layoutIntegration: ExpoRuntimeLayoutIntegrationPlan;
|
|
21
|
+
readonly native: ExpoRuntimeNativeOutputPlan;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function resolveExpoRuntimeDependencyMap(
|
|
25
|
+
runtimePlan: ExpoRuntimePlan | undefined,
|
|
26
|
+
): ExpoRuntimeDependencyMap {
|
|
27
|
+
return Object.fromEntries(
|
|
28
|
+
(runtimePlan?.dependencies ?? []).map((dependency) => [dependency.name, dependency.version]),
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function resolveExpoRuntimeConfigPluginOutput(
|
|
33
|
+
runtimePlan: ExpoRuntimePlan | undefined,
|
|
34
|
+
): readonly ExpoRuntimeConfigPluginOutput[] {
|
|
35
|
+
return (runtimePlan?.nativeConfig.plugins ?? []).map((plugin) =>
|
|
36
|
+
plugin.options === undefined ? plugin.name : ([plugin.name, plugin.options] as const),
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function resolveExpoRuntimeNativeOutput(
|
|
41
|
+
runtimePlan: ExpoRuntimePlan | undefined,
|
|
42
|
+
): ExpoRuntimeNativeOutputPlan {
|
|
43
|
+
return {
|
|
44
|
+
androidPermissions: runtimePlan?.nativeConfig.androidPermissions ?? [],
|
|
45
|
+
configPlugins: resolveExpoRuntimeConfigPluginOutput(runtimePlan),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function resolveExpoRuntimeGeneratedAppOutput(
|
|
50
|
+
runtimePlan: ExpoRuntimePlan | undefined,
|
|
51
|
+
): ExpoRuntimeGeneratedAppOutputPlan {
|
|
52
|
+
return {
|
|
53
|
+
dependencies: resolveExpoRuntimeDependencyMap(runtimePlan),
|
|
54
|
+
layoutIntegration: resolveExpoRuntimeLayoutIntegration(runtimePlan),
|
|
55
|
+
native: resolveExpoRuntimeNativeOutput(runtimePlan),
|
|
56
|
+
};
|
|
57
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -22,6 +22,16 @@ export {
|
|
|
22
22
|
} from './expoActionBridge';
|
|
23
23
|
export { ExpoBarcodeScannerAdapter } from './ExpoBarcodeScannerAdapter';
|
|
24
24
|
export { ExpoRuntimeProviders, type ExpoRuntimeProvidersProps } from './ExpoRuntimeProviders';
|
|
25
|
+
export {
|
|
26
|
+
type ExpoRuntimeConfigPluginOutput,
|
|
27
|
+
type ExpoRuntimeDependencyMap,
|
|
28
|
+
type ExpoRuntimeGeneratedAppOutputPlan,
|
|
29
|
+
type ExpoRuntimeNativeOutputPlan,
|
|
30
|
+
resolveExpoRuntimeConfigPluginOutput,
|
|
31
|
+
resolveExpoRuntimeDependencyMap,
|
|
32
|
+
resolveExpoRuntimeGeneratedAppOutput,
|
|
33
|
+
resolveExpoRuntimeNativeOutput,
|
|
34
|
+
} from './generatedAppOutput';
|
|
25
35
|
export { getExpoBarcodeScannerViewSource } from './generatedSources';
|
|
26
36
|
export {
|
|
27
37
|
type ExpoRuntimeLayoutIntegrationPlan,
|
package/src/planning.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
export {
|
|
2
|
+
type ExpoRuntimeConfigPluginOutput,
|
|
3
|
+
type ExpoRuntimeDependencyMap,
|
|
4
|
+
type ExpoRuntimeGeneratedAppOutputPlan,
|
|
5
|
+
type ExpoRuntimeNativeOutputPlan,
|
|
6
|
+
resolveExpoRuntimeConfigPluginOutput,
|
|
7
|
+
resolveExpoRuntimeDependencyMap,
|
|
8
|
+
resolveExpoRuntimeGeneratedAppOutput,
|
|
9
|
+
resolveExpoRuntimeNativeOutput,
|
|
10
|
+
} from './generatedAppOutput';
|
|
1
11
|
export { getExpoBarcodeScannerViewSource } from './generatedSources';
|
|
2
12
|
export {
|
|
3
13
|
type ExpoRuntimeLayoutIntegrationPlan,
|