@amabeth/repeating-wheel-picker 1.0.0 → 1.2.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/LICENSE +20 -20
- package/README.md +57 -44
- package/example/index.ts +8 -0
- package/example/node_modules/@expo/cli/static/template/+html.tsx +28 -0
- package/example/node_modules/@expo/cli/static/template/+native-intent.ts +9 -0
- package/example/node_modules/@expo/cli/static/template/[...rsc]+api.ts +16 -0
- package/example/node_modules/ansi-styles/index.d.ts +345 -0
- package/example/node_modules/chalk/index.d.ts +415 -0
- package/example/node_modules/commander/typings/index.d.ts +627 -0
- package/example/node_modules/expo/Expo.podspec +108 -0
- package/example/node_modules/expo/build/Expo.d.ts +8 -0
- package/example/node_modules/expo/build/Expo.fx.d.ts +4 -0
- package/example/node_modules/expo/build/Expo.fx.web.d.ts +3 -0
- package/example/node_modules/expo/build/devtools/DevToolsPluginClient.d.ts +72 -0
- package/example/node_modules/expo/build/devtools/DevToolsPluginClientFactory.d.ts +16 -0
- package/example/node_modules/expo/build/devtools/DevToolsPluginClientImplApp.d.ts +15 -0
- package/example/node_modules/expo/build/devtools/DevToolsPluginClientImplBrowser.d.ts +14 -0
- package/example/node_modules/expo/build/devtools/MessageFramePacker.d.ts +50 -0
- package/example/node_modules/expo/build/devtools/ProtocolVersion.d.ts +7 -0
- package/example/node_modules/expo/build/devtools/WebSocketBackingStore.d.ts +10 -0
- package/example/node_modules/expo/build/devtools/WebSocketWithReconnect.d.ts +81 -0
- package/example/node_modules/expo/build/devtools/devtools.types.d.ts +42 -0
- package/example/node_modules/expo/build/devtools/getConnectionInfo.d.ts +6 -0
- package/example/node_modules/expo/build/devtools/getConnectionInfo.native.d.ts +6 -0
- package/example/node_modules/expo/build/devtools/index.d.ts +12 -0
- package/example/node_modules/expo/build/devtools/logger.d.ts +6 -0
- package/example/node_modules/expo/build/dom/base.d.ts +5 -0
- package/example/node_modules/expo/build/dom/dom-entry.d.ts +3 -0
- package/example/node_modules/expo/build/dom/dom-hooks.d.ts +8 -0
- package/example/node_modules/expo/build/dom/dom.d.ts +5 -0
- package/example/node_modules/expo/build/dom/dom.types.d.ts +34 -0
- package/example/node_modules/expo/build/dom/dom.web.d.ts +3 -0
- package/example/node_modules/expo/build/dom/global-events.d.ts +4 -0
- package/example/node_modules/expo/build/dom/injection.d.ts +9 -0
- package/example/node_modules/expo/build/dom/internal.d.ts +3 -0
- package/example/node_modules/expo/build/dom/internal.web.d.ts +2 -0
- package/example/node_modules/expo/build/dom/marshal.d.ts +4 -0
- package/example/node_modules/expo/build/dom/webview/ExpoDOMWebView.d.ts +6 -0
- package/example/node_modules/expo/build/dom/webview/RNWebView.d.ts +7 -0
- package/example/node_modules/expo/build/dom/webview/useDebugZeroHeight.d.ts +12 -0
- package/example/node_modules/expo/build/dom/webview-wrapper.d.ts +16 -0
- package/example/node_modules/expo/build/environment/DevLoadingView.d.ts +3 -0
- package/example/node_modules/expo/build/environment/DevLoadingView.web.d.ts +3 -0
- package/example/node_modules/expo/build/environment/DevLoadingViewNativeModule.d.ts +9 -0
- package/example/node_modules/expo/build/environment/DevLoadingViewNativeModule.native.d.ts +3 -0
- package/example/node_modules/expo/build/environment/ExpoGo.d.ts +31 -0
- package/example/node_modules/expo/build/environment/ExpoGo.web.d.ts +3 -0
- package/example/node_modules/expo/build/environment/getInitialSafeArea.d.ts +7 -0
- package/example/node_modules/expo/build/environment/getInitialSafeArea.native.d.ts +11 -0
- package/example/node_modules/expo/build/errors/AppEntryNotFound.d.ts +2 -0
- package/example/node_modules/expo/build/errors/ExpoErrorManager.d.ts +8 -0
- package/example/node_modules/expo/build/errors/ExpoErrorManager.native.d.ts +4 -0
- package/example/node_modules/expo/build/hooks/useEvent.d.ts +59 -0
- package/example/node_modules/expo/build/launch/registerRootComponent.d.ts +30 -0
- package/example/node_modules/expo/build/launch/withDevTools.d.ts +3 -0
- package/example/node_modules/expo/build/launch/withDevTools.ios.d.ts +7 -0
- package/example/node_modules/expo/build/launch/withDevTools.web.d.ts +3 -0
- package/example/node_modules/expo/build/timer/polyfillNextTick.d.ts +6 -0
- package/example/node_modules/expo/build/utils/blobUtils.d.ts +9 -0
- package/example/node_modules/expo/build/utils/getBundleUrl.d.ts +2 -0
- package/example/node_modules/expo/build/utils/getBundleUrl.native.d.ts +2 -0
- package/example/node_modules/expo/build/utils/getBundleUrl.web.d.ts +2 -0
- package/example/node_modules/expo/build/winter/FormData.d.ts +49 -0
- package/example/node_modules/expo/build/winter/ImportMetaRegistry.d.ts +9 -0
- package/example/node_modules/expo/build/winter/TextDecoder.d.ts +20 -0
- package/example/node_modules/expo/build/winter/fetch/ExpoFetchModule.d.ts +2 -0
- package/example/node_modules/expo/build/winter/fetch/ExpoFetchModule.web.d.ts +10 -0
- package/example/node_modules/expo/build/winter/fetch/FetchErrors.d.ts +8 -0
- package/example/node_modules/expo/build/winter/fetch/FetchResponse.d.ts +31 -0
- package/example/node_modules/expo/build/winter/fetch/NativeRequest.d.ts +30 -0
- package/example/node_modules/expo/build/winter/fetch/RequestUtils.d.ts +21 -0
- package/example/node_modules/expo/build/winter/fetch/convertFormData.d.ts +19 -0
- package/example/node_modules/expo/build/winter/fetch/fetch.d.ts +4 -0
- package/example/node_modules/expo/build/winter/fetch/fetch.types.d.ts +16 -0
- package/example/node_modules/expo/build/winter/fetch/fetch.web.d.ts +2 -0
- package/example/node_modules/expo/build/winter/fetch/index.d.ts +3 -0
- package/example/node_modules/expo/build/winter/index.d.ts +2 -0
- package/example/node_modules/expo/build/winter/runtime.d.ts +2 -0
- package/example/node_modules/expo/build/winter/runtime.native.d.ts +2 -0
- package/example/node_modules/expo/build/winter/url.d.ts +23 -0
- package/example/node_modules/expo/config-plugins.d.ts +1 -0
- package/example/node_modules/expo/config.d.ts +1 -0
- package/example/node_modules/expo/devtools.d.ts +1 -0
- package/example/node_modules/expo/dom/global.d.ts +1 -0
- package/example/node_modules/expo/dom/index.d.ts +1 -0
- package/example/node_modules/expo/dom/internal.d.ts +1 -0
- package/example/node_modules/expo/fetch.d.ts +1 -0
- package/example/node_modules/expo/fingerprint.d.ts +1 -0
- package/example/node_modules/expo/metro-config.d.ts +1 -0
- package/example/node_modules/expo/react-native.config.js +50 -0
- package/example/node_modules/expo/src/Expo.fx.tsx +53 -0
- package/example/node_modules/expo/src/Expo.fx.web.tsx +21 -0
- package/example/node_modules/expo/src/Expo.ts +30 -0
- package/example/node_modules/expo/src/devtools/DevToolsPluginClient.ts +240 -0
- package/example/node_modules/expo/src/devtools/DevToolsPluginClientFactory.ts +73 -0
- package/example/node_modules/expo/src/devtools/DevToolsPluginClientImplApp.ts +56 -0
- package/example/node_modules/expo/src/devtools/DevToolsPluginClientImplBrowser.ts +38 -0
- package/example/node_modules/expo/src/devtools/MessageFramePacker.ts +235 -0
- package/example/node_modules/expo/src/devtools/ProtocolVersion.ts +6 -0
- package/example/node_modules/expo/src/devtools/WebSocketBackingStore.ts +10 -0
- package/example/node_modules/expo/src/devtools/WebSocketWithReconnect.ts +318 -0
- package/example/node_modules/expo/src/devtools/devtools.types.ts +50 -0
- package/example/node_modules/expo/src/devtools/getConnectionInfo.native.ts +18 -0
- package/example/node_modules/expo/src/devtools/getConnectionInfo.ts +16 -0
- package/example/node_modules/expo/src/devtools/index.ts +53 -0
- package/example/node_modules/expo/src/devtools/logger.ts +29 -0
- package/example/node_modules/expo/src/dom/base.ts +62 -0
- package/example/node_modules/expo/src/dom/dom-entry.tsx +128 -0
- package/example/node_modules/expo/src/dom/dom-hooks.ts +46 -0
- package/example/node_modules/expo/src/dom/dom.ts +8 -0
- package/example/node_modules/expo/src/dom/dom.types.ts +39 -0
- package/example/node_modules/expo/src/dom/dom.web.ts +6 -0
- package/example/node_modules/expo/src/dom/global-events.ts +16 -0
- package/example/node_modules/expo/src/dom/injection.ts +42 -0
- package/example/node_modules/expo/src/dom/internal.ts +5 -0
- package/example/node_modules/expo/src/dom/internal.web.ts +1 -0
- package/example/node_modules/expo/src/dom/marshal.tsx +116 -0
- package/example/node_modules/expo/src/dom/webview/ExpoDOMWebView.ts +10 -0
- package/example/node_modules/expo/src/dom/webview/RNWebView.ts +12 -0
- package/example/node_modules/expo/src/dom/webview/useDebugZeroHeight.ts +62 -0
- package/example/node_modules/expo/src/dom/webview-wrapper.tsx +253 -0
- package/example/node_modules/expo/src/environment/DevLoadingView.tsx +123 -0
- package/example/node_modules/expo/src/environment/DevLoadingView.web.tsx +135 -0
- package/example/node_modules/expo/src/environment/DevLoadingViewNativeModule.native.ts +3 -0
- package/example/node_modules/expo/src/environment/DevLoadingViewNativeModule.ts +7 -0
- package/example/node_modules/expo/src/environment/ExpoGo.ts +53 -0
- package/example/node_modules/expo/src/environment/ExpoGo.web.ts +7 -0
- package/example/node_modules/expo/src/environment/getInitialSafeArea.native.ts +16 -0
- package/example/node_modules/expo/src/environment/getInitialSafeArea.ts +8 -0
- package/example/node_modules/expo/src/errors/AppEntryNotFound.tsx +35 -0
- package/example/node_modules/expo/src/errors/ExpoErrorManager.native.ts +51 -0
- package/example/node_modules/expo/src/errors/ExpoErrorManager.ts +11 -0
- package/example/node_modules/expo/src/hooks/useEvent.ts +112 -0
- package/example/node_modules/expo/src/launch/registerRootComponent.tsx +64 -0
- package/example/node_modules/expo/src/launch/withDevTools.ios.tsx +47 -0
- package/example/node_modules/expo/src/launch/withDevTools.tsx +30 -0
- package/example/node_modules/expo/src/launch/withDevTools.web.tsx +23 -0
- package/example/node_modules/expo/src/timer/polyfillNextTick.ts +10 -0
- package/example/node_modules/expo/src/ts-declarations/console.d.ts +47 -0
- package/example/node_modules/expo/src/ts-declarations/global.d.ts +12 -0
- package/example/node_modules/expo/src/ts-declarations/react-native.d.ts +34 -0
- package/example/node_modules/expo/src/ts-declarations/whatwg-url-without-unicode.d.ts +186 -0
- package/example/node_modules/expo/src/utils/blobUtils.ts +23 -0
- package/example/node_modules/expo/src/utils/getBundleUrl.native.ts +17 -0
- package/example/node_modules/expo/src/utils/getBundleUrl.ts +5 -0
- package/example/node_modules/expo/src/utils/getBundleUrl.web.ts +21 -0
- package/example/node_modules/expo/src/winter/FormData.ts +222 -0
- package/example/node_modules/expo/src/winter/ImportMetaRegistry.ts +14 -0
- package/example/node_modules/expo/src/winter/TextDecoder.ts +429 -0
- package/example/node_modules/expo/src/winter/fetch/ExpoFetchModule.ts +3 -0
- package/example/node_modules/expo/src/winter/fetch/ExpoFetchModule.web.ts +7 -0
- package/example/node_modules/expo/src/winter/fetch/FetchErrors.ts +11 -0
- package/example/node_modules/expo/src/winter/fetch/FetchResponse.ts +146 -0
- package/example/node_modules/expo/src/winter/fetch/NativeRequest.ts +38 -0
- package/example/node_modules/expo/src/winter/fetch/RequestUtils.ts +124 -0
- package/example/node_modules/expo/src/winter/fetch/convertFormData.ts +92 -0
- package/example/node_modules/expo/src/winter/fetch/fetch.ts +59 -0
- package/example/node_modules/expo/src/winter/fetch/fetch.types.ts +17 -0
- package/example/node_modules/expo/src/winter/fetch/fetch.web.ts +1 -0
- package/example/node_modules/expo/src/winter/fetch/index.ts +2 -0
- package/example/node_modules/expo/src/winter/index.ts +1 -0
- package/example/node_modules/expo/src/winter/runtime.native.ts +41 -0
- package/example/node_modules/expo/src/winter/runtime.ts +5 -0
- package/example/node_modules/expo/src/winter/url.ts +116 -0
- package/example/node_modules/expo/types/global.d.ts +38 -0
- package/example/node_modules/expo/types/index.d.ts +3 -0
- package/example/node_modules/expo/types/metro-require.d.ts +52 -0
- package/example/node_modules/expo/types/react-native-web.d.ts +291 -0
- package/example/node_modules/expo-modules-autolinking/build/ExpoModuleConfig.d.ts +85 -0
- package/example/node_modules/expo-modules-autolinking/build/autolinking/findModules.d.ts +5 -0
- package/example/node_modules/expo-modules-autolinking/build/autolinking/generatePackageList.d.ts +11 -0
- package/example/node_modules/expo-modules-autolinking/build/autolinking/getConfiguration.d.ts +2 -0
- package/example/node_modules/expo-modules-autolinking/build/autolinking/index.d.ts +17 -0
- package/example/node_modules/expo-modules-autolinking/build/autolinking/mergeLinkingOptions.d.ts +21 -0
- package/example/node_modules/expo-modules-autolinking/build/autolinking/resolveModules.d.ts +9 -0
- package/example/node_modules/expo-modules-autolinking/build/autolinking/utils.d.ts +6 -0
- package/example/node_modules/expo-modules-autolinking/build/autolinking/verifySearchResults.d.ts +5 -0
- package/example/node_modules/expo-modules-autolinking/build/fileUtils.d.ts +18 -0
- package/example/node_modules/expo-modules-autolinking/build/index.d.ts +1 -0
- package/example/node_modules/expo-modules-autolinking/build/platforms/android.d.ts +38 -0
- package/example/node_modules/expo-modules-autolinking/build/platforms/apple.d.ts +15 -0
- package/example/node_modules/expo-modules-autolinking/build/platforms/devtools.d.ts +3 -0
- package/example/node_modules/expo-modules-autolinking/build/reactNativeConfig/androidResolver.d.ts +20 -0
- package/example/node_modules/expo-modules-autolinking/build/reactNativeConfig/config.d.ts +5 -0
- package/example/node_modules/expo-modules-autolinking/build/reactNativeConfig/index.d.ts +2 -0
- package/example/node_modules/expo-modules-autolinking/build/reactNativeConfig/iosResolver.d.ts +2 -0
- package/example/node_modules/expo-modules-autolinking/build/reactNativeConfig/reactNativeConfig.d.ts +13 -0
- package/example/node_modules/expo-modules-autolinking/build/reactNativeConfig/reactNativeConfig.types.d.ts +95 -0
- package/example/node_modules/expo-modules-autolinking/build/types.d.ts +319 -0
- package/example/node_modules/expo-modules-autolinking/e2e/TestUtils.ts +53 -0
- package/example/node_modules/expo-modules-autolinking/exports.d.ts +1 -0
- package/example/node_modules/expo-modules-autolinking/src/ExpoModuleConfig.ts +181 -0
- package/example/node_modules/expo-modules-autolinking/src/autolinking/findModules.ts +259 -0
- package/example/node_modules/expo-modules-autolinking/src/autolinking/generatePackageList.ts +46 -0
- package/example/node_modules/expo-modules-autolinking/src/autolinking/getConfiguration.ts +7 -0
- package/example/node_modules/expo-modules-autolinking/src/autolinking/index.ts +45 -0
- package/example/node_modules/expo-modules-autolinking/src/autolinking/mergeLinkingOptions.ts +127 -0
- package/example/node_modules/expo-modules-autolinking/src/autolinking/resolveModules.ts +46 -0
- package/example/node_modules/expo-modules-autolinking/src/autolinking/utils.ts +37 -0
- package/example/node_modules/expo-modules-autolinking/src/autolinking/verifySearchResults.ts +33 -0
- package/example/node_modules/expo-modules-autolinking/src/fileUtils.ts +64 -0
- package/example/node_modules/expo-modules-autolinking/src/index.ts +262 -0
- package/example/node_modules/expo-modules-autolinking/src/platforms/android.ts +303 -0
- package/example/node_modules/expo-modules-autolinking/src/platforms/apple.ts +292 -0
- package/example/node_modules/expo-modules-autolinking/src/platforms/devtools.ts +25 -0
- package/example/node_modules/expo-modules-autolinking/src/reactNativeConfig/androidResolver.ts +264 -0
- package/example/node_modules/expo-modules-autolinking/src/reactNativeConfig/config.ts +67 -0
- package/example/node_modules/expo-modules-autolinking/src/reactNativeConfig/index.ts +2 -0
- package/example/node_modules/expo-modules-autolinking/src/reactNativeConfig/iosResolver.ts +37 -0
- package/example/node_modules/expo-modules-autolinking/src/reactNativeConfig/reactNativeConfig.ts +245 -0
- package/example/node_modules/expo-modules-autolinking/src/reactNativeConfig/reactNativeConfig.types.ts +107 -0
- package/example/node_modules/expo-modules-autolinking/src/types.ts +384 -0
- package/example/node_modules/find-up/index.d.ts +138 -0
- package/example/node_modules/glob/dist/commonjs/glob.d.ts +388 -0
- package/example/node_modules/glob/dist/commonjs/has-magic.d.ts +14 -0
- package/example/node_modules/glob/dist/commonjs/ignore.d.ts +24 -0
- package/example/node_modules/glob/dist/commonjs/index.d.ts +97 -0
- package/example/node_modules/glob/dist/commonjs/pattern.d.ts +76 -0
- package/example/node_modules/glob/dist/commonjs/processor.d.ts +59 -0
- package/example/node_modules/glob/dist/commonjs/walker.d.ts +97 -0
- package/example/node_modules/glob/dist/esm/glob.d.ts +388 -0
- package/example/node_modules/glob/dist/esm/has-magic.d.ts +14 -0
- package/example/node_modules/glob/dist/esm/ignore.d.ts +24 -0
- package/example/node_modules/glob/dist/esm/index.d.ts +97 -0
- package/example/node_modules/glob/dist/esm/pattern.d.ts +76 -0
- package/example/node_modules/glob/dist/esm/processor.d.ts +59 -0
- package/example/node_modules/glob/dist/esm/walker.d.ts +97 -0
- package/example/node_modules/locate-path/index.d.ts +83 -0
- package/example/node_modules/log-symbols/node_modules/chalk/types/index.d.ts +97 -0
- package/example/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
- package/example/node_modules/minimatch/dist/commonjs/ast.d.ts +20 -0
- package/example/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +8 -0
- package/example/node_modules/minimatch/dist/commonjs/escape.d.ts +12 -0
- package/example/node_modules/minimatch/dist/commonjs/index.d.ts +94 -0
- package/example/node_modules/minimatch/dist/commonjs/unescape.d.ts +17 -0
- package/example/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
- package/example/node_modules/minimatch/dist/esm/ast.d.ts +20 -0
- package/example/node_modules/minimatch/dist/esm/brace-expressions.d.ts +8 -0
- package/example/node_modules/minimatch/dist/esm/escape.d.ts +12 -0
- package/example/node_modules/minimatch/dist/esm/index.d.ts +94 -0
- package/example/node_modules/minimatch/dist/esm/unescape.d.ts +17 -0
- package/example/node_modules/ora/index.d.ts +257 -0
- package/example/node_modules/ora/node_modules/chalk/types/index.d.ts +97 -0
- package/example/node_modules/ora/node_modules/strip-ansi/index.d.ts +15 -0
- package/example/node_modules/p-locate/index.d.ts +53 -0
- package/example/node_modules/path-exists/index.d.ts +28 -0
- package/example/package.json +29 -0
- package/example/src/constants/styles.ts +43 -0
- package/example/src/hooks/useComponentHeight.ts +13 -0
- package/example/src/scenes/app.tsx +33 -0
- package/example/src/scenes/booleanPicker.tsx +60 -0
- package/example/src/scenes/customTypePicker.tsx +83 -0
- package/example/src/scenes/numberPicker.tsx +75 -0
- package/example/src/scenes/stringPicker.tsx +64 -0
- package/lib/module/index.js +6 -6
- package/lib/module/index.js.map +1 -1
- package/package.json +168 -177
- package/src/index.tsx +0 -507
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { SupportedPlatform } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Options for 'react-native-config' command.
|
|
4
|
+
*/
|
|
5
|
+
export interface RNConfigCommandOptions {
|
|
6
|
+
platform: SupportedPlatform;
|
|
7
|
+
projectRoot: string;
|
|
8
|
+
searchPaths: string[];
|
|
9
|
+
transitiveLinkingDependencies: string[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Dependency configuration for Android platform.
|
|
13
|
+
*/
|
|
14
|
+
export interface RNConfigDependencyAndroid {
|
|
15
|
+
sourceDir: string;
|
|
16
|
+
packageImportPath: string;
|
|
17
|
+
packageInstance: string;
|
|
18
|
+
dependencyConfiguration?: string;
|
|
19
|
+
buildTypes: string[];
|
|
20
|
+
libraryName?: string | null;
|
|
21
|
+
componentDescriptors?: string[] | null;
|
|
22
|
+
cmakeListsPath?: string | null;
|
|
23
|
+
cxxModuleCMakeListsModuleName?: string | null;
|
|
24
|
+
cxxModuleCMakeListsPath?: string | null;
|
|
25
|
+
cxxModuleHeaderName?: string | null;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Dependency configuration for iOS platform.
|
|
29
|
+
*/
|
|
30
|
+
export interface RNConfigDependencyIos {
|
|
31
|
+
podspecPath: string;
|
|
32
|
+
version: string;
|
|
33
|
+
configurations: string[];
|
|
34
|
+
scriptPhases: any[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Dependency configuration.
|
|
38
|
+
*/
|
|
39
|
+
export interface RNConfigDependency {
|
|
40
|
+
root: string;
|
|
41
|
+
name: string;
|
|
42
|
+
platforms: {
|
|
43
|
+
android?: RNConfigDependencyAndroid;
|
|
44
|
+
ios?: RNConfigDependencyIos;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Result of 'react-native-config' command.
|
|
49
|
+
*/
|
|
50
|
+
export interface RNConfigResult {
|
|
51
|
+
root: string;
|
|
52
|
+
reactNativePath: string;
|
|
53
|
+
dependencies: Record<string, RNConfigDependency>;
|
|
54
|
+
project: {
|
|
55
|
+
ios?: {
|
|
56
|
+
sourceDir: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export type RNConfigReactNativePlatformsConfigAndroid = any;
|
|
61
|
+
export type RNConfigReactNativePlatformsConfigIos = any;
|
|
62
|
+
interface RNConfigReactNativePlatformsConfig {
|
|
63
|
+
root?: string;
|
|
64
|
+
platforms?: {
|
|
65
|
+
android?: RNConfigReactNativePlatformsConfigAndroid;
|
|
66
|
+
ios?: RNConfigReactNativePlatformsConfigIos;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The `react-native.config.js` config from projectRoot.
|
|
71
|
+
*/
|
|
72
|
+
export interface RNConfigReactNativeProjectConfig {
|
|
73
|
+
dependencies?: Record<string, RNConfigReactNativePlatformsConfig>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The `react-native.config.js` config from library packageRoot.
|
|
77
|
+
*/
|
|
78
|
+
export interface RNConfigReactNativeLibraryConfig {
|
|
79
|
+
dependency?: RNConfigReactNativePlatformsConfig;
|
|
80
|
+
platforms?: any;
|
|
81
|
+
}
|
|
82
|
+
export type RNConfigReactNativeConfig = RNConfigReactNativeProjectConfig | RNConfigReactNativeLibraryConfig;
|
|
83
|
+
/**
|
|
84
|
+
* The `project` config represents the app project configuration.
|
|
85
|
+
*/
|
|
86
|
+
export interface RNConfigReactNativeAppProjectConfig {
|
|
87
|
+
android?: {
|
|
88
|
+
sourceDir: string;
|
|
89
|
+
packageName: string;
|
|
90
|
+
};
|
|
91
|
+
ios?: {
|
|
92
|
+
sourceDir: string;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export {};
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { ExpoModuleConfig } from './ExpoModuleConfig';
|
|
2
|
+
type Required<T, K extends keyof T> = T & {
|
|
3
|
+
[P in K]-?: T[P];
|
|
4
|
+
};
|
|
5
|
+
type WithRequired<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>> & Required<T, K>;
|
|
6
|
+
export type SupportedPlatform = 'apple' | 'ios' | 'android' | 'web' | 'macos' | 'tvos' | 'devtools';
|
|
7
|
+
/**
|
|
8
|
+
* Options that can be passed through `expo.autolinking` config in the package.json file.
|
|
9
|
+
*/
|
|
10
|
+
export type AutolinkingOptions = {
|
|
11
|
+
searchPaths?: string[] | null;
|
|
12
|
+
ignorePaths?: string[] | null;
|
|
13
|
+
exclude?: string[] | null;
|
|
14
|
+
flags?: Record<string, any>;
|
|
15
|
+
};
|
|
16
|
+
export type AndroidAutolinkingOptions = AutolinkingOptions & {
|
|
17
|
+
buildFromSource?: string[] | null;
|
|
18
|
+
};
|
|
19
|
+
export type BaseAutolinkingOptions = AutolinkingOptions & {
|
|
20
|
+
[key in SupportedPlatform]?: AutolinkingOptions;
|
|
21
|
+
};
|
|
22
|
+
export interface PlatformAutolinkingOptions extends BaseAutolinkingOptions {
|
|
23
|
+
android?: AndroidAutolinkingOptions;
|
|
24
|
+
}
|
|
25
|
+
export interface SearchOptions {
|
|
26
|
+
searchPaths: string[];
|
|
27
|
+
ignorePaths?: string[] | null;
|
|
28
|
+
exclude?: string[] | null;
|
|
29
|
+
platform: SupportedPlatform;
|
|
30
|
+
silent?: boolean;
|
|
31
|
+
nativeModulesDir?: string | null;
|
|
32
|
+
projectRoot: string;
|
|
33
|
+
/**
|
|
34
|
+
* Filter the search results to only include the project dependencies.
|
|
35
|
+
* In a monorepo, you may like to set this to false and link all modules from the monorepo.
|
|
36
|
+
* @default true
|
|
37
|
+
*/
|
|
38
|
+
onlyProjectDeps?: boolean;
|
|
39
|
+
flags?: Record<string, any>;
|
|
40
|
+
android?: {
|
|
41
|
+
buildFromSource?: string[] | null;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface ResolveOptions extends SearchOptions {
|
|
45
|
+
json?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface GenerateOptions extends ResolveOptions {
|
|
48
|
+
target: string;
|
|
49
|
+
namespace?: string;
|
|
50
|
+
empty?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface GenerateModulesProviderOptions extends ResolveOptions {
|
|
53
|
+
target: string;
|
|
54
|
+
entitlement?: string;
|
|
55
|
+
packages: string[];
|
|
56
|
+
}
|
|
57
|
+
export type PackageRevision = {
|
|
58
|
+
path: string;
|
|
59
|
+
version: string;
|
|
60
|
+
config?: ExpoModuleConfig;
|
|
61
|
+
duplicates?: PackageRevision[];
|
|
62
|
+
};
|
|
63
|
+
export type SearchResults = {
|
|
64
|
+
[moduleName: string]: PackageRevision;
|
|
65
|
+
};
|
|
66
|
+
export interface ModuleAndroidProjectInfo {
|
|
67
|
+
name: string;
|
|
68
|
+
sourceDir: string;
|
|
69
|
+
modules: string[];
|
|
70
|
+
publication?: AndroidPublication;
|
|
71
|
+
aarProjects?: AndroidGradleAarProjectDescriptor[];
|
|
72
|
+
shouldUsePublicationScriptPath?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface ModuleAndroidPluginInfo {
|
|
75
|
+
id: string;
|
|
76
|
+
sourceDir: string;
|
|
77
|
+
}
|
|
78
|
+
export interface ModuleAndroidAarProjectInfo extends AndroidGradleAarProjectDescriptor {
|
|
79
|
+
projectDir: string;
|
|
80
|
+
}
|
|
81
|
+
export interface CommonNativeModuleDescriptor {
|
|
82
|
+
packageName: string;
|
|
83
|
+
coreFeatures?: string[];
|
|
84
|
+
}
|
|
85
|
+
export interface ModuleDescriptorAndroid extends CommonNativeModuleDescriptor {
|
|
86
|
+
projects?: ModuleAndroidProjectInfo[];
|
|
87
|
+
plugins?: ModuleAndroidPluginInfo[];
|
|
88
|
+
}
|
|
89
|
+
export interface ModuleIosPodspecInfo {
|
|
90
|
+
podName: string;
|
|
91
|
+
podspecDir: string;
|
|
92
|
+
}
|
|
93
|
+
export interface ModuleDescriptorIos extends CommonNativeModuleDescriptor {
|
|
94
|
+
modules: string[];
|
|
95
|
+
pods: ModuleIosPodspecInfo[];
|
|
96
|
+
flags: Record<string, any> | undefined;
|
|
97
|
+
swiftModuleNames: string[];
|
|
98
|
+
appDelegateSubscribers: string[];
|
|
99
|
+
reactDelegateHandlers: string[];
|
|
100
|
+
debugOnly: boolean;
|
|
101
|
+
}
|
|
102
|
+
export interface ModuleDescriptorDevTools {
|
|
103
|
+
packageName: string;
|
|
104
|
+
packageRoot: string;
|
|
105
|
+
webpageRoot: string;
|
|
106
|
+
}
|
|
107
|
+
export type ModuleDescriptor = ModuleDescriptorAndroid | ModuleDescriptorIos | ModuleDescriptorDevTools;
|
|
108
|
+
export interface AndroidGradlePluginDescriptor {
|
|
109
|
+
/**
|
|
110
|
+
* Gradle plugin ID
|
|
111
|
+
*/
|
|
112
|
+
id: string;
|
|
113
|
+
/**
|
|
114
|
+
* Artifact group
|
|
115
|
+
*/
|
|
116
|
+
group: string;
|
|
117
|
+
/**
|
|
118
|
+
* Relative path to the gradle plugin directory
|
|
119
|
+
*/
|
|
120
|
+
sourceDir: string;
|
|
121
|
+
/**
|
|
122
|
+
* Whether to apply the plugin to the root project
|
|
123
|
+
* Defaults to true
|
|
124
|
+
*/
|
|
125
|
+
applyToRootProject?: boolean;
|
|
126
|
+
}
|
|
127
|
+
export interface AndroidGradleAarProjectDescriptor {
|
|
128
|
+
/**
|
|
129
|
+
* Gradle project name
|
|
130
|
+
*/
|
|
131
|
+
name: string;
|
|
132
|
+
/**
|
|
133
|
+
* Path to the AAR file
|
|
134
|
+
*/
|
|
135
|
+
aarFilePath: string;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Information about the available publication of an Android AAR file.
|
|
139
|
+
*/
|
|
140
|
+
export interface AndroidPublication {
|
|
141
|
+
/**
|
|
142
|
+
* The Maven artifact ID.
|
|
143
|
+
*/
|
|
144
|
+
id: string;
|
|
145
|
+
/**
|
|
146
|
+
* The Maven group ID.
|
|
147
|
+
*/
|
|
148
|
+
group: string;
|
|
149
|
+
/**
|
|
150
|
+
* The Maven version.
|
|
151
|
+
*/
|
|
152
|
+
version: string;
|
|
153
|
+
/**
|
|
154
|
+
* The Maven repository.
|
|
155
|
+
*/
|
|
156
|
+
repository: string;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Represents a raw config specific to Apple platforms.
|
|
160
|
+
*/
|
|
161
|
+
export type RawModuleConfigApple = {
|
|
162
|
+
/**
|
|
163
|
+
* Names of Swift native modules classes to put to the generated modules provider file.
|
|
164
|
+
*/
|
|
165
|
+
modules?: string[];
|
|
166
|
+
/**
|
|
167
|
+
* Names of Swift classes that hooks into `ExpoAppDelegate` to receive AppDelegate life-cycle events.
|
|
168
|
+
*/
|
|
169
|
+
appDelegateSubscribers?: string[];
|
|
170
|
+
/**
|
|
171
|
+
* Names of Swift classes that implement `ExpoReactDelegateHandler` to hook React instance creation.
|
|
172
|
+
*/
|
|
173
|
+
reactDelegateHandlers?: string[];
|
|
174
|
+
/**
|
|
175
|
+
* Podspec relative path.
|
|
176
|
+
* To have multiple podspecs, string array type is also supported.
|
|
177
|
+
*/
|
|
178
|
+
podspecPath?: string | string[];
|
|
179
|
+
/**
|
|
180
|
+
* Swift product module name. If empty, the pod name is used for Swift imports.
|
|
181
|
+
* To have multiple modules, string array is also supported.
|
|
182
|
+
*/
|
|
183
|
+
swiftModuleName?: string | string[];
|
|
184
|
+
/**
|
|
185
|
+
* Whether this module will be added only to the debug configuration.
|
|
186
|
+
* Defaults to false.
|
|
187
|
+
*/
|
|
188
|
+
debugOnly?: boolean;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Represents a raw config specific to Android platforms.
|
|
192
|
+
*/
|
|
193
|
+
export type RawAndroidProjectConfig = {
|
|
194
|
+
/**
|
|
195
|
+
* The name of the project. It will be used as the Gradle project name.
|
|
196
|
+
*/
|
|
197
|
+
name?: string;
|
|
198
|
+
/**
|
|
199
|
+
* The path to the project directory. Should contain the `build.gradle{.kts}` file.
|
|
200
|
+
* It's relative to the module root directory.
|
|
201
|
+
*/
|
|
202
|
+
path?: string;
|
|
203
|
+
/**
|
|
204
|
+
* Information about the available publication of an Android AAR file
|
|
205
|
+
*/
|
|
206
|
+
publication?: AndroidPublication;
|
|
207
|
+
/**
|
|
208
|
+
* The path to the script that determines whether the publication should be used.
|
|
209
|
+
* Evaluate in the context of the `settings.gradle` file.
|
|
210
|
+
* Won't be run if the publication is not defined.
|
|
211
|
+
*/
|
|
212
|
+
shouldUsePublicationScriptPath?: string;
|
|
213
|
+
/**
|
|
214
|
+
* Names of the modules to be linked in the project.
|
|
215
|
+
*/
|
|
216
|
+
modules?: string[];
|
|
217
|
+
/**
|
|
218
|
+
* Prebuilded AAR projects.
|
|
219
|
+
*/
|
|
220
|
+
gradleAarProjects?: AndroidGradleAarProjectDescriptor[];
|
|
221
|
+
};
|
|
222
|
+
export type RawAndroidConfig = {
|
|
223
|
+
projects?: WithRequired<RawAndroidProjectConfig, 'name' | 'path'>[];
|
|
224
|
+
/**
|
|
225
|
+
* Gradle plugins.
|
|
226
|
+
*/
|
|
227
|
+
gradlePlugins?: AndroidGradlePluginDescriptor[];
|
|
228
|
+
} & RawAndroidProjectConfig;
|
|
229
|
+
/**
|
|
230
|
+
* Represents a raw config from `expo-module.json`.
|
|
231
|
+
*/
|
|
232
|
+
export interface RawExpoModuleConfig {
|
|
233
|
+
/**
|
|
234
|
+
* An array of supported platforms.
|
|
235
|
+
*/
|
|
236
|
+
platforms?: SupportedPlatform[];
|
|
237
|
+
/**
|
|
238
|
+
* A config for all Apple platforms.
|
|
239
|
+
*/
|
|
240
|
+
apple?: RawModuleConfigApple;
|
|
241
|
+
/**
|
|
242
|
+
* The legacy config previously used for iOS platform. For backwards compatibility it's used as the fallback for `apple`.
|
|
243
|
+
* @deprecated As the module can now support more than iOS platform, use the generic `apple` config instead.
|
|
244
|
+
*/
|
|
245
|
+
ios?: RawModuleConfigApple;
|
|
246
|
+
/**
|
|
247
|
+
* Android-specific config.
|
|
248
|
+
*/
|
|
249
|
+
android?: RawAndroidConfig;
|
|
250
|
+
/**
|
|
251
|
+
* List of core features that this module requires.
|
|
252
|
+
*/
|
|
253
|
+
coreFeatures?: string[];
|
|
254
|
+
/**
|
|
255
|
+
* DevTools-specific config.
|
|
256
|
+
*/
|
|
257
|
+
devtools?: {
|
|
258
|
+
/**
|
|
259
|
+
* The webpage root directory for Expo CLI DevTools to serve the web resources.
|
|
260
|
+
*/
|
|
261
|
+
webpageRoot: string;
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
interface AndroidMavenRepositoryPasswordCredentials {
|
|
265
|
+
username: string;
|
|
266
|
+
password: string;
|
|
267
|
+
}
|
|
268
|
+
interface AndroidMavenRepositoryHttpHeaderCredentials {
|
|
269
|
+
name: string;
|
|
270
|
+
value: string;
|
|
271
|
+
}
|
|
272
|
+
interface AndroidMavenRepositoryAWSCredentials {
|
|
273
|
+
accessKey: string;
|
|
274
|
+
secretKey: string;
|
|
275
|
+
sessionToken?: string;
|
|
276
|
+
}
|
|
277
|
+
type AndroidMavenRepositoryCredentials = AndroidMavenRepositoryPasswordCredentials | AndroidMavenRepositoryHttpHeaderCredentials | AndroidMavenRepositoryAWSCredentials;
|
|
278
|
+
export interface AndroidMavenRepository {
|
|
279
|
+
/**
|
|
280
|
+
* The URL of the Maven repository.
|
|
281
|
+
*/
|
|
282
|
+
url: string;
|
|
283
|
+
/**
|
|
284
|
+
* The credentials to use when accessing the Maven repository.
|
|
285
|
+
* May be of type PasswordCredentials, HttpHeaderCredentials, or AWSCredentials.
|
|
286
|
+
*
|
|
287
|
+
* @see the authentication schemes section of [Gradle documentation](https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:authentication_schemes) for more information.
|
|
288
|
+
*/
|
|
289
|
+
credentials?: AndroidMavenRepositoryCredentials;
|
|
290
|
+
/**
|
|
291
|
+
* The authentication scheme to use when accessing the Maven repository.
|
|
292
|
+
*/
|
|
293
|
+
authentication?: 'basic' | 'digest' | 'header';
|
|
294
|
+
}
|
|
295
|
+
interface ApplePod {
|
|
296
|
+
name: string;
|
|
297
|
+
version?: string;
|
|
298
|
+
configurations?: string[];
|
|
299
|
+
modular_headers?: boolean;
|
|
300
|
+
source?: string;
|
|
301
|
+
path?: string;
|
|
302
|
+
podspec?: string;
|
|
303
|
+
testspecs?: string[];
|
|
304
|
+
git?: string;
|
|
305
|
+
branch?: string;
|
|
306
|
+
tag?: string;
|
|
307
|
+
commit?: string;
|
|
308
|
+
}
|
|
309
|
+
export type ExtraDependencies = AndroidMavenRepository[] | ApplePod[];
|
|
310
|
+
/**
|
|
311
|
+
* Represents code signing entitlements passed to the `ExpoModulesProvider` for Apple platforms.
|
|
312
|
+
*/
|
|
313
|
+
export interface AppleCodeSignEntitlements {
|
|
314
|
+
/**
|
|
315
|
+
* @see https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_application-groups
|
|
316
|
+
*/
|
|
317
|
+
appGroups?: string[];
|
|
318
|
+
}
|
|
319
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import spawnAsync, { SpawnOptions, SpawnResult } from '@expo/spawn-async';
|
|
2
|
+
import { spawnSync } from 'child_process';
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
|
|
5
|
+
export const AUTOLINKINNG_CLI = join(__dirname, '../bin/expo-modules-autolinking.js');
|
|
6
|
+
|
|
7
|
+
function isSpawnResult(errorOrResult: Error): errorOrResult is Error & SpawnResult {
|
|
8
|
+
return 'pid' in errorOrResult && 'stdout' in errorOrResult && 'stderr' in errorOrResult;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export async function autolinkingRunAsync(
|
|
12
|
+
args: string[],
|
|
13
|
+
options?: SpawnOptions
|
|
14
|
+
): Promise<SpawnResult> {
|
|
15
|
+
const promise = spawnAsync(AUTOLINKINNG_CLI, args, {
|
|
16
|
+
...options,
|
|
17
|
+
env: { ...process.env, EXPO_SHOULD_USE_LEGACY_PACKAGE_INTERFACE: '1' },
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
return await promise;
|
|
22
|
+
} catch (error) {
|
|
23
|
+
if (isSpawnResult(error)) {
|
|
24
|
+
if (error.stdout) error.message += `\n------\nSTDOUT:\n${error.stdout}`;
|
|
25
|
+
if (error.stderr) error.message += `\n------\nSTDERR:\n${error.stderr}`;
|
|
26
|
+
}
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// For some reason, it can't be async, cause otherwise we will get `yarn did not print valid JSON:` error
|
|
32
|
+
export function yarnSync(options?: SpawnOptions) {
|
|
33
|
+
spawnSync('yarn', ['install', '--silent'], options);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function combinations<T, U>(
|
|
37
|
+
aKey: string,
|
|
38
|
+
a: T[],
|
|
39
|
+
bKey: string,
|
|
40
|
+
b: U[]
|
|
41
|
+
): { [key: string]: T | U }[] {
|
|
42
|
+
const result = [];
|
|
43
|
+
a.forEach(aValue => {
|
|
44
|
+
b.forEach(bValue => {
|
|
45
|
+
result.push({
|
|
46
|
+
[aKey]: aValue,
|
|
47
|
+
[bKey]: bValue,
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './build/autolinking';
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AndroidGradleAarProjectDescriptor,
|
|
3
|
+
AndroidGradlePluginDescriptor,
|
|
4
|
+
AndroidPublication,
|
|
5
|
+
RawExpoModuleConfig,
|
|
6
|
+
RawModuleConfigApple,
|
|
7
|
+
SupportedPlatform,
|
|
8
|
+
} from './types';
|
|
9
|
+
|
|
10
|
+
function arrayize<T>(value: T[] | T | undefined): T[] {
|
|
11
|
+
if (Array.isArray(value)) {
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
return value != null ? [value] : [];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class ExpoAndroidProjectConfig {
|
|
18
|
+
constructor(
|
|
19
|
+
public name: string,
|
|
20
|
+
public path: string,
|
|
21
|
+
public modules?: string[],
|
|
22
|
+
public publication?: AndroidPublication,
|
|
23
|
+
public gradleAarProjects?: AndroidGradleAarProjectDescriptor[],
|
|
24
|
+
public shouldUsePublicationScriptPath?: string,
|
|
25
|
+
/**
|
|
26
|
+
* Whether this project is the root one.
|
|
27
|
+
*/
|
|
28
|
+
public isDefault: boolean = false
|
|
29
|
+
) {}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A class that wraps the raw config (`expo-module.json` or `unimodule.json`).
|
|
34
|
+
*/
|
|
35
|
+
export class ExpoModuleConfig {
|
|
36
|
+
constructor(readonly rawConfig: RawExpoModuleConfig) {}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Whether the module supports given platform.
|
|
40
|
+
*/
|
|
41
|
+
supportsPlatform(platform: SupportedPlatform): boolean {
|
|
42
|
+
const supportedPlatforms = this.rawConfig.platforms ?? [];
|
|
43
|
+
|
|
44
|
+
if (platform === 'apple') {
|
|
45
|
+
// Apple platform is supported when any of iOS, macOS and tvOS is supported.
|
|
46
|
+
return supportedPlatforms.some((supportedPlatform) => {
|
|
47
|
+
return ['apple', 'ios', 'macos', 'tvos'].includes(supportedPlatform);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return supportedPlatforms.includes(platform);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Returns the generic config for all Apple platforms with a fallback to the legacy iOS config.
|
|
55
|
+
*/
|
|
56
|
+
getAppleConfig(): RawModuleConfigApple | null {
|
|
57
|
+
return this.rawConfig.apple ?? this.rawConfig.ios ?? null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Returns a list of names of Swift native modules classes to put to the generated modules provider file.
|
|
62
|
+
*/
|
|
63
|
+
appleModules() {
|
|
64
|
+
const appleConfig = this.getAppleConfig();
|
|
65
|
+
return appleConfig?.modules ?? [];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Returns a list of names of Swift classes that receives AppDelegate life-cycle events.
|
|
70
|
+
*/
|
|
71
|
+
appleAppDelegateSubscribers(): string[] {
|
|
72
|
+
return this.getAppleConfig()?.appDelegateSubscribers ?? [];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Returns a list of names of Swift classes that implement `ExpoReactDelegateHandler`.
|
|
77
|
+
*/
|
|
78
|
+
appleReactDelegateHandlers(): string[] {
|
|
79
|
+
return this.getAppleConfig()?.reactDelegateHandlers ?? [];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Returns podspec paths defined by the module author.
|
|
84
|
+
*/
|
|
85
|
+
applePodspecPaths(): string[] {
|
|
86
|
+
return arrayize(this.getAppleConfig()?.podspecPath);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Returns the product module names, if defined by the module author.
|
|
91
|
+
*/
|
|
92
|
+
appleSwiftModuleNames(): string[] {
|
|
93
|
+
return arrayize(this.getAppleConfig()?.swiftModuleName);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Returns whether this module will be added only to the debug configuration
|
|
98
|
+
*/
|
|
99
|
+
appleDebugOnly(): boolean {
|
|
100
|
+
return this.getAppleConfig()?.debugOnly ?? false;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Returns information about Android projects defined by the module author.
|
|
105
|
+
*/
|
|
106
|
+
androidProjects(defaultProjectName: string): ExpoAndroidProjectConfig[] {
|
|
107
|
+
const androidProjects: ExpoAndroidProjectConfig[] = [];
|
|
108
|
+
|
|
109
|
+
// Adding the "root" Android project - it might not be valide.
|
|
110
|
+
androidProjects.push(
|
|
111
|
+
new ExpoAndroidProjectConfig(
|
|
112
|
+
this.rawConfig.android?.name ?? defaultProjectName,
|
|
113
|
+
this.rawConfig.android?.path ?? 'android',
|
|
114
|
+
this.rawConfig.android?.modules,
|
|
115
|
+
this.rawConfig.android?.publication,
|
|
116
|
+
this.rawConfig.android?.gradleAarProjects,
|
|
117
|
+
this.rawConfig.android?.shouldUsePublicationScriptPath,
|
|
118
|
+
!this.rawConfig.android?.path // it's default project because path is not defined
|
|
119
|
+
)
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
this.rawConfig.android?.projects?.forEach((project) => {
|
|
123
|
+
androidProjects.push(
|
|
124
|
+
new ExpoAndroidProjectConfig(
|
|
125
|
+
project.name,
|
|
126
|
+
project.path,
|
|
127
|
+
project.modules,
|
|
128
|
+
project.publication,
|
|
129
|
+
project.gradleAarProjects,
|
|
130
|
+
project.shouldUsePublicationScriptPath
|
|
131
|
+
)
|
|
132
|
+
);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
return androidProjects;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Returns gradle plugins descriptors defined by the module author.
|
|
140
|
+
*/
|
|
141
|
+
androidGradlePlugins(): AndroidGradlePluginDescriptor[] {
|
|
142
|
+
return arrayize(this.rawConfig.android?.gradlePlugins ?? []);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Returns gradle projects containing AAR files defined by the module author.
|
|
147
|
+
*/
|
|
148
|
+
androidGradleAarProjects(): AndroidGradleAarProjectDescriptor[] {
|
|
149
|
+
return arrayize(this.rawConfig.android?.gradleAarProjects ?? []);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Returns the publication config for Android.
|
|
154
|
+
*/
|
|
155
|
+
androidPublication(): AndroidPublication | undefined {
|
|
156
|
+
return this.rawConfig.android?.publication;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Returns core features required by the module author.
|
|
161
|
+
*/
|
|
162
|
+
coreFeatures(): string[] {
|
|
163
|
+
return arrayize(this.rawConfig.coreFeatures ?? []);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Returns serializable raw config.
|
|
168
|
+
*/
|
|
169
|
+
toJSON(): RawExpoModuleConfig {
|
|
170
|
+
return this.rawConfig;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Reads the config at given path and returns the config wrapped by `ExpoModuleConfig` class.
|
|
176
|
+
*/
|
|
177
|
+
export function requireAndResolveExpoModuleConfig(path: string): ExpoModuleConfig {
|
|
178
|
+
// TODO: Validate the raw config against a schema.
|
|
179
|
+
// TODO: Support for `*.js` files, not only static `*.json`.
|
|
180
|
+
return new ExpoModuleConfig(require(path) as RawExpoModuleConfig);
|
|
181
|
+
}
|