[fs-detectors] getMonorepoDefaultSettings: Fix settings (#9315)

1. `commandForIgnoringBuildStep` should be run at the project directory level not the monorepo root level
2. Simplifying the `installCommand` because doesn't need the relative root unless it is `npm`
This commit is contained in:
chloetedder
2023-01-30 11:35:42 -07:00
committed by GitHub
parent fdf7fd6784
commit 31f3daa5b4
14 changed files with 48 additions and 26 deletions

View File

@@ -67,8 +67,11 @@ export async function getMonorepoDefaultSettings(
return {
monorepoManager: 'turbo',
buildCommand: `cd ${relativeToRoot} && npx turbo run build --filter={${projectPath}}...`,
installCommand: `cd ${relativeToRoot} && ${packageManager} install`,
commandForIgnoringBuildStep: `cd ${relativeToRoot} && npx turbo-ignore`,
installCommand:
packageManager === 'npm'
? `${packageManager} install --prefix=${relativeToRoot}`
: `${packageManager} install`,
commandForIgnoringBuildStep: `npx turbo-ignore`,
};
} else if (monorepoManager === 'nx') {
// No ENOENT handling required here since conditional wouldn't be `true` unless `nx.json` was found.
@@ -111,7 +114,10 @@ export async function getMonorepoDefaultSettings(
return {
monorepoManager: 'nx',
buildCommand: `cd ${relativeToRoot} && npx nx build ${projectName}`,
installCommand: `cd ${relativeToRoot} && ${packageManager} install`,
installCommand:
packageManager === 'npm'
? `${packageManager} install --prefix=${relativeToRoot}`
: `${packageManager} install`,
};
}
// TODO (@Ethan-Arrowood) - Revisit rush support when we can test it better