@nx/cypress 23.0.0 → 23.1.0-beta.1

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/README.md CHANGED
@@ -7,13 +7,12 @@
7
7
 
8
8
  <div style="text-align: center;">
9
9
 
10
- [![CircleCI](https://circleci.com/gh/nrwl/nx.svg?style=svg)](https://circleci.com/gh/nrwl/nx)
11
10
  [![License](https://img.shields.io/npm/l/@nx/workspace.svg?style=flat-square)]()
12
11
  [![NPM Version](https://badge.fury.io/js/nx.svg)](https://www.npmjs.com/package/nx)
13
12
  [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)]()
14
13
  [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
15
- [![Join the chat at https://gitter.im/nrwl-nx/community](https://badges.gitter.im/nrwl-nx/community.svg)](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
16
14
  [![Join us on the Official Nx Discord Server](https://img.shields.io/discord/1143497901675401286?label=discord)](https://go.nx.dev/community)
15
+ [![Nx Sandboxing](https://staging.nx.app/workspaces/62d013ea0852fe0a2df74438/sandbox-badge.svg)](https://nx.dev/docs/features/ci-features/sandboxing)
17
16
 
18
17
  </div>
19
18
 
@@ -30,6 +30,7 @@ function addBaseCypressSetup(tree, options) {
30
30
  : (0, js_1.getRelativePathToRootTsConfig)(tree, projectConfig.root),
31
31
  linter: isEslintInstalled(tree) ? 'eslint' : 'none',
32
32
  ext: '',
33
+ moduleResolution: (0, internal_1.getTsConfigModuleResolution)(tree),
33
34
  };
34
35
  (0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files/common'), projectConfig.root, templateVars);
35
36
  (0, devkit_1.generateFiles)(tree, isUsingTsSolutionConfig
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "extends": "<%= tsConfigPath %>",
3
3
  "compilerOptions": {
4
- "moduleResolution": "node10",
4
+ "moduleResolution": "<%= moduleResolution %>",
5
5
  "allowJs": true,
6
6
  "outDir": "<%= offsetFromRoot %>dist/out-tsc",
7
7
  "module": "commonjs",
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "extends": "<%= tsConfigPath %>",
3
3
  "compilerOptions": {
4
+ "rootDir": "<%= offsetFromProjectRoot ? offsetFromProjectRoot.replace(/\/$/, '') : '.' %>",
4
5
  "outDir": "out-tsc/cypress",
5
6
  "allowJs": true,
6
7
  "types": ["cypress", "node"],
@@ -48,13 +48,15 @@ async function configurationGeneratorInternal(tree, options) {
48
48
  const projectTsConfigPath = (0, devkit_1.joinPathFragments)(opts.projectRoot, 'tsconfig.json');
49
49
  if (tree.exists(projectTsConfigPath)) {
50
50
  (0, devkit_1.updateJson)(tree, projectTsConfigPath, (json) => {
51
- // Cypress uses commonjs, unless the project is also using commonjs (or does not set "module" i.e. uses default of commonjs),
52
- // then we need to set the moduleResolution to node10 or else Cypress will fail with TS5095 error.
51
+ // Cypress uses commonjs, so when the project sets a moduleResolution we
52
+ // pin a value compatible with both Cypress and the installed TypeScript
53
+ // version to avoid Cypress failing.
53
54
  // See: https://github.com/cypress-io/cypress/issues/27731
54
55
  if ((json.compilerOptions?.module ||
55
56
  json.compilerOptions?.module !== 'commonjs') &&
56
57
  json.compilerOptions?.moduleResolution) {
57
- json.compilerOptions.moduleResolution = 'node10';
58
+ json.compilerOptions.moduleResolution =
59
+ (0, internal_2.getTsConfigModuleResolution)(tree);
58
60
  }
59
61
  return json;
60
62
  });
@@ -32,8 +32,8 @@ export declare function updatePluginFile(tree: Tree, projectConfig: ProjectConfi
32
32
  cypressConfigTs: Record<string, any>;
33
33
  cypressConfigJson: Record<string, any>;
34
34
  } | {
35
+ cypressConfigJson: Record<string, any>;
35
36
  cypressConfigTs: {
36
37
  e2e: any;
37
38
  };
38
- cypressConfigJson: Record<string, any>;
39
39
  };
@@ -1,4 +1,4 @@
1
- import { Tree } from '@nx/devkit';
1
+ import { GeneratorCallback, Tree } from '@nx/devkit';
2
2
  import { Linter, LinterType } from '@nx/eslint';
3
3
  export interface CyLinterOptions {
4
4
  project: string;
@@ -19,4 +19,4 @@ export interface CyLinterOptions {
19
19
  overwriteExisting?: boolean;
20
20
  addPlugin?: boolean;
21
21
  }
22
- export declare function addLinterToCyProject(tree: Tree, options: CyLinterOptions): Promise<() => void>;
22
+ export declare function addLinterToCyProject(tree: Tree, options: CyLinterOptions): Promise<GeneratorCallback>;
@@ -4,7 +4,7 @@ export declare const minSupportedCypressVersion = "13.0.0";
4
4
  export declare const eslintPluginCypressVersion = "^3.5.0";
5
5
  export declare const typesNodeVersion = "^22.0.0";
6
6
  export declare const cypressViteDevServerVersion = "^7.3.1";
7
- export declare const cypressVersion = "^15.14.2";
7
+ export declare const cypressVersion = "^15.17.0";
8
8
  export declare const cypressWebpackVersion = "^5.4.1";
9
9
  export declare const viteVersion = "^6.0.0";
10
10
  export declare const htmlWebpackPluginVersion = "^5.5.0";
@@ -13,7 +13,7 @@ exports.minSupportedCypressVersion = '13.0.0';
13
13
  exports.eslintPluginCypressVersion = '^3.5.0';
14
14
  exports.typesNodeVersion = '^22.0.0';
15
15
  exports.cypressViteDevServerVersion = '^7.3.1';
16
- exports.cypressVersion = '^15.14.2';
16
+ exports.cypressVersion = '^15.17.0';
17
17
  exports.cypressWebpackVersion = '^5.4.1';
18
18
  exports.viteVersion = '^6.0.0';
19
19
  exports.htmlWebpackPluginVersion = '^5.5.0';
package/migrations.json CHANGED
@@ -115,6 +115,18 @@
115
115
  "alwaysAddToPackageJson": false
116
116
  }
117
117
  }
118
+ },
119
+ "23.0.0-cypress-15.17": {
120
+ "version": "23.1.0-beta.0",
121
+ "requires": {
122
+ "cypress": ">=15.0.0 <15.17.0"
123
+ },
124
+ "packages": {
125
+ "cypress": {
126
+ "version": "^15.17.0",
127
+ "alwaysAddToPackageJson": false
128
+ }
129
+ }
118
130
  }
119
131
  }
120
132
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/cypress",
3
- "version": "23.0.0",
3
+ "version": "23.1.0-beta.1",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "files": [
@@ -89,12 +89,12 @@
89
89
  "semver": "^7.6.3",
90
90
  "tree-kill": "^1.2.2",
91
91
  "tslib": "^2.3.0",
92
- "@nx/devkit": "23.0.0",
93
- "@nx/eslint": "23.0.0",
94
- "@nx/js": "23.0.0"
92
+ "@nx/devkit": "23.1.0-beta.1",
93
+ "@nx/eslint": "23.1.0-beta.1",
94
+ "@nx/js": "23.1.0-beta.1"
95
95
  },
96
96
  "devDependencies": {
97
- "nx": "23.0.0"
97
+ "nx": "23.1.0-beta.1"
98
98
  },
99
99
  "peerDependencies": {
100
100
  "cypress": ">= 13 < 16"