Skip to content

[heft] Stop using true-case-path #4969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/heft/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
12 changes: 6 additions & 6 deletions apps/heft/src/configuration/HeftConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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?');
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
{
"pnpmShrinkwrapHash": "5b75a8ef91af53a8caf52319e5eb0042c4d06852",
"preferredVersionsHash": "ce857ea0536b894ec8f346aaea08cfd85a5af648",
"packageJsonInjectedDependenciesHash": "5ff2fabbffcfb22bb3e29f56c997f7c762e89d20"
"packageJsonInjectedDependenciesHash": "31e2e4a94050edab124897e4049a6c1d94c21c91"
}
3 changes: 0 additions & 3 deletions common/config/subspaces/default/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading