@gravirei/reis 2.3.2 → 2.3.3

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/bin/reis.js CHANGED
@@ -310,11 +310,13 @@ program
310
310
  await treeCmd(subcommand, args, options);
311
311
  });
312
312
 
313
+ const updateCmd = require('../lib/commands/update.js');
314
+
313
315
  program
314
316
  .command('update')
315
317
  .description('Update REIS to latest version')
316
- .action(() => {
317
- console.log('Command coming soon in Phase 5-8');
318
+ .action(async () => {
319
+ await updateCmd({});
318
320
  });
319
321
 
320
322
  program
@@ -1,15 +1,75 @@
1
- const { showInfo, getVersion } = require('../utils/command-helpers.js');
1
+ const { showInfo, showSuccess, showError, showWarning, getVersion } = require('../utils/command-helpers.js');
2
+ const { execSync } = require('child_process');
2
3
 
3
4
  /**
4
- * Update command - check for REIS updates
5
+ * Update command - check for and install REIS updates
5
6
  * @param {Object} args - {}
6
7
  */
7
- module.exports = function(args) {
8
- const version = getVersion();
8
+ module.exports = async function(args) {
9
+ const currentVersion = getVersion();
10
+ const packageName = '@gravirei/reis';
9
11
 
10
- showInfo('Checking for REIS updates...');
11
- showInfo(`Current version: ${version}`);
12
- showInfo('');
13
- showInfo('To update: npm update -g reis');
14
- showInfo('(If installed via npx, it will automatically use latest)');
12
+ console.log('');
13
+ showInfo('🔍 Checking for REIS updates...');
14
+ console.log('');
15
+ showInfo(` Current version: v${currentVersion}`);
16
+
17
+ try {
18
+ // Check latest version from npm
19
+ const latestVersion = execSync(`npm view ${packageName} version 2>/dev/null`, {
20
+ encoding: 'utf-8'
21
+ }).trim();
22
+
23
+ showInfo(` Latest version: v${latestVersion}`);
24
+ console.log('');
25
+
26
+ if (currentVersion === latestVersion) {
27
+ showSuccess('✅ You are already on the latest version!');
28
+ console.log('');
29
+ return 0;
30
+ }
31
+
32
+ // New version available
33
+ showWarning(`📦 New version available: v${currentVersion} → v${latestVersion}`);
34
+ console.log('');
35
+ showInfo(' Updating REIS...');
36
+ console.log('');
37
+
38
+ try {
39
+ // Try global update
40
+ execSync(`npm install -g ${packageName}@latest`, {
41
+ stdio: 'inherit',
42
+ encoding: 'utf-8'
43
+ });
44
+
45
+ console.log('');
46
+ showSuccess(`✅ Successfully updated to v${latestVersion}!`);
47
+ console.log('');
48
+ showInfo(' Run "reis whats-new" to see what\'s changed.');
49
+ console.log('');
50
+
51
+ } catch (installError) {
52
+ // If global install fails, suggest manual update
53
+ console.log('');
54
+ showError('❌ Automatic update failed (may need sudo/admin privileges)');
55
+ console.log('');
56
+ showInfo(' Try manually:');
57
+ showInfo(` $ sudo npm install -g ${packageName}@latest`);
58
+ showInfo(' or');
59
+ showInfo(` $ npm install -g ${packageName}@latest --force`);
60
+ console.log('');
61
+ return 1;
62
+ }
63
+
64
+ } catch (error) {
65
+ showError('❌ Failed to check for updates');
66
+ showInfo(' Check your internet connection and try again.');
67
+ console.log('');
68
+ showInfo(' Manual update:');
69
+ showInfo(` $ npm install -g ${packageName}@latest`);
70
+ console.log('');
71
+ return 1;
72
+ }
73
+
74
+ return 0;
15
75
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravirei/reis",
3
- "version": "2.3.2",
3
+ "version": "2.3.3",
4
4
  "description": "Roadmap Execution & Implementation System v2.0 - Wave-based execution with checkpoints, metrics, and visualization for Atlassian Rovo Dev",
5
5
  "main": "lib/index.js",
6
6
  "bin": {