@nx/detox 18.3.0-beta.1 → 18.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/detox",
3
- "version": "18.3.0-beta.1",
3
+ "version": "18.3.0-beta.2",
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": [
@@ -25,13 +25,13 @@
25
25
  "main": "./index.js",
26
26
  "types": "index.d.ts",
27
27
  "dependencies": {
28
- "@nx/devkit": "18.3.0-beta.1",
29
- "@nx/jest": "18.3.0-beta.1",
30
- "@nx/js": "18.3.0-beta.1",
31
- "@nx/eslint": "18.3.0-beta.1",
32
- "@nx/react": "18.3.0-beta.1",
28
+ "@nx/devkit": "18.3.0-beta.2",
29
+ "@nx/jest": "18.3.0-beta.2",
30
+ "@nx/js": "18.3.0-beta.2",
31
+ "@nx/eslint": "18.3.0-beta.2",
32
+ "@nx/react": "18.3.0-beta.2",
33
33
  "tslib": "^2.3.0",
34
- "@nrwl/detox": "18.3.0-beta.1"
34
+ "@nrwl/detox": "18.3.0-beta.2"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "detox": "^20.9.0"
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateDependencies = exports.detoxInitGeneratorInternal = exports.detoxInitGenerator = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const update_package_scripts_1 = require("@nx/devkit/src/utils/update-package-scripts");
5
+ const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
6
6
  const plugin_1 = require("../../plugins/plugin");
7
7
  const versions_1 = require("../../utils/versions");
8
8
  function detoxInitGenerator(host, schema) {
@@ -20,10 +20,11 @@ async function detoxInitGeneratorInternal(host, schema) {
20
20
  tasks.push(updateDependencies(host, schema));
21
21
  }
22
22
  if (schema.addPlugin) {
23
- addPlugin(host);
24
- }
25
- if (schema.updatePackageScripts) {
26
- await (0, update_package_scripts_1.updatePackageScripts)(host, plugin_1.createNodes);
23
+ await (0, add_plugin_1.addPlugin)(host, await (0, devkit_1.createProjectGraphAsync)(), '@nx/detox/plugin', plugin_1.createNodes, {
24
+ buildTargetName: ['build', 'detox:build', 'detox-build'],
25
+ startTargetName: ['start', 'detox:start', 'detox-start'],
26
+ testTargetName: ['test', 'detox:test', 'detox-test'],
27
+ }, schema.updatePackageScripts);
27
28
  }
28
29
  if (!schema.skipFormat) {
29
30
  await (0, devkit_1.formatFiles)(host);
@@ -41,24 +42,4 @@ exports.updateDependencies = updateDependencies;
41
42
  function moveDependency(host) {
42
43
  return (0, devkit_1.removeDependenciesFromPackageJson)(host, ['@nx/detox'], []);
43
44
  }
44
- function addPlugin(host) {
45
- const nxJson = (0, devkit_1.readNxJson)(host);
46
- nxJson.plugins ??= [];
47
- for (const plugin of nxJson.plugins) {
48
- if (typeof plugin === 'string'
49
- ? plugin === '@nx/detox/plugin'
50
- : plugin.plugin === '@nx/detox/plugin') {
51
- return;
52
- }
53
- }
54
- nxJson.plugins.push({
55
- plugin: '@nx/detox/plugin',
56
- options: {
57
- buildTargetName: 'build',
58
- startTargetName: 'start',
59
- testTargetName: 'test',
60
- },
61
- });
62
- (0, devkit_1.updateNxJson)(host, nxJson);
63
- }
64
45
  exports.default = detoxInitGenerator;