@nx/playwright 19.4.0-beta.0 → 19.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/playwright",
3
- "version": "19.4.0-beta.0",
3
+ "version": "19.4.0-beta.2",
4
4
  "type": "commonjs",
5
5
  "homepage": "https://nx.dev",
6
6
  "private": false,
@@ -35,9 +35,9 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@phenomnomnominal/tsquery": "~5.0.1",
38
- "@nx/devkit": "19.4.0-beta.0",
39
- "@nx/eslint": "19.4.0-beta.0",
40
- "@nx/js": "19.4.0-beta.0",
38
+ "@nx/devkit": "19.4.0-beta.2",
39
+ "@nx/eslint": "19.4.0-beta.2",
40
+ "@nx/js": "19.4.0-beta.2",
41
41
  "tslib": "^2.3.0",
42
42
  "minimatch": "9.0.3"
43
43
  },
@@ -11,7 +11,7 @@ export interface PlaywrightExecutorSchema {
11
11
  testFiles?: string[];
12
12
  headed?: boolean;
13
13
  ignoreSnapshots?: boolean;
14
- workers?: string;
14
+ workers?: number | string;
15
15
  list?: boolean;
16
16
  maxFailures?: number | boolean;
17
17
  noDeps?: boolean;
@@ -62,7 +62,7 @@
62
62
  },
63
63
  "workers": {
64
64
  "alias": "j",
65
- "type": "string",
65
+ "oneOf": [{ "type": "number" }, { "type": "string" }],
66
66
  "description": "Number of concurrent workers or percentage of logical CPU cores, use 1 to run in a single worker"
67
67
  },
68
68
  "list": {
@@ -6,7 +6,13 @@ const plugin_1 = require("../../plugins/plugin");
6
6
  const executor_to_plugin_migrator_1 = require("@nx/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator");
7
7
  async function convertToInferred(tree, options) {
8
8
  const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
9
- const migratedProjects = await (0, executor_to_plugin_migrator_1.migrateExecutorToPlugin)(tree, projectGraph, '@nx/playwright:playwright', '@nx/playwright/plugin', (targetName) => ({ targetName, ciTargetName: 'e2e-ci' }), postTargetTransformer, plugin_1.createNodesV2, options.project);
9
+ const migratedProjects = await (0, executor_to_plugin_migrator_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/playwright/plugin', plugin_1.createNodesV2, { targetName: 'e2e', ciTargetName: 'e2e-ci' }, [
10
+ {
11
+ executors: ['@nx/playwright:playwright'],
12
+ postTargetTransformer,
13
+ targetPluginOptionMapper: (targetName) => ({ targetName }),
14
+ },
15
+ ], options.project);
10
16
  if (migratedProjects.size === 0) {
11
17
  throw new Error('Could not find any targets to migrate.');
12
18
  }
@@ -20,12 +26,21 @@ function postTargetTransformer(target) {
20
26
  if (target.options?.config) {
21
27
  delete target.options.config;
22
28
  }
23
- for (const [key, value] of Object.entries(target.options)) {
24
- const newKeyName = (0, devkit_1.names)(key).fileName;
25
- delete target.options[key];
26
- target.options[newKeyName] = value;
29
+ handleRenameOfProperties(target.options);
30
+ }
31
+ if (target.configurations) {
32
+ for (const configurationName in target.configurations) {
33
+ const configuration = target.configurations[configurationName];
34
+ handleRenameOfProperties(configuration);
27
35
  }
28
36
  }
29
37
  return target;
30
38
  }
39
+ function handleRenameOfProperties(options) {
40
+ for (const [key, value] of Object.entries(options)) {
41
+ const newKeyName = (0, devkit_1.names)(key).fileName;
42
+ delete options[key];
43
+ options[newKeyName] = value;
44
+ }
45
+ }
31
46
  exports.default = convertToInferred;
@@ -127,6 +127,7 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
127
127
  metadata: {
128
128
  technologies: ['playwright'],
129
129
  description: `Runs Playwright Tests in ${relativeSpecFilePath} in CI`,
130
+ nonAtomizedTarget: options.targetName,
130
131
  },
131
132
  };
132
133
  dependsOn.push({
@@ -149,6 +150,7 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
149
150
  metadata: {
150
151
  technologies: ['playwright'],
151
152
  description: 'Runs Playwright Tests in CI',
153
+ nonAtomizedTarget: options.targetName,
152
154
  },
153
155
  };
154
156
  ciTargetGroup.push(options.ciTargetName);