MaxKless b73f1e0e00
fix(core): set windowsHide: true wherever possible (#28073)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-09-24 11:31:22 -04:00

67 lines
1.8 KiB
TypeScript

import * as chalk from 'chalk';
import { execSync } from 'child_process';
import { removeSync } from 'fs-extra';
import { join, resolve } from 'path';
import { generatePackageSchemas } from '../package-schemas/generatePackageSchemas';
import { generateCliDocumentation } from './generate-cli-data';
import { generateCnwDocumentation } from './generate-cnw-documentation';
import { generateDevkitDocumentation } from './generate-devkit-documentation';
import { generateManifests } from './generate-manifests';
const workspaceRoot = resolve(__dirname, '../../../');
async function generate() {
try {
console.log(`${chalk.blue('i')} Generating Documentation`);
const generatedOutputDirectory = join(workspaceRoot, 'docs', 'generated');
removeSync(generatedOutputDirectory);
const commandsOutputDirectory = join(
workspaceRoot,
'docs',
'generated',
'cli'
);
await generateCnwDocumentation(commandsOutputDirectory);
await generateCliDocumentation(commandsOutputDirectory);
await generateDevkitDocumentation();
await generatePackageSchemas();
await generateManifests(workspaceRoot);
console.log(`\n${chalk.green('✓')} Generated Documentation\n`);
} catch (e) {
console.error(e);
process.exit(1);
}
}
function checkDocumentation() {
const output = execSync('git status --porcelain ./docs', {
windowsHide: true,
}).toString('utf-8');
if (output) {
console.log(
`${chalk.red(
'!'
)} 📄 Documentation has been modified, you need to commit the changes. ${chalk.red(
'!'
)} `
);
console.log('\nChanged Docs:');
execSync('git status --porcelain ./docs', {
stdio: 'inherit',
windowsHide: true,
});
process.exit(1);
} else {
console.log('📄 Documentation not modified');
}
}
generate().then(() => checkDocumentation());