Skip to content

Commit 089f09a

Browse files
authored
Merge pull request #112 from webdeveric/dev
Refactor skip message format and update text reporter icons
2 parents c35dc9b + e5e670d commit 089f09a

6 files changed

Lines changed: 28 additions & 12 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"engines": {
3333
"node": ">=22.22.2"
3434
},
35-
"packageManager": "pnpm@11.16.0+sha512.b767e9a98fc87aec0f42daefcd0e84941c2cdb45d73c4e1e68860fb2bdfdbe032ab592105479e5e05c237f740c8a5ffdbbb52385797ddc2296745a1bbb883e8d",
35+
"packageManager": "pnpm@11.17.0+sha512.cca3cea332ad254bb84145f966d19f4879615210346fc92c79a047f23a0d7b3cca3c3792f0076ba1f1831d277efbcf0a9119b31a9a60eca7fb3d6231f331ef72",
3636
"scripts": {
3737
"prevalidate": "pnpm build:dev",
3838
"validate": "./dist/cli.mjs",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/reporters/text-icons.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export const checkMark = '✓';
2+
3+
export const xMark = '✗';
4+
5+
export const emptyBox = '□';
6+
7+
export const leftArrow = '←';
8+
9+
export const rightArrow = '→';
10+
11+
export const upArrow = '↑';
12+
13+
export const downArrow = '↓';
14+
15+
export const pencil = '✎';

src/lib/reporters/web-stream/TextWritableStream.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { assertExhaustive } from '@webdeveric/utils/assertion';
55
import { graphemeLength } from '@webdeveric/utils/graphemeLength';
66
import { indent } from '@webdeveric/utils/indent';
77

8+
import { checkMark, emptyBox, xMark } from '@lib/reporters/text-icons.js';
89
import { ResultCode, type Result } from '@lib/Result.js';
910
import { stdoutWritableStream } from '@utils/stdoutWritableStream.js';
1011

@@ -59,11 +60,11 @@ export class TextWritableStream extends WritableStream<Result> {
5960
getIcon(resultCode: ResultCode): string {
6061
switch (resultCode) {
6162
case ResultCode.Success:
62-
return styleText(['greenBright'], '🗹');
63+
return styleText(['greenBright'], checkMark);
6364
case ResultCode.Error:
64-
return styleText(['redBright'], '🗷');
65+
return styleText(['redBright'], xMark);
6566
case ResultCode.Skip:
66-
return styleText(['whiteBright'], '🞏');
67+
return styleText(['whiteBright'], emptyBox);
6768
default:
6869
assertExhaustive(resultCode, 'Unhandled ResultCode');
6970
}

src/utils/checkImport.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ export function checkImport(entryPoint: EntryPoint): Result {
4545
return new Result({
4646
code: ResultCode.Skip,
4747
entryPoint,
48-
message: `Import skipped: ${entryPoint.itemPath.join('.')}`,
48+
message: `"${entryPoint.moduleName}" skipped`,
4949
name: 'import',
5050
});
5151
} catch (error) {
5252
return new Result({
5353
code: ResultCode.Error,
5454
entryPoint,
5555
error: asError(error),
56-
message: `${entryPoint.moduleName ?? entryPoint.itemPath.join('.')} cannot be imported`,
56+
message: `${entryPoint.moduleName ?? entryPoint.relativePath} cannot be imported`,
5757
name: 'import',
5858
});
5959
}

src/utils/checkRequire.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function checkRequire(entryPoint: EntryPoint): Result {
4242
return new Result({
4343
code: ResultCode.Skip,
4444
entryPoint,
45-
message: `Require skipped: ${entryPoint.itemPath.join('.')}`,
45+
message: `"${entryPoint.moduleName}" skipped`,
4646
name: 'require',
4747
});
4848
} catch (error) {

0 commit comments

Comments
 (0)