@nx/cypress 17.3.0-beta.5 → 17.3.0-beta.8

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/cypress",
3
- "version": "17.3.0-beta.5",
3
+ "version": "17.3.0-beta.8",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Cypress contains executors and generators allowing your workspace to use the powerful Cypress integration testing capabilities.",
6
6
  "repository": {
@@ -34,14 +34,14 @@
34
34
  "migrations": "./migrations.json"
35
35
  },
36
36
  "dependencies": {
37
- "@nx/devkit": "17.3.0-beta.5",
38
- "@nx/eslint": "17.3.0-beta.5",
39
- "@nx/js": "17.3.0-beta.5",
37
+ "@nx/devkit": "17.3.0-beta.8",
38
+ "@nx/eslint": "17.3.0-beta.8",
39
+ "@nx/js": "17.3.0-beta.8",
40
40
  "@phenomnomnominal/tsquery": "~5.0.1",
41
41
  "detect-port": "^1.5.1",
42
42
  "semver": "7.5.3",
43
43
  "tslib": "^2.3.0",
44
- "@nrwl/cypress": "17.3.0-beta.5"
44
+ "@nrwl/cypress": "17.3.0-beta.8"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "cypress": ">= 3 < 14"
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cypressInitGenerator = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
+ const update_package_scripts_1 = require("@nx/devkit/src/utils/update-package-scripts");
6
+ const plugin_1 = require("../../plugins/plugin");
5
7
  const versions_1 = require("../../utils/versions");
6
8
  function setupE2ETargetDefaults(tree) {
7
9
  const nxJson = (0, devkit_1.readNxJson)(tree);
@@ -19,13 +21,13 @@ function setupE2ETargetDefaults(tree) {
19
21
  ];
20
22
  (0, devkit_1.updateNxJson)(tree, nxJson);
21
23
  }
22
- function updateDependencies(tree) {
24
+ function updateDependencies(tree, options) {
23
25
  const tasks = [];
24
26
  tasks.push((0, devkit_1.removeDependenciesFromPackageJson)(tree, ['@nx/cypress'], []));
25
27
  tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
26
28
  ['@nx/cypress']: versions_1.nxVersion,
27
29
  cypress: versions_1.cypressVersion,
28
- }));
30
+ }, undefined, options.keepExistingVersions));
29
31
  return (0, devkit_1.runTasksInSerial)(...tasks);
30
32
  }
31
33
  function addPlugin(tree) {
@@ -70,7 +72,10 @@ async function cypressInitGenerator(tree, options) {
70
72
  }
71
73
  let installTask = () => { };
72
74
  if (!options.skipPackageJson) {
73
- installTask = updateDependencies(tree);
75
+ installTask = updateDependencies(tree, options);
76
+ }
77
+ if (options.updatePackageScripts) {
78
+ await (0, update_package_scripts_1.updatePackageScripts)(tree, plugin_1.createNodes);
74
79
  }
75
80
  if (!options.skipFormat) {
76
81
  await (0, devkit_1.formatFiles)(tree);
@@ -1,4 +1,6 @@
1
1
  export interface Schema {
2
2
  skipFormat?: boolean;
3
3
  skipPackageJson?: boolean;
4
+ keepExistingVersions?: boolean;
5
+ updatePackageScripts?: boolean;
4
6
  }
@@ -17,6 +17,18 @@
17
17
  "default": false,
18
18
  "description": "Do not add dependencies to `package.json`.",
19
19
  "x-priority": "internal"
20
+ },
21
+ "keepExistingVersions": {
22
+ "type": "boolean",
23
+ "x-priority": "internal",
24
+ "description": "Keep existing dependencies versions",
25
+ "default": false
26
+ },
27
+ "updatePackageScripts": {
28
+ "type": "boolean",
29
+ "x-priority": "internal",
30
+ "description": "Update `package.json` scripts with inferred targets",
31
+ "default": false
20
32
  }
21
33
  }
22
34
  }