@nx/expo 18.0.0-beta.1 → 18.0.0-beta.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.
Files changed (85) hide show
  1. package/.eslintrc.json +3 -0
  2. package/docs/export-examples.md +112 -0
  3. package/docs/start-examples.md +6 -0
  4. package/executors.json +5 -0
  5. package/generators.json +2 -2
  6. package/migrations.json +85 -6
  7. package/package.json +12 -16
  8. package/plugins/metro-resolver.js +4 -1
  9. package/plugins/plugin.js +10 -7
  10. package/plugins/with-nx-metro.js +6 -2
  11. package/plugins/with-nx-webpack.d.ts +1 -1
  12. package/plugins/with-nx-webpack.js +8 -4
  13. package/src/executors/build/build.impl.js +2 -1
  14. package/src/executors/build-list/build-list.impl.js +2 -3
  15. package/src/executors/ensure-symlink/ensure-symlink.impl.d.ts +4 -0
  16. package/src/executors/ensure-symlink/ensure-symlink.impl.js +4 -0
  17. package/src/executors/export/export.impl.d.ts +1 -0
  18. package/src/executors/export/export.impl.js +25 -15
  19. package/src/executors/export/schema.d.ts +4 -2
  20. package/src/executors/export/schema.json +13 -12
  21. package/src/executors/install/install.impl.js +0 -2
  22. package/src/executors/prebuild/prebuild.impl.js +11 -5
  23. package/src/executors/prebuild/schema.json +1 -0
  24. package/src/executors/serve/lib/is-packager-running.d.ts +1 -0
  25. package/src/executors/serve/lib/is-packager-running.js +15 -0
  26. package/src/executors/serve/schema.d.ts +7 -0
  27. package/src/executors/serve/schema.json +35 -0
  28. package/src/executors/serve/serve.impl.d.ts +11 -0
  29. package/src/executors/serve/serve.impl.js +103 -0
  30. package/src/executors/start/start.impl.js +7 -1
  31. package/src/executors/submit/submit.impl.js +2 -1
  32. package/src/executors/sync-deps/sync-deps.impl.d.ts +4 -4
  33. package/src/executors/sync-deps/sync-deps.impl.js +20 -5
  34. package/src/executors/update/update.impl.js +3 -4
  35. package/src/generators/application/application.js +5 -7
  36. package/src/generators/application/files/app.json.template +2 -0
  37. package/src/generators/application/files/eas.json.template +0 -3
  38. package/src/generators/application/files/metro.config.js.template +0 -4
  39. package/src/generators/application/files/src/app/App.tsx.template +29 -2
  40. package/src/generators/application/files/webpack.config.js.template +57 -0
  41. package/src/generators/application/lib/add-e2e.d.ts +3 -0
  42. package/src/generators/application/lib/add-e2e.js +85 -0
  43. package/src/generators/application/lib/add-project.js +12 -21
  44. package/src/generators/application/lib/create-application-files.js +0 -2
  45. package/src/generators/application/lib/normalize-options.d.ts +3 -0
  46. package/src/generators/application/lib/normalize-options.js +8 -1
  47. package/src/generators/application/schema.d.ts +2 -1
  48. package/src/generators/application/schema.json +3 -3
  49. package/src/generators/init/init.d.ts +2 -1
  50. package/src/generators/init/init.js +9 -5
  51. package/src/generators/init/schema.d.ts +1 -0
  52. package/src/generators/library/files/lib/.babelrc.js.template +21 -0
  53. package/src/generators/library/lib/normalize-options.js +1 -0
  54. package/src/generators/library/library.js +2 -1
  55. package/src/generators/library/schema.d.ts +1 -0
  56. package/src/generators/library/schema.json +1 -1
  57. package/src/migrations/update-16-6-0/update-metro-config.js +0 -4
  58. package/src/migrations/update-16-9-0/remove-types-react-native.js +2 -9
  59. package/src/migrations/update-16-9-0/update-eas-cli-version.js +1 -2
  60. package/src/migrations/{update-16-1-4/add-detox-app-json.d.ts → update-18-0-0/change-outputDir-export-target.d.ts} +1 -1
  61. package/src/migrations/update-18-0-0/change-outputDir-export-target.js +25 -0
  62. package/src/migrations/update-18-0-0/remove-block-list.d.ts +6 -0
  63. package/src/migrations/update-18-0-0/remove-block-list.js +26 -0
  64. package/src/migrations/update-18-0-0/remove-eas-cli.d.ts +12 -0
  65. package/src/migrations/update-18-0-0/remove-eas-cli.js +18 -0
  66. package/src/migrations/update-18-0-0/remove-symlink-target.d.ts +6 -0
  67. package/src/migrations/update-18-0-0/remove-symlink-target.js +29 -0
  68. package/src/utils/add-jest.d.ts +1 -1
  69. package/src/utils/add-jest.js +15 -5
  70. package/src/utils/add-linting.d.ts +1 -0
  71. package/src/utils/add-linting.js +1 -0
  72. package/src/utils/ensure-dependencies.js +1 -2
  73. package/src/utils/resolve-eas.d.ts +1 -0
  74. package/src/utils/resolve-eas.js +36 -0
  75. package/src/utils/versions.d.ts +13 -14
  76. package/src/utils/versions.js +14 -15
  77. package/src/generators/application/lib/add-detox.d.ts +0 -3
  78. package/src/generators/application/lib/add-detox.js +0 -24
  79. package/src/generators/library/files/lib/babel.config.json +0 -17
  80. package/src/migrations/update-16-1-4/add-detox-app-json.js +0 -29
  81. package/src/utils/find-all-npm-dependencies.d.ts +0 -2
  82. package/src/utils/find-all-npm-dependencies.js +0 -25
  83. package/src/utils/symlink-task.d.ts +0 -2
  84. package/src/utils/symlink-task.js +0 -18
  85. /package/src/generators/application/files/{babel.config.js.template → .babelrc.js.template} +0 -0
@@ -9,12 +9,11 @@ function ensureDependencies(host) {
9
9
  'expo-status-bar': versions_1.expoStatusBarVersion,
10
10
  'react-native-web': versions_1.reactNativeWebVersion,
11
11
  '@expo/metro-config': versions_1.expoMetroConfigVersion,
12
+ '@expo/metro-runtime': versions_1.expoMetroRuntimeVersion,
12
13
  'react-native-svg-transformer': versions_1.reactNativeSvgTransformerVersion,
13
14
  'react-native-svg': versions_1.reactNativeSvgVersion,
14
15
  }, {
15
16
  '@types/react': versions_1.typesReactVersion,
16
- metro: versions_1.metroVersion,
17
- 'metro-resolver': versions_1.metroVersion,
18
17
  'react-test-renderer': versions_1.reactTestRendererVersion,
19
18
  '@testing-library/react-native': versions_1.testingLibraryReactNativeVersion,
20
19
  '@testing-library/jest-native': versions_1.testingLibraryJestNativeVersion,
@@ -0,0 +1 @@
1
+ export declare function resolveEas(workspaceRoot: string): string;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveEas = void 0;
4
+ const child_process_1 = require("child_process");
5
+ function resolveEas(workspaceRoot) {
6
+ try {
7
+ (0, child_process_1.execSync)('eas --version');
8
+ }
9
+ catch {
10
+ throw new Error('EAS is not installed. Please run `npm install --global eas-cli` or `yarn global add eas-cli`.');
11
+ }
12
+ let npmGlobalPath, yarnGlobalPath;
13
+ try {
14
+ npmGlobalPath = (0, child_process_1.execSync)('npm root -g')
15
+ ?.toString()
16
+ ?.trim()
17
+ ?.replace('\u001b[2K\u001b[1G', ''); // strip out ansi codes
18
+ }
19
+ catch { }
20
+ try {
21
+ yarnGlobalPath = (0, child_process_1.execSync)('yarn global dir')
22
+ ?.toString()
23
+ ?.trim()
24
+ ?.replace('\u001b[2K\u001b[1G', ''); // strip out ansi codes
25
+ }
26
+ catch { }
27
+ try {
28
+ return require.resolve('eas-cli/bin/run', {
29
+ paths: [npmGlobalPath, yarnGlobalPath, workspaceRoot].filter(Boolean),
30
+ });
31
+ }
32
+ catch {
33
+ throw new Error('Can not resolve EAS. Please run `npm install --global eas-cli` or `yarn global add eas-cli`.');
34
+ }
35
+ }
36
+ exports.resolveEas = resolveEas;
@@ -1,20 +1,19 @@
1
1
  export declare const nxVersion: any;
2
- export declare const expoVersion = "49.0.16";
3
- export declare const expoMetroConfigVersion = "~0.10.7";
4
- export declare const expoSplashScreenVersion = "~0.20.5";
5
- export declare const expoStatusBarVersion = "~1.6.0";
6
- export declare const expoCliVersion = "~0.10.13";
7
- export declare const easCliVersion = "~5.2.0";
8
- export declare const babelPresetExpoVersion = "~9.5.2";
2
+ export declare const expoVersion = "~50.0.3";
3
+ export declare const expoSplashScreenVersion = "~0.26.1";
4
+ export declare const expoStatusBarVersion = "~1.11.1";
5
+ export declare const expoCliVersion = "~0.16.5";
6
+ export declare const babelPresetExpoVersion = "~10.0.0";
9
7
  export declare const reactVersion = "18.2.0";
10
8
  export declare const reactDomVersion = "18.2.0";
11
9
  export declare const reactTestRendererVersion = "18.2.0";
12
- export declare const typesReactVersion = "18.0.28";
13
- export declare const reactNativeVersion = "0.72.6";
10
+ export declare const typesReactVersion = "~18.2.45";
11
+ export declare const reactNativeVersion = "0.73.2";
14
12
  export declare const reactNativeWebVersion = "~0.19.9";
15
- export declare const reactNativeSvgTransformerVersion = "1.0.0";
16
- export declare const reactNativeSvgVersion = "13.9.0";
17
- export declare const metroVersion = "0.76.8";
18
- export declare const testingLibraryReactNativeVersion = "~12.3.0";
13
+ export declare const expoMetroConfigVersion = "~0.17.3";
14
+ export declare const expoMetroRuntimeVersion = "~3.1.1";
15
+ export declare const reactNativeSvgTransformerVersion = "1.2.0";
16
+ export declare const reactNativeSvgVersion = "14.1.0";
17
+ export declare const testingLibraryReactNativeVersion = "~12.4.2";
19
18
  export declare const testingLibraryJestNativeVersion = "~5.4.3";
20
- export declare const jestExpoVersion = "~49.0.0";
19
+ export declare const jestExpoVersion = "~50.0.1";
@@ -1,23 +1,22 @@
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.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;
3
+ exports.jestExpoVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.expoMetroRuntimeVersion = exports.expoMetroConfigVersion = exports.reactNativeWebVersion = exports.reactNativeVersion = exports.typesReactVersion = exports.reactTestRendererVersion = exports.reactDomVersion = exports.reactVersion = exports.babelPresetExpoVersion = exports.expoCliVersion = exports.expoStatusBarVersion = exports.expoSplashScreenVersion = exports.expoVersion = exports.nxVersion = void 0;
4
4
  exports.nxVersion = require('../../package.json').version;
5
- exports.expoVersion = '49.0.16';
6
- exports.expoMetroConfigVersion = '~0.10.7';
7
- exports.expoSplashScreenVersion = '~0.20.5';
8
- exports.expoStatusBarVersion = '~1.6.0';
9
- exports.expoCliVersion = '~0.10.13'; // @expo/cli
10
- exports.easCliVersion = '~5.2.0';
11
- exports.babelPresetExpoVersion = '~9.5.2';
5
+ exports.expoVersion = '~50.0.3';
6
+ exports.expoSplashScreenVersion = '~0.26.1';
7
+ exports.expoStatusBarVersion = '~1.11.1';
8
+ exports.expoCliVersion = '~0.16.5'; // @expo/cli
9
+ exports.babelPresetExpoVersion = '~10.0.0';
12
10
  exports.reactVersion = '18.2.0';
13
11
  exports.reactDomVersion = '18.2.0';
14
12
  exports.reactTestRendererVersion = '18.2.0';
15
- exports.typesReactVersion = '18.0.28';
16
- exports.reactNativeVersion = '0.72.6';
13
+ exports.typesReactVersion = '~18.2.45';
14
+ exports.reactNativeVersion = '0.73.2';
17
15
  exports.reactNativeWebVersion = '~0.19.9';
18
- exports.reactNativeSvgTransformerVersion = '1.0.0';
19
- exports.reactNativeSvgVersion = '13.9.0';
20
- exports.metroVersion = '0.76.8';
21
- exports.testingLibraryReactNativeVersion = '~12.3.0';
16
+ exports.expoMetroConfigVersion = '~0.17.3';
17
+ exports.expoMetroRuntimeVersion = '~3.1.1';
18
+ exports.reactNativeSvgTransformerVersion = '1.2.0';
19
+ exports.reactNativeSvgVersion = '14.1.0';
20
+ exports.testingLibraryReactNativeVersion = '~12.4.2';
22
21
  exports.testingLibraryJestNativeVersion = '~5.4.3';
23
- exports.jestExpoVersion = '~49.0.0';
22
+ exports.jestExpoVersion = '~50.0.1';
@@ -1,3 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- import { NormalizedSchema } from './normalize-options';
3
- export declare function addDetox(host: Tree, options: NormalizedSchema): Promise<import("@nx/devkit").GeneratorCallback>;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addDetox = void 0;
4
- const detox_1 = require("@nx/detox");
5
- const eslint_1 = require("@nx/eslint");
6
- async function addDetox(host, options) {
7
- if (options?.e2eTestRunner !== 'detox') {
8
- return () => { };
9
- }
10
- return (0, detox_1.detoxApplicationGenerator)(host, {
11
- ...options,
12
- linter: eslint_1.Linter.EsLint,
13
- e2eName: `${options.projectName}-e2e`,
14
- e2eDirectory: `${options.appProjectRoot}-e2e`,
15
- projectNameAndRootFormat: 'as-provided',
16
- appProject: options.projectName,
17
- appDisplayName: options.displayName,
18
- appName: options.name,
19
- framework: 'expo',
20
- setParserOptionsProject: options.setParserOptionsProject,
21
- skipFormat: true,
22
- });
23
- }
24
- exports.addDetox = addDetox;
@@ -1,17 +0,0 @@
1
- {
2
- "presets": [
3
- [
4
- "@nx/react/babel",
5
- {
6
- "runtime": "automatic",
7
- "useBuiltIns": "usage"
8
- }
9
- ]
10
- ],
11
- "plugins": [],
12
- "env": {
13
- "test": {
14
- "presets": ["babel-preset-expo"]
15
- }
16
- }
17
- }
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- /**
5
- * Add detox plugin to app.json for expo
6
- */
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
- }
26
- });
27
- await (0, devkit_1.formatFiles)(tree);
28
- }
29
- exports.default = update;
@@ -1,2 +0,0 @@
1
- import { ProjectGraph } from '@nx/devkit';
2
- export declare function findAllNpmDependencies(graph: ProjectGraph, projectName: string, list?: string[], seen?: Set<string>): string[];
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findAllNpmDependencies = void 0;
4
- function findAllNpmDependencies(graph, projectName, list = [], seen = new Set()) {
5
- // In case of bad circular dependencies
6
- if (seen.has(projectName)) {
7
- return list;
8
- }
9
- seen.add(projectName);
10
- const node = graph.externalNodes[projectName];
11
- // Don't want to include '@nx/react-native' because React Native
12
- // autolink will warn that the package has no podspec file for iOS.
13
- if (node) {
14
- if (node.name !== `npm:@nx/react-native` &&
15
- node.name !== `npm:@nrwl/react-native`) {
16
- list.push(node.data.packageName);
17
- }
18
- }
19
- else {
20
- // it's workspace project, search for it's dependencies
21
- graph.dependencies[projectName]?.forEach((dep) => findAllNpmDependencies(graph, dep.target, list, seen));
22
- }
23
- return list;
24
- }
25
- exports.findAllNpmDependencies = findAllNpmDependencies;
@@ -1,2 +0,0 @@
1
- import { GeneratorCallback } from '@nx/devkit';
2
- export declare function runSymlink(workspaceRoot: string, projectRoot: string): GeneratorCallback;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runSymlink = void 0;
4
- const ensure_node_modules_symlink_1 = require("./ensure-node-modules-symlink");
5
- const chalk = require("chalk");
6
- const devkit_1 = require("@nx/devkit");
7
- function runSymlink(workspaceRoot, projectRoot) {
8
- return () => {
9
- devkit_1.logger.info(`creating symlinks for ${chalk.bold(projectRoot)}`);
10
- try {
11
- (0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(workspaceRoot, projectRoot);
12
- }
13
- catch {
14
- throw new Error(`Failed to create symlinks for ${chalk.bold(projectRoot)}`);
15
- }
16
- };
17
- }
18
- exports.runSymlink = runSymlink;