simple-ascii-chart-cli 1.2.0 → 2.0.0
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.js +17 -7
- package/dist/tests/cli.test.js +8 -7
- package/dist/validators.d.ts +1 -1
- package/package.json +11 -11
package/dist/cli.js
CHANGED
|
@@ -27,13 +27,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
27
27
|
}) : function(o, v) {
|
|
28
28
|
o["default"] = v;
|
|
29
29
|
});
|
|
30
|
-
var __importStar = (this && this.__importStar) || function (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
37
47
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
38
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
39
49
|
};
|
package/dist/tests/cli.test.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
var child_process_1 = require("child_process");
|
|
7
|
+
var path_1 = __importDefault(require("path"));
|
|
8
|
+
var cliPath = path_1.default.resolve(__dirname, '../../dist/cli.js'); // <-- LOCAL build output
|
|
9
|
+
function execPlotterScript(args, callback) {
|
|
10
|
+
(0, child_process_1.exec)("node ".concat(cliPath, " ").concat(args), callback);
|
|
11
|
+
}
|
|
4
12
|
describe('plotter script', function () {
|
|
5
|
-
// @ts-expect-error tests
|
|
6
|
-
var execPlotterScript = function (args, callback) {
|
|
7
|
-
(0, child_process_1.exec)("node node_modules/simple-ascii-chart/dist/cli.js ".concat(args), callback);
|
|
8
|
-
};
|
|
9
13
|
it('should require the --input option', function (done) {
|
|
10
|
-
// @ts-expect-error tests
|
|
11
14
|
execPlotterScript('', function (error, stdout, stderr) {
|
|
12
15
|
expect(stderr).toContain('Missing required argument: input');
|
|
13
16
|
done();
|
|
@@ -19,7 +22,6 @@ describe('plotter script', function () {
|
|
|
19
22
|
[2, 2],
|
|
20
23
|
[3, 3],
|
|
21
24
|
]);
|
|
22
|
-
// @ts-expect-error tests
|
|
23
25
|
execPlotterScript("--input '".concat(validInput, "'"), function (error, stdout, stderr) {
|
|
24
26
|
expect(error).toBeNull();
|
|
25
27
|
expect(stderr).toBe('');
|
|
@@ -29,7 +31,6 @@ describe('plotter script', function () {
|
|
|
29
31
|
});
|
|
30
32
|
it('should handle invalid JSON input gracefully', function (done) {
|
|
31
33
|
var invalidInput = '[ invalid json';
|
|
32
|
-
// @ts-expect-error tests
|
|
33
34
|
execPlotterScript("--input '".concat(invalidInput, "'"), function (error, stdout, stderr) {
|
|
34
35
|
expect(stderr).toContain('Oops! Something went wrong!');
|
|
35
36
|
done();
|
package/dist/validators.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Colors, CustomSymbol, Formatter, Legend, LineFormatterArgs, MaybePoint, Symbols, Threshold } from 'simple-ascii-chart
|
|
1
|
+
import { Colors, CustomSymbol, Formatter, Legend, LineFormatterArgs, MaybePoint, Symbols, Threshold } from 'simple-ascii-chart';
|
|
2
2
|
export declare const validateAxisCenter: (axisCenter: (string | number)[] | undefined) => MaybePoint;
|
|
3
3
|
export declare const validateColors: (colors: (string | number)[] | string | undefined) => Colors | undefined;
|
|
4
4
|
export declare const validateYRange: (yRange: (string | number)[] | undefined) => [number, number] | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "simple-ascii-chart-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Simple ascii chart generator CLI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,17 +19,17 @@
|
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/jest": "^29.5.14",
|
|
22
|
-
"@types/node": "^22.
|
|
23
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
24
|
-
"@typescript-eslint/parser": "^8.
|
|
25
|
-
"eslint": "^9.
|
|
26
|
-
"eslint-config-prettier": "^
|
|
22
|
+
"@types/node": "^22.15.17",
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "^8.32.0",
|
|
24
|
+
"@typescript-eslint/parser": "^8.32.0",
|
|
25
|
+
"eslint": "^9.26.0",
|
|
26
|
+
"eslint-config-prettier": "^10.1.5",
|
|
27
27
|
"eslint-plugin-import": "^2.31.0",
|
|
28
28
|
"jest": "^29.7.0",
|
|
29
|
-
"prettier": "^3.
|
|
30
|
-
"ts-jest": "^29.2
|
|
31
|
-
"tsc-watch": "^6.2.
|
|
32
|
-
"typescript": "^5.
|
|
29
|
+
"prettier": "^3.5.3",
|
|
30
|
+
"ts-jest": "^29.3.2",
|
|
31
|
+
"tsc-watch": "^6.2.1",
|
|
32
|
+
"typescript": "^5.8.3"
|
|
33
33
|
},
|
|
34
34
|
"keywords": [
|
|
35
35
|
"ascii",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dist/**/*"
|
|
53
53
|
],
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"simple-ascii-chart": "^
|
|
55
|
+
"simple-ascii-chart": "^5.0.0",
|
|
56
56
|
"yargs": "^17.7.2"
|
|
57
57
|
}
|
|
58
58
|
}
|