@nx/jest 20.1.2 → 20.1.4

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": "20.1.2",
3
+ "version": "20.1.4",
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": {
@@ -37,8 +37,8 @@
37
37
  "dependencies": {
38
38
  "@jest/reporters": "^29.4.1",
39
39
  "@jest/test-result": "^29.4.1",
40
- "@nx/devkit": "20.1.2",
41
- "@nx/js": "20.1.2",
40
+ "@nx/devkit": "20.1.4",
41
+ "@nx/js": "20.1.4",
42
42
  "@phenomnomnominal/tsquery": "~5.0.1",
43
43
  "chalk": "^4.1.0",
44
44
  "identity-obj-proxy": "3.0.0",
@@ -20,6 +20,12 @@ function updateTsConfig(host, options) {
20
20
  let runtimeTsconfigPath = (0, devkit_1.joinPathFragments)(root, projectType === 'application' ? 'tsconfig.app.json' : 'tsconfig.lib.json');
21
21
  if (options.runtimeTsconfigFileName) {
22
22
  runtimeTsconfigPath = (0, devkit_1.joinPathFragments)(root, options.runtimeTsconfigFileName);
23
+ // If the app is Next.js it will not have a tsconfig.app.json
24
+ const extensions = ['js', 'ts', 'mjs', 'cjs'];
25
+ const hasNextConfig = extensions.some((ext) => host.exists((0, devkit_1.joinPathFragments)(root, `next.config.${ext}`)));
26
+ if (hasNextConfig && projectType === 'application') {
27
+ runtimeTsconfigPath = (0, devkit_1.joinPathFragments)(root, 'tsconfig.json');
28
+ }
23
29
  if (!host.exists(runtimeTsconfigPath)) {
24
30
  // the user provided a runtimeTsconfigFileName that doesn't exist, so we throw an error
25
31
  throw new Error(`Cannot find the provided runtimeTsConfigFileName ("${options.runtimeTsconfigFileName}") at the project root "${root}".`);