expo-modules-autolinking 3.0.0 → 3.0.2
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 +16 -0
- package/build/autolinking/findModules.d.ts +11 -5
- package/build/autolinking/findModules.js +8 -16
- package/build/autolinking/findModules.js.map +1 -1
- package/build/autolinking/generatePackageList.d.ts +16 -10
- package/build/autolinking/generatePackageList.js +13 -28
- package/build/autolinking/generatePackageList.js.map +1 -1
- package/build/autolinking/getConfiguration.d.ts +9 -2
- package/build/autolinking/getConfiguration.js +9 -4
- package/build/autolinking/getConfiguration.js.map +1 -1
- package/build/autolinking/index.d.ts +22 -17
- package/build/autolinking/index.js +23 -47
- package/build/autolinking/index.js.map +1 -1
- package/build/autolinking/resolveModules.d.ts +13 -9
- package/build/autolinking/resolveModules.js +21 -18
- package/build/autolinking/resolveModules.js.map +1 -1
- package/build/commands/autolinkingOptions.d.ts +50 -0
- package/build/commands/autolinkingOptions.js +168 -0
- package/build/commands/autolinkingOptions.js.map +1 -0
- package/build/commands/generateModulesProviderCommand.d.ts +3 -0
- package/build/commands/generateModulesProviderCommand.js +35 -0
- package/build/commands/generateModulesProviderCommand.js.map +1 -0
- package/build/commands/generatePackageListCommand.d.ts +6 -0
- package/build/commands/generatePackageListCommand.js +39 -0
- package/build/commands/generatePackageListCommand.js.map +1 -0
- package/build/commands/reactNativeConfigCommand.d.ts +3 -0
- package/build/commands/reactNativeConfigCommand.js +36 -0
- package/build/commands/reactNativeConfigCommand.js.map +1 -0
- package/build/commands/resolveCommand.d.ts +3 -0
- package/build/commands/resolveCommand.js +63 -0
- package/build/commands/resolveCommand.js.map +1 -0
- package/build/commands/searchCommand.d.ts +2 -0
- package/build/commands/searchCommand.js +27 -0
- package/build/commands/searchCommand.js.map +1 -0
- package/build/{autolinking/verifySearchResults.d.ts → commands/verifyCommand.d.ts} +4 -2
- package/build/{autolinking/verifySearchResults.js → commands/verifyCommand.js} +24 -3
- package/build/commands/verifyCommand.js.map +1 -0
- package/build/dependencies/CachedDependenciesLinker.d.ts +2 -1
- package/build/dependencies/CachedDependenciesLinker.js +23 -9
- package/build/dependencies/CachedDependenciesLinker.js.map +1 -1
- package/build/exports.d.ts +17 -1
- package/build/exports.js +48 -1
- package/build/exports.js.map +1 -1
- package/build/index.js +18 -162
- package/build/index.js.map +1 -1
- package/build/platforms/{android.d.ts → android/android.d.ts} +7 -2
- package/build/platforms/{android.js → android/android.js} +1 -5
- package/build/platforms/android/android.js.map +1 -0
- package/build/platforms/android/index.d.ts +1 -0
- package/build/platforms/android/index.js +9 -0
- package/build/platforms/android/index.js.map +1 -0
- package/build/platforms/{apple.d.ts → apple/apple.d.ts} +6 -6
- package/build/platforms/{apple.js → apple/apple.js} +5 -7
- package/build/platforms/apple/apple.js.map +1 -0
- package/build/platforms/apple/index.d.ts +1 -0
- package/build/platforms/apple/index.js +8 -0
- package/build/platforms/apple/index.js.map +1 -0
- package/build/platforms/index.d.ts +15 -0
- package/build/{autolinking/utils.js → platforms/index.js} +6 -1
- package/build/platforms/index.js.map +1 -0
- package/build/reactNativeConfig/reactNativeConfig.d.ts +11 -2
- package/build/reactNativeConfig/reactNativeConfig.js +13 -15
- package/build/reactNativeConfig/reactNativeConfig.js.map +1 -1
- package/build/reactNativeConfig/reactNativeConfig.types.d.ts +4 -33
- package/build/reactNativeConfig/reactNativeConfig.types.js.map +1 -1
- package/build/types.d.ts +1 -58
- package/build/types.js.map +1 -1
- package/package.json +3 -3
- package/src/autolinking/findModules.ts +18 -16
- package/src/autolinking/generatePackageList.ts +30 -31
- package/src/autolinking/getConfiguration.ts +16 -5
- package/src/autolinking/index.ts +48 -41
- package/src/autolinking/resolveModules.ts +47 -34
- package/src/commands/autolinkingOptions.ts +265 -0
- package/src/commands/generateModulesProviderCommand.ts +60 -0
- package/src/commands/generatePackageListCommand.ts +67 -0
- package/src/commands/reactNativeConfigCommand.ts +50 -0
- package/src/commands/resolveCommand.ts +101 -0
- package/src/commands/searchCommand.ts +35 -0
- package/src/{autolinking/verifySearchResults.ts → commands/verifyCommand.ts} +48 -6
- package/src/dependencies/CachedDependenciesLinker.ts +30 -12
- package/src/exports.ts +65 -0
- package/src/index.ts +18 -286
- package/src/platforms/{android.ts → android/android.ts} +10 -12
- package/src/platforms/android/index.ts +6 -0
- package/src/platforms/{apple.ts → apple/apple.ts} +10 -11
- package/src/platforms/apple/index.ts +5 -0
- package/src/platforms/index.ts +49 -0
- package/src/reactNativeConfig/reactNativeConfig.ts +25 -28
- package/src/reactNativeConfig/reactNativeConfig.types.ts +4 -35
- package/src/types.ts +10 -70
- package/build/autolinking/mergeLinkingOptions.d.ts +0 -27
- package/build/autolinking/mergeLinkingOptions.js +0 -112
- package/build/autolinking/mergeLinkingOptions.js.map +0 -1
- package/build/autolinking/utils.d.ts +0 -2
- package/build/autolinking/utils.js.map +0 -1
- package/build/autolinking/verifySearchResults.js.map +0 -1
- package/build/platforms/android.js.map +0 -1
- package/build/platforms/apple.js.map +0 -1
- package/src/autolinking/mergeLinkingOptions.ts +0 -146
- package/src/autolinking/utils.ts +0 -15
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apple.js","sourceRoot":"","sources":["../../../src/platforms/apple/apple.ts"],"names":[],"mappings":";;;;;AAiCA,kDASC;AAGD,gDA6BC;AAED,gFAcC;AAKD,oEAeC;AA4ID,8EASC;AAnQD,oEAA2C;AAC3C,4CAAoB;AACpB,+BAA4B;AAC5B,gDAAwB;AAExB,+CAAkD;AASlD,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AACxD,MAAM,0BAA0B,GAAG,iBAAiB,CAAC;AAErD,MAAM,MAAM,GAAG,IAAI,CAAC;AAEpB,KAAK,UAAU,gBAAgB,CAAC,QAAyB;IACvD,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAChE,IAAI,kBAAkB,IAAI,kBAAkB,CAAC,MAAM,EAAE,CAAC;QAC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B,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,iCAAiC,MAAM,CAAC,MAAM,CACrF,gBAAgB,CACjB,GAAG,UAAU,KAAK,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,UAAU,MAAM,CAAC,MAAM,CACvE,gBAAgB,CACjB,GAAG,YAAY,KAAK,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC;IAC/D,CAAC;IAED,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,iCAAiC,MAAM,CAAC,MAAM,CACrF,gBAAgB,CACjB,GAAG,UAAU,KAAK,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC;AAC7D,CAAC;AAED,KAAK,UAAU,sBAAsB,CACnC,eAA8B;IAE9B,IAAI,CAAC,eAAe,IAAI,CAAC,CAAC,MAAM,IAAA,2BAAe,EAAC,eAAe,CAAC,CAAC,EAAE,CAAC;QAClE,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAA,qBAAU,EAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC;IAChG,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5C,OAAO;QACL,SAAS,EAAE,gBAAgB,CAAC,uCAAuC,CAAC,IAAI,SAAS;KAClF,CAAC;AACJ,CAAC","sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport fs from 'fs';\nimport { glob } from 'glob';\nimport path from 'path';\n\nimport { fileExistsAsync } from '../../fileUtils';\nimport type {\n AppleCodeSignEntitlements,\n ExtraDependencies,\n ModuleDescriptorIos,\n ModuleIosPodspecInfo,\n PackageRevision,\n} from '../../types';\n\nconst APPLE_PROPERTIES_FILE = 'Podfile.properties.json';\nconst APPLE_EXTRA_BUILD_DEPS_KEY = 'apple.extraPods';\n\nconst indent = ' ';\n\nasync function findPodspecFiles(revision: PackageRevision): Promise<string[]> {\n const configPodspecPaths = revision.config?.applePodspecPaths();\n if (configPodspecPaths && configPodspecPaths.length) {\n return configPodspecPaths;\n }\n\n const podspecFiles = await glob('*/*.podspec', {\n cwd: revision.path,\n ignore: ['**/node_modules/**'],\n });\n\n return podspecFiles;\n}\n\nexport function getSwiftModuleNames(\n pods: ModuleIosPodspecInfo[],\n swiftModuleNames: string[] | undefined\n): string[] {\n if (swiftModuleNames && swiftModuleNames.length) {\n return swiftModuleNames;\n }\n // by default, non-alphanumeric characters in the pod name are replaced by _ in the module name\n return pods.map((pod) => pod.podName.replace(/[^a-zA-Z0-9]/g, '_'));\n}\n\n/** Resolves module search result with additional details required for iOS platform. */\nexport async function resolveModuleAsync(\n packageName: string,\n revision: PackageRevision,\n extraOutput: { flags?: Record<string, any> }\n): Promise<ModuleDescriptorIos | null> {\n const podspecFiles = await findPodspecFiles(revision);\n if (!podspecFiles.length) {\n return null;\n }\n\n const pods = podspecFiles.map((podspecFile) => ({\n podName: path.basename(podspecFile, path.extname(podspecFile)),\n podspecDir: path.dirname(path.join(revision.path, podspecFile)),\n }));\n\n const swiftModuleNames = getSwiftModuleNames(pods, revision.config?.appleSwiftModuleNames());\n const coreFeatures = revision.config?.coreFeatures() ?? [];\n\n return {\n packageName,\n pods,\n swiftModuleNames,\n flags: extraOutput.flags,\n modules: revision.config?.appleModules() ?? [],\n appDelegateSubscribers: revision.config?.appleAppDelegateSubscribers() ?? [],\n reactDelegateHandlers: revision.config?.appleReactDelegateHandlers() ?? [],\n debugOnly: revision.config?.appleDebugOnly() ?? false,\n ...(coreFeatures.length > 0 ? { coreFeatures } : {}),\n };\n}\n\nexport async function resolveExtraBuildDependenciesAsync(\n projectNativeRoot: string\n): Promise<ExtraDependencies | null> {\n const propsFile = path.join(projectNativeRoot, APPLE_PROPERTIES_FILE);\n try {\n const contents = await fs.promises.readFile(propsFile, 'utf8');\n const podfileJson = JSON.parse(contents);\n if (podfileJson[APPLE_EXTRA_BUILD_DEPS_KEY]) {\n // expo-build-properties would serialize the extraPods as JSON string, we should parse it again.\n const extraPods = JSON.parse(podfileJson[APPLE_EXTRA_BUILD_DEPS_KEY]);\n return extraPods;\n }\n } catch {}\n return null;\n}\n\n/**\n * Generates Swift file that contains all autolinked Swift packages.\n */\nexport async function generateModulesProviderAsync(\n modules: ModuleDescriptorIos[],\n targetPath: string,\n entitlementPath: string | null\n): Promise<void> {\n const className = path.basename(targetPath, path.extname(targetPath));\n const entitlements = await parseEntitlementsAsync(entitlementPath);\n const generatedFileContent = await generatePackageListFileContentAsync(\n modules,\n className,\n entitlements\n );\n const parentPath = path.dirname(targetPath);\n await fs.promises.mkdir(parentPath, { recursive: true });\n await fs.promises.writeFile(targetPath, generatedFileContent, 'utf8');\n}\n\n/**\n * Generates the string to put into the generated package list.\n */\nasync function generatePackageListFileContentAsync(\n modules: ModuleDescriptorIos[],\n className: string,\n entitlements: AppleCodeSignEntitlements\n): Promise<string> {\n const iosModules = modules.filter(\n (module) =>\n module.modules.length ||\n module.appDelegateSubscribers.length ||\n module.reactDelegateHandlers.length\n );\n\n const modulesToImport = iosModules.filter((module) => !module.debugOnly);\n const debugOnlyModules = iosModules.filter((module) => module.debugOnly);\n\n const swiftModules = ([] as string[])\n .concat(...modulesToImport.map((module) => module.swiftModuleNames))\n .filter(Boolean);\n\n const debugOnlySwiftModules = ([] as string[])\n .concat(...debugOnlyModules.map((module) => module.swiftModuleNames))\n .filter(Boolean);\n\n const modulesClassNames = ([] as string[])\n .concat(...modulesToImport.map((module) => module.modules))\n .filter(Boolean);\n\n const debugOnlyModulesClassNames = ([] as string[])\n .concat(...debugOnlyModules.map((module) => module.modules))\n .filter(Boolean);\n\n const appDelegateSubscribers = ([] as string[]).concat(\n ...modulesToImport.map((module) => module.appDelegateSubscribers)\n );\n\n const debugOnlyAppDelegateSubscribers = ([] as string[]).concat(\n ...debugOnlyModules.map((module) => module.appDelegateSubscribers)\n );\n\n const reactDelegateHandlerModules = modulesToImport.filter(\n (module) => !!module.reactDelegateHandlers.length\n );\n\n const debugOnlyReactDelegateHandlerModules = debugOnlyModules.filter(\n (module) => !!module.reactDelegateHandlers.length\n );\n\n return `/**\n * Automatically generated by expo-modules-autolinking.\n *\n * This autogenerated class provides a list of classes of native Expo modules,\n * but only these that are written in Swift and use the new API for creating Expo modules.\n */\n\nimport ExpoModulesCore\n${generateCommonImportList(swiftModules)}\n${generateDebugOnlyImportList(debugOnlySwiftModules)}\n@objc(${className})\npublic class ${className}: ModulesProvider {\n public override func getModuleClasses() -> [AnyModule.Type] {\n${generateModuleClasses(modulesClassNames, debugOnlyModulesClassNames)}\n }\n\n public override func getAppDelegateSubscribers() -> [ExpoAppDelegateSubscriber.Type] {\n${generateModuleClasses(appDelegateSubscribers, debugOnlyAppDelegateSubscribers)}\n }\n\n public override func getReactDelegateHandlers() -> [ExpoReactDelegateHandlerTupleType] {\n${generateReactDelegateHandlers(reactDelegateHandlerModules, debugOnlyReactDelegateHandlerModules)}\n }\n\n public override func getAppCodeSignEntitlements() -> AppCodeSignEntitlements {\n return AppCodeSignEntitlements.from(json: #\"${JSON.stringify(entitlements)}\"#)\n }\n}\n`;\n}\n\nfunction generateCommonImportList(swiftModules: string[]): string {\n return swiftModules.map((moduleName) => `import ${moduleName}`).join('\\n');\n}\n\nfunction generateDebugOnlyImportList(swiftModules: string[]): string {\n if (!swiftModules.length) {\n return '';\n }\n\n return (\n wrapInDebugConfigurationCheck(\n 0,\n swiftModules.map((moduleName) => `import ${moduleName}`).join('\\n')\n ) + '\\n'\n );\n}\n\nfunction generateModuleClasses(classNames: string[], debugOnlyClassName: string[]): string {\n const commonClassNames = formatArrayOfClassNames(classNames);\n if (debugOnlyClassName.length > 0) {\n return wrapInDebugConfigurationCheck(\n 2,\n `return ${formatArrayOfClassNames(classNames.concat(debugOnlyClassName))}`,\n `return ${commonClassNames}`\n );\n } else {\n return `${indent.repeat(2)}return ${commonClassNames}`;\n }\n}\n\n/**\n * Formats an array of class names to Swift's array containing these classes.\n */\nfunction formatArrayOfClassNames(classNames: string[]): string {\n return `[${classNames.map((className) => `\\n${indent.repeat(3)}${className}.self`).join(',')}\n${indent.repeat(2)}]`;\n}\n\nfunction generateReactDelegateHandlers(\n module: ModuleDescriptorIos[],\n debugOnlyModules: ModuleDescriptorIos[]\n): string {\n const commonModules = formatArrayOfReactDelegateHandler(module);\n if (debugOnlyModules.length > 0) {\n return wrapInDebugConfigurationCheck(\n 2,\n `return ${formatArrayOfReactDelegateHandler(module.concat(debugOnlyModules))}`,\n `return ${commonModules}`\n );\n } else {\n return `${indent.repeat(2)}return ${commonModules}`;\n }\n}\n\n/**\n * Formats an array of modules to Swift's array containing ReactDelegateHandlers\n */\nexport function formatArrayOfReactDelegateHandler(modules: ModuleDescriptorIos[]): string {\n const values: string[] = [];\n for (const module of modules) {\n for (const handler of module.reactDelegateHandlers) {\n values.push(`(packageName: \"${module.packageName}\", handler: ${handler}.self)`);\n }\n }\n return `[${values.map((value) => `\\n${indent.repeat(3)}${value}`).join(',')}\n${indent.repeat(2)}]`;\n}\n\nfunction wrapInDebugConfigurationCheck(\n indentationLevel: number,\n debugBlock: string,\n releaseBlock: string | null = null\n) {\n if (releaseBlock) {\n return `${indent.repeat(indentationLevel)}#if EXPO_CONFIGURATION_DEBUG\\n${indent.repeat(\n indentationLevel\n )}${debugBlock}\\n${indent.repeat(indentationLevel)}#else\\n${indent.repeat(\n indentationLevel\n )}${releaseBlock}\\n${indent.repeat(indentationLevel)}#endif`;\n }\n\n return `${indent.repeat(indentationLevel)}#if EXPO_CONFIGURATION_DEBUG\\n${indent.repeat(\n indentationLevel\n )}${debugBlock}\\n${indent.repeat(indentationLevel)}#endif`;\n}\n\nasync function parseEntitlementsAsync(\n entitlementPath: string | null\n): Promise<AppleCodeSignEntitlements> {\n if (!entitlementPath || !(await fileExistsAsync(entitlementPath))) {\n return {};\n }\n const { stdout } = await spawnAsync('plutil', ['-convert', 'json', '-o', '-', entitlementPath]);\n const entitlementsJson = JSON.parse(stdout);\n return {\n appGroups: entitlementsJson['com.apple.security.application-groups'] || undefined,\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { generateModulesProviderAsync, resolveModuleAsync, resolveExtraBuildDependenciesAsync, } from './apple';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveExtraBuildDependenciesAsync = exports.resolveModuleAsync = exports.generateModulesProviderAsync = void 0;
|
|
4
|
+
var apple_1 = require("./apple");
|
|
5
|
+
Object.defineProperty(exports, "generateModulesProviderAsync", { enumerable: true, get: function () { return apple_1.generateModulesProviderAsync; } });
|
|
6
|
+
Object.defineProperty(exports, "resolveModuleAsync", { enumerable: true, get: function () { return apple_1.resolveModuleAsync; } });
|
|
7
|
+
Object.defineProperty(exports, "resolveExtraBuildDependenciesAsync", { enumerable: true, get: function () { return apple_1.resolveExtraBuildDependenciesAsync; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platforms/apple/index.ts"],"names":[],"mappings":";;;AAAA,iCAIiB;AAHf,qHAAA,4BAA4B,OAAA;AAC5B,2GAAA,kBAAkB,OAAA;AAClB,2HAAA,kCAAkC,OAAA","sourcesContent":["export {\n generateModulesProviderAsync,\n resolveModuleAsync,\n resolveExtraBuildDependenciesAsync,\n} from './apple';\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SupportedPlatform } from '../types';
|
|
2
|
+
interface PlatformImplementations {
|
|
3
|
+
ios: typeof import('./apple/apple');
|
|
4
|
+
macos: typeof import('./apple/apple');
|
|
5
|
+
tvos: typeof import('./apple/apple');
|
|
6
|
+
apple: typeof import('./apple/apple');
|
|
7
|
+
android: typeof import('./android/android');
|
|
8
|
+
devtools: typeof import('./devtools');
|
|
9
|
+
}
|
|
10
|
+
declare function getLinkingImplementationForPlatform<Platform extends keyof PlatformImplementations>(platform: Platform): PlatformImplementations[Platform];
|
|
11
|
+
declare function getLinkingImplementationForPlatform(platform: 'ios' | 'macos' | 'tvos' | 'apple'): PlatformImplementations['apple'];
|
|
12
|
+
declare function getLinkingImplementationForPlatform(platform: 'android'): PlatformImplementations['android'];
|
|
13
|
+
declare function getLinkingImplementationForPlatform(platform: 'devtools'): PlatformImplementations['devtools'];
|
|
14
|
+
declare function getLinkingImplementationForPlatform(platform: SupportedPlatform): PlatformImplementations[keyof PlatformImplementations];
|
|
15
|
+
export { getLinkingImplementationForPlatform };
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getLinkingImplementationForPlatform = getLinkingImplementationForPlatform;
|
|
4
4
|
function getLinkingImplementationForPlatform(platform) {
|
|
5
|
+
if (!platform) {
|
|
6
|
+
throw new Error(`No platform was specified, but linking commands require a specific platform.`);
|
|
7
|
+
}
|
|
5
8
|
switch (platform) {
|
|
6
9
|
case 'ios':
|
|
7
10
|
case 'macos':
|
|
@@ -12,6 +15,8 @@ function getLinkingImplementationForPlatform(platform) {
|
|
|
12
15
|
return require('../platforms/android');
|
|
13
16
|
case 'devtools':
|
|
14
17
|
return require('../platforms/devtools');
|
|
18
|
+
default:
|
|
19
|
+
throw new Error(`No linking implementation is available for platform "${platform}"`);
|
|
15
20
|
}
|
|
16
21
|
}
|
|
17
|
-
//# sourceMappingURL=
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platforms/index.ts"],"names":[],"mappings":";;AAgDS,kFAAmC;AArB5C,SAAS,mCAAmC,CAC1C,QAA2B;IAE3B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAC;IAClG,CAAC;IACD,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,KAAK,CAAC;QACX,KAAK,OAAO,CAAC;QACb,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO;YACV,OAAO,OAAO,CAAC,oBAAoB,CAAC,CAAC;QACvC,KAAK,SAAS;YACZ,OAAO,OAAO,CAAC,sBAAsB,CAAC,CAAC;QACzC,KAAK,UAAU;YACb,OAAO,OAAO,CAAC,uBAAuB,CAAC,CAAC;QAC1C;YACE,MAAM,IAAI,KAAK,CAAC,wDAAwD,QAAQ,GAAG,CAAC,CAAC;IACzF,CAAC;AACH,CAAC","sourcesContent":["import { SupportedPlatform } from '../types';\n\ninterface PlatformImplementations {\n ios: typeof import('./apple/apple');\n macos: typeof import('./apple/apple');\n tvos: typeof import('./apple/apple');\n apple: typeof import('./apple/apple');\n android: typeof import('./android/android');\n devtools: typeof import('./devtools');\n}\n\nfunction getLinkingImplementationForPlatform<Platform extends keyof PlatformImplementations>(\n platform: Platform\n): PlatformImplementations[Platform];\nfunction getLinkingImplementationForPlatform(\n platform: 'ios' | 'macos' | 'tvos' | 'apple'\n): PlatformImplementations['apple'];\nfunction getLinkingImplementationForPlatform(\n platform: 'android'\n): PlatformImplementations['android'];\nfunction getLinkingImplementationForPlatform(\n platform: 'devtools'\n): PlatformImplementations['devtools'];\nfunction getLinkingImplementationForPlatform(\n platform: SupportedPlatform\n): PlatformImplementations[keyof PlatformImplementations];\n\nfunction getLinkingImplementationForPlatform(\n platform: SupportedPlatform\n): PlatformImplementations[keyof PlatformImplementations] {\n if (!platform) {\n throw new Error(`No platform was specified, but linking commands require a specific platform.`);\n }\n switch (platform) {\n case 'ios':\n case 'macos':\n case 'tvos':\n case 'apple':\n return require('../platforms/apple');\n case 'android':\n return require('../platforms/android');\n case 'devtools':\n return require('../platforms/devtools');\n default:\n throw new Error(`No linking implementation is available for platform \"${platform}\"`);\n }\n}\n\nexport { getLinkingImplementationForPlatform };\n"]}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import type { SupportedPlatform } from '../types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RNConfigDependency, RNConfigReactNativeAppProjectConfig, RNConfigReactNativeProjectConfig, RNConfigResult } from './reactNativeConfig.types';
|
|
3
|
+
import { AutolinkingOptions } from '../commands/autolinkingOptions';
|
|
3
4
|
import { DependencyResolution } from '../dependencies';
|
|
4
5
|
export declare function resolveReactNativeModule(resolution: DependencyResolution, projectConfig: RNConfigReactNativeProjectConfig | null, platform: SupportedPlatform, excludeNames: Set<string>): Promise<RNConfigDependency | null>;
|
|
6
|
+
interface CreateRNConfigParams {
|
|
7
|
+
appRoot: string;
|
|
8
|
+
sourceDir: string | undefined;
|
|
9
|
+
autolinkingOptions: AutolinkingOptions & {
|
|
10
|
+
platform: SupportedPlatform;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
5
13
|
/**
|
|
6
14
|
* Create config for react-native core autolinking.
|
|
7
15
|
*/
|
|
8
|
-
export declare function createReactNativeConfigAsync(
|
|
16
|
+
export declare function createReactNativeConfigAsync({ appRoot, sourceDir, autolinkingOptions, }: CreateRNConfigParams): Promise<RNConfigResult>;
|
|
9
17
|
export declare function resolveAppProjectConfigAsync(projectRoot: string, platform: SupportedPlatform, sourceDir?: string): Promise<RNConfigReactNativeAppProjectConfig>;
|
|
18
|
+
export {};
|
|
@@ -6,13 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.resolveReactNativeModule = resolveReactNativeModule;
|
|
7
7
|
exports.createReactNativeConfigAsync = createReactNativeConfigAsync;
|
|
8
8
|
exports.resolveAppProjectConfigAsync = resolveAppProjectConfigAsync;
|
|
9
|
-
const fs_1 = __importDefault(require("fs"));
|
|
10
9
|
const path_1 = __importDefault(require("path"));
|
|
11
10
|
const androidResolver_1 = require("./androidResolver");
|
|
12
11
|
const config_1 = require("./config");
|
|
13
12
|
const iosResolver_1 = require("./iosResolver");
|
|
14
13
|
const ExpoModuleConfig_1 = require("../ExpoModuleConfig");
|
|
15
|
-
const autolinking_1 = require("../autolinking");
|
|
16
14
|
const dependencies_1 = require("../dependencies");
|
|
17
15
|
async function resolveReactNativeModule(resolution, projectConfig, platform, excludeNames) {
|
|
18
16
|
if (excludeNames.has(resolution.name)) {
|
|
@@ -66,29 +64,29 @@ async function resolveReactNativeModule(resolution, projectConfig, platform, exc
|
|
|
66
64
|
/**
|
|
67
65
|
* Create config for react-native core autolinking.
|
|
68
66
|
*/
|
|
69
|
-
async function createReactNativeConfigAsync(
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
const projectConfig = await (0, config_1.loadConfigAsync)(options.projectRoot);
|
|
67
|
+
async function createReactNativeConfigAsync({ appRoot, sourceDir, autolinkingOptions, }) {
|
|
68
|
+
const excludeNames = new Set(autolinkingOptions.exclude);
|
|
69
|
+
const projectConfig = await (0, config_1.loadConfigAsync)(appRoot);
|
|
73
70
|
// custom native modules should be resolved first so that they can override other modules
|
|
74
|
-
const searchPaths =
|
|
75
|
-
? [
|
|
76
|
-
:
|
|
77
|
-
const limitDepth =
|
|
71
|
+
const searchPaths = autolinkingOptions.nativeModulesDir
|
|
72
|
+
? [autolinkingOptions.nativeModulesDir, ...autolinkingOptions.searchPaths]
|
|
73
|
+
: autolinkingOptions.searchPaths;
|
|
74
|
+
const limitDepth = autolinkingOptions.legacy_shallowReactNativeLinking ? 1 : undefined;
|
|
78
75
|
const resolutions = (0, dependencies_1.mergeResolutionResults)(await Promise.all([
|
|
79
|
-
(0, dependencies_1.scanDependenciesFromRNProjectConfig)(
|
|
76
|
+
(0, dependencies_1.scanDependenciesFromRNProjectConfig)(appRoot, projectConfig),
|
|
80
77
|
...searchPaths.map((searchPath) => (0, dependencies_1.scanDependenciesInSearchPath)(searchPath)),
|
|
81
|
-
(0, dependencies_1.scanDependenciesRecursively)(
|
|
78
|
+
(0, dependencies_1.scanDependenciesRecursively)(appRoot, { limitDepth }),
|
|
82
79
|
]));
|
|
83
|
-
const dependencies = await (0, dependencies_1.filterMapResolutionResult)(resolutions, (resolution) => resolveReactNativeModule(resolution, projectConfig,
|
|
80
|
+
const dependencies = await (0, dependencies_1.filterMapResolutionResult)(resolutions, (resolution) => resolveReactNativeModule(resolution, projectConfig, autolinkingOptions.platform, excludeNames));
|
|
84
81
|
return {
|
|
85
|
-
root:
|
|
82
|
+
root: appRoot,
|
|
86
83
|
reactNativePath: resolutions['react-native']?.path,
|
|
87
84
|
dependencies,
|
|
88
|
-
project: await resolveAppProjectConfigAsync(
|
|
85
|
+
project: await resolveAppProjectConfigAsync(appRoot, autolinkingOptions.platform, sourceDir),
|
|
89
86
|
};
|
|
90
87
|
}
|
|
91
88
|
async function resolveAppProjectConfigAsync(projectRoot, platform, sourceDir) {
|
|
89
|
+
// TODO(@kitten): use the commandRoot here to find these files in non <projectRoot>/<platform> folders
|
|
92
90
|
if (platform === 'android') {
|
|
93
91
|
const androidDir = path_1.default.join(projectRoot, 'android');
|
|
94
92
|
const { gradle, manifest } = await (0, androidResolver_1.findGradleAndManifestAsync)({ androidDir, isLibrary: false });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactNativeConfig.js","sourceRoot":"","sources":["../../src/reactNativeConfig/reactNativeConfig.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"reactNativeConfig.js","sourceRoot":"","sources":["../../src/reactNativeConfig/reactNativeConfig.ts"],"names":[],"mappings":";;;;;AA8BA,4DAgEC;AAWD,oEAiCC;AAED,oEA+BC;AA3KD,gDAAwB;AAGxB,uDAI2B;AAC3B,qCAA2C;AAC3C,+CAAoE;AAUpE,0DAAsF;AAEtF,kDAOyB;AAElB,KAAK,UAAU,wBAAwB,CAC5C,UAAgC,EAChC,aAAsD,EACtD,QAA2B,EAC3B,YAAyB;IAEzB,IAAI,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACtC,OAAO,IAAI,CAA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AAC,CAC/F,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,OAAO;QACb,eAAe,EAAE,WAAW,CAAC,cAAc,CAAC,EAAE,IAAK;QACnD,YAAY;QACZ,OAAO,EAAE,MAAM,4BAA4B,CAAC,OAAO,EAAE,kBAAkB,CAAC,QAAQ,EAAE,SAAS,CAAC;KAC7F,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,4BAA4B,CAChD,WAAmB,EACnB,QAA2B,EAC3B,SAAkB;IAElB,sGAAsG;IACtG,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QACrD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAA,4CAA0B,EAAC,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;QAChG,IAAI,MAAM,IAAI,IAAI,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACvC,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,MAAM,WAAW,GAAG,MAAM,IAAA,uCAAqB,EAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAE9E,OAAO;YACL,OAAO,EAAE;gBACP,WAAW,EAAE,WAAW,IAAI,EAAE;gBAC9B,SAAS,EAAE,SAAS,IAAI,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;aAC1D;SACF,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;QACvB,OAAO;YACL,GAAG,EAAE;gBACH,SAAS,EAAE,SAAS,IAAI,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC;aACtD;SACF,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import path from 'path';\n\nimport type { SupportedPlatform } from '../types';\nimport {\n findGradleAndManifestAsync,\n parsePackageNameAsync,\n resolveDependencyConfigImplAndroidAsync,\n} from './androidResolver';\nimport { loadConfigAsync } from './config';\nimport { resolveDependencyConfigImplIosAsync } from './iosResolver';\nimport type {\n RNConfigDependency,\n RNConfigDependencyAndroid,\n RNConfigDependencyIos,\n RNConfigReactNativeAppProjectConfig,\n RNConfigReactNativeLibraryConfig,\n RNConfigReactNativeProjectConfig,\n RNConfigResult,\n} from './reactNativeConfig.types';\nimport { discoverExpoModuleConfigAsync, ExpoModuleConfig } from '../ExpoModuleConfig';\nimport { AutolinkingOptions } from '../commands/autolinkingOptions';\nimport {\n DependencyResolution,\n filterMapResolutionResult,\n mergeResolutionResults,\n scanDependenciesFromRNProjectConfig,\n scanDependenciesInSearchPath,\n scanDependenciesRecursively,\n} from '../dependencies';\n\nexport async function resolveReactNativeModule(\n resolution: DependencyResolution,\n projectConfig: RNConfigReactNativeProjectConfig | null,\n platform: SupportedPlatform,\n excludeNames: Set<string>\n): Promise<RNConfigDependency | null> {\n if (excludeNames.has(resolution.name)) {\n return null;\n }\n\n const libraryConfig = await loadConfigAsync<RNConfigReactNativeLibraryConfig>(resolution.path);\n const reactNativeConfig = {\n ...libraryConfig?.dependency,\n ...projectConfig?.dependencies?.[resolution.name],\n };\n\n if (Object.keys(libraryConfig?.platforms ?? {}).length > 0) {\n // Package defines platforms would be a platform host package.\n // The rnc-cli will skip this package.\n return null;\n } else if (resolution.name === 'react-native' || resolution.name === 'react-native-macos') {\n // Starting from version 0.76, the `react-native` package only defines platforms\n // when @react-native-community/cli-platform-android/ios is installed.\n // Therefore, we need to manually filter it out.\n return null;\n }\n\n let maybeExpoModuleConfig: ExpoModuleConfig | null | undefined;\n if (!libraryConfig) {\n // NOTE(@kitten): If we don't have an explicit react-native.config.{js,ts} file,\n // we should pass the Expo Module config (if it exists) to the resolvers below,\n // which can then decide if the React Native inferred config and Expo Module\n // configs conflict\n try {\n maybeExpoModuleConfig = await discoverExpoModuleConfigAsync(resolution.path);\n } catch {\n // We ignore invalid Expo Modules for the purpose of auto-linking and\n // pretend the config doesn't exist, if it isn't valid JSON\n }\n }\n\n let platformData: RNConfigDependencyAndroid | RNConfigDependencyIos | null = null;\n if (platform === 'android') {\n platformData = await resolveDependencyConfigImplAndroidAsync(\n resolution.path,\n reactNativeConfig.platforms?.android,\n maybeExpoModuleConfig\n );\n } else if (platform === 'ios') {\n platformData = await resolveDependencyConfigImplIosAsync(\n resolution,\n reactNativeConfig.platforms?.ios,\n maybeExpoModuleConfig\n );\n }\n return (\n platformData && {\n root: resolution.path,\n name: resolution.name,\n platforms: {\n [platform]: platformData,\n },\n }\n );\n}\n\ninterface CreateRNConfigParams {\n appRoot: string;\n sourceDir: string | undefined;\n autolinkingOptions: AutolinkingOptions & { platform: SupportedPlatform };\n}\n\n/**\n * Create config for react-native core autolinking.\n */\nexport async function createReactNativeConfigAsync({\n appRoot,\n sourceDir,\n autolinkingOptions,\n}: CreateRNConfigParams): Promise<RNConfigResult> {\n const excludeNames = new Set(autolinkingOptions.exclude);\n const projectConfig = await loadConfigAsync<RNConfigReactNativeProjectConfig>(appRoot);\n\n // custom native modules should be resolved first so that they can override other modules\n const searchPaths = autolinkingOptions.nativeModulesDir\n ? [autolinkingOptions.nativeModulesDir, ...autolinkingOptions.searchPaths]\n : autolinkingOptions.searchPaths;\n\n const limitDepth = autolinkingOptions.legacy_shallowReactNativeLinking ? 1 : undefined;\n\n const resolutions = mergeResolutionResults(\n await Promise.all([\n scanDependenciesFromRNProjectConfig(appRoot, projectConfig),\n ...searchPaths.map((searchPath) => scanDependenciesInSearchPath(searchPath)),\n scanDependenciesRecursively(appRoot, { limitDepth }),\n ])\n );\n\n const dependencies = await filterMapResolutionResult(resolutions, (resolution) =>\n resolveReactNativeModule(resolution, projectConfig, autolinkingOptions.platform, excludeNames)\n );\n\n return {\n root: appRoot,\n reactNativePath: resolutions['react-native']?.path!,\n dependencies,\n project: await resolveAppProjectConfigAsync(appRoot, autolinkingOptions.platform, sourceDir),\n };\n}\n\nexport async function resolveAppProjectConfigAsync(\n projectRoot: string,\n platform: SupportedPlatform,\n sourceDir?: string\n): Promise<RNConfigReactNativeAppProjectConfig> {\n // TODO(@kitten): use the commandRoot here to find these files in non <projectRoot>/<platform> folders\n if (platform === 'android') {\n const androidDir = path.join(projectRoot, 'android');\n const { gradle, manifest } = await findGradleAndManifestAsync({ androidDir, isLibrary: false });\n if (gradle == null || manifest == null) {\n return {};\n }\n const packageName = await parsePackageNameAsync(androidDir, manifest, gradle);\n\n return {\n android: {\n packageName: packageName ?? '',\n sourceDir: sourceDir ?? path.join(projectRoot, 'android'),\n },\n };\n }\n\n if (platform === 'ios') {\n return {\n ios: {\n sourceDir: sourceDir ?? path.join(projectRoot, 'ios'),\n },\n };\n }\n\n return {};\n}\n"]}
|
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
sourceDir?: string;
|
|
11
|
-
nativeModulesDir?: string | null;
|
|
12
|
-
/** Only scan direct "dependencies" of a project for React Native modules, rather than including transitive dependencies.
|
|
13
|
-
* @remarks
|
|
14
|
-
* Before SDK 54, React Native modules would only be linked if they were listed as dependencies
|
|
15
|
-
* of a project. However, in SDK 54+ transitive React Native modules dependencies are also
|
|
16
|
-
* auto-linked, unless this flag is enabled.
|
|
17
|
-
* @privateRemarks
|
|
18
|
-
* This is not an argument, but can only be specified on `expo.autolinking`
|
|
19
|
-
*/
|
|
20
|
-
legacy_shallowReactNativeLinking?: boolean;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Dependency configuration for Android platform.
|
|
24
|
-
*/
|
|
1
|
+
/** Dependency configuration for Android platform. */
|
|
25
2
|
export interface RNConfigDependencyAndroid {
|
|
26
3
|
sourceDir: string;
|
|
27
4
|
packageImportPath: string | null;
|
|
@@ -36,18 +13,14 @@ export interface RNConfigDependencyAndroid {
|
|
|
36
13
|
cxxModuleHeaderName?: string | null;
|
|
37
14
|
isPureCxxDependency?: boolean;
|
|
38
15
|
}
|
|
39
|
-
/**
|
|
40
|
-
* Dependency configuration for iOS platform.
|
|
41
|
-
*/
|
|
16
|
+
/** Dependency configuration for iOS platform. */
|
|
42
17
|
export interface RNConfigDependencyIos {
|
|
43
18
|
podspecPath: string;
|
|
44
19
|
version: string;
|
|
45
20
|
configurations: string[];
|
|
46
21
|
scriptPhases: any[];
|
|
47
22
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Dependency configuration.
|
|
50
|
-
*/
|
|
23
|
+
/** Dependency configuration. */
|
|
51
24
|
export interface RNConfigDependency {
|
|
52
25
|
root: string;
|
|
53
26
|
name: string;
|
|
@@ -56,9 +29,7 @@ export interface RNConfigDependency {
|
|
|
56
29
|
ios?: RNConfigDependencyIos;
|
|
57
30
|
};
|
|
58
31
|
}
|
|
59
|
-
/**
|
|
60
|
-
* Result of 'react-native-config' command.
|
|
61
|
-
*/
|
|
32
|
+
/** Result of 'react-native-config' command. */
|
|
62
33
|
export interface RNConfigResult {
|
|
63
34
|
root: string;
|
|
64
35
|
reactNativePath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactNativeConfig.types.js","sourceRoot":"","sources":["../../src/reactNativeConfig/reactNativeConfig.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SupportedPlatform } from '../types';\n\n
|
|
1
|
+
{"version":3,"file":"reactNativeConfig.types.js","sourceRoot":"","sources":["../../src/reactNativeConfig/reactNativeConfig.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SupportedPlatform } from '../types';\n\n/** Dependency configuration for Android platform. */\nexport interface RNConfigDependencyAndroid {\n sourceDir: string;\n packageImportPath: string | null;\n packageInstance: string | null;\n dependencyConfiguration?: string;\n buildTypes: string[];\n libraryName?: string | null;\n componentDescriptors?: string[] | null;\n cmakeListsPath?: string | null;\n cxxModuleCMakeListsModuleName?: string | null;\n cxxModuleCMakeListsPath?: string | null;\n cxxModuleHeaderName?: string | null;\n isPureCxxDependency?: boolean;\n}\n\n/** Dependency configuration for iOS platform. */\nexport interface RNConfigDependencyIos {\n podspecPath: string;\n version: string;\n configurations: string[];\n scriptPhases: any[];\n}\n\n/** Dependency configuration. */\nexport interface RNConfigDependency {\n root: string;\n name: string;\n platforms: {\n android?: RNConfigDependencyAndroid;\n ios?: RNConfigDependencyIos;\n };\n}\n\n/** Result of 'react-native-config' command. */\nexport interface RNConfigResult {\n root: string;\n reactNativePath: string;\n dependencies: Record<string, RNConfigDependency>;\n project: {\n ios?: {\n sourceDir: string;\n };\n };\n}\n\nexport type RNConfigReactNativePlatformsConfigAndroid = any;\nexport type RNConfigReactNativePlatformsConfigIos = any;\n\ninterface RNConfigReactNativePlatformsConfig {\n root?: string;\n platforms?: {\n android?: RNConfigReactNativePlatformsConfigAndroid;\n ios?: RNConfigReactNativePlatformsConfigIos;\n };\n}\n\n/**\n * The `react-native.config.js` config from projectRoot.\n */\nexport interface RNConfigReactNativeProjectConfig {\n dependencies?: Record<string, RNConfigReactNativePlatformsConfig>;\n}\n\n/**\n * The `react-native.config.js` config from library packageRoot.\n */\nexport interface RNConfigReactNativeLibraryConfig {\n dependency?: RNConfigReactNativePlatformsConfig;\n platforms?: any;\n}\n\nexport type RNConfigReactNativeConfig =\n | RNConfigReactNativeProjectConfig\n | RNConfigReactNativeLibraryConfig;\n\n/**\n * The `project` config represents the app project configuration.\n */\nexport interface RNConfigReactNativeAppProjectConfig {\n android?: {\n sourceDir: string;\n packageName: string;\n };\n ios?: {\n sourceDir: string;\n };\n}\n"]}
|
package/build/types.d.ts
CHANGED
|
@@ -3,64 +3,7 @@ type Required<T, K extends keyof T> = T & {
|
|
|
3
3
|
[P in K]-?: T[P];
|
|
4
4
|
};
|
|
5
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
|
-
/** Only scan direct "dependencies" of a project for React Native modules, rather than including transitive dependencies.
|
|
12
|
-
* @remarks
|
|
13
|
-
* Before SDK 54, React Native modules would only be linked if they were listed as dependencies
|
|
14
|
-
* of a project. However, in SDK 54+ transitive React Native modules dependencies are also
|
|
15
|
-
* auto-linked, unless this flag is enabled.
|
|
16
|
-
*/
|
|
17
|
-
legacy_shallowReactNativeLinking?: boolean;
|
|
18
|
-
searchPaths?: string[] | null;
|
|
19
|
-
ignorePaths?: string[] | null;
|
|
20
|
-
exclude?: string[] | null;
|
|
21
|
-
flags?: Record<string, any>;
|
|
22
|
-
};
|
|
23
|
-
export type AndroidAutolinkingOptions = AutolinkingOptions & {
|
|
24
|
-
buildFromSource?: string[] | null;
|
|
25
|
-
};
|
|
26
|
-
export type BaseAutolinkingOptions = AutolinkingOptions & {
|
|
27
|
-
[key in SupportedPlatform]?: AutolinkingOptions;
|
|
28
|
-
};
|
|
29
|
-
export interface PlatformAutolinkingOptions extends BaseAutolinkingOptions {
|
|
30
|
-
android?: AndroidAutolinkingOptions;
|
|
31
|
-
}
|
|
32
|
-
export interface SearchOptions {
|
|
33
|
-
searchPaths?: string[];
|
|
34
|
-
ignorePaths?: string[] | null;
|
|
35
|
-
exclude?: string[] | null;
|
|
36
|
-
platform: SupportedPlatform;
|
|
37
|
-
silent?: boolean;
|
|
38
|
-
nativeModulesDir?: string | null;
|
|
39
|
-
projectRoot: string;
|
|
40
|
-
/**
|
|
41
|
-
* Filter the search results to only include the project dependencies.
|
|
42
|
-
* In a monorepo, you may like to set this to false and link all modules from the monorepo.
|
|
43
|
-
* @default true
|
|
44
|
-
*/
|
|
45
|
-
onlyProjectDeps?: boolean;
|
|
46
|
-
flags?: Record<string, any>;
|
|
47
|
-
android?: {
|
|
48
|
-
buildFromSource?: string[] | null;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
export interface ResolveOptions extends SearchOptions {
|
|
52
|
-
json?: boolean;
|
|
53
|
-
}
|
|
54
|
-
export interface GenerateOptions extends ResolveOptions {
|
|
55
|
-
target: string;
|
|
56
|
-
namespace?: string;
|
|
57
|
-
empty?: boolean;
|
|
58
|
-
}
|
|
59
|
-
export interface GenerateModulesProviderOptions extends ResolveOptions {
|
|
60
|
-
target: string;
|
|
61
|
-
entitlement?: string;
|
|
62
|
-
packages: string[];
|
|
63
|
-
}
|
|
6
|
+
export type SupportedPlatform = 'apple' | 'ios' | 'android' | 'web' | 'macos' | 'tvos' | 'devtools' | (string & {});
|
|
64
7
|
export type PackageRevision = {
|
|
65
8
|
name: string;
|
|
66
9
|
path: string;
|
package/build/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ExpoModuleConfig } from './ExpoModuleConfig';\n\ntype Required<T, K extends keyof T> = T & { [P in K]-?: T[P] };\n\ntype WithRequired<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>> & Required<T, K>;\n\nexport type SupportedPlatform = 'apple' | 'ios' | 'android' | 'web' | 'macos' | 'tvos' | 'devtools';\n\n/**\n * Options that can be passed through `expo.autolinking` config in the package.json file.\n */\nexport type AutolinkingOptions = {\n /** Only scan direct \"dependencies\" of a project for React Native modules, rather than including transitive dependencies.\n * @remarks\n * Before SDK 54, React Native modules would only be linked if they were listed as dependencies\n * of a project. However, in SDK 54+ transitive React Native modules dependencies are also\n * auto-linked, unless this flag is enabled.\n */\n legacy_shallowReactNativeLinking?: boolean;\n searchPaths?: string[] | null;\n ignorePaths?: string[] | null;\n exclude?: string[] | null;\n flags?: Record<string, any>;\n};\n\nexport type AndroidAutolinkingOptions = AutolinkingOptions & {\n buildFromSource?: string[] | null;\n};\n\nexport type BaseAutolinkingOptions = AutolinkingOptions & {\n [key in SupportedPlatform]?: AutolinkingOptions;\n};\n\nexport interface PlatformAutolinkingOptions extends BaseAutolinkingOptions {\n android?: AndroidAutolinkingOptions;\n}\n\nexport interface SearchOptions {\n // Available in the CLI\n searchPaths?: string[];\n ignorePaths?: string[] | null;\n exclude?: string[] | null;\n platform: SupportedPlatform;\n silent?: boolean;\n nativeModulesDir?: string | null;\n projectRoot: string;\n /**\n * Filter the search results to only include the project dependencies.\n * In a monorepo, you may like to set this to false and link all modules from the monorepo.\n * @default true\n */\n onlyProjectDeps?: boolean;\n\n // Scratched from project's config\n flags?: Record<string, any>;\n\n android?: {\n buildFromSource?: string[] | null;\n };\n}\n\nexport interface ResolveOptions extends SearchOptions {\n json?: boolean;\n}\n\nexport interface GenerateOptions extends ResolveOptions {\n target: string;\n namespace?: string;\n empty?: boolean;\n}\n\nexport interface GenerateModulesProviderOptions extends ResolveOptions {\n target: string;\n entitlement?: string;\n packages: string[];\n}\n\nexport type PackageRevision = {\n name: string;\n path: string;\n version: string;\n config?: ExpoModuleConfig;\n duplicates?: PackageRevision[];\n};\n\nexport type SearchResults = {\n [moduleName: string]: PackageRevision;\n};\n\nexport interface ModuleAndroidProjectInfo {\n name: string;\n sourceDir: string;\n modules: string[];\n publication?: AndroidPublication;\n aarProjects?: AndroidGradleAarProjectDescriptor[];\n shouldUsePublicationScriptPath?: string;\n}\n\nexport interface ModuleAndroidPluginInfo {\n id: string;\n sourceDir: string;\n}\n\nexport interface ModuleAndroidAarProjectInfo extends AndroidGradleAarProjectDescriptor {\n projectDir: string;\n}\n\nexport interface CommonNativeModuleDescriptor {\n packageName: string;\n coreFeatures?: string[];\n}\n\nexport interface ModuleDescriptorAndroid extends CommonNativeModuleDescriptor {\n projects?: ModuleAndroidProjectInfo[];\n plugins?: ModuleAndroidPluginInfo[];\n}\n\nexport interface ModuleIosPodspecInfo {\n podName: string;\n podspecDir: string;\n}\nexport interface ModuleDescriptorIos extends CommonNativeModuleDescriptor {\n modules: string[];\n pods: ModuleIosPodspecInfo[];\n flags: Record<string, any> | undefined;\n swiftModuleNames: string[];\n appDelegateSubscribers: string[];\n reactDelegateHandlers: string[];\n debugOnly: boolean;\n}\n\nexport interface ModuleDescriptorDevTools {\n packageName: string;\n packageRoot: string;\n webpageRoot: string;\n}\n\nexport type ModuleDescriptor =\n | ModuleDescriptorAndroid\n | ModuleDescriptorIos\n | ModuleDescriptorDevTools;\n\nexport interface AndroidGradlePluginDescriptor {\n /**\n * Gradle plugin ID\n */\n id: string;\n\n /**\n * Artifact group\n */\n group: string;\n\n /**\n * Relative path to the gradle plugin directory\n */\n sourceDir: string;\n\n /**\n * Whether to apply the plugin to the root project\n * Defaults to true\n */\n applyToRootProject?: boolean;\n}\n\nexport interface AndroidGradleAarProjectDescriptor {\n /**\n * Gradle project name\n */\n name: string;\n\n /**\n * Path to the AAR file\n */\n aarFilePath: string;\n}\n\n/**\n * Information about the available publication of an Android AAR file.\n */\nexport interface AndroidPublication {\n /**\n * The Maven artifact ID.\n */\n id: string;\n /**\n * The Maven group ID.\n */\n group: string;\n /**\n * The Maven version.\n */\n version: string;\n /**\n * The Maven repository.\n */\n repository: string;\n}\n\n/**\n * Represents a raw config specific to Apple platforms.\n */\nexport type RawModuleConfigApple = {\n /**\n * Names of Swift native modules classes to put to the generated modules provider file.\n */\n modules?: string[];\n\n /**\n * Names of Swift classes that hooks into `ExpoAppDelegate` to receive AppDelegate life-cycle events.\n */\n appDelegateSubscribers?: string[];\n\n /**\n * Names of Swift classes that implement `ExpoReactDelegateHandler` to hook React instance creation.\n */\n reactDelegateHandlers?: string[];\n\n /**\n * Podspec relative path.\n * To have multiple podspecs, string array type is also supported.\n */\n podspecPath?: string | string[];\n\n /**\n * Swift product module name. If empty, the pod name is used for Swift imports.\n * To have multiple modules, string array is also supported.\n */\n swiftModuleName?: string | string[];\n\n /**\n * Whether this module will be added only to the debug configuration.\n * Defaults to false.\n */\n debugOnly?: boolean;\n};\n\n/**\n * Represents a raw config specific to Android platforms.\n */\nexport type RawAndroidProjectConfig = {\n /**\n * The name of the project. It will be used as the Gradle project name.\n */\n name?: string;\n\n /**\n * The path to the project directory. Should contain the `build.gradle{.kts}` file.\n * It's relative to the module root directory.\n */\n path?: string;\n\n /**\n * Information about the available publication of an Android AAR file\n */\n publication?: AndroidPublication;\n\n /**\n * The path to the script that determines whether the publication should be used.\n * Evaluate in the context of the `settings.gradle` file.\n * Won't be run if the publication is not defined.\n */\n shouldUsePublicationScriptPath?: string;\n /**\n * Names of the modules to be linked in the project.\n */\n modules?: string[];\n\n /**\n * Prebuilded AAR projects.\n */\n gradleAarProjects?: AndroidGradleAarProjectDescriptor[];\n\n gradlePath?: string;\n};\n\nexport type RawAndroidConfig = {\n projects?: WithRequired<RawAndroidProjectConfig, 'name' | 'path'>[];\n /**\n * Gradle plugins.\n */\n gradlePlugins?: AndroidGradlePluginDescriptor[];\n\n /**\n * Gradle projects containing AAR files.\n */\n} & RawAndroidProjectConfig;\n\n/**\n * Represents a raw config from `expo-module.json`.\n */\nexport interface RawExpoModuleConfig {\n /**\n * An array of supported platforms.\n */\n platforms?: SupportedPlatform[];\n\n /**\n * A config for all Apple platforms.\n */\n apple?: RawModuleConfigApple;\n\n /**\n * The legacy config previously used for iOS platform. For backwards compatibility it's used as the fallback for `apple`.\n * @deprecated As the module can now support more than iOS platform, use the generic `apple` config instead.\n */\n ios?: RawModuleConfigApple;\n\n /**\n * Android-specific config.\n */\n android?: RawAndroidConfig;\n\n /**\n * List of core features that this module requires.\n */\n coreFeatures?: string[];\n\n /**\n * DevTools-specific config.\n */\n devtools?: {\n /**\n * The webpage root directory for Expo CLI DevTools to serve the web resources.\n */\n webpageRoot: string;\n };\n}\n\ninterface AndroidMavenRepositoryPasswordCredentials {\n username: string;\n password: string;\n}\n\ninterface AndroidMavenRepositoryHttpHeaderCredentials {\n name: string;\n value: string;\n}\n\ninterface AndroidMavenRepositoryAWSCredentials {\n accessKey: string;\n secretKey: string;\n sessionToken?: string;\n}\n\ntype AndroidMavenRepositoryCredentials =\n | AndroidMavenRepositoryPasswordCredentials\n | AndroidMavenRepositoryHttpHeaderCredentials\n | AndroidMavenRepositoryAWSCredentials;\n\nexport interface AndroidMavenRepository {\n /**\n * The URL of the Maven repository.\n */\n url: string;\n /**\n * The credentials to use when accessing the Maven repository.\n * May be of type PasswordCredentials, HttpHeaderCredentials, or AWSCredentials.\n *\n * @see the authentication schemes section of [Gradle documentation](https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:authentication_schemes) for more information.\n */\n credentials?: AndroidMavenRepositoryCredentials;\n /**\n * The authentication scheme to use when accessing the Maven repository.\n */\n authentication?: 'basic' | 'digest' | 'header';\n}\n\ninterface ApplePod {\n name: string;\n version?: string;\n configurations?: string[];\n modular_headers?: boolean;\n source?: string;\n path?: string;\n podspec?: string;\n testspecs?: string[];\n git?: string;\n branch?: string;\n tag?: string;\n commit?: string;\n}\n\nexport type ExtraDependencies = AndroidMavenRepository[] | ApplePod[];\n\n/**\n * Represents code signing entitlements passed to the `ExpoModulesProvider` for Apple platforms.\n */\nexport interface AppleCodeSignEntitlements {\n /**\n * @see https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_application-groups\n */\n appGroups?: string[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ExpoModuleConfig } from './ExpoModuleConfig';\n\ntype Required<T, K extends keyof T> = T & { [P in K]-?: T[P] };\n\ntype WithRequired<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>> & Required<T, K>;\n\n// NOTE(@kitten): Our code has never guaranteed this to be exhaustive, hence the `| (string & {})` addition\nexport type SupportedPlatform =\n | 'apple'\n | 'ios'\n | 'android'\n | 'web'\n | 'macos'\n | 'tvos'\n | 'devtools'\n | (string & {});\n\nexport type PackageRevision = {\n name: string;\n path: string;\n version: string;\n config?: ExpoModuleConfig;\n duplicates?: PackageRevision[];\n};\n\nexport type SearchResults = {\n [moduleName: string]: PackageRevision;\n};\n\nexport interface ModuleAndroidProjectInfo {\n name: string;\n sourceDir: string;\n modules: string[];\n publication?: AndroidPublication;\n aarProjects?: AndroidGradleAarProjectDescriptor[];\n shouldUsePublicationScriptPath?: string;\n}\n\nexport interface ModuleAndroidPluginInfo {\n id: string;\n sourceDir: string;\n}\n\nexport interface ModuleAndroidAarProjectInfo extends AndroidGradleAarProjectDescriptor {\n projectDir: string;\n}\n\nexport interface CommonNativeModuleDescriptor {\n packageName: string;\n coreFeatures?: string[];\n}\n\nexport interface ModuleDescriptorAndroid extends CommonNativeModuleDescriptor {\n projects?: ModuleAndroidProjectInfo[];\n plugins?: ModuleAndroidPluginInfo[];\n}\n\nexport interface ModuleIosPodspecInfo {\n podName: string;\n podspecDir: string;\n}\nexport interface ModuleDescriptorIos extends CommonNativeModuleDescriptor {\n modules: string[];\n pods: ModuleIosPodspecInfo[];\n flags: Record<string, any> | undefined;\n swiftModuleNames: string[];\n appDelegateSubscribers: string[];\n reactDelegateHandlers: string[];\n debugOnly: boolean;\n}\n\nexport interface ModuleDescriptorDevTools {\n packageName: string;\n packageRoot: string;\n webpageRoot: string;\n}\n\nexport type ModuleDescriptor =\n | ModuleDescriptorAndroid\n | ModuleDescriptorIos\n | ModuleDescriptorDevTools;\n\nexport interface AndroidGradlePluginDescriptor {\n /**\n * Gradle plugin ID\n */\n id: string;\n\n /**\n * Artifact group\n */\n group: string;\n\n /**\n * Relative path to the gradle plugin directory\n */\n sourceDir: string;\n\n /**\n * Whether to apply the plugin to the root project\n * Defaults to true\n */\n applyToRootProject?: boolean;\n}\n\nexport interface AndroidGradleAarProjectDescriptor {\n /**\n * Gradle project name\n */\n name: string;\n\n /**\n * Path to the AAR file\n */\n aarFilePath: string;\n}\n\n/**\n * Information about the available publication of an Android AAR file.\n */\nexport interface AndroidPublication {\n /**\n * The Maven artifact ID.\n */\n id: string;\n /**\n * The Maven group ID.\n */\n group: string;\n /**\n * The Maven version.\n */\n version: string;\n /**\n * The Maven repository.\n */\n repository: string;\n}\n\n/**\n * Represents a raw config specific to Apple platforms.\n */\nexport type RawModuleConfigApple = {\n /**\n * Names of Swift native modules classes to put to the generated modules provider file.\n */\n modules?: string[];\n\n /**\n * Names of Swift classes that hooks into `ExpoAppDelegate` to receive AppDelegate life-cycle events.\n */\n appDelegateSubscribers?: string[];\n\n /**\n * Names of Swift classes that implement `ExpoReactDelegateHandler` to hook React instance creation.\n */\n reactDelegateHandlers?: string[];\n\n /**\n * Podspec relative path.\n * To have multiple podspecs, string array type is also supported.\n */\n podspecPath?: string | string[];\n\n /**\n * Swift product module name. If empty, the pod name is used for Swift imports.\n * To have multiple modules, string array is also supported.\n */\n swiftModuleName?: string | string[];\n\n /**\n * Whether this module will be added only to the debug configuration.\n * Defaults to false.\n */\n debugOnly?: boolean;\n};\n\n/**\n * Represents a raw config specific to Android platforms.\n */\nexport type RawAndroidProjectConfig = {\n /**\n * The name of the project. It will be used as the Gradle project name.\n */\n name?: string;\n\n /**\n * The path to the project directory. Should contain the `build.gradle{.kts}` file.\n * It's relative to the module root directory.\n */\n path?: string;\n\n /**\n * Information about the available publication of an Android AAR file\n */\n publication?: AndroidPublication;\n\n /**\n * The path to the script that determines whether the publication should be used.\n * Evaluate in the context of the `settings.gradle` file.\n * Won't be run if the publication is not defined.\n */\n shouldUsePublicationScriptPath?: string;\n /**\n * Names of the modules to be linked in the project.\n */\n modules?: string[];\n\n /**\n * Prebuilded AAR projects.\n */\n gradleAarProjects?: AndroidGradleAarProjectDescriptor[];\n\n gradlePath?: string;\n};\n\nexport type RawAndroidConfig = {\n projects?: WithRequired<RawAndroidProjectConfig, 'name' | 'path'>[];\n /**\n * Gradle plugins.\n */\n gradlePlugins?: AndroidGradlePluginDescriptor[];\n\n /**\n * Gradle projects containing AAR files.\n */\n} & RawAndroidProjectConfig;\n\n/**\n * Represents a raw config from `expo-module.json`.\n */\nexport interface RawExpoModuleConfig {\n /**\n * An array of supported platforms.\n */\n platforms?: SupportedPlatform[];\n\n /**\n * A config for all Apple platforms.\n */\n apple?: RawModuleConfigApple;\n\n /**\n * The legacy config previously used for iOS platform. For backwards compatibility it's used as the fallback for `apple`.\n * @deprecated As the module can now support more than iOS platform, use the generic `apple` config instead.\n */\n ios?: RawModuleConfigApple;\n\n /**\n * Android-specific config.\n */\n android?: RawAndroidConfig;\n\n /**\n * List of core features that this module requires.\n */\n coreFeatures?: string[];\n\n /**\n * DevTools-specific config.\n */\n devtools?: {\n /**\n * The webpage root directory for Expo CLI DevTools to serve the web resources.\n */\n webpageRoot: string;\n };\n}\n\ninterface AndroidMavenRepositoryPasswordCredentials {\n username: string;\n password: string;\n}\n\ninterface AndroidMavenRepositoryHttpHeaderCredentials {\n name: string;\n value: string;\n}\n\ninterface AndroidMavenRepositoryAWSCredentials {\n accessKey: string;\n secretKey: string;\n sessionToken?: string;\n}\n\ntype AndroidMavenRepositoryCredentials =\n | AndroidMavenRepositoryPasswordCredentials\n | AndroidMavenRepositoryHttpHeaderCredentials\n | AndroidMavenRepositoryAWSCredentials;\n\nexport interface AndroidMavenRepository {\n /**\n * The URL of the Maven repository.\n */\n url: string;\n /**\n * The credentials to use when accessing the Maven repository.\n * May be of type PasswordCredentials, HttpHeaderCredentials, or AWSCredentials.\n *\n * @see the authentication schemes section of [Gradle documentation](https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:authentication_schemes) for more information.\n */\n credentials?: AndroidMavenRepositoryCredentials;\n /**\n * The authentication scheme to use when accessing the Maven repository.\n */\n authentication?: 'basic' | 'digest' | 'header';\n}\n\ninterface ApplePod {\n name: string;\n version?: string;\n configurations?: string[];\n modular_headers?: boolean;\n source?: string;\n path?: string;\n podspec?: string;\n testspecs?: string[];\n git?: string;\n branch?: string;\n tag?: string;\n commit?: string;\n}\n\nexport type ExtraDependencies = AndroidMavenRepository[] | ApplePod[];\n\n/**\n * Represents code signing entitlements passed to the `ExpoModulesProvider` for Apple platforms.\n */\nexport interface AppleCodeSignEntitlements {\n /**\n * @see https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_application-groups\n */\n appGroups?: string[];\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-modules-autolinking",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "Scripts that autolink Expo modules.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"homepage": "https://github.com/expo/expo/tree/main/packages/expo-modules-autolinking#readme",
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"expo-module-scripts": "~5.0.
|
|
37
|
+
"expo-module-scripts": "~5.0.2",
|
|
38
38
|
"memfs": "^3.2.0",
|
|
39
39
|
"minimatch": "^9.0.0"
|
|
40
40
|
},
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"require-from-string": "^2.0.2",
|
|
48
48
|
"resolve-from": "^5.0.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "eaa9b645058cf2233fbb27bb21a19bc605c90a88"
|
|
51
51
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
|
|
3
|
-
import { mergeLinkingOptionsAsync } from './mergeLinkingOptions';
|
|
4
1
|
import { discoverExpoModuleConfigAsync } from '../ExpoModuleConfig';
|
|
2
|
+
import { AutolinkingOptions } from '../commands/autolinkingOptions';
|
|
5
3
|
import {
|
|
6
4
|
type DependencyResolution,
|
|
7
5
|
scanDependenciesRecursively,
|
|
@@ -9,7 +7,7 @@ import {
|
|
|
9
7
|
filterMapResolutionResult,
|
|
10
8
|
mergeResolutionResults,
|
|
11
9
|
} from '../dependencies';
|
|
12
|
-
import { PackageRevision,
|
|
10
|
+
import { PackageRevision, SearchResults, SupportedPlatform } from '../types';
|
|
13
11
|
|
|
14
12
|
export async function resolveExpoModule(
|
|
15
13
|
resolution: DependencyResolution,
|
|
@@ -38,26 +36,30 @@ export async function resolveExpoModule(
|
|
|
38
36
|
}
|
|
39
37
|
}
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
interface FindModulesParams {
|
|
40
|
+
appRoot: string;
|
|
41
|
+
autolinkingOptions: AutolinkingOptions & { platform: SupportedPlatform };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Searches for modules to link based on given config. */
|
|
45
|
+
export async function findModulesAsync({
|
|
46
|
+
appRoot,
|
|
47
|
+
autolinkingOptions,
|
|
48
|
+
}: FindModulesParams): Promise<SearchResults> {
|
|
49
|
+
const excludeNames = new Set(autolinkingOptions.exclude);
|
|
47
50
|
|
|
48
51
|
// custom native modules should be resolved first so that they can override other modules
|
|
49
|
-
const searchPaths =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
: (options.searchPaths ?? []);
|
|
52
|
+
const searchPaths = autolinkingOptions.nativeModulesDir
|
|
53
|
+
? [autolinkingOptions.nativeModulesDir, ...autolinkingOptions.searchPaths]
|
|
54
|
+
: autolinkingOptions.searchPaths;
|
|
53
55
|
|
|
54
56
|
return filterMapResolutionResult(
|
|
55
57
|
mergeResolutionResults(
|
|
56
58
|
await Promise.all([
|
|
57
59
|
...searchPaths.map((searchPath) => scanDependenciesInSearchPath(searchPath)),
|
|
58
|
-
scanDependenciesRecursively(
|
|
60
|
+
scanDependenciesRecursively(appRoot),
|
|
59
61
|
])
|
|
60
62
|
),
|
|
61
|
-
(resolution) => resolveExpoModule(resolution,
|
|
63
|
+
(resolution) => resolveExpoModule(resolution, autolinkingOptions.platform, excludeNames)
|
|
62
64
|
);
|
|
63
65
|
}
|
|
@@ -1,46 +1,45 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getLinkingImplementationForPlatform } from '../platforms';
|
|
2
|
+
import { ModuleDescriptor, ModuleDescriptorIos, SupportedPlatform } from '../types';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
interface GeneratePackageListParams {
|
|
5
|
+
platform: SupportedPlatform;
|
|
6
|
+
targetPath: string;
|
|
7
|
+
namespace: string;
|
|
8
|
+
}
|
|
5
9
|
|
|
6
|
-
/**
|
|
7
|
-
* Generates a source file listing all packages to link.
|
|
8
|
-
* Right know it works only for Android platform.
|
|
9
|
-
*/
|
|
10
|
+
/** Generates a source file listing all packages to link (Android-only) */
|
|
10
11
|
export async function generatePackageListAsync(
|
|
11
12
|
modules: ModuleDescriptor[],
|
|
12
|
-
|
|
13
|
+
params: GeneratePackageListParams
|
|
13
14
|
) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} catch (e) {
|
|
18
|
-
console.error(
|
|
19
|
-
chalk.red(`Generating package list is not available for platform: ${options.platform}`)
|
|
20
|
-
);
|
|
21
|
-
throw e;
|
|
15
|
+
const platformLinking = getLinkingImplementationForPlatform(params.platform);
|
|
16
|
+
if (!('generatePackageListAsync' in platformLinking)) {
|
|
17
|
+
throw new Error(`Generating package list is not available for platform "${params.platform}"`);
|
|
22
18
|
}
|
|
19
|
+
await platformLinking.generatePackageListAsync(modules, params.targetPath, params.namespace);
|
|
23
20
|
}
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
interface GenerateModulesProviderParams {
|
|
23
|
+
platform: SupportedPlatform;
|
|
24
|
+
targetPath: string;
|
|
25
|
+
entitlementPath: string | null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Generates ExpoModulesProvider file listing all packages to link (Apple-only)
|
|
28
29
|
*/
|
|
29
30
|
export async function generateModulesProviderAsync(
|
|
30
31
|
modules: ModuleDescriptor[],
|
|
31
|
-
|
|
32
|
+
params: GenerateModulesProviderParams
|
|
32
33
|
) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
modules
|
|
37
|
-
options.target,
|
|
38
|
-
options.entitlement
|
|
39
|
-
);
|
|
40
|
-
} catch (e) {
|
|
41
|
-
console.error(
|
|
42
|
-
chalk.red(`Generating modules provider is not available for platform: ${options.platform}`)
|
|
34
|
+
const platformLinking = getLinkingImplementationForPlatform(params.platform);
|
|
35
|
+
if (!('generateModulesProviderAsync' in platformLinking)) {
|
|
36
|
+
throw new Error(
|
|
37
|
+
`Generating modules provider is not available for platform "${params.platform}"`
|
|
43
38
|
);
|
|
44
|
-
throw e;
|
|
45
39
|
}
|
|
40
|
+
await platformLinking.generateModulesProviderAsync(
|
|
41
|
+
modules as ModuleDescriptorIos[],
|
|
42
|
+
params.targetPath,
|
|
43
|
+
params.entitlementPath
|
|
44
|
+
);
|
|
46
45
|
}
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getLinkingImplementationForPlatform } from '
|
|
1
|
+
import { AutolinkingOptions } from '../commands/autolinkingOptions';
|
|
2
|
+
import { getLinkingImplementationForPlatform } from '../platforms';
|
|
3
|
+
import type { SupportedPlatform } from '../types';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
interface GetConfigurationParams {
|
|
6
|
+
autolinkingOptions: AutolinkingOptions & { platform: SupportedPlatform };
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function getConfiguration({
|
|
10
|
+
autolinkingOptions,
|
|
11
|
+
}: GetConfigurationParams): Record<string, any> | undefined {
|
|
12
|
+
const platformLinking = getLinkingImplementationForPlatform(autolinkingOptions.platform);
|
|
13
|
+
if ('getConfiguration' in platformLinking) {
|
|
14
|
+
return platformLinking.getConfiguration(autolinkingOptions);
|
|
15
|
+
} else {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
7
18
|
}
|