Skip to content
Closed
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
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
]
}
],
"@nx/workspace/valid-command-object": "error"
"@nx/workspace/valid-command-object": "error",
"@nx/workspace/require-windows-hide": "error"
}
},
{
Expand Down
1 change: 1 addition & 0 deletions astro-docs/src/plugins/utils/cnw-generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export async function loadCnwPackage(
const child = fork(subprocessPath, [], {
cwd: workspaceRoot,
silent: true,
windowsHide: true,
});

let stdout = '';
Expand Down
1 change: 1 addition & 0 deletions astro-docs/src/plugins/utils/nx-cli-generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export async function loadNxCliPackage(
cwd: workspaceRoot,
silent: true,
stdio: ['inherit', 'inherit', 'inherit', 'ipc'],
windowsHide: true,
});

child.on('message', (message: any) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function spawnAndWait(command: string, args: string[], cwd: string) {
ESLINT_USE_FLAT_CONFIG: process.env.ESLINT_USE_FLAT_CONFIG ?? 'true',
},
shell: true,
windowsHide: false,
windowsHide: true,
});

childProcess.on('exit', (code, signal) => {
Expand All @@ -47,7 +47,7 @@ export function execAndWait(
return new Promise<{ code: number; stdout: string }>((res, rej) => {
exec(
command,
{ cwd, env: { ...process.env, NX_DAEMON: 'false' }, windowsHide: false },
{ cwd, env: { ...process.env, NX_DAEMON: 'false' }, windowsHide: true },
(error, stdout, stderr) => {
if (error) {
if (silenceErrors) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function deduceDefaultBase(): string {
const nxDefaultBase = 'main';
try {
return (
execSync('git config --get init.defaultBranch', { windowsHide: false })
execSync('git config --get init.defaultBranch', { windowsHide: true })
.toString()
.trim() || nxDefaultBase
);
Expand Down
4 changes: 2 additions & 2 deletions packages/create-nx-workspace/src/utils/git/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function checkGitVersion(): Promise<string | null | undefined> {
*/
export function isGitAvailable(): boolean {
try {
execSync('git --version', { stdio: 'ignore' });
execSync('git --version', { stdio: 'ignore', windowsHide: true });
return true;
} catch {
return false;
Expand All @@ -49,7 +49,7 @@ export function isGitAvailable(): boolean {
*/
export function isGhCliAvailable(): boolean {
try {
execSync('gh --version', { stdio: 'ignore' });
execSync('gh --version', { stdio: 'ignore', windowsHide: true });
return true;
} catch {
return false;
Expand Down
2 changes: 1 addition & 1 deletion packages/create-nx-workspace/src/utils/nx/ab-testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ function shouldRecordStats(): boolean {
// Use npm to check registry - this works regardless of which package manager invoked us
const stdout = execSync('npm config get registry', {
encoding: 'utf-8',
windowsHide: false,
windowsHide: true,
});
const url = new URL(stdout.trim());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export function getPackageManagerVersion(
const version = execSync(`${packageManager} --version`, {
cwd,
encoding: 'utf-8',
windowsHide: false,
windowsHide: true,
}).trim();
pmVersionCache.set(packageManager, version);
return version;
Expand Down
4 changes: 2 additions & 2 deletions packages/cypress/plugins/cypress-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ function startWebServer(webServerCommand: string) {
// Windows is fine so we leave it attached to this process
detached: process.platform !== 'win32',
stdio: 'inherit',
windowsHide: false,
windowsHide: true,
});

return async () => {
if (process.platform === 'win32') {
try {
execSync('taskkill /pid ' + serverProcess.pid + ' /T /F', {
windowsHide: false,
windowsHide: true,
});
} catch (e) {
if (process.env.NX_VERBOSE_LOGGING === 'true') {
Expand Down
1 change: 1 addition & 0 deletions packages/detox/src/executors/build/build.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export function runCliBuild(
{
cwd: pathResolve(workspaceRoot, projectRoot),
env: process.env,
windowsHide: true,
}
);

Expand Down
1 change: 1 addition & 0 deletions packages/detox/src/executors/test/test.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function runCliTest(
{
cwd: pathResolve(workspaceRoot, projectRoot),
env: process.env,
windowsHide: true,
}
);

Expand Down
2 changes: 1 addition & 1 deletion packages/devkit/src/tasks/install-packages-task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function installPackagesTask(
const execSyncOptions: ExecSyncOptions = {
cwd: join(tree.root, cwd),
stdio: process.env.NX_GENERATE_QUIET === 'true' ? 'ignore' : 'inherit',
windowsHide: false,
windowsHide: true,
};
// ensure local registry from process is not interfering with the install
// when we start the process from temp folder the local registry would override the custom registry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function checkDockerImageExistsLocally(imageRef: string) {
: imageRef;
const childProcess = exec(
`docker images --filter "reference=${normalizedImageRef}" --quiet`,
{ encoding: 'utf8' }
{ encoding: 'utf8', windowsHide: true }
);
let result = '';
childProcess.stdout?.on('data', (data) => {
Expand Down Expand Up @@ -118,6 +118,7 @@ async function dockerPush(imageReference: string, quiet: boolean) {
{
encoding: 'utf8',
maxBuffer: LARGE_BUFFER,
windowsHide: true,
}
);
let result = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export function runCliBuildList(
cwd: pathResolve(workspaceRoot, projectRoot),
env: process.env,
stdio: ['inherit', 'pipe', 'inherit', 'ipc'], // only stream stdout on child process
windowsHide: true,
}
);

Expand Down
1 change: 1 addition & 0 deletions packages/expo/src/executors/build/build.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function runCliBuild(
...(options.local ? { YARN_ENABLE_IMMUTABLE_INSTALLS: 'false' } : {}),
...process.env,
},
windowsHide: true,
}
);

Expand Down
6 changes: 5 additions & 1 deletion packages/expo/src/executors/export/export.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ function exportAsync(
childProcess = fork(
require.resolve('@expo/cli/build/bin/cli'),
[`export`, ...createExportOptions(options, projectRoot)],
{ cwd: pathResolve(workspaceRoot, projectRoot), env: process.env }
{
cwd: pathResolve(workspaceRoot, projectRoot),
env: process.env,
windowsHide: true,
}
);

// Ensure the child process is killed when the parent exits
Expand Down
6 changes: 5 additions & 1 deletion packages/expo/src/executors/prebuild/prebuild.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ export function prebuildAsync(
childProcess = fork(
require.resolve('@expo/cli/build/bin/cli'),
['prebuild', ...createPrebuildOptions(options), '--no-install'],
{ cwd: join(workspaceRoot, projectRoot), env: process.env }
{
cwd: join(workspaceRoot, projectRoot),
env: process.env,
windowsHide: true,
}
);

// Ensure the child process is killed when the parent exits
Expand Down
1 change: 1 addition & 0 deletions packages/expo/src/executors/run/run.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function runCliRun(
{
cwd: pathResolve(workspaceRoot, projectRoot),
env: process.env,
windowsHide: true,
}
);

Expand Down
1 change: 1 addition & 0 deletions packages/expo/src/executors/serve/serve.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function serveAsync(
cwd: pathResolve(workspaceRoot, projectRoot),
env: process.env,
stdio: ['inherit', 'pipe', 'pipe', 'ipc'],
windowsHide: true,
}
);

Expand Down
1 change: 1 addition & 0 deletions packages/expo/src/executors/start/start.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function startAsync(
RCT_METRO_PORT: options.port.toString(),
...process.env,
},
windowsHide: true,
}
);

Expand Down
1 change: 1 addition & 0 deletions packages/expo/src/executors/submit/submit.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function runCliSubmit(
{
cwd: pathResolve(workspaceRoot, projectRoot),
env: process.env,
windowsHide: true,
}
);

Expand Down
6 changes: 5 additions & 1 deletion packages/expo/src/executors/update/update.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ function runCliUpdate(
childProcess = fork(
resolveEas(workspaceRoot),
['update', ...createUpdateOptions(options)],
{ cwd: pathResolve(workspaceRoot, projectRoot), env: process.env }
{
cwd: pathResolve(workspaceRoot, projectRoot),
env: process.env,
windowsHide: true,
}
);

// Ensure the child process is killed when the parent exits
Expand Down
4 changes: 2 additions & 2 deletions packages/expo/src/utils/pod-install-task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function podInstall(
execSync('touch .xcode.env', {
cwd: iosDirectory,
stdio: 'inherit',
windowsHide: false,
windowsHide: true,
});
}
execSync(
Expand All @@ -79,7 +79,7 @@ export function podInstall(
{
cwd: iosDirectory,
stdio: 'inherit',
windowsHide: false,
windowsHide: true,
}
);
} catch (e) {
Expand Down
4 changes: 2 additions & 2 deletions packages/expo/src/utils/resolve-eas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ export function resolveEas(workspaceRoot: string): string {

let npmGlobalPath: string, yarnGlobalPath: string;
try {
npmGlobalPath = execSync('npm root -g', { windowsHide: false })
npmGlobalPath = execSync('npm root -g', { windowsHide: true })
?.toString()
?.trim()
?.replace('\u001b[2K\u001b[1G', ''); // strip out ansi codes
} catch {}
try {
yarnGlobalPath = execSync('yarn global dir', { windowsHide: false })
yarnGlobalPath = execSync('yarn global dir', { windowsHide: true })
?.toString()
?.trim()
?.replace('\u001b[2K\u001b[1G', ''); // strip out ansi codes
Expand Down
6 changes: 3 additions & 3 deletions packages/js/src/executors/node/lib/kill-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function killTree(pid: number, signal: NodeJS.Signals) {
exec(
'taskkill /pid ' + pid + ' /T /F',
{
windowsHide: false,
windowsHide: true,
},
(error) => {
// Ignore Fatal errors (128) because it might be due to the process already being killed.
Expand All @@ -37,7 +37,7 @@ export async function killTree(pid: number, signal: NodeJS.Signals) {
pidsToProcess,
function (parentPid) {
return spawn('pgrep', ['-P', parentPid], {
windowsHide: false,
windowsHide: true,
});
},
function () {
Expand All @@ -55,7 +55,7 @@ export async function killTree(pid: number, signal: NodeJS.Signals) {
'ps',
['-o', 'pid', '--no-headers', '--ppid', parentPid],
{
windowsHide: false,
windowsHide: true,
}
);
},
Expand Down
2 changes: 2 additions & 0 deletions packages/js/src/executors/node/node.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ export async function* nodeExecutor(
NX_FILE_TO_RUN: fileToRunCorrectPath(fileToRun),
NX_MAPPINGS: JSON.stringify(mappings),
},
windowsHide: true,
}
);

Expand Down Expand Up @@ -306,6 +307,7 @@ export async function* nodeExecutor(
{
cwd: context.root,
stdio: 'inherit',
windowsHide: true,
}
);
childProcess.once('exit', (code) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
env: processEnv(true),
cwd: context.root,
stdio: ['ignore', 'pipe', 'pipe'],
windowsHide: false,
windowsHide: true,
});

const resultJson = JSON.parse(result.toString());
Expand All @@ -174,7 +174,7 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
env: processEnv(true),
cwd: context.root,
stdio: 'ignore',
windowsHide: false,
windowsHide: true,
});
console.log(
`Added the dist-tag ${tag} to v${currentVersion} for registry ${registry}.\n`
Expand Down Expand Up @@ -295,7 +295,7 @@ Please update the local dependency on "${depName}" to be a valid semantic versio
env: processEnv(true),
cwd: context.root,
stdio: ['ignore', 'pipe', 'pipe'],
windowsHide: false,
windowsHide: true,
});
// If in dry-run mode, the version on disk will not represent the version that would be published, so we scrub it from the output to avoid confusion.
const dryRunVersionPlaceholder = 'X.X.X-dry-run';
Expand Down
Loading
Loading