@nx/js 23.0.0-rc.4 → 23.0.0

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.
@@ -521,12 +521,12 @@ function getOutputs(config, rootTsConfig, internalProjectReferences, workspaceRo
521
521
  // reflected in the outputs. So, we just include everything that could be
522
522
  // produced by the tsc command.
523
523
  [
524
- { configBaseNameNoExt: config.basenameNoExt, tsConfig: rootTsConfig },
524
+ { configPath: config.absolutePath, tsConfig: rootTsConfig },
525
525
  ...Object.entries(internalProjectReferences).map(([internalConfigPath, internalConfig]) => ({
526
- configBaseNameNoExt: (0, node_path_1.basename)(internalConfigPath, '.json'),
526
+ configPath: internalConfigPath,
527
527
  tsConfig: internalConfig,
528
528
  })),
529
- ].forEach(({ configBaseNameNoExt, tsConfig }) => {
529
+ ].forEach(({ configPath, tsConfig }) => {
530
530
  if (tsConfig.options.outFile) {
531
531
  const outFileName = (0, node_path_1.basename)(tsConfig.options.outFile, '.js');
532
532
  const outFileDir = (0, node_path_1.dirname)(tsConfig.options.outFile);
@@ -571,7 +571,7 @@ function getOutputs(config, rootTsConfig, internalProjectReferences, workspaceRo
571
571
  outputs.add((0, devkit_1.joinPathFragments)('{projectRoot}', '**/*.d.mts.map'));
572
572
  }
573
573
  // tsc --build always produces a tsbuildinfo file.
574
- outputs.add(getTsBuildInfoOutputPath(tsConfig, configBaseNameNoExt, workspaceRoot, config.project));
574
+ outputs.add(getTsBuildInfoOutputPath(tsConfig, configPath, workspaceRoot, config.project));
575
575
  });
576
576
  return Array.from(outputs);
577
577
  }
@@ -579,7 +579,7 @@ function getOutputs(config, rootTsConfig, internalProjectReferences, workspaceRo
579
579
  * Returns the path to the tsbuildinfo file that tsc --build will produce.
580
580
  * tsc always emits this file in build mode (incremental is implicit).
581
581
  */
582
- function getTsBuildInfoOutputPath(tsConfig, configBaseNameNoExt, workspaceRoot, project) {
582
+ function getTsBuildInfoOutputPath(tsConfig, configPath, workspaceRoot, project) {
583
583
  if (tsConfig.options.tsBuildInfoFile) {
584
584
  return pathToInputOrOutput(tsConfig.options.tsBuildInfoFile, workspaceRoot, project);
585
585
  }
@@ -588,10 +588,20 @@ function getTsBuildInfoOutputPath(tsConfig, configBaseNameNoExt, workspaceRoot,
588
588
  const outDir = (0, node_path_1.relative)(workspaceRoot, (0, node_path_1.dirname)(tsConfig.options.outFile));
589
589
  return pathToInputOrOutput((0, devkit_1.joinPathFragments)(outDir, `${outFileName}.tsbuildinfo`), workspaceRoot, project);
590
590
  }
591
+ const configPathNoExt = (0, node_path_1.join)((0, node_path_1.dirname)(configPath), (0, node_path_1.basename)(configPath, '.json'));
591
592
  if (tsConfig.options.outDir) {
592
- return pathToInputOrOutput((0, devkit_1.joinPathFragments)(tsConfig.options.outDir, `${configBaseNameNoExt}.tsbuildinfo`), workspaceRoot, project);
593
+ // When rootDir is set, tsc resolves the config path (sans extension)
594
+ // relative to rootDir against outDir, which can place the file outside
595
+ // outDir (e.g. rootDir 'src' with the config one level up emits to the
596
+ // parent of outDir). Without rootDir it just drops the file in outDir.
597
+ // Mirror tsc's getTsBuildInfoEmitOutputFilePath so the declared output
598
+ // matches what's emitted.
599
+ const buildInfoPath = tsConfig.options.rootDir
600
+ ? `${(0, node_path_1.resolve)(tsConfig.options.outDir, (0, node_path_1.relative)(tsConfig.options.rootDir, configPathNoExt))}.tsbuildinfo`
601
+ : (0, devkit_1.joinPathFragments)(tsConfig.options.outDir, `${(0, node_path_1.basename)(configPathNoExt)}.tsbuildinfo`);
602
+ return pathToInputOrOutput(buildInfoPath, workspaceRoot, project);
593
603
  }
594
- return (0, devkit_1.joinPathFragments)('{projectRoot}', `${configBaseNameNoExt}.tsbuildinfo`);
604
+ return (0, devkit_1.joinPathFragments)('{projectRoot}', `${(0, node_path_1.basename)(configPathNoExt)}.tsbuildinfo`);
595
605
  }
596
606
  function pathToInputOrOutput(path, workspaceRoot, project) {
597
607
  const fullProjectRoot = project.absolute;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/js",
3
- "version": "23.0.0-rc.4",
3
+ "version": "23.0.0",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "files": [
@@ -144,11 +144,11 @@
144
144
  "source-map-support": "0.5.19",
145
145
  "tinyglobby": "^0.2.12",
146
146
  "tslib": "^2.3.0",
147
- "@nx/devkit": "23.0.0-rc.4",
148
- "@nx/workspace": "23.0.0-rc.4"
147
+ "@nx/devkit": "23.0.0",
148
+ "@nx/workspace": "23.0.0"
149
149
  },
150
150
  "devDependencies": {
151
- "nx": "23.0.0-rc.4"
151
+ "nx": "23.0.0"
152
152
  },
153
153
  "peerDependencies": {
154
154
  "@swc/cli": ">=0.6.0 <0.9.0",