@ankhorage/expo-runtime 0.0.6 → 0.0.8

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,17 @@
1
1
  # @ankhorage/expo-runtime
2
2
 
3
+ ## 0.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 681f7e1: Add app output model helpers for dependency maps, native plugin output, Android permissions, and combined Expo plan output.
8
+
9
+ ## 0.0.7
10
+
11
+ ### Patch Changes
12
+
13
+ - 7eddf62: Add generated layout helper output for Expo provider imports.
14
+
3
15
  ## 0.0.6
4
16
 
5
17
  ### Patch 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: v0.0.5](././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: v0.0.7](././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
 
@@ -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,7 +5,9 @@ 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';
10
+ export { type ExpoRuntimeLayoutIntegrationPlan, resolveExpoRuntimeLayoutIntegration, } from './layoutIntegrationPlanning';
9
11
  export type { ExpoRuntimeAdapterId, ExpoRuntimePlan, ExpoRuntimeProviderId, } from './resolveExpoRuntimePlan';
10
12
  export { resolveExpoRuntimePlan } from './resolveExpoRuntimePlan';
11
13
  //# sourceMappingURL=index.d.ts.map
@@ -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,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,8 @@ 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';
9
+ export { resolveExpoRuntimeLayoutIntegration, } from './layoutIntegrationPlanning';
8
10
  export { resolveExpoRuntimePlan } from './resolveExpoRuntimePlan';
9
11
  //# sourceMappingURL=index.js.map
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;AAMrE,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 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"]}
@@ -0,0 +1,9 @@
1
+ import type { ExpoRuntimePlan } from './resolveExpoRuntimePlan';
2
+ export interface ExpoRuntimeLayoutIntegrationPlan {
3
+ readonly imports: readonly string[];
4
+ readonly moduleDeclarations: readonly string[];
5
+ readonly providerStart: readonly string[];
6
+ readonly providerEnd: readonly string[];
7
+ }
8
+ export declare function resolveExpoRuntimeLayoutIntegration(runtimePlan: ExpoRuntimePlan | undefined): ExpoRuntimeLayoutIntegrationPlan;
9
+ //# sourceMappingURL=layoutIntegrationPlanning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layoutIntegrationPlanning.d.ts","sourceRoot":"","sources":["../src/layoutIntegrationPlanning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC;AAED,wBAAgB,mCAAmC,CACjD,WAAW,EAAE,eAAe,GAAG,SAAS,GACvC,gCAAgC,CA2BlC"}
@@ -0,0 +1,22 @@
1
+ export function resolveExpoRuntimeLayoutIntegration(runtimePlan) {
2
+ const imports = [];
3
+ const expoRuntimeImports = [];
4
+ const moduleDeclarations = [];
5
+ const providerStart = [];
6
+ const providerEnd = [];
7
+ if ((runtimePlan?.providers.length ?? 0) > 0) {
8
+ expoRuntimeImports.push('ExpoRuntimeProviders');
9
+ providerStart.push(`<ExpoRuntimeProviders providers={['${(runtimePlan?.providers ?? []).join("', '")}']}>`);
10
+ providerEnd.push('</ExpoRuntimeProviders>');
11
+ }
12
+ if (expoRuntimeImports.length > 0) {
13
+ imports.push(`import { ${Array.from(new Set(expoRuntimeImports)).join(', ')} } from '@ankhorage/expo-runtime';`);
14
+ }
15
+ return {
16
+ imports,
17
+ moduleDeclarations,
18
+ providerStart,
19
+ providerEnd,
20
+ };
21
+ }
22
+ //# sourceMappingURL=layoutIntegrationPlanning.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layoutIntegrationPlanning.js","sourceRoot":"","sources":["../src/layoutIntegrationPlanning.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,mCAAmC,CACjD,WAAwC;IAExC,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,kBAAkB,GAAa,EAAE,CAAC;IACxC,MAAM,kBAAkB,GAAa,EAAE,CAAC;IACxC,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7C,kBAAkB,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAChD,aAAa,CAAC,IAAI,CAChB,sCAAsC,CAAC,WAAW,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CACxF,CAAC;QACF,WAAW,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IAC9C,CAAC;IAED,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,OAAO,CAAC,IAAI,CACV,YAAY,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,oCAAoC,CACnG,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO;QACP,kBAAkB;QAClB,aAAa;QACb,WAAW;KACZ,CAAC;AACJ,CAAC","sourcesContent":["import type { ExpoRuntimePlan } from './resolveExpoRuntimePlan';\n\nexport interface ExpoRuntimeLayoutIntegrationPlan {\n readonly imports: readonly string[];\n readonly moduleDeclarations: readonly string[];\n readonly providerStart: readonly string[];\n readonly providerEnd: readonly string[];\n}\n\nexport function resolveExpoRuntimeLayoutIntegration(\n runtimePlan: ExpoRuntimePlan | undefined,\n): ExpoRuntimeLayoutIntegrationPlan {\n const imports: string[] = [];\n const expoRuntimeImports: string[] = [];\n const moduleDeclarations: string[] = [];\n const providerStart: string[] = [];\n const providerEnd: string[] = [];\n\n if ((runtimePlan?.providers.length ?? 0) > 0) {\n expoRuntimeImports.push('ExpoRuntimeProviders');\n providerStart.push(\n `<ExpoRuntimeProviders providers={['${(runtimePlan?.providers ?? []).join(\"', '\")}']}>`,\n );\n providerEnd.push('</ExpoRuntimeProviders>');\n }\n\n if (expoRuntimeImports.length > 0) {\n imports.push(\n `import { ${Array.from(new Set(expoRuntimeImports)).join(', ')} } from '@ankhorage/expo-runtime';`,\n );\n }\n\n return {\n imports,\n moduleDeclarations,\n providerStart,\n providerEnd,\n };\n}\n"]}
@@ -1,4 +1,6 @@
1
+ export { type ExpoRuntimeConfigPluginOutput, type ExpoRuntimeDependencyMap, type ExpoRuntimeGeneratedAppOutputPlan, type ExpoRuntimeNativeOutputPlan, resolveExpoRuntimeConfigPluginOutput, resolveExpoRuntimeDependencyMap, resolveExpoRuntimeGeneratedAppOutput, resolveExpoRuntimeNativeOutput, } from './generatedAppOutput';
1
2
  export { getExpoBarcodeScannerViewSource } from './generatedSources';
3
+ export { type ExpoRuntimeLayoutIntegrationPlan, resolveExpoRuntimeLayoutIntegration, } from './layoutIntegrationPlanning';
2
4
  export type { ExpoRuntimeAdapterId, ExpoRuntimePlan, ExpoRuntimeProviderId, } from './resolveExpoRuntimePlan';
3
5
  export { resolveExpoRuntimePlan } from './resolveExpoRuntimePlan';
4
6
  //# sourceMappingURL=planning.d.ts.map
@@ -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,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,5 @@
1
+ export { resolveExpoRuntimeConfigPluginOutput, resolveExpoRuntimeDependencyMap, resolveExpoRuntimeGeneratedAppOutput, resolveExpoRuntimeNativeOutput, } from './generatedAppOutput';
1
2
  export { getExpoBarcodeScannerViewSource } from './generatedSources';
3
+ export { resolveExpoRuntimeLayoutIntegration, } from './layoutIntegrationPlanning';
2
4
  export { resolveExpoRuntimePlan } from './resolveExpoRuntimePlan';
3
5
  //# sourceMappingURL=planning.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"planning.js","sourceRoot":"","sources":["../src/planning.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAMrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export { getExpoBarcodeScannerViewSource } from './generatedSources';\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.6",
4
+ "version": "0.0.8",
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": {
@@ -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,7 +22,21 @@ 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';
36
+ export {
37
+ type ExpoRuntimeLayoutIntegrationPlan,
38
+ resolveExpoRuntimeLayoutIntegration,
39
+ } from './layoutIntegrationPlanning';
26
40
  export type {
27
41
  ExpoRuntimeAdapterId,
28
42
  ExpoRuntimePlan,
@@ -0,0 +1,55 @@
1
+ import { describe, expect, test } from 'bun:test';
2
+
3
+ import { resolveExpoRuntimeLayoutIntegration } from './layoutIntegrationPlanning';
4
+ import type { ExpoRuntimePlan } from './resolveExpoRuntimePlan';
5
+
6
+ const EMPTY_PLAN: ExpoRuntimePlan = {
7
+ permissions: [],
8
+ capabilities: [],
9
+ impliedPermissions: [],
10
+ dependencies: [],
11
+ nativeConfig: {
12
+ androidPermissions: [],
13
+ configHints: [],
14
+ plugins: [],
15
+ },
16
+ providers: [],
17
+ runtimeAdapters: [],
18
+ usesExpoRuntimeRegistry: false,
19
+ needsPermissionsProvider: false,
20
+ diagnostics: [],
21
+ };
22
+
23
+ const PERMISSIONS_PROVIDER_START = "<ExpoRuntimeProviders providers={['permissions']}>";
24
+
25
+ describe('layoutIntegrationPlanning', () => {
26
+ test('returns an empty integration plan when no providers are required', () => {
27
+ expect(resolveExpoRuntimeLayoutIntegration(undefined)).toEqual({
28
+ imports: [],
29
+ moduleDeclarations: [],
30
+ providerStart: [],
31
+ providerEnd: [],
32
+ });
33
+ expect(resolveExpoRuntimeLayoutIntegration(EMPTY_PLAN)).toEqual({
34
+ imports: [],
35
+ moduleDeclarations: [],
36
+ providerStart: [],
37
+ providerEnd: [],
38
+ });
39
+ });
40
+
41
+ test('adds ExpoRuntimeProviders import and wrapper when providers are required', () => {
42
+ expect(
43
+ resolveExpoRuntimeLayoutIntegration({
44
+ ...EMPTY_PLAN,
45
+ providers: ['permissions'],
46
+ needsPermissionsProvider: true,
47
+ }),
48
+ ).toEqual({
49
+ imports: ["import { ExpoRuntimeProviders } from '@ankhorage/expo-runtime';"],
50
+ moduleDeclarations: [],
51
+ providerStart: [PERMISSIONS_PROVIDER_START],
52
+ providerEnd: ['</ExpoRuntimeProviders>'],
53
+ });
54
+ });
55
+ });
@@ -0,0 +1,39 @@
1
+ import type { ExpoRuntimePlan } from './resolveExpoRuntimePlan';
2
+
3
+ export interface ExpoRuntimeLayoutIntegrationPlan {
4
+ readonly imports: readonly string[];
5
+ readonly moduleDeclarations: readonly string[];
6
+ readonly providerStart: readonly string[];
7
+ readonly providerEnd: readonly string[];
8
+ }
9
+
10
+ export function resolveExpoRuntimeLayoutIntegration(
11
+ runtimePlan: ExpoRuntimePlan | undefined,
12
+ ): ExpoRuntimeLayoutIntegrationPlan {
13
+ const imports: string[] = [];
14
+ const expoRuntimeImports: string[] = [];
15
+ const moduleDeclarations: string[] = [];
16
+ const providerStart: string[] = [];
17
+ const providerEnd: string[] = [];
18
+
19
+ if ((runtimePlan?.providers.length ?? 0) > 0) {
20
+ expoRuntimeImports.push('ExpoRuntimeProviders');
21
+ providerStart.push(
22
+ `<ExpoRuntimeProviders providers={['${(runtimePlan?.providers ?? []).join("', '")}']}>`,
23
+ );
24
+ providerEnd.push('</ExpoRuntimeProviders>');
25
+ }
26
+
27
+ if (expoRuntimeImports.length > 0) {
28
+ imports.push(
29
+ `import { ${Array.from(new Set(expoRuntimeImports)).join(', ')} } from '@ankhorage/expo-runtime';`,
30
+ );
31
+ }
32
+
33
+ return {
34
+ imports,
35
+ moduleDeclarations,
36
+ providerStart,
37
+ providerEnd,
38
+ };
39
+ }
package/src/planning.ts CHANGED
@@ -1,4 +1,18 @@
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';
12
+ export {
13
+ type ExpoRuntimeLayoutIntegrationPlan,
14
+ resolveExpoRuntimeLayoutIntegration,
15
+ } from './layoutIntegrationPlanning';
2
16
  export type {
3
17
  ExpoRuntimeAdapterId,
4
18
  ExpoRuntimePlan,