diff --git a/.prettierignore b/.prettierignore index 8e678fb814..6547d6d1a4 100644 --- a/.prettierignore +++ b/.prettierignore @@ -48,3 +48,7 @@ packages/testing/config /.nx/cache /.nx/workspace-data + +# Ignore agent instruction symlinks that are checked out as placeholder files on Windows +/CLAUDE.md +/GEMINI.md diff --git a/tasks/git-hooks/pre-push.mts b/tasks/git-hooks/pre-push.mts index 04539e41e9..f2b424505f 100644 --- a/tasks/git-hooks/pre-push.mts +++ b/tasks/git-hooks/pre-push.mts @@ -16,8 +16,13 @@ if (currentBranch === 'next' || currentBranch.startsWith('release/')) { process.exit(0) } +const buildResult = await execAsync('yarn', ['build'], { NX_TUI: 'false' }) + +if (buildResult !== 0) { + process.exit(buildResult) +} + const results = await Promise.allSettled([ - execAsync('yarn', ['build'], { NX_TUI: 'false' }), execAsync('yarn', ['lint']), execAsync('yarn', ['prettier', '--check', '.']), execAsync('yarn', ['check']), diff --git a/tasks/git-hooks/shared.mts b/tasks/git-hooks/shared.mts index f129696d4e..7a5d0e0676 100644 --- a/tasks/git-hooks/shared.mts +++ b/tasks/git-hooks/shared.mts @@ -6,7 +6,13 @@ export function execAsync( extraEnv: Record = {}, ) { return new Promise((resolve, reject) => { - const child = spawn(command, args, { + const isWindowsYarn = process.platform === 'win32' && command === 'yarn' + const commandForPlatform = isWindowsYarn ? 'cmd.exe' : command + const argsForPlatform = isWindowsYarn + ? ['/d', '/s', '/c', 'yarn.cmd', ...args] + : args + + const child = spawn(commandForPlatform, argsForPlatform, { stdio: 'inherit', env: { ...process.env, ...extraEnv }, }) diff --git a/tasks/smart-format.mts b/tasks/smart-format.mts index babd6a38d0..7bc90cd4d0 100644 --- a/tasks/smart-format.mts +++ b/tasks/smart-format.mts @@ -61,5 +61,9 @@ if (existingFiles.length > 0) { } function quoteAll(files: string[]): string { + if (process.platform === 'win32') { + return files.join(' ') + } + return files.map((f) => `'${f.replaceAll("'", "'\\''")}'`).join(' ') }