@nx/plugin 22.1.0-beta.5 → 22.1.0-beta.7

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/plugin",
3
- "version": "22.1.0-beta.5",
3
+ "version": "22.1.0-beta.7",
4
4
  "private": false,
5
5
  "description": "This plugin is used to create Nx plugins! It contains generators for generating common plugin features like generators, executors, migrations and more.",
6
6
  "repository": {
@@ -28,13 +28,13 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "tslib": "^2.3.0",
31
- "@nx/devkit": "22.1.0-beta.5",
32
- "@nx/jest": "22.1.0-beta.5",
33
- "@nx/js": "22.1.0-beta.5",
34
- "@nx/eslint": "22.1.0-beta.5"
31
+ "@nx/devkit": "22.1.0-beta.7",
32
+ "@nx/jest": "22.1.0-beta.7",
33
+ "@nx/js": "22.1.0-beta.7",
34
+ "@nx/eslint": "22.1.0-beta.7"
35
35
  },
36
36
  "devDependencies": {
37
- "nx": "22.1.0-beta.5"
37
+ "nx": "22.1.0-beta.7"
38
38
  },
39
39
  "publishConfig": {
40
40
  "access": "public"
@@ -1 +1 @@
1
- {"version":3,"file":"e2e.d.ts","sourceRoot":"","sources":["../../../../../../packages/plugin/src/generators/e2e-project/e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAeL,KAAK,iBAAiB,EAEtB,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAcpB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAwLvC,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAMnE;AAED,wBAAsB,2BAA2B,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BA8C3E;AAED,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"e2e.d.ts","sourceRoot":"","sources":["../../../../../../packages/plugin/src/generators/e2e-project/e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAeL,KAAK,iBAAiB,EAEtB,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAkBpB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AA+LvC,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAMnE;AAED,wBAAsB,2BAA2B,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BA8C3E;AAED,eAAe,mBAAmB,CAAC"}
@@ -93,8 +93,12 @@ async function addJest(host, options) {
93
93
  compiler: options.isTsSolutionSetup ? 'swc' : undefined,
94
94
  });
95
95
  const { startLocalRegistryPath, stopLocalRegistryPath } = (0, add_local_registry_scripts_1.addLocalRegistryScripts)(host);
96
- (0, jest_1.addPropertyToJestConfig)(host, (0, path_1.join)(options.projectRoot, 'jest.config.ts'), 'globalSetup', (0, path_1.join)((0, devkit_1.offsetFromRoot)(options.projectRoot), startLocalRegistryPath));
97
- (0, jest_1.addPropertyToJestConfig)(host, (0, path_1.join)(options.projectRoot, 'jest.config.ts'), 'globalTeardown', (0, path_1.join)((0, devkit_1.offsetFromRoot)(options.projectRoot), stopLocalRegistryPath));
96
+ const jestConfigPath = (0, jest_1.findJestConfig)(host, options.projectRoot);
97
+ if (!jestConfigPath) {
98
+ throw new Error(`Could not find Jest config for project ${options.projectName} at ${options.projectRoot}`);
99
+ }
100
+ (0, jest_1.addPropertyToJestConfig)(host, jestConfigPath, 'globalSetup', (0, path_1.join)((0, devkit_1.offsetFromRoot)(options.projectRoot), startLocalRegistryPath));
101
+ (0, jest_1.addPropertyToJestConfig)(host, jestConfigPath, 'globalTeardown', (0, path_1.join)((0, devkit_1.offsetFromRoot)(options.projectRoot), stopLocalRegistryPath));
98
102
  const project = (0, devkit_1.readProjectConfiguration)(host, options.projectName);
99
103
  project.targets ??= {};
100
104
  if (project.targets.e2e) {
@@ -76,7 +76,7 @@ async function pluginGeneratorInternal(host, schema) {
76
76
  tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, {
77
77
  '@nx/devkit': nxVersion,
78
78
  }, {
79
- [options.unitTestRunner === 'vitest' ? '@nx/vite' : '@nx/jest']: nxVersion,
79
+ [options.unitTestRunner === 'vitest' ? '@nx/vitest' : '@nx/jest']: nxVersion,
80
80
  '@nx/js': nxVersion,
81
81
  '@nx/plugin': nxVersion,
82
82
  }));