@nx/expo 16.6.0-beta.3 → 16.6.0-beta.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.
Files changed (31) hide show
  1. package/migrations.json +73 -0
  2. package/package.json +15 -12
  3. package/plugins/with-nx-metro.d.ts +5 -1
  4. package/plugins/with-nx-metro.js +27 -21
  5. package/plugins/with-nx-webpack.d.ts +1 -1
  6. package/plugins/with-nx-webpack.js +1 -1
  7. package/src/executors/build/build.impl.js +7 -7
  8. package/src/executors/build/schema.json +2 -1
  9. package/src/executors/build-list/build-list.impl.js +2 -2
  10. package/src/executors/download/download.impl.d.ts +1 -0
  11. package/src/executors/download/download.impl.js +1 -0
  12. package/src/executors/export/export.impl.js +2 -4
  13. package/src/executors/install/install.impl.js +1 -2
  14. package/src/executors/prebuild/prebuild.impl.js +2 -2
  15. package/src/executors/run/run.impl.js +4 -9
  16. package/src/executors/run/schema.d.ts +3 -0
  17. package/src/executors/run/schema.json +1 -0
  18. package/src/executors/start/schema.d.ts +3 -1
  19. package/src/executors/start/schema.json +1 -0
  20. package/src/executors/start/start.impl.js +1 -7
  21. package/src/executors/submit/submit.impl.js +2 -4
  22. package/src/executors/update/update.impl.js +1 -1
  23. package/src/generators/application/files/metro.config.js.template +32 -20
  24. package/src/generators/application/files/package.json.template +1 -0
  25. package/src/generators/application/lib/add-project.js +8 -0
  26. package/src/migrations/update-16-6-0/add-depends-on.d.ts +6 -0
  27. package/src/migrations/update-16-6-0/add-depends-on.js +25 -0
  28. package/src/migrations/update-16-6-0/update-metro-config.d.ts +6 -0
  29. package/src/migrations/update-16-6-0/update-metro-config.js +73 -0
  30. package/src/utils/versions.d.ts +13 -14
  31. package/src/utils/versions.js +14 -15
package/migrations.json CHANGED
@@ -65,6 +65,18 @@
65
65
  "cli": "nx",
66
66
  "description": "Add app.json for detox",
67
67
  "factory": "./src/migrations/update-16-1-4/add-detox-app-json"
68
+ },
69
+ "update-16-6-0-add-dependsOn": {
70
+ "cli": "nx",
71
+ "version": "16.6.0-beta.0",
72
+ "description": "Add dependsOn like ensure-symlink or sync-deps to targets",
73
+ "implementation": "./src/migrations/update-16-6-0/add-depends-on"
74
+ },
75
+ "update-16-6-0-update-metro-config": {
76
+ "cli": "nx",
77
+ "version": "16.6.0-beta.0",
78
+ "description": "Update metro.config.js to use the new metro config format",
79
+ "implementation": "./src/migrations/update-16-6-0/update-metro-config"
68
80
  }
69
81
  },
70
82
  "packageJsonUpdates": {
@@ -855,6 +867,67 @@
855
867
  "alwaysAddToPackageJson": false
856
868
  }
857
869
  }
870
+ },
871
+ "16.6.0": {
872
+ "version": "16.6.0-beta.0",
873
+ "packages": {
874
+ "expo": {
875
+ "version": "^49.0.3",
876
+ "alwaysAddToPackageJson": false
877
+ },
878
+ "@expo/metro-config": {
879
+ "version": "~0.10.6",
880
+ "alwaysAddToPackageJson": false
881
+ },
882
+ "expo-splash-screen": {
883
+ "version": "~0.20.4",
884
+ "alwaysAddToPackageJson": false
885
+ },
886
+ "expo-status-bar": {
887
+ "version": "~1.6.0",
888
+ "alwaysAddToPackageJson": false
889
+ },
890
+ "@expo/cli": {
891
+ "version": "~0.10.10",
892
+ "alwaysAddToPackageJson": false
893
+ },
894
+ "eas-cli": {
895
+ "version": "~3.15.0",
896
+ "alwaysAddToPackageJson": false
897
+ },
898
+ "babel-preset-expo": {
899
+ "version": "~9.5.0",
900
+ "alwaysAddToPackageJson": false
901
+ },
902
+ "jest-expo": {
903
+ "version": "~49.0.0",
904
+ "alwaysAddToPackageJson": false
905
+ },
906
+ "metro-resolver": {
907
+ "version": "0.76.7",
908
+ "alwaysAddToPackageJson": false
909
+ },
910
+ "metro": {
911
+ "version": "0.76.7",
912
+ "alwaysAddToPackageJson": false
913
+ },
914
+ "react-native": {
915
+ "version": "0.72.3",
916
+ "alwaysAddToPackageJson": false
917
+ },
918
+ "@types/react-native": {
919
+ "version": "0.72.2",
920
+ "alwaysAddToPackageJson": false
921
+ },
922
+ "react-native-web": {
923
+ "version": "~0.19.6",
924
+ "alwaysAddToPackageJson": false
925
+ },
926
+ "react-native-svg": {
927
+ "version": "13.9.0",
928
+ "alwaysAddToPackageJson": false
929
+ }
930
+ }
858
931
  }
859
932
  }
860
933
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/expo",
3
- "version": "16.6.0-beta.3",
3
+ "version": "16.6.0-beta.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": [
@@ -26,25 +26,28 @@
26
26
  "main": "./index",
27
27
  "types": "index.d.ts",
28
28
  "dependencies": {
29
- "@nrwl/expo": "16.6.0-beta.3",
30
- "@nx/detox": "16.6.0-beta.3",
31
- "@nx/devkit": "16.6.0-beta.3",
32
- "@nx/jest": "16.6.0-beta.3",
33
- "@nx/js": "16.6.0-beta.3",
34
- "@nx/linter": "16.6.0-beta.3",
35
- "@nx/react": "16.6.0-beta.3",
36
- "@nx/webpack": "16.6.0-beta.3",
29
+ "@nrwl/expo": "16.6.0-beta.4",
30
+ "@nx/detox": "16.6.0-beta.4",
31
+ "@nx/devkit": "16.6.0-beta.4",
32
+ "@nx/jest": "16.6.0-beta.4",
33
+ "@nx/js": "16.6.0-beta.4",
34
+ "@nx/linter": "16.6.0-beta.4",
35
+ "@nx/react": "16.6.0-beta.4",
36
+ "@nx/webpack": "16.6.0-beta.4",
37
37
  "chalk": "^4.1.0",
38
38
  "enhanced-resolve": "^5.8.3",
39
39
  "fs-extra": "^11.1.0",
40
- "metro-resolver": "^0.74.1",
40
+ "metro-config": "0.76.7",
41
+ "metro-resolver": "0.76.7",
41
42
  "node-fetch": "^2.6.7",
42
43
  "tar-fs": "^2.1.1",
43
44
  "tsconfig-paths": "^4.1.2",
44
45
  "tsconfig-paths-webpack-plugin": "^4.0.0"
45
46
  },
46
47
  "peerDependencies": {
47
- "expo": "^48.0.19"
48
+ "@expo/cli": ">= 0.10.0",
49
+ "eas-cli": ">= 3.15.0",
50
+ "expo": ">= 49.0.0"
48
51
  },
49
52
  "builders": "./executors.json",
50
53
  "ng-update": {
@@ -55,5 +58,5 @@
55
58
  "publishConfig": {
56
59
  "access": "public"
57
60
  },
58
- "gitHead": "cd8c61d7a3b8ab9bc7bab068f5ca49bbf14abbf5"
61
+ "gitHead": "b1a9ae7ce76697019b26ec9a172005840cca8da6"
59
62
  }
@@ -1,8 +1,12 @@
1
+ import type { MetroConfig } from 'metro-config';
1
2
  interface WithNxOptions {
2
3
  debug?: boolean;
3
4
  extensions?: string[];
5
+ /**
6
+ * @deprecated TODO(v17) in the metro.config.js, pass in to the getDefaultConfig instead: getDefaultConfig(__dirname)
7
+ */
4
8
  projectRoot?: string;
5
9
  watchFolders?: string[];
6
10
  }
7
- export declare function withNxMetro(config: any, opts?: WithNxOptions): any;
11
+ export declare function withNxMetro(userConfig: MetroConfig, opts?: WithNxOptions): Promise<import("metro-config").ConfigT>;
8
12
  export {};
@@ -1,31 +1,37 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withNxMetro = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const devkit_1 = require("@nx/devkit");
6
+ const metro_config_1 = require("metro-config");
5
7
  const path_1 = require("path");
6
8
  const fs_extra_1 = require("fs-extra");
7
9
  const metro_resolver_1 = require("./metro-resolver");
8
- function withNxMetro(config, opts = {}) {
10
+ function withNxMetro(userConfig, opts = {}) {
9
11
  var _a;
10
- const extensions = ['', 'ts', 'tsx', 'js', 'jsx', 'json'];
11
- if (opts.debug)
12
- process.env.NX_REACT_NATIVE_DEBUG = 'true';
13
- if (opts.extensions)
14
- extensions.push(...opts.extensions);
15
- config.projectRoot = opts.projectRoot || devkit_1.workspaceRoot;
16
- // Add support for paths specified by tsconfig
17
- config.resolver = Object.assign(Object.assign({}, config.resolver), { resolveRequest: (0, metro_resolver_1.getResolveRequest)(extensions) });
18
- let watchFolders = config.watchFolders || [];
19
- watchFolders = watchFolders.concat([
20
- (0, path_1.join)(devkit_1.workspaceRoot, 'node_modules'),
21
- (0, path_1.join)(devkit_1.workspaceRoot, (0, devkit_1.workspaceLayout)().libsDir),
22
- (0, path_1.join)(devkit_1.workspaceRoot, 'packages'),
23
- ]);
24
- if ((_a = opts.watchFolders) === null || _a === void 0 ? void 0 : _a.length) {
25
- watchFolders = watchFolders.concat(opts.watchFolders);
26
- }
27
- watchFolders = watchFolders.filter((folder) => (0, fs_extra_1.existsSync)(folder));
28
- config.watchFolders = watchFolders;
29
- return config;
12
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
13
+ const extensions = ['', 'ts', 'tsx', 'js', 'jsx', 'json'];
14
+ if (opts.debug)
15
+ process.env.NX_REACT_NATIVE_DEBUG = 'true';
16
+ if (opts.extensions)
17
+ extensions.push(...opts.extensions);
18
+ let watchFolders = [
19
+ (0, path_1.join)(devkit_1.workspaceRoot, 'node_modules'),
20
+ (0, path_1.join)(devkit_1.workspaceRoot, (0, devkit_1.workspaceLayout)().libsDir),
21
+ (0, path_1.join)(devkit_1.workspaceRoot, 'packages'),
22
+ (0, path_1.join)(devkit_1.workspaceRoot, '.storybook'),
23
+ ];
24
+ if ((_a = opts.watchFolders) === null || _a === void 0 ? void 0 : _a.length) {
25
+ watchFolders = watchFolders.concat(opts.watchFolders);
26
+ }
27
+ watchFolders = watchFolders.filter((folder) => (0, fs_extra_1.existsSync)(folder));
28
+ const nxConfig = {
29
+ resolver: {
30
+ resolveRequest: (0, metro_resolver_1.getResolveRequest)(extensions),
31
+ },
32
+ watchFolders,
33
+ };
34
+ return (0, metro_config_1.mergeConfig)(userConfig, nxConfig);
35
+ });
30
36
  }
31
37
  exports.withNxMetro = withNxMetro;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @deprecated use bundler: 'metro' instead, will be removed in 16.0.0
2
+ * @deprecated TODO(v17) use bundler: 'metro' instead, will be removed in 16.0.0
3
3
  * This function add additional rules to expo's webpack config to make expo web working
4
4
  */
5
5
  export declare function withNxWebpack(config: any): Promise<any>;
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const tsconfig_paths_webpack_plugin_1 = require("tsconfig-paths-webpack-plugin");
6
6
  const path_1 = require("path");
7
7
  /**
8
- * @deprecated use bundler: 'metro' instead, will be removed in 16.0.0
8
+ * @deprecated TODO(v17) use bundler: 'metro' instead, will be removed in 16.0.0
9
9
  * This function add additional rules to expo's webpack config to make expo web working
10
10
  */
11
11
  function withNxWebpack(config) {
@@ -4,25 +4,25 @@ const tslib_1 = require("tslib");
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const path_1 = require("path");
6
6
  const child_process_1 = require("child_process");
7
- const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
8
7
  const download_impl_1 = require("../download/download.impl");
9
8
  const fs_extra_1 = require("fs-extra");
10
9
  let childProcess;
11
10
  function buildExecutor(options, context) {
12
11
  return tslib_1.__asyncGenerator(this, arguments, function* buildExecutor_1() {
13
12
  const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
14
- (0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
15
13
  try {
16
14
  // remove the output app if it already existed
17
15
  if (options.local && options.output) {
18
16
  (0, fs_extra_1.removeSync)(options.output);
17
+ if (options.output.endsWith('.tar.gz')) {
18
+ // remove unzipped app if it already existed
19
+ (0, fs_extra_1.removeSync)(options.output.replace('.tar.gz', '.app'));
20
+ }
19
21
  }
20
22
  yield tslib_1.__await(runCliBuild(context.root, projectRoot, options));
21
23
  // unzip the build if it's a tar.gz
22
24
  if (options.local && options.output && options.output.endsWith('.tar.gz')) {
23
- const directoryPath = (0, path_1.normalize)(options.output).split(path_1.sep);
24
- directoryPath.pop();
25
- const outputDirectory = directoryPath.join(path_1.sep);
25
+ const outputDirectory = (0, path_1.dirname)(options.output);
26
26
  yield tslib_1.__await((0, download_impl_1.unzipBuild)(options.output, outputDirectory));
27
27
  }
28
28
  yield yield tslib_1.__await({ success: true });
@@ -37,8 +37,8 @@ function buildExecutor(options, context) {
37
37
  exports.default = buildExecutor;
38
38
  function runCliBuild(workspaceRoot, projectRoot, options) {
39
39
  return new Promise((resolve, reject) => {
40
- childProcess = (0, child_process_1.fork)((0, path_1.join)(workspaceRoot, './node_modules/eas-cli/bin/run'), ['build', ...createBuildOptions(options)], {
41
- cwd: (0, path_1.join)(workspaceRoot, projectRoot),
40
+ childProcess = (0, child_process_1.fork)(require.resolve('eas-cli/bin/run'), ['build', ...createBuildOptions(options)], {
41
+ cwd: (0, path_1.resolve)(workspaceRoot, projectRoot),
42
42
  env: process.env,
43
43
  });
44
44
  // Ensure the child process is killed when the parent exits
@@ -55,7 +55,8 @@
55
55
  },
56
56
  "output": {
57
57
  "type": "string",
58
- "description": "Output path for local build"
58
+ "description": "Output path for local build",
59
+ "examples": ["../../dist/MyApp.tar.gz", "../../dist"]
59
60
  },
60
61
  "wait": {
61
62
  "type": "boolean",
@@ -29,8 +29,8 @@ function buildListExecutor(options, context) {
29
29
  exports.default = buildListExecutor;
30
30
  function runCliBuildList(workspaceRoot, projectRoot, options) {
31
31
  return new Promise((resolve, reject) => {
32
- childProcess = (0, child_process_1.fork)((0, path_1.join)(workspaceRoot, './node_modules/eas-cli/bin/run'), ['build:list', ...createBuildListOptions(options)], {
33
- cwd: (0, path_1.join)(workspaceRoot, projectRoot),
32
+ childProcess = (0, child_process_1.fork)(require.resolve('eas-cli/bin/run'), ['build:list', ...createBuildListOptions(options)], {
33
+ cwd: (0, path_1.resolve)(workspaceRoot, projectRoot),
34
34
  env: process.env,
35
35
  stdio: ['inherit', 'pipe', 'inherit', 'ipc'], // only stream stdout on child process
36
36
  });
@@ -5,6 +5,7 @@ export interface ReactNativeDownloadOutput {
5
5
  success: boolean;
6
6
  }
7
7
  /**
8
+ * @deprecated TODO(v17) this executor is to be removed in NX 17. It is no longer used.
8
9
  * This executor downloads the latest EAS build.
9
10
  * It calls the build list executor to list EAS builds with options passed in.
10
11
  */
@@ -15,6 +15,7 @@ const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-s
15
15
  const build_list_impl_1 = require("../build-list/build-list.impl");
16
16
  const streamPipeline = (0, util_1.promisify)(stream_1.pipeline);
17
17
  /**
18
+ * @deprecated TODO(v17) this executor is to be removed in NX 17. It is no longer used.
18
19
  * This executor downloads the latest EAS build.
19
20
  * It calls the build list executor to list EAS builds with options passed in.
20
21
  */
@@ -4,12 +4,10 @@ const tslib_1 = require("tslib");
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const child_process_1 = require("child_process");
6
6
  const path_1 = require("path");
7
- const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
8
7
  let childProcess;
9
8
  function exportExecutor(options, context) {
10
9
  return tslib_1.__asyncGenerator(this, arguments, function* exportExecutor_1() {
11
10
  const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
12
- (0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
13
11
  try {
14
12
  yield tslib_1.__await(exportAsync(context.root, projectRoot, options));
15
13
  yield yield tslib_1.__await({
@@ -26,11 +24,11 @@ function exportExecutor(options, context) {
26
24
  exports.default = exportExecutor;
27
25
  function exportAsync(workspaceRoot, projectRoot, options) {
28
26
  return new Promise((resolve, reject) => {
29
- childProcess = (0, child_process_1.fork)((0, path_1.join)(workspaceRoot, './node_modules/@expo/cli/build/bin/cli'), [
27
+ childProcess = (0, child_process_1.fork)(require.resolve('@expo/cli/build/bin/cli'), [
30
28
  `export${options.bundler === 'webpack' ? ':web' : ''}`,
31
29
  '.',
32
30
  ...createExportOptions(options),
33
- ], { cwd: (0, path_1.join)(workspaceRoot, projectRoot), env: process.env });
31
+ ], { cwd: (0, path_1.resolve)(workspaceRoot, projectRoot), env: process.env });
34
32
  // Ensure the child process is killed when the parent exits
35
33
  process.on('exit', () => childProcess.kill());
36
34
  process.on('SIGTERM', () => childProcess.kill());
@@ -4,7 +4,6 @@ exports.installAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  const child_process_1 = require("child_process");
7
- const path_1 = require("path");
8
7
  const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
9
8
  let childProcess;
10
9
  function installExecutor(options, context) {
@@ -27,7 +26,7 @@ function installExecutor(options, context) {
27
26
  exports.default = installExecutor;
28
27
  function installAsync(workspaceRoot, options) {
29
28
  return new Promise((resolve, reject) => {
30
- childProcess = (0, child_process_1.fork)((0, path_1.join)(workspaceRoot, './node_modules/@expo/cli/build/bin/cli'), ['install', ...createInstallOptions(options)], { cwd: workspaceRoot, env: process.env });
29
+ childProcess = (0, child_process_1.fork)(require.resolve('@expo/cli/build/bin/cli'), ['install', ...createInstallOptions(options)], { cwd: workspaceRoot, env: process.env });
31
30
  // Ensure the child process is killed when the parent exits
32
31
  process.on('exit', () => childProcess.kill());
33
32
  process.on('SIGTERM', () => childProcess.kill());
@@ -18,7 +18,7 @@ function prebuildExecutor(options, context) {
18
18
  if (options.install) {
19
19
  yield tslib_1.__await((0, install_impl_1.installAsync)(context.root, {}));
20
20
  if (options.platform === 'ios') {
21
- yield tslib_1.__await((0, pod_install_task_1.podInstall)((0, path_1.join)(context.root, projectRoot, 'ios')));
21
+ (0, pod_install_task_1.podInstall)((0, path_1.join)(context.root, projectRoot, 'ios'));
22
22
  }
23
23
  }
24
24
  yield yield tslib_1.__await({
@@ -35,7 +35,7 @@ function prebuildExecutor(options, context) {
35
35
  exports.default = prebuildExecutor;
36
36
  function prebuildAsync(workspaceRoot, projectRoot, options) {
37
37
  return new Promise((resolve, reject) => {
38
- childProcess = (0, child_process_1.fork)((0, path_1.join)(workspaceRoot, './node_modules/@expo/cli/build/bin/cli'), ['prebuild', ...createPrebuildOptions(options), '--no-install'], { cwd: (0, path_1.join)(workspaceRoot, projectRoot), env: process.env });
38
+ childProcess = (0, child_process_1.fork)(require.resolve('@expo/cli/build/bin/cli'), ['prebuild', ...createPrebuildOptions(options), '--no-install'], { cwd: (0, path_1.join)(workspaceRoot, projectRoot), env: process.env });
39
39
  // Ensure the child process is killed when the parent exits
40
40
  process.on('exit', () => childProcess.kill());
41
41
  process.on('SIGTERM', () => childProcess.kill());
@@ -6,8 +6,6 @@ const path_1 = require("path");
6
6
  const child_process_1 = require("child_process");
7
7
  const os_1 = require("os");
8
8
  const fs_extra_1 = require("fs-extra");
9
- const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
10
- const sync_deps_impl_1 = require("../sync-deps/sync-deps.impl");
11
9
  const prebuild_impl_1 = require("../prebuild/prebuild.impl");
12
10
  const pod_install_task_1 = require("../../utils/pod-install-task");
13
11
  const install_impl_1 = require("../install/install.impl");
@@ -18,10 +16,6 @@ function runExecutor(options, context) {
18
16
  throw new Error(`The run-ios build requires Mac to run`);
19
17
  }
20
18
  const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
21
- (0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
22
- if (options.sync) {
23
- (0, sync_deps_impl_1.displayNewlyAddedDepsMessage)(context.projectName, yield tslib_1.__await((0, sync_deps_impl_1.syncDeps)(context.projectName, projectRoot, context.root, context.projectGraph)));
24
- }
25
19
  if (!(0, fs_extra_1.existsSync)((0, path_1.join)(context.root, projectRoot, options.platform))) {
26
20
  yield tslib_1.__await((0, prebuild_impl_1.prebuildAsync)(context.root, projectRoot, {
27
21
  install: options.install,
@@ -32,7 +26,7 @@ function runExecutor(options, context) {
32
26
  if (options.install) {
33
27
  yield tslib_1.__await((0, install_impl_1.installAsync)(context.root, {}));
34
28
  if (options.platform === 'ios') {
35
- yield tslib_1.__await((0, pod_install_task_1.podInstall)((0, path_1.join)(context.root, projectRoot, 'ios')));
29
+ (0, pod_install_task_1.podInstall)((0, path_1.join)(context.root, projectRoot, 'ios'));
36
30
  }
37
31
  }
38
32
  try {
@@ -49,9 +43,10 @@ function runExecutor(options, context) {
49
43
  exports.default = runExecutor;
50
44
  function runCliRun(workspaceRoot, projectRoot, options) {
51
45
  return new Promise((resolve, reject) => {
52
- childProcess = (0, child_process_1.fork)((0, path_1.join)(workspaceRoot, './node_modules/@expo/cli/build/bin/cli'), ['run:' + options.platform, ...createRunOptions(options), '--no-install'], // pass in no-install to prevent node_modules install
46
+ childProcess = (0, child_process_1.fork)(require.resolve('@expo/cli/build/bin/cli'), ['run:' + options.platform, ...createRunOptions(options), '--no-install'], // pass in no-install to prevent node_modules install
53
47
  {
54
- cwd: projectRoot,
48
+ cwd: (0, path_1.resolve)(workspaceRoot, projectRoot),
49
+ env: process.env,
55
50
  });
56
51
  // Ensure the child process is killed when the parent exits
57
52
  process.on('exit', () => childProcess.kill());
@@ -6,6 +6,9 @@
6
6
  export interface ExpoRunOptions {
7
7
  // nx options
8
8
  platform: 'ios' | 'android';
9
+ /**
10
+ * @deprecated TODO(v17) Add sync-deps to dependsOn in project.json for this target instead
11
+ */
9
12
  sync: boolean; // default is true
10
13
  install?: boolean; // default is true
11
14
  clean?: boolean; // default is false
@@ -39,6 +39,7 @@
39
39
  "type": "boolean",
40
40
  "description": "Syncs npm dependencies to package.json (for React Native autolink).",
41
41
  "default": true,
42
+ "x-deprecated": "Add sync-deps to dependsOn in project.json for this target instead",
42
43
  "x-priority": "internal"
43
44
  },
44
45
  "port": {
@@ -20,6 +20,8 @@ export interface ExpoStartOptions {
20
20
  tunnel?: boolean;
21
21
  offline?: boolean;
22
22
 
23
- // nx options
23
+ /**
24
+ * @deprecated TODO(v17) Add sync-deps to dependsOn in project.json for this target instead
25
+ */
24
26
  sync?: boolean; // default is true
25
27
  }
@@ -91,6 +91,7 @@
91
91
  "sync": {
92
92
  "type": "boolean",
93
93
  "description": "Syncs npm dependencies to package.json (for React Native autolink).",
94
+ "x-deprecated": "Add sync-deps to dependsOn in project.json for this target instead",
94
95
  "default": true
95
96
  }
96
97
  },
@@ -5,16 +5,10 @@ const chalk = require("chalk");
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  const child_process_1 = require("child_process");
7
7
  const path_1 = require("path");
8
- const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
9
- const sync_deps_impl_1 = require("../sync-deps/sync-deps.impl");
10
8
  let childProcess;
11
9
  function startExecutor(options, context) {
12
10
  return tslib_1.__asyncGenerator(this, arguments, function* startExecutor_1() {
13
11
  const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
14
- (0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
15
- if (options.sync) {
16
- (0, sync_deps_impl_1.displayNewlyAddedDepsMessage)(context.projectName, yield tslib_1.__await((0, sync_deps_impl_1.syncDeps)(context.projectName, projectRoot, context.root, context.projectGraph)));
17
- }
18
12
  try {
19
13
  const baseUrl = `http://localhost:${options.port}`;
20
14
  devkit_1.logger.info(chalk.cyan(`Packager is ready at ${baseUrl}`));
@@ -34,7 +28,7 @@ function startExecutor(options, context) {
34
28
  exports.default = startExecutor;
35
29
  function startAsync(workspaceRoot, projectRoot, options) {
36
30
  return new Promise((resolve, reject) => {
37
- childProcess = (0, child_process_1.fork)((0, path_1.join)(workspaceRoot, './node_modules/@expo/cli/build/bin/cli'), ['start', ...createStartOptions(options)], { cwd: (0, path_1.join)(workspaceRoot, projectRoot), env: process.env });
31
+ childProcess = (0, child_process_1.fork)(require.resolve('@expo/cli/build/bin/cli'), ['start', ...createStartOptions(options)], { cwd: (0, path_1.resolve)(workspaceRoot, projectRoot), env: process.env });
38
32
  // Ensure the child process is killed when the parent exits
39
33
  process.on('exit', () => childProcess.kill());
40
34
  process.on('SIGTERM', () => childProcess.kill());
@@ -4,12 +4,10 @@ const tslib_1 = require("tslib");
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const path_1 = require("path");
6
6
  const child_process_1 = require("child_process");
7
- const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
8
7
  let childProcess;
9
8
  function submitExecutor(options, context) {
10
9
  return tslib_1.__asyncGenerator(this, arguments, function* submitExecutor_1() {
11
10
  const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
12
- (0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
13
11
  try {
14
12
  yield tslib_1.__await(runCliSubmit(context.root, projectRoot, options));
15
13
  yield yield tslib_1.__await({ success: true });
@@ -24,8 +22,8 @@ function submitExecutor(options, context) {
24
22
  exports.default = submitExecutor;
25
23
  function runCliSubmit(workspaceRoot, projectRoot, options) {
26
24
  return new Promise((resolve, reject) => {
27
- childProcess = (0, child_process_1.fork)((0, path_1.join)(workspaceRoot, './node_modules/eas-cli/bin/run'), ['submit', ...createSubmitOptions(options)], {
28
- cwd: (0, path_1.join)(workspaceRoot, projectRoot),
25
+ childProcess = (0, child_process_1.fork)(require.resolve('eas-cli/bin/run'), ['submit', ...createSubmitOptions(options)], {
26
+ cwd: (0, path_1.resolve)(workspaceRoot, projectRoot),
29
27
  env: process.env,
30
28
  });
31
29
  // Ensure the child process is killed when the parent exits
@@ -28,7 +28,7 @@ function buildExecutor(options, context) {
28
28
  exports.default = buildExecutor;
29
29
  function runCliUpdate(workspaceRoot, projectRoot, options) {
30
30
  return new Promise((resolve, reject) => {
31
- childProcess = (0, child_process_1.fork)((0, path_1.join)(workspaceRoot, './node_modules/eas-cli/bin/run'), ['update', ...createUpdateOptions(options)], { cwd: (0, path_1.join)(workspaceRoot, projectRoot), env: process.env });
31
+ childProcess = (0, child_process_1.fork)(require.resolve('eas-cli/bin/run'), ['update', ...createUpdateOptions(options)], { cwd: (0, path_1.resolve)(workspaceRoot, projectRoot), env: process.env });
32
32
  // Ensure the child process is killed when the parent exits
33
33
  process.on('exit', () => childProcess.kill());
34
34
  process.on('SIGTERM', () => childProcess.kill());
@@ -1,25 +1,37 @@
1
1
  const { withNxMetro } = require('@nx/expo');
2
2
  const { getDefaultConfig } = require('@expo/metro-config');
3
+ const { mergeConfig } = require('metro-config');
4
+ const exclusionList = require('metro-config/src/defaults/exclusionList');
3
5
 
4
6
  const defaultConfig = getDefaultConfig(__dirname);
7
+ const { assetExts, sourceExts } = defaultConfig.resolver;
5
8
 
6
- module.exports = (async () => {
7
- defaultConfig.transformer.babelTransformerPath = require.resolve(
8
- 'react-native-svg-transformer'
9
- );
10
- defaultConfig.resolver.assetExts = defaultConfig.resolver.assetExts.filter(
11
- (ext) => ext !== 'svg'
12
- );
13
- defaultConfig.resolver.sourceExts.push('svg');
14
- return withNxMetro(defaultConfig, {
15
- // Change this to true to see debugging info.
16
- // Useful if you have issues resolving modules
17
- debug: false,
18
- // all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx'
19
- extensions: [],
20
- // the project root to start the metro server
21
- projectRoot: __dirname,
22
- // Specify any additional (to projectRoot) watch folders, this is used to know which files to watch
23
- watchFolders: []
24
- });
25
- })();
9
+ /**
10
+ * Metro configuration
11
+ * https://facebook.github.io/metro/docs/configuration
12
+ *
13
+ * @type {import('metro-config').MetroConfig}
14
+ */
15
+ const customConfig = {
16
+ transformer: {
17
+ babelTransformerPath: require.resolve('react-native-svg-transformer'),
18
+ },
19
+ resolver: {
20
+ assetExts: assetExts.filter((ext) => ext !== 'svg'),
21
+ sourceExts: [...sourceExts, 'svg'],
22
+ blockList: exclusionList([/^(?!.*node_modules).*\/dist\/.*/]),
23
+ unstable_enableSymlinks: true,
24
+ unstable_enablePackageExports: true,
25
+ },
26
+ };
27
+
28
+
29
+ module.exports = withNxMetro(mergeConfig(defaultConfig, customConfig), {
30
+ // Change this to true to see debugging info.
31
+ // Useful if you have issues resolving modules
32
+ debug: false,
33
+ // all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx', 'json'
34
+ extensions: [],
35
+ // Specify folders to watch, in addition to Nx defaults (workspace libraries and node_modules)
36
+ watchFolders: [],
37
+ });
@@ -5,6 +5,7 @@
5
5
  "dependencies": {
6
6
  "@testing-library/jest-native": "*",
7
7
  "@testing-library/react-native": "*",
8
+ "metro-config": "*",
8
9
  "react-native": "*",
9
10
  "expo": "*",
10
11
  "react-native-svg": "*",
@@ -17,6 +17,7 @@ function getTargets(options) {
17
17
  const architect = {};
18
18
  architect.start = {
19
19
  executor: '@nx/expo:start',
20
+ dependsOn: ['ensure-symlink', 'sync-deps'],
20
21
  options: {
21
22
  port: 8081,
22
23
  },
@@ -29,12 +30,14 @@ function getTargets(options) {
29
30
  };
30
31
  architect['run-ios'] = {
31
32
  executor: '@nx/expo:run',
33
+ dependsOn: ['ensure-symlink', 'sync-deps'],
32
34
  options: {
33
35
  platform: 'ios',
34
36
  },
35
37
  };
36
38
  architect['run-android'] = {
37
39
  executor: '@nx/expo:run',
40
+ dependsOn: ['ensure-symlink', 'sync-deps'],
38
41
  options: {
39
42
  platform: 'android',
40
43
  },
@@ -51,6 +54,9 @@ function getTargets(options) {
51
54
  executor: '@nx/expo:build-list',
52
55
  options: {},
53
56
  };
57
+ /**
58
+ * @deprecated TODO(v17) this executor is no longer used, to be removed in v17
59
+ */
54
60
  architect['download'] = {
55
61
  executor: '@nx/expo:download',
56
62
  options: {
@@ -67,6 +73,7 @@ function getTargets(options) {
67
73
  };
68
74
  architect['prebuild'] = {
69
75
  executor: '@nx/expo:prebuild',
76
+ dependsOn: ['ensure-symlink', 'sync-deps'],
70
77
  options: {},
71
78
  };
72
79
  architect['install'] = {
@@ -79,6 +86,7 @@ function getTargets(options) {
79
86
  };
80
87
  architect['export'] = {
81
88
  executor: '@nx/expo:export',
89
+ dependsOn: ['ensure-symlink', 'sync-deps'],
82
90
  options: {
83
91
  platform: 'all',
84
92
  outputDir: `${(0, devkit_1.offsetFromRoot)(options.appProjectRoot)}dist/${options.appProjectRoot}`,
@@ -0,0 +1,6 @@
1
+ import { Tree } from '@nx/devkit';
2
+ /**
3
+ * This migration adds dependsOn to project.json.
4
+ *
5
+ */
6
+ export default function update(tree: Tree): Promise<void>;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const devkit_1 = require("@nx/devkit");
5
+ /**
6
+ * This migration adds dependsOn to project.json.
7
+ *
8
+ */
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
+ }
22
+ }
23
+ });
24
+ }
25
+ exports.default = update;
@@ -0,0 +1,6 @@
1
+ import { Tree } from '@nx/devkit';
2
+ /**
3
+ * This migration updates metro.config.js to export config as a default.
4
+ *
5
+ */
6
+ export default function update(tree: Tree): Promise<void>;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const devkit_1 = require("@nx/devkit");
5
+ const path_1 = require("path");
6
+ /**
7
+ * This migration updates metro.config.js to export config as a default.
8
+ *
9
+ */
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
+ }
23
+ }
24
+ }
25
+ });
26
+ }
27
+ exports.default = update;
28
+ const oldConfigComment = `/**
29
+ * Old custom configuration for React Native v0.71.
30
+ * From @react-native/metro-config 0.72.1, it is no longer necessary to use a config function to access the complete default config.
31
+ * Please port your custom configuration to metro.config.js.
32
+ * Please see https://docs.expo.dev/guides/customizing-metro/ to learn about configuration.
33
+ */
34
+ `;
35
+ const content = `
36
+ const { withNxMetro } = require('@nx/expo');
37
+ const { getDefaultConfig } = require('@expo/metro-config');
38
+ const { mergeConfig } = require('metro-config');
39
+ const exclusionList = require('metro-config/src/defaults/exclusionList');
40
+
41
+ const defaultConfig = getDefaultConfig(__dirname);
42
+ const { assetExts, sourceExts } = defaultConfig.resolver;
43
+
44
+ /**
45
+ * Metro configuration
46
+ * https://facebook.github.io/metro/docs/configuration
47
+ *
48
+ * @type {import('metro-config').MetroConfig}
49
+ */
50
+ const customConfig = {
51
+ transformer: {
52
+ babelTransformerPath: require.resolve('react-native-svg-transformer'),
53
+ },
54
+ resolver: {
55
+ assetExts: assetExts.filter((ext) => ext !== 'svg'),
56
+ sourceExts: [...sourceExts, 'svg'],
57
+ blockList: exclusionList([/^(?!.*node_modules).*\/dist\/.*/]),
58
+ unstable_enableSymlinks: true,
59
+ unstable_enablePackageExports: true,
60
+ },
61
+ };
62
+
63
+
64
+ module.exports = withNxMetro(mergeConfig(defaultConfig, customConfig), {
65
+ // Change this to true to see debugging info.
66
+ // Useful if you have issues resolving modules
67
+ debug: false,
68
+ // all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx', 'json'
69
+ extensions: [],
70
+ // Specify folders to watch, in addition to Nx defaults (workspace libraries and node_modules)
71
+ watchFolders: [],
72
+ });
73
+ `;
@@ -1,22 +1,21 @@
1
1
  export declare const nxVersion: any;
2
- export declare const expoVersion = "48.0.19";
3
- export declare const expoMetroConfigVersion = "0.7.1";
4
- export declare const expoSplashScreenVersion = "~0.18.2";
5
- export declare const expoStatusBarVersion = "~1.4.4";
6
- export declare const expoUpdatesVersion = "~0.16.4";
7
- export declare const expoCliVersion = "~0.7.3";
8
- export declare const easCliVersion = "~3.13.3";
9
- export declare const babelPresetExpoVersion = "~9.3.2";
2
+ export declare const expoVersion = "49.0.3";
3
+ export declare const expoMetroConfigVersion = "~0.10.6";
4
+ export declare const expoSplashScreenVersion = "~0.20.4";
5
+ export declare const expoStatusBarVersion = "~1.6.0";
6
+ export declare const expoCliVersion = "~0.10.10";
7
+ export declare const easCliVersion = "~3.15.1";
8
+ export declare const babelPresetExpoVersion = "~9.5.0";
10
9
  export declare const reactVersion = "18.2.0";
11
10
  export declare const reactDomVersion = "18.2.0";
12
11
  export declare const reactTestRendererVersion = "18.2.0";
13
12
  export declare const typesReactVersion = "18.0.28";
14
- export declare const reactNativeVersion = "0.71.8";
15
- export declare const typesReactNativeVersion = "0.71.7";
16
- export declare const reactNativeWebVersion = "~0.18.12";
13
+ export declare const reactNativeVersion = "0.72.3";
14
+ export declare const typesReactNativeVersion = "0.72.2";
15
+ export declare const reactNativeWebVersion = "~0.19.6";
17
16
  export declare const reactNativeSvgTransformerVersion = "1.0.0";
18
- export declare const reactNativeSvgVersion = "13.4.0";
19
- export declare const metroVersion = "0.74.1";
17
+ export declare const reactNativeSvgVersion = "13.9.0";
18
+ export declare const metroVersion = "0.76.7";
20
19
  export declare const testingLibraryReactNativeVersion = "12.1.2";
21
20
  export declare const testingLibraryJestNativeVersion = "5.4.2";
22
- export declare const jestExpoVersion = "~48.0.2";
21
+ export declare const jestExpoVersion = "~49.0.0";
@@ -1,25 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jestExpoVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.metroVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.reactNativeWebVersion = exports.typesReactNativeVersion = exports.reactNativeVersion = exports.typesReactVersion = exports.reactTestRendererVersion = exports.reactDomVersion = exports.reactVersion = exports.babelPresetExpoVersion = exports.easCliVersion = exports.expoCliVersion = exports.expoUpdatesVersion = exports.expoStatusBarVersion = exports.expoSplashScreenVersion = exports.expoMetroConfigVersion = exports.expoVersion = exports.nxVersion = void 0;
3
+ exports.jestExpoVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.metroVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.reactNativeWebVersion = exports.typesReactNativeVersion = exports.reactNativeVersion = exports.typesReactVersion = exports.reactTestRendererVersion = exports.reactDomVersion = exports.reactVersion = exports.babelPresetExpoVersion = exports.easCliVersion = exports.expoCliVersion = exports.expoStatusBarVersion = exports.expoSplashScreenVersion = exports.expoMetroConfigVersion = exports.expoVersion = exports.nxVersion = void 0;
4
4
  exports.nxVersion = require('../../package.json').version;
5
- exports.expoVersion = '48.0.19';
6
- exports.expoMetroConfigVersion = '0.7.1';
7
- exports.expoSplashScreenVersion = '~0.18.2';
8
- exports.expoStatusBarVersion = '~1.4.4';
9
- exports.expoUpdatesVersion = '~0.16.4';
10
- exports.expoCliVersion = '~0.7.3'; // @expo/cli
11
- exports.easCliVersion = '~3.13.3';
12
- exports.babelPresetExpoVersion = '~9.3.2';
5
+ exports.expoVersion = '49.0.3';
6
+ exports.expoMetroConfigVersion = '~0.10.6';
7
+ exports.expoSplashScreenVersion = '~0.20.4';
8
+ exports.expoStatusBarVersion = '~1.6.0';
9
+ exports.expoCliVersion = '~0.10.10'; // @expo/cli
10
+ exports.easCliVersion = '~3.15.1';
11
+ exports.babelPresetExpoVersion = '~9.5.0';
13
12
  exports.reactVersion = '18.2.0';
14
13
  exports.reactDomVersion = '18.2.0';
15
14
  exports.reactTestRendererVersion = '18.2.0';
16
15
  exports.typesReactVersion = '18.0.28';
17
- exports.reactNativeVersion = '0.71.8';
18
- exports.typesReactNativeVersion = '0.71.7';
19
- exports.reactNativeWebVersion = '~0.18.12';
16
+ exports.reactNativeVersion = '0.72.3';
17
+ exports.typesReactNativeVersion = '0.72.2';
18
+ exports.reactNativeWebVersion = '~0.19.6';
20
19
  exports.reactNativeSvgTransformerVersion = '1.0.0';
21
- exports.reactNativeSvgVersion = '13.4.0';
22
- exports.metroVersion = '0.74.1';
20
+ exports.reactNativeSvgVersion = '13.9.0';
21
+ exports.metroVersion = '0.76.7';
23
22
  exports.testingLibraryReactNativeVersion = '12.1.2';
24
23
  exports.testingLibraryJestNativeVersion = '5.4.2';
25
- exports.jestExpoVersion = '~48.0.2';
24
+ exports.jestExpoVersion = '~49.0.0';