nx 21.1.0-beta.0 → 21.1.0-beta.1

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.
@@ -8,7 +8,7 @@ export declare class ExternalObject<T> {
8
8
  }
9
9
  }
10
10
  export declare class AppLifeCycle {
11
- constructor(tasks: Array<Task>, initiatingTasks: Array<string>, runMode: RunMode, pinnedTasks: Array<string>, tuiCliArgs: TuiCliArgs, tuiConfig: TuiConfig, titleText: string)
11
+ constructor(tasks: Array<Task>, initiatingTasks: Array<string>, runMode: RunMode, pinnedTasks: Array<string>, tuiCliArgs: TuiCliArgs, tuiConfig: TuiConfig, titleText: string, workspaceRoot: string)
12
12
  startCommand(threadCount?: number | undefined | null): void
13
13
  scheduleTask(task: Task): void
14
14
  startTasks(tasks: Array<Task>, metadata: object): void
@@ -62,10 +62,15 @@ const originalLoad = Module._load;
62
62
  // Will only be called once because the require cache takes over afterwards.
63
63
  Module._load = function (request, parent, isMain) {
64
64
  const modulePath = request;
65
- if (
65
+ // Check if we should use the native file cache (enabled by default)
66
+ const useNativeFileCache = process.env.NX_SKIP_NATIVE_FILE_CACHE !== 'true';
67
+ // Check if this is an Nx native module (either from npm or local file)
68
+ const isNxNativeModule =
66
69
  nxPackages.has(modulePath) ||
67
- localNodeFiles.some((f) => modulePath.endsWith(f))
68
- ) {
70
+ localNodeFiles.some((file) => modulePath.endsWith(file));
71
+
72
+ // Only use the file cache for Nx native modules when caching is enabled
73
+ if (useNativeFileCache && isNxNativeModule) {
69
74
  const nativeLocation = require.resolve(modulePath);
70
75
  const fileName = basename(nativeLocation);
71
76
 
Binary file
@@ -128,7 +128,7 @@ async function getTerminalOutputLifeCycle(initiatingProject, initiatingTasks, pr
128
128
  const lifeCycles = [tsLifeCycle];
129
129
  // Only run the TUI if there are tasks to run
130
130
  if (tasks.length > 0) {
131
- appLifeCycle = new AppLifeCycle(tasks, initiatingTasks.map((t) => t.id), isRunOne ? 0 /* RunMode.RunOne */ : 1 /* RunMode.RunMany */, pinnedTasks, nxArgs ?? {}, nxJson.tui ?? {}, titleText);
131
+ appLifeCycle = new AppLifeCycle(tasks, initiatingTasks.map((t) => t.id), isRunOne ? 0 /* RunMode.RunOne */ : 1 /* RunMode.RunMany */, pinnedTasks, nxArgs ?? {}, nxJson.tui ?? {}, titleText, workspace_root_1.workspaceRoot);
132
132
  lifeCycles.unshift(appLifeCycle);
133
133
  /**
134
134
  * Patch stdout.write and stderr.write methods to pass Nx Cloud client logs to the TUI via the lifecycle
@@ -96,8 +96,8 @@ function addPrefixTransformer(prefix) {
96
96
  const colors = [
97
97
  chalk.green,
98
98
  chalk.greenBright,
99
- chalk.red,
100
- chalk.redBright,
99
+ chalk.blue,
100
+ chalk.blueBright,
101
101
  chalk.cyan,
102
102
  chalk.cyanBright,
103
103
  chalk.yellow,