@nx/playwright 20.3.0 → 20.3.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2017-2024 Narwhal Technologies Inc.
3
+ Copyright (c) 2017-2025 Narwhal Technologies Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/playwright",
3
- "version": "20.3.0",
3
+ "version": "20.3.2",
4
4
  "type": "commonjs",
5
5
  "homepage": "https://nx.dev",
6
6
  "private": false,
@@ -35,11 +35,11 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@phenomnomnominal/tsquery": "~5.0.1",
38
- "@nx/devkit": "20.3.0",
39
- "@nx/eslint": "20.3.0",
40
- "@nx/webpack": "20.3.0",
41
- "@nx/vite": "20.3.0",
42
- "@nx/js": "20.3.0",
38
+ "@nx/devkit": "20.3.2",
39
+ "@nx/eslint": "20.3.2",
40
+ "@nx/webpack": "20.3.2",
41
+ "@nx/vite": "20.3.2",
42
+ "@nx/js": "20.3.2",
43
43
  "tslib": "^2.3.0",
44
44
  "minimatch": "9.0.3"
45
45
  },
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = addE2eCiTargetDefaults;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
6
- const internal_api_1 = require("nx/src/project-graph/plugins/internal-api");
6
+ const loaded_nx_plugin_1 = require("nx/src/project-graph/plugins/loaded-nx-plugin");
7
7
  const devkit_internals_1 = require("nx/src/devkit-internals");
8
8
  const tsquery_1 = require("@phenomnomnominal/tsquery");
9
9
  const path_1 = require("path");
@@ -19,7 +19,7 @@ async function addE2eCiTargetDefaults(tree) {
19
19
  for (const plugin of matchingPluginRegistrations) {
20
20
  let projectConfigs;
21
21
  try {
22
- const loadedPlugin = new internal_api_1.LoadedNxPlugin({ createNodesV2, name: pluginName }, plugin);
22
+ const loadedPlugin = new loaded_nx_plugin_1.LoadedNxPlugin({ createNodesV2, name: pluginName }, plugin);
23
23
  projectConfigs = await (0, devkit_internals_1.retrieveProjectConfigurations)([loadedPlugin], tree.root, nxJson);
24
24
  }
25
25
  catch (e) {
@@ -4,7 +4,7 @@ exports.default = default_1;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const tsquery_1 = require("@phenomnomnominal/tsquery");
6
6
  const add_e2e_ci_target_defaults_1 = require("./add-e2e-ci-target-defaults");
7
- const internal_api_1 = require("nx/src/project-graph/plugins/internal-api");
7
+ const loaded_nx_plugin_1 = require("nx/src/project-graph/plugins/loaded-nx-plugin");
8
8
  const retrieve_workspace_files_1 = require("nx/src/project-graph/utils/retrieve-workspace-files");
9
9
  const error_types_1 = require("nx/src/project-graph/error-types");
10
10
  const plugin_1 = require("@nx/webpack/src/plugins/plugin");
@@ -143,7 +143,7 @@ async function getServeStaticTargetNameForConfigFile(tree, pluginName, configFil
143
143
  for (const plugin of matchingPluginRegistrations) {
144
144
  let projectConfigs;
145
145
  try {
146
- const loadedPlugin = new internal_api_1.LoadedNxPlugin({ createNodesV2, name: pluginName }, plugin);
146
+ const loadedPlugin = new loaded_nx_plugin_1.LoadedNxPlugin({ createNodesV2, name: pluginName }, plugin);
147
147
  projectConfigs = await (0, retrieve_workspace_files_1.retrieveProjectConfigurations)([loadedPlugin], tree.root, nxJson);
148
148
  }
149
149
  catch (e) {
@@ -106,7 +106,7 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
106
106
  : ['default', '^default']),
107
107
  { externalDependencies: ['@playwright/test'] },
108
108
  ],
109
- outputs: getTargetOutputs(testOutput, reporterOutputs, projectRoot),
109
+ outputs: getTargetOutputs(testOutput, reporterOutputs, context.workspaceRoot, projectRoot),
110
110
  };
111
111
  if (options.ciTargetName) {
112
112
  const ciBaseTargetConfig = {
@@ -118,7 +118,7 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
118
118
  : ['default', '^default']),
119
119
  { externalDependencies: ['@playwright/test'] },
120
120
  ],
121
- outputs: getTargetOutputs(testOutput, reporterOutputs, projectRoot),
121
+ outputs: getTargetOutputs(testOutput, reporterOutputs, context.workspaceRoot, projectRoot),
122
122
  };
123
123
  const groupName = 'E2E (CI)';
124
124
  metadata = { targetGroups: { [groupName]: [] } };
@@ -142,7 +142,7 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
142
142
  ...ciBaseTargetConfig.options,
143
143
  env: getOutputEnvVars(reporterOutputs, outputSubfolder),
144
144
  },
145
- outputs: getTargetOutputs(testOutput, reporterOutputs, projectRoot, outputSubfolder),
145
+ outputs: getTargetOutputs(testOutput, reporterOutputs, context.workspaceRoot, projectRoot, outputSubfolder),
146
146
  command: `${baseTargetConfig.command} ${relativeSpecFilePath} --output=${(0, node_path_1.join)(testOutput, outputSubfolder)}`,
147
147
  metadata: {
148
148
  technologies: ['playwright'],
@@ -273,21 +273,22 @@ function getReporterOutputs(playwrightConfig) {
273
273
  }
274
274
  return outputs;
275
275
  }
276
- function getTargetOutputs(testOutput, reporterOutputs, projectRoot, scope) {
276
+ function getTargetOutputs(testOutput, reporterOutputs, workspaceRoot, projectRoot, scope) {
277
277
  const outputs = new Set();
278
- outputs.add(normalizeOutput(projectRoot, scope ? (0, node_path_1.join)(testOutput, scope) : testOutput));
278
+ outputs.add(normalizeOutput(scope ? (0, node_path_1.join)(testOutput, scope) : testOutput, workspaceRoot, projectRoot));
279
279
  for (const [, output] of reporterOutputs) {
280
- outputs.add(normalizeOutput(projectRoot, scope ? (0, node_path_1.join)(output, scope) : output));
280
+ outputs.add(normalizeOutput(scope ? (0, node_path_1.join)(output, scope) : output, workspaceRoot, projectRoot));
281
281
  }
282
282
  return Array.from(outputs);
283
283
  }
284
- function normalizeOutput(projectRoot, path) {
285
- if (path.startsWith('..')) {
286
- return (0, node_path_1.join)('{workspaceRoot}', (0, node_path_1.join)(projectRoot, path));
287
- }
288
- else {
289
- return (0, node_path_1.join)('{projectRoot}', path);
284
+ function normalizeOutput(path, workspaceRoot, projectRoot) {
285
+ const fullProjectRoot = (0, node_path_1.resolve)(workspaceRoot, projectRoot);
286
+ const fullPath = (0, node_path_1.resolve)(fullProjectRoot, path);
287
+ const pathRelativeToProjectRoot = (0, devkit_1.normalizePath)((0, node_path_1.relative)(fullProjectRoot, fullPath));
288
+ if (pathRelativeToProjectRoot.startsWith('..')) {
289
+ return (0, devkit_1.joinPathFragments)('{workspaceRoot}', (0, node_path_1.relative)(workspaceRoot, fullPath));
290
290
  }
291
+ return (0, devkit_1.joinPathFragments)('{projectRoot}', pathRelativeToProjectRoot);
291
292
  }
292
293
  function getOutputEnvVars(reporterOutputs, outputSubfolder) {
293
294
  const env = {};