@nx/js 20.2.0-beta.4 → 20.2.0-beta.6

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/migrations.json CHANGED
@@ -111,6 +111,19 @@
111
111
  "alwaysAddToPackageJson": false
112
112
  }
113
113
  }
114
+ },
115
+ "20.2.0": {
116
+ "version": "20.2.0-beta.5",
117
+ "x-prompt": "Do you want to update to TypeScript v5.6?",
118
+ "requires": {
119
+ "typescript": ">=5.5.0 <5.6.0"
120
+ },
121
+ "packages": {
122
+ "typescript": {
123
+ "version": "~5.6.2",
124
+ "alwaysAddToPackageJson": false
125
+ }
126
+ }
114
127
  }
115
128
  }
116
129
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/js",
3
- "version": "20.2.0-beta.4",
3
+ "version": "20.2.0-beta.6",
4
4
  "private": false,
5
5
  "description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ",
6
6
  "repository": {
@@ -39,8 +39,8 @@
39
39
  "@babel/preset-env": "^7.23.2",
40
40
  "@babel/preset-typescript": "^7.22.5",
41
41
  "@babel/runtime": "^7.22.6",
42
- "@nx/devkit": "20.2.0-beta.4",
43
- "@nx/workspace": "20.2.0-beta.4",
42
+ "@nx/devkit": "20.2.0-beta.6",
43
+ "@nx/workspace": "20.2.0-beta.6",
44
44
  "@zkochan/js-yaml": "0.0.7",
45
45
  "babel-plugin-const-enum": "^1.0.1",
46
46
  "babel-plugin-macros": "^2.8.0",
@@ -3,5 +3,5 @@ import { NodeExecutorOptions } from './schema';
3
3
  export declare function nodeExecutor(options: NodeExecutorOptions, context: ExecutorContext): AsyncGenerator<{
4
4
  success: boolean;
5
5
  options?: Record<string, any>;
6
- }, void, undefined>;
6
+ }, void, any>;
7
7
  export default nodeExecutor;
@@ -6,5 +6,5 @@ export declare function swcExecutor(_options: SwcExecutorOptions, context: Execu
6
6
  } | {
7
7
  success: boolean;
8
8
  outfile: string;
9
- }, any, undefined>;
9
+ }, any, any>;
10
10
  export default swcExecutor;
@@ -3,5 +3,5 @@ import type { TypeScriptCompilationOptions } from '@nx/workspace/src/utilities/t
3
3
  import { ExecutorOptions, NormalizedExecutorOptions } from '../../utils/schema';
4
4
  export declare function determineModuleFormatFromTsConfig(absolutePathToTsConfig: string): 'cjs' | 'esm';
5
5
  export declare function createTypeScriptCompilationOptions(normalizedOptions: NormalizedExecutorOptions, context: ExecutorContext): TypeScriptCompilationOptions;
6
- export declare function tscExecutor(_options: ExecutorOptions, context: ExecutorContext): AsyncGenerator<import("../../utils/typescript/compile-typescript-files").TypescriptCompilationResult, any, undefined>;
6
+ export declare function tscExecutor(_options: ExecutorOptions, context: ExecutorContext): AsyncGenerator<import("../../utils/typescript/compile-typescript-files").TypescriptCompilationResult, any, any>;
7
7
  export default tscExecutor;
@@ -136,7 +136,7 @@ async function syncGenerator(tree) {
136
136
  if (hasChanges) {
137
137
  await (0, devkit_1.formatFiles)(tree);
138
138
  return {
139
- outOfSyncMessage: 'Based on the workspace project graph, some TypeScript configuration files are missing project references to the projects they depend on or contain outdated project references.',
139
+ outOfSyncMessage: 'Some TypeScript configuration files are missing project references to the projects they depend on or contain outdated project references.',
140
140
  };
141
141
  }
142
142
  }
@@ -325,7 +325,7 @@ function getTsConfigPathFromReferencePath(tree, ownerTsConfigPath, referencePath
325
325
  */
326
326
  function patchTsconfigJsonReferences(tree, tsconfigInfoCaches, tsconfigPath, updatedReferences) {
327
327
  const stringifiedJsonContents = readRawTsconfigContents(tree, tsconfigInfoCaches, tsconfigPath);
328
- const edits = (0, jsonc_parser_1.modify)(stringifiedJsonContents, ['references'], updatedReferences, {});
328
+ const edits = (0, jsonc_parser_1.modify)(stringifiedJsonContents, ['references'], updatedReferences, { formattingOptions: { keepLines: false } });
329
329
  const updatedJsonContents = (0, jsonc_parser_1.applyEdits)(stringifiedJsonContents, edits);
330
330
  // The final contents will be formatted by formatFiles() later
331
331
  tree.write(tsconfigPath, updatedJsonContents);
@@ -109,14 +109,12 @@ function collectDependencies(project, projGraph, acc, shallow, areTopLevelDeps =
109
109
  });
110
110
  return acc;
111
111
  }
112
- function readTsConfigWithRemappedPaths(tsConfig, generatedTsConfigPath, dependencies) {
112
+ function readTsConfigWithRemappedPaths(originalTsconfigPath, generatedTsconfigPath, dependencies, workspaceRoot) {
113
113
  const generatedTsConfig = { compilerOptions: {} };
114
- const dirnameTsConfig = (0, path_1.dirname)(generatedTsConfigPath);
115
- const relativeTsconfig = (0, path_1.isAbsolute)(dirnameTsConfig)
116
- ? (0, path_1.relative)(devkit_1.workspaceRoot, dirnameTsConfig)
117
- : dirnameTsConfig;
118
- generatedTsConfig.extends = (0, path_1.relative)(relativeTsconfig, tsConfig);
119
- generatedTsConfig.compilerOptions.paths = computeCompilerOptionsPaths(tsConfig, dependencies);
114
+ const normalizedTsConfig = (0, path_1.resolve)(workspaceRoot, originalTsconfigPath);
115
+ const normalizedGeneratedTsConfigDir = (0, path_1.resolve)(workspaceRoot, (0, path_1.dirname)(generatedTsconfigPath));
116
+ generatedTsConfig.extends = (0, path_1.relative)(normalizedGeneratedTsConfigDir, normalizedTsConfig);
117
+ generatedTsConfig.compilerOptions.paths = computeCompilerOptionsPaths(originalTsconfigPath, dependencies);
120
118
  if (process.env.NX_VERBOSE_LOGGING_PATH_MAPPINGS === 'true') {
121
119
  output_1.output.log({
122
120
  title: 'TypeScript path mappings have been rewritten.',
@@ -232,7 +230,7 @@ function computeCompilerOptionsPaths(tsConfig, dependencies) {
232
230
  }
233
231
  function createTmpTsConfig(tsconfigPath, workspaceRoot, projectRoot, dependencies, useWorkspaceAsBaseUrl = false) {
234
232
  const tmpTsConfigPath = (0, path_1.join)(workspaceRoot, 'tmp', projectRoot, process.env.NX_TASK_TARGET_TARGET ?? 'build', 'tsconfig.generated.json');
235
- const parsedTSConfig = readTsConfigWithRemappedPaths(tsconfigPath, tmpTsConfigPath, dependencies);
233
+ const parsedTSConfig = readTsConfigWithRemappedPaths(tsconfigPath, tmpTsConfigPath, dependencies, workspaceRoot);
236
234
  process.on('exit', () => cleanupTmpTsConfigFile(tmpTsConfigPath));
237
235
  if (useWorkspaceAsBaseUrl) {
238
236
  parsedTSConfig.compilerOptions ??= {};
@@ -10,4 +10,4 @@ export declare function compileSwc(context: ExecutorContext, normalizedOptions:
10
10
  export declare function compileSwcWatch(context: ExecutorContext, normalizedOptions: NormalizedSwcExecutorOptions, postCompilationCallback: () => Promise<void>): AsyncGenerator<{
11
11
  success: boolean;
12
12
  outfile: string;
13
- }, any, undefined>;
13
+ }, any, any>;
@@ -8,10 +8,10 @@ export declare const swcNodeVersion = "~1.9.1";
8
8
  export declare const tsLibVersion = "^2.3.0";
9
9
  export declare const typesNodeVersion = "18.16.9";
10
10
  export declare const verdaccioVersion = "^5.0.4";
11
- export declare const typescriptVersion = "~5.5.2";
11
+ export declare const typescriptVersion = "~5.6.2";
12
12
  /**
13
13
  * The minimum version is currently determined from the lowest version
14
14
  * that's supported by the lowest Angular supported version, e.g.
15
- * `npm view @angular/compiler-cli@14.0.0 peerDependencies.typescript`
15
+ * `npm view @angular/compiler-cli@17.0.0 peerDependencies.typescript`
16
16
  */
17
- export declare const supportedTypescriptVersions = ">=4.9.3";
17
+ export declare const supportedTypescriptVersions = ">=5.2.0";
@@ -12,10 +12,10 @@ exports.tsLibVersion = '^2.3.0';
12
12
  exports.typesNodeVersion = '18.16.9';
13
13
  exports.verdaccioVersion = '^5.0.4';
14
14
  // Typescript
15
- exports.typescriptVersion = '~5.5.2';
15
+ exports.typescriptVersion = '~5.6.2';
16
16
  /**
17
17
  * The minimum version is currently determined from the lowest version
18
18
  * that's supported by the lowest Angular supported version, e.g.
19
- * `npm view @angular/compiler-cli@14.0.0 peerDependencies.typescript`
19
+ * `npm view @angular/compiler-cli@17.0.0 peerDependencies.typescript`
20
20
  */
21
- exports.supportedTypescriptVersions = '>=4.9.3';
21
+ exports.supportedTypescriptVersions = '>=5.2.0';