@nx/cypress 18.2.0-beta.0 → 18.2.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/LICENSE +1 -1
- package/package.json +5 -5
- package/src/plugins/plugin.js +13 -14
package/LICENSE
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/cypress",
|
|
3
|
-
"version": "18.2.0-beta.
|
|
3
|
+
"version": "18.2.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.2.0-beta.
|
|
38
|
-
"@nx/eslint": "18.2.0-beta.
|
|
39
|
-
"@nx/js": "18.2.0-beta.
|
|
37
|
+
"@nx/devkit": "18.2.0-beta.1",
|
|
38
|
+
"@nx/eslint": "18.2.0-beta.1",
|
|
39
|
+
"@nx/js": "18.2.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.2.0-beta.
|
|
44
|
+
"@nrwl/cypress": "18.2.0-beta.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"cypress": ">= 3 < 14"
|
package/src/plugins/plugin.js
CHANGED
|
@@ -39,10 +39,10 @@ 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, targetGroups } = targetsCache[hash]
|
|
43
43
|
? targetsCache[hash]
|
|
44
44
|
: await buildCypressTargets(configFilePath, projectRoot, options, context);
|
|
45
|
-
calculatedTargets[hash] = { targets,
|
|
45
|
+
calculatedTargets[hash] = { targets, targetGroups };
|
|
46
46
|
const project = {
|
|
47
47
|
projectType: 'application',
|
|
48
48
|
targets,
|
|
@@ -50,10 +50,8 @@ exports.createNodes = [
|
|
|
50
50
|
technologies: ['cypress'],
|
|
51
51
|
},
|
|
52
52
|
};
|
|
53
|
-
if (
|
|
54
|
-
project.metadata.targetGroups =
|
|
55
|
-
[`${projectRoot}:e2e-ci`]: ciTestingGroup,
|
|
56
|
-
};
|
|
53
|
+
if (targetGroups) {
|
|
54
|
+
project.metadata.targetGroups = targetGroups;
|
|
57
55
|
}
|
|
58
56
|
return {
|
|
59
57
|
projects: {
|
|
@@ -111,7 +109,7 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
111
109
|
const webServerCommands = pluginPresetOptions?.webServerCommands;
|
|
112
110
|
const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);
|
|
113
111
|
const targets = {};
|
|
114
|
-
let
|
|
112
|
+
let targetGroups;
|
|
115
113
|
if ('e2e' in cypressConfig) {
|
|
116
114
|
targets[options.targetName] = {
|
|
117
115
|
command: `cypress run`,
|
|
@@ -146,10 +144,12 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
146
144
|
const dependsOn = [];
|
|
147
145
|
const outputs = getOutputs(projectRoot, cypressConfig, 'e2e');
|
|
148
146
|
const inputs = getInputs(namedInputs);
|
|
147
|
+
targetGroups = { [options.ciTargetName]: [] };
|
|
148
|
+
const ciTargetGroup = targetGroups[options.ciTargetName];
|
|
149
149
|
for (const file of specFiles) {
|
|
150
150
|
const relativeSpecFilePath = (0, devkit_1.normalizePath)((0, path_1.relative)(projectRoot, file));
|
|
151
151
|
const targetName = options.ciTargetName + '--' + relativeSpecFilePath;
|
|
152
|
-
|
|
152
|
+
ciTargetGroup.push(targetName);
|
|
153
153
|
targets[targetName] = {
|
|
154
154
|
outputs,
|
|
155
155
|
inputs,
|
|
@@ -165,7 +165,6 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
165
165
|
params: 'forward',
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
targets[options.ciTargetName] ??= {};
|
|
169
168
|
targets[options.ciTargetName] = {
|
|
170
169
|
executor: 'nx:noop',
|
|
171
170
|
cache: true,
|
|
@@ -173,7 +172,10 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
173
172
|
outputs,
|
|
174
173
|
dependsOn,
|
|
175
174
|
};
|
|
176
|
-
|
|
175
|
+
ciTargetGroup.push(options.ciTargetName);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
targetGroups = null;
|
|
177
179
|
}
|
|
178
180
|
}
|
|
179
181
|
if ('component' in cypressConfig) {
|
|
@@ -186,10 +188,7 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
|
|
|
186
188
|
outputs: getOutputs(projectRoot, cypressConfig, 'component'),
|
|
187
189
|
};
|
|
188
190
|
}
|
|
189
|
-
|
|
190
|
-
ciTestingGroup = null;
|
|
191
|
-
}
|
|
192
|
-
return { targets, ciTestingGroup };
|
|
191
|
+
return { targets, targetGroups };
|
|
193
192
|
}
|
|
194
193
|
function normalizeOptions(options) {
|
|
195
194
|
options ??= {};
|