@nx/expo 19.8.2 → 19.8.4
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/.eslintrc.json +4 -0
- package/package.json +9 -10
- package/plugins/with-nx-metro.js +4 -4
- package/src/executors/build/build.impl.js +7 -7
- package/src/executors/install/install.impl.js +4 -2
- package/src/executors/install/schema.d.ts +1 -0
- package/src/executors/install/schema.json +5 -0
- package/src/executors/run/run.impl.js +3 -3
- package/src/migrations/update-18-0-0/remove-symlink-target.js +2 -2
- package/src/utils/ensure-node-modules-symlink.js +6 -6
- package/src/utils/pod-install-task.js +4 -4
package/.eslintrc.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/expo",
|
|
3
|
-
"version": "19.8.
|
|
3
|
+
"version": "19.8.4",
|
|
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": [
|
|
@@ -28,22 +28,21 @@
|
|
|
28
28
|
"main": "./index",
|
|
29
29
|
"types": "index.d.ts",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@nx/devkit": "19.8.
|
|
32
|
-
"@nx/eslint": "19.8.
|
|
33
|
-
"@nx/jest": "19.8.
|
|
34
|
-
"@nx/js": "19.8.
|
|
35
|
-
"@nx/react": "19.8.
|
|
36
|
-
"@nx/web": "19.8.
|
|
37
|
-
"@nx/webpack": "19.8.
|
|
31
|
+
"@nx/devkit": "19.8.4",
|
|
32
|
+
"@nx/eslint": "19.8.4",
|
|
33
|
+
"@nx/jest": "19.8.4",
|
|
34
|
+
"@nx/js": "19.8.4",
|
|
35
|
+
"@nx/react": "19.8.4",
|
|
36
|
+
"@nx/web": "19.8.4",
|
|
37
|
+
"@nx/webpack": "19.8.4",
|
|
38
38
|
"enhanced-resolve": "^5.8.3",
|
|
39
|
-
"fs-extra": "^11.1.0",
|
|
40
39
|
"metro-config": "~0.80.4",
|
|
41
40
|
"metro-resolver": "~0.80.4",
|
|
42
41
|
"node-fetch": "^2.6.7",
|
|
43
42
|
"picocolors": "^1.1.0",
|
|
44
43
|
"tsconfig-paths": "^4.1.2",
|
|
45
44
|
"tslib": "^2.3.0",
|
|
46
|
-
"@nrwl/expo": "19.8.
|
|
45
|
+
"@nrwl/expo": "19.8.4"
|
|
47
46
|
},
|
|
48
47
|
"executors": "./executors.json",
|
|
49
48
|
"ng-update": {
|
package/plugins/with-nx-metro.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.withNxMetro = withNxMetro;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const metro_config_1 = require("metro-config");
|
|
6
|
-
const
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const metro_resolver_1 = require("./metro-resolver");
|
|
9
9
|
async function withNxMetro(userConfig, opts = {}) {
|
|
@@ -12,14 +12,14 @@ async function withNxMetro(userConfig, opts = {}) {
|
|
|
12
12
|
process.env.NX_REACT_NATIVE_DEBUG = 'true';
|
|
13
13
|
if (opts.extensions)
|
|
14
14
|
extensions.push(...opts.extensions);
|
|
15
|
-
let watchFolders = (0,
|
|
15
|
+
let watchFolders = (0, node_fs_1.readdirSync)(devkit_1.workspaceRoot)
|
|
16
16
|
.filter((fileName) => !['dist', 'e2e'].includes(fileName) && !fileName.startsWith('.'))
|
|
17
17
|
.map((fileName) => (0, path_1.join)(devkit_1.workspaceRoot, fileName))
|
|
18
|
-
.filter((filePath) => (0,
|
|
18
|
+
.filter((filePath) => (0, node_fs_1.statSync)(filePath).isDirectory());
|
|
19
19
|
if (opts.watchFolders?.length) {
|
|
20
20
|
watchFolders = watchFolders.concat(opts.watchFolders);
|
|
21
21
|
}
|
|
22
|
-
watchFolders = [...new Set(watchFolders)].filter((folder) => (0,
|
|
22
|
+
watchFolders = [...new Set(watchFolders)].filter((folder) => (0, node_fs_1.existsSync)(folder));
|
|
23
23
|
const nxConfig = {
|
|
24
24
|
resolver: {
|
|
25
25
|
resolveRequest: (0, metro_resolver_1.getResolveRequest)(extensions, opts.exportsConditionNames, opts.mainFields),
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = buildExecutor;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const js_1 = require("@nx/js");
|
|
6
|
-
const fs_extra_1 = require("fs-extra");
|
|
7
|
-
const path_1 = require("path");
|
|
8
6
|
const child_process_1 = require("child_process");
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
const path_1 = require("path");
|
|
9
9
|
const resolve_eas_1 = require("../../utils/resolve-eas");
|
|
10
10
|
let childProcess;
|
|
11
11
|
async function* buildExecutor(options, context) {
|
|
@@ -83,7 +83,7 @@ function copyPackageJsonAndLock(packageManager, workspaceRoot, projectRoot) {
|
|
|
83
83
|
const rootPackageJson = (0, devkit_1.readJsonFile)(packageJson);
|
|
84
84
|
// do not copy package.json and lock file if workspaces are enabled
|
|
85
85
|
if ((packageManager === 'pnpm' &&
|
|
86
|
-
(0,
|
|
86
|
+
(0, node_fs_1.existsSync)((0, path_1.resolve)(workspaceRoot, 'pnpm-workspace.yaml'))) ||
|
|
87
87
|
rootPackageJson.workspaces) {
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
@@ -100,15 +100,15 @@ function copyPackageJsonAndLock(packageManager, workspaceRoot, projectRoot) {
|
|
|
100
100
|
projectPackageJson.dependencies = rootPackageJsonDependencies;
|
|
101
101
|
projectPackageJson.devDependencies = rootPackageJsonDevDependencies;
|
|
102
102
|
// Copy dependencies from root package.json to project package.json
|
|
103
|
-
(0,
|
|
103
|
+
(0, devkit_1.writeJsonFile)(packageJsonProject, projectPackageJson);
|
|
104
104
|
// Copy lock file from root to project
|
|
105
|
-
(0,
|
|
105
|
+
(0, node_fs_1.copyFileSync)(lockFile, lockFileProject);
|
|
106
106
|
return () => {
|
|
107
107
|
// Reset project package.json to original state
|
|
108
108
|
projectPackageJson.dependencies = projectPackageJsonDependencies;
|
|
109
109
|
projectPackageJson.devDependencies = projectPackageJsonDevDependencies;
|
|
110
|
-
(0,
|
|
110
|
+
(0, node_fs_1.writeFileSync)(packageJsonProject, JSON.stringify(projectPackageJson, null, 2));
|
|
111
111
|
// Remove lock file from project
|
|
112
|
-
(0,
|
|
112
|
+
(0, node_fs_1.rmSync)(lockFileProject, { recursive: true, force: true });
|
|
113
113
|
};
|
|
114
114
|
}
|
|
@@ -25,8 +25,10 @@ async function installAndUpdatePackageJson(context, options) {
|
|
|
25
25
|
const packages = typeof options.packages === 'string'
|
|
26
26
|
? options.packages.split(',')
|
|
27
27
|
: options.packages ?? [];
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
await installAsync(packages, createInstallOptions({
|
|
29
|
+
fix: options.fix,
|
|
30
|
+
check: options.check,
|
|
31
|
+
}), createInstallOptions({ force: options.force }));
|
|
30
32
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
31
33
|
const workspacePackageJsonPath = (0, path_1.join)(context.root, 'package.json');
|
|
32
34
|
const projectPackageJsonPath = (0, path_1.join)(context.root, projectRoot, 'package.json');
|
|
@@ -29,6 +29,11 @@
|
|
|
29
29
|
"type": "boolean",
|
|
30
30
|
"description": "Automatically update any invalid package versions",
|
|
31
31
|
"default": false
|
|
32
|
+
},
|
|
33
|
+
"force": {
|
|
34
|
+
"type": "boolean",
|
|
35
|
+
"description": "Force the installation of a package, even if it is already installed",
|
|
36
|
+
"default": false
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
39
|
}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = runExecutor;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const path_1 = require("path");
|
|
6
5
|
const child_process_1 = require("child_process");
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
7
|
const os_1 = require("os");
|
|
8
|
-
const
|
|
8
|
+
const path_1 = require("path");
|
|
9
9
|
const prebuild_impl_1 = require("../prebuild/prebuild.impl");
|
|
10
10
|
const pod_install_task_1 = require("../../utils/pod-install-task");
|
|
11
11
|
let childProcess;
|
|
@@ -14,7 +14,7 @@ async function* runExecutor(options, context) {
|
|
|
14
14
|
throw new Error(`The run-ios build requires Mac to run`);
|
|
15
15
|
}
|
|
16
16
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
17
|
-
if (!(0,
|
|
17
|
+
if (!(0, node_fs_1.existsSync)((0, path_1.join)(context.root, projectRoot, options.platform))) {
|
|
18
18
|
await (0, prebuild_impl_1.prebuildAsync)(context.root, projectRoot, {
|
|
19
19
|
install: options.install,
|
|
20
20
|
platform: options.platform,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = update;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
6
|
/**
|
|
7
7
|
* Remove ensure-symlink target.
|
|
8
8
|
* It is going to be supported by react-native version 0.73 by default.
|
|
@@ -13,7 +13,7 @@ async function update(tree) {
|
|
|
13
13
|
if (config.targets?.['ensure-symlink']?.executor === '@nx/expo:ensure-symlink') {
|
|
14
14
|
removeTargets(config.targets, 'ensure-symlink');
|
|
15
15
|
(0, devkit_1.updateProjectConfiguration)(tree, projectName, config);
|
|
16
|
-
(0,
|
|
16
|
+
(0, node_fs_1.rmSync)(`${config.root}/node_modules`, { recursive: true, force: true });
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ensureNodeModulesSymlink = ensureNodeModulesSymlink;
|
|
4
|
-
const
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
5
|
const os_1 = require("os");
|
|
6
|
-
const
|
|
6
|
+
const path_1 = require("path");
|
|
7
7
|
/**
|
|
8
8
|
* This function symlink workspace node_modules folder with app project's node_mdules folder.
|
|
9
9
|
* For yarn and npm, it will symlink the entire node_modules folder.
|
|
@@ -14,14 +14,14 @@ const fs_extra_1 = require("fs-extra");
|
|
|
14
14
|
*/
|
|
15
15
|
function ensureNodeModulesSymlink(workspaceRoot, projectRoot) {
|
|
16
16
|
const worksapceNodeModulesPath = (0, path_1.join)(workspaceRoot, 'node_modules');
|
|
17
|
-
if (!(0,
|
|
17
|
+
if (!(0, node_fs_1.existsSync)(worksapceNodeModulesPath)) {
|
|
18
18
|
throw new Error(`Cannot find ${worksapceNodeModulesPath}`);
|
|
19
19
|
}
|
|
20
20
|
const appNodeModulesPath = (0, path_1.join)(workspaceRoot, projectRoot, 'node_modules');
|
|
21
21
|
// `mklink /D` requires admin privilege in Windows so we need to use junction
|
|
22
22
|
const symlinkType = (0, os_1.platform)() === 'win32' ? 'junction' : 'dir';
|
|
23
|
-
if ((0,
|
|
24
|
-
(0,
|
|
23
|
+
if ((0, node_fs_1.existsSync)(appNodeModulesPath)) {
|
|
24
|
+
(0, node_fs_1.rmSync)(appNodeModulesPath, { recursive: true, force: true });
|
|
25
25
|
}
|
|
26
|
-
(0,
|
|
26
|
+
(0, node_fs_1.symlinkSync)(worksapceNodeModulesPath, appNodeModulesPath, symlinkType);
|
|
27
27
|
}
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.runPodInstall = runPodInstall;
|
|
4
4
|
exports.podInstall = podInstall;
|
|
5
5
|
const child_process_1 = require("child_process");
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
6
7
|
const os_1 = require("os");
|
|
8
|
+
const path_1 = require("path");
|
|
7
9
|
const pc = require("picocolors");
|
|
8
10
|
const devkit_1 = require("@nx/devkit");
|
|
9
|
-
const fs_extra_1 = require("fs-extra");
|
|
10
|
-
const path_1 = require("path");
|
|
11
11
|
const podInstallErrorMessage = `
|
|
12
12
|
Running ${pc.bold('pod install')} failed, see above.
|
|
13
13
|
Do you have CocoaPods (https://cocoapods.org/) installed?
|
|
@@ -33,7 +33,7 @@ function runPodInstall(iosDirectory, install = true, options = {
|
|
|
33
33
|
devkit_1.logger.info('Skipping `pod install` on non-darwin platform');
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
if (!install || !(0,
|
|
36
|
+
if (!install || !(0, node_fs_1.existsSync)((0, path_1.join)(iosDirectory, 'Podfile'))) {
|
|
37
37
|
devkit_1.logger.info('Skipping `pod install`');
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
@@ -47,7 +47,7 @@ function podInstall(iosDirectory, options = {
|
|
|
47
47
|
deployment: false,
|
|
48
48
|
}) {
|
|
49
49
|
try {
|
|
50
|
-
if ((0,
|
|
50
|
+
if ((0, node_fs_1.existsSync)((0, path_1.join)(iosDirectory, '.xcode.env'))) {
|
|
51
51
|
(0, child_process_1.execSync)('touch .xcode.env', {
|
|
52
52
|
cwd: iosDirectory,
|
|
53
53
|
stdio: 'inherit',
|