@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.
- package/dist/cli-table.d.ts +1 -1
- package/dist/cli-table.js +58 -39
- package/dist/cli-table.js.map +1 -1
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/package.json +27 -7
- package/types/asset.d.ts +15 -3
- package/dist/preview-1728236174539.js +0 -7
package/dist/cli-table.d.ts
CHANGED
|
@@ -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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
6
|
exports.CLITable = void 0;
|
|
7
|
-
|
|
8
|
-
const
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
package/dist/cli-table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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,OA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CAAC,CAACf,KAAK,CAAC,CAAC;IACtE,OAAO,IAAIZ,QAAQ,CACjBE,OAAO,EACPT,IAAI,CAACkB,GAAG,CAAEC,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
|
-
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
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,"
|
|
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.
|
|
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.
|
|
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
|
-
"
|
|
18
|
-
"@
|
|
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": "
|
|
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<
|
|
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
|
+
}
|