@nx/playwright 23.0.0-pr.35413.460eeef → 23.0.0-rc.0

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.
Files changed (67) hide show
  1. package/{index.d.ts → dist/index.d.ts} +0 -1
  2. package/{plugin.d.ts → dist/plugin.d.ts} +0 -1
  3. package/{preset.d.ts → dist/preset.d.ts} +0 -1
  4. package/{src → dist/src}/executors/merge-reports/merge-reports.impl.d.ts +0 -1
  5. package/{src → dist/src}/executors/merge-reports/merge-reports.impl.js +8 -2
  6. package/{src → dist/src}/executors/playwright/playwright.impl.d.ts +0 -1
  7. package/{src → dist/src}/executors/playwright/playwright.impl.js +2 -0
  8. package/{src → dist/src}/executors/playwright/schema.json +1 -0
  9. package/{src → dist/src}/generators/configuration/configuration.d.ts +0 -1
  10. package/{src → dist/src}/generators/configuration/configuration.js +55 -27
  11. package/{src/generators/configuration/files/playwright.config.ts.template → dist/src/generators/configuration/files/playwright.config.mts.template} +10 -3
  12. package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.d.ts +0 -1
  13. package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.js +5 -3
  14. package/{src → dist/src}/generators/init/init.d.ts +0 -1
  15. package/{src → dist/src}/generators/init/init.js +5 -3
  16. package/{src → dist/src}/generators/init/schema.json +1 -1
  17. package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.d.ts +9 -0
  18. package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.js +225 -0
  19. package/dist/src/plugins/plugin.d.ts +7 -0
  20. package/{src → dist/src}/plugins/plugin.js +57 -28
  21. package/{src → dist/src}/utils/add-linter.d.ts +0 -1
  22. package/{src → dist/src}/utils/add-linter.js +12 -14
  23. package/dist/src/utils/assert-supported-playwright-version.d.ts +2 -0
  24. package/dist/src/utils/assert-supported-playwright-version.js +8 -0
  25. package/dist/src/utils/deprecation.d.ts +3 -0
  26. package/dist/src/utils/deprecation.js +16 -0
  27. package/{src → dist/src}/utils/preset.d.ts +4 -2
  28. package/{src → dist/src}/utils/preset.js +15 -3
  29. package/{src → dist/src}/utils/reporters.d.ts +0 -1
  30. package/dist/src/utils/versions.d.ts +5 -0
  31. package/dist/src/utils/versions.js +9 -0
  32. package/executors.json +4 -4
  33. package/generators.json +6 -6
  34. package/migrations.json +8 -1
  35. package/package.json +61 -34
  36. package/index.d.ts.map +0 -1
  37. package/plugin.d.ts.map +0 -1
  38. package/preset.d.ts.map +0 -1
  39. package/src/executors/merge-reports/merge-reports.impl.d.ts.map +0 -1
  40. package/src/executors/playwright/playwright.impl.d.ts.map +0 -1
  41. package/src/generators/configuration/configuration.d.ts.map +0 -1
  42. package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +0 -1
  43. package/src/generators/init/init.d.ts.map +0 -1
  44. package/src/migrations/update-19-6-0/use-serve-static-preview-for-command.d.ts +0 -1
  45. package/src/migrations/update-19-6-0/use-serve-static-preview-for-command.d.ts.map +0 -1
  46. package/src/migrations/update-19-6-0/use-serve-static-preview-for-command.js +0 -0
  47. package/src/plugins/plugin.d.ts +0 -8
  48. package/src/plugins/plugin.d.ts.map +0 -1
  49. package/src/utils/add-linter.d.ts.map +0 -1
  50. package/src/utils/preset.d.ts.map +0 -1
  51. package/src/utils/reporters.d.ts.map +0 -1
  52. package/src/utils/versions.d.ts +0 -4
  53. package/src/utils/versions.d.ts.map +0 -1
  54. package/src/utils/versions.js +0 -6
  55. /package/{LICENSE → dist/LICENSE} +0 -0
  56. /package/{PLUGIN.md → dist/PLUGIN.md} +0 -0
  57. /package/{index.js → dist/index.js} +0 -0
  58. /package/{plugin.js → dist/plugin.js} +0 -0
  59. /package/{preset.js → dist/preset.js} +0 -0
  60. /package/{src → dist/src}/executors/merge-reports/schema.d.ts +0 -0
  61. /package/{src → dist/src}/executors/merge-reports/schema.json +0 -0
  62. /package/{src → dist/src}/generators/configuration/files/__directory__/example.spec.ts.template +0 -0
  63. /package/{src → dist/src}/generators/configuration/schema.d.ts +0 -0
  64. /package/{src → dist/src}/generators/configuration/schema.json +0 -0
  65. /package/{src → dist/src}/generators/convert-to-inferred/schema.json +0 -0
  66. /package/{src → dist/src}/generators/init/schema.d.ts +0 -0
  67. /package/{src → dist/src}/utils/reporters.js +0 -0
@@ -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/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,33 +20,41 @@ 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
+ const normalizedOptions = normalizeOptions(options);
26
27
  try {
27
- return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, pluginCache, pmc), configFilePaths, options, context);
28
+ const { entries, preErrors } = await filterPlaywrightConfigs(configFilePaths, context);
29
+ const projectHashes = await (0, internal_1.calculateHashesForCreateNodes)(entries.map((e) => e.projectRoot), { ...normalizedOptions, CI: process.env.CI }, context, entries.map((e) => [lockFileName, ...e.externalTsconfigInputs]));
30
+ let results = [];
31
+ let nodeErrors = [];
32
+ try {
33
+ results = await (0, devkit_1.createNodesFromFiles)((configFile, _, ctx, idx) => createNodesInternal(configFile, normalizedOptions, ctx, pluginCache, pmc, entries[idx].externalTsconfigInputs, projectHashes[idx]), entries.map((e) => e.configFile), options, context);
34
+ }
35
+ catch (e) {
36
+ if (e instanceof devkit_1.AggregateCreateNodesError) {
37
+ results = e.partialResults ?? [];
38
+ nodeErrors = e.errors;
39
+ }
40
+ else {
41
+ throw e;
42
+ }
43
+ }
44
+ const allErrors = [...preErrors, ...nodeErrors];
45
+ if (allErrors.length > 0) {
46
+ throw new devkit_1.AggregateCreateNodesError(allErrors, results);
47
+ }
48
+ return results;
28
49
  }
29
50
  finally {
30
- pluginCache.writeToDisk(cachePath);
51
+ pluginCache.writeToDisk();
31
52
  }
32
53
  },
33
54
  ];
34
55
  exports.createNodesV2 = exports.createNodes;
35
- async function createNodesInternal(configFilePath, options, context, pluginCache, pmc) {
56
+ async function createNodesInternal(configFilePath, normalizedOptions, context, pluginCache, pmc, externalTsconfigInputs, hash) {
36
57
  const projectRoot = (0, node_path_1.dirname)(configFilePath);
37
- // Do not create a project if package.json and project.json isn't there.
38
- const siblingFiles = (0, node_fs_1.readdirSync)((0, node_path_1.join)(context.workspaceRoot, projectRoot));
39
- if (!siblingFiles.includes('package.json') &&
40
- !siblingFiles.includes('project.json')) {
41
- return {};
42
- }
43
- const normalizedOptions = normalizeOptions(options);
44
- const externalTsconfigInputs = collectExternalTsconfigInputs(projectRoot, context.workspaceRoot);
45
- const hash = await (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, {
46
- ...normalizedOptions,
47
- CI: process.env.CI,
48
- }, context, [
49
- (0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot)),
50
- ...externalTsconfigInputs,
51
- ]);
52
58
  if (!pluginCache.has(hash)) {
53
59
  pluginCache.set(hash, await buildPlaywrightTargets(configFilePath, projectRoot, normalizedOptions, context, pmc, externalTsconfigInputs));
54
60
  }
@@ -68,8 +74,8 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
68
74
  // but we're just reading the config so let's delete the variable they are using to detect this.
69
75
  // See: https://github.com/microsoft/playwright/pull/11218/files
70
76
  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);
77
+ const playwrightConfig = await (0, internal_1.loadConfigFile)((0, node_path_1.join)(context.workspaceRoot, configFilePath));
78
+ const namedInputs = (0, internal_1.getNamedInputs)(projectRoot, context);
73
79
  const tsconfigJsonInputs = externalTsconfigInputs.map((file) => ({
74
80
  json: `{workspaceRoot}/${file}`,
75
81
  fields: ['compilerOptions', 'extends', 'files', 'include'],
@@ -187,7 +193,6 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
187
193
  };
188
194
  dependsOn.push({
189
195
  target: targetName,
190
- projects: 'self',
191
196
  params: 'forward',
192
197
  options: 'forward',
193
198
  });
@@ -226,6 +231,7 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
226
231
  }
227
232
  targets[options.mergeReportsTargetName] = {
228
233
  executor: '@nx/playwright:merge-reports',
234
+ continuous: false,
229
235
  cache: true,
230
236
  inputs: ciBaseTargetConfig.inputs,
231
237
  outputs: Array.from(mergeReportsTargetOutputs),
@@ -409,6 +415,29 @@ function normalizeAtomizedTaskBlobReportOutput(output, subfolder) {
409
415
  ? (0, devkit_1.joinPathFragments)((0, node_path_1.dirname)(output), `${subfolder}.zip`)
410
416
  : (0, devkit_1.joinPathFragments)(output, `${subfolder}.zip`);
411
417
  }
418
+ async function filterPlaywrightConfigs(configFilePaths, context) {
419
+ const preErrors = [];
420
+ const candidates = await Promise.all(configFilePaths.map(async (configFile) => {
421
+ try {
422
+ const projectRoot = (0, node_path_1.dirname)(configFile);
423
+ const siblingFiles = (0, node_fs_1.readdirSync)((0, node_path_1.join)(context.workspaceRoot, projectRoot));
424
+ if (!siblingFiles.includes('package.json') &&
425
+ !siblingFiles.includes('project.json')) {
426
+ return null;
427
+ }
428
+ const externalTsconfigInputs = collectExternalTsconfigInputs(projectRoot, context.workspaceRoot);
429
+ return { configFile, projectRoot, externalTsconfigInputs };
430
+ }
431
+ catch (e) {
432
+ preErrors.push([configFile, e]);
433
+ return null;
434
+ }
435
+ }));
436
+ return {
437
+ entries: candidates.filter((c) => c !== null),
438
+ preErrors,
439
+ };
440
+ }
412
441
  /**
413
442
  * Collects tsconfig files read by the Playwright task that are NOT already
414
443
  * covered by other inputs, returned as workspace-relative paths.
@@ -454,11 +483,11 @@ function collectExternalTsconfigInputs(projectRoot, workspaceRoot) {
454
483
  };
455
484
  const projectTsconfig = (0, node_path_1.join)(workspaceRoot, projectRoot, 'tsconfig.json');
456
485
  if ((0, node_fs_1.existsSync)(projectTsconfig)) {
457
- (0, internal_1.walkTsconfigExtendsChain)(projectTsconfig, visit);
486
+ (0, internal_2.walkTsconfigExtendsChain)(projectTsconfig, visit);
458
487
  }
459
488
  const rootTsconfig = (0, node_path_1.join)(workspaceRoot, 'tsconfig.json');
460
489
  if ((0, node_fs_1.existsSync)(rootTsconfig)) {
461
- (0, internal_1.walkTsconfigExtendsChain)(rootTsconfig, visit);
490
+ (0, internal_2.walkTsconfigExtendsChain)(rootTsconfig, visit);
462
491
  }
463
492
  return collected;
464
493
  }
@@ -14,4 +14,3 @@ export interface PlaywrightLinterOptions {
14
14
  addPlugin?: boolean;
15
15
  }
16
16
  export declare function addLinterToPlaywrightProject(tree: Tree, options: PlaywrightLinterOptions): Promise<GeneratorCallback>;
17
- //# sourceMappingURL=add-linter.d.ts.map
@@ -3,17 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addLinterToPlaywrightProject = addLinterToPlaywrightProject;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const eslint_1 = require("@nx/eslint");
6
- const global_eslint_config_1 = require("@nx/eslint/src/generators/init/global-eslint-config");
6
+ const internal_1 = require("@nx/eslint/internal");
7
7
  const versions_1 = require("./versions");
8
- const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
9
- const flat_config_1 = require("@nx/eslint/src/utils/flat-config");
10
8
  async function addLinterToPlaywrightProject(tree, options) {
11
9
  if (options.linter === 'none') {
12
10
  return () => { };
13
11
  }
14
12
  const tasks = [];
15
13
  const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
16
- const eslintFile = (0, eslint_file_1.findEslintFile)(tree, projectConfig.root);
14
+ const eslintFile = (0, internal_1.findEslintFile)(tree, projectConfig.root);
17
15
  if (!eslintFile) {
18
16
  tasks.push(await (0, eslint_1.lintProjectGenerator)(tree, {
19
17
  project: options.project,
@@ -30,30 +28,30 @@ async function addLinterToPlaywrightProject(tree, options) {
30
28
  return (0, devkit_1.runTasksInSerial)(...tasks);
31
29
  }
32
30
  tasks.push(!options.skipPackageJson
33
- ? (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { 'eslint-plugin-playwright': versions_1.eslintPluginPlaywrightVersion })
31
+ ? (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { 'eslint-plugin-playwright': versions_1.eslintPluginPlaywrightVersion }, undefined, true)
34
32
  : () => { });
35
- if ((0, eslint_file_1.isEslintConfigSupported)(tree, projectConfig.root) ||
36
- (0, eslint_file_1.isEslintConfigSupported)(tree)) {
37
- if ((0, flat_config_1.useFlatConfig)(tree)) {
38
- (0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(tree, projectConfig.root, 'flat/recommended', {
33
+ if ((0, internal_1.isEslintConfigSupported)(tree, projectConfig.root) ||
34
+ (0, internal_1.isEslintConfigSupported)(tree)) {
35
+ if ((0, internal_1.useFlatConfig)(tree)) {
36
+ (0, internal_1.addPredefinedConfigToFlatLintConfig)(tree, projectConfig.root, 'flat/recommended', {
39
37
  moduleName: 'playwright',
40
38
  moduleImportPath: 'eslint-plugin-playwright',
41
39
  spread: false,
42
40
  insertAtTheEnd: false,
43
41
  });
44
- (0, eslint_file_1.addOverrideToLintConfig)(tree, projectConfig.root, {
42
+ (0, internal_1.addOverrideToLintConfig)(tree, projectConfig.root, {
45
43
  files: ['*.ts', '*.js'],
46
44
  rules: {},
47
45
  });
48
46
  }
49
47
  else {
50
- const addExtendsTask = (0, eslint_file_1.addExtendsToLintConfig)(tree, projectConfig.root, 'plugin:playwright/recommended');
48
+ const addExtendsTask = (0, internal_1.addExtendsToLintConfig)(tree, projectConfig.root, 'plugin:playwright/recommended');
51
49
  tasks.push(addExtendsTask);
52
50
  if (options.rootProject) {
53
- (0, eslint_file_1.addPluginsToLintConfig)(tree, projectConfig.root, '@nx');
54
- (0, eslint_file_1.addOverrideToLintConfig)(tree, projectConfig.root, global_eslint_config_1.javaScriptOverride);
51
+ (0, internal_1.addPluginsToLintConfig)(tree, projectConfig.root, '@nx');
52
+ (0, internal_1.addOverrideToLintConfig)(tree, projectConfig.root, internal_1.javaScriptOverride);
55
53
  }
56
- (0, eslint_file_1.addOverrideToLintConfig)(tree, projectConfig.root, {
54
+ (0, internal_1.addOverrideToLintConfig)(tree, projectConfig.root, {
57
55
  files: [`${options.directory}/**/*.{ts,js,tsx,jsx}`],
58
56
  parserOptions: !options.setParserOptionsProject
59
57
  ? undefined
@@ -0,0 +1,2 @@
1
+ import { type Tree } from '@nx/devkit';
2
+ export declare function assertSupportedPlaywrightVersion(tree: Tree): void;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertSupportedPlaywrightVersion = assertSupportedPlaywrightVersion;
4
+ const internal_1 = require("@nx/devkit/internal");
5
+ const versions_1 = require("./versions");
6
+ function assertSupportedPlaywrightVersion(tree) {
7
+ (0, internal_1.assertSupportedPackageVersion)(tree, '@playwright/test', versions_1.minSupportedPlaywrightVersion);
8
+ }
@@ -0,0 +1,3 @@
1
+ export declare const PLAYWRIGHT_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx/playwright:playwright` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/playwright:convert-to-inferred` to migrate to the `@nx/playwright/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.";
2
+ export declare function warnPlaywrightExecutorDeprecation(): void;
3
+ export declare function warnPlaywrightExecutorGenerating(): void;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PLAYWRIGHT_EXECUTOR_DEPRECATION_MESSAGE = void 0;
4
+ exports.warnPlaywrightExecutorDeprecation = warnPlaywrightExecutorDeprecation;
5
+ exports.warnPlaywrightExecutorGenerating = warnPlaywrightExecutorGenerating;
6
+ const devkit_1 = require("@nx/devkit");
7
+ // TODO(v24): Remove the @nx/playwright:playwright executor. The inferred
8
+ // plugin (@nx/playwright/plugin) and the convert-to-inferred generator stay
9
+ // supported.
10
+ exports.PLAYWRIGHT_EXECUTOR_DEPRECATION_MESSAGE = 'The `@nx/playwright:playwright` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/playwright:convert-to-inferred` to migrate to the `@nx/playwright/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.';
11
+ function warnPlaywrightExecutorDeprecation() {
12
+ devkit_1.logger.warn(exports.PLAYWRIGHT_EXECUTOR_DEPRECATION_MESSAGE);
13
+ }
14
+ function warnPlaywrightExecutorGenerating() {
15
+ devkit_1.logger.warn('Generating a target that uses the deprecated `@nx/playwright:playwright` executor. The executor will be removed in Nx v24. Run `nx g @nx/playwright:convert-to-inferred` next to migrate this target to the `@nx/playwright/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
16
+ }
@@ -30,8 +30,11 @@ export interface NxPlaywrightOptions {
30
30
  *
31
31
  * you can easily extend this within your playwright config via spreading the preset
32
32
  * @example
33
+ * // Nx generates `playwright.config.mts` (ESM). Pass `import.meta.dirname`.
34
+ * // For hand-written CJS configs (`.cts` or `.ts` outside a `type: "module"`
35
+ * // workspace), pass `__filename` instead.
33
36
  * export default defineConfig({
34
- * ...nxE2EPreset(__filename, options)
37
+ * ...nxE2EPreset(import.meta.dirname, options)
35
38
  * // add your own config here
36
39
  * })
37
40
  *
@@ -39,4 +42,3 @@ export interface NxPlaywrightOptions {
39
42
  * @param options optional configuration options
40
43
  */
41
44
  export declare function nxE2EPreset(pathToConfig: string, options?: NxPlaywrightOptions): import("@playwright/test").PlaywrightTestConfig<{}, {}>;
42
- //# sourceMappingURL=preset.d.ts.map
@@ -2,10 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.nxE2EPreset = nxE2EPreset;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
5
+ const internal_1 = require("@nx/devkit/internal");
6
+ const internal_2 = require("@nx/js/internal");
6
7
  const test_1 = require("@playwright/test");
7
8
  const node_fs_1 = require("node:fs");
8
9
  const node_path_1 = require("node:path");
10
+ const semver_1 = require("semver");
11
+ const versions_1 = require("./versions");
9
12
  /**
10
13
  * nx E2E Preset for Playwright
11
14
  * @description
@@ -20,8 +23,11 @@ const node_path_1 = require("node:path");
20
23
  *
21
24
  * you can easily extend this within your playwright config via spreading the preset
22
25
  * @example
26
+ * // Nx generates `playwright.config.mts` (ESM). Pass `import.meta.dirname`.
27
+ * // For hand-written CJS configs (`.cts` or `.ts` outside a `type: "module"`
28
+ * // workspace), pass `__filename` instead.
23
29
  * export default defineConfig({
24
- * ...nxE2EPreset(__filename, options)
30
+ * ...nxE2EPreset(import.meta.dirname, options)
25
31
  * // add your own config here
26
32
  * })
27
33
  *
@@ -34,7 +40,7 @@ function nxE2EPreset(pathToConfig, options) {
34
40
  : (0, node_path_1.dirname)(pathToConfig);
35
41
  const projectPath = (0, node_path_1.relative)(devkit_1.workspaceRoot, normalizedPath);
36
42
  const offset = (0, node_path_1.relative)(normalizedPath, devkit_1.workspaceRoot);
37
- const isTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)();
43
+ const isTsSolutionSetup = (0, internal_2.isUsingTsSolutionSetup)();
38
44
  const testResultOuputDir = isTsSolutionSetup
39
45
  ? 'test-output/playwright/output'
40
46
  : (0, node_path_1.join)(offset, 'dist', '.playwright', projectPath, 'test-output');
@@ -48,6 +54,12 @@ function nxE2EPreset(pathToConfig, options) {
48
54
  open: options?.openHtmlReport ?? 'on-failure',
49
55
  },
50
56
  ]);
57
+ if (options?.generateBlobReports === true) {
58
+ const installed = (0, internal_1.getInstalledPackageVersion)('@playwright/test');
59
+ if (installed && (0, semver_1.lt)(installed, versions_1.minPlaywrightVersionForBlobReports)) {
60
+ throw new Error(`The "blob" reporter requires "@playwright/test" version ${versions_1.minPlaywrightVersionForBlobReports} or greater. You are currently using version ${installed}. Either upgrade "@playwright/test" or set "generateBlobReports" to false.`);
61
+ }
62
+ }
51
63
  const shouldGenerateBlobReports = options?.generateBlobReports ?? !!process.env['CI'];
52
64
  if (shouldGenerateBlobReports) {
53
65
  reporters.push([
@@ -1,4 +1,3 @@
1
1
  import type { PlaywrightTestConfig } from '@playwright/test';
2
2
  export type ReporterOutput = [reporter: string, output?: string];
3
3
  export declare function getReporterOutputs(playwrightConfig: PlaywrightTestConfig): Array<ReporterOutput>;
4
- //# sourceMappingURL=reporters.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const nxVersion: any;
2
+ export declare const minSupportedPlaywrightVersion = "1.36.0";
3
+ export declare const minPlaywrightVersionForBlobReports = "1.37.0";
4
+ export declare const playwrightVersion = "^1.37.0";
5
+ export declare const eslintPluginPlaywrightVersion = "^1.6.2";
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.eslintPluginPlaywrightVersion = exports.playwrightVersion = exports.minPlaywrightVersionForBlobReports = exports.minSupportedPlaywrightVersion = exports.nxVersion = void 0;
4
+ const path_1 = require("path");
5
+ exports.nxVersion = require((0, path_1.join)('@nx/playwright', 'package.json')).version;
6
+ exports.minSupportedPlaywrightVersion = '1.36.0';
7
+ exports.minPlaywrightVersionForBlobReports = '1.37.0';
8
+ exports.playwrightVersion = '^1.37.0';
9
+ exports.eslintPluginPlaywrightVersion = '^1.6.2';
package/executors.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "executors": {
3
3
  "playwright": {
4
- "implementation": "./src/executors/playwright/playwright.impl",
5
- "schema": "./src/executors/playwright/schema.json",
4
+ "implementation": "./dist/src/executors/playwright/playwright.impl",
5
+ "schema": "./dist/src/executors/playwright/schema.json",
6
6
  "description": "Run Playwright tests."
7
7
  },
8
8
  "merge-reports": {
9
- "implementation": "./src/executors/merge-reports/merge-reports.impl",
10
- "schema": "./src/executors/merge-reports/schema.json",
9
+ "implementation": "./dist/src/executors/merge-reports/merge-reports.impl",
10
+ "schema": "./dist/src/executors/merge-reports/schema.json",
11
11
  "description": "Merge Playwright blob reports to produce unified reports for the configured reporters (excluding the `blob` reporter).",
12
12
  "hidden": true
13
13
  }
package/generators.json CHANGED
@@ -3,19 +3,19 @@
3
3
  "version": "0.1",
4
4
  "generators": {
5
5
  "configuration": {
6
- "factory": "./src/generators/configuration/configuration#configurationGeneratorInternal",
7
- "schema": "./src/generators/configuration/schema.json",
6
+ "factory": "./dist/src/generators/configuration/configuration#configurationGeneratorInternal",
7
+ "schema": "./dist/src/generators/configuration/schema.json",
8
8
  "description": "Add Nx Playwright configuration to your project"
9
9
  },
10
10
  "init": {
11
- "factory": "./src/generators/init/init#initGeneratorInternal",
12
- "schema": "./src/generators/init/schema.json",
11
+ "factory": "./dist/src/generators/init/init#initGeneratorInternal",
12
+ "schema": "./dist/src/generators/init/schema.json",
13
13
  "description": "Initializes a Playwright project in the current workspace",
14
14
  "hidden": true
15
15
  },
16
16
  "convert-to-inferred": {
17
- "factory": "./src/generators/convert-to-inferred/convert-to-inferred",
18
- "schema": "./src/generators/convert-to-inferred/schema.json",
17
+ "factory": "./dist/src/generators/convert-to-inferred/convert-to-inferred",
18
+ "schema": "./dist/src/generators/convert-to-inferred/schema.json",
19
19
  "description": "Convert existing Playwright project(s) using `@nx/playwright:playwright` executor to use `@nx/playwright/plugin`."
20
20
  }
21
21
  }
package/migrations.json CHANGED
@@ -1,3 +1,10 @@
1
1
  {
2
- "generators": {}
2
+ "generators": {
3
+ "update-23-0-0-migrate-create-nodes-v2-import": {
4
+ "version": "23.0.0-beta.24",
5
+ "description": "Rename imports of `createNodesV2` from `@nx/playwright/plugin` to the canonical `createNodes` export.",
6
+ "implementation": "./dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes",
7
+ "documentation": "./dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.md"
8
+ }
9
+ }
3
10
  }
package/package.json CHANGED
@@ -1,13 +1,21 @@
1
1
  {
2
2
  "name": "@nx/playwright",
3
- "version": "23.0.0-pr.35413.460eeef",
4
- "type": "commonjs",
5
- "homepage": "https://nx.dev",
3
+ "version": "23.0.0-rc.0",
6
4
  "private": false,
7
- "publishConfig": {
8
- "access": "public"
9
- },
5
+ "type": "commonjs",
6
+ "files": [
7
+ "dist",
8
+ "!dist/tsconfig.tsbuildinfo",
9
+ "migrations.json",
10
+ "executors.json",
11
+ "generators.json"
12
+ ],
10
13
  "description": "The Nx Plugin for Playwright contains executors and generators allowing your workspace to use the powerful Playwright integration testing capabilities.",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/nrwl/nx.git",
17
+ "directory": "packages/playwright"
18
+ },
11
19
  "keywords": [
12
20
  "Monorepo",
13
21
  "Angular",
@@ -21,27 +29,61 @@
21
29
  "Testing",
22
30
  "Front-end"
23
31
  ],
24
- "main": "./index.js",
25
- "types": "./index.d.ts",
32
+ "main": "./dist/index.js",
33
+ "types": "./dist/index.d.ts",
34
+ "typesVersions": {
35
+ "*": {
36
+ "plugin": [
37
+ "dist/plugin.d.ts"
38
+ ],
39
+ "preset": [
40
+ "dist/preset.d.ts"
41
+ ]
42
+ }
43
+ },
44
+ "exports": {
45
+ ".": {
46
+ "@nx/nx-source": "./index.ts",
47
+ "types": "./dist/index.d.ts",
48
+ "default": "./dist/index.js"
49
+ },
50
+ "./package.json": "./package.json",
51
+ "./migrations.json": "./migrations.json",
52
+ "./generators.json": "./generators.json",
53
+ "./executors.json": "./executors.json",
54
+ "./plugin": {
55
+ "@nx/nx-source": "./plugin.ts",
56
+ "types": "./dist/plugin.d.ts",
57
+ "default": "./dist/plugin.js"
58
+ },
59
+ "./preset": {
60
+ "@nx/nx-source": "./preset.ts",
61
+ "types": "./dist/preset.d.ts",
62
+ "default": "./dist/preset.js"
63
+ }
64
+ },
26
65
  "author": "Victor Savkin",
27
66
  "license": "MIT",
28
67
  "bugs": {
29
68
  "url": "https://github.com/nrwl/nx/issues"
30
69
  },
31
- "repository": {
32
- "type": "git",
33
- "url": "https://github.com/nrwl/nx.git",
34
- "directory": "packages/playwright"
70
+ "homepage": "https://nx.dev",
71
+ "executors": "./executors.json",
72
+ "generators": "./generators.json",
73
+ "nx-migrations": {
74
+ "migrations": "./migrations.json",
75
+ "supportsOptionalMigrations": true
35
76
  },
36
77
  "dependencies": {
37
- "@nx/devkit": "23.0.0-pr.35413.460eeef",
38
- "@nx/eslint": "23.0.0-pr.35413.460eeef",
39
- "@nx/js": "23.0.0-pr.35413.460eeef",
40
78
  "tslib": "^2.3.0",
41
- "minimatch": "10.2.4"
79
+ "minimatch": "10.2.5",
80
+ "semver": "^7.6.3",
81
+ "@nx/devkit": "23.0.0-rc.0",
82
+ "@nx/eslint": "23.0.0-rc.0",
83
+ "@nx/js": "23.0.0-rc.0"
42
84
  },
43
85
  "devDependencies": {
44
- "nx": "23.0.0-pr.35413.460eeef"
86
+ "nx": "23.0.0-rc.0"
45
87
  },
46
88
  "peerDependencies": {
47
89
  "@playwright/test": "^1.36.0"
@@ -51,22 +93,7 @@
51
93
  "optional": true
52
94
  }
53
95
  },
54
- "executors": "./executors.json",
55
- "generators": "./generators.json",
56
- "exports": {
57
- ".": "./index.js",
58
- "./package.json": "./package.json",
59
- "./migrations.json": "./migrations.json",
60
- "./generators.json": "./generators.json",
61
- "./generators/*/schema.json": "./src/generators/*/schema.json",
62
- "./generators/*/schema": "./src/generators/*/schema.d.ts",
63
- "./executors.json": "./executors.json",
64
- "./executors/*/schema.json": "./src/executors/*/schema.json",
65
- "./executors/*/schema": "./src/executors/*/schema.d.ts",
66
- "./plugin": "./plugin.js",
67
- "./preset": "./src/utils/preset.js"
68
- },
69
- "nx-migrations": {
70
- "migrations": "./migrations.json"
96
+ "publishConfig": {
97
+ "access": "public"
71
98
  }
72
99
  }
package/index.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/playwright/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC"}
package/plugin.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../packages/playwright/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,uBAAuB,GACxB,MAAM,sBAAsB,CAAC"}
package/preset.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../../packages/playwright/preset.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -1 +0,0 @@
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 +0,0 @@
1
- {"version":3,"file":"playwright.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/playwright/src/executors/playwright/playwright.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAKhB,MAAM,YAAY,CAAC;AAGpB,MAAM,WAAW,wBAAwB;IAKvC,OAAO,CAAC,EAAE,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EACL,MAAM,GACN,MAAM,GACN,KAAK,GACL,MAAM,GACN,OAAO,GACP,MAAM,GACN,QAAQ,GACR,MAAM,GACN,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EACF,IAAI,GACJ,KAAK,GACL,gBAAgB,GAChB,gBAAgB,GAChB,mBAAmB,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,wBAAwB,EACjC,OAAO,EAAE,eAAe;aAoCM,OAAO;GAKtC;AAkDD,eAAe,kBAAkB,CAAC"}
@@ -1 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
1
- //# sourceMappingURL=use-serve-static-preview-for-command.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-serve-static-preview-for-command.d.ts","sourceRoot":"","sources":["../../../../../../packages/playwright/src/migrations/update-19-6-0/use-serve-static-preview-for-command.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- import { type CreateNodesV2 } from '@nx/devkit';
2
- export interface PlaywrightPluginOptions {
3
- targetName?: string;
4
- ciTargetName?: string;
5
- }
6
- export declare const createNodes: CreateNodesV2<PlaywrightPluginOptions>;
7
- export declare const createNodesV2: CreateNodesV2<PlaywrightPluginOptions>;
8
- //# sourceMappingURL=plugin.d.ts.map
@@ -1 +0,0 @@
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 +0,0 @@
1
- {"version":3,"file":"add-linter.d.ts","sourceRoot":"","sources":["../../../../../packages/playwright/src/utils/add-linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAIjB,IAAI,EACL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAwB,MAAM,YAAY,CAAC;AAatE,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5B,uBAAuB,EAAE,OAAO,CAAC;IACjC,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb;;QAEI;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAmF5B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../../../../packages/playwright/src/utils/preset.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,mBAAmB;IAClC;;;QAGI;IACJ,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC;IACnD;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,mBAAmB,2DAmD9B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"reporters.d.ts","sourceRoot":"","sources":["../../../../../packages/playwright/src/utils/reporters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,MAAM,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AAEjE,wBAAgB,kBAAkB,CAChC,gBAAgB,EAAE,oBAAoB,GACrC,KAAK,CAAC,cAAc,CAAC,CAuCvB"}
@@ -1,4 +0,0 @@
1
- export declare const nxVersion: any;
2
- export declare const playwrightVersion = "^1.36.0";
3
- export declare const eslintPluginPlaywrightVersion = "^1.6.2";
4
- //# sourceMappingURL=versions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/playwright/src/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAwC,CAAC;AAC/D,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,6BAA6B,WAAW,CAAC"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.eslintPluginPlaywrightVersion = exports.playwrightVersion = exports.nxVersion = void 0;
4
- exports.nxVersion = require('../../package.json').version;
5
- exports.playwrightVersion = '^1.36.0';
6
- exports.eslintPluginPlaywrightVersion = '^1.6.2';
File without changes
File without changes
File without changes
File without changes