Skip to content

Commit 402831e

Browse files
feat!: use @oclif/table (#635)
* feat!: use @oclif/table BREAKING CHANGE: new table API * chore: fix test * feat: allow borderStyle to be configured via env var * test: adjust number of newlines * test: trim tables for testing output * fix: change default table style * chore: bump oclif/table --------- Co-authored-by: Eric Willhoit <ewillhoit@salesforce.com>
1 parent 1b8d385 commit 402831e

File tree

12 files changed

+735
-1711
lines changed

12 files changed

+735
-1711
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,6 @@ jobs:
1717
needs: linux-unit-tests
1818
uses: salesforcecli/github-workflows/.github/workflows/unitTestsWindows.yml@main
1919

20-
integration:
21-
needs: linux-unit-tests
22-
strategy:
23-
matrix:
24-
os: [ubuntu-latest, windows-latest]
25-
node_version: [lts/*, latest]
26-
exclude:
27-
- os: windows-latest
28-
node_version: lts/*
29-
fail-fast: false
30-
runs-on: ${{ matrix.os }}
31-
steps:
32-
- uses: actions/checkout@v4
33-
- uses: actions/setup-node@v4
34-
with:
35-
node-version: ${{ matrix.node_version }}
36-
cache: yarn
37-
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
38-
- run: yarn build
39-
- run: yarn test:integration
40-
4120
external-nuts-deploy-retrieve:
4221
name: external-nuts-deploy-retrieve
4322
needs: linux-unit-tests

CHANGELOG.md

Lines changed: 320 additions & 1088 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"prepack": "sf-prepack",
2121
"prepare": "sf-install",
2222
"test": "wireit",
23-
"test:integration": "mocha test/**/*.integration.ts --timeout 30000",
2423
"test:only": "wireit"
2524
},
2625
"exports": {
@@ -46,6 +45,7 @@
4645
"dependencies": {
4746
"@inquirer/confirm": "^3.1.22",
4847
"@inquirer/password": "^2.2.0",
48+
"@oclif/table": "^0.1.19",
4949
"@oclif/core": "^4.0.27",
5050
"@salesforce/core": "^8.5.1",
5151
"@salesforce/kit": "^3.2.3",
@@ -59,6 +59,7 @@
5959
},
6060
"devDependencies": {
6161
"@inquirer/type": "^1.5.2",
62+
"@oclif/test": "^4.0.9",
6263
"@salesforce/dev-scripts": "^10.2.10",
6364
"@types/cli-progress": "^3.11.6",
6465
"eslint-plugin-sf-plugin": "^1.20.7",

src/exported.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export { toHelpSection, parseVarArgs } from './util.js';
99
export { Progress } from './ux/progress.js';
1010
export { Spinner } from './ux/spinner.js';
1111
export { Ux } from './ux/ux.js';
12+
export { convertToNewTableAPI } from './ux/table.js';
1213
export { StandardColors } from './ux/standardColors.js';
1314

1415
export { SfCommand, SfCommandInterface } from './sfCommand.js';

src/sfCommand.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
StructuredMessage,
1818
} from '@salesforce/core';
1919
import type { AnyJson } from '@salesforce/ts-types';
20+
import { TableOptions } from '@oclif/table';
2021
import { Progress } from './ux/progress.js';
2122
import { Spinner } from './ux/spinner.js';
2223
import { Ux } from './ux/ux.js';
@@ -235,8 +236,8 @@ export abstract class SfCommand<T> extends Command {
235236
/**
236237
* Display a table on the console. Will automatically be suppressed when --json flag is present.
237238
*/
238-
public table<R extends Ux.Table.Data>(data: R[], columns: Ux.Table.Columns<R>, options?: Ux.Table.Options): void {
239-
this.ux.table(data, columns, options);
239+
public table<R extends Record<string, unknown>>(options: TableOptions<R>): void {
240+
this.ux.table(options);
240241
}
241242

242243
/**

0 commit comments

Comments
 (0)