@commitguard/cli 0.0.3 → 0.0.13
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/index.d.mts +0 -0
- package/dist/index.mjs +14 -13
- package/package.json +13 -11
package/dist/index.d.mts
CHANGED
|
File without changes
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
2
|
import process from "node:process";
|
|
4
3
|
import { consola } from "consola";
|
|
5
4
|
import updateNotifier from "update-notifier";
|
|
@@ -10,19 +9,15 @@ import { Entry } from "@napi-rs/keyring";
|
|
|
10
9
|
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
11
10
|
import { homedir } from "node:os";
|
|
12
11
|
import { dirname, join } from "node:path";
|
|
12
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
13
13
|
import { readFile } from "node:fs/promises";
|
|
14
|
-
import { pathToFileURL } from "node:url";
|
|
15
14
|
import { findUp } from "find-up";
|
|
16
15
|
import { FlatCache } from "flat-cache";
|
|
17
16
|
import stringWidth from "string-width";
|
|
18
17
|
import "dotenv/config";
|
|
19
18
|
|
|
20
|
-
//#region rolldown:runtime
|
|
21
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
19
|
//#region package.json
|
|
25
|
-
var version = "0.0.
|
|
20
|
+
var version = "0.0.13";
|
|
26
21
|
var package_default = {
|
|
27
22
|
name: "@commitguard/cli",
|
|
28
23
|
type: "module",
|
|
@@ -31,7 +26,7 @@ var package_default = {
|
|
|
31
26
|
license: "MIT",
|
|
32
27
|
repository: {
|
|
33
28
|
"type": "git",
|
|
34
|
-
"url": "git+https://github.com/
|
|
29
|
+
"url": "git+https://github.com/commitguard/cli.git"
|
|
35
30
|
},
|
|
36
31
|
exports: {
|
|
37
32
|
".": "./dist/index.mjs",
|
|
@@ -49,7 +44,8 @@ var package_default = {
|
|
|
49
44
|
"typecheck": "tsc --noEmit",
|
|
50
45
|
"prepublishOnly": "pnpm run build",
|
|
51
46
|
"lint": "eslint .",
|
|
52
|
-
"lint:fix": "eslint . --fix"
|
|
47
|
+
"lint:fix": "eslint . --fix",
|
|
48
|
+
"release": "pnpm typecheck && bumpp --tag --push --publish && npm publish"
|
|
53
49
|
},
|
|
54
50
|
dependencies: {
|
|
55
51
|
"@clack/prompts": "^0.11.0",
|
|
@@ -741,7 +737,7 @@ async function installHooks() {
|
|
|
741
737
|
}
|
|
742
738
|
log.info("Installing CommitGuard...");
|
|
743
739
|
const node = process.execPath.replace(/\\/g, "/");
|
|
744
|
-
const cliPath =
|
|
740
|
+
const cliPath = fileURLToPath(import.meta.url).replace(/\\/g, "/");
|
|
745
741
|
writeFileSync(COMMIT_MSG_HOOK_PATH, `#!/bin/sh
|
|
746
742
|
${COMMITGUARD_MARKER}
|
|
747
743
|
# Auto-generated - do not edit manually
|
|
@@ -790,9 +786,14 @@ fi
|
|
|
790
786
|
|
|
791
787
|
exit 0
|
|
792
788
|
`, { mode: 493 });
|
|
793
|
-
log.info("
|
|
794
|
-
|
|
795
|
-
|
|
789
|
+
log.info("Checking ESLint configuration...");
|
|
790
|
+
try {
|
|
791
|
+
const eslintRules = await getEslintRules({ overrideCache: true });
|
|
792
|
+
if (Object.keys(eslintRules.rules).length > 0) log.success("ESLint configuration loaded.");
|
|
793
|
+
else log.info("No ESLint rules detected.");
|
|
794
|
+
} catch {
|
|
795
|
+
log.warn("Failed to load ESLint configuration.");
|
|
796
|
+
}
|
|
796
797
|
if (!getGlobalKey() && process.env.COMMITGUARD_API_KEY === void 0) {
|
|
797
798
|
if (await confirm({
|
|
798
799
|
message: "No global API key found. Do you want to set it now?",
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commitguard/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.13",
|
|
5
5
|
"description": "AI-powered git commit checker that blocks bad code before it ships",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/
|
|
9
|
+
"url": "git+https://github.com/commitguard/cli.git"
|
|
10
10
|
},
|
|
11
11
|
"exports": {
|
|
12
12
|
".": "./dist/index.mjs",
|
|
@@ -21,6 +21,16 @@
|
|
|
21
21
|
"files": [
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsdown",
|
|
26
|
+
"dev": "tsdown --watch",
|
|
27
|
+
"test": "vitest",
|
|
28
|
+
"typecheck": "tsc --noEmit",
|
|
29
|
+
"prepublishOnly": "pnpm run build",
|
|
30
|
+
"lint": "eslint .",
|
|
31
|
+
"lint:fix": "eslint . --fix",
|
|
32
|
+
"release": "pnpm typecheck && bumpp --tag --push --publish && npm publish"
|
|
33
|
+
},
|
|
24
34
|
"dependencies": {
|
|
25
35
|
"@clack/prompts": "^0.11.0",
|
|
26
36
|
"@napi-rs/keyring": "^1.2.0",
|
|
@@ -42,13 +52,5 @@
|
|
|
42
52
|
"tsdown": "^0.18.3",
|
|
43
53
|
"typescript": "^5.9.3",
|
|
44
54
|
"vitest": "^4.0.16"
|
|
45
|
-
},
|
|
46
|
-
"scripts": {
|
|
47
|
-
"build": "tsdown",
|
|
48
|
-
"dev": "tsdown --watch",
|
|
49
|
-
"test": "vitest",
|
|
50
|
-
"typecheck": "tsc --noEmit",
|
|
51
|
-
"lint": "eslint .",
|
|
52
|
-
"lint:fix": "eslint . --fix"
|
|
53
55
|
}
|
|
54
|
-
}
|
|
56
|
+
}
|