@nx/cypress 18.2.4 → 18.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/plugins/plugin.js +27 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/cypress",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.3.0-beta.1",
|
|
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": {
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"migrations": "./migrations.json"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@nx/devkit": "18.
|
|
38
|
-
"@nx/eslint": "18.
|
|
39
|
-
"@nx/js": "18.
|
|
37
|
+
"@nx/devkit": "18.3.0-beta.1",
|
|
38
|
+
"@nx/eslint": "18.3.0-beta.1",
|
|
39
|
+
"@nx/js": "18.3.0-beta.1",
|
|
40
40
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
41
41
|
"detect-port": "^1.5.1",
|
|
42
42
|
"semver": "^7.5.3",
|
|
43
43
|
"tslib": "^2.3.0",
|
|
44
|
-
"@nrwl/cypress": "18.
|
|
44
|
+
"@nrwl/cypress": "18.3.0-beta.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"cypress": ">= 3 < 14"
|
package/src/plugins/plugin.js
CHANGED
|
@@ -39,20 +39,15 @@ exports.createNodes = [
|
|
|
39
39
|
const hash = (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, options, context, [
|
|
40
40
|
(0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot)),
|
|
41
41
|
]);
|
|
42
|
-
const { targets,
|
|
42
|
+
const { targets, metadata } = targetsCache[hash]
|
|
43
43
|
? targetsCache[hash]
|
|
44
44
|
: await buildCypressTargets(configFilePath, projectRoot, options, context);
|
|
45
|
-
calculatedTargets[hash] = { targets,
|
|
45
|
+
calculatedTargets[hash] = { targets, metadata };
|
|
46
46
|
const project = {
|
|
47
47
|
projectType: 'application',
|
|
48
48
|
targets,
|
|
49
|
-
metadata
|
|
50
|
-
technologies: ['cypress'],
|
|
51
|
-
},
|
|
49
|
+
metadata,
|
|
52
50
|
};
|
|
53
|
-
if (targetGroups) {
|
|
54
|
-
project.metadata.targetGroups = targetGroups;
|
|
55
|
-
}
|
|
56
51
|
return {
|
|
57
52
|
projects: {
|
|
58
53
|
[projectRoot]: project,
|
|
@@ -109,7 +104,7 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
109
104
|
const webServerCommands = pluginPresetOptions?.webServerCommands;
|
|
110
105
|
const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);
|
|
111
106
|
const targets = {};
|
|
112
|
-
let
|
|
107
|
+
let metadata;
|
|
113
108
|
if ('e2e' in cypressConfig) {
|
|
114
109
|
targets[options.targetName] = {
|
|
115
110
|
command: `cypress run`,
|
|
@@ -117,6 +112,10 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
117
112
|
cache: true,
|
|
118
113
|
inputs: getInputs(namedInputs),
|
|
119
114
|
outputs: getOutputs(projectRoot, cypressConfig, 'e2e'),
|
|
115
|
+
metadata: {
|
|
116
|
+
technologies: ['cypress'],
|
|
117
|
+
description: 'Runs Cypress Tests',
|
|
118
|
+
},
|
|
120
119
|
};
|
|
121
120
|
if (webServerCommands?.default) {
|
|
122
121
|
delete webServerCommands.default;
|
|
@@ -145,8 +144,8 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
145
144
|
const outputs = getOutputs(projectRoot, cypressConfig, 'e2e');
|
|
146
145
|
const inputs = getInputs(namedInputs);
|
|
147
146
|
const groupName = 'E2E (CI)';
|
|
148
|
-
|
|
149
|
-
const ciTargetGroup = targetGroups[groupName];
|
|
147
|
+
metadata = { targetGroups: { [groupName]: [] } };
|
|
148
|
+
const ciTargetGroup = metadata.targetGroups[groupName];
|
|
150
149
|
for (const file of specFiles) {
|
|
151
150
|
const relativeSpecFilePath = (0, devkit_1.normalizePath)((0, path_1.relative)(projectRoot, file));
|
|
152
151
|
const targetName = options.ciTargetName + '--' + relativeSpecFilePath;
|
|
@@ -159,6 +158,10 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
159
158
|
options: {
|
|
160
159
|
cwd: projectRoot,
|
|
161
160
|
},
|
|
161
|
+
metadata: {
|
|
162
|
+
technologies: ['cypress'],
|
|
163
|
+
description: `Runs Cypress Tests in ${relativeSpecFilePath} in CI`,
|
|
164
|
+
},
|
|
162
165
|
};
|
|
163
166
|
dependsOn.push({
|
|
164
167
|
target: targetName,
|
|
@@ -172,12 +175,13 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
172
175
|
inputs,
|
|
173
176
|
outputs,
|
|
174
177
|
dependsOn,
|
|
178
|
+
metadata: {
|
|
179
|
+
technologies: ['cypress'],
|
|
180
|
+
description: 'Runs Cypress Tests in CI',
|
|
181
|
+
},
|
|
175
182
|
};
|
|
176
183
|
ciTargetGroup.push(options.ciTargetName);
|
|
177
184
|
}
|
|
178
|
-
else {
|
|
179
|
-
targetGroups = null;
|
|
180
|
-
}
|
|
181
185
|
}
|
|
182
186
|
if ('component' in cypressConfig) {
|
|
183
187
|
// This will not override the e2e target if it is the same
|
|
@@ -187,13 +191,21 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
187
191
|
cache: true,
|
|
188
192
|
inputs: getInputs(namedInputs),
|
|
189
193
|
outputs: getOutputs(projectRoot, cypressConfig, 'component'),
|
|
194
|
+
metadata: {
|
|
195
|
+
technologies: ['cypress'],
|
|
196
|
+
description: 'Runs Cypress Component Tests',
|
|
197
|
+
},
|
|
190
198
|
};
|
|
191
199
|
}
|
|
192
200
|
targets[options.openTargetName] = {
|
|
193
201
|
command: `cypress open`,
|
|
194
202
|
options: { cwd: projectRoot },
|
|
203
|
+
metadata: {
|
|
204
|
+
technologies: ['cypress'],
|
|
205
|
+
description: 'Opens Cypress',
|
|
206
|
+
},
|
|
195
207
|
};
|
|
196
|
-
return { targets,
|
|
208
|
+
return { targets, metadata };
|
|
197
209
|
}
|
|
198
210
|
function normalizeOptions(options) {
|
|
199
211
|
options ??= {};
|