diff --git a/apps/heft/package.json b/apps/heft/package.json index fec0d462f0e..ca3c65bf748 100644 --- a/apps/heft/package.json +++ b/apps/heft/package.json @@ -45,7 +45,6 @@ "git-repo-info": "~2.1.0", "ignore": "~5.1.6", "tapable": "1.1.3", - "true-case-path": "~2.2.1", "watchpack": "2.4.0" }, "devDependencies": { diff --git a/apps/heft/src/configuration/HeftConfiguration.ts b/apps/heft/src/configuration/HeftConfiguration.ts index 7d88d982e54..02388a34c5a 100644 --- a/apps/heft/src/configuration/HeftConfiguration.ts +++ b/apps/heft/src/configuration/HeftConfiguration.ts @@ -4,7 +4,6 @@ import * as path from 'path'; import { type IPackageJson, PackageJsonLookup, InternalError, Path } from '@rushstack/node-core-library'; import { Terminal, type ITerminalProvider, type ITerminal } from '@rushstack/terminal'; -import { trueCasePathSync } from 'true-case-path'; import { type IRigConfig, RigConfig } from '@rushstack/rig-package'; import { Constants } from '../utilities/Constants'; @@ -161,11 +160,12 @@ export class HeftConfiguration { ); if (packageJsonPath) { let buildFolderPath: string = path.dirname(packageJsonPath); - // The CWD path's casing may be incorrect on a case-insensitive filesystem. Some tools, like Jest - // expect the casing of the project path to be correct and produce unexpected behavior when the casing - // isn't correct. - // This ensures the casing of the project folder is correct. - buildFolderPath = trueCasePathSync(buildFolderPath); + // On Windows it is possible for the drive letter in the CWD to be lowercase, but the normalized naming is uppercase + // Force it to always be uppercase for consistency. + buildFolderPath = + process.platform === 'win32' + ? buildFolderPath.charAt(0).toUpperCase() + buildFolderPath.slice(1) + : buildFolderPath; configuration._buildFolderPath = buildFolderPath; } else { throw new Error('No package.json file found. Are you in a project folder?'); diff --git a/common/changes/@rushstack/heft/kill-true-case-path_2024-10-11-23-03.json b/common/changes/@rushstack/heft/kill-true-case-path_2024-10-11-23-03.json new file mode 100644 index 00000000000..235eb918b10 --- /dev/null +++ b/common/changes/@rushstack/heft/kill-true-case-path_2024-10-11-23-03.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/heft", + "comment": "Remove usage of true-case-path in favor of manually adjusting the drive letter casing to avoid confusing file system tracing tools with unnecessary directory enumerations.", + "type": "patch" + } + ], + "packageName": "@rushstack/heft" +} \ No newline at end of file diff --git a/common/config/subspaces/build-tests-subspace/repo-state.json b/common/config/subspaces/build-tests-subspace/repo-state.json index 5c13112cf8e..cb6f5ac7ac7 100644 --- a/common/config/subspaces/build-tests-subspace/repo-state.json +++ b/common/config/subspaces/build-tests-subspace/repo-state.json @@ -2,5 +2,5 @@ { "pnpmShrinkwrapHash": "5b75a8ef91af53a8caf52319e5eb0042c4d06852", "preferredVersionsHash": "ce857ea0536b894ec8f346aaea08cfd85a5af648", - "packageJsonInjectedDependenciesHash": "5ff2fabbffcfb22bb3e29f56c997f7c762e89d20" + "packageJsonInjectedDependenciesHash": "31e2e4a94050edab124897e4049a6c1d94c21c91" } diff --git a/common/config/subspaces/default/pnpm-lock.yaml b/common/config/subspaces/default/pnpm-lock.yaml index c426ccc5542..4bc180884a4 100644 --- a/common/config/subspaces/default/pnpm-lock.yaml +++ b/common/config/subspaces/default/pnpm-lock.yaml @@ -155,9 +155,6 @@ importers: tapable: specifier: 1.1.3 version: 1.1.3 - true-case-path: - specifier: ~2.2.1 - version: 2.2.1 watchpack: specifier: 2.4.0 version: 2.4.0