@nx/cypress 23.0.0-beta.1 → 23.0.0-beta.10
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/migrations.json +32 -0
- package/package.json +8 -8
- package/src/executors/cypress/cypress.impl.d.ts.map +1 -1
- package/src/executors/cypress/cypress.impl.js +2 -0
- package/src/executors/cypress/schema.json +1 -0
- package/src/generators/component-configuration/component-configuration.d.ts.map +1 -1
- package/src/generators/component-configuration/component-configuration.js +2 -12
- package/src/generators/configuration/configuration.d.ts.map +1 -1
- package/src/generators/configuration/configuration.js +5 -4
- package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +1 -1
- package/src/generators/convert-to-inferred/convert-to-inferred.js +5 -6
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +2 -2
- package/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.d.ts.map +1 -1
- package/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.js +3 -3
- package/src/migrations/update-20-8-0/replace-experimental-just-in-time-compile.js +2 -2
- package/src/migrations/update-21-0-0/remove-tsconfig-and-copy-files-options-from-cypress-executor.d.ts.map +1 -1
- package/src/migrations/update-21-0-0/remove-tsconfig-and-copy-files-options-from-cypress-executor.js +2 -2
- package/src/migrations/update-23-0-0/remove-experimental-prompt-command.d.ts +3 -0
- package/src/migrations/update-23-0-0/remove-experimental-prompt-command.d.ts.map +1 -0
- package/src/migrations/update-23-0-0/remove-experimental-prompt-command.js +47 -0
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +46 -30
- package/src/utils/deprecation.d.ts +4 -0
- package/src/utils/deprecation.d.ts.map +1 -0
- package/src/utils/deprecation.js +20 -0
- package/src/utils/versions.d.ts +3 -3
- package/src/utils/versions.d.ts.map +1 -1
- package/src/utils/versions.js +5 -5
package/migrations.json
CHANGED
|
@@ -64,6 +64,14 @@
|
|
|
64
64
|
},
|
|
65
65
|
"description": "For Angular component testing projects below v18, switches to the fallback `@cypress/angular` harness required by Cypress v15.",
|
|
66
66
|
"implementation": "./src/migrations/update-22-1-0/update-angular-component-testing-support"
|
|
67
|
+
},
|
|
68
|
+
"remove-experimental-prompt-command": {
|
|
69
|
+
"version": "23.0.0-beta.10",
|
|
70
|
+
"requires": {
|
|
71
|
+
"cypress": ">=15.13.0"
|
|
72
|
+
},
|
|
73
|
+
"description": "Removes the `experimentalPromptCommand` flag from `cypress.config.{ts,js,mjs,cjs}`. The flag was removed in Cypress 15.13.0; `cy.prompt` is now in beta without configuration.",
|
|
74
|
+
"implementation": "./src/migrations/update-23-0-0/remove-experimental-prompt-command"
|
|
67
75
|
}
|
|
68
76
|
},
|
|
69
77
|
"packageJsonUpdates": {
|
|
@@ -124,6 +132,30 @@
|
|
|
124
132
|
"alwaysAddToPackageJson": false
|
|
125
133
|
}
|
|
126
134
|
}
|
|
135
|
+
},
|
|
136
|
+
"23.0.0": {
|
|
137
|
+
"version": "23.0.0-beta.10",
|
|
138
|
+
"requires": {
|
|
139
|
+
"cypress": ">=15.0.0 <15.14.0"
|
|
140
|
+
},
|
|
141
|
+
"packages": {
|
|
142
|
+
"cypress": {
|
|
143
|
+
"version": "^15.14.2",
|
|
144
|
+
"alwaysAddToPackageJson": false
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"23.0.0-vite-dev-server": {
|
|
149
|
+
"version": "23.0.0-beta.10",
|
|
150
|
+
"requires": {
|
|
151
|
+
"@cypress/vite-dev-server": ">=7.0.0 <7.3.1"
|
|
152
|
+
},
|
|
153
|
+
"packages": {
|
|
154
|
+
"@cypress/vite-dev-server": {
|
|
155
|
+
"version": "^7.3.1",
|
|
156
|
+
"alwaysAddToPackageJson": false
|
|
157
|
+
}
|
|
158
|
+
}
|
|
127
159
|
}
|
|
128
160
|
}
|
|
129
161
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/cypress",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Cypress contains executors and generators allowing your workspace to use the powerful Cypress integration testing capabilities.",
|
|
6
6
|
"repository": {
|
|
@@ -37,17 +37,17 @@
|
|
|
37
37
|
"migrations": "./migrations.json"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@nx/devkit": "23.0.0-beta.
|
|
41
|
-
"@nx/eslint": "23.0.0-beta.
|
|
42
|
-
"@nx/js": "23.0.0-beta.
|
|
43
|
-
"@phenomnomnominal/tsquery": "~6.
|
|
44
|
-
"detect-port": "^1.
|
|
40
|
+
"@nx/devkit": "23.0.0-beta.10",
|
|
41
|
+
"@nx/eslint": "23.0.0-beta.10",
|
|
42
|
+
"@nx/js": "23.0.0-beta.10",
|
|
43
|
+
"@phenomnomnominal/tsquery": "~6.2.0",
|
|
44
|
+
"detect-port": "^2.1.0",
|
|
45
45
|
"semver": "^7.6.3",
|
|
46
|
-
"tree-kill": "1.2.2",
|
|
46
|
+
"tree-kill": "^1.2.2",
|
|
47
47
|
"tslib": "^2.3.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"nx": "23.0.0-beta.
|
|
50
|
+
"nx": "23.0.0-beta.10"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"cypress": ">= 13 < 16"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cypress.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/executors/cypress/cypress.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"cypress.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/executors/cypress/cypress.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;AASrD,MAAM,MAAM,IAAI,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC;AAExC,MAAM,WAAW,sBAAuB,SAAQ,IAAI;IAClD,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;QAGI;IACJ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC;IAClC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uBAAuB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC5C;AAOD,wBAA8B,eAAe,CAC3C,OAAO,EAAE,sBAAsB,EAC/B,OAAO,EAAE,eAAe;;GA4BzB"}
|
|
@@ -5,9 +5,11 @@ const devkit_1 = require("@nx/devkit");
|
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
const ct_helpers_1 = require("../../utils/ct-helpers");
|
|
8
|
+
const deprecation_1 = require("../../utils/deprecation");
|
|
8
9
|
const start_dev_server_1 = require("../../utils/start-dev-server");
|
|
9
10
|
const Cypress = require('cypress'); // @NOTE: Importing via ES6 messes the whole test dependencies.
|
|
10
11
|
async function cypressExecutor(options, context) {
|
|
12
|
+
(0, deprecation_1.warnCypressExecutorDeprecation)();
|
|
11
13
|
options = normalizeOptions(options, context);
|
|
12
14
|
// this is used by cypress component testing presets to build the executor contexts with the correct configuration options.
|
|
13
15
|
process.env.NX_CYPRESS_TARGET_CONFIGURATION = context.configurationName;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"type": "object",
|
|
6
6
|
"outputCapture": "pipe",
|
|
7
7
|
"cli": "nx",
|
|
8
|
+
"x-deprecated": "The `@nx/cypress:cypress` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/cypress:convert-to-inferred` to migrate to the `@nx/cypress/plugin` inferred plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
|
|
8
9
|
"presets": [
|
|
9
10
|
{
|
|
10
11
|
"name": "Starting Dev Server",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/generators/component-configuration/component-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,
|
|
1
|
+
{"version":3,"file":"component-configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/generators/component-configuration/component-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAGjB,oBAAoB,EAKpB,IAAI,EAIL,MAAM,YAAY,CAAC;AASpB,OAAO,EAAE,mCAAmC,EAAE,MAAM,UAAU,CAAC;AAI/D,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mCAAmC,8BAM7C;AAED,wBAAsB,uCAAuC,CAC3D,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mCAAmC,8BA2C7C;AAkHD,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,oBAAoB,QAsDpC;AAOD,eAAe,+BAA+B,CAAC"}
|
|
@@ -6,7 +6,7 @@ exports.updateTsConfigForComponentTesting = updateTsConfigForComponentTesting;
|
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
|
8
8
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
9
|
-
const
|
|
9
|
+
const deprecation_1 = require("../../utils/deprecation");
|
|
10
10
|
const versions_1 = require("../../utils/versions");
|
|
11
11
|
const base_setup_1 = require("../base-setup/base-setup");
|
|
12
12
|
const init_1 = tslib_1.__importDefault(require("../init/init"));
|
|
@@ -18,17 +18,6 @@ function componentConfigurationGenerator(tree, options) {
|
|
|
18
18
|
}
|
|
19
19
|
async function componentConfigurationGeneratorInternal(tree, options) {
|
|
20
20
|
(0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(tree, 'cypress', 'component-configuration');
|
|
21
|
-
// Cypress CT does not support Vite 8 yet (@cypress/vite-dev-server
|
|
22
|
-
// peer dep is ^5.0.0 || ^6.0.0 || ^7.0.0).
|
|
23
|
-
const viteVersion = (0, devkit_1.getDependencyVersionFromPackageJson)(tree, 'vite');
|
|
24
|
-
if (viteVersion) {
|
|
25
|
-
const viteMajor = (0, semver_1.major)((0, semver_1.coerce)(viteVersion));
|
|
26
|
-
if (viteMajor >= 8) {
|
|
27
|
-
throw new Error(`Cypress component testing does not yet support Vite ${viteMajor}. ` +
|
|
28
|
-
`Downgrade to Vite 7 or earlier to use Cypress component testing. ` +
|
|
29
|
-
`See: https://github.com/cypress-io/cypress/issues/33078`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
21
|
const tasks = [];
|
|
33
22
|
const opts = normalizeOptions(tree, options);
|
|
34
23
|
if (!(0, versions_1.getInstalledCypressMajorVersion)(tree)) {
|
|
@@ -47,6 +36,7 @@ async function componentConfigurationGeneratorInternal(tree, options) {
|
|
|
47
36
|
}
|
|
48
37
|
addProjectFiles(tree, projectConfig, opts);
|
|
49
38
|
if (!hasPlugin || opts.addExplicitTargets) {
|
|
39
|
+
(0, deprecation_1.warnCypressExecutorGenerating)();
|
|
50
40
|
addTargetToProject(tree, projectConfig, opts);
|
|
51
41
|
}
|
|
52
42
|
updateNxJsonConfiguration(tree, hasPlugin);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/generators/configuration/configuration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/generators/configuration/configuration.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,iBAAiB,EAWjB,IAAI,EAIL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAuBhD,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC;IAC/B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAID,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,sBAAsB,8BAMhC;AAED,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,sBAAsB,8BAgGhC;AA+SD,eAAe,sBAAsB,CAAC"}
|
|
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.configurationGenerator = configurationGenerator;
|
|
4
4
|
exports.configurationGeneratorInternal = configurationGeneratorInternal;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
7
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
8
|
-
const prompt_1 = require("@nx/devkit/src/generators/prompt");
|
|
9
8
|
const js_1 = require("@nx/js");
|
|
10
9
|
const generator_prompts_1 = require("@nx/js/src/utils/generator-prompts");
|
|
11
10
|
const package_manager_workspaces_1 = require("@nx/js/src/utils/package-manager-workspaces");
|
|
@@ -13,6 +12,7 @@ const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-set
|
|
|
13
12
|
const path_1 = require("path");
|
|
14
13
|
const add_linter_1 = require("../../utils/add-linter");
|
|
15
14
|
const config_1 = require("../../utils/config");
|
|
15
|
+
const deprecation_1 = require("../../utils/deprecation");
|
|
16
16
|
const versions_1 = require("../../utils/versions");
|
|
17
17
|
const base_setup_1 = require("../base-setup/base-setup");
|
|
18
18
|
const init_1 = tslib_1.__importStar(require("../init/init"));
|
|
@@ -42,6 +42,7 @@ async function configurationGeneratorInternal(tree, options) {
|
|
|
42
42
|
: p.plugin === '@nx/cypress/plugin');
|
|
43
43
|
await addFiles(tree, opts, projectGraph, hasPlugin);
|
|
44
44
|
if (!hasPlugin) {
|
|
45
|
+
(0, deprecation_1.warnCypressExecutorGenerating)();
|
|
45
46
|
addTarget(tree, opts, projectGraph);
|
|
46
47
|
}
|
|
47
48
|
const projectTsConfigPath = (0, devkit_1.joinPathFragments)(opts.projectRoot, 'tsconfig.json');
|
|
@@ -141,7 +142,7 @@ In this case you need to provide a devServerTarget,'<projectName>:<targetName>[:
|
|
|
141
142
|
};
|
|
142
143
|
}
|
|
143
144
|
async function promptForMissingServeData(projectName) {
|
|
144
|
-
const { devServerTarget, port } = await (0,
|
|
145
|
+
const { devServerTarget, port } = await (0, internal_1.promptWhenInteractive)([
|
|
145
146
|
{
|
|
146
147
|
type: 'input',
|
|
147
148
|
name: 'devServerTarget',
|
|
@@ -273,7 +274,7 @@ function createPackageJson(tree, options) {
|
|
|
273
274
|
if (tree.exists(packageJsonPath)) {
|
|
274
275
|
return;
|
|
275
276
|
}
|
|
276
|
-
const importPath = (0,
|
|
277
|
+
const importPath = (0, internal_1.resolveImportPath)(tree, projectConfig.name, projectConfig.root);
|
|
277
278
|
const packageJson = {
|
|
278
279
|
name: importPath,
|
|
279
280
|
version: '0.0.1',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"AAMA,OAAO,EAIL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAOpB,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,iBA+BlE;AAqID,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertToInferred = convertToInferred;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const executor_to_plugin_migrator_1 = require("@nx/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator");
|
|
6
|
-
const plugin_migration_utils_1 = require("@nx/devkit/src/generators/plugin-migrations/plugin-migration-utils");
|
|
7
6
|
const plugin_1 = require("../../plugins/plugin");
|
|
8
7
|
const add_dev_server_target_to_config_1 = require("./lib/add-dev-server-target-to-config");
|
|
9
8
|
const add_exclude_spec_pattern_1 = require("./lib/add-exclude-spec-pattern");
|
|
@@ -11,7 +10,7 @@ const target_options_map_1 = require("./lib/target-options-map");
|
|
|
11
10
|
const upsert_baseUrl_1 = require("./lib/upsert-baseUrl");
|
|
12
11
|
async function convertToInferred(tree, options) {
|
|
13
12
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
14
|
-
const migratedProjects = await (0,
|
|
13
|
+
const migratedProjects = await (0, internal_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/cypress/plugin', plugin_1.createNodesV2, {
|
|
15
14
|
targetName: 'cypress',
|
|
16
15
|
ciTargetName: 'e2e-ci',
|
|
17
16
|
componentTestingTargetName: 'component-test',
|
|
@@ -24,7 +23,7 @@ async function convertToInferred(tree, options) {
|
|
|
24
23
|
},
|
|
25
24
|
], options.project);
|
|
26
25
|
if (migratedProjects.size === 0) {
|
|
27
|
-
throw new
|
|
26
|
+
throw new internal_1.NoTargetsToMigrateError();
|
|
28
27
|
}
|
|
29
28
|
if (!options.skipFormat) {
|
|
30
29
|
await (0, devkit_1.formatFiles)(tree);
|
|
@@ -54,7 +53,7 @@ function postTargetTransformer(target, tree, projectDetails, inferredTargetConfi
|
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
if (target.outputs) {
|
|
57
|
-
(0,
|
|
56
|
+
(0, internal_1.processTargetOutputs)(target, [], inferredTargetConfiguration, {
|
|
58
57
|
projectName: projectDetails.projectName,
|
|
59
58
|
projectRoot: projectDetails.root,
|
|
60
59
|
});
|
|
@@ -65,7 +64,7 @@ function handlePropertiesInOptions(tree, options, projectRoot, target) {
|
|
|
65
64
|
let configFilePath;
|
|
66
65
|
if ('cypressConfig' in options) {
|
|
67
66
|
configFilePath = options.cypressConfig;
|
|
68
|
-
options['config-file'] = (0,
|
|
67
|
+
options['config-file'] = (0, internal_1.toProjectRelativePath)(configFilePath, projectRoot);
|
|
69
68
|
delete options.cypressConfig;
|
|
70
69
|
}
|
|
71
70
|
if ('copyFiles' in options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/generators/init/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/generators/init/init.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EACjB,YAAY,EAIZ,IAAI,EAEL,MAAM,YAAY,CAAC;AAOpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AA+ClC,wBAAgB,SAAS,CACvB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,YAAY,EACnB,oBAAoB,EAAE,OAAO,iBAmB9B;AAmBD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,8BAErE;AAED,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,8BA8BhB;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addPlugin = addPlugin;
|
|
4
4
|
exports.cypressInitGenerator = cypressInitGenerator;
|
|
5
5
|
exports.cypressInitGeneratorInternal = cypressInitGeneratorInternal;
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
7
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
|
|
8
8
|
const plugin_1 = require("../../plugins/plugin");
|
|
9
9
|
const versions_1 = require("../../utils/versions");
|
|
10
10
|
function setupE2ETargetDefaults(tree) {
|
|
@@ -36,7 +36,7 @@ function updateDependencies(tree, options) {
|
|
|
36
36
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
37
37
|
}
|
|
38
38
|
function addPlugin(tree, graph, updatePackageScripts) {
|
|
39
|
-
return (0,
|
|
39
|
+
return (0, internal_1.addPlugin)(tree, graph, '@nx/cypress/plugin', plugin_1.createNodesV2, {
|
|
40
40
|
targetName: ['e2e', 'cypress:e2e', 'cypress-e2e'],
|
|
41
41
|
openTargetName: ['open-cypress', 'cypress-open'],
|
|
42
42
|
componentTestingTargetName: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-to-cypress-11.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"migrate-to-cypress-11.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,IAAI,EAGL,MAAM,YAAY,CAAC;AA2GpB,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,IAAI,uBA4DrD;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.migrateCypressProject = migrateCypressProject;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
|
6
6
|
const versions_1 = require("../../utils/versions");
|
|
7
7
|
const conversion_util_1 = require("./conversion.util");
|
|
8
8
|
function migrateCypressExecutorOptions(tree, projectName, target, configuration, previousCypressConfigs) {
|
|
@@ -66,10 +66,10 @@ async function migrateCypressProject(tree) {
|
|
|
66
66
|
// if we don't have the already migrated configs
|
|
67
67
|
// it prevents us from being able to rename files for those projects
|
|
68
68
|
const previousCypressConfigs = new Map();
|
|
69
|
-
(0,
|
|
69
|
+
(0, internal_1.forEachExecutorOptions)(tree, '@nx/cypress:cypress', (currentValue, projectName, target, configuration) => {
|
|
70
70
|
migrateCypressExecutorOptions(tree, projectName, target, configuration, previousCypressConfigs);
|
|
71
71
|
});
|
|
72
|
-
(0,
|
|
72
|
+
(0, internal_1.forEachExecutorOptions)(tree, '@nrwl/cypress:cypress', (currentValue, projectName, target, configuration) => {
|
|
73
73
|
migrateCypressExecutorOptions(tree, projectName, target, configuration, previousCypressConfigs);
|
|
74
74
|
});
|
|
75
75
|
(0, devkit_1.updateJson)(tree, 'package.json', (json) => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = default_1;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
|
|
7
7
|
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
8
8
|
const node_path_1 = require("node:path");
|
|
@@ -85,7 +85,7 @@ async function resolveBundler(config, cypressConfigPath) {
|
|
|
85
85
|
}
|
|
86
86
|
try {
|
|
87
87
|
// we can't statically resolve the bundler from the config, so we load the config
|
|
88
|
-
const cypressConfig = await (0,
|
|
88
|
+
const cypressConfig = await (0, internal_1.loadConfigFile)((0, node_path_1.join)(devkit_1.workspaceRoot, cypressConfigPath));
|
|
89
89
|
return cypressConfig.component?.devServer?.bundler;
|
|
90
90
|
}
|
|
91
91
|
catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-tsconfig-and-copy-files-options-from-cypress-executor.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/migrations/update-21-0-0/remove-tsconfig-and-copy-files-options-from-cypress-executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove-tsconfig-and-copy-files-options-from-cypress-executor.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/migrations/update-21-0-0/remove-tsconfig-and-copy-files-options-from-cypress-executor.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,IAAI,EAGV,MAAM,YAAY,CAAC;AAKpB,yBAA+B,IAAI,EAAE,IAAI,iBA8DxC"}
|
package/src/migrations/update-21-0-0/remove-tsconfig-and-copy-files-options-from-cypress-executor.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = default_1;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
|
6
6
|
const EXECUTOR_TO_MIGRATE = '@nx/cypress:cypress';
|
|
7
7
|
async function default_1(tree) {
|
|
8
8
|
// update options from project configs
|
|
9
|
-
(0,
|
|
9
|
+
(0, internal_1.forEachExecutorOptions)(tree, EXECUTOR_TO_MIGRATE, (options, project, target, configuration) => {
|
|
10
10
|
if (options.tsConfig === undefined && options.copyFiles === undefined) {
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-experimental-prompt-command.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/migrations/update-23-0-0/remove-experimental-prompt-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAWpD,wBAA8B,+BAA+B,CAAC,IAAI,EAAE,IAAI,iBA4CvE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = removeExperimentalPromptCommand;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
6
|
+
const migrations_1 = require("../../utils/migrations");
|
|
7
|
+
// Match both `experimentalPromptCommand: true` and `'experimentalPromptCommand': true`
|
|
8
|
+
// (string-literal keys appear in JSON-style configs and after some formatters).
|
|
9
|
+
const SELECTOR = 'PropertyAssignment:has(Identifier[name=experimentalPromptCommand]),' +
|
|
10
|
+
'PropertyAssignment:has(StringLiteral[value=experimentalPromptCommand])';
|
|
11
|
+
async function removeExperimentalPromptCommand(tree) {
|
|
12
|
+
for await (const { cypressConfigPath } of (0, migrations_1.cypressProjectConfigs)(tree)) {
|
|
13
|
+
if (!tree.exists(cypressConfigPath)) {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
const contents = tree.read(cypressConfigPath, 'utf-8');
|
|
17
|
+
if (!contents.includes('experimentalPromptCommand')) {
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
const sourceFile = (0, tsquery_1.ast)(contents);
|
|
21
|
+
// `:has()` may match nested PropertyAssignments (e.g. an outer object whose
|
|
22
|
+
// value contains the flag). Restrict to ones whose own `name` is the flag.
|
|
23
|
+
const propAssigns = (0, tsquery_1.query)(sourceFile, SELECTOR).filter((p) => {
|
|
24
|
+
const name = p.name;
|
|
25
|
+
return (
|
|
26
|
+
// Identifier name has `.text`; StringLiteral name does too.
|
|
27
|
+
'text' in name && name.text === 'experimentalPromptCommand');
|
|
28
|
+
});
|
|
29
|
+
if (propAssigns.length === 0) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
let updated = contents;
|
|
33
|
+
// Walk end-to-start so positions remain valid as we slice.
|
|
34
|
+
for (let i = propAssigns.length - 1; i >= 0; i--) {
|
|
35
|
+
const propAssign = propAssigns[i];
|
|
36
|
+
const start = propAssign.getStart(sourceFile);
|
|
37
|
+
let end = propAssign.getEnd();
|
|
38
|
+
// Eat a single trailing comma if present (prettier handles whitespace).
|
|
39
|
+
if (updated[end] === ',') {
|
|
40
|
+
end++;
|
|
41
|
+
}
|
|
42
|
+
updated = updated.slice(0, start) + updated.slice(end);
|
|
43
|
+
}
|
|
44
|
+
tree.write(cypressConfigPath, updated);
|
|
45
|
+
}
|
|
46
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
47
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/cypress/src/plugins/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/cypress/src/plugins/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,aAAa,EAQnB,MAAM,YAAY,CAAC;AAUpB,MAAM,WAAW,oBAAoB;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC;AAcD,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,oBAAoB,CA+B3D,CAAC;AAEF,eAAO,MAAM,aAAa,qCAAc,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNodesV2 = exports.createNodes = void 0;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
|
|
6
|
-
const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
|
|
7
|
-
const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
|
|
8
6
|
const js_1 = require("@nx/js");
|
|
9
7
|
const fs_1 = require("fs");
|
|
10
8
|
const devkit_internals_1 = require("nx/src/devkit-internals");
|
|
@@ -30,17 +28,19 @@ exports.createNodes = [
|
|
|
30
28
|
const optionsHash = (0, devkit_internals_1.hashObject)(options);
|
|
31
29
|
const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `cypress-${optionsHash}.hash`);
|
|
32
30
|
const pluginCache = new plugin_cache_utils_1.PluginCache(cachePath);
|
|
33
|
-
const
|
|
31
|
+
const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
|
|
32
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
33
|
+
const lockFileName = (0, js_1.getLockFileName)(packageManager);
|
|
34
34
|
try {
|
|
35
|
-
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, pluginCache, pmc), configFiles, options, context);
|
|
35
|
+
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, pluginCache, pmc, lockFileName), configFiles, options, context);
|
|
36
36
|
}
|
|
37
37
|
finally {
|
|
38
|
-
pluginCache.writeToDisk(
|
|
38
|
+
pluginCache.writeToDisk();
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
];
|
|
42
42
|
exports.createNodesV2 = exports.createNodes;
|
|
43
|
-
async function createNodesInternal(configFilePath, options, context, pluginCache, pmc) {
|
|
43
|
+
async function createNodesInternal(configFilePath, options, context, pluginCache, pmc, lockFileName) {
|
|
44
44
|
options = normalizeOptions(options);
|
|
45
45
|
const projectRoot = (0, path_1.dirname)(configFilePath);
|
|
46
46
|
// Do not create a project if package.json and project.json isn't there.
|
|
@@ -49,8 +49,8 @@ async function createNodesInternal(configFilePath, options, context, pluginCache
|
|
|
49
49
|
!siblingFiles.includes('project.json')) {
|
|
50
50
|
return {};
|
|
51
51
|
}
|
|
52
|
-
const hash = (await (0,
|
|
53
|
-
|
|
52
|
+
const hash = (await (0, internal_1.calculateHashForCreateNodes)(projectRoot, options, context, [
|
|
53
|
+
lockFileName,
|
|
54
54
|
])) + configFilePath;
|
|
55
55
|
if (!pluginCache.has(hash)) {
|
|
56
56
|
pluginCache.set(hash, await buildCypressTargets(configFilePath, projectRoot, options, context, pmc));
|
|
@@ -70,47 +70,63 @@ async function createNodesInternal(configFilePath, options, context, pluginCache
|
|
|
70
70
|
function getTargetOutputs(outputs, subfolder) {
|
|
71
71
|
return outputs.map((output) => subfolder ? (0, path_1.join)(output, subfolder) : output);
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
// Normalize a Cypress config folder (e.g. videosFolder, screenshotsFolder) to a
|
|
74
|
+
// project-root-relative path, then append the per-spec subfolder. Cypress
|
|
75
|
+
// resolves relative folders against the project root (cwd), so this keeps the
|
|
76
|
+
// path Cypress writes to in lockstep with what Nx declares as the target's
|
|
77
|
+
// outputs — regardless of whether the user wrote a relative path or computed
|
|
78
|
+
// an absolute one (e.g. via `path.resolve` / `__dirname`).
|
|
79
|
+
function serializeConfigPath(configPath, projectRoot, workspaceRoot, outputSubfolder) {
|
|
80
|
+
if (!configPath) {
|
|
81
|
+
return configPath;
|
|
82
|
+
}
|
|
83
|
+
const fullProjectRoot = (0, path_1.resolve)(workspaceRoot, projectRoot);
|
|
84
|
+
const fullConfigPath = (0, path_1.resolve)(fullProjectRoot, configPath);
|
|
85
|
+
const relativeConfigPath = (0, devkit_1.normalizePath)((0, path_1.relative)(fullProjectRoot, fullConfigPath));
|
|
86
|
+
return (0, devkit_1.normalizePath)((0, path_1.join)(relativeConfigPath, outputSubfolder));
|
|
87
|
+
}
|
|
88
|
+
function getTargetConfig(cypressConfig, projectRoot, workspaceRoot, outputSubfolder, ciBaseUrl) {
|
|
74
89
|
const config = {};
|
|
75
90
|
if (ciBaseUrl) {
|
|
76
91
|
config['baseUrl'] = ciBaseUrl;
|
|
77
92
|
}
|
|
78
93
|
const { screenshotsFolder, videosFolder, e2e, component } = cypressConfig;
|
|
79
94
|
if (videosFolder) {
|
|
80
|
-
config['videosFolder'] = (
|
|
95
|
+
config['videosFolder'] = serializeConfigPath(videosFolder, projectRoot, workspaceRoot, outputSubfolder);
|
|
81
96
|
}
|
|
82
97
|
if (screenshotsFolder) {
|
|
83
|
-
config['screenshotsFolder'] = (
|
|
98
|
+
config['screenshotsFolder'] = serializeConfigPath(screenshotsFolder, projectRoot, workspaceRoot, outputSubfolder);
|
|
84
99
|
}
|
|
85
100
|
if (e2e) {
|
|
86
101
|
config['e2e'] = {};
|
|
87
102
|
if (e2e.videosFolder) {
|
|
88
|
-
config['e2e']['videosFolder'] = (
|
|
103
|
+
config['e2e']['videosFolder'] = serializeConfigPath(e2e.videosFolder, projectRoot, workspaceRoot, outputSubfolder);
|
|
89
104
|
}
|
|
90
105
|
if (e2e.screenshotsFolder) {
|
|
91
|
-
config['e2e']['screenshotsFolder'] = (
|
|
106
|
+
config['e2e']['screenshotsFolder'] = serializeConfigPath(e2e.screenshotsFolder, projectRoot, workspaceRoot, outputSubfolder);
|
|
92
107
|
}
|
|
93
108
|
}
|
|
94
109
|
if (component) {
|
|
95
110
|
config['component'] = {};
|
|
96
111
|
if (component.videosFolder) {
|
|
97
|
-
config['component']['videosFolder'] = (
|
|
112
|
+
config['component']['videosFolder'] = serializeConfigPath(component.videosFolder, projectRoot, workspaceRoot, outputSubfolder);
|
|
98
113
|
}
|
|
99
114
|
if (component.screenshotsFolder) {
|
|
100
|
-
config['component']['screenshotsFolder'] = (
|
|
115
|
+
config['component']['screenshotsFolder'] = serializeConfigPath(component.screenshotsFolder, projectRoot, workspaceRoot, outputSubfolder);
|
|
101
116
|
}
|
|
102
117
|
}
|
|
103
118
|
// Stringify twice to escape the quotes.
|
|
104
119
|
return JSON.stringify(JSON.stringify(config));
|
|
105
120
|
}
|
|
106
|
-
function getOutputs(projectRoot, cypressConfig, testingType) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return (0, devkit_1.joinPathFragments)('{
|
|
121
|
+
function getOutputs(projectRoot, cypressConfig, testingType, workspaceRoot) {
|
|
122
|
+
const fullProjectRoot = (0, path_1.resolve)(workspaceRoot, projectRoot);
|
|
123
|
+
function getOutput(outputPath) {
|
|
124
|
+
const fullPath = (0, path_1.resolve)(fullProjectRoot, outputPath);
|
|
125
|
+
const relativeToProjectRoot = (0, devkit_1.normalizePath)((0, path_1.relative)(fullProjectRoot, fullPath));
|
|
126
|
+
if (relativeToProjectRoot.startsWith('..')) {
|
|
127
|
+
return (0, devkit_1.joinPathFragments)('{workspaceRoot}', (0, path_1.relative)(workspaceRoot, fullPath));
|
|
113
128
|
}
|
|
129
|
+
return (0, devkit_1.joinPathFragments)('{projectRoot}', relativeToProjectRoot);
|
|
114
130
|
}
|
|
115
131
|
const { screenshotsFolder, videosFolder, e2e, component } = cypressConfig;
|
|
116
132
|
const outputs = [];
|
|
@@ -143,7 +159,7 @@ function getOutputs(projectRoot, cypressConfig, testingType) {
|
|
|
143
159
|
return outputs;
|
|
144
160
|
}
|
|
145
161
|
async function buildCypressTargets(configFilePath, projectRoot, options, context, pmc) {
|
|
146
|
-
const cypressConfig = await (0,
|
|
162
|
+
const cypressConfig = await (0, internal_1.loadConfigFile)((0, path_1.join)(context.workspaceRoot, configFilePath));
|
|
147
163
|
const pluginPresetOptions = {
|
|
148
164
|
...cypressConfig.e2e?.[constants_1.NX_PLUGIN_OPTIONS],
|
|
149
165
|
...cypressConfig.env,
|
|
@@ -151,7 +167,7 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
151
167
|
};
|
|
152
168
|
const webServerCommands = pluginPresetOptions?.webServerCommands;
|
|
153
169
|
const shouldReuseExistingServer = pluginPresetOptions?.reuseExistingServer ?? true;
|
|
154
|
-
const namedInputs = (0,
|
|
170
|
+
const namedInputs = (0, internal_1.getNamedInputs)(projectRoot, context);
|
|
155
171
|
const targets = {};
|
|
156
172
|
let metadata;
|
|
157
173
|
const tsNodeCompilerOptions = JSON.stringify({ customConditions: null });
|
|
@@ -164,7 +180,7 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
164
180
|
},
|
|
165
181
|
cache: true,
|
|
166
182
|
inputs: getInputs(namedInputs),
|
|
167
|
-
outputs: getOutputs(projectRoot, cypressConfig, 'e2e'),
|
|
183
|
+
outputs: getOutputs(projectRoot, cypressConfig, 'e2e', context.workspaceRoot),
|
|
168
184
|
metadata: {
|
|
169
185
|
technologies: ['cypress'],
|
|
170
186
|
description: 'Runs Cypress Tests',
|
|
@@ -209,7 +225,7 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
209
225
|
const { specFiles, specPatterns, excludeSpecPatterns } = await getSpecFilesAndPatternsForTestType(cypressConfig, 'e2e', context.workspaceRoot, projectRoot);
|
|
210
226
|
const ciBaseUrl = pluginPresetOptions?.ciBaseUrl;
|
|
211
227
|
const dependsOn = [];
|
|
212
|
-
const outputs = getOutputs(projectRoot, cypressConfig, 'e2e');
|
|
228
|
+
const outputs = getOutputs(projectRoot, cypressConfig, 'e2e', context.workspaceRoot);
|
|
213
229
|
const inputs = getInputs(namedInputs);
|
|
214
230
|
const groupName = 'E2E (CI)';
|
|
215
231
|
metadata = { targetGroups: { [groupName]: [] } };
|
|
@@ -239,7 +255,7 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
239
255
|
outputs: getTargetOutputs(outputs, outputSubfolder),
|
|
240
256
|
inputs,
|
|
241
257
|
cache: true,
|
|
242
|
-
command: `cypress run --env webServerCommand="${ciWebServerCommand}" --spec ${relativeSpecFilePath} --config=${getTargetConfig(cypressConfig, outputSubfolder, ciBaseUrl)}`,
|
|
258
|
+
command: `cypress run --env webServerCommand="${ciWebServerCommand}" --spec ${relativeSpecFilePath} --config=${getTargetConfig(cypressConfig, projectRoot, context.workspaceRoot, outputSubfolder, ciBaseUrl)}`,
|
|
243
259
|
options: {
|
|
244
260
|
cwd: projectRoot,
|
|
245
261
|
env: { TS_NODE_COMPILER_OPTIONS: tsNodeCompilerOptions },
|
|
@@ -299,7 +315,7 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
299
315
|
}
|
|
300
316
|
if ('component' in cypressConfig) {
|
|
301
317
|
const inputs = getInputs(namedInputs);
|
|
302
|
-
const outputs = getOutputs(projectRoot, cypressConfig, 'component');
|
|
318
|
+
const outputs = getOutputs(projectRoot, cypressConfig, 'component', context.workspaceRoot);
|
|
303
319
|
// This will not override the e2e target if it is the same
|
|
304
320
|
targets[options.componentTestingTargetName] ??= {
|
|
305
321
|
command: `cypress run --component`,
|
|
@@ -351,7 +367,7 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
351
367
|
outputs: getTargetOutputs(outputs, outputSubfolder),
|
|
352
368
|
inputs,
|
|
353
369
|
cache: true,
|
|
354
|
-
command: `cypress run --component --spec ${relativeSpecFilePath} --config=${getTargetConfig(cypressConfig, outputSubfolder)}`,
|
|
370
|
+
command: `cypress run --component --spec ${relativeSpecFilePath} --config=${getTargetConfig(cypressConfig, projectRoot, context.workspaceRoot, outputSubfolder)}`,
|
|
355
371
|
options: {
|
|
356
372
|
cwd: projectRoot,
|
|
357
373
|
env: { TS_NODE_COMPILER_OPTIONS: tsNodeCompilerOptions },
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const CYPRESS_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx/cypress:cypress` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/cypress:convert-to-inferred` to migrate to the `@nx/cypress/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.";
|
|
2
|
+
export declare function warnCypressExecutorDeprecation(): void;
|
|
3
|
+
export declare function warnCypressExecutorGenerating(): void;
|
|
4
|
+
//# sourceMappingURL=deprecation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecation.d.ts","sourceRoot":"","sources":["../../../../../packages/cypress/src/utils/deprecation.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oCAAoC,uQACqN,CAAC;AAEvQ,wBAAgB,8BAA8B,IAAI,IAAI,CAErD;AAOD,wBAAgB,6BAA6B,IAAI,IAAI,CAIpD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CYPRESS_EXECUTOR_DEPRECATION_MESSAGE = void 0;
|
|
4
|
+
exports.warnCypressExecutorDeprecation = warnCypressExecutorDeprecation;
|
|
5
|
+
exports.warnCypressExecutorGenerating = warnCypressExecutorGenerating;
|
|
6
|
+
const devkit_1 = require("@nx/devkit");
|
|
7
|
+
// TODO(v24): Remove the @nx/cypress:cypress executor. The inferred plugin
|
|
8
|
+
// (@nx/cypress/plugin) and the convert-to-inferred generator stay supported.
|
|
9
|
+
exports.CYPRESS_EXECUTOR_DEPRECATION_MESSAGE = 'The `@nx/cypress:cypress` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/cypress:convert-to-inferred` to migrate to the `@nx/cypress/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.';
|
|
10
|
+
function warnCypressExecutorDeprecation() {
|
|
11
|
+
devkit_1.logger.warn(exports.CYPRESS_EXECUTOR_DEPRECATION_MESSAGE);
|
|
12
|
+
}
|
|
13
|
+
// Fired when the @nx/cypress:configuration or :component-configuration
|
|
14
|
+
// generator is about to generate a target that uses the deprecated executor —
|
|
15
|
+
// i.e. when @nx/cypress/plugin isn't registered in nx.json. Surfaces the
|
|
16
|
+
// deprecation at generation time rather than only when the user later runs the
|
|
17
|
+
// generated target.
|
|
18
|
+
function warnCypressExecutorGenerating() {
|
|
19
|
+
devkit_1.logger.warn('Generating a target that uses the deprecated `@nx/cypress:cypress` executor. The executor will be removed in Nx v24. Run `nx g @nx/cypress:convert-to-inferred` next to migrate this target to the `@nx/cypress/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
|
|
20
|
+
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type Tree } from '@nx/devkit';
|
|
2
2
|
export declare const nxVersion: any;
|
|
3
3
|
export declare const eslintPluginCypressVersion = "^3.5.0";
|
|
4
|
-
export declare const typesNodeVersion = "
|
|
5
|
-
export declare const cypressViteDevServerVersion = "^7.
|
|
6
|
-
export declare const cypressVersion = "^15.
|
|
4
|
+
export declare const typesNodeVersion = "^22.0.0";
|
|
5
|
+
export declare const cypressViteDevServerVersion = "^7.3.1";
|
|
6
|
+
export declare const cypressVersion = "^15.14.2";
|
|
7
7
|
export declare const cypressWebpackVersion = "^5.4.1";
|
|
8
8
|
export declare const viteVersion = "^6.0.0";
|
|
9
9
|
export declare const htmlWebpackPluginVersion = "^5.5.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/cypress/src/utils/versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAI5E,eAAO,MAAM,SAAS,KAAwC,CAAC;AAC/D,eAAO,MAAM,0BAA0B,WAAW,CAAC;AACnD,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,2BAA2B,WAAW,CAAC;AACpD,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/cypress/src/utils/versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAI5E,eAAO,MAAM,SAAS,KAAwC,CAAC;AAC/D,eAAO,MAAM,0BAA0B,WAAW,CAAC;AACnD,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,2BAA2B,WAAW,CAAC;AACpD,eAAO,MAAM,cAAc,aAAa,CAAC;AACzC,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,wBAAwB,WAAW,CAAC;AAEjD,MAAM,MAAM,eAAe,GAAG,MAAM,CAClC,MAAM,IAAI,CACR,cAAc,YAAY,CAAC,EACzB,WAAW,GACX,UAAU,GACV,4BAA4B,GAC5B,iCAAiC,GACjC,6BAA6B,CAChC,EACD,MAAM,CACP,CAAC;AAkCF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,eAAe,CAmBpD;AAED,wBAAgB,0BAA0B,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAcrE;AAED,wBAAgB,+BAA+B,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAI1E;AAED,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,EAClB,IAAI,CAAC,EAAE,IAAI,GACV,IAAI,CAON"}
|
package/src/utils/versions.js
CHANGED
|
@@ -9,9 +9,9 @@ const devkit_1 = require("@nx/devkit");
|
|
|
9
9
|
const semver_1 = require("semver");
|
|
10
10
|
exports.nxVersion = require('../../package.json').version;
|
|
11
11
|
exports.eslintPluginCypressVersion = '^3.5.0';
|
|
12
|
-
exports.typesNodeVersion = '
|
|
13
|
-
exports.cypressViteDevServerVersion = '^7.
|
|
14
|
-
exports.cypressVersion = '^15.
|
|
12
|
+
exports.typesNodeVersion = '^22.0.0';
|
|
13
|
+
exports.cypressViteDevServerVersion = '^7.3.1';
|
|
14
|
+
exports.cypressVersion = '^15.14.2';
|
|
15
15
|
exports.cypressWebpackVersion = '^5.4.1';
|
|
16
16
|
exports.viteVersion = '^6.0.0';
|
|
17
17
|
exports.htmlWebpackPluginVersion = '^5.5.0';
|
|
@@ -27,7 +27,7 @@ const latestVersions = {
|
|
|
27
27
|
const versionMap = {
|
|
28
28
|
13: {
|
|
29
29
|
eslintPluginCypressVersion: '^3.5.0',
|
|
30
|
-
typesNodeVersion: '
|
|
30
|
+
typesNodeVersion: '^22.0.0',
|
|
31
31
|
cypressViteDevServerVersion: '^2.2.1',
|
|
32
32
|
cypressVersion: '^13.13.0',
|
|
33
33
|
cypressWebpackVersion: '^3.8.0',
|
|
@@ -36,7 +36,7 @@ const versionMap = {
|
|
|
36
36
|
},
|
|
37
37
|
14: {
|
|
38
38
|
eslintPluginCypressVersion: '^3.5.0',
|
|
39
|
-
typesNodeVersion: '
|
|
39
|
+
typesNodeVersion: '^22.0.0',
|
|
40
40
|
cypressViteDevServerVersion: '^6.0.3',
|
|
41
41
|
cypressVersion: '^14.2.1',
|
|
42
42
|
cypressWebpackVersion: '^4.0.2',
|