@nx/playwright 23.0.0-rc.3 → 23.0.0-rc.4

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,30 +254,15 @@ 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 ??= {};
257
258
  const productionFileSet = !!nxJson.namedInputs?.production;
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
- }
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);
281
266
  }
282
267
  function addE2eTarget(tree, options) {
283
268
  const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
@@ -0,0 +1,25 @@
1
+ #### Rename `createNodesV2` imports to `createNodes`
2
+
3
+ `@nx/playwright` renamed its primary inferred-plugin export from `createNodesV2` to `createNodes`. The `createNodesV2` name is preserved as a deprecated alias for now, but new code should use `createNodes`.
4
+
5
+ This migration scans every `.ts`, `.tsx`, `.cts`, and `.mts` file in your workspace and rewrites named imports and re-exports of `createNodesV2` from `@nx/playwright/plugin` to `createNodes`.
6
+
7
+ #### Sample Code Changes
8
+
9
+ ##### Before
10
+
11
+ ```ts
12
+ import { createNodesV2 } from '@nx/playwright/plugin';
13
+ ```
14
+
15
+ ##### After
16
+
17
+ ```ts
18
+ import { createNodes } from '@nx/playwright/plugin';
19
+ ```
20
+
21
+ Aliases are preserved (`createNodesV2 as cn` becomes `createNodes as cn`), and if a file already imports both names (`{ createNodes, createNodesV2 }`) the redundant binding is dropped.
22
+
23
+ #### What is not rewritten
24
+
25
+ Only static `import`/`export` named bindings from `@nx/playwright/plugin` are rewritten. Namespace imports, dynamic `import(...)`, `require(...)` destructuring, and property access such as `plugin.createNodesV2` are left untouched — they keep working through the `createNodesV2` runtime alias. Update those by hand if you want to drop the deprecated name everywhere.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/playwright",
3
- "version": "23.0.0-rc.3",
3
+ "version": "23.0.0-rc.4",
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.0.0-rc.3",
82
- "@nx/eslint": "23.0.0-rc.3",
83
- "@nx/js": "23.0.0-rc.3"
81
+ "@nx/devkit": "23.0.0-rc.4",
82
+ "@nx/eslint": "23.0.0-rc.4",
83
+ "@nx/js": "23.0.0-rc.4"
84
84
  },
85
85
  "devDependencies": {
86
- "nx": "23.0.0-rc.3"
86
+ "nx": "23.0.0-rc.4"
87
87
  },
88
88
  "peerDependencies": {
89
89
  "@playwright/test": "^1.36.0"