qkpr 1.0.1 → 1.0.2

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.
Files changed (2) hide show
  1. package/dist/index.mjs +12 -6
  2. package/package.json +41 -44
package/dist/index.mjs CHANGED
@@ -1514,14 +1514,22 @@ async function checkForUpdates(packageName$1, currentVersion) {
1514
1514
  "pipe",
1515
1515
  "ignore"
1516
1516
  ],
1517
- timeout: 3e3
1517
+ timeout: 5e3
1518
1518
  }).trim();
1519
+ const hasUpdate = compareVersions(currentVersion, latestVersion) < 0;
1520
+ if (process.env.DEBUG_QKPR_UPDATE) {
1521
+ console.log(`[DEBUG] Package: ${packageName$1}`);
1522
+ console.log(`[DEBUG] Current: ${currentVersion}`);
1523
+ console.log(`[DEBUG] Latest: ${latestVersion}`);
1524
+ console.log(`[DEBUG] Has update: ${hasUpdate}`);
1525
+ }
1519
1526
  return {
1520
- hasUpdate: compareVersions(currentVersion, latestVersion) < 0,
1527
+ hasUpdate,
1521
1528
  currentVersion,
1522
1529
  latestVersion
1523
1530
  };
1524
- } catch {
1531
+ } catch (error) {
1532
+ if (process.env.DEBUG_QKPR_UPDATE) console.log(`[DEBUG] Update check failed: ${error instanceof Error ? error.message : "Unknown error"}`);
1525
1533
  return {
1526
1534
  hasUpdate: false,
1527
1535
  currentVersion,
@@ -1700,6 +1708,7 @@ async function showSettingsMenu() {
1700
1708
  }
1701
1709
  }
1702
1710
  async function showMainMenu() {
1711
+ await checkAndNotifyUpdate(packageName, version);
1703
1712
  console.log(bold(cyan("\n╔══════════════════════════════════════════════════════════════╗")));
1704
1713
  console.log(bold(cyan("║ 🚀 Quick PR Tool ║")));
1705
1714
  console.log(bold(cyan("║ ║")));
@@ -1750,17 +1759,14 @@ async function showMainMenu() {
1750
1759
  switch (feature) {
1751
1760
  case "pr":
1752
1761
  await handlePRCommand();
1753
- await checkAndNotifyUpdate(packageName, version);
1754
1762
  await showMainMenu();
1755
1763
  break;
1756
1764
  case "commit":
1757
1765
  await handleCommitCommand();
1758
- await checkAndNotifyUpdate(packageName, version);
1759
1766
  await showMainMenu();
1760
1767
  break;
1761
1768
  case "branch":
1762
1769
  await handleBranchCommand();
1763
- await checkAndNotifyUpdate(packageName, version);
1764
1770
  await showMainMenu();
1765
1771
  break;
1766
1772
  case "pinned":
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "qkpr",
3
3
  "type": "module",
4
- "version": "1.0.1",
5
- "packageManager": "pnpm@10.20.0",
4
+ "version": "1.0.2",
6
5
  "description": "Create a Pull Request with interactive branch selection",
7
6
  "author": "KazooTTT <work@kazoottt.top>",
8
7
  "license": "MIT",
@@ -33,11 +32,48 @@
33
32
  "files": [
34
33
  "dist"
35
34
  ],
35
+ "dependencies": {
36
+ "@google/generative-ai": "^0.24.1",
37
+ "inquirer": "^9.2.20",
38
+ "inquirer-autocomplete-prompt": "^3.0.1",
39
+ "inquirer-search-checkbox": "^1.0.0",
40
+ "is-ip": "^5.0.1",
41
+ "kolorist": "^1.8.0",
42
+ "open": "^8.4.2",
43
+ "ora": "^9.0.0",
44
+ "yargs": "^17.7.2"
45
+ },
46
+ "devDependencies": {
47
+ "@antfu/eslint-config": "^6.2.0",
48
+ "@antfu/ni": "^27.0.1",
49
+ "@antfu/utils": "^9.3.0",
50
+ "@types/inquirer": "^9.0.7",
51
+ "@types/inquirer-autocomplete-prompt": "^3.0.3",
52
+ "@types/node": "^24.10.0",
53
+ "@types/yargs": "^17.0.32",
54
+ "bumpp": "^10.3.1",
55
+ "eslint": "^9.39.1",
56
+ "lint-staged": "^16.2.6",
57
+ "simple-git-hooks": "^2.13.1",
58
+ "tinyexec": "^1.0.2",
59
+ "tsdown": "^0.16.0",
60
+ "tsx": "^4.20.6",
61
+ "typescript": "^5.9.3",
62
+ "vite": "^7.2.1",
63
+ "vitest": "^4.0.7",
64
+ "vitest-package-exports": "^0.1.1",
65
+ "yaml": "^2.8.1"
66
+ },
67
+ "simple-git-hooks": {
68
+ "pre-commit": "pnpm i --frozen-lockfile --ignore-scripts --offline && npx lint-staged"
69
+ },
70
+ "lint-staged": {
71
+ "*": "eslint --fix"
72
+ },
36
73
  "scripts": {
37
74
  "build": "tsdown",
38
75
  "dev": "tsdown --watch",
39
76
  "lint": "eslint",
40
- "prepublishOnly": "nr build",
41
77
  "release": "bumpp",
42
78
  "release:next": "bumpp next --yes",
43
79
  "release:patch": "bumpp patch --yes",
@@ -45,45 +81,6 @@
45
81
  "release:major": "bumpp major --yes",
46
82
  "start": "tsx src/index.ts",
47
83
  "test": "vitest",
48
- "typecheck": "tsc",
49
- "prepare": "simple-git-hooks"
50
- },
51
- "dependencies": {
52
- "@google/generative-ai": "catalog:prod",
53
- "inquirer": "catalog:prod",
54
- "inquirer-autocomplete-prompt": "catalog:prod",
55
- "inquirer-search-checkbox": "catalog:prod",
56
- "is-ip": "catalog:prod",
57
- "kolorist": "catalog:prod",
58
- "open": "catalog:prod",
59
- "ora": "catalog:prod",
60
- "yargs": "catalog:prod"
61
- },
62
- "devDependencies": {
63
- "@antfu/eslint-config": "catalog:lint",
64
- "@antfu/ni": "catalog:script",
65
- "@antfu/utils": "catalog:inlined",
66
- "@types/inquirer": "catalog:types",
67
- "@types/inquirer-autocomplete-prompt": "catalog:types",
68
- "@types/node": "catalog:types",
69
- "@types/yargs": "catalog:types",
70
- "bumpp": "catalog:script",
71
- "eslint": "catalog:lint",
72
- "lint-staged": "catalog:script",
73
- "simple-git-hooks": "catalog:script",
74
- "tinyexec": "catalog:script",
75
- "tsdown": "catalog:build",
76
- "tsx": "catalog:script",
77
- "typescript": "catalog:build",
78
- "vite": "catalog:build",
79
- "vitest": "catalog:test",
80
- "vitest-package-exports": "catalog:test",
81
- "yaml": "catalog:test"
82
- },
83
- "simple-git-hooks": {
84
- "pre-commit": "pnpm i --frozen-lockfile --ignore-scripts --offline && npx lint-staged"
85
- },
86
- "lint-staged": {
87
- "*": "eslint --fix"
84
+ "typecheck": "tsc"
88
85
  }
89
- }
86
+ }