@oclif/table 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/table.js +12 -2
  2. package/package.json +2 -2
package/lib/table.js CHANGED
@@ -285,6 +285,12 @@ export function Skeleton(props) {
285
285
  * the desired effect in powershell.
286
286
  */
287
287
  class Stream extends WriteStream {
288
+ // Override the rows so that ink doesn't clear the entire terminal when
289
+ // unmounting the component and the height of the output is greater than
290
+ // the height of the terminal
291
+ // https://github.com/vadimdemedes/ink/blob/v5.0.1/src/ink.tsx#L174
292
+ // This might be a bad idea but it works.
293
+ rows = 10_000;
288
294
  frames = [];
289
295
  lastFrame() {
290
296
  return this.frames
@@ -302,8 +308,12 @@ class Stream extends WriteStream {
302
308
  class Output {
303
309
  stream;
304
310
  constructor() {
305
- const fd = process.env.OCLIF_TABLE_FD ? Number(process.env.OCLIF_TABLE_FD) : 0;
306
- this.stream = process.env.NODE_ENV === 'test' ? process.stdout : new Stream(fd);
311
+ // Use process.stdout if NODE_ENV is `test` OR if tests are being run by wireit on windows (windows + tests run by wireit
312
+ // are problematic for an unknown reason)
313
+ this.stream =
314
+ (process.platform === 'win32' && process.env.npm_lifecycle_script === 'wireit') || process.env.NODE_ENV === 'test'
315
+ ? process.stdout
316
+ : new Stream(process.env.OCLIF_TABLE_FD ? Number(process.env.OCLIF_TABLE_FD) : process.stdout.fd);
307
317
  }
308
318
  maybePrintLastFrame() {
309
319
  if (this.stream instanceof Stream) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oclif/table",
3
3
  "description": "Display table in terminal",
4
- "version": "0.1.21",
4
+ "version": "0.1.22",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/table/issues",
7
7
  "dependencies": {
@@ -19,7 +19,7 @@
19
19
  "devDependencies": {
20
20
  "@commitlint/config-conventional": "^19",
21
21
  "@oclif/prettier-config": "^0.2.1",
22
- "@oclif/test": "^4.0.9",
22
+ "@oclif/test": "^4.1.0",
23
23
  "@types/chai": "^4.3.16",
24
24
  "@types/mocha": "^10.0.9",
25
25
  "@types/node": "^18",