Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
24 changes: 12 additions & 12 deletions scripts/documentation/map-link-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* - Error if `map.json` reference a markdown file that does not exist
* - Error if a markdown file exists without reference in `map.json`
*/
import * as chalk from 'chalk';
import { styleText } from 'node:util';
import { readJsonSync } from 'fs-extra';
import * as glob from 'glob';

console.log(`${chalk.blue('i')} Documentation Map Check`);
console.log(`${styleText('blue', 'i')} Documentation Map Check`);

const basePath = 'docs';
const sharedFilesPattern = 'shared/cli';
Expand Down Expand Up @@ -57,42 +57,42 @@ let scriptError = false;

if (!!readmeMissList.length) {
console.error(
chalk.red(
styleText(
'red',
"\n⚠️ Documentation files and 'map.json' file are out of sync!\n"
)
);
console.log(readmeMissList.map((x) => x.concat('.md')).join('\n'));
console.error(
chalk.red(
styleText(
'red',
`\nSome documentation files exist without any reference in \'map.json\', make sure to add an entry.`
)
);
scriptError = true;
} else {
console.log(
`${chalk.green('✓')} Markdown files are in sync with ${chalk.grey(
'docs/maps.json'
)}.`
`${styleText('green', '✓')} Markdown files are in sync with ${styleText('grey', 'docs/maps.json')}.`
);
}

if (!!mapMissList.length) {
console.log(
`\n${chalk.red(
'ERROR'
)} The 'map.json' file and the documentation files are out of sync!\n`
`\n${styleText('red', 'ERROR')} The 'map.json' file and the documentation files are out of sync!\n`
);
console.log(mapPathList);
console.log(mapMissList.map((x) => x.concat('.md')).join('\n'));
console.log(
`\n${chalk.red(
`\n${styleText(
'red',
'ERROR'
)} The \'map.json\' file is linking documentation files that do not exist.`
);
scriptError = true;
} else {
console.log(
`${chalk.green(
`${styleText(
'green',
'✓'
)} The 'map.json' file and the documentation files are in sync.`
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Lookup for all the schema.json and add create a list with their path and related package information
* */
import { createDocumentMetadata } from '@nx/nx-dev-models-document';
import * as chalk from 'chalk';
import { styleText } from 'node:util';
import { join, resolve } from 'path';
import { compare } from 'semver';
import {
Expand Down Expand Up @@ -79,7 +79,7 @@ export function generatePackageSchemas(
sourcePackagesDirectory = 'packages',
specificPackages?: string[] | undefined
): Promise<void[]> {
console.log(`${chalk.blue('i')} Generating Package Schemas`);
console.log(`${styleText('blue', 'i')} Generating Package Schemas`);
const absoluteRoot = resolve(join(__dirname, '../../../'));
const sourceRepositoryRoot = resolve(
join(__dirname, '../../../', sourceRepositoryRelativePath)
Expand Down
13 changes: 9 additions & 4 deletions scripts/nx-release.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { createProjectGraphAsync, workspaceRoot } from '@nx/devkit';
import * as chalk from 'chalk';
import { styleText } from 'node:util';
import { execSync } from 'node:child_process';
import { rmSync, writeFileSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
Expand Down Expand Up @@ -150,7 +150,10 @@ const VALID_AUTHORS_FOR_LATEST = [
// If publishing locally, force all projects to not be private first
if (options.local) {
console.log(
chalk.dim`\n Publishing locally, so setting all packages with existing nx-release-publish targets to not be private. If you have created a new private package and you want it to be published, you will need to manually configure the "nx-release-publish" target using executor "@nx/js:release-publish"`
styleText(
'dim',
`\n Publishing locally, so setting all packages with existing nx-release-publish targets to not be private. If you have created a new private package and you want it to be published, you will need to manually configure the "nx-release-publish" target using executor "@nx/js:release-publish"`
)
);
const projectGraph = await createProjectGraphAsync();
for (const proj of Object.values(projectGraph.nodes)) {
Expand Down Expand Up @@ -223,8 +226,10 @@ const VALID_AUTHORS_FOR_LATEST = [
version = options.version;
}

console.log(chalk.green` > Published version: ` + version);
console.log(chalk.dim` Use: npx create-nx-workspace@${version}\n`);
console.log(styleText('green', ` > Published version: ` + version));
console.log(
styleText('dim', ` Use: npx create-nx-workspace@${version}\n`)
);
}

// TODO(colum): Remove when we have a better way to handle this
Expand Down
Loading