first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import { AutolinkingOptions } from '../commands/autolinkingOptions';
import { type DependencyResolution } from '../dependencies';
import { PackageRevision, SearchResults, SupportedPlatform } from '../types';
export declare function resolveExpoModule(resolution: DependencyResolution, platform: SupportedPlatform, excludeNames: Set<string>): Promise<PackageRevision | null>;
interface FindModulesParams {
appRoot: string;
autolinkingOptions: AutolinkingOptions & {
platform: SupportedPlatform;
};
}
/** Searches for modules to link based on given config. */
export declare function findModulesAsync({ appRoot, autolinkingOptions, }: FindModulesParams): Promise<SearchResults>;
export {};

View File

@@ -0,0 +1,45 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveExpoModule = resolveExpoModule;
exports.findModulesAsync = findModulesAsync;
const ExpoModuleConfig_1 = require("../ExpoModuleConfig");
const dependencies_1 = require("../dependencies");
const memoize_1 = require("../memoize");
async function resolveExpoModule(resolution, platform, excludeNames) {
if (excludeNames.has(resolution.name)) {
return null;
}
const expoModuleConfig = await (0, ExpoModuleConfig_1.discoverExpoModuleConfigAsync)(resolution.path);
if (expoModuleConfig && expoModuleConfig.supportsPlatform(platform)) {
return {
name: resolution.name,
path: resolution.path,
version: resolution.version,
config: expoModuleConfig,
duplicates: resolution.duplicates?.map((duplicate) => ({
name: duplicate.name,
path: duplicate.path,
version: duplicate.version,
})) ?? [],
};
}
else {
return null;
}
}
/** Searches for modules to link based on given config. */
async function findModulesAsync({ appRoot, autolinkingOptions, }) {
const memoizer = (0, memoize_1.createMemoizer)();
const excludeNames = new Set(autolinkingOptions.exclude);
// custom native modules should be resolved first so that they can override other modules
const searchPaths = autolinkingOptions.nativeModulesDir
? [autolinkingOptions.nativeModulesDir, ...autolinkingOptions.searchPaths]
: autolinkingOptions.searchPaths;
return memoizer.withMemoizer(async () => {
return (0, dependencies_1.filterMapResolutionResult)((0, dependencies_1.mergeResolutionResults)(await Promise.all([
...searchPaths.map((searchPath) => (0, dependencies_1.scanDependenciesInSearchPath)(searchPath)),
(0, dependencies_1.scanDependenciesRecursively)(appRoot),
])), (resolution) => resolveExpoModule(resolution, autolinkingOptions.platform, excludeNames));
});
}
//# sourceMappingURL=findModules.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"findModules.js","sourceRoot":"","sources":["../../src/autolinking/findModules.ts"],"names":[],"mappings":";;AAYA,8CAyBC;AAQD,4CAuBC;AApED,0DAAoE;AAEpE,kDAMyB;AACzB,wCAA4C;AAGrC,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,QAAQ,GAAG,IAAA,wBAAc,GAAE,CAAC;IAClC,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,QAAQ,CAAC,YAAY,CAAC,KAAK,IAAI,EAAE;QACtC,OAAO,IAAA,wCAAyB,EAC9B,IAAA,qCAAsB,EACpB,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAA,2CAA4B,EAAC,UAAU,CAAC,CAAC;YAC5E,IAAA,0CAA2B,EAAC,OAAO,CAAC;SACrC,CAAC,CACH,EACD,CAAC,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,UAAU,EAAE,kBAAkB,CAAC,QAAQ,EAAE,YAAY,CAAC,CACzF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,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 { createMemoizer } from '../memoize';\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 memoizer = createMemoizer();\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 memoizer.withMemoizer(async () => {\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}\n"]}

View File

@@ -0,0 +1,10 @@
import { ModuleDescriptor, SupportedPlatform } from '../types';
interface GenerateModulesProviderParams {
platform: SupportedPlatform;
targetPath: string;
entitlementPath: string | null;
}
/** Generates ExpoModulesProvider file listing all packages to link (Apple-only)
*/
export declare function generateModulesProviderAsync(modules: ModuleDescriptor[], params: GenerateModulesProviderParams): Promise<void>;
export {};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateModulesProviderAsync = generateModulesProviderAsync;
const platforms_1 = require("../platforms");
/** Generates ExpoModulesProvider file listing all packages to link (Apple-only)
*/
async function generateModulesProviderAsync(modules, params) {
const platformLinking = (0, platforms_1.getLinkingImplementationForPlatform)(params.platform);
if (!('generateModulesProviderAsync' in platformLinking)) {
throw new Error(`Generating modules provider is not available for platform "${params.platform}"`);
}
await platformLinking.generateModulesProviderAsync(modules, params.targetPath, params.entitlementPath);
}
//# sourceMappingURL=generatePackageList.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"generatePackageList.js","sourceRoot":"","sources":["../../src/autolinking/generatePackageList.ts"],"names":[],"mappings":";;AAWA,oEAeC;AA1BD,4CAAmE;AASnE;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 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"]}

View File

@@ -0,0 +1,9 @@
import { AutolinkingOptions } from '../commands/autolinkingOptions';
import type { SupportedPlatform } from '../types';
interface GetConfigurationParams {
autolinkingOptions: AutolinkingOptions & {
platform: SupportedPlatform;
};
}
export declare function getConfiguration({ autolinkingOptions, }: GetConfigurationParams): Record<string, any> | undefined;
export {};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getConfiguration = getConfiguration;
const platforms_1 = require("../platforms");
function getConfiguration({ autolinkingOptions, }) {
const platformLinking = (0, platforms_1.getLinkingImplementationForPlatform)(autolinkingOptions.platform);
if ('getConfiguration' in platformLinking) {
return platformLinking.getConfiguration(autolinkingOptions);
}
else {
return undefined;
}
}
//# sourceMappingURL=getConfiguration.js.map

View File

@@ -0,0 +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"]}

View File

@@ -0,0 +1,23 @@
import { AutolinkingOptions } from '../commands/autolinkingOptions';
import { ExtraDependencies, ModuleDescriptor, SearchResults, SupportedPlatform } from '../types';
export { getConfiguration } from './getConfiguration';
export { generateModulesProviderAsync } from './generatePackageList';
/** @deprecated */
export interface SearchOptions extends Partial<AutolinkingOptions> {
projectRoot: string;
platform: SupportedPlatform;
[extra: string]: unknown;
}
/** @deprecated */
export interface ResolveOptions {
projectRoot: string;
platform: SupportedPlatform;
[extra: string]: unknown;
}
/** @deprecated */
declare function apiFindModulesAsync(providedOptions: SearchOptions): Promise<SearchResults>;
/** @deprecated */
declare function apiResolveExtraBuildDependenciesAsync(providedOptions: ResolveOptions): Promise<ExtraDependencies>;
/** @deprecated */
declare function apiResolveModulesAsync(searchResults: SearchResults, providedOptions: SearchOptions): Promise<ModuleDescriptor[]>;
export { apiFindModulesAsync as findModulesAsync, apiResolveExtraBuildDependenciesAsync as resolveExtraBuildDependenciesAsync, apiResolveModulesAsync as resolveModulesAsync, };

View File

@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateModulesProviderAsync = exports.getConfiguration = void 0;
exports.findModulesAsync = apiFindModulesAsync;
exports.resolveExtraBuildDependenciesAsync = apiResolveExtraBuildDependenciesAsync;
exports.resolveModulesAsync = apiResolveModulesAsync;
const autolinkingOptions_1 = require("../commands/autolinkingOptions");
const findModules_1 = require("./findModules");
const resolveModules_1 = require("./resolveModules");
var getConfiguration_1 = require("./getConfiguration");
Object.defineProperty(exports, "getConfiguration", { enumerable: true, get: function () { return getConfiguration_1.getConfiguration; } });
var generatePackageList_1 = require("./generatePackageList");
Object.defineProperty(exports, "generateModulesProviderAsync", { enumerable: true, get: function () { return generatePackageList_1.generateModulesProviderAsync; } });
/** @deprecated */
async function apiFindModulesAsync(providedOptions) {
const autolinkingOptionsLoader = (0, autolinkingOptions_1.createAutolinkingOptionsLoader)(providedOptions);
return (0, findModules_1.findModulesAsync)({
appRoot: await autolinkingOptionsLoader.getAppRoot(),
autolinkingOptions: await autolinkingOptionsLoader.getPlatformOptions(providedOptions.platform),
});
}
/** @deprecated */
async function apiResolveExtraBuildDependenciesAsync(providedOptions) {
return (0, resolveModules_1.resolveExtraBuildDependenciesAsync)({
commandRoot: providedOptions.projectRoot,
platform: providedOptions.platform,
});
}
/** @deprecated */
async function apiResolveModulesAsync(searchResults, providedOptions) {
const autolinkingOptionsLoader = (0, autolinkingOptions_1.createAutolinkingOptionsLoader)(providedOptions);
return (0, resolveModules_1.resolveModulesAsync)(searchResults, await autolinkingOptionsLoader.getPlatformOptions(providedOptions.platform));
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +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,6DAAqE;AAA5D,mIAAA,4BAA4B,OAAA;AAgBrC,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 } 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"]}

View File

@@ -0,0 +1,13 @@
import { AutolinkingOptions } from '../commands/autolinkingOptions';
import type { ExtraDependencies, ModuleDescriptor, SearchResults, SupportedPlatform } from '../types';
/** Resolves search results to a list of platform-specific configuration. */
export declare function resolveModulesAsync(searchResults: SearchResults, autolinkingOptions: AutolinkingOptions & {
platform: SupportedPlatform;
}): Promise<ModuleDescriptor[]>;
interface ResolveExtraBuildDependenciesParams {
commandRoot: string;
platform: SupportedPlatform;
}
/** Resolves the extra build dependencies for the project, such as additional Maven repositories or CocoaPods pods. */
export declare function resolveExtraBuildDependenciesAsync({ commandRoot, platform, }: ResolveExtraBuildDependenciesParams): Promise<ExtraDependencies>;
export {};

View File

@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveModulesAsync = resolveModulesAsync;
exports.resolveExtraBuildDependenciesAsync = resolveExtraBuildDependenciesAsync;
const concurrency_1 = require("../concurrency");
const platforms_1 = require("../platforms");
/** Resolves search results to a list of platform-specific configuration. */
async function resolveModulesAsync(searchResults, autolinkingOptions) {
const platformLinking = (0, platforms_1.getLinkingImplementationForPlatform)(autolinkingOptions.platform);
// Additional output property for Cocoapods flags
const extraOutput = { flags: autolinkingOptions.flags };
const moduleDescriptorList = await (0, concurrency_1.taskAll)(Object.entries(searchResults), async ([packageName, revision]) => {
const resolvedModule = await platformLinking.resolveModuleAsync(packageName, revision, extraOutput);
return resolvedModule
? {
...resolvedModule,
packageVersion: revision.version,
packageName: resolvedModule.packageName ?? packageName,
}
: null;
});
return moduleDescriptorList
.filter((moduleDescriptor) => moduleDescriptor != null)
.sort((a, b) => a.packageName.localeCompare(b.packageName));
}
/** Resolves the extra build dependencies for the project, such as additional Maven repositories or CocoaPods pods. */
async function resolveExtraBuildDependenciesAsync({ commandRoot, platform, }) {
const platformLinking = (0, platforms_1.getLinkingImplementationForPlatform)(platform);
const extraDependencies = await platformLinking.resolveExtraBuildDependenciesAsync(
// NOTE: We assume we must be inside the native folder here
// The `resolve` command either is invoked in the CWD of `./{android,ios}` or has a `--project-root`
// that's in the native directory
commandRoot);
return extraDependencies ?? [];
}
//# sourceMappingURL=resolveModules.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"resolveModules.js","sourceRoot":"","sources":["../../src/autolinking/resolveModules.ts"],"names":[],"mappings":";;AAWA,kDA6BC;AAQD,gFAYC;AA3DD,gDAAyC;AACzC,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,IAAA,qBAAO,EACxC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAC7B,KAAK,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,EAAE;QAChC,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,CACF,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 { taskAll } from '../concurrency';\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 taskAll(\n Object.entries(searchResults),\n 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"]}