@nx/playwright 22.6.4 → 22.6.5

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": "22.6.4",
3
+ "version": "22.6.5",
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": "22.6.4",
38
- "@nx/eslint": "22.6.4",
39
- "@nx/js": "22.6.4",
37
+ "@nx/devkit": "22.6.5",
38
+ "@nx/eslint": "22.6.5",
39
+ "@nx/js": "22.6.5",
40
40
  "tslib": "^2.3.0",
41
41
  "minimatch": "10.2.4"
42
42
  },
43
43
  "devDependencies": {
44
- "nx": "22.6.4"
44
+ "nx": "22.6.5"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@playwright/test": "^1.36.0"
@@ -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;AAiBpB,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAWD,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,uBAAuB,CAqB9D,CAAC;AAEF,eAAO,MAAM,aAAa,wCAAc,CAAC"}
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;AAepB,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"}
@@ -14,7 +14,6 @@ const cache_directory_1 = require("nx/src/utils/cache-directory");
14
14
  const plugin_cache_utils_1 = require("nx/src/utils/plugin-cache-utils");
15
15
  const workspace_context_1 = require("nx/src/utils/workspace-context");
16
16
  const reporters_1 = require("../utils/reporters");
17
- const pmc = (0, devkit_1.getPackageManagerCommand)();
18
17
  const playwrightConfigGlob = '**/playwright.config.{js,ts,cjs,cts,mjs,mts}';
19
18
  exports.createNodes = [
20
19
  playwrightConfigGlob,
@@ -22,8 +21,9 @@ exports.createNodes = [
22
21
  const optionsHash = (0, file_hasher_1.hashObject)(options);
23
22
  const cachePath = (0, node_path_1.join)(cache_directory_1.workspaceDataDirectory, `playwright-${optionsHash}.hash`);
24
23
  const pluginCache = new plugin_cache_utils_1.PluginCache(cachePath);
24
+ const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
25
25
  try {
26
- return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, pluginCache), configFilePaths, options, context);
26
+ return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, pluginCache, pmc), configFilePaths, options, context);
27
27
  }
28
28
  finally {
29
29
  pluginCache.writeToDisk(cachePath);
@@ -31,7 +31,7 @@ exports.createNodes = [
31
31
  },
32
32
  ];
33
33
  exports.createNodesV2 = exports.createNodes;
34
- async function createNodesInternal(configFilePath, options, context, pluginCache) {
34
+ async function createNodesInternal(configFilePath, options, context, pluginCache, pmc) {
35
35
  const projectRoot = (0, node_path_1.dirname)(configFilePath);
36
36
  // Do not create a project if package.json and project.json isn't there.
37
37
  const siblingFiles = (0, node_fs_1.readdirSync)((0, node_path_1.join)(context.workspaceRoot, projectRoot));
@@ -45,7 +45,7 @@ async function createNodesInternal(configFilePath, options, context, pluginCache
45
45
  CI: process.env.CI,
46
46
  }, context, [(0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot))]);
47
47
  if (!pluginCache.has(hash)) {
48
- pluginCache.set(hash, await buildPlaywrightTargets(configFilePath, projectRoot, normalizedOptions, context));
48
+ pluginCache.set(hash, await buildPlaywrightTargets(configFilePath, projectRoot, normalizedOptions, context, pmc));
49
49
  }
50
50
  const { targets, metadata } = pluginCache.get(hash);
51
51
  return {
@@ -58,7 +58,7 @@ async function createNodesInternal(configFilePath, options, context, pluginCache
58
58
  },
59
59
  };
60
60
  }
61
- async function buildPlaywrightTargets(configFilePath, projectRoot, options, context) {
61
+ async function buildPlaywrightTargets(configFilePath, projectRoot, options, context, pmc) {
62
62
  // Playwright forbids importing the `@playwright/test` module twice. This would affect running the tests,
63
63
  // but we're just reading the config so let's delete the variable they are using to detect this.
64
64
  // See: https://github.com/microsoft/playwright/pull/11218/files
@@ -160,7 +160,7 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
160
160
  env: getAtomizedTaskEnvVars(reporterOutputs, outputSubfolder),
161
161
  },
162
162
  outputs: getAtomizedTaskOutputs(testOutput, reporterOutputs, context.workspaceRoot, projectRoot, outputSubfolder),
163
- command: `${baseTargetConfig.command} ${relativeSpecFilePath} --output=${(0, node_path_1.join)(testOutput, outputSubfolder)}`,
163
+ command: `${baseTargetConfig.command} ${relativeSpecFilePath} --output=${(0, devkit_1.joinPathFragments)(testOutput, outputSubfolder)}`,
164
164
  metadata: {
165
165
  technologies: ['playwright'],
166
166
  description: `Runs Playwright Tests in ${relativeSpecFilePath} in CI`,
@@ -219,7 +219,7 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
219
219
  inputs: ciBaseTargetConfig.inputs,
220
220
  outputs: Array.from(mergeReportsTargetOutputs),
221
221
  options: {
222
- config: node_path_1.posix.relative(projectRoot, configFilePath),
222
+ config: (0, devkit_1.normalizePath)((0, node_path_1.relative)(projectRoot, configFilePath)),
223
223
  expectedSuites: dependsOn.length,
224
224
  },
225
225
  metadata: {
@@ -306,9 +306,9 @@ function getAtomizedTaskOutputs(testOutput, reporterOutputs, workspaceRoot, proj
306
306
  function addSubfolderToOutput(output, subfolder) {
307
307
  const parts = (0, node_path_1.parse)(output);
308
308
  if (parts.ext !== '') {
309
- return (0, node_path_1.join)(parts.dir, subfolder, parts.base);
309
+ return (0, devkit_1.joinPathFragments)(parts.dir, subfolder, parts.base);
310
310
  }
311
- return (0, node_path_1.join)(output, subfolder);
311
+ return (0, devkit_1.joinPathFragments)(output, subfolder);
312
312
  }
313
313
  function getWebserverCommandTasks(playwrightConfig) {
314
314
  if (!playwrightConfig.webServer) {
@@ -395,6 +395,6 @@ function getAtomizedTaskEnvVars(reporterOutputs, outputSubfolder) {
395
395
  function normalizeAtomizedTaskBlobReportOutput(output, subfolder) {
396
396
  // set unique name for the blob report file
397
397
  return output.endsWith('.zip')
398
- ? (0, node_path_1.join)((0, node_path_1.dirname)(output), `${subfolder}.zip`)
399
- : (0, node_path_1.join)(output, `${subfolder}.zip`);
398
+ ? (0, devkit_1.joinPathFragments)((0, node_path_1.dirname)(output), `${subfolder}.zip`)
399
+ : (0, devkit_1.joinPathFragments)(output, `${subfolder}.zip`);
400
400
  }