@nx/playwright 22.6.0-beta.0 → 22.6.0-beta.10

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.0-beta.0",
3
+ "version": "22.6.0-beta.10",
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.0-beta.0",
38
- "@nx/eslint": "22.6.0-beta.0",
39
- "@nx/js": "22.6.0-beta.0",
37
+ "@nx/devkit": "22.6.0-beta.10",
38
+ "@nx/eslint": "22.6.0-beta.10",
39
+ "@nx/js": "22.6.0-beta.10",
40
40
  "tslib": "^2.3.0",
41
- "minimatch": "10.1.1"
41
+ "minimatch": "10.2.4"
42
42
  },
43
43
  "devDependencies": {
44
- "nx": "22.6.0-beta.0"
44
+ "nx": "22.6.0-beta.10"
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,EAUnB,MAAM,YAAY,CAAC;AAgBpB,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA8BD,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;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"}
@@ -11,39 +11,27 @@ const node_fs_1 = require("node:fs");
11
11
  const node_path_1 = require("node:path");
12
12
  const file_hasher_1 = require("nx/src/hasher/file-hasher");
13
13
  const cache_directory_1 = require("nx/src/utils/cache-directory");
14
+ const plugin_cache_utils_1 = require("nx/src/utils/plugin-cache-utils");
14
15
  const workspace_context_1 = require("nx/src/utils/workspace-context");
15
16
  const reporters_1 = require("../utils/reporters");
16
17
  const pmc = (0, devkit_1.getPackageManagerCommand)();
17
- function readTargetsCache(cachePath) {
18
- try {
19
- return process.env.NX_CACHE_PROJECT_GRAPH !== 'false'
20
- ? (0, devkit_1.readJsonFile)(cachePath)
21
- : {};
22
- }
23
- catch {
24
- return {};
25
- }
26
- }
27
- function writeTargetsToCache(cachePath, results) {
28
- (0, devkit_1.writeJsonFile)(cachePath, results);
29
- }
30
18
  const playwrightConfigGlob = '**/playwright.config.{js,ts,cjs,cts,mjs,mts}';
31
19
  exports.createNodes = [
32
20
  playwrightConfigGlob,
33
21
  async (configFilePaths, options, context) => {
34
22
  const optionsHash = (0, file_hasher_1.hashObject)(options);
35
23
  const cachePath = (0, node_path_1.join)(cache_directory_1.workspaceDataDirectory, `playwright-${optionsHash}.hash`);
36
- const targetsCache = readTargetsCache(cachePath);
24
+ const pluginCache = new plugin_cache_utils_1.PluginCache(cachePath);
37
25
  try {
38
- return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache), configFilePaths, options, context);
26
+ return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, pluginCache), configFilePaths, options, context);
39
27
  }
40
28
  finally {
41
- writeTargetsToCache(cachePath, targetsCache);
29
+ pluginCache.writeToDisk(cachePath);
42
30
  }
43
31
  },
44
32
  ];
45
33
  exports.createNodesV2 = exports.createNodes;
46
- async function createNodesInternal(configFilePath, options, context, targetsCache) {
34
+ async function createNodesInternal(configFilePath, options, context, pluginCache) {
47
35
  const projectRoot = (0, node_path_1.dirname)(configFilePath);
48
36
  // Do not create a project if package.json and project.json isn't there.
49
37
  const siblingFiles = (0, node_fs_1.readdirSync)((0, node_path_1.join)(context.workspaceRoot, projectRoot));
@@ -56,8 +44,10 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
56
44
  ...normalizedOptions,
57
45
  CI: process.env.CI,
58
46
  }, context, [(0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot))]);
59
- targetsCache[hash] ??= await buildPlaywrightTargets(configFilePath, projectRoot, normalizedOptions, context);
60
- const { targets, metadata } = targetsCache[hash];
47
+ if (!pluginCache.has(hash)) {
48
+ pluginCache.set(hash, await buildPlaywrightTargets(configFilePath, projectRoot, normalizedOptions, context));
49
+ }
50
+ const { targets, metadata } = pluginCache.get(hash);
61
51
  return {
62
52
  projects: {
63
53
  [projectRoot]: {