expo-modules-autolinking 3.0.1 → 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 +12 -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
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 3.0.2 — 2025-08-16
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- Regression: Use the command's root instead of the app's root when resolving extra build dependencies ([#38907](https://github.com/expo/expo/pull/38907) by [@kitten](https://github.com/kitten))
|
|
18
|
+
|
|
19
|
+
### 💡 Others
|
|
20
|
+
|
|
21
|
+
- Refactor command implementations and deprecate old Expo modules autolinking API ([#38907](https://github.com/expo/expo/pull/38907) by [@kitten](https://github.com/kitten))
|
|
22
|
+
- Add internal API to scan only for Expo modules ([#38909](https://github.com/expo/expo/pull/38909) by [@kitten](https://github.com/kitten))
|
|
23
|
+
- Expose `getLinkingImplementationForPlatform` and `PackageRevision` for Expo modules from internal autolinking API ([#38913](https://github.com/expo/expo/pull/38913) by [@kitten](https://github.com/kitten))
|
|
24
|
+
|
|
13
25
|
## 3.0.1 — 2025-08-15
|
|
14
26
|
|
|
15
27
|
_This version does not introduce any user-facing changes._
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { AutolinkingOptions } from '../commands/autolinkingOptions';
|
|
1
2
|
import { type DependencyResolution } from '../dependencies';
|
|
2
|
-
import { PackageRevision,
|
|
3
|
+
import { PackageRevision, SearchResults, SupportedPlatform } from '../types';
|
|
3
4
|
export declare function resolveExpoModule(resolution: DependencyResolution, platform: SupportedPlatform, excludeNames: Set<string>): Promise<PackageRevision | null>;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
interface FindModulesParams {
|
|
6
|
+
appRoot: string;
|
|
7
|
+
autolinkingOptions: AutolinkingOptions & {
|
|
8
|
+
platform: SupportedPlatform;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/** Searches for modules to link based on given config. */
|
|
12
|
+
export declare function findModulesAsync({ appRoot, autolinkingOptions, }: FindModulesParams): Promise<SearchResults>;
|
|
13
|
+
export {};
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.resolveExpoModule = resolveExpoModule;
|
|
7
4
|
exports.findModulesAsync = findModulesAsync;
|
|
8
|
-
const fs_1 = __importDefault(require("fs"));
|
|
9
|
-
const mergeLinkingOptions_1 = require("./mergeLinkingOptions");
|
|
10
5
|
const ExpoModuleConfig_1 = require("../ExpoModuleConfig");
|
|
11
6
|
const dependencies_1 = require("../dependencies");
|
|
12
7
|
async function resolveExpoModule(resolution, platform, excludeNames) {
|
|
@@ -31,19 +26,16 @@ async function resolveExpoModule(resolution, platform, excludeNames) {
|
|
|
31
26
|
return null;
|
|
32
27
|
}
|
|
33
28
|
}
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
async function findModulesAsync(providedOptions) {
|
|
38
|
-
const options = await (0, mergeLinkingOptions_1.mergeLinkingOptionsAsync)(providedOptions);
|
|
39
|
-
const excludeNames = new Set(options.exclude);
|
|
29
|
+
/** Searches for modules to link based on given config. */
|
|
30
|
+
async function findModulesAsync({ appRoot, autolinkingOptions, }) {
|
|
31
|
+
const excludeNames = new Set(autolinkingOptions.exclude);
|
|
40
32
|
// custom native modules should be resolved first so that they can override other modules
|
|
41
|
-
const searchPaths =
|
|
42
|
-
? [
|
|
43
|
-
:
|
|
33
|
+
const searchPaths = autolinkingOptions.nativeModulesDir
|
|
34
|
+
? [autolinkingOptions.nativeModulesDir, ...autolinkingOptions.searchPaths]
|
|
35
|
+
: autolinkingOptions.searchPaths;
|
|
44
36
|
return (0, dependencies_1.filterMapResolutionResult)((0, dependencies_1.mergeResolutionResults)(await Promise.all([
|
|
45
37
|
...searchPaths.map((searchPath) => (0, dependencies_1.scanDependenciesInSearchPath)(searchPath)),
|
|
46
|
-
(0, dependencies_1.scanDependenciesRecursively)(
|
|
47
|
-
])), (resolution) => resolveExpoModule(resolution,
|
|
38
|
+
(0, dependencies_1.scanDependenciesRecursively)(appRoot),
|
|
39
|
+
])), (resolution) => resolveExpoModule(resolution, autolinkingOptions.platform, excludeNames));
|
|
48
40
|
}
|
|
49
41
|
//# sourceMappingURL=findModules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findModules.js","sourceRoot":"","sources":["../../src/autolinking/findModules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"findModules.js","sourceRoot":"","sources":["../../src/autolinking/findModules.ts"],"names":[],"mappings":";;AAWA,8CAyBC;AAQD,4CAoBC;AAhED,0DAAoE;AAEpE,kDAMyB;AAGlB,KAAK,UAAU,iBAAiB,CACrC,UAAgC,EAChC,QAA2B,EAC3B,YAAyB;IAEzB,IAAI,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,gBAAgB,GAAG,MAAM,IAAA,gDAA6B,EAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9E,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpE,OAAO;YACL,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,MAAM,EAAE,gBAAgB;YACxB,UAAU,EACR,UAAU,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;gBACzC,IAAI,EAAE,SAAS,CAAC,IAAI;gBACpB,IAAI,EAAE,SAAS,CAAC,IAAI;gBACpB,OAAO,EAAE,SAAS,CAAC,OAAO;aAC3B,CAAC,CAAC,IAAI,EAAE;SACZ,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAOD,0DAA0D;AACnD,KAAK,UAAU,gBAAgB,CAAC,EACrC,OAAO,EACP,kBAAkB,GACA;IAClB,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAEzD,yFAAyF;IACzF,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB;QACrD,CAAC,CAAC,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,GAAG,kBAAkB,CAAC,WAAW,CAAC;QAC1E,CAAC,CAAC,kBAAkB,CAAC,WAAW,CAAC;IAEnC,OAAO,IAAA,wCAAyB,EAC9B,IAAA,qCAAsB,EACpB,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAA,2CAA4B,EAAC,UAAU,CAAC,CAAC;QAC5E,IAAA,0CAA2B,EAAC,OAAO,CAAC;KACrC,CAAC,CACH,EACD,CAAC,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,UAAU,EAAE,kBAAkB,CAAC,QAAQ,EAAE,YAAY,CAAC,CACzF,CAAC;AACJ,CAAC","sourcesContent":["import { discoverExpoModuleConfigAsync } from '../ExpoModuleConfig';\nimport { AutolinkingOptions } from '../commands/autolinkingOptions';\nimport {\n type DependencyResolution,\n scanDependenciesRecursively,\n scanDependenciesInSearchPath,\n filterMapResolutionResult,\n mergeResolutionResults,\n} from '../dependencies';\nimport { PackageRevision, SearchResults, SupportedPlatform } from '../types';\n\nexport async function resolveExpoModule(\n resolution: DependencyResolution,\n platform: SupportedPlatform,\n excludeNames: Set<string>\n): Promise<PackageRevision | null> {\n if (excludeNames.has(resolution.name)) {\n return null;\n }\n const expoModuleConfig = await discoverExpoModuleConfigAsync(resolution.path);\n if (expoModuleConfig && expoModuleConfig.supportsPlatform(platform)) {\n return {\n name: resolution.name,\n path: resolution.path,\n version: resolution.version,\n config: expoModuleConfig,\n duplicates:\n resolution.duplicates?.map((duplicate) => ({\n name: duplicate.name,\n path: duplicate.path,\n version: duplicate.version,\n })) ?? [],\n };\n } else {\n return null;\n }\n}\n\ninterface FindModulesParams {\n appRoot: string;\n autolinkingOptions: AutolinkingOptions & { platform: SupportedPlatform };\n}\n\n/** Searches for modules to link based on given config. */\nexport async function findModulesAsync({\n appRoot,\n autolinkingOptions,\n}: FindModulesParams): Promise<SearchResults> {\n const excludeNames = new Set(autolinkingOptions.exclude);\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 return filterMapResolutionResult(\n mergeResolutionResults(\n await Promise.all([\n ...searchPaths.map((searchPath) => scanDependenciesInSearchPath(searchPath)),\n scanDependenciesRecursively(appRoot),\n ])\n ),\n (resolution) => resolveExpoModule(resolution, autolinkingOptions.platform, excludeNames)\n );\n}\n"]}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ModuleDescriptor, SupportedPlatform } from '../types';
|
|
2
|
+
interface GeneratePackageListParams {
|
|
3
|
+
platform: SupportedPlatform;
|
|
4
|
+
targetPath: string;
|
|
5
|
+
namespace: string;
|
|
6
|
+
}
|
|
7
|
+
/** Generates a source file listing all packages to link (Android-only) */
|
|
8
|
+
export declare function generatePackageListAsync(modules: ModuleDescriptor[], params: GeneratePackageListParams): Promise<void>;
|
|
9
|
+
interface GenerateModulesProviderParams {
|
|
10
|
+
platform: SupportedPlatform;
|
|
11
|
+
targetPath: string;
|
|
12
|
+
entitlementPath: string | null;
|
|
13
|
+
}
|
|
14
|
+
/** Generates ExpoModulesProvider file listing all packages to link (Apple-only)
|
|
5
15
|
*/
|
|
6
|
-
export declare function
|
|
7
|
-
|
|
8
|
-
* Generates ExpoModulesProvider file listing all packages to link.
|
|
9
|
-
* Right know it works only for Apple platforms.
|
|
10
|
-
*/
|
|
11
|
-
export declare function generateModulesProviderAsync(modules: ModuleDescriptor[], options: GenerateModulesProviderOptions): Promise<void>;
|
|
16
|
+
export declare function generateModulesProviderAsync(modules: ModuleDescriptor[], params: GenerateModulesProviderParams): Promise<void>;
|
|
17
|
+
export {};
|
|
@@ -1,38 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.generatePackageListAsync = generatePackageListAsync;
|
|
7
4
|
exports.generateModulesProviderAsync = generateModulesProviderAsync;
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
async function generatePackageListAsync(modules, options) {
|
|
15
|
-
try {
|
|
16
|
-
const platformLinking = (0, utils_1.getLinkingImplementationForPlatform)(options.platform);
|
|
17
|
-
await platformLinking.generatePackageListAsync(modules, options.target, options.namespace);
|
|
18
|
-
}
|
|
19
|
-
catch (e) {
|
|
20
|
-
console.error(chalk_1.default.red(`Generating package list is not available for platform: ${options.platform}`));
|
|
21
|
-
throw e;
|
|
5
|
+
const platforms_1 = require("../platforms");
|
|
6
|
+
/** Generates a source file listing all packages to link (Android-only) */
|
|
7
|
+
async function generatePackageListAsync(modules, params) {
|
|
8
|
+
const platformLinking = (0, platforms_1.getLinkingImplementationForPlatform)(params.platform);
|
|
9
|
+
if (!('generatePackageListAsync' in platformLinking)) {
|
|
10
|
+
throw new Error(`Generating package list is not available for platform "${params.platform}"`);
|
|
22
11
|
}
|
|
12
|
+
await platformLinking.generatePackageListAsync(modules, params.targetPath, params.namespace);
|
|
23
13
|
}
|
|
24
|
-
/**
|
|
25
|
-
* Generates ExpoModulesProvider file listing all packages to link.
|
|
26
|
-
* Right know it works only for Apple platforms.
|
|
14
|
+
/** Generates ExpoModulesProvider file listing all packages to link (Apple-only)
|
|
27
15
|
*/
|
|
28
|
-
async function generateModulesProviderAsync(modules,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
catch (e) {
|
|
34
|
-
console.error(chalk_1.default.red(`Generating modules provider is not available for platform: ${options.platform}`));
|
|
35
|
-
throw e;
|
|
16
|
+
async function generateModulesProviderAsync(modules, params) {
|
|
17
|
+
const platformLinking = (0, platforms_1.getLinkingImplementationForPlatform)(params.platform);
|
|
18
|
+
if (!('generateModulesProviderAsync' in platformLinking)) {
|
|
19
|
+
throw new Error(`Generating modules provider is not available for platform "${params.platform}"`);
|
|
36
20
|
}
|
|
21
|
+
await platformLinking.generateModulesProviderAsync(modules, params.targetPath, params.entitlementPath);
|
|
37
22
|
}
|
|
38
23
|
//# sourceMappingURL=generatePackageList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePackageList.js","sourceRoot":"","sources":["../../src/autolinking/generatePackageList.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generatePackageList.js","sourceRoot":"","sources":["../../src/autolinking/generatePackageList.ts"],"names":[],"mappings":";;AAUA,4DASC;AAUD,oEAeC;AA5CD,4CAAmE;AASnE,0EAA0E;AACnE,KAAK,UAAU,wBAAwB,CAC5C,OAA2B,EAC3B,MAAiC;IAEjC,MAAM,eAAe,GAAG,IAAA,+CAAmC,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC7E,IAAI,CAAC,CAAC,0BAA0B,IAAI,eAAe,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CAAC,0DAA0D,MAAM,CAAC,QAAQ,GAAG,CAAC,CAAC;IAChG,CAAC;IACD,MAAM,eAAe,CAAC,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;AAC/F,CAAC;AAQD;GACG;AACI,KAAK,UAAU,4BAA4B,CAChD,OAA2B,EAC3B,MAAqC;IAErC,MAAM,eAAe,GAAG,IAAA,+CAAmC,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC7E,IAAI,CAAC,CAAC,8BAA8B,IAAI,eAAe,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CACb,8DAA8D,MAAM,CAAC,QAAQ,GAAG,CACjF,CAAC;IACJ,CAAC;IACD,MAAM,eAAe,CAAC,4BAA4B,CAChD,OAAgC,EAChC,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,eAAe,CACvB,CAAC;AACJ,CAAC","sourcesContent":["import { getLinkingImplementationForPlatform } from '../platforms';\nimport { ModuleDescriptor, ModuleDescriptorIos, SupportedPlatform } from '../types';\n\ninterface GeneratePackageListParams {\n platform: SupportedPlatform;\n targetPath: string;\n namespace: string;\n}\n\n/** Generates a source file listing all packages to link (Android-only) */\nexport async function generatePackageListAsync(\n modules: ModuleDescriptor[],\n params: GeneratePackageListParams\n) {\n const platformLinking = getLinkingImplementationForPlatform(params.platform);\n if (!('generatePackageListAsync' in platformLinking)) {\n throw new Error(`Generating package list is not available for platform \"${params.platform}\"`);\n }\n await platformLinking.generatePackageListAsync(modules, params.targetPath, params.namespace);\n}\n\ninterface GenerateModulesProviderParams {\n platform: SupportedPlatform;\n targetPath: string;\n entitlementPath: string | null;\n}\n\n/** Generates ExpoModulesProvider file listing all packages to link (Apple-only)\n */\nexport async function generateModulesProviderAsync(\n modules: ModuleDescriptor[],\n params: GenerateModulesProviderParams\n) {\n const platformLinking = getLinkingImplementationForPlatform(params.platform);\n if (!('generateModulesProviderAsync' in platformLinking)) {\n throw new Error(\n `Generating modules provider is not available for platform \"${params.platform}\"`\n );\n }\n await platformLinking.generateModulesProviderAsync(\n modules as ModuleDescriptorIos[],\n params.targetPath,\n params.entitlementPath\n );\n}\n"]}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { AutolinkingOptions } from '../commands/autolinkingOptions';
|
|
2
|
+
import type { SupportedPlatform } from '../types';
|
|
3
|
+
interface GetConfigurationParams {
|
|
4
|
+
autolinkingOptions: AutolinkingOptions & {
|
|
5
|
+
platform: SupportedPlatform;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export declare function getConfiguration({ autolinkingOptions, }: GetConfigurationParams): Record<string, any> | undefined;
|
|
9
|
+
export {};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getConfiguration = getConfiguration;
|
|
4
|
-
const
|
|
5
|
-
function getConfiguration(
|
|
6
|
-
const platformLinking = (0,
|
|
7
|
-
|
|
4
|
+
const platforms_1 = require("../platforms");
|
|
5
|
+
function getConfiguration({ autolinkingOptions, }) {
|
|
6
|
+
const platformLinking = (0, platforms_1.getLinkingImplementationForPlatform)(autolinkingOptions.platform);
|
|
7
|
+
if ('getConfiguration' in platformLinking) {
|
|
8
|
+
return platformLinking.getConfiguration(autolinkingOptions);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
8
13
|
}
|
|
9
14
|
//# sourceMappingURL=getConfiguration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConfiguration.js","sourceRoot":"","sources":["../../src/autolinking/getConfiguration.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"getConfiguration.js","sourceRoot":"","sources":["../../src/autolinking/getConfiguration.ts"],"names":[],"mappings":";;AAQA,4CASC;AAhBD,4CAAmE;AAOnE,SAAgB,gBAAgB,CAAC,EAC/B,kBAAkB,GACK;IACvB,MAAM,eAAe,GAAG,IAAA,+CAAmC,EAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACzF,IAAI,kBAAkB,IAAI,eAAe,EAAE,CAAC;QAC1C,OAAO,eAAe,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;IAC9D,CAAC;SAAM,CAAC;QACN,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC","sourcesContent":["import { AutolinkingOptions } from '../commands/autolinkingOptions';\nimport { getLinkingImplementationForPlatform } from '../platforms';\nimport type { SupportedPlatform } from '../types';\n\ninterface GetConfigurationParams {\n autolinkingOptions: AutolinkingOptions & { platform: SupportedPlatform };\n}\n\nexport function getConfiguration({\n autolinkingOptions,\n}: GetConfigurationParams): Record<string, any> | undefined {\n const platformLinking = getLinkingImplementationForPlatform(autolinkingOptions.platform);\n if ('getConfiguration' in platformLinking) {\n return platformLinking.getConfiguration(autolinkingOptions);\n } else {\n return undefined;\n }\n}\n"]}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import type { ModuleDescriptor, SearchOptions } from '../types';
|
|
5
|
-
import { getConfiguration } from './getConfiguration';
|
|
6
|
-
export { findModulesAsync, getProjectPackageJsonPathAsync, mergeLinkingOptionsAsync, resolveExtraBuildDependenciesAsync, resolveModulesAsync, getConfiguration, };
|
|
1
|
+
import { AutolinkingOptions } from '../commands/autolinkingOptions';
|
|
2
|
+
import { ExtraDependencies, ModuleDescriptor, SearchResults, SupportedPlatform } from '../types';
|
|
3
|
+
export { getConfiguration } from './getConfiguration';
|
|
7
4
|
export { generateModulesProviderAsync, generatePackageListAsync } from './generatePackageList';
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
/** @deprecated */
|
|
6
|
+
export interface SearchOptions extends Partial<AutolinkingOptions> {
|
|
7
|
+
projectRoot: string;
|
|
8
|
+
platform: SupportedPlatform;
|
|
9
|
+
[extra: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
/** @deprecated */
|
|
12
|
+
export interface ResolveOptions {
|
|
13
|
+
projectRoot: string;
|
|
14
|
+
platform: SupportedPlatform;
|
|
15
|
+
[extra: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
/** @deprecated */
|
|
18
|
+
declare function apiFindModulesAsync(providedOptions: SearchOptions): Promise<SearchResults>;
|
|
19
|
+
/** @deprecated */
|
|
20
|
+
declare function apiResolveExtraBuildDependenciesAsync(providedOptions: ResolveOptions): Promise<ExtraDependencies>;
|
|
21
|
+
/** @deprecated */
|
|
22
|
+
declare function apiResolveModulesAsync(searchResults: SearchResults, providedOptions: SearchOptions): Promise<ModuleDescriptor[]>;
|
|
23
|
+
export { apiFindModulesAsync as findModulesAsync, apiResolveExtraBuildDependenciesAsync as resolveExtraBuildDependenciesAsync, apiResolveModulesAsync as resolveModulesAsync, };
|
|
@@ -1,59 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
const
|
|
3
|
+
exports.generatePackageListAsync = exports.generateModulesProviderAsync = exports.getConfiguration = void 0;
|
|
4
|
+
exports.findModulesAsync = apiFindModulesAsync;
|
|
5
|
+
exports.resolveExtraBuildDependenciesAsync = apiResolveExtraBuildDependenciesAsync;
|
|
6
|
+
exports.resolveModulesAsync = apiResolveModulesAsync;
|
|
7
|
+
const autolinkingOptions_1 = require("../commands/autolinkingOptions");
|
|
25
8
|
const findModules_1 = require("./findModules");
|
|
26
|
-
Object.defineProperty(exports, "findModulesAsync", { enumerable: true, get: function () { return findModules_1.findModulesAsync; } });
|
|
27
|
-
const mergeLinkingOptions_1 = require("./mergeLinkingOptions");
|
|
28
|
-
Object.defineProperty(exports, "getProjectPackageJsonPathAsync", { enumerable: true, get: function () { return mergeLinkingOptions_1.getProjectPackageJsonPathAsync; } });
|
|
29
|
-
Object.defineProperty(exports, "mergeLinkingOptionsAsync", { enumerable: true, get: function () { return mergeLinkingOptions_1.mergeLinkingOptionsAsync; } });
|
|
30
9
|
const resolveModules_1 = require("./resolveModules");
|
|
31
|
-
|
|
32
|
-
Object.defineProperty(exports, "resolveModulesAsync", { enumerable: true, get: function () { return resolveModules_1.resolveModulesAsync; } });
|
|
33
|
-
const getConfiguration_1 = require("./getConfiguration");
|
|
10
|
+
var getConfiguration_1 = require("./getConfiguration");
|
|
34
11
|
Object.defineProperty(exports, "getConfiguration", { enumerable: true, get: function () { return getConfiguration_1.getConfiguration; } });
|
|
35
12
|
var generatePackageList_1 = require("./generatePackageList");
|
|
36
13
|
Object.defineProperty(exports, "generateModulesProviderAsync", { enumerable: true, get: function () { return generatePackageList_1.generateModulesProviderAsync; } });
|
|
37
14
|
Object.defineProperty(exports, "generatePackageListAsync", { enumerable: true, get: function () { return generatePackageList_1.generatePackageListAsync; } });
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
15
|
+
/** @deprecated */
|
|
16
|
+
async function apiFindModulesAsync(providedOptions) {
|
|
17
|
+
const autolinkingOptionsLoader = (0, autolinkingOptions_1.createAutolinkingOptionsLoader)(providedOptions);
|
|
18
|
+
return (0, findModules_1.findModulesAsync)({
|
|
19
|
+
appRoot: await autolinkingOptionsLoader.getAppRoot(),
|
|
20
|
+
autolinkingOptions: await autolinkingOptionsLoader.getPlatformOptions(providedOptions.platform),
|
|
21
|
+
});
|
|
43
22
|
}
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const searchResults = await (0, findModules_1.findModulesAsync)(linkOptions);
|
|
51
|
-
return await (0, resolveModules_1.resolveModulesAsync)(searchResults, linkOptions);
|
|
23
|
+
/** @deprecated */
|
|
24
|
+
async function apiResolveExtraBuildDependenciesAsync(providedOptions) {
|
|
25
|
+
return (0, resolveModules_1.resolveExtraBuildDependenciesAsync)({
|
|
26
|
+
commandRoot: providedOptions.projectRoot,
|
|
27
|
+
platform: providedOptions.platform,
|
|
28
|
+
});
|
|
52
29
|
}
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return path_1.default.dirname((0, mergeLinkingOptions_1.getProjectPackageJsonPathSync)(cwd));
|
|
30
|
+
/** @deprecated */
|
|
31
|
+
async function apiResolveModulesAsync(searchResults, providedOptions) {
|
|
32
|
+
const autolinkingOptionsLoader = (0, autolinkingOptions_1.createAutolinkingOptionsLoader)(providedOptions);
|
|
33
|
+
return (0, resolveModules_1.resolveModulesAsync)(searchResults, await autolinkingOptionsLoader.getPlatformOptions(providedOptions.platform));
|
|
58
34
|
}
|
|
59
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/autolinking/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/autolinking/index.ts"],"names":[],"mappings":";;;AAsDyB,+CAAgB;AACE,mFAAkC;AACjD,qDAAmB;AAxD/C,uEAAoG;AAEpG,+CAAiD;AACjD,qDAA2F;AAE3F,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,6DAA+F;AAAtF,mIAAA,4BAA4B,OAAA;AAAE,+HAAA,wBAAwB,OAAA;AAgB/D,kBAAkB;AAClB,KAAK,UAAU,mBAAmB,CAAC,eAA8B;IAC/D,MAAM,wBAAwB,GAAG,IAAA,mDAA8B,EAAC,eAAe,CAAC,CAAC;IACjF,OAAO,IAAA,8BAAgB,EAAC;QACtB,OAAO,EAAE,MAAM,wBAAwB,CAAC,UAAU,EAAE;QACpD,kBAAkB,EAAE,MAAM,wBAAwB,CAAC,kBAAkB,CAAC,eAAe,CAAC,QAAQ,CAAC;KAChG,CAAC,CAAC;AACL,CAAC;AAED,kBAAkB;AAClB,KAAK,UAAU,qCAAqC,CAClD,eAA+B;IAE/B,OAAO,IAAA,mDAAkC,EAAC;QACxC,WAAW,EAAE,eAAe,CAAC,WAAW;QACxC,QAAQ,EAAE,eAAe,CAAC,QAAQ;KACnC,CAAC,CAAC;AACL,CAAC;AAED,kBAAkB;AAClB,KAAK,UAAU,sBAAsB,CACnC,aAA4B,EAC5B,eAA8B;IAE9B,MAAM,wBAAwB,GAAG,IAAA,mDAA8B,EAAC,eAAe,CAAC,CAAC;IACjF,OAAO,IAAA,oCAAmB,EACxB,aAAa,EACb,MAAM,wBAAwB,CAAC,kBAAkB,CAAC,eAAe,CAAC,QAAQ,CAAC,CAC5E,CAAC;AACJ,CAAC","sourcesContent":["import { AutolinkingOptions, createAutolinkingOptionsLoader } from '../commands/autolinkingOptions';\nimport { ExtraDependencies, ModuleDescriptor, SearchResults, SupportedPlatform } from '../types';\nimport { findModulesAsync } from './findModules';\nimport { resolveExtraBuildDependenciesAsync, resolveModulesAsync } from './resolveModules';\n\nexport { getConfiguration } from './getConfiguration';\nexport { generateModulesProviderAsync, generatePackageListAsync } from './generatePackageList';\n\n/** @deprecated */\nexport interface SearchOptions extends Partial<AutolinkingOptions> {\n projectRoot: string;\n platform: SupportedPlatform;\n [extra: string]: unknown;\n}\n\n/** @deprecated */\nexport interface ResolveOptions {\n projectRoot: string;\n platform: SupportedPlatform;\n [extra: string]: unknown;\n}\n\n/** @deprecated */\nasync function apiFindModulesAsync(providedOptions: SearchOptions): Promise<SearchResults> {\n const autolinkingOptionsLoader = createAutolinkingOptionsLoader(providedOptions);\n return findModulesAsync({\n appRoot: await autolinkingOptionsLoader.getAppRoot(),\n autolinkingOptions: await autolinkingOptionsLoader.getPlatformOptions(providedOptions.platform),\n });\n}\n\n/** @deprecated */\nasync function apiResolveExtraBuildDependenciesAsync(\n providedOptions: ResolveOptions\n): Promise<ExtraDependencies> {\n return resolveExtraBuildDependenciesAsync({\n commandRoot: providedOptions.projectRoot,\n platform: providedOptions.platform,\n });\n}\n\n/** @deprecated */\nasync function apiResolveModulesAsync(\n searchResults: SearchResults,\n providedOptions: SearchOptions\n): Promise<ModuleDescriptor[]> {\n const autolinkingOptionsLoader = createAutolinkingOptionsLoader(providedOptions);\n return resolveModulesAsync(\n searchResults,\n await autolinkingOptionsLoader.getPlatformOptions(providedOptions.platform)\n );\n}\n\nexport {\n apiFindModulesAsync as findModulesAsync,\n apiResolveExtraBuildDependenciesAsync as resolveExtraBuildDependenciesAsync,\n apiResolveModulesAsync as resolveModulesAsync,\n};\n"]}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { AutolinkingOptions } from '../commands/autolinkingOptions';
|
|
2
|
+
import type { ExtraDependencies, ModuleDescriptor, SearchResults, SupportedPlatform } from '../types';
|
|
3
|
+
/** Resolves search results to a list of platform-specific configuration. */
|
|
4
|
+
export declare function resolveModulesAsync(searchResults: SearchResults, autolinkingOptions: AutolinkingOptions & {
|
|
5
|
+
platform: SupportedPlatform;
|
|
6
|
+
}): Promise<ModuleDescriptor[]>;
|
|
7
|
+
interface ResolveExtraBuildDependenciesParams {
|
|
8
|
+
commandRoot: string;
|
|
9
|
+
platform: SupportedPlatform;
|
|
10
|
+
}
|
|
11
|
+
/** Resolves the extra build dependencies for the project, such as additional Maven repositories or CocoaPods pods. */
|
|
12
|
+
export declare function resolveExtraBuildDependenciesAsync({ commandRoot, platform, }: ResolveExtraBuildDependenciesParams): Promise<ExtraDependencies>;
|
|
13
|
+
export {};
|
|
@@ -2,31 +2,34 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveModulesAsync = resolveModulesAsync;
|
|
4
4
|
exports.resolveExtraBuildDependenciesAsync = resolveExtraBuildDependenciesAsync;
|
|
5
|
-
const
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const resolvedModule = await platformLinking.resolveModuleAsync(packageName, revision,
|
|
5
|
+
const platforms_1 = require("../platforms");
|
|
6
|
+
/** Resolves search results to a list of platform-specific configuration. */
|
|
7
|
+
async function resolveModulesAsync(searchResults, autolinkingOptions) {
|
|
8
|
+
const platformLinking = (0, platforms_1.getLinkingImplementationForPlatform)(autolinkingOptions.platform);
|
|
9
|
+
// Additional output property for Cocoapods flags
|
|
10
|
+
const extraOutput = { flags: autolinkingOptions.flags };
|
|
11
|
+
const moduleDescriptorList = await Promise.all(Object.entries(searchResults).map(async ([packageName, revision]) => {
|
|
12
|
+
const resolvedModule = await platformLinking.resolveModuleAsync(packageName, revision, extraOutput);
|
|
13
13
|
return resolvedModule
|
|
14
14
|
? {
|
|
15
|
-
packageName,
|
|
16
|
-
packageVersion: revision.version,
|
|
17
15
|
...resolvedModule,
|
|
16
|
+
packageVersion: revision.version,
|
|
17
|
+
packageName: resolvedModule.packageName ?? packageName,
|
|
18
18
|
}
|
|
19
19
|
: null;
|
|
20
|
-
}))
|
|
21
|
-
|
|
20
|
+
}));
|
|
21
|
+
return moduleDescriptorList
|
|
22
|
+
.filter((moduleDescriptor) => moduleDescriptor != null)
|
|
22
23
|
.sort((a, b) => a.packageName.localeCompare(b.packageName));
|
|
23
24
|
}
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
/** Resolves the extra build dependencies for the project, such as additional Maven repositories or CocoaPods pods. */
|
|
26
|
+
async function resolveExtraBuildDependenciesAsync({ commandRoot, platform, }) {
|
|
27
|
+
const platformLinking = (0, platforms_1.getLinkingImplementationForPlatform)(platform);
|
|
28
|
+
const extraDependencies = await platformLinking.resolveExtraBuildDependenciesAsync(
|
|
29
|
+
// NOTE: We assume we must be inside the native folder here
|
|
30
|
+
// The `resolve` command either is invoked in the CWD of `./{android,ios}` or has a `--project-root`
|
|
31
|
+
// that's in the native directory
|
|
32
|
+
commandRoot);
|
|
30
33
|
return extraDependencies ?? [];
|
|
31
34
|
}
|
|
32
35
|
//# sourceMappingURL=resolveModules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveModules.js","sourceRoot":"","sources":["../../src/autolinking/resolveModules.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"resolveModules.js","sourceRoot":"","sources":["../../src/autolinking/resolveModules.ts"],"names":[],"mappings":";;AAUA,kDA4BC;AAQD,gFAYC;AAzDD,4CAAmE;AAQnE,4EAA4E;AACrE,KAAK,UAAU,mBAAmB,CACvC,aAA4B,EAC5B,kBAAwE;IAExE,MAAM,eAAe,GAAG,IAAA,+CAAmC,EAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACzF,iDAAiD;IACjD,MAAM,WAAW,GAAG,EAAE,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAAE,CAAC;IAExD,MAAM,oBAAoB,GAAG,MAAM,OAAO,CAAC,GAAG,CAC5C,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,EAAE;QAClE,MAAM,cAAc,GAAG,MAAM,eAAe,CAAC,kBAAkB,CAC7D,WAAW,EACX,QAAQ,EACR,WAAW,CACZ,CAAC;QACF,OAAO,cAAc;YACnB,CAAC,CAAC;gBACE,GAAG,cAAc;gBACjB,cAAc,EAAE,QAAQ,CAAC,OAAO;gBAChC,WAAW,EAAE,cAAc,CAAC,WAAW,IAAI,WAAW;aACvD;YACH,CAAC,CAAC,IAAI,CAAC;IACX,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,oBAAoB;SACxB,MAAM,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAAC,gBAAgB,IAAI,IAAI,CAAC;SACtD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;AAChE,CAAC;AAOD,sHAAsH;AAC/G,KAAK,UAAU,kCAAkC,CAAC,EACvD,WAAW,EACX,QAAQ,GAC4B;IACpC,MAAM,eAAe,GAAG,IAAA,+CAAmC,EAAC,QAAQ,CAAC,CAAC;IACtE,MAAM,iBAAiB,GAAG,MAAM,eAAe,CAAC,kCAAkC;IAChF,2DAA2D;IAC3D,oGAAoG;IACpG,iCAAiC;IACjC,WAAW,CACZ,CAAC;IACF,OAAO,iBAAiB,IAAI,EAAE,CAAC;AACjC,CAAC","sourcesContent":["import { AutolinkingOptions } from '../commands/autolinkingOptions';\nimport { getLinkingImplementationForPlatform } from '../platforms';\nimport type {\n ExtraDependencies,\n ModuleDescriptor,\n SearchResults,\n SupportedPlatform,\n} from '../types';\n\n/** Resolves search results to a list of platform-specific configuration. */\nexport async function resolveModulesAsync(\n searchResults: SearchResults,\n autolinkingOptions: AutolinkingOptions & { platform: SupportedPlatform }\n): Promise<ModuleDescriptor[]> {\n const platformLinking = getLinkingImplementationForPlatform(autolinkingOptions.platform);\n // Additional output property for Cocoapods flags\n const extraOutput = { flags: autolinkingOptions.flags };\n\n const moduleDescriptorList = await Promise.all(\n Object.entries(searchResults).map(async ([packageName, revision]) => {\n const resolvedModule = await platformLinking.resolveModuleAsync(\n packageName,\n revision,\n extraOutput\n );\n return resolvedModule\n ? {\n ...resolvedModule,\n packageVersion: revision.version,\n packageName: resolvedModule.packageName ?? packageName,\n }\n : null;\n })\n );\n\n return moduleDescriptorList\n .filter((moduleDescriptor) => moduleDescriptor != null)\n .sort((a, b) => a.packageName.localeCompare(b.packageName));\n}\n\ninterface ResolveExtraBuildDependenciesParams {\n commandRoot: string;\n platform: SupportedPlatform;\n}\n\n/** Resolves the extra build dependencies for the project, such as additional Maven repositories or CocoaPods pods. */\nexport async function resolveExtraBuildDependenciesAsync({\n commandRoot,\n platform,\n}: ResolveExtraBuildDependenciesParams): Promise<ExtraDependencies> {\n const platformLinking = getLinkingImplementationForPlatform(platform);\n const extraDependencies = await platformLinking.resolveExtraBuildDependenciesAsync(\n // NOTE: We assume we must be inside the native folder here\n // The `resolve` command either is invoked in the CWD of `./{android,ios}` or has a `--project-root`\n // that's in the native directory\n commandRoot\n );\n return extraDependencies ?? [];\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import commander from 'commander';
|
|
2
|
+
import { SupportedPlatform } from '../types';
|
|
3
|
+
export interface AutolinkingOptions {
|
|
4
|
+
/** Only scan direct "dependencies" of a project for React Native modules, rather than including transitive dependencies.
|
|
5
|
+
* @remarks
|
|
6
|
+
* Before SDK 54, React Native modules would only be linked if they were listed as dependencies
|
|
7
|
+
* of a project. However, in SDK 54+ transitive React Native modules dependencies are also
|
|
8
|
+
* auto-linked, unless this flag is enabled.
|
|
9
|
+
* @defaultValue `false`
|
|
10
|
+
*/
|
|
11
|
+
legacy_shallowReactNativeLinking: boolean;
|
|
12
|
+
/** Extra modules directories to search for native modules.
|
|
13
|
+
* @defaultValue `[]`
|
|
14
|
+
*/
|
|
15
|
+
searchPaths: string[];
|
|
16
|
+
/** Local native modules directory to add to autolinking.
|
|
17
|
+
* @defaultValue `"./modules"`
|
|
18
|
+
*/
|
|
19
|
+
nativeModulesDir: string | null;
|
|
20
|
+
/** Native modules to exclude from autolinking by name.
|
|
21
|
+
* @defaultValue `[]`
|
|
22
|
+
*/
|
|
23
|
+
exclude: string[];
|
|
24
|
+
/** A list of package names to opt out of prebuilt Expo modules (Android-only)
|
|
25
|
+
* @defaultValue `[]`
|
|
26
|
+
*/
|
|
27
|
+
buildFromSource?: string[];
|
|
28
|
+
/** CocoaPods flags to pass to each autolinked pod (Apple/iOS-only)
|
|
29
|
+
* @defaultValue `[]`
|
|
30
|
+
*/
|
|
31
|
+
flags?: Record<string, any>;
|
|
32
|
+
}
|
|
33
|
+
export declare const filterMapSearchPaths: (searchPaths: unknown, basePath: string) => string[] | undefined;
|
|
34
|
+
/** Common commandline arguments for autolinking commands (Not to be confused with `AutolinkingOptions` */
|
|
35
|
+
export interface AutolinkingCommonArguments {
|
|
36
|
+
projectRoot?: string | null;
|
|
37
|
+
searchPaths?: string[] | null;
|
|
38
|
+
exclude?: string[] | null;
|
|
39
|
+
platform?: SupportedPlatform | null;
|
|
40
|
+
}
|
|
41
|
+
export declare function registerAutolinkingArguments(command: commander.Command): commander.Command;
|
|
42
|
+
export interface LinkingOptionsLoader {
|
|
43
|
+
getCommandRoot(): string;
|
|
44
|
+
getAppRoot(): Promise<string>;
|
|
45
|
+
getPlatformOptions<T extends SupportedPlatform | undefined>(platform: T): Promise<AutolinkingOptions & {
|
|
46
|
+
platform: T;
|
|
47
|
+
}>;
|
|
48
|
+
getPlatformOptions(): Promise<AutolinkingOptions>;
|
|
49
|
+
}
|
|
50
|
+
export declare function createAutolinkingOptionsLoader(argumentsOptions?: AutolinkingCommonArguments): LinkingOptionsLoader;
|