@nx/playwright 23.0.0-beta.5 → 23.0.0-beta.7

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": "23.0.0-beta.5",
3
+ "version": "23.0.0-beta.7",
4
4
  "type": "commonjs",
5
5
  "homepage": "https://nx.dev",
6
6
  "private": false,
@@ -34,14 +34,14 @@
34
34
  "directory": "packages/playwright"
35
35
  },
36
36
  "dependencies": {
37
- "@nx/devkit": "23.0.0-beta.5",
38
- "@nx/eslint": "23.0.0-beta.5",
39
- "@nx/js": "23.0.0-beta.5",
37
+ "@nx/devkit": "23.0.0-beta.7",
38
+ "@nx/eslint": "23.0.0-beta.7",
39
+ "@nx/js": "23.0.0-beta.7",
40
40
  "tslib": "^2.3.0",
41
41
  "minimatch": "10.2.4"
42
42
  },
43
43
  "devDependencies": {
44
- "nx": "23.0.0-beta.5"
44
+ "nx": "23.0.0-beta.7"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@playwright/test": "^1.36.0"
@@ -1 +1 @@
1
- {"version":3,"file":"merge-reports.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/playwright/src/executors/merge-reports/merge-reports.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAOpB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe;;GAqHzB;AAED,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"merge-reports.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/playwright/src/executors/merge-reports/merge-reports.impl.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAMpB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe;;GAqHzB;AAED,eAAe,oBAAoB,CAAC"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mergeReportsExecutor = mergeReportsExecutor;
4
+ const internal_1 = require("@nx/devkit/internal");
4
5
  const devkit_1 = require("@nx/devkit");
5
- const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
6
6
  const node_child_process_1 = require("node:child_process");
7
7
  const node_fs_1 = require("node:fs");
8
8
  const node_path_1 = require("node:path");
@@ -11,7 +11,7 @@ async function mergeReportsExecutor(options, context) {
11
11
  const { config, expectedSuites } = options;
12
12
  const projectRoot = (0, node_path_1.join)(context.root, context.projectsConfigurations.projects[context.projectName].root);
13
13
  const configPath = (0, node_path_1.join)(projectRoot, config);
14
- const playwrightConfig = await (0, config_utils_1.loadConfigFile)(configPath);
14
+ const playwrightConfig = await (0, internal_1.loadConfigFile)(configPath);
15
15
  const reporterOutputs = (0, reporters_1.getReporterOutputs)(playwrightConfig);
16
16
  const blobReporterOutput = reporterOutputs.find(([reporter]) => reporter === 'blob');
17
17
  if (!blobReporterOutput) {
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/playwright/src/generators/configuration/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAUjB,IAAI,EAML,MAAM,YAAY,CAAC;AAiBpB,OAAO,KAAK,EACV,4BAA4B,EAE7B,MAAM,UAAU,CAAC;AAGlB,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4BAA4B,8BAGtC;AAED,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,4BAA4B,8BA+MzC;AA2JD,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/playwright/src/generators/configuration/configuration.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EAUjB,IAAI,EAML,MAAM,YAAY,CAAC;AAepB,OAAO,KAAK,EACV,4BAA4B,EAE7B,MAAM,UAAU,CAAC;AAGlB,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4BAA4B,8BAGtC;AAED,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,4BAA4B,8BA+MzC;AA2JD,eAAe,sBAAsB,CAAC"}
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.configurationGenerator = configurationGenerator;
4
4
  exports.configurationGeneratorInternal = configurationGeneratorInternal;
5
5
  const tslib_1 = require("tslib");
6
+ const internal_1 = require("@nx/devkit/internal");
6
7
  const devkit_1 = require("@nx/devkit");
7
- const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
8
- const prompt_1 = require("@nx/devkit/src/generators/prompt");
9
8
  const js_1 = require("@nx/js");
10
9
  const generator_prompts_1 = require("@nx/js/src/utils/generator-prompts");
11
10
  const package_manager_workspaces_1 = require("@nx/js/src/utils/package-manager-workspaces");
@@ -112,7 +111,7 @@ async function configurationGeneratorInternal(tree, rawOptions) {
112
111
  if (isTsSolutionSetup) {
113
112
  const packageJsonPath = (0, devkit_1.joinPathFragments)(projectConfig.root, 'package.json');
114
113
  if (!tree.exists(packageJsonPath)) {
115
- const importPath = (0, project_name_and_root_utils_1.resolveImportPath)(tree, projectConfig.name, projectConfig.root);
114
+ const importPath = (0, internal_1.resolveImportPath)(tree, projectConfig.name, projectConfig.root);
116
115
  const packageJson = {
117
116
  name: importPath,
118
117
  version: '0.0.1',
@@ -186,7 +185,7 @@ async function normalizeOptions(tree, options) {
186
185
  };
187
186
  }
188
187
  async function promptForMissingServeData(projectName) {
189
- const { command, port } = await (0, prompt_1.promptWhenInteractive)([
188
+ const { command, port } = await (0, internal_1.promptWhenInteractive)([
190
189
  {
191
190
  type: 'input',
192
191
  name: 'command',
@@ -1 +1 @@
1
- {"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/playwright/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAOpB,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,iBA0BlE;AA+BD,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/playwright/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"AAIA,OAAO,EAKL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAGpB,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,iBA0BlE;AA+BD,eAAe,iBAAiB,CAAC"}
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.convertToInferred = convertToInferred;
4
+ const internal_1 = require("@nx/devkit/internal");
4
5
  const devkit_1 = require("@nx/devkit");
5
6
  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
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.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/playwright/plugin', plugin_1.createNodesV2, { targetName: 'e2e', ciTargetName: 'e2e-ci' }, [
9
+ const migratedProjects = await (0, internal_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/playwright/plugin', plugin_1.createNodesV2, { targetName: 'e2e', ciTargetName: 'e2e-ci' }, [
10
10
  {
11
11
  executors: ['@nx/playwright:playwright'],
12
12
  postTargetTransformer,
@@ -14,7 +14,7 @@ async function convertToInferred(tree, options) {
14
14
  },
15
15
  ], options.project);
16
16
  if (migratedProjects.size === 0) {
17
- throw new executor_to_plugin_migrator_1.NoTargetsToMigrateError();
17
+ throw new internal_1.NoTargetsToMigrateError();
18
18
  }
19
19
  if (!options.skipFormat) {
20
20
  await (0, devkit_1.formatFiles)(tree);
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/playwright/src/generators/init/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,mBAAmB,8BAErE;AAED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mBAAmB,8BA0C7B;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/playwright/src/generators/init/init.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,mBAAmB,8BAErE;AAED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mBAAmB,8BA0C7B;AAED,eAAe,aAAa,CAAC"}
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.initGenerator = initGenerator;
4
4
  exports.initGeneratorInternal = initGeneratorInternal;
5
+ const internal_1 = require("@nx/devkit/internal");
5
6
  const devkit_1 = require("@nx/devkit");
6
- const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
7
7
  const plugin_1 = require("../../plugins/plugin");
8
8
  const versions_1 = require("../../utils/versions");
9
9
  function initGenerator(tree, options) {
@@ -22,7 +22,7 @@ async function initGeneratorInternal(tree, options) {
22
22
  }, undefined, options.keepExistingVersions));
23
23
  }
24
24
  if (options.addPlugin) {
25
- await (0, add_plugin_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/playwright/plugin', plugin_1.createNodesV2, { targetName: ['e2e', 'playwright:e2e', 'playwright-e2e'] }, options.updatePackageScripts);
25
+ await (0, internal_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/playwright/plugin', plugin_1.createNodesV2, { targetName: ['e2e', 'playwright:e2e', 'playwright-e2e'] }, options.updatePackageScripts);
26
26
  }
27
27
  if (!options.skipFormat) {
28
28
  await (0, devkit_1.formatFiles)(tree);
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/playwright/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAQnB,MAAM,YAAY,CAAC;AAgBpB,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAWD,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,uBAAuB,CAwB9D,CAAC;AAEF,eAAO,MAAM,aAAa,wCAAc,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/playwright/src/plugins/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,aAAa,EAQnB,MAAM,YAAY,CAAC;AAapB,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAWD,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,uBAAuB,CA+B9D,CAAC;AAEF,eAAO,MAAM,aAAa,wCAAc,CAAC"}
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createNodesV2 = exports.createNodes = void 0;
4
+ const internal_1 = require("@nx/devkit/internal");
4
5
  const devkit_1 = require("@nx/devkit");
5
- const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
6
- const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
7
- const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
8
6
  const js_1 = require("@nx/js");
9
- const internal_1 = require("@nx/js/src/internal");
7
+ const internal_2 = require("@nx/js/src/internal");
10
8
  const minimatch_1 = require("minimatch");
11
9
  const node_fs_1 = require("node:fs");
12
10
  const node_path_1 = require("node:path");
@@ -22,17 +20,19 @@ exports.createNodes = [
22
20
  const optionsHash = (0, file_hasher_1.hashObject)(options);
23
21
  const cachePath = (0, node_path_1.join)(cache_directory_1.workspaceDataDirectory, `playwright-${optionsHash}.hash`);
24
22
  const pluginCache = new plugin_cache_utils_1.PluginCache(cachePath);
25
- const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
23
+ const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
24
+ const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
25
+ const lockFileName = (0, js_1.getLockFileName)(packageManager);
26
26
  try {
27
- return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, pluginCache, pmc), configFilePaths, options, context);
27
+ return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, pluginCache, pmc, lockFileName), configFilePaths, options, context);
28
28
  }
29
29
  finally {
30
- pluginCache.writeToDisk(cachePath);
30
+ pluginCache.writeToDisk();
31
31
  }
32
32
  },
33
33
  ];
34
34
  exports.createNodesV2 = exports.createNodes;
35
- async function createNodesInternal(configFilePath, options, context, pluginCache, pmc) {
35
+ async function createNodesInternal(configFilePath, options, context, pluginCache, pmc, lockFileName) {
36
36
  const projectRoot = (0, node_path_1.dirname)(configFilePath);
37
37
  // Do not create a project if package.json and project.json isn't there.
38
38
  const siblingFiles = (0, node_fs_1.readdirSync)((0, node_path_1.join)(context.workspaceRoot, projectRoot));
@@ -42,13 +42,10 @@ async function createNodesInternal(configFilePath, options, context, pluginCache
42
42
  }
43
43
  const normalizedOptions = normalizeOptions(options);
44
44
  const externalTsconfigInputs = collectExternalTsconfigInputs(projectRoot, context.workspaceRoot);
45
- const hash = await (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, {
45
+ const hash = await (0, internal_1.calculateHashForCreateNodes)(projectRoot, {
46
46
  ...normalizedOptions,
47
47
  CI: process.env.CI,
48
- }, context, [
49
- (0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot)),
50
- ...externalTsconfigInputs,
51
- ]);
48
+ }, context, [lockFileName, ...externalTsconfigInputs]);
52
49
  if (!pluginCache.has(hash)) {
53
50
  pluginCache.set(hash, await buildPlaywrightTargets(configFilePath, projectRoot, normalizedOptions, context, pmc, externalTsconfigInputs));
54
51
  }
@@ -68,8 +65,8 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
68
65
  // but we're just reading the config so let's delete the variable they are using to detect this.
69
66
  // See: https://github.com/microsoft/playwright/pull/11218/files
70
67
  delete process['__pw_initiator__'];
71
- const playwrightConfig = await (0, config_utils_1.loadConfigFile)((0, node_path_1.join)(context.workspaceRoot, configFilePath));
72
- const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);
68
+ const playwrightConfig = await (0, internal_1.loadConfigFile)((0, node_path_1.join)(context.workspaceRoot, configFilePath));
69
+ const namedInputs = (0, internal_1.getNamedInputs)(projectRoot, context);
73
70
  const tsconfigJsonInputs = externalTsconfigInputs.map((file) => ({
74
71
  json: `{workspaceRoot}/${file}`,
75
72
  fields: ['compilerOptions', 'extends', 'files', 'include'],
@@ -454,11 +451,11 @@ function collectExternalTsconfigInputs(projectRoot, workspaceRoot) {
454
451
  };
455
452
  const projectTsconfig = (0, node_path_1.join)(workspaceRoot, projectRoot, 'tsconfig.json');
456
453
  if ((0, node_fs_1.existsSync)(projectTsconfig)) {
457
- (0, internal_1.walkTsconfigExtendsChain)(projectTsconfig, visit);
454
+ (0, internal_2.walkTsconfigExtendsChain)(projectTsconfig, visit);
458
455
  }
459
456
  const rootTsconfig = (0, node_path_1.join)(workspaceRoot, 'tsconfig.json');
460
457
  if ((0, node_fs_1.existsSync)(rootTsconfig)) {
461
- (0, internal_1.walkTsconfigExtendsChain)(rootTsconfig, visit);
458
+ (0, internal_2.walkTsconfigExtendsChain)(rootTsconfig, visit);
462
459
  }
463
460
  return collected;
464
461
  }