nx 19.1.0-canary.20240515-a2a7d7e → 19.1.0-canary.20240516-d581cef

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",
3
- "version": "19.1.0-canary.20240515-a2a7d7e",
3
+ "version": "19.1.0-canary.20240516-d581cef",
4
4
  "private": false,
5
5
  "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
6
6
  "repository": {
@@ -66,7 +66,7 @@
66
66
  "yargs-parser": "21.1.1",
67
67
  "node-machine-id": "1.1.12",
68
68
  "ora": "5.3.0",
69
- "@nrwl/tao": "19.1.0-canary.20240515-a2a7d7e"
69
+ "@nrwl/tao": "19.1.0-canary.20240516-d581cef"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "@swc-node/register": "^1.8.0",
@@ -81,16 +81,16 @@
81
81
  }
82
82
  },
83
83
  "optionalDependencies": {
84
- "@nx/nx-darwin-x64": "19.1.0-canary.20240515-a2a7d7e",
85
- "@nx/nx-darwin-arm64": "19.1.0-canary.20240515-a2a7d7e",
86
- "@nx/nx-linux-x64-gnu": "19.1.0-canary.20240515-a2a7d7e",
87
- "@nx/nx-linux-x64-musl": "19.1.0-canary.20240515-a2a7d7e",
88
- "@nx/nx-win32-x64-msvc": "19.1.0-canary.20240515-a2a7d7e",
89
- "@nx/nx-linux-arm64-gnu": "19.1.0-canary.20240515-a2a7d7e",
90
- "@nx/nx-linux-arm64-musl": "19.1.0-canary.20240515-a2a7d7e",
91
- "@nx/nx-linux-arm-gnueabihf": "19.1.0-canary.20240515-a2a7d7e",
92
- "@nx/nx-win32-arm64-msvc": "19.1.0-canary.20240515-a2a7d7e",
93
- "@nx/nx-freebsd-x64": "19.1.0-canary.20240515-a2a7d7e"
84
+ "@nx/nx-darwin-x64": "19.1.0-canary.20240516-d581cef",
85
+ "@nx/nx-darwin-arm64": "19.1.0-canary.20240516-d581cef",
86
+ "@nx/nx-linux-x64-gnu": "19.1.0-canary.20240516-d581cef",
87
+ "@nx/nx-linux-x64-musl": "19.1.0-canary.20240516-d581cef",
88
+ "@nx/nx-win32-x64-msvc": "19.1.0-canary.20240516-d581cef",
89
+ "@nx/nx-linux-arm64-gnu": "19.1.0-canary.20240516-d581cef",
90
+ "@nx/nx-linux-arm64-musl": "19.1.0-canary.20240516-d581cef",
91
+ "@nx/nx-linux-arm-gnueabihf": "19.1.0-canary.20240516-d581cef",
92
+ "@nx/nx-win32-arm64-msvc": "19.1.0-canary.20240516-d581cef",
93
+ "@nx/nx-freebsd-x64": "19.1.0-canary.20240516-d581cef"
94
94
  },
95
95
  "nx-migrations": {
96
96
  "migrations": "./migrations.json",
@@ -257,6 +257,10 @@ exports.examples = {
257
257
  },
258
258
  {
259
259
  command: 'show project my-app',
260
+ description: 'If in an interactive terminal, opens the project detail view. If not in an interactive terminal, defaults to JSON.',
261
+ },
262
+ {
263
+ command: 'show project my-app --json',
260
264
  description: 'Show detailed information about "my-app" in a json format.',
261
265
  },
262
266
  {
@@ -255,7 +255,7 @@ async function generateGraph(args, affectedProjects) {
255
255
  const environmentJs = buildEnvironmentJs(args.exclude || [], args.watch, !!args.file && args.file.endsWith('html') ? 'build' : 'serve', projectGraphClientResponse, taskGraphClientResponse, taskInputsReponse, sourceMaps);
256
256
  html = html.replace(/src="/g, 'src="static/');
257
257
  html = html.replace(/href="styles/g, 'href="static/styles');
258
- html = html.replace('<base href="/" />', '');
258
+ html = html.replace(/<base href="\/".*>/g, '');
259
259
  html = html.replace(/type="module"/g, '');
260
260
  (0, fs_1.writeFileSync)(fullFilePath, html);
261
261
  (0, fs_1.writeFileSync)((0, path_1.join)(assetsFolder, 'environment.js'), environmentJs);
@@ -5,6 +5,7 @@ const fs_extra_1 = require("fs-extra");
5
5
  const client_1 = require("../../daemon/client/client");
6
6
  const cache_directory_1 = require("../../utils/cache-directory");
7
7
  const output_1 = require("../../utils/output");
8
+ const native_file_cache_location_1 = require("../../native/native-file-cache-location");
8
9
  async function resetHandler() {
9
10
  output_1.output.note({
10
11
  title: 'Resetting the Nx workspace cache and stopping the Nx Daemon.',
@@ -12,6 +13,12 @@ async function resetHandler() {
12
13
  });
13
14
  await client_1.daemonClient.stop();
14
15
  output_1.output.log({ title: 'Daemon Server - Stopped' });
16
+ try {
17
+ (0, fs_extra_1.rmSync)(native_file_cache_location_1.nativeFileCacheLocation, { recursive: true, force: true });
18
+ }
19
+ catch (e) {
20
+ // ignore, deleting the native file cache is not critical and can fail if another process is locking the file
21
+ }
15
22
  (0, fs_extra_1.rmSync)(cache_directory_1.cacheDir, { recursive: true, force: true });
16
23
  if (cache_directory_1.projectGraphCacheDirectory !== cache_directory_1.cacheDir) {
17
24
  (0, fs_extra_1.rmSync)(cache_directory_1.projectGraphCacheDirectory, { recursive: true, force: true });
@@ -81,10 +81,9 @@ const showProjectCommand = {
81
81
  alias: 'p',
82
82
  description: 'Which project should be viewed?',
83
83
  })
84
- .default('json', true)
85
84
  .option('web', {
86
85
  type: 'boolean',
87
- description: 'Show project details in the browser',
86
+ description: 'Show project details in the browser. (default when interactive)',
88
87
  })
89
88
  .option('open', {
90
89
  type: 'boolean',
@@ -92,8 +91,15 @@ const showProjectCommand = {
92
91
  implies: 'web',
93
92
  })
94
93
  .check((argv) => {
95
- if (argv.web) {
96
- argv.json = false;
94
+ // If TTY is enabled, default to web. Otherwise, default to JSON.
95
+ const alreadySpecified = argv.web !== undefined || argv.json !== undefined;
96
+ if (!alreadySpecified) {
97
+ if (process.stdout.isTTY) {
98
+ argv.web = true;
99
+ }
100
+ else {
101
+ argv.json = true;
102
+ }
97
103
  }
98
104
  return true;
99
105
  })
@@ -2,7 +2,7 @@ const { join, basename } = require('path');
2
2
  const { copyFileSync, existsSync, mkdirSync } = require('fs');
3
3
  const Module = require('module');
4
4
  const { nxVersion } = require('../utils/versions');
5
- const { cacheDir } = require('../utils/cache-directory');
5
+ const { nativeFileCacheLocation } = require('./native-file-cache-location');
6
6
 
7
7
  const nxPackages = new Set([
8
8
  '@nx/nx-android-arm64',
@@ -52,13 +52,14 @@ Module._load = function (request, parent, isMain) {
52
52
  ) {
53
53
  const nativeLocation = require.resolve(modulePath);
54
54
  const fileName = basename(nativeLocation);
55
- // we copy the file to the cache directory (.nx/cache by default) and prefix with nxVersion to avoid stale files being loaded
56
- const tmpFile = join(cacheDir, nxVersion + '-' + fileName);
55
+
56
+ // we copy the file to a workspace-scoped tmp directory and prefix with nxVersion to avoid stale files being loaded
57
+ const tmpFile = join(nativeFileCacheLocation, nxVersion + '-' + fileName);
57
58
  if (existsSync(tmpFile)) {
58
59
  return originalLoad.apply(this, [tmpFile, parent, isMain]);
59
60
  }
60
- if (!existsSync(cacheDir)) {
61
- mkdirSync(cacheDir, { recursive: true });
61
+ if (!existsSync(nativeFileCacheLocation)) {
62
+ mkdirSync(nativeFileCacheLocation, { recursive: true });
62
63
  }
63
64
  copyFileSync(nativeLocation, tmpFile);
64
65
  return originalLoad.apply(this, [tmpFile, parent, isMain]);
@@ -0,0 +1 @@
1
+ export declare const nativeFileCacheLocation: string;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.nativeFileCacheLocation = void 0;
4
+ const os_1 = require("os");
5
+ const path_1 = require("path");
6
+ const crypto_1 = require("crypto");
7
+ const workspace_root_1 = require("../utils/workspace-root");
8
+ exports.nativeFileCacheLocation = (0, path_1.join)((0, os_1.tmpdir)(), 'nx-native-file-cache', (0, crypto_1.createHash)('sha256').update(workspace_root_1.workspaceRoot).digest('hex'));