@nx/playwright 19.0.0-canary.20240423-b37bfdb → 19.0.0-canary.20240426-ac9ad35

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/generators.json CHANGED
@@ -11,6 +11,11 @@
11
11
  "factory": "./src/generators/init/init#initGeneratorInternal",
12
12
  "schema": "./src/generators/init/schema.json",
13
13
  "description": "Initializes a Playwright project in the current workspace"
14
+ },
15
+ "convert-to-inferred": {
16
+ "factory": "./src/generators/convert-to-inferred/convert-to-inferred",
17
+ "schema": "./src/generators/convert-to-inferred/schema.json",
18
+ "description": "Convert existing Playwright project(s) using `@nx/playwright:playwright` executor to use `@nx/playwright/plugin`."
14
19
  }
15
20
  }
16
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/playwright",
3
- "version": "19.0.0-canary.20240423-b37bfdb",
3
+ "version": "19.0.0-canary.20240426-ac9ad35",
4
4
  "type": "commonjs",
5
5
  "homepage": "https://nx.dev",
6
6
  "private": false,
@@ -33,9 +33,9 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@phenomnomnominal/tsquery": "~5.0.1",
36
- "@nx/devkit": "19.0.0-canary.20240423-b37bfdb",
37
- "@nx/eslint": "19.0.0-canary.20240423-b37bfdb",
38
- "@nx/js": "19.0.0-canary.20240423-b37bfdb",
36
+ "@nx/devkit": "19.0.0-canary.20240426-ac9ad35",
37
+ "@nx/eslint": "19.0.0-canary.20240426-ac9ad35",
38
+ "@nx/js": "19.0.0-canary.20240426-ac9ad35",
39
39
  "tslib": "^2.3.0",
40
40
  "minimatch": "9.0.3"
41
41
  },
@@ -0,0 +1,8 @@
1
+ import { type Tree } from '@nx/devkit';
2
+ interface Schema {
3
+ project?: string;
4
+ all?: boolean;
5
+ skipFormat?: boolean;
6
+ }
7
+ export declare function convertToInferred(tree: Tree, options: Schema): Promise<void>;
8
+ export default convertToInferred;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertToInferred = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const plugin_1 = require("../../plugins/plugin");
6
+ const executor_to_plugin_migrator_1 = require("@nx/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator");
7
+ async function convertToInferred(tree, options) {
8
+ const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
9
+ await (0, executor_to_plugin_migrator_1.migrateExecutorToPlugin)(tree, projectGraph, '@nx/playwright:playwright', '@nx/playwright/plugin', (targetName) => ({ targetName, ciTargetName: 'e2e-ci' }), postTargetTransformer, plugin_1.createNodes, options.project);
10
+ if (!options.skipFormat) {
11
+ await (0, devkit_1.formatFiles)(tree);
12
+ }
13
+ }
14
+ exports.convertToInferred = convertToInferred;
15
+ function postTargetTransformer(target) {
16
+ if (target.options) {
17
+ if (target.options?.config) {
18
+ delete target.options.config;
19
+ }
20
+ for (const [key, value] of Object.entries(target.options)) {
21
+ const newKeyName = (0, devkit_1.names)(key).fileName;
22
+ delete target.options[key];
23
+ target.options[newKeyName] = value;
24
+ }
25
+ }
26
+ return target;
27
+ }
28
+ exports.default = convertToInferred;
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "NxPlaywrightConvertToInferred",
4
+ "description": "Convert existing Playwright project(s) using `@nx/playwright:playwright` executor to use `@nx/playwright/plugin`. Defaults to migrating all projects. Pass '--project' to migrate only one target.",
5
+ "title": "Convert Playwright project from executor to plugin",
6
+ "type": "object",
7
+ "properties": {
8
+ "project": {
9
+ "type": "string",
10
+ "description": "The project to convert from using the `@nx/playwright:playwright` executor to use `@nx/playwright/plugin`.",
11
+ "x-priority": "important"
12
+ },
13
+ "skipFormat": {
14
+ "type": "boolean",
15
+ "description": "Whether to format files at the end of the migration.",
16
+ "default": false
17
+ }
18
+ }
19
+ }