@nx/detox 23.0.0-pr.35413.460eeef → 23.0.0-rc.0

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 (91) hide show
  1. package/{index.d.ts → dist/index.d.ts} +0 -1
  2. package/{plugin.d.ts → dist/plugin.d.ts} +0 -1
  3. package/{src → dist/src}/executors/build/build.impl.d.ts +0 -1
  4. package/{src → dist/src}/executors/build/build.impl.js +2 -0
  5. package/{src → dist/src}/executors/build/schema.json +1 -0
  6. package/{src → dist/src}/executors/test/schema.json +1 -0
  7. package/{src → dist/src}/executors/test/test.impl.d.ts +0 -1
  8. package/{src → dist/src}/executors/test/test.impl.js +2 -0
  9. package/{src → dist/src}/generators/application/application.d.ts +0 -1
  10. package/{src → dist/src}/generators/application/application.js +7 -6
  11. package/{src → dist/src}/generators/application/files/app/.detoxrc.json.template +4 -8
  12. package/{src → dist/src}/generators/application/lib/add-git-ignore-entry.d.ts +0 -1
  13. package/{src → dist/src}/generators/application/lib/add-linting.d.ts +0 -1
  14. package/{src → dist/src}/generators/application/lib/add-linting.js +7 -8
  15. package/{src → dist/src}/generators/application/lib/add-project.d.ts +0 -1
  16. package/{src → dist/src}/generators/application/lib/add-project.js +4 -0
  17. package/{src → dist/src}/generators/application/lib/create-files.d.ts +0 -1
  18. package/{src → dist/src}/generators/application/lib/create-files.js +2 -2
  19. package/{src → dist/src}/generators/application/lib/ensure-dependencies.d.ts +0 -1
  20. package/{src → dist/src}/generators/application/lib/ensure-dependencies.js +6 -6
  21. package/{src → dist/src}/generators/application/lib/get-targets.d.ts +0 -1
  22. package/{src → dist/src}/generators/application/lib/normalize-options.d.ts +0 -1
  23. package/{src → dist/src}/generators/application/lib/normalize-options.js +4 -4
  24. package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.d.ts +0 -1
  25. package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.js +6 -5
  26. package/{src → dist/src}/generators/convert-to-inferred/lib/post-target-transformer.d.ts +1 -2
  27. package/{src → dist/src}/generators/convert-to-inferred/lib/post-target-transformer.js +2 -2
  28. package/{src → dist/src}/generators/convert-to-inferred/lib/process-build-options.d.ts +1 -2
  29. package/{src → dist/src}/generators/convert-to-inferred/lib/process-test-options.d.ts +1 -2
  30. package/{src → dist/src}/generators/convert-to-inferred/lib/process-test-options.js +8 -6
  31. package/{src → dist/src}/generators/init/init.d.ts +0 -1
  32. package/{src → dist/src}/generators/init/init.js +4 -3
  33. package/{src → dist/src}/generators/init/schema.json +1 -1
  34. package/{src → dist/src}/migrations/update-22-0-0/remove-config-plugins-detox-for-expo-54.d.ts +0 -1
  35. package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.d.ts +9 -0
  36. package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.js +223 -0
  37. package/dist/src/plugins/plugin.d.ts +10 -0
  38. package/{src → dist/src}/plugins/plugin.js +19 -26
  39. package/dist/src/utils/deprecation.d.ts +3 -0
  40. package/dist/src/utils/deprecation.js +21 -0
  41. package/{src → dist/src}/utils/expo-version-utils.d.ts +0 -1
  42. package/{src → dist/src}/utils/versions.d.ts +3 -1
  43. package/dist/src/utils/versions.js +16 -0
  44. package/executors.json +4 -4
  45. package/generators.json +6 -6
  46. package/migrations.json +15 -27
  47. package/package.json +48 -12
  48. package/index.d.ts.map +0 -1
  49. package/plugin.d.ts.map +0 -1
  50. package/src/executors/build/build.impl.d.ts.map +0 -1
  51. package/src/executors/test/test.impl.d.ts.map +0 -1
  52. package/src/generators/application/application.d.ts.map +0 -1
  53. package/src/generators/application/lib/add-git-ignore-entry.d.ts.map +0 -1
  54. package/src/generators/application/lib/add-linting.d.ts.map +0 -1
  55. package/src/generators/application/lib/add-project.d.ts.map +0 -1
  56. package/src/generators/application/lib/create-files.d.ts.map +0 -1
  57. package/src/generators/application/lib/ensure-dependencies.d.ts.map +0 -1
  58. package/src/generators/application/lib/get-targets.d.ts.map +0 -1
  59. package/src/generators/application/lib/normalize-options.d.ts.map +0 -1
  60. package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +0 -1
  61. package/src/generators/convert-to-inferred/lib/post-target-transformer.d.ts.map +0 -1
  62. package/src/generators/convert-to-inferred/lib/process-build-options.d.ts.map +0 -1
  63. package/src/generators/convert-to-inferred/lib/process-test-options.d.ts.map +0 -1
  64. package/src/generators/init/init.d.ts.map +0 -1
  65. package/src/migrations/update-22-0-0/remove-config-plugins-detox-for-expo-54.d.ts.map +0 -1
  66. package/src/plugins/plugin.d.ts +0 -11
  67. package/src/plugins/plugin.d.ts.map +0 -1
  68. package/src/utils/expo-version-utils.d.ts.map +0 -1
  69. package/src/utils/versions.d.ts.map +0 -1
  70. package/src/utils/versions.js +0 -7
  71. /package/{LICENSE → dist/LICENSE} +0 -0
  72. /package/{index.js → dist/index.js} +0 -0
  73. /package/{plugin.js → dist/plugin.js} +0 -0
  74. /package/{src → dist/src}/executors/build/schema.d.ts +0 -0
  75. /package/{src → dist/src}/executors/test/schema.d.ts +0 -0
  76. /package/{src → dist/src}/generators/application/files/app/.babelrc.template +0 -0
  77. /package/{src → dist/src}/generators/application/files/app/src/app.spec.ts.template +0 -0
  78. /package/{src → dist/src}/generators/application/files/app/test-setup.ts.template +0 -0
  79. /package/{src → dist/src}/generators/application/files/non-ts-solution/jest.config.json.template +0 -0
  80. /package/{src → dist/src}/generators/application/files/non-ts-solution/tsconfig.e2e.json.template +0 -0
  81. /package/{src → dist/src}/generators/application/files/non-ts-solution/tsconfig.json.template +0 -0
  82. /package/{src → dist/src}/generators/application/files/ts-solution/jest.config.cts.template +0 -0
  83. /package/{src → dist/src}/generators/application/lib/add-git-ignore-entry.js +0 -0
  84. /package/{src → dist/src}/generators/application/lib/get-targets.js +0 -0
  85. /package/{src → dist/src}/generators/application/schema.d.ts +0 -0
  86. /package/{src → dist/src}/generators/application/schema.json +0 -0
  87. /package/{src → dist/src}/generators/convert-to-inferred/lib/process-build-options.js +0 -0
  88. /package/{src → dist/src}/generators/convert-to-inferred/schema.json +0 -0
  89. /package/{src → dist/src}/generators/init/schema.d.ts +0 -0
  90. /package/{src → dist/src}/migrations/update-22-0-0/remove-config-plugins-detox-for-expo-54.js +0 -0
  91. /package/{src → dist/src}/utils/expo-version-utils.js +0 -0
@@ -1,3 +1,2 @@
1
1
  export { detoxInitGenerator } from './src/generators/init/init';
2
2
  export { detoxApplicationGenerator } from './src/generators/application/application';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export { createNodes, createNodesV2, DetoxPluginOptions, } from './src/plugins/plugin';
2
- //# sourceMappingURL=plugin.d.ts.map
@@ -5,4 +5,3 @@ export interface DetoxBuildOutput {
5
5
  }
6
6
  export default function detoxBuildExecutor(options: DetoxBuildOptions, context: ExecutorContext): AsyncGenerator<DetoxBuildOutput>;
7
7
  export declare function runCliBuild(workspaceRoot: string, projectRoot: string, options: DetoxBuildOptions): Promise<unknown>;
8
- //# sourceMappingURL=build.impl.d.ts.map
@@ -5,8 +5,10 @@ exports.runCliBuild = runCliBuild;
5
5
  const internal_1 = require("@nx/devkit/internal");
6
6
  const path_1 = require("path");
7
7
  const child_process_1 = require("child_process");
8
+ const deprecation_1 = require("../../utils/deprecation");
8
9
  let childProcess;
9
10
  async function* detoxBuildExecutor(options, context) {
11
+ (0, deprecation_1.warnDetoxExecutorsDeprecation)();
10
12
  const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
11
13
  try {
12
14
  await runCliBuild(context.root, projectRoot, options);
@@ -5,6 +5,7 @@
5
5
  "description": "Run detox build options.",
6
6
  "type": "object",
7
7
  "cli": "nx",
8
+ "x-deprecated": "The `@nx/detox:build` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/detox:convert-to-inferred` to migrate to the `@nx/detox/plugin` inferred plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
8
9
  "properties": {
9
10
  "detoxConfiguration": {
10
11
  "type": "string",
@@ -5,6 +5,7 @@
5
5
  "description": "Run detox test options.",
6
6
  "type": "object",
7
7
  "cli": "nx",
8
+ "x-deprecated": "The `@nx/detox:test` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/detox:convert-to-inferred` to migrate to the `@nx/detox/plugin` inferred plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
8
9
  "presets": [
9
10
  {
10
11
  "name": "Test a Detox Configuration",
@@ -4,4 +4,3 @@ export interface DetoxTestOutput {
4
4
  success: boolean;
5
5
  }
6
6
  export default function detoxTestExecutor(options: DetoxTestOptions, context: ExecutorContext): AsyncGenerator<DetoxTestOutput>;
7
- //# sourceMappingURL=test.impl.d.ts.map
@@ -7,8 +7,10 @@ const devkit_2 = require("@nx/devkit");
7
7
  const path_1 = require("path");
8
8
  const child_process_1 = require("child_process");
9
9
  const build_impl_1 = require("../build/build.impl");
10
+ const deprecation_1 = require("../../utils/deprecation");
10
11
  let childProcess;
11
12
  async function* detoxTestExecutor(options, context) {
13
+ (0, deprecation_1.warnDetoxExecutorsDeprecation)();
12
14
  const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
13
15
  try {
14
16
  if (!options.reuse && options.buildTarget) {
@@ -3,4 +3,3 @@ import { Schema } from './schema';
3
3
  export declare function detoxApplicationGenerator(host: Tree, schema: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
4
4
  export declare function detoxApplicationGeneratorInternal(host: Tree, schema: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
5
5
  export default detoxApplicationGenerator;
6
- //# sourceMappingURL=application.d.ts.map
@@ -12,9 +12,9 @@ const add_project_1 = require("./lib/add-project");
12
12
  const create_files_1 = require("./lib/create-files");
13
13
  const normalize_options_1 = require("./lib/normalize-options");
14
14
  const ensure_dependencies_1 = require("./lib/ensure-dependencies");
15
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
16
- const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
15
+ const internal_1 = require("@nx/js/internal");
17
16
  const expo_version_utils_1 = require("../../utils/expo-version-utils");
17
+ const versions_1 = require("../../utils/versions");
18
18
  async function detoxApplicationGenerator(host, schema) {
19
19
  return await detoxApplicationGeneratorInternal(host, {
20
20
  addPlugin: false,
@@ -23,7 +23,8 @@ async function detoxApplicationGenerator(host, schema) {
23
23
  });
24
24
  }
25
25
  async function detoxApplicationGeneratorInternal(host, schema) {
26
- const addTsPlugin = (0, ts_solution_setup_1.shouldConfigureTsSolutionSetup)(host, schema.addPlugin);
26
+ (0, versions_1.assertSupportedDetoxVersion)(host);
27
+ const addTsPlugin = (0, internal_1.shouldConfigureTsSolutionSetup)(host, schema.addPlugin);
27
28
  const jsInitTask = await (0, js_1.initGenerator)(host, {
28
29
  addTsPlugin,
29
30
  skipFormat: true,
@@ -48,7 +49,7 @@ async function detoxApplicationGeneratorInternal(host, schema) {
48
49
  (0, add_git_ignore_entry_1.addGitIgnoreEntry)(host, options);
49
50
  const lintingTask = await (0, add_linting_1.addLinting)(host, options);
50
51
  const depsTask = (0, ensure_dependencies_1.ensureDependencies)(host, options);
51
- (0, ts_solution_setup_1.updateTsconfigFiles)(host, options.e2eProjectRoot, 'tsconfig.json', {
52
+ (0, internal_1.updateTsconfigFiles)(host, options.e2eProjectRoot, 'tsconfig.json', {
52
53
  module: 'esnext',
53
54
  moduleResolution: 'bundler',
54
55
  outDir: 'out-tsc/detox',
@@ -58,9 +59,9 @@ async function detoxApplicationGeneratorInternal(host, schema) {
58
59
  ? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
59
60
  : undefined);
60
61
  if (options.isUsingTsSolutionConfig) {
61
- await (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(host, options.e2eProjectRoot);
62
+ await (0, internal_1.addProjectToTsSolutionWorkspace)(host, options.e2eProjectRoot);
62
63
  }
63
- (0, sort_fields_1.sortPackageJsonFields)(host, options.e2eProjectRoot);
64
+ (0, internal_1.sortPackageJsonFields)(host, options.e2eProjectRoot);
64
65
  if (!options.skipFormat) {
65
66
  await (0, devkit_1.formatFiles)(host);
66
67
  }
@@ -35,14 +35,12 @@
35
35
  "type": "android.apk",
36
36
  "build": "cd <%= offsetFromRoot %><%= appRoot %>/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release",
37
37
  "binaryPath": "<%= offsetFromRoot %><%= appRoot %>/android/app/build/outputs/apk/release/app-release.apk"
38
- },
39
- <% if (framework === 'expo') { %>
38
+ }<% if (framework === 'expo') { %>,
40
39
  "android.local": {
41
40
  "type": "android.apk",
42
41
  "build": "<%= exec %> nx run <%= appFileName %>:build --platform android --profile preview --wait --local --no-interactive --output=<%= offsetFromRoot %><%= appRoot %>/dist/<%= appExpoName %>.apk",
43
42
  "binaryPath": "<%= offsetFromRoot %><%= appRoot %>/dist/<%= appExpoName %>.apk"
44
- },
45
- <% } %>
43
+ }<% } %>
46
44
  },
47
45
  "devices": {
48
46
  "simulator": {
@@ -80,12 +78,10 @@
80
78
  "android.emu.debug": {
81
79
  "device": "emulator",
82
80
  "app": "android.debug"
83
- },
84
- <% if (framework === 'expo') { %>
81
+ }<% if (framework === 'expo') { %>,
85
82
  "android.emu.local": {
86
83
  "device": "emulator",
87
84
  "app": "android.local"
88
- },
89
- <% } %>
85
+ }<% } %>
90
86
  }
91
87
  }
@@ -1,4 +1,3 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  import { NormalizedSchema } from './normalize-options';
3
3
  export declare function addGitIgnoreEntry(host: Tree, options: NormalizedSchema): void;
4
- //# sourceMappingURL=add-git-ignore-entry.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import { GeneratorCallback, Tree } from '@nx/devkit';
2
2
  import { NormalizedSchema } from './normalize-options';
3
3
  export declare function addLinting(host: Tree, options: NormalizedSchema): Promise<GeneratorCallback>;
4
- //# sourceMappingURL=add-linting.d.ts.map
@@ -4,8 +4,7 @@ exports.addLinting = addLinting;
4
4
  const eslint_1 = require("@nx/eslint");
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  const react_1 = require("@nx/react");
7
- const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
8
- const flat_config_1 = require("@nx/eslint/src/utils/flat-config");
7
+ const internal_1 = require("@nx/eslint/internal");
9
8
  async function addLinting(host, options) {
10
9
  if (options.linter === 'none') {
11
10
  return () => { };
@@ -21,21 +20,21 @@ async function addLinting(host, options) {
21
20
  addPlugin: options.addPlugin,
22
21
  });
23
22
  tasks.push(lintTask);
24
- if ((0, eslint_file_1.isEslintConfigSupported)(host)) {
25
- if ((0, flat_config_1.useFlatConfig)(host)) {
26
- (0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(host, options.e2eProjectRoot, 'flat/react', { checkBaseConfig: true });
23
+ if ((0, internal_1.isEslintConfigSupported)(host)) {
24
+ if ((0, internal_1.useFlatConfig)(host)) {
25
+ (0, internal_1.addPredefinedConfigToFlatLintConfig)(host, options.e2eProjectRoot, 'flat/react', { checkBaseConfig: true });
27
26
  // Add an empty rules object to users know how to add/override rules
28
- (0, eslint_file_1.addOverrideToLintConfig)(host, options.e2eProjectRoot, {
27
+ (0, internal_1.addOverrideToLintConfig)(host, options.e2eProjectRoot, {
29
28
  files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
30
29
  rules: {},
31
30
  });
32
31
  }
33
32
  else {
34
- const addExtendsTask = (0, eslint_file_1.addExtendsToLintConfig)(host, options.e2eProjectRoot, { name: 'plugin:@nx/react', needCompatFixup: true });
33
+ const addExtendsTask = (0, internal_1.addExtendsToLintConfig)(host, options.e2eProjectRoot, { name: 'plugin:@nx/react', needCompatFixup: true });
35
34
  tasks.push(addExtendsTask);
36
35
  }
37
36
  }
38
- const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, react_1.extraEslintDependencies.dependencies, react_1.extraEslintDependencies.devDependencies);
37
+ const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, react_1.extraEslintDependencies.dependencies, react_1.extraEslintDependencies.devDependencies, undefined, true);
39
38
  tasks.push(installTask);
40
39
  return (0, devkit_1.runTasksInSerial)(...tasks);
41
40
  }
@@ -1,4 +1,3 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  import { NormalizedSchema } from './normalize-options';
3
3
  export declare function addProject(host: Tree, options: NormalizedSchema): void;
4
- //# sourceMappingURL=add-project.d.ts.map
@@ -3,11 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addProject = addProject;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const get_targets_1 = require("./get-targets");
6
+ const deprecation_1 = require("../../../utils/deprecation");
6
7
  function addProject(host, options) {
7
8
  const nxJson = (0, devkit_1.readNxJson)(host);
8
9
  const hasPlugin = nxJson.plugins?.some((p) => typeof p === 'string'
9
10
  ? p === '@nx/detox/plugin'
10
11
  : p.plugin === '@nx/detox/plugin');
12
+ if (!hasPlugin) {
13
+ (0, deprecation_1.warnDetoxExecutorsGenerating)();
14
+ }
11
15
  const packageJson = {
12
16
  name: options.importPath,
13
17
  version: '0.0.1',
@@ -1,4 +1,3 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  import { NormalizedSchema } from './normalize-options';
3
3
  export declare function createFiles(host: Tree, options: NormalizedSchema): void;
4
- //# sourceMappingURL=create-files.d.ts.map
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createFiles = createFiles;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const js_1 = require("@nx/js");
6
- const add_swc_config_1 = require("@nx/js/src/utils/swc/add-swc-config");
6
+ const internal_1 = require("@nx/js/internal");
7
7
  const path_1 = require("path");
8
8
  function createFiles(host, options) {
9
9
  const offsetFromRoot = (0, devkit_1.offsetFromRoot)(options.e2eProjectRoot);
@@ -18,7 +18,7 @@ function createFiles(host, options) {
18
18
  : 'jest.config.json',
19
19
  });
20
20
  if (options.isUsingTsSolutionConfig) {
21
- (0, add_swc_config_1.addSwcTestConfig)(host, options.e2eProjectRoot, 'es6');
21
+ (0, internal_1.addSwcTestConfig)(host, options.e2eProjectRoot, 'es6');
22
22
  (0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files/ts-solution'), options.e2eProjectRoot, {
23
23
  ...options,
24
24
  exec: (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(host.root)).exec,
@@ -1,4 +1,3 @@
1
1
  import { type Tree } from '@nx/devkit';
2
2
  import type { NormalizedSchema } from './normalize-options';
3
3
  export declare function ensureDependencies(tree: Tree, options: NormalizedSchema): import("@nx/devkit").GeneratorCallback;
4
- //# sourceMappingURL=ensure-dependencies.d.ts.map
@@ -2,17 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ensureDependencies = ensureDependencies;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const versions_1 = require("@nx/jest/src/utils/versions");
6
- const versions_2 = require("../../../utils/versions");
5
+ const internal_1 = require("@nx/jest/internal");
6
+ const versions_1 = require("../../../utils/versions");
7
7
  function ensureDependencies(tree, options) {
8
- const { jestVersion, typesNodeVersion } = (0, versions_1.versions)(tree);
8
+ const { jestVersion, typesNodeVersion } = (0, internal_1.versions)(tree);
9
9
  const devDependencies = {
10
- '@testing-library/jest-dom': versions_2.testingLibraryJestDom,
10
+ '@testing-library/jest-dom': versions_1.testingLibraryJestDom,
11
11
  '@types/node': typesNodeVersion,
12
12
  'jest-circus': jestVersion,
13
13
  };
14
14
  if (options.framework === 'expo') {
15
- devDependencies['@config-plugins/detox'] = versions_2.configPluginsDetoxVersion;
15
+ devDependencies['@config-plugins/detox'] = versions_1.configPluginsDetoxVersion;
16
16
  }
17
- return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies);
17
+ return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies, undefined, true);
18
18
  }
@@ -49,4 +49,3 @@ export declare function expoTestTarget(platform: 'ios.sim' | 'android.emu', e2eN
49
49
  };
50
50
  };
51
51
  };
52
- //# sourceMappingURL=get-targets.d.ts.map
@@ -11,4 +11,3 @@ export interface NormalizedSchema extends Omit<Schema, 'e2eName'> {
11
11
  isUsingTsSolutionConfig?: boolean;
12
12
  }
13
13
  export declare function normalizeOptions(host: Tree, options: Schema): Promise<NormalizedSchema>;
14
- //# sourceMappingURL=normalize-options.d.ts.map
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeOptions = normalizeOptions;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
6
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
5
+ const internal_1 = require("@nx/devkit/internal");
6
+ const internal_2 = require("@nx/js/internal");
7
7
  async function normalizeOptions(host, options) {
8
- const { projectName, projectRoot: e2eProjectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
8
+ const { projectName, projectRoot: e2eProjectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
9
9
  name: options.e2eName,
10
10
  projectType: 'application',
11
11
  directory: options.e2eDirectory,
@@ -16,7 +16,7 @@ async function normalizeOptions(host, options) {
16
16
  options.addPlugin ??= addPlugin;
17
17
  const { fileName: appFileName, className: appClassName } = (0, devkit_1.names)(options.appName || options.appProject);
18
18
  const { root: appRoot } = (0, devkit_1.readProjectConfiguration)(host, options.appProject);
19
- const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
19
+ const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(host);
20
20
  const e2eProjectName = !isUsingTsSolutionConfig || options.e2eName ? projectName : importPath;
21
21
  // We default to generate a project.json file if the new setup is not being used
22
22
  const useProjectJson = options.useProjectJson ?? !isUsingTsSolutionConfig;
@@ -5,4 +5,3 @@ interface Schema {
5
5
  }
6
6
  export declare function convertToInferred(tree: Tree, options: Schema): Promise<() => void>;
7
7
  export default convertToInferred;
8
- //# sourceMappingURL=convert-to-inferred.d.ts.map
@@ -1,17 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.convertToInferred = convertToInferred;
4
+ const internal_1 = require("@nx/devkit/internal");
4
5
  const devkit_1 = require("@nx/devkit");
5
- const aggregate_log_util_1 = require("@nx/devkit/src/generators/plugin-migrations/aggregate-log-util");
6
- const executor_to_plugin_migrator_1 = require("@nx/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator");
7
6
  const plugin_1 = require("../../plugins/plugin");
7
+ const versions_1 = require("../../utils/versions");
8
8
  const process_build_options_1 = require("./lib/process-build-options");
9
9
  const post_target_transformer_1 = require("./lib/post-target-transformer");
10
10
  const process_test_options_1 = require("./lib/process-test-options");
11
11
  async function convertToInferred(tree, options) {
12
+ (0, versions_1.assertSupportedDetoxVersion)(tree);
12
13
  const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
13
- const migrationLogs = new aggregate_log_util_1.AggregatedLog();
14
- const migratedProjects = await (0, executor_to_plugin_migrator_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/detox/plugin', plugin_1.createNodesV2, {
14
+ const migrationLogs = new internal_1.AggregatedLog();
15
+ const migratedProjects = await (0, internal_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/detox/plugin', plugin_1.createNodesV2, {
15
16
  buildTargetName: 'build',
16
17
  startTargetName: 'start',
17
18
  testTargetName: 'test',
@@ -67,7 +68,7 @@ async function convertToInferred(tree, options) {
67
68
  }
68
69
  (0, devkit_1.updateNxJson)(tree, nxJson);
69
70
  if (migratedProjects.size === 0) {
70
- throw new executor_to_plugin_migrator_1.NoTargetsToMigrateError();
71
+ throw new internal_1.NoTargetsToMigrateError();
71
72
  }
72
73
  if (!options.skipFormat) {
73
74
  await (0, devkit_1.formatFiles)(tree);
@@ -1,7 +1,6 @@
1
1
  import type { TargetConfiguration, Tree } from '@nx/devkit';
2
- import type { AggregatedLog } from '@nx/devkit/src/generators/plugin-migrations/aggregate-log-util';
2
+ import { type AggregatedLog } from '@nx/devkit/internal';
3
3
  export declare function postTargetTransformer(migrationLogs: AggregatedLog, processOptions: (tree: Tree, options: any, projectName: string, projectRoot: string, target: TargetConfiguration | undefined, migrationLogs: AggregatedLog) => void): (target: TargetConfiguration, tree: Tree, projectDetails: {
4
4
  projectName: string;
5
5
  root: string;
6
6
  }, inferredTargetConfiguration: TargetConfiguration) => TargetConfiguration<any>;
7
- //# sourceMappingURL=post-target-transformer.d.ts.map
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.postTargetTransformer = postTargetTransformer;
4
- const plugin_migration_utils_1 = require("@nx/devkit/src/generators/plugin-migrations/plugin-migration-utils");
4
+ const internal_1 = require("@nx/devkit/internal");
5
5
  function postTargetTransformer(migrationLogs, processOptions) {
6
6
  return (target, tree, projectDetails, inferredTargetConfiguration) => {
7
7
  if (target.options) {
@@ -24,7 +24,7 @@ function postTargetTransformer(migrationLogs, processOptions) {
24
24
  }
25
25
  }
26
26
  if (target.outputs) {
27
- (0, plugin_migration_utils_1.processTargetOutputs)(target, [], inferredTargetConfiguration, {
27
+ (0, internal_1.processTargetOutputs)(target, [], inferredTargetConfiguration, {
28
28
  projectName: projectDetails.projectName,
29
29
  projectRoot: projectDetails.root,
30
30
  });
@@ -1,4 +1,3 @@
1
1
  import { type TargetConfiguration, type Tree } from '@nx/devkit';
2
- import type { AggregatedLog } from '@nx/devkit/src/generators/plugin-migrations/aggregate-log-util';
2
+ import type { AggregatedLog } from '@nx/devkit/internal';
3
3
  export declare function processBuildOptions(_tree: Tree, options: any, projectName: string, _projectRoot: string, target: TargetConfiguration | undefined, _migrationLogs: AggregatedLog): void;
4
- //# sourceMappingURL=process-build-options.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import { type TargetConfiguration, type Tree } from '@nx/devkit';
2
- import type { AggregatedLog } from '@nx/devkit/src/generators/plugin-migrations/aggregate-log-util';
2
+ import type { AggregatedLog } from '@nx/devkit/internal';
3
3
  export declare function processTestOptions(_tree: Tree, options: any, projectName: string, _projectRoot: string, target: TargetConfiguration | undefined, migrationLogs: AggregatedLog): void;
4
- //# sourceMappingURL=process-test-options.d.ts.map
@@ -24,12 +24,14 @@ function processTestOptions(_tree, options, projectName, _projectRoot, target, m
24
24
  delete options.color;
25
25
  }
26
26
  if ('buildTarget' in options) {
27
- migrationLogs.addLog({
28
- project: projectName,
29
- executorName: '@nx/expo:test',
30
- log: 'Unable to migrate `buildTarget` for Detox test. Use "nx run <project>:run-ios" or "nx run <project>:run-android", and pass "--reuse" option when running tests.',
31
- });
27
+ const value = options.buildTarget;
32
28
  delete options.buildTarget;
29
+ if (target && typeof value === 'string' && value.length > 0) {
30
+ target.dependsOn ??= [];
31
+ if (!target.dependsOn.includes(value)) {
32
+ target.dependsOn.push(value);
33
+ }
34
+ }
33
35
  }
34
36
  const deprecatedOptions = [
35
37
  'runnerConfig',
@@ -42,7 +44,7 @@ function processTestOptions(_tree, options, projectName, _projectRoot, target, m
42
44
  continue;
43
45
  migrationLogs.addLog({
44
46
  project: projectName,
45
- executorName: '@nx/expo:test',
47
+ executorName: '@nx/detox:test',
46
48
  log: `Option "${key}" is not migrated since it was removed in Detox 20.`,
47
49
  });
48
50
  delete options[key];
@@ -4,4 +4,3 @@ export declare function detoxInitGenerator(host: Tree, schema: Schema): Promise<
4
4
  export declare function detoxInitGeneratorInternal(host: Tree, schema: Schema): Promise<GeneratorCallback>;
5
5
  export declare function updateDependencies(host: Tree, schema: Schema): GeneratorCallback;
6
6
  export default detoxInitGenerator;
7
- //# sourceMappingURL=init.d.ts.map
@@ -3,14 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.detoxInitGenerator = detoxInitGenerator;
4
4
  exports.detoxInitGeneratorInternal = detoxInitGeneratorInternal;
5
5
  exports.updateDependencies = updateDependencies;
6
+ const internal_1 = require("@nx/devkit/internal");
6
7
  const devkit_1 = require("@nx/devkit");
7
- const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
8
8
  const plugin_1 = require("../../plugins/plugin");
9
9
  const versions_1 = require("../../utils/versions");
10
10
  function detoxInitGenerator(host, schema) {
11
11
  return detoxInitGeneratorInternal(host, { addPlugin: false, ...schema });
12
12
  }
13
13
  async function detoxInitGeneratorInternal(host, schema) {
14
+ (0, versions_1.assertSupportedDetoxVersion)(host);
14
15
  const tasks = [];
15
16
  const nxJson = (0, devkit_1.readNxJson)(host);
16
17
  const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
@@ -21,7 +22,7 @@ async function detoxInitGeneratorInternal(host, schema) {
21
22
  tasks.push(updateDependencies(host, schema));
22
23
  }
23
24
  if (schema.addPlugin) {
24
- await (0, add_plugin_1.addPlugin)(host, await (0, devkit_1.createProjectGraphAsync)(), '@nx/detox/plugin', plugin_1.createNodesV2, {
25
+ await (0, internal_1.addPlugin)(host, await (0, devkit_1.createProjectGraphAsync)(), '@nx/detox/plugin', plugin_1.createNodesV2, {
25
26
  buildTargetName: ['build', 'detox:build', 'detox-build'],
26
27
  startTargetName: ['start', 'detox:start', 'detox-start'],
27
28
  testTargetName: ['test', 'detox:test', 'detox-test'],
@@ -46,7 +47,7 @@ function updateDependencies(host, schema) {
46
47
  return (0, devkit_1.addDependenciesToPackageJson)(host, {}, {
47
48
  '@nx/detox': versions_1.nxVersion,
48
49
  detox: versions_1.detoxVersion,
49
- }, undefined, schema.keepExistingVersions);
50
+ }, undefined, schema.keepExistingVersions ?? true);
50
51
  }
51
52
  function moveDependency(host) {
52
53
  return (0, devkit_1.removeDependenciesFromPackageJson)(host, ['@nx/detox'], []);
@@ -20,7 +20,7 @@
20
20
  "type": "boolean",
21
21
  "x-priority": "internal",
22
22
  "description": "Keep existing dependencies versions",
23
- "default": false
23
+ "default": true
24
24
  },
25
25
  "updatePackageScripts": {
26
26
  "type": "boolean",
@@ -9,4 +9,3 @@ import { Tree } from '@nx/devkit';
9
9
  * using Expo 54 or above.
10
10
  */
11
11
  export default function update(tree: Tree): Promise<void>;
12
- //# sourceMappingURL=remove-config-plugins-detox-for-expo-54.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { type Tree } from '@nx/devkit';
2
+ export default function migrateCreateNodesV2ToCreateNodes(tree: Tree): Promise<void>;
3
+ /**
4
+ * Rewrites named imports and re-exports of `createNodesV2` to `createNodes`
5
+ * when they come from one of the given module specifiers. Only the named
6
+ * bindings are touched — the module specifier, the `import`/`export` keyword,
7
+ * any `type` modifier, and any default import are left untouched.
8
+ */
9
+ export declare function rewriteCreateNodesV2Imports(source: string, specifiers: ReadonlySet<string>): string;