@nx/jest 17.3.0-beta.6 → 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/jest",
3
- "version": "17.3.0-beta.6",
3
+ "version": "17.3.0-beta.8",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Jest contains executors and generators allowing your workspace to use the powerful Jest testing capabilities.",
6
6
  "repository": {
@@ -45,9 +45,9 @@
45
45
  "minimatch": "9.0.3",
46
46
  "resolve.exports": "1.1.0",
47
47
  "tslib": "^2.3.0",
48
- "@nx/devkit": "17.3.0-beta.6",
49
- "@nx/js": "17.3.0-beta.6",
50
- "@nrwl/jest": "17.3.0-beta.6"
48
+ "@nx/devkit": "17.3.0-beta.8",
49
+ "@nx/js": "17.3.0-beta.8",
50
+ "@nrwl/jest": "17.3.0-beta.8"
51
51
  },
52
52
  "publishConfig": {
53
53
  "access": "public"
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.jestInitGenerator = 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 addPlugin(tree) {
7
9
  const nxJson = (0, devkit_1.readNxJson)(tree);
@@ -82,6 +84,9 @@ async function jestInitGenerator(tree, options) {
82
84
  tasks.push((0, devkit_1.removeDependenciesFromPackageJson)(tree, ['@nx/jest'], []));
83
85
  tasks.push(updateDependencies(tree, options));
84
86
  }
87
+ if (options.updatePackageScripts) {
88
+ await (0, update_package_scripts_1.updatePackageScripts)(tree, plugin_1.createNodes);
89
+ }
85
90
  if (!options.skipFormat) {
86
91
  await (0, devkit_1.formatFiles)(tree);
87
92
  }
@@ -2,4 +2,5 @@ export interface JestInitSchema {
2
2
  skipFormat?: boolean;
3
3
  skipPackageJson?: boolean;
4
4
  keepExistingVersions?: boolean;
5
+ updatePackageScripts?: boolean;
5
6
  }
@@ -23,6 +23,12 @@
23
23
  "x-priority": "internal",
24
24
  "description": "Keep existing dependencies versions",
25
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
26
32
  }
27
33
  },
28
34
  "required": []
@@ -9,7 +9,7 @@ const fs_1 = require("fs");
9
9
  const jest_config_1 = require("jest-config");
10
10
  const cache_directory_1 = require("nx/src/utils/cache-directory");
11
11
  const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
12
- const package_json_workspaces_1 = require("nx/plugins/package-json-workspaces");
12
+ const package_json_workspaces_1 = require("nx/src/plugins/package-json-workspaces");
13
13
  const globs_1 = require("nx/src/utils/globs");
14
14
  const minimatch_1 = require("minimatch");
15
15
  const cachePath = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'jest.hash');