nx 20.0.0-rc.0 → 20.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,3 @@
1
1
  export declare function hashArray(content: string[]): string;
2
2
  export declare function hashObject(obj: object): string;
3
+ export declare function hashFile(filePath: string): string;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hashArray = hashArray;
4
4
  exports.hashObject = hashObject;
5
+ exports.hashFile = hashFile;
5
6
  function hashArray(content) {
6
7
  // Import as needed. There is also an issue running unit tests in Nx repo if this is a top-level import.
7
8
  const { hashArray } = require('../native');
@@ -16,3 +17,7 @@ function hashObject(obj) {
16
17
  }
17
18
  return hashArray(parts);
18
19
  }
20
+ function hashFile(filePath) {
21
+ const { hashFile } = require('../native');
22
+ return hashFile(filePath);
23
+ }
@@ -0,0 +1,2 @@
1
+ import { Tree } from '../../generators/tree';
2
+ export default function update(tree: Tree): Promise<void>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = update;
4
+ const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
5
+ const nx_json_1 = require("../../generators/utils/nx-json");
6
+ async function update(tree) {
7
+ const nxJson = (0, nx_json_1.readNxJson)(tree);
8
+ if (!nxJson) {
9
+ return;
10
+ }
11
+ // If workspaces had `enableDbCache` we can just delete the property as the db cache is enabled by default in nx v20
12
+ if (nxJson.enableDbCache) {
13
+ delete nxJson.enableDbCache;
14
+ }
15
+ else {
16
+ nxJson.useLegacyCache = true;
17
+ }
18
+ (0, nx_json_1.updateNxJson)(tree, nxJson);
19
+ await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
20
+ }
Binary file
@@ -3,6 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isNxCloudUsed = isNxCloudUsed;
4
4
  exports.getNxCloudUrl = getNxCloudUrl;
5
5
  function isNxCloudUsed(nxJson) {
6
+ if (process.env.NX_NO_CLOUD === 'true') {
7
+ return false;
8
+ }
9
+ if (nxJson.neverConnectToCloud) {
10
+ return true;
11
+ }
6
12
  return (!!process.env.NX_CLOUD_ACCESS_TOKEN ||
7
13
  !!nxJson.nxCloudAccessToken ||
8
14
  !!nxJson.nxCloudId ||