@heroku/heroku-cli-util 9.0.0 → 9.0.1-beta.1

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.
package/README.md CHANGED
@@ -30,10 +30,24 @@ import { hux } from '@heroku/heroku-cli-util';
30
30
  hux.styledHeader('My CLI Header');
31
31
 
32
32
  // Styled JSON
33
- hux.styledJson({ foo: 'bar' });
33
+ hux.styledJSON({ foo: 'bar' });
34
34
 
35
35
  // Styled object
36
36
  hux.styledObject({ foo: 'bar' });
37
+
38
+ // Table output
39
+ hux.table([
40
+ {name: 'Alice', age: 30},
41
+ {name: 'Bob', age: 25},
42
+ ], {
43
+ name: {header: 'Name'},
44
+ age: {header: 'Age'},
45
+ });
46
+
47
+ // Wait indicator
48
+ const stop = hux.wait('Processing...');
49
+ // ...do async work...
50
+ stop();
37
51
  ```
38
52
 
39
53
  ### User Interaction
package/dist/index.d.ts CHANGED
@@ -10,8 +10,10 @@ import { exec } from './utils/pg/psql';
10
10
  import { confirm } from './ux/confirm';
11
11
  import { prompt } from './ux/prompt';
12
12
  import { styledHeader } from './ux/styled-header';
13
- import { styledJson } from './ux/styled-json';
13
+ import { styledJSON } from './ux/styled-json';
14
14
  import { styledObject } from './ux/styled-object';
15
+ import { table } from './ux/table';
16
+ import { wait } from './ux/wait';
15
17
  export declare const testHelpers: {
16
18
  expectOutput: (actual: string, expected: string) => Chai.Assertion;
17
19
  initCliTest: typeof initCliTest;
@@ -48,6 +50,8 @@ export declare const hux: {
48
50
  confirm: typeof confirm;
49
51
  prompt: typeof prompt;
50
52
  styledHeader: typeof styledHeader;
51
- styledJson: typeof styledJson;
53
+ styledJSON: typeof styledJSON;
52
54
  styledObject: typeof styledObject;
55
+ table: typeof table;
56
+ wait: typeof wait;
53
57
  };
package/dist/index.js CHANGED
@@ -15,6 +15,8 @@ const prompt_1 = require("./ux/prompt");
15
15
  const styled_header_1 = require("./ux/styled-header");
16
16
  const styled_json_1 = require("./ux/styled-json");
17
17
  const styled_object_1 = require("./ux/styled-object");
18
+ const table_1 = require("./ux/table");
19
+ const wait_1 = require("./ux/wait");
18
20
  exports.testHelpers = {
19
21
  expectOutput: expect_output_1.default,
20
22
  initCliTest: init_1.initCliTest,
@@ -51,6 +53,8 @@ exports.hux = {
51
53
  confirm: confirm_1.confirm,
52
54
  prompt: prompt_1.prompt,
53
55
  styledHeader: styled_header_1.styledHeader,
54
- styledJson: styled_json_1.styledJson,
56
+ styledJSON: styled_json_1.styledJSON,
55
57
  styledObject: styled_object_1.styledObject,
58
+ table: table_1.table,
59
+ wait: wait_1.wait,
56
60
  };
@@ -1 +1 @@
1
- export declare function styledJson(obj: unknown): void;
1
+ export declare function styledJSON(obj: unknown): void;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.styledJson = styledJson;
3
+ exports.styledJSON = styledJSON;
4
4
  const core_1 = require("@oclif/core");
5
- function styledJson(obj) {
5
+ function styledJSON(obj) {
6
6
  return core_1.ux.styledJSON(obj);
7
7
  }
@@ -1,2 +1,2 @@
1
1
  import { ux } from '@oclif/core';
2
- export declare function table<T extends Record<string, unknown>>(data: T[], columns: Parameters<typeof ux.table>[1], options?: Parameters<typeof ux.table>[2]): void;
2
+ export declare function table(data: Record<string, unknown>[], columns: ux.Table.table.Columns<Record<string, unknown>>, options?: ux.Table.table.Options): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "commonjs",
3
3
  "name": "@heroku/heroku-cli-util",
4
- "version": "9.0.0",
4
+ "version": "9.0.1-beta.1",
5
5
  "description": "Set of helpful CLI utilities",
6
6
  "author": "Heroku",
7
7
  "license": "ISC",