@nx/detox 23.0.0-beta.5 → 23.0.0-beta.6

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 (27) hide show
  1. package/package.json +7 -7
  2. package/src/executors/build/build.impl.d.ts.map +1 -1
  3. package/src/executors/build/build.impl.js +2 -0
  4. package/src/executors/build/schema.json +1 -0
  5. package/src/executors/test/schema.json +1 -0
  6. package/src/executors/test/test.impl.d.ts.map +1 -1
  7. package/src/executors/test/test.impl.js +2 -0
  8. package/src/generators/application/lib/add-project.d.ts.map +1 -1
  9. package/src/generators/application/lib/add-project.js +4 -0
  10. package/src/generators/application/lib/normalize-options.js +2 -2
  11. package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +1 -1
  12. package/src/generators/convert-to-inferred/convert-to-inferred.js +4 -5
  13. package/src/generators/convert-to-inferred/lib/post-target-transformer.d.ts +1 -1
  14. package/src/generators/convert-to-inferred/lib/post-target-transformer.d.ts.map +1 -1
  15. package/src/generators/convert-to-inferred/lib/post-target-transformer.js +2 -2
  16. package/src/generators/convert-to-inferred/lib/process-build-options.d.ts +1 -1
  17. package/src/generators/convert-to-inferred/lib/process-build-options.d.ts.map +1 -1
  18. package/src/generators/convert-to-inferred/lib/process-test-options.d.ts +1 -1
  19. package/src/generators/convert-to-inferred/lib/process-test-options.d.ts.map +1 -1
  20. package/src/generators/convert-to-inferred/lib/process-test-options.js +8 -6
  21. package/src/generators/init/init.d.ts.map +1 -1
  22. package/src/generators/init/init.js +2 -2
  23. package/src/plugins/plugin.d.ts.map +1 -1
  24. package/src/plugins/plugin.js +15 -23
  25. package/src/utils/deprecation.d.ts +4 -0
  26. package/src/utils/deprecation.d.ts.map +1 -0
  27. package/src/utils/deprecation.js +21 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/detox",
3
- "version": "23.0.0-beta.5",
3
+ "version": "23.0.0-beta.6",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Detox contains executors and generators for allowing your workspace to use the powerful Detox integration testing capabilities.",
6
6
  "keywords": [
@@ -28,16 +28,16 @@
28
28
  "type": "commonjs",
29
29
  "types": "index.d.ts",
30
30
  "dependencies": {
31
- "@nx/devkit": "23.0.0-beta.5",
32
- "@nx/jest": "23.0.0-beta.5",
33
- "@nx/js": "23.0.0-beta.5",
34
- "@nx/eslint": "23.0.0-beta.5",
35
- "@nx/react": "23.0.0-beta.5",
31
+ "@nx/devkit": "23.0.0-beta.6",
32
+ "@nx/jest": "23.0.0-beta.6",
33
+ "@nx/js": "23.0.0-beta.6",
34
+ "@nx/eslint": "23.0.0-beta.6",
35
+ "@nx/react": "23.0.0-beta.6",
36
36
  "semver": "^7.6.3",
37
37
  "tslib": "^2.3.0"
38
38
  },
39
39
  "devDependencies": {
40
- "nx": "23.0.0-beta.5"
40
+ "nx": "23.0.0-beta.6"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "detox": "^20.9.0"
@@ -1 +1 @@
1
- {"version":3,"file":"build.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/detox/src/executors/build/build.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAK7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;CAClB;AAID,wBAA+B,kBAAkB,CAC/C,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,eAAe,GACvB,cAAc,CAAC,gBAAgB,CAAC,CAalC;AAED,wBAAgB,WAAW,CACzB,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,iBAAiB,oBA4B3B"}
1
+ {"version":3,"file":"build.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/detox/src/executors/build/build.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAK7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;CAClB;AAID,wBAA+B,kBAAkB,CAC/C,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,eAAe,GACvB,cAAc,CAAC,gBAAgB,CAAC,CAelC;AAED,wBAAgB,WAAW,CACzB,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,iBAAiB,oBA4B3B"}
@@ -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",
@@ -1 +1 @@
1
- {"version":3,"file":"test.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/detox/src/executors/test/test.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGhB,MAAM,YAAY,CAAC;AASpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB;AAID,wBAA+B,iBAAiB,CAC9C,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,eAAe,GACvB,cAAc,CAAC,eAAe,CAAC,CA0BjC"}
1
+ {"version":3,"file":"test.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/detox/src/executors/test/test.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGhB,MAAM,YAAY,CAAC;AASpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB;AAID,wBAA+B,iBAAiB,CAC9C,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,eAAe,GACvB,cAAc,CAAC,eAAe,CAAC,CA4BjC"}
@@ -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) {
@@ -1 +1 @@
1
- {"version":3,"file":"add-project.d.ts","sourceRoot":"","sources":["../../../../../../../packages/detox/src/generators/application/lib/add-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,EAEL,MAAM,YAAY,CAAC;AAOpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,QAyC/D"}
1
+ {"version":3,"file":"add-project.d.ts","sourceRoot":"","sources":["../../../../../../../packages/detox/src/generators/application/lib/add-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,EAEL,MAAM,YAAY,CAAC;AAOpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,QA6C/D"}
@@ -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.warnDetoxExecutorsScaffolding)();
14
+ }
11
15
  const packageJson = {
12
16
  name: options.importPath,
13
17
  version: '0.0.1',
@@ -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");
5
+ const internal_1 = require("@nx/devkit/internal");
6
6
  const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
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,
@@ -1 +1 @@
1
- {"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/detox/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,IAAI,EAEV,MAAM,YAAY,CAAC;AAWpB,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,uBAyFlE;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/detox/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,IAAI,EAEV,MAAM,YAAY,CAAC;AAMpB,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,uBAyFlE;AAED,eAAe,iBAAiB,CAAC"}
@@ -1,17 +1,16 @@
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");
8
7
  const process_build_options_1 = require("./lib/process-build-options");
9
8
  const post_target_transformer_1 = require("./lib/post-target-transformer");
10
9
  const process_test_options_1 = require("./lib/process-test-options");
11
10
  async function convertToInferred(tree, options) {
12
11
  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, {
12
+ const migrationLogs = new internal_1.AggregatedLog();
13
+ const migratedProjects = await (0, internal_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/detox/plugin', plugin_1.createNodesV2, {
15
14
  buildTargetName: 'build',
16
15
  startTargetName: 'start',
17
16
  testTargetName: 'test',
@@ -67,7 +66,7 @@ async function convertToInferred(tree, options) {
67
66
  }
68
67
  (0, devkit_1.updateNxJson)(tree, nxJson);
69
68
  if (migratedProjects.size === 0) {
70
- throw new executor_to_plugin_migrator_1.NoTargetsToMigrateError();
69
+ throw new internal_1.NoTargetsToMigrateError();
71
70
  }
72
71
  if (!options.skipFormat) {
73
72
  await (0, devkit_1.formatFiles)(tree);
@@ -1,5 +1,5 @@
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;
@@ -1 +1 @@
1
- {"version":3,"file":"post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/detox/src/generators/convert-to-inferred/lib/post-target-transformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gEAAgE,CAAC;AAGpG,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,CACd,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,mBAAmB,GAAG,SAAS,EACvC,aAAa,EAAE,aAAa,KACzB,IAAI,IAGP,QAAQ,mBAAmB,EAC3B,MAAM,IAAI,EACV,gBAAgB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACrD,6BAA6B,mBAAmB,8BAkDnD"}
1
+ {"version":3,"file":"post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/detox/src/generators/convert-to-inferred/lib/post-target-transformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE/E,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,CACd,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,mBAAmB,GAAG,SAAS,EACvC,aAAa,EAAE,aAAa,KACzB,IAAI,IAGP,QAAQ,mBAAmB,EAC3B,MAAM,IAAI,EACV,gBAAgB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACrD,6BAA6B,mBAAmB,8BAkDnD"}
@@ -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,4 @@
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
4
  //# sourceMappingURL=process-build-options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"process-build-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/detox/src/generators/convert-to-inferred/lib/process-build-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,mBAAmB,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gEAAgE,CAAC;AAEpG,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,IAAI,EACX,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,mBAAmB,GAAG,SAAS,EACvC,cAAc,EAAE,aAAa,GAC5B,IAAI,CAwBN"}
1
+ {"version":3,"file":"process-build-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/detox/src/generators/convert-to-inferred/lib/process-build-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,mBAAmB,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,IAAI,EACX,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,mBAAmB,GAAG,SAAS,EACvC,cAAc,EAAE,aAAa,GAC5B,IAAI,CAwBN"}
@@ -1,4 +1,4 @@
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
4
  //# sourceMappingURL=process-test-options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"process-test-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/detox/src/generators/convert-to-inferred/lib/process-test-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,mBAAmB,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gEAAgE,CAAC;AAEpG,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,IAAI,EACX,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,mBAAmB,GAAG,SAAS,EACvC,aAAa,EAAE,aAAa,GAC3B,IAAI,CAiEN"}
1
+ {"version":3,"file":"process-test-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/detox/src/generators/convert-to-inferred/lib/process-test-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,mBAAmB,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,IAAI,EACX,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,mBAAmB,GAAG,SAAS,EACvC,aAAa,EAAE,aAAa,GAC3B,IAAI,CAoEN"}
@@ -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];
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/detox/src/generators/init/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAIjB,IAAI,EACL,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAE5D;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BA6C1E;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,qBAW5D;AAMD,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/detox/src/generators/init/init.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EAIjB,IAAI,EACL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAE5D;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BA6C1E;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,qBAW5D;AAMD,eAAe,kBAAkB,CAAC"}
@@ -3,8 +3,8 @@ 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) {
@@ -21,7 +21,7 @@ async function detoxInitGeneratorInternal(host, schema) {
21
21
  tasks.push(updateDependencies(host, schema));
22
22
  }
23
23
  if (schema.addPlugin) {
24
- await (0, add_plugin_1.addPlugin)(host, await (0, devkit_1.createProjectGraphAsync)(), '@nx/detox/plugin', plugin_1.createNodesV2, {
24
+ await (0, internal_1.addPlugin)(host, await (0, devkit_1.createProjectGraphAsync)(), '@nx/detox/plugin', plugin_1.createNodesV2, {
25
25
  buildTargetName: ['build', 'detox:build', 'detox-build'],
26
26
  startTargetName: ['start', 'detox:start', 'detox-start'],
27
27
  testTargetName: ['test', 'detox:test', 'detox-test'],
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/detox/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EAOd,MAAM,YAAY,CAAC;AAUpB,MAAM,WAAW,kBAAkB;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAsBD,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,kBAAkB,CAsBzD,CAAC;AAEF,eAAO,MAAM,aAAa,mCAAc,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/detox/src/plugins/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,aAAa,EAKd,MAAM,YAAY,CAAC;AAOpB,MAAM,WAAW,kBAAkB;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAID,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,kBAAkB,CA6BzD,CAAC;AAEF,eAAO,MAAM,aAAa,mCAAc,CAAC"}
@@ -1,56 +1,48 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createNodesV2 = exports.createNodes = void 0;
4
+ const internal_1 = require("@nx/devkit/internal");
4
5
  const devkit_1 = require("@nx/devkit");
5
6
  const path_1 = require("path");
6
7
  const js_1 = require("@nx/js");
7
- const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
8
- const fs_1 = require("fs");
9
- const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
10
8
  const cache_directory_1 = require("nx/src/utils/cache-directory");
11
9
  const devkit_internals_1 = require("nx/src/devkit-internals");
12
10
  const util_1 = require("@nx/js/src/plugins/typescript/util");
13
- function readTargetsCache(cachePath) {
14
- return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
15
- }
16
- function writeTargetsToCache(cachePath, targetsCache) {
17
- const oldCache = readTargetsCache(cachePath);
18
- (0, devkit_1.writeJsonFile)(cachePath, {
19
- ...oldCache,
20
- targetsCache,
21
- });
22
- }
23
11
  exports.createNodes = [
24
12
  '**/{detox.config,.detoxrc}.{json,js}',
25
13
  async (configFiles, options, context) => {
26
14
  const optionsHash = (0, devkit_internals_1.hashObject)(options);
27
- const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `expo-${optionsHash}.hash`);
28
- const targetsCache = readTargetsCache(cachePath);
29
- const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
15
+ const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `detox-${optionsHash}.hash`);
16
+ const targetsCache = new internal_1.PluginCache(cachePath);
17
+ const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
18
+ const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
19
+ const lockFileName = (0, js_1.getLockFileName)(packageManager);
30
20
  try {
31
- return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, pmc), configFiles, options, context);
21
+ return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, pmc, lockFileName), configFiles, options, context);
32
22
  }
33
23
  finally {
34
- writeTargetsToCache(cachePath, targetsCache);
24
+ targetsCache.writeToDisk();
35
25
  }
36
26
  },
37
27
  ];
38
28
  exports.createNodesV2 = exports.createNodes;
39
- async function createNodesInternal(configFile, options, context, targetsCache, pmc) {
29
+ async function createNodesInternal(configFile, options, context, targetsCache, pmc, lockFileName) {
40
30
  options = normalizeOptions(options);
41
31
  const projectRoot = (0, path_1.dirname)(configFile);
42
- const hash = await (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, options, context, [(0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot))]);
43
- targetsCache[hash] ??= buildDetoxTargets(projectRoot, options, context, pmc);
32
+ const hash = await (0, internal_1.calculateHashForCreateNodes)(projectRoot, options, context, [lockFileName]);
33
+ if (!targetsCache.has(hash)) {
34
+ targetsCache.set(hash, buildDetoxTargets(projectRoot, options, context, pmc));
35
+ }
44
36
  return {
45
37
  projects: {
46
38
  [projectRoot]: {
47
- targets: targetsCache[hash],
39
+ targets: targetsCache.get(hash),
48
40
  },
49
41
  },
50
42
  };
51
43
  }
52
44
  function buildDetoxTargets(projectRoot, options, context, pmc) {
53
- const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);
45
+ const namedInputs = (0, internal_1.getNamedInputs)(projectRoot, context);
54
46
  const targets = {
55
47
  [options.buildTargetName]: {
56
48
  command: `detox build`,
@@ -0,0 +1,4 @@
1
+ export declare const DETOX_EXECUTORS_DEPRECATION_MESSAGE = "`@nx/detox:build` and `@nx/detox:test` are deprecated and will be removed in Nx v24. Run `nx g @nx/detox:convert-to-inferred` to migrate to the `@nx/detox/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.";
2
+ export declare function warnDetoxExecutorsDeprecation(): void;
3
+ export declare function warnDetoxExecutorsScaffolding(): void;
4
+ //# sourceMappingURL=deprecation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecation.d.ts","sourceRoot":"","sources":["../../../../../packages/detox/src/utils/deprecation.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mCAAmC,wQACuN,CAAC;AAExQ,wBAAgB,6BAA6B,IAAI,IAAI,CAEpD;AAOD,wBAAgB,6BAA6B,IAAI,IAAI,CAIpD"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DETOX_EXECUTORS_DEPRECATION_MESSAGE = void 0;
4
+ exports.warnDetoxExecutorsDeprecation = warnDetoxExecutorsDeprecation;
5
+ exports.warnDetoxExecutorsScaffolding = warnDetoxExecutorsScaffolding;
6
+ const devkit_1 = require("@nx/devkit");
7
+ // TODO(v24): Remove the @nx/detox:build and @nx/detox:test executors and the
8
+ // convert-to-inferred generator. The inferred plugin (@nx/detox/plugin) and
9
+ // the application/init generators stay supported.
10
+ exports.DETOX_EXECUTORS_DEPRECATION_MESSAGE = '`@nx/detox:build` and `@nx/detox:test` are deprecated and will be removed in Nx v24. Run `nx g @nx/detox:convert-to-inferred` to migrate to the `@nx/detox/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.';
11
+ function warnDetoxExecutorsDeprecation() {
12
+ devkit_1.logger.warn(exports.DETOX_EXECUTORS_DEPRECATION_MESSAGE);
13
+ }
14
+ // Fired when the @nx/detox:application generator is about to scaffold
15
+ // build-ios/test-ios/build-android/test-android targets that use the deprecated
16
+ // executors — i.e. when @nx/detox/plugin isn't registered in nx.json. Surfaces
17
+ // the deprecation at scaffold time rather than only when the user later runs
18
+ // the generated targets.
19
+ function warnDetoxExecutorsScaffolding() {
20
+ devkit_1.logger.warn('Scaffolding `build-ios`, `test-ios`, `build-android`, and `test-android` targets that use the deprecated `@nx/detox:build` and `@nx/detox:test` executors. These executors will be removed in Nx v24. Run `nx g @nx/detox:convert-to-inferred` after this scaffold to migrate the generated targets to the `@nx/detox/plugin` inferred plugin. To skip emitting executor targets entirely on future scaffolds, register `@nx/detox/plugin` in `nx.json` first (`nx add @nx/detox` or a manual plugin entry). See https://nx.dev/docs/technologies/test-tools/detox/introduction for details.');
21
+ }