Skip to content

Commit

Permalink
fix: bump oclif/table
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Oct 25, 2024
1 parent 334be37 commit 6ebe4d1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@inquirer/confirm": "^3.1.22",
"@inquirer/password": "^2.2.0",
"@oclif/core": "^4.0.27",
"@oclif/table": "^0.2.1",
"@oclif/table": "^0.2.2",
"@salesforce/core": "^8.5.1",
"@salesforce/kit": "^3.2.3",
"@salesforce/ts-types": "^2.0.12",
Expand Down
11 changes: 11 additions & 0 deletions src/ux/ux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ export class Ux extends UxBase {
return defaultStyle;
};

const overflowOptions = ['wrap', 'truncate', 'truncate-middle', 'truncate-start', 'truncate-end'];
const determineOverflow = (): TableOptions<T>['overflow'] => {
const envVar = env.getString('SF_TABLE_OVERFLOW');
if (envVar && overflowOptions.includes(envVar)) {
return envVar as TableOptions<T>['overflow'];
}

return options.overflow;
};

this.maybeNoop(() =>
printTable({
...options,
Expand All @@ -109,6 +119,7 @@ export class Ux extends UxBase {
...options.headerOptions,
formatter: 'capitalCase',
},
overflow: determineOverflow(),
})
);
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -582,10 +582,10 @@
wordwrap "^1.0.0"
wrap-ansi "^7.0.0"

"@oclif/table@^0.2.1":
version "0.2.1"
resolved "https://registry.yarnpkg.com/@oclif/table/-/table-0.2.1.tgz#99462f914638cd70325e6bb9a1510fc5fef4a903"
integrity sha512-RdznMxghWq6AcZQkT0+lvUFYstyThJlyYxlJPJxunTCrPvkJXhcTDh0eUttLmjaNhqhGWaxZHXlgsga5Ecs/AQ==
"@oclif/table@^0.2.2":
version "0.2.2"
resolved "https://registry.yarnpkg.com/@oclif/table/-/table-0.2.2.tgz#057f1f86c51a5a4239dbd0a71d3fe4056d8d95f5"
integrity sha512-wKWkPcZ00k3v1ZgaX0MB1LR1HR227ZtFv/zgElGwVSTvvRLe1r5VHple7nmZA+7zJkRO7ko09IPUlxezDu2D3A==
dependencies:
"@oclif/core" "^4"
"@types/react" "^18.3.11"
Expand Down

0 comments on commit 6ebe4d1

Please sign in to comment.