@kaiord/cli 0.1.1 → 2.0.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/LICENSE +21 -0
- package/README.md +96 -63
- package/dist/bin/kaiord.js +1338 -549
- package/dist/package.json +3 -0
- package/package.json +24 -23
- package/dist/chunk-TI3WVGXE.js +0 -10
- package/dist/pretty-logger-P2OWMOGW.js +0 -58
- package/dist/structured-logger-HMEQGEES.js +0 -37
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaiord/cli",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Command-line interface for Kaiord workout file conversion",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,17 +11,6 @@
|
|
|
11
11
|
"README.md",
|
|
12
12
|
"LICENSE"
|
|
13
13
|
],
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "tsup",
|
|
16
|
-
"test": "vitest run",
|
|
17
|
-
"test:unit": "vitest run --exclude '**/*-{integration,smoke,snapshot}.test.ts'",
|
|
18
|
-
"test:integration": "vitest run src/commands/convert-integration.test.ts src/commands/validate-integration.test.ts",
|
|
19
|
-
"test:smoke": "vitest run src/tests/cli-smoke.test.ts",
|
|
20
|
-
"test:watch": "vitest",
|
|
21
|
-
"dev": "tsx src/bin/kaiord.ts",
|
|
22
|
-
"prepublishOnly": "pnpm build && pnpm test",
|
|
23
|
-
"check-licenses": "license-checker --onlyAllow 'MIT;Apache-2.0;BSD;BSD-2-Clause;BSD-3-Clause;ISC' --production"
|
|
24
|
-
},
|
|
25
14
|
"keywords": [
|
|
26
15
|
"kaiord",
|
|
27
16
|
"fit",
|
|
@@ -37,34 +26,46 @@
|
|
|
37
26
|
"license": "MIT",
|
|
38
27
|
"repository": {
|
|
39
28
|
"type": "git",
|
|
40
|
-
"url": "https://github.com/
|
|
29
|
+
"url": "https://github.com/pablo-albaladejo/kaiord.git",
|
|
41
30
|
"directory": "packages/cli"
|
|
42
31
|
},
|
|
43
32
|
"homepage": "https://www.npmjs.com/package/@kaiord/cli",
|
|
44
33
|
"bugs": {
|
|
45
|
-
"url": "https://github.com/
|
|
34
|
+
"url": "https://github.com/pablo-albaladejo/kaiord/issues"
|
|
46
35
|
},
|
|
47
36
|
"publishConfig": {
|
|
48
37
|
"access": "public"
|
|
49
38
|
},
|
|
50
39
|
"dependencies": {
|
|
51
|
-
"@kaiord/core": "workspace:*",
|
|
52
40
|
"chalk": "^5.3.0",
|
|
53
|
-
"glob": "
|
|
54
|
-
"ora": "^
|
|
41
|
+
"glob": ">=11.1.0",
|
|
42
|
+
"ora": "^9.1.0",
|
|
55
43
|
"winston": "^3.11.0",
|
|
56
|
-
"yargs": "^
|
|
57
|
-
"zod": "^3.22.4"
|
|
44
|
+
"yargs": "^18.0.0",
|
|
45
|
+
"zod": "^3.22.4",
|
|
46
|
+
"@kaiord/all": "^2.0.1",
|
|
47
|
+
"@kaiord/core": "^2.0.1"
|
|
58
48
|
},
|
|
59
49
|
"devDependencies": {
|
|
60
50
|
"@types/yargs": "^17.0.32",
|
|
61
|
-
"execa": "^
|
|
51
|
+
"execa": "^9.6.1",
|
|
62
52
|
"license-checker": "^25.0.1",
|
|
63
53
|
"strip-ansi": "^7.1.0",
|
|
64
54
|
"tmp-promise": "^3.0.3",
|
|
65
|
-
"tsup": "^8.
|
|
55
|
+
"tsup": "^8.5.1",
|
|
66
56
|
"tsx": "^4.7.0",
|
|
67
57
|
"typescript": "^5.3.3",
|
|
68
|
-
"vitest": "^
|
|
58
|
+
"vitest": "^4.0.18"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "tsup",
|
|
62
|
+
"test": "pnpm build && vitest run",
|
|
63
|
+
"test:unit": "vitest run --exclude '**/*-{integration,smoke,snapshot}.test.ts'",
|
|
64
|
+
"test:integration": "pnpm build && vitest run src/commands/convert-integration.test.ts src/commands/validate-integration.test.ts",
|
|
65
|
+
"test:smoke": "pnpm build && vitest run src/tests/cli-smoke.test.ts",
|
|
66
|
+
"test:watch": "vitest",
|
|
67
|
+
"dev": "tsx src/bin/kaiord.ts",
|
|
68
|
+
"prebuild": "echo 'Building CLI...'",
|
|
69
|
+
"check-licenses": "license-checker --onlyAllow 'MIT;Apache-2.0;BSD;BSD-2-Clause;BSD-3-Clause;ISC' --production"
|
|
69
70
|
}
|
|
70
|
-
}
|
|
71
|
+
}
|
package/dist/chunk-TI3WVGXE.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
isTTY
|
|
4
|
-
} from "./chunk-TI3WVGXE.js";
|
|
5
|
-
|
|
6
|
-
// src/adapters/logger/pretty-logger.ts
|
|
7
|
-
import chalk from "chalk";
|
|
8
|
-
var createPrettyLogger = (options = {}) => {
|
|
9
|
-
const level = options.level || "info";
|
|
10
|
-
const quiet = options.quiet || false;
|
|
11
|
-
const forceColor = process.env.FORCE_COLOR === "1";
|
|
12
|
-
const useColors = isTTY() || forceColor;
|
|
13
|
-
const levels = ["debug", "info", "warn", "error"];
|
|
14
|
-
const minLevelIndex = levels.indexOf(level);
|
|
15
|
-
const shouldLog = (messageLevel) => {
|
|
16
|
-
if (quiet && messageLevel !== "error") {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
const messageLevelIndex = levels.indexOf(messageLevel);
|
|
20
|
-
return messageLevelIndex >= minLevelIndex;
|
|
21
|
-
};
|
|
22
|
-
const formatContext = (context) => {
|
|
23
|
-
if (!context || Object.keys(context).length === 0) {
|
|
24
|
-
return "";
|
|
25
|
-
}
|
|
26
|
-
const contextStr = JSON.stringify(context);
|
|
27
|
-
return " " + (useColors ? chalk.gray(contextStr) : contextStr);
|
|
28
|
-
};
|
|
29
|
-
return {
|
|
30
|
-
debug: (message, context) => {
|
|
31
|
-
if (shouldLog("debug")) {
|
|
32
|
-
const formatted = `\u{1F41B} ${message}${formatContext(context)}`;
|
|
33
|
-
console.log(useColors ? chalk.gray(formatted) : formatted);
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
info: (message, context) => {
|
|
37
|
-
if (shouldLog("info")) {
|
|
38
|
-
const formatted = `\u2139 ${message}${formatContext(context)}`;
|
|
39
|
-
console.log(useColors ? chalk.blue(formatted) : formatted);
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
warn: (message, context) => {
|
|
43
|
-
if (shouldLog("warn")) {
|
|
44
|
-
const formatted = `\u26A0 ${message}${formatContext(context)}`;
|
|
45
|
-
console.warn(useColors ? chalk.yellow(formatted) : formatted);
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
error: (message, context) => {
|
|
49
|
-
if (shouldLog("error")) {
|
|
50
|
-
const formatted = `\u2716 ${message}${formatContext(context)}`;
|
|
51
|
-
console.error(useColors ? chalk.red(formatted) : formatted);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
export {
|
|
57
|
-
createPrettyLogger
|
|
58
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/adapters/logger/structured-logger.ts
|
|
4
|
-
import winston from "winston";
|
|
5
|
-
var createStructuredLogger = (options = {}) => {
|
|
6
|
-
const level = options.level || "info";
|
|
7
|
-
const quiet = options.quiet || false;
|
|
8
|
-
const winstonLogger = winston.createLogger({
|
|
9
|
-
level: quiet ? "error" : level,
|
|
10
|
-
format: winston.format.combine(
|
|
11
|
-
winston.format.timestamp(),
|
|
12
|
-
winston.format.json()
|
|
13
|
-
),
|
|
14
|
-
transports: [
|
|
15
|
-
new winston.transports.Console({
|
|
16
|
-
stderrLevels: ["error", "warn", "info", "debug"]
|
|
17
|
-
})
|
|
18
|
-
]
|
|
19
|
-
});
|
|
20
|
-
return {
|
|
21
|
-
debug: (message, context) => {
|
|
22
|
-
winstonLogger.debug(message, context);
|
|
23
|
-
},
|
|
24
|
-
info: (message, context) => {
|
|
25
|
-
winstonLogger.info(message, context);
|
|
26
|
-
},
|
|
27
|
-
warn: (message, context) => {
|
|
28
|
-
winstonLogger.warn(message, context);
|
|
29
|
-
},
|
|
30
|
-
error: (message, context) => {
|
|
31
|
-
winstonLogger.error(message, context);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
createStructuredLogger
|
|
37
|
-
};
|