@nx/playwright 19.1.0-canary.20240522-89fdd42 → 19.1.0-canary.20240524-12c6a73

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/playwright",
3
- "version": "19.1.0-canary.20240522-89fdd42",
3
+ "version": "19.1.0-canary.20240524-12c6a73",
4
4
  "type": "commonjs",
5
5
  "homepage": "https://nx.dev",
6
6
  "private": false,
@@ -17,7 +17,9 @@
17
17
  "Nest",
18
18
  "Jest",
19
19
  "Playwright",
20
- "CLI"
20
+ "CLI",
21
+ "Testing",
22
+ "Front-end"
21
23
  ],
22
24
  "main": "./index.js",
23
25
  "typings": "./index.d.ts",
@@ -33,9 +35,9 @@
33
35
  },
34
36
  "dependencies": {
35
37
  "@phenomnomnominal/tsquery": "~5.0.1",
36
- "@nx/devkit": "19.1.0-canary.20240522-89fdd42",
37
- "@nx/eslint": "19.1.0-canary.20240522-89fdd42",
38
- "@nx/js": "19.1.0-canary.20240522-89fdd42",
38
+ "@nx/devkit": "19.1.0-canary.20240524-12c6a73",
39
+ "@nx/eslint": "19.1.0-canary.20240524-12c6a73",
40
+ "@nx/js": "19.1.0-canary.20240524-12c6a73",
39
41
  "tslib": "^2.3.0",
40
42
  "minimatch": "9.0.3"
41
43
  },
@@ -12,16 +12,19 @@ const cache_directory_1 = require("nx/src/utils/cache-directory");
12
12
  const js_1 = require("@nx/js");
13
13
  const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
14
14
  const cachePath = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'playwright.hash');
15
- const targetsCache = (0, fs_1.existsSync)(cachePath) ? readTargetsCache() : {};
16
- const calculatedTargets = {};
15
+ const targetsCache = readTargetsCache();
17
16
  function readTargetsCache() {
18
- return (0, devkit_1.readJsonFile)(cachePath);
17
+ return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
19
18
  }
20
- function writeTargetsToCache(targets) {
21
- (0, devkit_1.writeJsonFile)(cachePath, targets);
19
+ function writeTargetsToCache() {
20
+ const oldCache = readTargetsCache();
21
+ (0, devkit_1.writeJsonFile)(cachePath, {
22
+ ...readTargetsCache,
23
+ targetsCache,
24
+ });
22
25
  }
23
26
  const createDependencies = () => {
24
- writeTargetsToCache(calculatedTargets);
27
+ writeTargetsToCache();
25
28
  return [];
26
29
  };
27
30
  exports.createDependencies = createDependencies;
@@ -39,9 +42,8 @@ exports.createNodes = [
39
42
  const hash = (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, options, context, [
40
43
  (0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot)),
41
44
  ]);
42
- const { targets, metadata } = targetsCache[hash] ??
43
- (await buildPlaywrightTargets(configFilePath, projectRoot, normalizedOptions, context));
44
- calculatedTargets[hash] = { targets, metadata };
45
+ targetsCache[hash] ??= await buildPlaywrightTargets(configFilePath, projectRoot, normalizedOptions, context);
46
+ const { targets, metadata } = targetsCache[hash];
45
47
  return {
46
48
  projects: {
47
49
  [projectRoot]: {