@nx/cypress 23.0.0-beta.5 → 23.0.0-beta.6
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 +6 -6
- 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 -0
- 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/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +11 -11
- 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/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.6",
|
|
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.
|
|
40
|
+
"@nx/devkit": "23.0.0-beta.6",
|
|
41
|
+
"@nx/eslint": "23.0.0-beta.6",
|
|
42
|
+
"@nx/js": "23.0.0-beta.6",
|
|
43
43
|
"@phenomnomnominal/tsquery": "~6.1.4",
|
|
44
|
-
"detect-port": "^1.
|
|
44
|
+
"detect-port": "^2.1.0",
|
|
45
45
|
"semver": "^7.6.3",
|
|
46
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.6"
|
|
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,EAIjB,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,EAIjB,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,8BAyD7C;AAkHD,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,oBAAoB,QAsDpC;AAOD,eAAe,+BAA+B,CAAC"}
|
|
@@ -7,6 +7,7 @@ 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
9
|
const semver_1 = require("semver");
|
|
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");
|
|
12
13
|
const init_1 = tslib_1.__importDefault(require("../init/init"));
|
|
@@ -47,6 +48,7 @@ async function componentConfigurationGeneratorInternal(tree, options) {
|
|
|
47
48
|
}
|
|
48
49
|
addProjectFiles(tree, projectConfig, opts);
|
|
49
50
|
if (!hasPlugin || opts.addExplicitTargets) {
|
|
51
|
+
(0, deprecation_1.warnCypressExecutorScaffolding)();
|
|
50
52
|
addTargetToProject(tree, projectConfig, opts);
|
|
51
53
|
}
|
|
52
54
|
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.warnCypressExecutorScaffolding)();
|
|
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
|
}
|
|
@@ -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));
|
|
@@ -143,7 +143,7 @@ function getOutputs(projectRoot, cypressConfig, testingType) {
|
|
|
143
143
|
return outputs;
|
|
144
144
|
}
|
|
145
145
|
async function buildCypressTargets(configFilePath, projectRoot, options, context, pmc) {
|
|
146
|
-
const cypressConfig = await (0,
|
|
146
|
+
const cypressConfig = await (0, internal_1.loadConfigFile)((0, path_1.join)(context.workspaceRoot, configFilePath));
|
|
147
147
|
const pluginPresetOptions = {
|
|
148
148
|
...cypressConfig.e2e?.[constants_1.NX_PLUGIN_OPTIONS],
|
|
149
149
|
...cypressConfig.env,
|
|
@@ -151,7 +151,7 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
151
151
|
};
|
|
152
152
|
const webServerCommands = pluginPresetOptions?.webServerCommands;
|
|
153
153
|
const shouldReuseExistingServer = pluginPresetOptions?.reuseExistingServer ?? true;
|
|
154
|
-
const namedInputs = (0,
|
|
154
|
+
const namedInputs = (0, internal_1.getNamedInputs)(projectRoot, context);
|
|
155
155
|
const targets = {};
|
|
156
156
|
let metadata;
|
|
157
157
|
const tsNodeCompilerOptions = JSON.stringify({ customConditions: null });
|
|
@@ -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 warnCypressExecutorScaffolding(): 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,8BAA8B,IAAI,IAAI,CAIrD"}
|
|
@@ -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.warnCypressExecutorScaffolding = warnCypressExecutorScaffolding;
|
|
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 scaffold 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 scaffold time rather than only when the user later runs the
|
|
17
|
+
// generated target.
|
|
18
|
+
function warnCypressExecutorScaffolding() {
|
|
19
|
+
devkit_1.logger.warn('Scaffolding 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` after this scaffold to migrate the generated target to the `@nx/cypress/plugin` inferred plugin. To skip emitting executor targets entirely on future scaffolds, register `@nx/cypress/plugin` in `nx.json` first (`nx add @nx/cypress` or a manual plugin entry). See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
|
|
20
|
+
}
|