@nx/playwright 23.1.0-beta.4 → 23.1.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.
@@ -254,15 +254,30 @@ function setupE2ETargetDefaults(tree) {
254
254
  return;
255
255
  }
256
256
  // E2e targets depend on all their project's sources + production sources of dependencies
257
- nxJson.targetDefaults ??= {};
258
257
  const productionFileSet = !!nxJson.namedInputs?.production;
259
- nxJson.targetDefaults.e2e ??= {};
260
- nxJson.targetDefaults.e2e.cache ??= true;
261
- nxJson.targetDefaults.e2e.inputs ??= [
262
- 'default',
263
- productionFileSet ? '^production' : '^default',
264
- ];
265
- (0, devkit_1.updateNxJson)(tree, nxJson);
258
+ // Either a `target: 'e2e'` default or a default keyed on the executor
259
+ // we're about to scaffold will apply to the new target — consider both
260
+ // before deciding to add cache/inputs. Target-keyed wins when both are
261
+ // present.
262
+ const existingForTarget = (0, internal_1.findTargetDefault)(nxJson.targetDefaults, {
263
+ target: 'e2e',
264
+ });
265
+ const existingForExecutor = (0, internal_1.findTargetDefault)(nxJson.targetDefaults, {
266
+ executor: '@nx/playwright:playwright',
267
+ });
268
+ const existingCache = existingForTarget?.cache ?? existingForExecutor?.cache;
269
+ const existingInputs = existingForTarget?.inputs ?? existingForExecutor?.inputs;
270
+ const patch = {};
271
+ if (existingCache === undefined) {
272
+ patch.cache = true;
273
+ }
274
+ if (existingInputs === undefined) {
275
+ patch.inputs = ['default', productionFileSet ? '^production' : '^default'];
276
+ }
277
+ if (Object.keys(patch).length > 0) {
278
+ (0, internal_1.upsertTargetDefault)(tree, nxJson, { target: 'e2e', ...patch });
279
+ (0, devkit_1.updateNxJson)(tree, nxJson);
280
+ }
266
281
  }
267
282
  function addE2eTarget(tree, options) {
268
283
  const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/playwright",
3
- "version": "23.1.0-beta.4",
3
+ "version": "23.1.0-beta.6",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "files": [
@@ -78,12 +78,12 @@
78
78
  "tslib": "^2.3.0",
79
79
  "minimatch": "10.2.5",
80
80
  "semver": "^7.6.3",
81
- "@nx/devkit": "23.1.0-beta.4",
82
- "@nx/eslint": "23.1.0-beta.4",
83
- "@nx/js": "23.1.0-beta.4"
81
+ "@nx/devkit": "23.1.0-beta.6",
82
+ "@nx/eslint": "23.1.0-beta.6",
83
+ "@nx/js": "23.1.0-beta.6"
84
84
  },
85
85
  "devDependencies": {
86
- "nx": "23.1.0-beta.4"
86
+ "nx": "23.1.0-beta.6"
87
87
  },
88
88
  "peerDependencies": {
89
89
  "@playwright/test": "^1.36.0"