Skip to content

Commit

Permalink
feat!: use @oclif/table (#635)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
mdonnalley and iowillhoit authored Oct 17, 2024
1 parent 1b8d385 commit 402831e
Show file tree
Hide file tree
Showing 12 changed files with 735 additions and 1,711 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,6 @@ jobs:
needs: linux-unit-tests
uses: salesforcecli/github-workflows/.github/workflows/unitTestsWindows.yml@main

integration:
needs: linux-unit-tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node_version: [lts/*, latest]
exclude:
- os: windows-latest
node_version: lts/*
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: yarn
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- run: yarn build
- run: yarn test:integration

external-nuts-deploy-retrieve:
name: external-nuts-deploy-retrieve
needs: linux-unit-tests
Expand Down
1,408 changes: 320 additions & 1,088 deletions CHANGELOG.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"prepack": "sf-prepack",
"prepare": "sf-install",
"test": "wireit",
"test:integration": "mocha test/**/*.integration.ts --timeout 30000",
"test:only": "wireit"
},
"exports": {
Expand All @@ -46,6 +45,7 @@
"dependencies": {
"@inquirer/confirm": "^3.1.22",
"@inquirer/password": "^2.2.0",
"@oclif/table": "^0.1.19",
"@oclif/core": "^4.0.27",
"@salesforce/core": "^8.5.1",
"@salesforce/kit": "^3.2.3",
Expand All @@ -59,6 +59,7 @@
},
"devDependencies": {
"@inquirer/type": "^1.5.2",
"@oclif/test": "^4.0.9",
"@salesforce/dev-scripts": "^10.2.10",
"@types/cli-progress": "^3.11.6",
"eslint-plugin-sf-plugin": "^1.20.7",
Expand Down
1 change: 1 addition & 0 deletions src/exported.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export { toHelpSection, parseVarArgs } from './util.js';
export { Progress } from './ux/progress.js';
export { Spinner } from './ux/spinner.js';
export { Ux } from './ux/ux.js';
export { convertToNewTableAPI } from './ux/table.js';
export { StandardColors } from './ux/standardColors.js';

export { SfCommand, SfCommandInterface } from './sfCommand.js';
Expand Down
5 changes: 3 additions & 2 deletions src/sfCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
StructuredMessage,
} from '@salesforce/core';
import type { AnyJson } from '@salesforce/ts-types';
import { TableOptions } from '@oclif/table';
import { Progress } from './ux/progress.js';
import { Spinner } from './ux/spinner.js';
import { Ux } from './ux/ux.js';
Expand Down Expand Up @@ -235,8 +236,8 @@ export abstract class SfCommand<T> extends Command {
/**
* Display a table on the console. Will automatically be suppressed when --json flag is present.
*/
public table<R extends Ux.Table.Data>(data: R[], columns: Ux.Table.Columns<R>, options?: Ux.Table.Options): void {
this.ux.table(data, columns, options);
public table<R extends Record<string, unknown>>(options: TableOptions<R>): void {
this.ux.table(options);
}

/**
Expand Down
Loading

0 comments on commit 402831e

Please sign in to comment.