@expo/prebuild-config 10.0.1 → 10.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.
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getAutolinkedPackagesAsync = getAutolinkedPackagesAsync;
|
|
7
7
|
exports.resolvePackagesList = resolvePackagesList;
|
|
8
8
|
exports.shouldSkipAutoPlugin = shouldSkipAutoPlugin;
|
|
9
|
-
function
|
|
10
|
-
const data = require("
|
|
11
|
-
|
|
9
|
+
function _unstableAutolinkingExports() {
|
|
10
|
+
const data = require("expo/internal/unstable-autolinking-exports");
|
|
11
|
+
_unstableAutolinkingExports = function () {
|
|
12
12
|
return data;
|
|
13
13
|
};
|
|
14
14
|
return data;
|
|
@@ -21,15 +21,13 @@ function _importExpoModulesAutolinking() {
|
|
|
21
21
|
* @returns list of packages ex: `['expo-camera', 'react-native-screens']`
|
|
22
22
|
*/
|
|
23
23
|
async function getAutolinkedPackagesAsync(projectRoot, platforms = ['ios', 'android']) {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
platform
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
})));
|
|
32
|
-
return resolvePackagesList(platformPaths);
|
|
24
|
+
const linker = (0, _unstableAutolinkingExports().makeCachedDependenciesLinker)({
|
|
25
|
+
projectRoot
|
|
26
|
+
});
|
|
27
|
+
const dependenciesPerPlatform = await Promise.all(platforms.map(platform => {
|
|
28
|
+
return (0, _unstableAutolinkingExports().scanExpoModuleResolutionsForPlatform)(linker, platform);
|
|
29
|
+
}));
|
|
30
|
+
return resolvePackagesList(dependenciesPerPlatform);
|
|
33
31
|
}
|
|
34
32
|
function resolvePackagesList(platformPaths) {
|
|
35
33
|
const allPlatformPaths = platformPaths.map(paths => Object.keys(paths)).flat();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAutolinkedPackages.js","names":["
|
|
1
|
+
{"version":3,"file":"getAutolinkedPackages.js","names":["_unstableAutolinkingExports","data","require","getAutolinkedPackagesAsync","projectRoot","platforms","linker","makeCachedDependenciesLinker","dependenciesPerPlatform","Promise","all","map","platform","scanExpoModuleResolutionsForPlatform","resolvePackagesList","platformPaths","allPlatformPaths","paths","Object","keys","flat","uniquePaths","Set","sort","shouldSkipAutoPlugin","config","plugin","Array","isArray","_internal","autolinkedModules","pluginId","isIncluded","includes"],"sources":["../src/getAutolinkedPackages.ts"],"sourcesContent":["import { ModPlatform, StaticPlugin } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport {\n makeCachedDependenciesLinker,\n scanExpoModuleResolutionsForPlatform,\n} from 'expo/internal/unstable-autolinking-exports';\n\n/**\n * Returns a list of packages that are autolinked to a project.\n *\n * @param projectRoot\n * @param platforms platforms to check for\n * @returns list of packages ex: `['expo-camera', 'react-native-screens']`\n */\nexport async function getAutolinkedPackagesAsync(\n projectRoot: string,\n platforms: ModPlatform[] = ['ios', 'android']\n) {\n const linker = makeCachedDependenciesLinker({ projectRoot });\n const dependenciesPerPlatform = await Promise.all(\n platforms.map((platform) => {\n return scanExpoModuleResolutionsForPlatform(linker, platform);\n })\n );\n return resolvePackagesList(dependenciesPerPlatform);\n}\n\nexport function resolvePackagesList(platformPaths: Record<string, any>[]) {\n const allPlatformPaths = platformPaths.map((paths) => Object.keys(paths)).flat();\n\n const uniquePaths = [...new Set(allPlatformPaths)];\n\n return uniquePaths.sort();\n}\n\nexport function shouldSkipAutoPlugin(\n config: Pick<ExpoConfig, '_internal'>,\n plugin: StaticPlugin | string\n) {\n // Hack workaround because expo-dev-client doesn't use expo modules.\n if (plugin === 'expo-dev-client') {\n return false;\n }\n\n // Only perform the check if `autolinkedModules` is defined, otherwise we assume\n // this is a legacy runner which doesn't support autolinking.\n if (Array.isArray(config._internal?.autolinkedModules)) {\n // Resolve the pluginId as a string.\n const pluginId = Array.isArray(plugin) ? plugin[0] : plugin;\n if (typeof pluginId === 'string') {\n // Determine if the autolinked modules list includes our moduleId\n const isIncluded = config._internal!.autolinkedModules.includes(pluginId);\n if (!isIncluded) {\n // If it doesn't then we know that any potential plugin shouldn't be applied automatically.\n return true;\n }\n }\n }\n return false;\n}\n"],"mappings":";;;;;;;;AAEA,SAAAA,4BAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,2BAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeE,0BAA0BA,CAC9CC,WAAmB,EACnBC,SAAwB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,EAC7C;EACA,MAAMC,MAAM,GAAG,IAAAC,0DAA4B,EAAC;IAAEH;EAAY,CAAC,CAAC;EAC5D,MAAMI,uBAAuB,GAAG,MAAMC,OAAO,CAACC,GAAG,CAC/CL,SAAS,CAACM,GAAG,CAAEC,QAAQ,IAAK;IAC1B,OAAO,IAAAC,kEAAoC,EAACP,MAAM,EAAEM,QAAQ,CAAC;EAC/D,CAAC,CACH,CAAC;EACD,OAAOE,mBAAmB,CAACN,uBAAuB,CAAC;AACrD;AAEO,SAASM,mBAAmBA,CAACC,aAAoC,EAAE;EACxE,MAAMC,gBAAgB,GAAGD,aAAa,CAACJ,GAAG,CAAEM,KAAK,IAAKC,MAAM,CAACC,IAAI,CAACF,KAAK,CAAC,CAAC,CAACG,IAAI,CAAC,CAAC;EAEhF,MAAMC,WAAW,GAAG,CAAC,GAAG,IAAIC,GAAG,CAACN,gBAAgB,CAAC,CAAC;EAElD,OAAOK,WAAW,CAACE,IAAI,CAAC,CAAC;AAC3B;AAEO,SAASC,oBAAoBA,CAClCC,MAAqC,EACrCC,MAA6B,EAC7B;EACA;EACA,IAAIA,MAAM,KAAK,iBAAiB,EAAE;IAChC,OAAO,KAAK;EACd;;EAEA;EACA;EACA,IAAIC,KAAK,CAACC,OAAO,CAACH,MAAM,CAACI,SAAS,EAAEC,iBAAiB,CAAC,EAAE;IACtD;IACA,MAAMC,QAAQ,GAAGJ,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC,GAAGA,MAAM,CAAC,CAAC,CAAC,GAAGA,MAAM;IAC3D,IAAI,OAAOK,QAAQ,KAAK,QAAQ,EAAE;MAChC;MACA,MAAMC,UAAU,GAAGP,MAAM,CAACI,SAAS,CAAEC,iBAAiB,CAACG,QAAQ,CAACF,QAAQ,CAAC;MACzE,IAAI,CAACC,UAAU,EAAE;QACf;QACA,OAAO,IAAI;MACb;IACF;EACF;EACA,OAAO,KAAK;AACd","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/prebuild-config",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.2",
|
|
4
4
|
"description": "Get the prebuild config",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,17 +31,20 @@
|
|
|
31
31
|
"files": [
|
|
32
32
|
"build"
|
|
33
33
|
],
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"expo": "*"
|
|
36
|
+
},
|
|
34
37
|
"devDependencies": {
|
|
35
38
|
"@types/debug": "^4.1.5",
|
|
36
39
|
"@types/xml2js": "~0.4.11",
|
|
37
|
-
"expo-module-scripts": "^5.0.
|
|
40
|
+
"expo-module-scripts": "^5.0.2"
|
|
38
41
|
},
|
|
39
42
|
"dependencies": {
|
|
40
|
-
"@expo/config": "~12.0.
|
|
41
|
-
"@expo/config-plugins": "~11.0.
|
|
42
|
-
"@expo/config-types": "^54.0.
|
|
43
|
-
"@expo/image-utils": "^0.8.
|
|
44
|
-
"@expo/json-file": "^10.0.
|
|
43
|
+
"@expo/config": "~12.0.2",
|
|
44
|
+
"@expo/config-plugins": "~11.0.2",
|
|
45
|
+
"@expo/config-types": "^54.0.2",
|
|
46
|
+
"@expo/image-utils": "^0.8.2",
|
|
47
|
+
"@expo/json-file": "^10.0.2",
|
|
45
48
|
"@react-native/normalize-colors": "0.81.0",
|
|
46
49
|
"debug": "^4.3.1",
|
|
47
50
|
"resolve-from": "^5.0.0",
|
|
@@ -51,5 +54,5 @@
|
|
|
51
54
|
"publishConfig": {
|
|
52
55
|
"access": "public"
|
|
53
56
|
},
|
|
54
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "eaa9b645058cf2233fbb27bb21a19bc605c90a88"
|
|
55
58
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type SearchResults = {
|
|
2
|
-
[moduleName: string]: object;
|
|
3
|
-
};
|
|
4
|
-
export type SearchOptions = {
|
|
5
|
-
searchPaths: string[];
|
|
6
|
-
platform: 'ios' | 'android' | 'web';
|
|
7
|
-
silent?: boolean;
|
|
8
|
-
};
|
|
9
|
-
type AutolinkingModule = typeof import('expo-modules-autolinking/exports');
|
|
10
|
-
/**
|
|
11
|
-
* Imports the `expo-modules-autolinking` package installed in the project at the given path.
|
|
12
|
-
*/
|
|
13
|
-
export declare function importExpoModulesAutolinking(projectRoot: string): AutolinkingModule;
|
|
14
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.importExpoModulesAutolinking = importExpoModulesAutolinking;
|
|
7
|
-
function _resolveFrom() {
|
|
8
|
-
const data = _interopRequireDefault(require("resolve-from"));
|
|
9
|
-
_resolveFrom = function () {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
/**
|
|
16
|
-
* Imports the `expo-modules-autolinking` package installed in the project at the given path.
|
|
17
|
-
*/
|
|
18
|
-
function importExpoModulesAutolinking(projectRoot) {
|
|
19
|
-
const autolinking = tryRequireExpoModulesAutolinking(projectRoot);
|
|
20
|
-
assertAutolinkingCompatibility(autolinking);
|
|
21
|
-
return autolinking;
|
|
22
|
-
}
|
|
23
|
-
function tryRequireExpoModulesAutolinking(projectRoot) {
|
|
24
|
-
const expoPackageRoot = _resolveFrom().default.silent(projectRoot, 'expo/package.json');
|
|
25
|
-
const autolinkingExportsPath = _resolveFrom().default.silent(expoPackageRoot ?? projectRoot, 'expo-modules-autolinking/exports');
|
|
26
|
-
if (!autolinkingExportsPath) {
|
|
27
|
-
throw new Error("Cannot find 'expo-modules-autolinking' package in your project, make sure that you have 'expo' package installed");
|
|
28
|
-
}
|
|
29
|
-
return require(autolinkingExportsPath);
|
|
30
|
-
}
|
|
31
|
-
function assertAutolinkingCompatibility(autolinking) {
|
|
32
|
-
if ('resolveSearchPathsAsync' in autolinking && 'findModulesAsync' in autolinking) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
throw new Error("The 'expo-modules-autolinking' package has been found, but it seems to be incompatible with '@expo/prebuild-config'");
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=importExpoModulesAutolinking.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"importExpoModulesAutolinking.js","names":["_resolveFrom","data","_interopRequireDefault","require","e","__esModule","default","importExpoModulesAutolinking","projectRoot","autolinking","tryRequireExpoModulesAutolinking","assertAutolinkingCompatibility","expoPackageRoot","resolveFrom","silent","autolinkingExportsPath","Error"],"sources":["../src/importExpoModulesAutolinking.ts"],"sourcesContent":["import resolveFrom from 'resolve-from';\n\nexport type SearchResults = {\n [moduleName: string]: object;\n};\n\nexport type SearchOptions = {\n searchPaths: string[];\n platform: 'ios' | 'android' | 'web';\n silent?: boolean;\n};\n\ntype AutolinkingModule = typeof import('expo-modules-autolinking/exports');\n\n/**\n * Imports the `expo-modules-autolinking` package installed in the project at the given path.\n */\nexport function importExpoModulesAutolinking(projectRoot: string): AutolinkingModule {\n const autolinking = tryRequireExpoModulesAutolinking(projectRoot);\n assertAutolinkingCompatibility(autolinking);\n return autolinking;\n}\n\nfunction tryRequireExpoModulesAutolinking(projectRoot: string): AutolinkingModule {\n const expoPackageRoot = resolveFrom.silent(projectRoot, 'expo/package.json');\n const autolinkingExportsPath = resolveFrom.silent(\n expoPackageRoot ?? projectRoot,\n 'expo-modules-autolinking/exports'\n );\n if (!autolinkingExportsPath) {\n throw new Error(\n \"Cannot find 'expo-modules-autolinking' package in your project, make sure that you have 'expo' package installed\"\n );\n }\n return require(autolinkingExportsPath);\n}\n\nfunction assertAutolinkingCompatibility(autolinking: AutolinkingModule): void {\n if ('resolveSearchPathsAsync' in autolinking && 'findModulesAsync' in autolinking) {\n return;\n }\n throw new Error(\n \"The 'expo-modules-autolinking' package has been found, but it seems to be incompatible with '@expo/prebuild-config'\"\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,aAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,YAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAuC,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAcvC;AACA;AACA;AACO,SAASG,4BAA4BA,CAACC,WAAmB,EAAqB;EACnF,MAAMC,WAAW,GAAGC,gCAAgC,CAACF,WAAW,CAAC;EACjEG,8BAA8B,CAACF,WAAW,CAAC;EAC3C,OAAOA,WAAW;AACpB;AAEA,SAASC,gCAAgCA,CAACF,WAAmB,EAAqB;EAChF,MAAMI,eAAe,GAAGC,sBAAW,CAACC,MAAM,CAACN,WAAW,EAAE,mBAAmB,CAAC;EAC5E,MAAMO,sBAAsB,GAAGF,sBAAW,CAACC,MAAM,CAC/CF,eAAe,IAAIJ,WAAW,EAC9B,kCACF,CAAC;EACD,IAAI,CAACO,sBAAsB,EAAE;IAC3B,MAAM,IAAIC,KAAK,CACb,kHACF,CAAC;EACH;EACA,OAAOb,OAAO,CAACY,sBAAsB,CAAC;AACxC;AAEA,SAASJ,8BAA8BA,CAACF,WAA8B,EAAQ;EAC5E,IAAI,yBAAyB,IAAIA,WAAW,IAAI,kBAAkB,IAAIA,WAAW,EAAE;IACjF;EACF;EACA,MAAM,IAAIO,KAAK,CACb,qHACF,CAAC;AACH","ignoreList":[]}
|