@teambit/cli-table 0.0.49 → 0.0.51

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.
@@ -2,7 +2,7 @@ export declare class CLITable {
2
2
  private headers;
3
3
  private body;
4
4
  private options?;
5
- constructor(headers: any, body: string[][], options?: Record<string, any>);
5
+ constructor(headers: any, body: string[][], options?: Record<string, any> | undefined);
6
6
  render(): string;
7
7
  /**
8
8
  * sort by the first column
package/dist/cli-table.js CHANGED
@@ -1,45 +1,64 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
6
  exports.CLITable = void 0;
7
- const cli_table_1 = __importDefault(require("cli-table"));
8
- const colors_1 = __importDefault(require("colors"));
7
+ function _cliTable() {
8
+ const data = _interopRequireDefault(require("cli-table"));
9
+ _cliTable = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _colors() {
15
+ const data = _interopRequireDefault(require("colors"));
16
+ _colors = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
22
  class CLITable {
10
- constructor(headers, body, options) {
11
- this.headers = headers;
12
- this.body = body;
13
- this.options = options;
14
- }
15
- render() {
16
- const table = new cli_table_1.default({ head: this.headers, style: { border: ['grey'] } });
17
- this.body.map((value) => {
18
- var _a;
19
- const color = colors_1.default[(_a = this.options) === null || _a === void 0 ? void 0 : _a.color] || colors_1.default.cyan;
20
- value[0] = color(value[0]);
21
- return table.push(value);
22
- });
23
- return table.toString();
24
- }
25
- /**
26
- * sort by the first column
27
- */
28
- sort() {
29
- this.body.sort((a, b) => {
30
- const aValue = a[0];
31
- const bValue = b[0];
32
- if (aValue < bValue)
33
- return -1;
34
- if (aValue > bValue)
35
- return 1;
36
- return 0;
37
- });
38
- }
39
- static fromObject(header, data) {
40
- const headers = Object.values(header).map((d) => colors_1.default.cyan(d.value));
41
- return new CLITable(headers, data.map((value) => Object.values(value)), { color: 'white' });
42
- }
23
+ constructor(headers, body, options) {
24
+ this.headers = headers;
25
+ this.body = body;
26
+ this.options = options;
27
+ }
28
+ render() {
29
+ const table = new (_cliTable().default)({
30
+ head: this.headers,
31
+ style: {
32
+ border: ['grey']
33
+ }
34
+ });
35
+ this.body.map(value => {
36
+ const color = _colors().default[this.options?.color] || _colors().default.cyan;
37
+ value[0] = color(value[0]);
38
+ return table.push(value);
39
+ });
40
+ return table.toString();
41
+ }
42
+
43
+ /**
44
+ * sort by the first column
45
+ */
46
+ sort() {
47
+ this.body.sort((a, b) => {
48
+ const aValue = a[0];
49
+ const bValue = b[0];
50
+ if (aValue < bValue) return -1;
51
+ if (aValue > bValue) return 1;
52
+ return 0;
53
+ });
54
+ }
55
+ static fromObject(header, data) {
56
+ const headers = Object.values(header).map(d => _colors().default.cyan(d.value));
57
+ return new CLITable(headers, data.map(value => Object.values(value)), {
58
+ color: 'white'
59
+ });
60
+ }
43
61
  }
44
62
  exports.CLITable = CLITable;
63
+
45
64
  //# sourceMappingURL=cli-table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-table.js","sourceRoot":"","sources":["../cli-table.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA8B;AAC9B,oDAA4B;AAE5B,MAAa,QAAQ;IACnB,YACU,OAAY,EACZ,IAAgB,EAChB,OAA6B;QAF7B,YAAO,GAAP,OAAO,CAAK;QACZ,SAAI,GAAJ,IAAI,CAAY;QAChB,YAAO,GAAP,OAAO,CAAsB;IACpC,CAAC;IAEJ,MAAM;QACJ,MAAM,KAAK,GAAG,IAAI,mBAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,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
1
+ {"version":3,"names":["_cliTable","data","_interopRequireDefault","require","_colors","e","__esModule","default","CLITable","constructor","headers","body","options","render","table","Table","head","style","border","map","value","color","colors","cyan","push","toString","sort","a","b","aValue","bValue","fromObject","header","Object","values","d","exports"],"sources":["cli-table.ts"],"sourcesContent":["import Table from 'cli-table';\nimport colors from 'colors';\n\nexport class CLITable {\n constructor(\n private headers: any,\n private body: string[][],\n private options?: Record<string, any>\n ) {}\n\n render(): string {\n const table = new Table({ head: this.headers, style: { border: ['grey'] } });\n this.body.map((value) => {\n const color = colors[this.options?.color] || colors.cyan;\n value[0] = color(value[0]);\n return table.push(value);\n });\n return table.toString();\n }\n\n /**\n * sort by the first column\n */\n sort() {\n this.body.sort((a, b) => {\n const aValue = a[0];\n const bValue = b[0];\n if (aValue < bValue) return -1;\n if (aValue > bValue) return 1;\n return 0;\n });\n }\n\n static fromObject(header: { value: string }[], data: Record<string, string>[]) {\n const headers = Object.values(header).map((d) => colors.cyan(d.value));\n return new CLITable(\n headers,\n data.map((value) => Object.values(value)),\n { color: 'white' }\n );\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4B,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAErB,MAAMG,QAAQ,CAAC;EACpBC,WAAWA,CACDC,OAAY,EACZC,IAAgB,EAChBC,OAA6B,EACrC;IAAA,KAHQF,OAAY,GAAZA,OAAY;IAAA,KACZC,IAAgB,GAAhBA,IAAgB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KAAK,IAAKa,MAAM,CAACC,MAAM,CAACd,KAAK,CAAC,CAAC,EACzC;MAAEC,KAAK,EAAE;IAAQ,CACnB,CAAC;EACH;AACF;AAACe,OAAA,CAAA5B,QAAA,GAAAA,QAAA","ignoreList":[]}
package/dist/index.js CHANGED
@@ -1,6 +1,20 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CLITable = void 0;
4
- var cli_table_1 = require("./cli-table");
5
- Object.defineProperty(exports, "CLITable", { enumerable: true, get: function () { return cli_table_1.CLITable; } });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "CLITable", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _cliTable().CLITable;
10
+ }
11
+ });
12
+ function _cliTable() {
13
+ const data = require("./cli-table");
14
+ _cliTable = function () {
15
+ return data;
16
+ };
17
+ return data;
18
+ }
19
+
6
20
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA"}
1
+ {"version":3,"names":["_cliTable","data","require"],"sources":["index.ts"],"sourcesContent":["export { CLITable } from './cli-table';\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/cli-table",
3
- "version": "0.0.49",
3
+ "version": "0.0.51",
4
4
  "homepage": "https://bit.cloud/teambit/toolbox/cli-table",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.toolbox",
8
8
  "name": "cli-table",
9
- "version": "0.0.49"
9
+ "version": "0.0.51"
10
10
  },
11
11
  "dependencies": {
12
12
  "cli-table": "0.3.6",
@@ -14,12 +14,32 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@types/cli-table": "^0.3.0",
17
- "@types/jest": "26.0.20",
18
- "@types/node": "12.20.4",
19
- "@babel/runtime": "7.20.0"
17
+ "chai": "5.2.1",
18
+ "@teambit/node.envs.node-babel-mocha": "0.2.10"
20
19
  },
21
20
  "peerDependencies": {},
22
- "license": "SEE LICENSE IN UNLICENSED",
21
+ "license": "Apache-2.0",
23
22
  "optionalDependencies": {},
24
- "peerDependenciesMeta": {}
23
+ "peerDependenciesMeta": {},
24
+ "exports": {
25
+ ".": {
26
+ "types": "./index.ts",
27
+ "require": "./dist/index.js",
28
+ "import": "./dist/esm.mjs"
29
+ }
30
+ },
31
+ "private": false,
32
+ "engines": {
33
+ "node": ">=16.0.0"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "https://github.com/teambit/bit"
38
+ },
39
+ "keywords": [
40
+ "bit",
41
+ "components",
42
+ "collaboration",
43
+ "web"
44
+ ]
25
45
  }
package/types/asset.d.ts CHANGED
@@ -5,12 +5,12 @@ declare module '*.png' {
5
5
  declare module '*.svg' {
6
6
  import type { FunctionComponent, SVGProps } from 'react';
7
7
 
8
- export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
8
+ export const ReactComponent: FunctionComponent<
9
+ SVGProps<SVGSVGElement> & { title?: string }
10
+ >;
9
11
  const src: string;
10
12
  export default src;
11
13
  }
12
-
13
- // @TODO Gilad
14
14
  declare module '*.jpg' {
15
15
  const value: any;
16
16
  export = value;
@@ -27,3 +27,15 @@ declare module '*.bmp' {
27
27
  const value: any;
28
28
  export = value;
29
29
  }
30
+ declare module '*.otf' {
31
+ const value: any;
32
+ export = value;
33
+ }
34
+ declare module '*.woff' {
35
+ const value: any;
36
+ export = value;
37
+ }
38
+ declare module '*.woff2' {
39
+ const value: any;
40
+ export = value;
41
+ }
@@ -1,7 +0,0 @@
1
- ;
2
- ;
3
-
4
- export const compositions = [];
5
- export const overview = [];
6
-
7
- export const compositions_metadata = {"compositions":[]};