@nx/expo 23.0.0-beta.18 → 23.0.0-beta.19
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/package.json +8 -8
- package/plugins/plugin.d.ts.map +1 -1
- package/plugins/plugin.js +52 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/expo",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.19",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Expo Plugin for Nx contains executors and generators for managing and developing an expo application within your workspace. For example, you can directly build for different target platforms as well as generate projects and publish your code.",
|
|
6
6
|
"keywords": [
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"type": "commonjs",
|
|
30
30
|
"types": "index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@nx/devkit": "23.0.0-beta.
|
|
33
|
-
"@nx/eslint": "23.0.0-beta.
|
|
34
|
-
"@nx/js": "23.0.0-beta.
|
|
35
|
-
"@nx/react": "23.0.0-beta.
|
|
32
|
+
"@nx/devkit": "23.0.0-beta.19",
|
|
33
|
+
"@nx/eslint": "23.0.0-beta.19",
|
|
34
|
+
"@nx/js": "23.0.0-beta.19",
|
|
35
|
+
"@nx/react": "23.0.0-beta.19",
|
|
36
36
|
"enhanced-resolve": "^5.8.3",
|
|
37
37
|
"picocolors": "^1.1.0",
|
|
38
38
|
"semver": "^7.6.3",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"metro-resolver": ">= 0.82.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"nx": "23.0.0-beta.
|
|
47
|
+
"nx": "23.0.0-beta.19"
|
|
48
48
|
},
|
|
49
49
|
"optionalDependencies": {
|
|
50
|
-
"@nx/detox": "23.0.0-beta.
|
|
51
|
-
"@nx/rollup": "23.0.0-beta.
|
|
50
|
+
"@nx/detox": "23.0.0-beta.19",
|
|
51
|
+
"@nx/rollup": "23.0.0-beta.19"
|
|
52
52
|
},
|
|
53
53
|
"executors": "./executors.json",
|
|
54
54
|
"ng-update": {
|
package/plugins/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../packages/expo/plugins/plugin.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../packages/expo/plugins/plugin.ts"],"names":[],"mappings":"AAMA,OAAO,EAML,aAAa,EAMd,MAAM,YAAY,CAAC;AAQpB,MAAM,WAAW,iBAAiB;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAID,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,iBAAiB,CA2DxD,CAAC;AAEF,eAAO,MAAM,aAAa,kCAAc,CAAC"}
|
package/plugins/plugin.js
CHANGED
|
@@ -18,8 +18,29 @@ exports.createNodes = [
|
|
|
18
18
|
const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
|
|
19
19
|
const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
20
20
|
const lockFileName = (0, js_1.getLockFileName)(packageManager);
|
|
21
|
+
const normalizedOptions = normalizeOptions(options);
|
|
21
22
|
try {
|
|
22
|
-
|
|
23
|
+
const { entries, preErrors } = await filterExpoConfigs(configFiles, context);
|
|
24
|
+
const projectHashes = await (0, internal_1.calculateHashesForCreateNodes)(entries.map((e) => e.projectRoot), normalizedOptions, context, entries.map(() => [lockFileName]));
|
|
25
|
+
let results = [];
|
|
26
|
+
let nodeErrors = [];
|
|
27
|
+
try {
|
|
28
|
+
results = await (0, devkit_1.createNodesFromFiles)((configFile, _, ctx, idx) => createNodesInternal(configFile, normalizedOptions, ctx, targetsCache, pmc, projectHashes[idx]), entries.map((e) => e.configFile), options, context);
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
if (e instanceof devkit_1.AggregateCreateNodesError) {
|
|
32
|
+
results = e.partialResults ?? [];
|
|
33
|
+
nodeErrors = e.errors;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
throw e;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const allErrors = [...preErrors, ...nodeErrors];
|
|
40
|
+
if (allErrors.length > 0) {
|
|
41
|
+
throw new devkit_1.AggregateCreateNodesError(allErrors, results);
|
|
42
|
+
}
|
|
43
|
+
return results;
|
|
23
44
|
}
|
|
24
45
|
finally {
|
|
25
46
|
targetsCache.writeToDisk();
|
|
@@ -27,24 +48,8 @@ exports.createNodes = [
|
|
|
27
48
|
},
|
|
28
49
|
];
|
|
29
50
|
exports.createNodesV2 = exports.createNodes;
|
|
30
|
-
async function createNodesInternal(configFile, options, context, targetsCache, pmc,
|
|
31
|
-
options = normalizeOptions(options);
|
|
51
|
+
async function createNodesInternal(configFile, options, context, targetsCache, pmc, hash) {
|
|
32
52
|
const projectRoot = (0, path_1.dirname)(configFile);
|
|
33
|
-
// Do not create a project if package.json or project.json or metro.config.js isn't there.
|
|
34
|
-
const siblingFiles = (0, fs_1.readdirSync)((0, path_1.join)(context.workspaceRoot, projectRoot));
|
|
35
|
-
if (!siblingFiles.includes('package.json') ||
|
|
36
|
-
!siblingFiles.includes('metro.config.js')) {
|
|
37
|
-
return {};
|
|
38
|
-
}
|
|
39
|
-
// Check if it's an Expo project
|
|
40
|
-
const packageJson = (0, devkit_1.readJsonFile)((0, path_1.join)(context.workspaceRoot, projectRoot, 'package.json'));
|
|
41
|
-
const appConfig = await getAppConfig(configFile, context);
|
|
42
|
-
if (!appConfig.expo &&
|
|
43
|
-
!packageJson.dependencies?.['expo'] &&
|
|
44
|
-
!packageJson.devDependencies?.['expo']) {
|
|
45
|
-
return {};
|
|
46
|
-
}
|
|
47
|
-
const hash = await (0, internal_1.calculateHashForCreateNodes)(projectRoot, options, context, [lockFileName]);
|
|
48
53
|
if (!targetsCache.has(hash)) {
|
|
49
54
|
targetsCache.set(hash, buildExpoTargets(projectRoot, options, context, pmc));
|
|
50
55
|
}
|
|
@@ -107,6 +112,35 @@ function getAppConfig(configFilePath, context) {
|
|
|
107
112
|
const resolvedPath = (0, path_1.join)(context.workspaceRoot, configFilePath);
|
|
108
113
|
return (0, internal_1.loadConfigFile)(resolvedPath);
|
|
109
114
|
}
|
|
115
|
+
async function filterExpoConfigs(configFiles, context) {
|
|
116
|
+
const preErrors = [];
|
|
117
|
+
const candidates = await Promise.all(configFiles.map(async (configFile) => {
|
|
118
|
+
try {
|
|
119
|
+
const projectRoot = (0, path_1.dirname)(configFile);
|
|
120
|
+
const siblingFiles = (0, fs_1.readdirSync)((0, path_1.join)(context.workspaceRoot, projectRoot));
|
|
121
|
+
if (!siblingFiles.includes('package.json') ||
|
|
122
|
+
!siblingFiles.includes('metro.config.js')) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
const packageJson = (0, devkit_1.readJsonFile)((0, path_1.join)(context.workspaceRoot, projectRoot, 'package.json'));
|
|
126
|
+
const appConfig = await getAppConfig(configFile, context);
|
|
127
|
+
if (!appConfig.expo &&
|
|
128
|
+
!packageJson.dependencies?.['expo'] &&
|
|
129
|
+
!packageJson.devDependencies?.['expo']) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
return { configFile, projectRoot };
|
|
133
|
+
}
|
|
134
|
+
catch (e) {
|
|
135
|
+
preErrors.push([configFile, e]);
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
139
|
+
return {
|
|
140
|
+
entries: candidates.filter((c) => c !== null),
|
|
141
|
+
preErrors,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
110
144
|
function getInputs(namedInputs) {
|
|
111
145
|
return [
|
|
112
146
|
...('production' in namedInputs
|