@commitguard/cli 0.0.15 → 0.0.17

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 CHANGED
File without changes
package/dist/index.mjs CHANGED
@@ -17,7 +17,7 @@ import stringWidth from "string-width";
17
17
  import "dotenv/config";
18
18
 
19
19
  //#region package.json
20
- var version = "0.0.15";
20
+ var version = "0.0.17";
21
21
  var package_default = {
22
22
  name: "@commitguard/cli",
23
23
  type: "module",
@@ -374,6 +374,7 @@ async function sendToCommitGuard(diff, eslint, config$1) {
374
374
  const errorText = await response.text();
375
375
  let errorMessage = "Failed to analyze commit";
376
376
  if (response.status === 401) errorMessage = "Invalid API key. Check your key with \"commitguard keys\" or get a new one at https://commitguard.ai";
377
+ else if (response.status === 402) errorMessage = "You’ve reached your plan limit. Upgrade now with 20% off using code SAVE20 at checkout: https://commitguard.ai/dashboard";
377
378
  else if (response.status === 429) errorMessage = "Rate limit exceeded. Please try again later";
378
379
  else if (response.status === 500) errorMessage = "CommitGuard service error. Please try again later";
379
380
  else if (response.status >= 400 && response.status < 500) errorMessage = `Request error: ${errorText || "Invalid request"}`;
@@ -942,7 +943,12 @@ async function onStaged() {
942
943
  analysis: response
943
944
  });
944
945
  } catch (error) {
945
- consola.error("Analysis failed:", error);
946
+ const message = error instanceof Error ? error.message : String(error);
947
+ if (process.stdout.isTTY) consola.box({
948
+ title: "Analysis Failed",
949
+ message
950
+ });
951
+ else consola.log(message);
946
952
  }
947
953
  }
948
954
  function getCachedAnalysis(diff, diffHash) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commitguard/cli",
3
3
  "type": "module",
4
- "version": "0.0.15",
4
+ "version": "0.0.17",
5
5
  "description": "AI-powered git commit checker that blocks bad code before it ships",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -21,16 +21,6 @@
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
- },
34
24
  "dependencies": {
35
25
  "@clack/prompts": "^0.11.0",
36
26
  "@napi-rs/keyring": "^1.2.0",
@@ -52,5 +42,14 @@
52
42
  "tsdown": "^0.18.3",
53
43
  "typescript": "^5.9.3",
54
44
  "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
+ "release": "pnpm typecheck && bumpp --tag --push --publish && npm publish"
55
54
  }
56
- }
55
+ }