@nx/expo 16.8.0-beta.4 → 16.8.0-beta.5

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.
Files changed (46) hide show
  1. package/package.json +10 -10
  2. package/plugins/metro-resolver.js +4 -5
  3. package/plugins/with-nx-metro.js +23 -27
  4. package/plugins/with-nx-webpack.js +34 -38
  5. package/src/executors/build/build.impl.js +21 -24
  6. package/src/executors/build-list/build-list.impl.js +14 -17
  7. package/src/executors/download/download.impl.js +46 -48
  8. package/src/executors/ensure-symlink/ensure-symlink.impl.js +4 -7
  9. package/src/executors/export/export.impl.js +12 -15
  10. package/src/executors/install/install.impl.js +13 -16
  11. package/src/executors/prebuild/prebuild.impl.js +17 -20
  12. package/src/executors/run/run.impl.js +25 -28
  13. package/src/executors/start/start.impl.js +15 -18
  14. package/src/executors/submit/submit.impl.js +10 -13
  15. package/src/executors/sync-deps/sync-deps.impl.js +32 -37
  16. package/src/executors/update/update.impl.js +13 -16
  17. package/src/generators/application/application.js +23 -21
  18. package/src/generators/application/lib/add-detox.js +16 -7
  19. package/src/generators/application/lib/add-project.js +1 -1
  20. package/src/generators/application/lib/create-application-files.js +6 -2
  21. package/src/generators/application/lib/normalize-options.js +24 -17
  22. package/src/generators/component/component.js +11 -11
  23. package/src/generators/component/lib/normalize-options.js +36 -37
  24. package/src/generators/init/init.js +27 -24
  25. package/src/generators/init/lib/add-git-ignore-entry.js +1 -2
  26. package/src/generators/library/lib/normalize-options.js +23 -20
  27. package/src/generators/library/library.js +95 -79
  28. package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.js +18 -22
  29. package/src/migrations/update-14-1-2/add-eject-target-14-1-2.js +11 -15
  30. package/src/migrations/update-14-4-3/add-eas-build-target.js +26 -30
  31. package/src/migrations/update-14-5-1/add-eas-update-target.js +12 -16
  32. package/src/migrations/update-15-0-3/add-new-expo-cli-targets.js +44 -48
  33. package/src/migrations/update-15-0-3/change-jest-preset.js +17 -21
  34. package/src/migrations/update-15-8-3/change-webpack-to-metro.js +18 -23
  35. package/src/migrations/update-16-0-0/add-jest-expo.js +15 -19
  36. package/src/migrations/update-16-0-0/remove-deprecated-targets.js +23 -27
  37. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +3 -6
  38. package/src/migrations/update-16-1-4/add-detox-app-json.js +20 -24
  39. package/src/migrations/update-16-1-4/update-eas-scripts.js +9 -7
  40. package/src/migrations/update-16-2-2/add-submit-target.js +12 -16
  41. package/src/migrations/update-16-6-0/add-depends-on.js +11 -15
  42. package/src/migrations/update-16-6-0/update-metro-config.js +11 -15
  43. package/src/utils/add-jest.js +19 -22
  44. package/src/utils/add-linting.js +27 -30
  45. package/src/utils/find-all-npm-dependencies.js +1 -2
  46. package/src/utils/symlink-task.js +1 -1
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  /**
6
5
  * Add new @expo/cli targets:
@@ -9,57 +8,54 @@ const devkit_1 = require("@nx/devkit");
9
8
  * - add target update
10
9
  * - replace target eject
11
10
  */
12
- function update(tree) {
13
- var _a, _b;
14
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
- const projects = (0, devkit_1.getProjects)(tree);
16
- for (const [name, config] of projects.entries()) {
17
- if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a['start']) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/expo:start') {
18
- if (!config.targets['prebuild']) {
19
- config.targets['prebuild'] = {
20
- executor: '@nrwl/expo:prebuild',
21
- options: {},
22
- };
23
- }
24
- if (!config.targets['install']) {
25
- config.targets['install'] = {
26
- executor: '@nrwl/expo:install',
27
- options: {},
28
- };
29
- }
30
- if (!config.targets['update']) {
31
- config.targets['update'] = {
32
- executor: '@nrwl/expo:update',
33
- options: {},
34
- };
35
- }
36
- if (!config.targets['export']) {
37
- config.targets['export'] = {
38
- executor: '@nrwl/expo:export',
39
- options: {
40
- platform: 'all',
41
- outputDir: `${(0, devkit_1.offsetFromRoot)(config.root)}dist/${config.root}`,
42
- },
43
- };
44
- }
45
- if (!config.targets['export-web']) {
46
- config.targets['export-web'] = {
47
- executor: '@nrwl/expo:export',
48
- options: {
49
- bundler: 'webpack',
50
- },
51
- };
52
- }
53
- config.targets['eject'] = {
54
- executor: 'nx:run-commands',
11
+ async function update(tree) {
12
+ const projects = (0, devkit_1.getProjects)(tree);
13
+ for (const [name, config] of projects.entries()) {
14
+ if (config.targets?.['start']?.executor === '@nrwl/expo:start') {
15
+ if (!config.targets['prebuild']) {
16
+ config.targets['prebuild'] = {
17
+ executor: '@nrwl/expo:prebuild',
18
+ options: {},
19
+ };
20
+ }
21
+ if (!config.targets['install']) {
22
+ config.targets['install'] = {
23
+ executor: '@nrwl/expo:install',
24
+ options: {},
25
+ };
26
+ }
27
+ if (!config.targets['update']) {
28
+ config.targets['update'] = {
29
+ executor: '@nrwl/expo:update',
30
+ options: {},
31
+ };
32
+ }
33
+ if (!config.targets['export']) {
34
+ config.targets['export'] = {
35
+ executor: '@nrwl/expo:export',
36
+ options: {
37
+ platform: 'all',
38
+ outputDir: `${(0, devkit_1.offsetFromRoot)(config.root)}dist/${config.root}`,
39
+ },
40
+ };
41
+ }
42
+ if (!config.targets['export-web']) {
43
+ config.targets['export-web'] = {
44
+ executor: '@nrwl/expo:export',
55
45
  options: {
56
- command: `nx prebuild ${name}`,
46
+ bundler: 'webpack',
57
47
  },
58
48
  };
59
49
  }
60
- (0, devkit_1.updateProjectConfiguration)(tree, name, config);
50
+ config.targets['eject'] = {
51
+ executor: 'nx:run-commands',
52
+ options: {
53
+ command: `nx prebuild ${name}`,
54
+ },
55
+ };
61
56
  }
62
- yield (0, devkit_1.formatFiles)(tree);
63
- });
57
+ (0, devkit_1.updateProjectConfiguration)(tree, name, config);
58
+ }
59
+ await (0, devkit_1.formatFiles)(tree);
64
60
  }
65
61
  exports.default = update;
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
6
5
  const jest_1 = require("@nx/jest");
@@ -11,30 +10,27 @@ const path_1 = require("path");
11
10
  * - changes preset from jest-expo to react-native
12
11
  * - change to babel.config.json
13
12
  */
14
- function update(tree) {
15
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
16
- let useJestExpo = false;
17
- (0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nrwl/jest:jest', (options, projectName) => {
18
- if (options.jestConfig && tree.exists(options.jestConfig)) {
19
- const jestConfig = tree.read(options.jestConfig, 'utf-8');
20
- if (jestConfig.includes(`preset: 'jest-expo'`)) {
21
- const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
22
- changePreset(tree, project);
23
- renameBabelJson(tree, project);
24
- useJestExpo = true;
25
- }
13
+ async function update(tree) {
14
+ let useJestExpo = false;
15
+ (0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nrwl/jest:jest', (options, projectName) => {
16
+ if (options.jestConfig && tree.exists(options.jestConfig)) {
17
+ const jestConfig = tree.read(options.jestConfig, 'utf-8');
18
+ if (jestConfig.includes(`preset: 'jest-expo'`)) {
19
+ const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
20
+ changePreset(tree, project);
21
+ renameBabelJson(tree, project);
22
+ useJestExpo = true;
26
23
  }
27
- });
28
- if (useJestExpo) {
29
- removeJestExpoFromPackageJson(tree);
30
24
  }
31
- yield (0, devkit_1.formatFiles)(tree);
32
25
  });
26
+ if (useJestExpo) {
27
+ removeJestExpoFromPackageJson(tree);
28
+ }
29
+ await (0, devkit_1.formatFiles)(tree);
33
30
  }
34
31
  exports.default = update;
35
32
  function changePreset(host, project) {
36
- var _a, _b, _c;
37
- const jestConfigPath = (_c = (_b = (_a = project.targets) === null || _a === void 0 ? void 0 : _a.test) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.jestConfig;
33
+ const jestConfigPath = project.targets?.test?.options?.jestConfig;
38
34
  if (!jestConfigPath || !host.exists(jestConfigPath))
39
35
  return;
40
36
  try {
@@ -43,7 +39,7 @@ function changePreset(host, project) {
43
39
  (0, jest_1.removePropertyFromJestConfig)(host, jestConfigPath, 'preset');
44
40
  (0, jest_1.addPropertyToJestConfig)(host, jestConfigPath, 'preset', 'react-native');
45
41
  }
46
- catch (_d) {
42
+ catch {
47
43
  devkit_1.logger.error((0, devkit_1.stripIndents) `Unable to update ${jestConfigPath} for project ${project.root}.`);
48
44
  }
49
45
  }
@@ -61,7 +57,7 @@ function renameBabelJson(host, project) {
61
57
  host.write(babelJsonPath, buffer);
62
58
  host.delete(babelrcPath);
63
59
  }
64
- catch (_a) {
60
+ catch {
65
61
  devkit_1.logger.error((0, devkit_1.stripIndents) `Unable to rename from ${babelrcPath} to ${babelJsonPath} for project ${project.root}.`);
66
62
  }
67
63
  }
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  /**
6
5
  * Change webpack to metro
@@ -8,29 +7,25 @@ const devkit_1 = require("@nx/devkit");
8
7
  * - delete webpack.config.js
9
8
  * - delete @expo/webpack-config dependency
10
9
  */
11
- function update(tree) {
12
- var _a, _b;
13
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
14
- const projects = (0, devkit_1.getProjects)(tree);
15
- for (const [name, config] of projects.entries()) {
16
- if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a['start']) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/expo:start') {
17
- if (config.targets['web']) {
18
- delete config.targets['web'];
19
- }
20
- if (config.targets['export-web']) {
21
- config.targets['export-web'].options.bundler = 'metro';
22
- }
23
- (0, devkit_1.updateJson)(tree, `${config.root}/app.json`, (appJson) => {
24
- var _a;
25
- if ((_a = appJson.expo) === null || _a === void 0 ? void 0 : _a.web) {
26
- appJson.expo.web.bundler = 'metro';
27
- }
28
- return appJson;
29
- });
10
+ async function update(tree) {
11
+ const projects = (0, devkit_1.getProjects)(tree);
12
+ for (const [name, config] of projects.entries()) {
13
+ if (config.targets?.['start']?.executor === '@nrwl/expo:start') {
14
+ if (config.targets['web']) {
15
+ delete config.targets['web'];
30
16
  }
31
- (0, devkit_1.updateProjectConfiguration)(tree, name, config);
17
+ if (config.targets['export-web']) {
18
+ config.targets['export-web'].options.bundler = 'metro';
19
+ }
20
+ (0, devkit_1.updateJson)(tree, `${config.root}/app.json`, (appJson) => {
21
+ if (appJson.expo?.web) {
22
+ appJson.expo.web.bundler = 'metro';
23
+ }
24
+ return appJson;
25
+ });
32
26
  }
33
- yield (0, devkit_1.formatFiles)(tree);
34
- });
27
+ (0, devkit_1.updateProjectConfiguration)(tree, name, config);
28
+ }
29
+ await (0, devkit_1.formatFiles)(tree);
35
30
  }
36
31
  exports.default = update;
@@ -1,31 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  const jest_1 = require("@nx/jest");
6
5
  /**
7
6
  * Change the preset in expo's jest config
8
7
  * - changes preset of jest.config to jest-expo
9
8
  */
10
- function update(tree) {
11
- var _a, _b, _c, _d, _e, _f, _g;
12
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
13
- const projects = (0, devkit_1.getProjects)(tree);
14
- for (const [name, config] of projects.entries()) {
15
- if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a['start']) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/expo:start' ||
16
- ((_d = (_c = config.targets) === null || _c === void 0 ? void 0 : _c['start']) === null || _d === void 0 ? void 0 : _d.executor) === '@nx/expo:start') {
17
- const jestConfigPath = (_g = (_f = (_e = config.targets) === null || _e === void 0 ? void 0 : _e.test) === null || _f === void 0 ? void 0 : _f.options) === null || _g === void 0 ? void 0 : _g.jestConfig;
18
- if (!jestConfigPath || !tree.exists(jestConfigPath))
19
- return;
20
- try {
21
- (0, jest_1.removePropertyFromJestConfig)(tree, jestConfigPath, 'preset');
22
- (0, jest_1.addPropertyToJestConfig)(tree, jestConfigPath, 'preset', 'jest-expo');
23
- }
24
- catch (_h) {
25
- devkit_1.logger.error((0, devkit_1.stripIndents) `Unable to update ${jestConfigPath} for project ${name}.`);
26
- }
9
+ async function update(tree) {
10
+ const projects = (0, devkit_1.getProjects)(tree);
11
+ for (const [name, config] of projects.entries()) {
12
+ if (config.targets?.['start']?.executor === '@nrwl/expo:start' ||
13
+ config.targets?.['start']?.executor === '@nx/expo:start') {
14
+ const jestConfigPath = config.targets?.test?.options?.jestConfig;
15
+ if (!jestConfigPath || !tree.exists(jestConfigPath))
16
+ return;
17
+ try {
18
+ (0, jest_1.removePropertyFromJestConfig)(tree, jestConfigPath, 'preset');
19
+ (0, jest_1.addPropertyToJestConfig)(tree, jestConfigPath, 'preset', 'jest-expo');
20
+ }
21
+ catch {
22
+ devkit_1.logger.error((0, devkit_1.stripIndents) `Unable to update ${jestConfigPath} for project ${name}.`);
27
23
  }
28
24
  }
29
- });
25
+ }
30
26
  }
31
27
  exports.default = update;
@@ -1,36 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  /**
6
5
  * Remove deprecated @expo/cli targets
7
6
  */
8
- function update(tree) {
9
- var _a, _b, _c, _d;
10
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
11
- const projects = (0, devkit_1.getProjects)(tree);
12
- for (const [name, config] of projects.entries()) {
13
- if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a['start']) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/expo:start' ||
14
- ((_d = (_c = config.targets) === null || _c === void 0 ? void 0 : _c['start']) === null || _d === void 0 ? void 0 : _d.executor) === '@nx/expo:start') {
15
- const targetsToDelete = [
16
- 'build-ios',
17
- 'build-android',
18
- 'build-web',
19
- 'build-status',
20
- 'publish',
21
- 'publish-set',
22
- 'rollback',
23
- 'eject',
24
- ];
25
- targetsToDelete.forEach((target) => {
26
- if (config.targets[target]) {
27
- delete config.targets[target];
28
- }
29
- });
30
- (0, devkit_1.updateProjectConfiguration)(tree, name, config);
31
- }
7
+ async function update(tree) {
8
+ const projects = (0, devkit_1.getProjects)(tree);
9
+ for (const [name, config] of projects.entries()) {
10
+ if (config.targets?.['start']?.executor === '@nrwl/expo:start' ||
11
+ config.targets?.['start']?.executor === '@nx/expo:start') {
12
+ const targetsToDelete = [
13
+ 'build-ios',
14
+ 'build-android',
15
+ 'build-web',
16
+ 'build-status',
17
+ 'publish',
18
+ 'publish-set',
19
+ 'rollback',
20
+ 'eject',
21
+ ];
22
+ targetsToDelete.forEach((target) => {
23
+ if (config.targets[target]) {
24
+ delete config.targets[target];
25
+ }
26
+ });
27
+ (0, devkit_1.updateProjectConfiguration)(tree, name, config);
32
28
  }
33
- yield (0, devkit_1.formatFiles)(tree);
34
- });
29
+ }
30
+ await (0, devkit_1.formatFiles)(tree);
35
31
  }
36
32
  exports.default = update;
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  const replace_package_1 = require("@nx/devkit/src/utils/replace-package");
6
- function replacePackage(tree) {
7
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
- yield (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/expo', '@nx/expo');
9
- yield (0, devkit_1.formatFiles)(tree);
10
- });
5
+ async function replacePackage(tree) {
6
+ await (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/expo', '@nx/expo');
7
+ await (0, devkit_1.formatFiles)(tree);
11
8
  }
12
9
  exports.default = replacePackage;
@@ -1,33 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  /**
6
5
  * Add detox plugin to app.json for expo
7
6
  */
8
- function update(tree) {
9
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
- const projects = (0, devkit_1.getProjects)(tree);
11
- projects.forEach((config) => {
12
- var _a, _b, _c, _d;
13
- if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a['start']) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/expo:start' ||
14
- ((_d = (_c = config.targets) === null || _c === void 0 ? void 0 : _c['start']) === null || _d === void 0 ? void 0 : _d.executor) === '@nx/expo:start') {
15
- (0, devkit_1.updateJson)(tree, `${config.root}/app.json`, (json) => {
16
- if (!json.expo.plugins) {
17
- json.expo.plugins = [];
18
- }
19
- json.expo.plugins.push([
20
- '@config-plugins/detox',
21
- {
22
- skipProguard: false,
23
- subdomains: ['10.0.2.2', 'localhost'],
24
- },
25
- ]);
26
- return json;
27
- });
28
- }
29
- });
30
- yield (0, devkit_1.formatFiles)(tree);
7
+ async function update(tree) {
8
+ const projects = (0, devkit_1.getProjects)(tree);
9
+ projects.forEach((config) => {
10
+ if (config.targets?.['start']?.executor === '@nrwl/expo:start' ||
11
+ config.targets?.['start']?.executor === '@nx/expo:start') {
12
+ (0, devkit_1.updateJson)(tree, `${config.root}/app.json`, (json) => {
13
+ if (!json.expo.plugins) {
14
+ json.expo.plugins = [];
15
+ }
16
+ json.expo.plugins.push([
17
+ '@config-plugins/detox',
18
+ {
19
+ skipProguard: false,
20
+ subdomains: ['10.0.2.2', 'localhost'],
21
+ },
22
+ ]);
23
+ return json;
24
+ });
25
+ }
31
26
  });
27
+ await (0, devkit_1.formatFiles)(tree);
32
28
  }
33
29
  exports.default = update;
@@ -7,7 +7,6 @@ const path_1 = require("path");
7
7
  * Update app's package.json to use eas-build-pre-install and eas-build-post-install scripts.
8
8
  */
9
9
  function update(tree) {
10
- var _a, _b, _c, _d;
11
10
  const projects = (0, devkit_1.getProjects)(tree);
12
11
  const packageManagerLockFile = {
13
12
  npm: 'package-lock.json',
@@ -15,23 +14,26 @@ function update(tree) {
15
14
  pnpm: 'pnpm-lock.yaml',
16
15
  };
17
16
  for (const [name, config] of projects.entries()) {
18
- if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a['start']) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/expo:start' ||
19
- ((_d = (_c = config.targets) === null || _c === void 0 ? void 0 : _c['start']) === null || _d === void 0 ? void 0 : _d.executor) === '@nx/expo:start') {
17
+ if (config.targets?.['start']?.executor === '@nrwl/expo:start' ||
18
+ config.targets?.['start']?.executor === '@nx/expo:start') {
20
19
  try {
21
20
  (0, add_eas_scripts_1.addEasScripts)(tree);
22
21
  (0, devkit_1.updateJson)(tree, (0, path_1.join)(config.root, 'package.json'), (packageJson) => {
23
- var _a;
24
- if ((_a = packageJson.scripts) === null || _a === void 0 ? void 0 : _a['postinstall']) {
22
+ if (packageJson.scripts?.['postinstall']) {
25
23
  delete packageJson.scripts['postinstall'];
26
24
  }
27
25
  const packageManager = (0, devkit_1.detectPackageManager)(tree.root);
28
26
  const packageLockFile = packageManagerLockFile[packageManager];
29
27
  const offset = (0, devkit_1.offsetFromRoot)(config.root);
30
- packageJson.scripts = Object.assign(Object.assign({}, packageJson.scripts), { 'eas-build-pre-install': `cd ${offset} && node tools/scripts/eas-build-pre-install.mjs . ${config.root} && cp ${packageLockFile} ${config.root}`, 'eas-build-post-install': `cd ${offset} && node tools/scripts/eas-build-post-install.mjs . ${config.root}` });
28
+ packageJson.scripts = {
29
+ ...packageJson.scripts,
30
+ 'eas-build-pre-install': `cd ${offset} && node tools/scripts/eas-build-pre-install.mjs . ${config.root} && cp ${packageLockFile} ${config.root}`,
31
+ 'eas-build-post-install': `cd ${offset} && node tools/scripts/eas-build-post-install.mjs . ${config.root}`,
32
+ };
31
33
  return packageJson;
32
34
  });
33
35
  }
34
- catch (_e) {
36
+ catch {
35
37
  devkit_1.logger.error(`Unable to update package.json for project ${name}.`);
36
38
  }
37
39
  }
@@ -1,26 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  /**
6
5
  * Add new submit target
7
6
  */
8
- function update(tree) {
9
- var _a, _b;
10
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
11
- const projects = (0, devkit_1.getProjects)(tree);
12
- for (const [name, config] of projects.entries()) {
13
- if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a['start']) === null || _b === void 0 ? void 0 : _b.executor) === '@nx/expo:start') {
14
- if (!config.targets['submit']) {
15
- config.targets['submit'] = {
16
- executor: '@nx/expo:submit',
17
- options: {},
18
- };
19
- (0, devkit_1.updateProjectConfiguration)(tree, name, config);
20
- }
7
+ async function update(tree) {
8
+ const projects = (0, devkit_1.getProjects)(tree);
9
+ for (const [name, config] of projects.entries()) {
10
+ if (config.targets?.['start']?.executor === '@nx/expo:start') {
11
+ if (!config.targets['submit']) {
12
+ config.targets['submit'] = {
13
+ executor: '@nx/expo:submit',
14
+ options: {},
15
+ };
16
+ (0, devkit_1.updateProjectConfiguration)(tree, name, config);
21
17
  }
22
18
  }
23
- yield (0, devkit_1.formatFiles)(tree);
24
- });
19
+ }
20
+ await (0, devkit_1.formatFiles)(tree);
25
21
  }
26
22
  exports.default = update;
@@ -1,25 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  /**
6
5
  * This migration adds dependsOn to project.json.
7
6
  *
8
7
  */
9
- function update(tree) {
10
- var _a, _b;
11
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
12
- const projects = (0, devkit_1.getProjects)(tree);
13
- for (const [name, config] of projects.entries()) {
14
- if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a['start']) === null || _b === void 0 ? void 0 : _b.executor) === '@nx/expo:start') {
15
- config.targets['start'].dependsOn = ['ensure-symlink', 'sync-deps'];
16
- config.targets['run-ios'].dependsOn = ['ensure-symlink', 'sync-deps'];
17
- config.targets['run-android'].dependsOn = ['ensure-symlink', 'sync-deps'];
18
- config.targets['prebuild'].dependsOn = ['ensure-symlink', 'sync-deps'];
19
- config.targets['export'].dependsOn = ['ensure-symlink', 'sync-deps'];
20
- (0, devkit_1.updateProjectConfiguration)(tree, name, config);
21
- }
8
+ async function update(tree) {
9
+ const projects = (0, devkit_1.getProjects)(tree);
10
+ for (const [name, config] of projects.entries()) {
11
+ if (config.targets?.['start']?.executor === '@nx/expo:start') {
12
+ config.targets['start'].dependsOn = ['ensure-symlink', 'sync-deps'];
13
+ config.targets['run-ios'].dependsOn = ['ensure-symlink', 'sync-deps'];
14
+ config.targets['run-android'].dependsOn = ['ensure-symlink', 'sync-deps'];
15
+ config.targets['prebuild'].dependsOn = ['ensure-symlink', 'sync-deps'];
16
+ config.targets['export'].dependsOn = ['ensure-symlink', 'sync-deps'];
17
+ (0, devkit_1.updateProjectConfiguration)(tree, name, config);
22
18
  }
23
- });
19
+ }
24
20
  }
25
21
  exports.default = update;
@@ -1,28 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  const path_1 = require("path");
6
5
  /**
7
6
  * This migration updates metro.config.js to export config as a default.
8
7
  *
9
8
  */
10
- function update(tree) {
11
- var _a, _b;
12
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
13
- const projects = (0, devkit_1.getProjects)(tree);
14
- for (const [_, config] of projects.entries()) {
15
- if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a['start']) === null || _b === void 0 ? void 0 : _b.executor) === '@nx/expo:start') {
16
- if (tree.exists((0, path_1.join)(config.root, 'metro.config.js'))) {
17
- const oldConfig = tree
18
- .read((0, path_1.join)(config.root, 'metro.config.js'))
19
- .toString();
20
- tree.write((0, path_1.join)(config.root, 'metro-v71.config.js'), oldConfigComment + oldConfig);
21
- tree.write((0, path_1.join)(config.root, 'metro.config.js'), content);
22
- }
9
+ async function update(tree) {
10
+ const projects = (0, devkit_1.getProjects)(tree);
11
+ for (const [_, config] of projects.entries()) {
12
+ if (config.targets?.['start']?.executor === '@nx/expo:start') {
13
+ if (tree.exists((0, path_1.join)(config.root, 'metro.config.js'))) {
14
+ const oldConfig = tree
15
+ .read((0, path_1.join)(config.root, 'metro.config.js'))
16
+ .toString();
17
+ tree.write((0, path_1.join)(config.root, 'metro-v71.config.js'), oldConfigComment + oldConfig);
18
+ tree.write((0, path_1.join)(config.root, 'metro.config.js'), content);
23
19
  }
24
20
  }
25
- });
21
+ }
26
22
  }
27
23
  exports.default = update;
28
24
  const oldConfigComment = `/**