Skip to content

Commit

Permalink
feat(nx-plugin): update unicode logo in stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
matejchalk committed Sep 16, 2024
1 parent 61ab0f7 commit 1d5e3ad
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
6 changes: 3 additions & 3 deletions e2e/create-cli-e2e/tests/init.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('create-cli-node', () => {
expect(code).toBe(0);
const cleanedStdout = removeColorCodes(stdout);
expect(cleanedStdout).toContain(
'<> Generating @code-pushup/nx-plugin:configuration',
'<> Generating @code-pushup/nx-plugin:configuration',
);
});

Expand All @@ -45,7 +45,7 @@ describe('create-cli-node', () => {
expect(code).toBe(0);
const cleanedStdout = removeColorCodes(stdout);
expect(cleanedStdout).toContain(
'<> Generating @code-pushup/nx-plugin:configuration',
'<> Generating @code-pushup/nx-plugin:configuration',
);
});

Expand All @@ -61,7 +61,7 @@ describe('create-cli-node', () => {
expect(code).toBe(0);
const cleanedStdout = removeColorCodes(stdout);
expect(cleanedStdout).toContain(
'<> Generating @code-pushup/nx-plugin:configuration',
'<> Generating @code-pushup/nx-plugin:configuration',
);
});
});
4 changes: 2 additions & 2 deletions packages/create-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ npm exec @code-pushup/create-cli
It should generate the following output:

```bash
> <> Generating @code-pushup/nx-plugin:init
> <> Generating @code-pushup/nx-plugin:init

> <> Generating @code-pushup/nx-plugin:configuration
> <> Generating @code-pushup/nx-plugin:configuration

CREATE code-pushup.config.ts
```
3 changes: 2 additions & 1 deletion packages/create-cli/src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { readFile, rm, stat, writeFile } from 'node:fs/promises';
import { CODE_PUSHUP_UNICODE_LOGO } from '@code-pushup/utils';
import {
NX_JSON_CONTENT,
NX_JSON_FILENAME,
Expand Down Expand Up @@ -45,7 +46,7 @@ export async function setupFile(
}

export function parseNxProcessOutput(output: string) {
return output.trim().replace('NX', '<↗>');
return output.trim().replace('NX', CODE_PUSHUP_UNICODE_LOGO);
}

export async function setupNxContext(): Promise<{
Expand Down
4 changes: 2 additions & 2 deletions packages/create-cli/src/lib/utils.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
} from './utils';

describe('parseNxProcessOutput', () => {
it('should replace NX with <>', () => {
expect(parseNxProcessOutput('NX some message')).toBe('<> some message');
it('should replace NX with <>', () => {
expect(parseNxProcessOutput('NX some message')).toBe('<> some message');
});
});

Expand Down
21 changes: 11 additions & 10 deletions packages/utils/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
export { exists } from '@code-pushup/models';
export { type Diff, comparePairs, matchArrayItemsByKey } from './lib/diff';
export { comparePairs, matchArrayItemsByKey, type Diff } from './lib/diff';
export { stringifyError } from './lib/errors';
export {
type ProcessConfig,
ProcessError,
executeProcess,
type ProcessConfig,
type ProcessObserver,
type ProcessResult,
executeProcess,
} from './lib/execute-process';
export {
type CrawlFileSystemOptions,
type FileResult,
type MultipleFileResults,
crawlFileSystem,
directoryExists,
ensureDirectoryExists,
Expand All @@ -24,6 +21,9 @@ export {
readJsonFile,
readTextFile,
removeDirectoryIfExists,
type CrawlFileSystemOptions,
type FileResult,
type MultipleFileResults,
} from './lib/file-system';
export { filterItemRefsBy } from './lib/filter';
export {
Expand All @@ -45,24 +45,25 @@ export {
toGitPath,
} from './lib/git/git';
export {
type LogResult,
getCurrentBranchOrTag,
getHashFromTag,
getHashes,
getLatestCommit,
getSemverTags,
type LogResult,
} from './lib/git/git.commits-and-tags';
export { groupByStatus } from './lib/group-by-status';
export {
isPromiseFulfilledResult,
isPromiseRejectedResult,
} from './lib/guards';
export { logMultipleResults } from './lib/log-results';
export { type CliUi, type Column, link, ui } from './lib/logging';
export { link, ui, type CliUi, type Column } from './lib/logging';
export { mergeConfigs } from './lib/merge-configs';
export { type ProgressBar, getProgressBar } from './lib/progress';
export { getProgressBar, type ProgressBar } from './lib/progress';
export {
CODE_PUSHUP_DOMAIN,
CODE_PUSHUP_UNICODE_LOGO,
FOOTER_PREFIX,
README_LINK,
TERMINAL_WIDTH,
Expand Down Expand Up @@ -93,7 +94,6 @@ export {
export { isSemver, normalizeSemver, sortSemvers } from './lib/semver';
export * from './lib/text-formats';
export {
type CliArgsObject,
capitalize,
countOccurrences,
distinct,
Expand All @@ -109,6 +109,7 @@ export {
toOrdinal,
toUnixNewlines,
toUnixPath,
type CliArgsObject,
} from './lib/transform';
export type {
ExcludeNullFromPropertyTypes,
Expand Down
2 changes: 2 additions & 0 deletions packages/utils/src/lib/reports/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export const CODE_PUSHUP_DOMAIN = 'code-pushup.dev';
export const README_LINK = 'https://github.com/code-pushup/cli#readme';
export const REPORT_HEADLINE_TEXT = 'Code PushUp Report';

export const CODE_PUSHUP_UNICODE_LOGO = '<✓>';

export const REPORT_RAW_OVERVIEW_TABLE_HEADERS = [
'Category',
'Score',
Expand Down

0 comments on commit 1d5e3ad

Please sign in to comment.