@nx/cypress 18.2.0-beta.0 → 18.2.0-beta.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2017-2023 Narwhal Technologies Inc.
3
+ Copyright (c) 2017-2024 Narwhal Technologies Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/cypress",
3
- "version": "18.2.0-beta.0",
3
+ "version": "18.2.0-beta.2",
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.0",
38
- "@nx/eslint": "18.2.0-beta.0",
39
- "@nx/js": "18.2.0-beta.0",
37
+ "@nx/devkit": "18.2.0-beta.2",
38
+ "@nx/eslint": "18.2.0-beta.2",
39
+ "@nx/js": "18.2.0-beta.2",
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.0"
44
+ "@nrwl/cypress": "18.2.0-beta.2"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "cypress": ">= 3 < 14"
@@ -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, ciTestingGroup } = targetsCache[hash]
42
+ const { targets, targetGroups } = targetsCache[hash]
43
43
  ? targetsCache[hash]
44
44
  : await buildCypressTargets(configFilePath, projectRoot, options, context);
45
- calculatedTargets[hash] = { targets, ciTestingGroup };
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 (ciTestingGroup) {
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 ciTestingGroup = [];
112
+ let targetGroups;
115
113
  if ('e2e' in cypressConfig) {
116
114
  targets[options.targetName] = {
117
115
  command: `cypress run`,
@@ -146,10 +144,13 @@ 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
+ const groupName = 'E2E (CI)';
148
+ targetGroups = { [groupName]: [] };
149
+ const ciTargetGroup = targetGroups[groupName];
149
150
  for (const file of specFiles) {
150
151
  const relativeSpecFilePath = (0, devkit_1.normalizePath)((0, path_1.relative)(projectRoot, file));
151
152
  const targetName = options.ciTargetName + '--' + relativeSpecFilePath;
152
- ciTestingGroup.push(targetName);
153
+ ciTargetGroup.push(targetName);
153
154
  targets[targetName] = {
154
155
  outputs,
155
156
  inputs,
@@ -165,7 +166,6 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
165
166
  params: 'forward',
166
167
  });
167
168
  }
168
- targets[options.ciTargetName] ??= {};
169
169
  targets[options.ciTargetName] = {
170
170
  executor: 'nx:noop',
171
171
  cache: true,
@@ -173,7 +173,10 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
173
173
  outputs,
174
174
  dependsOn,
175
175
  };
176
- ciTestingGroup.push(options.ciTargetName);
176
+ ciTargetGroup.push(options.ciTargetName);
177
+ }
178
+ else {
179
+ targetGroups = null;
177
180
  }
178
181
  }
179
182
  if ('component' in cypressConfig) {
@@ -186,10 +189,7 @@ async function buildCypressTargets(configFilePath, projectRoot, options, context
186
189
  outputs: getOutputs(projectRoot, cypressConfig, 'component'),
187
190
  };
188
191
  }
189
- if (ciTestingGroup.length === 0) {
190
- ciTestingGroup = null;
191
- }
192
- return { targets, ciTestingGroup };
192
+ return { targets, targetGroups };
193
193
  }
194
194
  function normalizeOptions(options) {
195
195
  options ??= {};