@nx/cypress 23.2.0-beta.6 → 23.2.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.
@@ -1,5 +1,5 @@
1
1
  import { GeneratorCallback, Tree } from '@nx/devkit';
2
- import { Linter, LinterType } from '@nx/eslint';
2
+ import { LinterType } from '@nx/js';
3
3
  export interface CypressE2EConfigSchema {
4
4
  project: string;
5
5
  baseUrl?: string;
@@ -14,7 +14,7 @@ export interface CypressE2EConfigSchema {
14
14
  skipPackageJson?: boolean;
15
15
  bundler?: 'webpack' | 'vite' | 'none';
16
16
  devServerTarget?: string;
17
- linter?: Linter | LinterType;
17
+ linter?: LinterType;
18
18
  port?: number | 'cypress-auto';
19
19
  jsx?: boolean;
20
20
  rootProject?: boolean;
@@ -144,23 +144,23 @@ In this case you need to provide a devServerTarget,'<projectName>:<targetName>[:
144
144
  };
145
145
  }
146
146
  async function promptForMissingServeData(projectName) {
147
- const { devServerTarget, port } = await (0, internal_1.promptWhenInteractive)([
148
- {
149
- type: 'input',
150
- name: 'devServerTarget',
151
- message: 'What is the name of the target used to serve the application locally?',
152
- initial: `${projectName}:serve`,
153
- },
154
- {
155
- type: 'numeral',
156
- name: 'port',
157
- message: 'What port will the application be served on?',
158
- initial: 3000,
159
- },
160
- ], {
161
- devServerTarget: `${projectName}:serve`,
162
- port: 3000,
147
+ if (!(0, internal_1.isInteractive)()) {
148
+ return {
149
+ devServerTarget: `${projectName}:serve`,
150
+ baseUrl: 'http://localhost:3000',
151
+ };
152
+ }
153
+ const devServerTarget = await (0, internal_1.textPrompt)({
154
+ message: 'What is the name of the target used to serve the application locally?',
155
+ initialValue: `${projectName}:serve`,
163
156
  });
157
+ const port = Number(await (0, internal_1.textPrompt)({
158
+ message: 'What port will the application be served on?',
159
+ initialValue: '3000',
160
+ validate: (value) => value !== '' && !Number.isNaN(Number(value))
161
+ ? undefined
162
+ : 'Please enter a number',
163
+ }));
164
164
  return {
165
165
  devServerTarget,
166
166
  baseUrl: `http://localhost:${port}`,
@@ -44,9 +44,9 @@
44
44
  "default": "cypress"
45
45
  },
46
46
  "linter": {
47
- "description": "The tool to use for running lint checks.",
47
+ "description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
48
48
  "type": "string",
49
- "enum": ["none", "eslint"],
49
+ "enum": ["none", "eslint", "oxlint"],
50
50
  "x-priority": "important"
51
51
  },
52
52
  "js": {
@@ -1,8 +1,8 @@
1
1
  import { GeneratorCallback, Tree } from '@nx/devkit';
2
- import { Linter, LinterType } from '@nx/eslint';
2
+ import { type LinterType } from '@nx/js';
3
3
  export interface CyLinterOptions {
4
4
  project: string;
5
- linter: Linter | LinterType;
5
+ linter: LinterType;
6
6
  enableTypedLinting?: boolean;
7
7
  /**
8
8
  * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addLinterToCyProject = addLinterToCyProject;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const eslint_1 = require("@nx/eslint");
6
5
  const internal_1 = require("@nx/eslint/internal");
7
6
  const versions_1 = require("./versions");
7
+ const internal_2 = require("@nx/js/internal");
8
8
  async function addLinterToCyProject(tree, options) {
9
9
  if (options.linter === 'none') {
10
10
  return () => { };
@@ -13,11 +13,13 @@ async function addLinterToCyProject(tree, options) {
13
13
  const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
14
14
  const eslintFile = (0, internal_1.findEslintFile)(tree, projectConfig.root);
15
15
  const enableTypedLinting = (0, internal_1.isTypedLintingEnabled)(options);
16
- if (!eslintFile) {
17
- tasks.push(await (0, eslint_1.lintProjectGenerator)(tree, {
16
+ // Register whichever linter was asked for. An existing ESLint config means
17
+ // the project is already registered, so skip straight to the Cypress-specific
18
+ // shaping below.
19
+ if (options.linter !== 'eslint' || !eslintFile) {
20
+ tasks.push(await (0, internal_2.addLintingToProject)(tree, {
18
21
  project: options.project,
19
22
  linter: options.linter,
20
- skipFormat: true,
21
23
  tsConfigPaths: [(0, devkit_1.joinPathFragments)(projectConfig.root, 'tsconfig.json')],
22
24
  enableTypedLinting,
23
25
  skipPackageJson: options.skipPackageJson,
@@ -25,7 +27,9 @@ async function addLinterToCyProject(tree, options) {
25
27
  addPlugin: options.addPlugin,
26
28
  }));
27
29
  }
28
- if (!options.linter || options.linter !== 'eslint') {
30
+ // Everything below configures ESLint — predefined configs, `extends`, ignore
31
+ // entries — which have no equivalent in other linters.
32
+ if (options.linter !== 'eslint') {
29
33
  return (0, devkit_1.runTasksInSerial)(...tasks);
30
34
  }
31
35
  options.overwriteExisting = options.overwriteExisting || !eslintFile;
@@ -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.17.0";
7
+ export declare const cypressVersion = "^15.20.1";
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.17.0';
16
+ exports.cypressVersion = '^15.20.1';
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
@@ -148,6 +148,18 @@
148
148
  "alwaysAddToPackageJson": false
149
149
  }
150
150
  }
151
+ },
152
+ "23.2.0-cypress-15.20.1": {
153
+ "version": "23.2.0-beta.6",
154
+ "requires": {
155
+ "cypress": ">=15.0.0 <15.20.1"
156
+ },
157
+ "packages": {
158
+ "cypress": {
159
+ "version": "^15.20.1",
160
+ "alwaysAddToPackageJson": false
161
+ }
162
+ }
151
163
  }
152
164
  }
153
165
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/cypress",
3
- "version": "23.2.0-beta.6",
3
+ "version": "23.2.0-beta.8",
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.2.0-beta.6",
93
- "@nx/eslint": "23.2.0-beta.6",
94
- "@nx/js": "23.2.0-beta.6"
92
+ "@nx/devkit": "23.2.0-beta.8",
93
+ "@nx/eslint": "23.2.0-beta.8",
94
+ "@nx/js": "23.2.0-beta.8"
95
95
  },
96
96
  "devDependencies": {
97
- "nx": "23.2.0-beta.6"
97
+ "nx": "23.2.0-beta.8"
98
98
  },
99
99
  "peerDependencies": {
100
100
  "cypress": ">= 13 < 16"