rampup 0.1.11 ā 0.1.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/index.js +85 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -28,7 +28,55 @@ const execAsync = promisify(exec);
|
|
|
28
28
|
const __filename = fileURLToPath(import.meta.url);
|
|
29
29
|
const __dirname = path.dirname(__filename);
|
|
30
30
|
|
|
31
|
-
const VERSION = '0.1.
|
|
31
|
+
const VERSION = '0.1.13';
|
|
32
|
+
const PACKAGE_NAME = 'rampup';
|
|
33
|
+
|
|
34
|
+
// Check for updates and auto-update if available
|
|
35
|
+
async function checkForUpdates() {
|
|
36
|
+
try {
|
|
37
|
+
// Check npm registry for latest version
|
|
38
|
+
const response = await fetch(`https://registry.npmjs.org/${PACKAGE_NAME}/latest`);
|
|
39
|
+
if (!response.ok) return;
|
|
40
|
+
|
|
41
|
+
const data = await response.json();
|
|
42
|
+
const latestVersion = data.version;
|
|
43
|
+
|
|
44
|
+
if (latestVersion && latestVersion !== VERSION) {
|
|
45
|
+
// Compare versions
|
|
46
|
+
const current = VERSION.split('.').map(Number);
|
|
47
|
+
const latest = latestVersion.split('.').map(Number);
|
|
48
|
+
|
|
49
|
+
const isNewer = latest[0] > current[0] ||
|
|
50
|
+
(latest[0] === current[0] && latest[1] > current[1]) ||
|
|
51
|
+
(latest[0] === current[0] && latest[1] === current[1] && latest[2] > current[2]);
|
|
52
|
+
|
|
53
|
+
if (isNewer) {
|
|
54
|
+
console.log(chalk.yellow(`\nš¦ Update available: ${VERSION} ā ${latestVersion}`));
|
|
55
|
+
console.log(chalk.dim(` Run: npm i -g ${PACKAGE_NAME}\n`));
|
|
56
|
+
|
|
57
|
+
// Auto-update option (uncomment to enable)
|
|
58
|
+
// console.log(chalk.dim(' Updating automatically...'));
|
|
59
|
+
// await execAsync(`npm i -g ${PACKAGE_NAME}`);
|
|
60
|
+
// console.log(chalk.green(' ā Updated! Please restart ramp.\n'));
|
|
61
|
+
// process.exit(0);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
} catch {
|
|
65
|
+
// Silently fail - don't block CLI usage
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Run update check in background (non-blocking)
|
|
70
|
+
checkForUpdates();
|
|
71
|
+
|
|
72
|
+
// Show deprecation notice
|
|
73
|
+
console.log(chalk.yellow('\nā ļø The Ramp CLI is being deprecated.'));
|
|
74
|
+
console.log(chalk.white(' For the best experience, use the web app at:'));
|
|
75
|
+
console.log(chalk.cyan(' https://app.rampup.dev/codebase/view\n'));
|
|
76
|
+
console.log(chalk.dim(' The web app offers:'));
|
|
77
|
+
console.log(chalk.dim(' ⢠Voice chat with full code context visible'));
|
|
78
|
+
console.log(chalk.dim(' ⢠Better file navigation and search'));
|
|
79
|
+
console.log(chalk.dim(' ⢠Real-time code highlighting\n'));
|
|
32
80
|
|
|
33
81
|
// ASCII art banner
|
|
34
82
|
const banner = `
|
|
@@ -2040,6 +2088,42 @@ program
|
|
|
2040
2088
|
console.log(chalk.green(`ā Logged out from ${user.email}\n`));
|
|
2041
2089
|
});
|
|
2042
2090
|
|
|
2091
|
+
program
|
|
2092
|
+
.command('update')
|
|
2093
|
+
.description('Update Ramp CLI to the latest version')
|
|
2094
|
+
.action(async () => {
|
|
2095
|
+
console.log(banner);
|
|
2096
|
+
console.log(chalk.bold.blue('š¦ Updating Ramp CLI\n'));
|
|
2097
|
+
|
|
2098
|
+
const spinner = ora('Checking for updates...').start();
|
|
2099
|
+
|
|
2100
|
+
try {
|
|
2101
|
+
// Check npm registry for latest version
|
|
2102
|
+
const response = await fetch(`https://registry.npmjs.org/${PACKAGE_NAME}/latest`);
|
|
2103
|
+
if (!response.ok) throw new Error('Failed to check npm registry');
|
|
2104
|
+
|
|
2105
|
+
const data = await response.json();
|
|
2106
|
+
const latestVersion = data.version;
|
|
2107
|
+
|
|
2108
|
+
if (latestVersion === VERSION) {
|
|
2109
|
+
spinner.succeed(`Already on latest version (${VERSION})\n`);
|
|
2110
|
+
return;
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
spinner.text = `Updating ${VERSION} ā ${latestVersion}...`;
|
|
2114
|
+
|
|
2115
|
+
// Run npm update
|
|
2116
|
+
await execAsync(`npm i -g ${PACKAGE_NAME}@latest`);
|
|
2117
|
+
|
|
2118
|
+
spinner.succeed(`Updated to ${latestVersion}!\n`);
|
|
2119
|
+
console.log(chalk.green('Please restart ramp to use the new version.\n'));
|
|
2120
|
+
} catch (error) {
|
|
2121
|
+
spinner.fail('Update failed');
|
|
2122
|
+
console.error(chalk.red(`Error: ${error.message}`));
|
|
2123
|
+
console.log(chalk.dim(`\nTry manually: npm i -g ${PACKAGE_NAME}\n`));
|
|
2124
|
+
}
|
|
2125
|
+
});
|
|
2126
|
+
|
|
2043
2127
|
program
|
|
2044
2128
|
.command('whoami')
|
|
2045
2129
|
.description('Show current logged in user')
|