@nx/cypress 23.0.0-beta.11 → 23.0.0-beta.12
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 +5 -5
- package/src/generators/component-configuration/component-configuration.d.ts.map +1 -1
- package/src/generators/component-configuration/component-configuration.js +2 -0
- package/src/generators/configuration/configuration.d.ts.map +1 -1
- package/src/generators/configuration/configuration.js +2 -0
- package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +1 -1
- package/src/generators/convert-to-inferred/convert-to-inferred.js +2 -0
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +3 -1
- package/src/generators/init/schema.json +1 -1
- package/src/plugins/plugin.js +0 -2
- package/src/utils/add-linter.d.ts.map +1 -1
- package/src/utils/add-linter.js +1 -1
- package/src/utils/assert-supported-cypress-version.d.ts +3 -0
- package/src/utils/assert-supported-cypress-version.d.ts.map +1 -0
- package/src/utils/assert-supported-cypress-version.js +8 -0
- package/src/utils/versions.d.ts +2 -1
- package/src/utils/versions.d.ts.map +1 -1
- package/src/utils/versions.js +12 -42
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.12",
|
|
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,9 +37,9 @@
|
|
|
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.
|
|
40
|
+
"@nx/devkit": "23.0.0-beta.12",
|
|
41
|
+
"@nx/eslint": "23.0.0-beta.12",
|
|
42
|
+
"@nx/js": "23.0.0-beta.12",
|
|
43
43
|
"@phenomnomnominal/tsquery": "~6.2.0",
|
|
44
44
|
"detect-port": "^2.1.0",
|
|
45
45
|
"semver": "^7.6.3",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"tslib": "^2.3.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"nx": "23.0.0-beta.
|
|
50
|
+
"nx": "23.0.0-beta.12"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"cypress": ">= 13 < 16"
|
|
@@ -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,EAGjB,oBAAoB,EAKpB,IAAI,EAIL,MAAM,YAAY,CAAC;
|
|
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;AAUpB,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,8BA6C7C;AAkHD,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,oBAAoB,QAsDpC;AAOD,eAAe,+BAA+B,CAAC"}
|
|
@@ -6,6 +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 assert_supported_cypress_version_1 = require("../../utils/assert-supported-cypress-version");
|
|
9
10
|
const deprecation_1 = require("../../utils/deprecation");
|
|
10
11
|
const versions_1 = require("../../utils/versions");
|
|
11
12
|
const base_setup_1 = require("../base-setup/base-setup");
|
|
@@ -17,6 +18,7 @@ function componentConfigurationGenerator(tree, options) {
|
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
20
|
async function componentConfigurationGeneratorInternal(tree, options) {
|
|
21
|
+
(0, assert_supported_cypress_version_1.assertSupportedCypressVersion)(tree);
|
|
20
22
|
(0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(tree, 'cypress', 'component-configuration');
|
|
21
23
|
const tasks = [];
|
|
22
24
|
const opts = normalizeOptions(tree, options);
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAwBhD,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,8BAkGhC;AA+SD,eAAe,sBAAsB,CAAC"}
|
|
@@ -11,6 +11,7 @@ const package_manager_workspaces_1 = require("@nx/js/src/utils/package-manager-w
|
|
|
11
11
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
12
12
|
const path_1 = require("path");
|
|
13
13
|
const add_linter_1 = require("../../utils/add-linter");
|
|
14
|
+
const assert_supported_cypress_version_1 = require("../../utils/assert-supported-cypress-version");
|
|
14
15
|
const config_1 = require("../../utils/config");
|
|
15
16
|
const deprecation_1 = require("../../utils/deprecation");
|
|
16
17
|
const versions_1 = require("../../utils/versions");
|
|
@@ -23,6 +24,7 @@ function configurationGenerator(tree, options) {
|
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
async function configurationGeneratorInternal(tree, options) {
|
|
27
|
+
(0, assert_supported_cypress_version_1.assertSupportedCypressVersion)(tree);
|
|
26
28
|
const opts = await normalizeOptions(tree, options);
|
|
27
29
|
const tasks = [];
|
|
28
30
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
@@ -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":"AAMA,OAAO,EAIL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;
|
|
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;AAQpB,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,iBAiClE;AAqID,eAAe,iBAAiB,CAAC"}
|
|
@@ -4,11 +4,13 @@ exports.convertToInferred = convertToInferred;
|
|
|
4
4
|
const internal_1 = require("@nx/devkit/internal");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const plugin_1 = require("../../plugins/plugin");
|
|
7
|
+
const assert_supported_cypress_version_1 = require("../../utils/assert-supported-cypress-version");
|
|
7
8
|
const add_dev_server_target_to_config_1 = require("./lib/add-dev-server-target-to-config");
|
|
8
9
|
const add_exclude_spec_pattern_1 = require("./lib/add-exclude-spec-pattern");
|
|
9
10
|
const target_options_map_1 = require("./lib/target-options-map");
|
|
10
11
|
const upsert_baseUrl_1 = require("./lib/upsert-baseUrl");
|
|
11
12
|
async function convertToInferred(tree, options) {
|
|
13
|
+
(0, assert_supported_cypress_version_1.assertSupportedCypressVersion)(tree);
|
|
12
14
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
13
15
|
const migratedProjects = await (0, internal_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/cypress/plugin', plugin_1.createNodesV2, {
|
|
14
16
|
targetName: 'cypress',
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAQpB,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,8BAgChB;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -6,6 +6,7 @@ exports.cypressInitGeneratorInternal = cypressInitGeneratorInternal;
|
|
|
6
6
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
|
8
8
|
const plugin_1 = require("../../plugins/plugin");
|
|
9
|
+
const assert_supported_cypress_version_1 = require("../../utils/assert-supported-cypress-version");
|
|
9
10
|
const versions_1 = require("../../utils/versions");
|
|
10
11
|
function setupE2ETargetDefaults(tree) {
|
|
11
12
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
@@ -32,7 +33,7 @@ function updateDependencies(tree, options) {
|
|
|
32
33
|
if (!(0, versions_1.getInstalledCypressVersion)(tree)) {
|
|
33
34
|
devDependencies.cypress = versions_1.cypressVersion;
|
|
34
35
|
}
|
|
35
|
-
tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies, undefined, options.keepExistingVersions));
|
|
36
|
+
tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies, undefined, options.keepExistingVersions ?? true));
|
|
36
37
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
37
38
|
}
|
|
38
39
|
function addPlugin(tree, graph, updatePackageScripts) {
|
|
@@ -64,6 +65,7 @@ async function cypressInitGenerator(tree, options) {
|
|
|
64
65
|
return cypressInitGeneratorInternal(tree, { addPlugin: false, ...options });
|
|
65
66
|
}
|
|
66
67
|
async function cypressInitGeneratorInternal(tree, options) {
|
|
68
|
+
(0, assert_supported_cypress_version_1.assertSupportedCypressVersion)(tree);
|
|
67
69
|
updateProductionFileset(tree);
|
|
68
70
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
69
71
|
options.addPlugin ??=
|
package/src/plugins/plugin.js
CHANGED
|
@@ -273,7 +273,6 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
273
273
|
};
|
|
274
274
|
dependsOn.push({
|
|
275
275
|
target: targetName,
|
|
276
|
-
projects: 'self',
|
|
277
276
|
params: 'forward',
|
|
278
277
|
options: 'forward',
|
|
279
278
|
});
|
|
@@ -389,7 +388,6 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
389
388
|
};
|
|
390
389
|
dependsOn.push({
|
|
391
390
|
target: targetName,
|
|
392
|
-
projects: 'self',
|
|
393
391
|
params: 'forward',
|
|
394
392
|
options: 'forward',
|
|
395
393
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-linter.d.ts","sourceRoot":"","sources":["../../../../../packages/cypress/src/utils/add-linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,IAAI,EACL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAwB,MAAM,YAAY,CAAC;AAiBtE,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb;;;QAGI;IACJ,UAAU,EAAE,MAAM,CAAC;IACnB;;;QAGI;IACJ,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"add-linter.d.ts","sourceRoot":"","sources":["../../../../../packages/cypress/src/utils/add-linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,IAAI,EACL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAwB,MAAM,YAAY,CAAC;AAiBtE,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb;;;QAGI;IACJ,UAAU,EAAE,MAAM,CAAC;IACnB;;;QAGI;IACJ,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,eAAe,uBAgIzB"}
|
package/src/utils/add-linter.js
CHANGED
|
@@ -32,7 +32,7 @@ async function addLinterToCyProject(tree, options) {
|
|
|
32
32
|
options.overwriteExisting = options.overwriteExisting || !eslintFile;
|
|
33
33
|
if (!options.skipPackageJson) {
|
|
34
34
|
const pkgVersions = (0, versions_1.versions)(tree);
|
|
35
|
-
tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, { 'eslint-plugin-cypress': pkgVersions.eslintPluginCypressVersion }));
|
|
35
|
+
tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, { 'eslint-plugin-cypress': pkgVersions.eslintPluginCypressVersion }, undefined, true));
|
|
36
36
|
}
|
|
37
37
|
if ((0, eslint_file_1.isEslintConfigSupported)(tree, projectConfig.root) ||
|
|
38
38
|
(0, eslint_file_1.isEslintConfigSupported)(tree)) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-supported-cypress-version.d.ts","sourceRoot":"","sources":["../../../../../packages/cypress/src/utils/assert-supported-cypress-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAIvC,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAE9D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertSupportedCypressVersion = assertSupportedCypressVersion;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
|
+
const versions_1 = require("./versions");
|
|
6
|
+
function assertSupportedCypressVersion(tree) {
|
|
7
|
+
(0, internal_1.assertSupportedPackageVersion)(tree, 'cypress', versions_1.minSupportedCypressVersion);
|
|
8
|
+
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Tree } from '@nx/devkit';
|
|
2
2
|
export declare const nxVersion: any;
|
|
3
|
+
export declare const minSupportedCypressVersion = "13.0.0";
|
|
3
4
|
export declare const eslintPluginCypressVersion = "^3.5.0";
|
|
4
5
|
export declare const typesNodeVersion = "^22.0.0";
|
|
5
6
|
export declare const cypressViteDevServerVersion = "^7.3.1";
|
|
@@ -7,7 +8,7 @@ export declare const cypressVersion = "^15.14.2";
|
|
|
7
8
|
export declare const cypressWebpackVersion = "^5.4.1";
|
|
8
9
|
export declare const viteVersion = "^6.0.0";
|
|
9
10
|
export declare const htmlWebpackPluginVersion = "^5.5.0";
|
|
10
|
-
export type CypressVersions = Record<keyof Omit<typeof import('./versions'), 'nxVersion' | 'versions' | 'getInstalledCypressVersion' | 'getInstalledCypressMajorVersion' | 'assertMinimumCypressVersion'>, string>;
|
|
11
|
+
export type CypressVersions = Record<keyof Omit<typeof import('./versions'), 'nxVersion' | 'minSupportedCypressVersion' | 'versions' | 'getInstalledCypressVersion' | 'getInstalledCypressMajorVersion' | 'assertMinimumCypressVersion'>, string>;
|
|
11
12
|
export declare function versions(tree: Tree): CypressVersions;
|
|
12
13
|
export declare function getInstalledCypressVersion(tree?: Tree): string | null;
|
|
13
14
|
export declare function getInstalledCypressMajorVersion(tree?: Tree): number | null;
|
|
@@ -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,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,
|
|
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,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,4BAA4B,GAC5B,UAAU,GACV,4BAA4B,GAC5B,iCAAiC,GACjC,6BAA6B,CAChC,EACD,MAAM,CACP,CAAC;AAkCF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,eAAe,CAQpD;AAED,wBAAgB,0BAA0B,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAarE;AAED,wBAAgB,+BAA+B,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAG1E;AAED,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,EAClB,IAAI,CAAC,EAAE,IAAI,GACV,IAAI,CAON"}
|
package/src/utils/versions.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.htmlWebpackPluginVersion = exports.viteVersion = exports.cypressWebpackVersion = exports.cypressVersion = exports.cypressViteDevServerVersion = exports.typesNodeVersion = exports.eslintPluginCypressVersion = exports.nxVersion = void 0;
|
|
3
|
+
exports.htmlWebpackPluginVersion = exports.viteVersion = exports.cypressWebpackVersion = exports.cypressVersion = exports.cypressViteDevServerVersion = exports.typesNodeVersion = exports.eslintPluginCypressVersion = exports.minSupportedCypressVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.versions = versions;
|
|
5
5
|
exports.getInstalledCypressVersion = getInstalledCypressVersion;
|
|
6
6
|
exports.getInstalledCypressMajorVersion = getInstalledCypressMajorVersion;
|
|
7
7
|
exports.assertMinimumCypressVersion = assertMinimumCypressVersion;
|
|
8
8
|
const devkit_1 = require("@nx/devkit");
|
|
9
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
9
10
|
const semver_1 = require("semver");
|
|
10
11
|
exports.nxVersion = require('../../package.json').version;
|
|
12
|
+
exports.minSupportedCypressVersion = '13.0.0';
|
|
11
13
|
exports.eslintPluginCypressVersion = '^3.5.0';
|
|
12
14
|
exports.typesNodeVersion = '^22.0.0';
|
|
13
15
|
exports.cypressViteDevServerVersion = '^7.3.1';
|
|
@@ -50,31 +52,20 @@ function versions(tree) {
|
|
|
50
52
|
return latestVersions;
|
|
51
53
|
}
|
|
52
54
|
const cypressMajorVersion = (0, semver_1.major)(installedCypressVersion);
|
|
53
|
-
|
|
54
|
-
case 15:
|
|
55
|
-
return latestVersions;
|
|
56
|
-
case 14:
|
|
57
|
-
return versionMap[14];
|
|
58
|
-
case 13:
|
|
59
|
-
return versionMap[13];
|
|
60
|
-
default:
|
|
61
|
-
throw new Error(`You're currently using an unsupported Cypress version: ${installedCypressVersion}. Supported versions are v13, v14, and v15.`);
|
|
62
|
-
}
|
|
55
|
+
return versionMap[cypressMajorVersion] ?? latestVersions;
|
|
63
56
|
}
|
|
64
57
|
function getInstalledCypressVersion(tree) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (tree) {
|
|
68
|
-
version = getCypressVersionFromTree(tree);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
version = getCypressVersionFromFileSystem();
|
|
72
|
-
}
|
|
73
|
-
return version;
|
|
58
|
+
if (!tree) {
|
|
59
|
+
return (0, internal_1.getInstalledPackageVersion)('cypress');
|
|
74
60
|
}
|
|
75
|
-
|
|
61
|
+
const installedVersion = (0, devkit_1.getDependencyVersionFromPackageJson)(tree, 'cypress');
|
|
62
|
+
if (!installedVersion) {
|
|
76
63
|
return null;
|
|
77
64
|
}
|
|
65
|
+
if (installedVersion === 'latest' || installedVersion === 'next') {
|
|
66
|
+
return (0, semver_1.clean)(exports.cypressVersion) ?? (0, semver_1.coerce)(exports.cypressVersion)?.version ?? null;
|
|
67
|
+
}
|
|
68
|
+
return (0, semver_1.clean)(installedVersion) ?? (0, semver_1.coerce)(installedVersion)?.version ?? null;
|
|
78
69
|
}
|
|
79
70
|
function getInstalledCypressMajorVersion(tree) {
|
|
80
71
|
const installedCypressVersion = getInstalledCypressVersion(tree);
|
|
@@ -86,24 +77,3 @@ function assertMinimumCypressVersion(minVersion, tree) {
|
|
|
86
77
|
throw new Error(`Cypress version of ${minVersion} or higher is not installed. Expected Cypress v${minVersion}+, found Cypress v${version} instead.`);
|
|
87
78
|
}
|
|
88
79
|
}
|
|
89
|
-
function getCypressVersionFromTree(tree) {
|
|
90
|
-
const installedVersion = (0, devkit_1.getDependencyVersionFromPackageJson)(tree, 'cypress');
|
|
91
|
-
if (!installedVersion) {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
if (installedVersion === 'latest' || installedVersion === 'next') {
|
|
95
|
-
return (0, semver_1.clean)(exports.cypressVersion) ?? (0, semver_1.coerce)(exports.cypressVersion)?.version;
|
|
96
|
-
}
|
|
97
|
-
return (0, semver_1.clean)(installedVersion) ?? (0, semver_1.coerce)(installedVersion)?.version;
|
|
98
|
-
}
|
|
99
|
-
function getCypressVersionFromFileSystem() {
|
|
100
|
-
let packageJson;
|
|
101
|
-
try {
|
|
102
|
-
packageJson = require('cypress/package.json');
|
|
103
|
-
}
|
|
104
|
-
catch { }
|
|
105
|
-
if (!packageJson) {
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
return packageJson.version;
|
|
109
|
-
}
|