nx 19.4.0-canary.20240628-336d371 → 19.4.0-canary.20240702-86da1b5

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",
3
- "version": "19.4.0-canary.20240628-336d371",
3
+ "version": "19.4.0-canary.20240702-86da1b5",
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": {
@@ -70,7 +70,7 @@
70
70
  "yargs-parser": "21.1.1",
71
71
  "node-machine-id": "1.1.12",
72
72
  "ora": "5.3.0",
73
- "@nrwl/tao": "19.4.0-canary.20240628-336d371"
73
+ "@nrwl/tao": "19.4.0-canary.20240702-86da1b5"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "@swc-node/register": "^1.8.0",
@@ -85,16 +85,16 @@
85
85
  }
86
86
  },
87
87
  "optionalDependencies": {
88
- "@nx/nx-darwin-x64": "19.4.0-canary.20240628-336d371",
89
- "@nx/nx-darwin-arm64": "19.4.0-canary.20240628-336d371",
90
- "@nx/nx-linux-x64-gnu": "19.4.0-canary.20240628-336d371",
91
- "@nx/nx-linux-x64-musl": "19.4.0-canary.20240628-336d371",
92
- "@nx/nx-win32-x64-msvc": "19.4.0-canary.20240628-336d371",
93
- "@nx/nx-linux-arm64-gnu": "19.4.0-canary.20240628-336d371",
94
- "@nx/nx-linux-arm64-musl": "19.4.0-canary.20240628-336d371",
95
- "@nx/nx-linux-arm-gnueabihf": "19.4.0-canary.20240628-336d371",
96
- "@nx/nx-win32-arm64-msvc": "19.4.0-canary.20240628-336d371",
97
- "@nx/nx-freebsd-x64": "19.4.0-canary.20240628-336d371"
88
+ "@nx/nx-darwin-x64": "19.4.0-canary.20240702-86da1b5",
89
+ "@nx/nx-darwin-arm64": "19.4.0-canary.20240702-86da1b5",
90
+ "@nx/nx-linux-x64-gnu": "19.4.0-canary.20240702-86da1b5",
91
+ "@nx/nx-linux-x64-musl": "19.4.0-canary.20240702-86da1b5",
92
+ "@nx/nx-win32-x64-msvc": "19.4.0-canary.20240702-86da1b5",
93
+ "@nx/nx-linux-arm64-gnu": "19.4.0-canary.20240702-86da1b5",
94
+ "@nx/nx-linux-arm64-musl": "19.4.0-canary.20240702-86da1b5",
95
+ "@nx/nx-linux-arm-gnueabihf": "19.4.0-canary.20240702-86da1b5",
96
+ "@nx/nx-win32-arm64-msvc": "19.4.0-canary.20240702-86da1b5",
97
+ "@nx/nx-freebsd-x64": "19.4.0-canary.20240702-86da1b5"
98
98
  },
99
99
  "nx-migrations": {
100
100
  "migrations": "./migrations.json",
@@ -10,6 +10,7 @@ const configuration_1 = require("../../../config/configuration");
10
10
  const nx_deps_cache_1 = require("../../../project-graph/nx-deps-cache");
11
11
  const path_1 = require("path");
12
12
  const task_hasher_1 = require("../../../hasher/task-hasher");
13
+ const output_1 = require("../../../utils/output");
13
14
  /**
14
15
  * Creates a package.json in the output directory for support to install dependencies within containers.
15
16
  *
@@ -106,6 +107,19 @@ function createPackageJson(projectName, graph, options = {}, fileMap = null) {
106
107
  packageJson.dependencies &&= (0, object_sort_1.sortObjectByKeys)(packageJson.dependencies);
107
108
  packageJson.peerDependencies &&= (0, object_sort_1.sortObjectByKeys)(packageJson.peerDependencies);
108
109
  packageJson.peerDependenciesMeta &&= (0, object_sort_1.sortObjectByKeys)(packageJson.peerDependenciesMeta);
110
+ if (rootPackageJson.packageManager) {
111
+ if (packageJson.packageManager &&
112
+ packageJson.packageManager !== rootPackageJson.packageManager) {
113
+ output_1.output.warn({
114
+ title: 'Package Manager Mismatch',
115
+ bodyLines: [
116
+ `The project ${projectName} has explicitly specified "packageManager" config of "${packageJson.packageManager}" but the workspace is using "${rootPackageJson.packageManager}".`,
117
+ `Please remove the project level "packageManager" config or align it with the workspace root package.json.`,
118
+ ],
119
+ });
120
+ }
121
+ packageJson.packageManager = rootPackageJson.packageManager;
122
+ }
109
123
  return packageJson;
110
124
  }
111
125
  exports.createPackageJson = createPackageJson;
@@ -1,4 +1,3 @@
1
- import type { TsConfigOptions } from 'ts-node';
2
1
  import type { CompilerOptions } from 'typescript';
3
2
  /**
4
3
  * Optionally, if swc-node and tsconfig-paths are available in the current workspace, apply the require
@@ -24,7 +23,7 @@ export declare function registerTsProject(tsConfigPath: string): () => void;
24
23
  */
25
24
  export declare function registerTsProject(path: string, configFilename: string): any;
26
25
  export declare function getSwcTranspiler(compilerOptions: CompilerOptions): (...args: unknown[]) => unknown;
27
- export declare function getTsNodeTranspiler(compilerOptions: CompilerOptions, tsNodeOptions?: TsConfigOptions): (...args: unknown[]) => unknown;
26
+ export declare function getTsNodeTranspiler(compilerOptions: CompilerOptions): (...args: unknown[]) => unknown;
28
27
  export declare function getTranspiler(compilerOptions: CompilerOptions, tsConfigRaw?: unknown): () => (...args: unknown[]) => unknown;
29
28
  /**
30
29
  * Register ts-node or swc-node given a set of compiler options.
@@ -79,7 +79,13 @@ function getSwcTranspiler(compilerOptions) {
79
79
  return typeof cleanupFn === 'function' ? cleanupFn : () => { };
80
80
  }
81
81
  exports.getSwcTranspiler = getSwcTranspiler;
82
- function getTsNodeTranspiler(compilerOptions, tsNodeOptions) {
82
+ const registered = new Set();
83
+ function getTsNodeTranspiler(compilerOptions) {
84
+ // Just return if transpiler was already registered before.
85
+ const registrationKey = JSON.stringify(compilerOptions);
86
+ if (registered.has(registrationKey)) {
87
+ return () => { };
88
+ }
83
89
  const { register } = require('ts-node');
84
90
  // ts-node doesn't provide a cleanup method
85
91
  const service = register({
@@ -88,13 +94,14 @@ function getTsNodeTranspiler(compilerOptions, tsNodeOptions) {
88
94
  // we already read and provide the compiler options, so prevent ts-node from reading them again
89
95
  skipProject: true,
90
96
  });
97
+ registered.add(registrationKey);
91
98
  const { transpiler, swc } = service.options;
92
99
  // Don't warn if a faster transpiler is enabled
93
100
  if (!transpiler && !swc) {
94
101
  warnTsNodeUsage();
95
102
  }
96
103
  return () => {
97
- service.enabled(false);
104
+ // Do not cleanup ts-node service since other consumers may need it
98
105
  };
99
106
  }
100
107
  exports.getTsNodeTranspiler = getTsNodeTranspiler;
@@ -159,7 +166,7 @@ function getTranspiler(compilerOptions, tsConfigRaw) {
159
166
  // We can fall back on ts-node if it's available
160
167
  if (tsNodeInstalled) {
161
168
  const tsNodeOptions = filterRecognizedTsConfigTsNodeOptions(tsConfigRaw).recognized;
162
- return () => getTsNodeTranspiler(compilerOptions, tsNodeOptions);
169
+ return () => getTsNodeTranspiler(compilerOptions);
163
170
  }
164
171
  }
165
172
  exports.getTranspiler = getTranspiler;