@snapcommit/cli 1.0.6 → 1.0.7
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.js +5 -2
- package/dist/repl.js +13 -0
- package/dist/utils/version.js +4 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28,8 +28,11 @@ const program = new commander_1.Command();
|
|
|
28
28
|
// Check for updates (async, non-blocking)
|
|
29
29
|
(0, version_1.checkForUpdates)().then((result) => {
|
|
30
30
|
if (result && result.hasUpdate) {
|
|
31
|
-
console.log(chalk_1.default.yellow(
|
|
32
|
-
console.log(chalk_1.default.
|
|
31
|
+
console.log(chalk_1.default.yellow.bold('\n╔════════════════════════════════════════╗'));
|
|
32
|
+
console.log(chalk_1.default.yellow.bold('║ 🚀 UPDATE AVAILABLE! ║'));
|
|
33
|
+
console.log(chalk_1.default.yellow.bold('╚════════════════════════════════════════╝'));
|
|
34
|
+
console.log(chalk_1.default.white(` Current: ${chalk_1.default.red(result.currentVersion)} → Latest: ${chalk_1.default.green(result.latestVersion)}`));
|
|
35
|
+
console.log(chalk_1.default.cyan(' Update now: ') + chalk_1.default.white('npm install -g @snapcommit/cli@latest\n'));
|
|
33
36
|
}
|
|
34
37
|
}).catch(() => {
|
|
35
38
|
// Silent fail
|
package/dist/repl.js
CHANGED
|
@@ -12,6 +12,7 @@ const quick_1 = require("./commands/quick");
|
|
|
12
12
|
const stats_1 = require("./commands/stats");
|
|
13
13
|
const github_connect_1 = require("./commands/github-connect");
|
|
14
14
|
const repo_manager_1 = require("./utils/repo-manager");
|
|
15
|
+
const version_1 = require("./utils/version");
|
|
15
16
|
/**
|
|
16
17
|
* Start SnapCommit REPL (Read-Eval-Print-Loop)
|
|
17
18
|
* Interactive mode for natural language Git commands
|
|
@@ -29,6 +30,18 @@ async function startREPL() {
|
|
|
29
30
|
process.exit(1);
|
|
30
31
|
}
|
|
31
32
|
console.log(chalk_1.default.green(`✅ Logged in as ${chalk_1.default.bold(authConfig.email)}\n`));
|
|
33
|
+
// Check for updates (non-blocking)
|
|
34
|
+
(0, version_1.checkForUpdates)().then(updateInfo => {
|
|
35
|
+
if (updateInfo && updateInfo.hasUpdate) {
|
|
36
|
+
console.log(chalk_1.default.yellow.bold('╔════════════════════════════════════════╗'));
|
|
37
|
+
console.log(chalk_1.default.yellow.bold('║ 🚀 UPDATE AVAILABLE! ║'));
|
|
38
|
+
console.log(chalk_1.default.yellow.bold('╚════════════════════════════════════════╝'));
|
|
39
|
+
console.log(chalk_1.default.white(` Current: ${chalk_1.default.red(updateInfo.currentVersion)} → Latest: ${chalk_1.default.green(updateInfo.latestVersion)}\n`));
|
|
40
|
+
console.log(chalk_1.default.cyan(' Update now: ') + chalk_1.default.white('npm install -g @snapcommit/cli@latest\n'));
|
|
41
|
+
}
|
|
42
|
+
}).catch(() => {
|
|
43
|
+
// Silent fail - don't interrupt user experience
|
|
44
|
+
});
|
|
32
45
|
// Check GitHub connection status
|
|
33
46
|
const githubConnected = (0, github_connect_1.isGitHubConnected)();
|
|
34
47
|
if (githubConnected) {
|
package/dist/utils/version.js
CHANGED
|
@@ -33,7 +33,7 @@ async function checkForUpdates() {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
// Fetch latest version from npm
|
|
36
|
-
const latestVersion = await getLatestVersionFromNpm('snapcommit');
|
|
36
|
+
const latestVersion = await getLatestVersionFromNpm('@snapcommit/cli');
|
|
37
37
|
// Update cache
|
|
38
38
|
const newCache = {
|
|
39
39
|
lastCheck: Date.now(),
|
|
@@ -53,7 +53,9 @@ async function checkForUpdates() {
|
|
|
53
53
|
}
|
|
54
54
|
function getLatestVersionFromNpm(packageName) {
|
|
55
55
|
return new Promise((resolve, reject) => {
|
|
56
|
-
|
|
56
|
+
// Encode package name for URL (handles scoped packages like @snapcommit/cli)
|
|
57
|
+
const encodedName = packageName.replace('/', '%2F');
|
|
58
|
+
https_1.default.get(`https://registry.npmjs.org/${encodedName}/latest`, (res) => {
|
|
57
59
|
let data = '';
|
|
58
60
|
res.on('data', (chunk) => data += chunk);
|
|
59
61
|
res.on('end', () => {
|