Skip to content

Commit c0da503

Browse files
committed
fix: change default table style
1 parent 2fe71ca commit c0da503

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/ux/ux.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,15 @@ export class Ux extends UxBase {
8888
'vertical-with-outline',
8989
'vertical',
9090
];
91+
92+
const defaultStyle = 'vertical-with-outline';
9193
const determineBorderStyle = (): TableOptions<T>['borderStyle'] => {
92-
const envVar = env.getString('SF_TABLE_BORDER_STYLE', 'headers-only-with-underline');
94+
const envVar = env.getString('SF_TABLE_BORDER_STYLE', defaultStyle);
9395
if (borderStyles.includes(envVar)) {
9496
return envVar as TableOptions<T>['borderStyle'];
9597
}
9698

97-
return 'headers-only-with-underline';
99+
return defaultStyle;
98100
};
99101

100102
this.maybeNoop(() =>

test/unit/ux/ux.test.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ describe('Ux', () => {
3232
ux.table({ data: [{ key: 'foo', value: 'bar' }], title: 'Title' });
3333
});
3434
expect(stdout.replaceAll(' \n', '\n').trimEnd()).to.equal(`Title
35-
Key Value
36-
─────────────
37-
foo bar`);
35+
┌─────┬───────┐
36+
│ Key │ Value │
37+
├─────┼───────┤
38+
│ foo │ bar │
39+
└─────┴───────┘`);
3840
});
3941

4042
it('should not log anything if output is not enabled', async () => {
@@ -54,9 +56,11 @@ describe('Ux', () => {
5456
ux.table(opts);
5557
});
5658
expect(stdout.replaceAll(' \n', '\n').trimEnd()).to.equal(`Title
57-
Key Value
58-
─────────────
59-
foo bar`);
59+
┌─────┬───────┐
60+
│ Key │ Value │
61+
├─────┼───────┤
62+
│ foo │ bar │
63+
└─────┴───────┘`);
6064
});
6165

6266
it('should not log anything if output is not enabled', async () => {

0 commit comments

Comments
 (0)