@nx/playwright 19.1.0-beta.2 → 19.1.0-beta.4

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-beta.2",
3
+ "version": "19.1.0-beta.4",
4
4
  "type": "commonjs",
5
5
  "homepage": "https://nx.dev",
6
6
  "private": false,
@@ -35,9 +35,9 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@phenomnomnominal/tsquery": "~5.0.1",
38
- "@nx/devkit": "19.1.0-beta.2",
39
- "@nx/eslint": "19.1.0-beta.2",
40
- "@nx/js": "19.1.0-beta.2",
38
+ "@nx/devkit": "19.1.0-beta.4",
39
+ "@nx/eslint": "19.1.0-beta.4",
40
+ "@nx/js": "19.1.0-beta.4",
41
41
  "tslib": "^2.3.0",
42
42
  "minimatch": "9.0.3"
43
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]: {