@gravirei/reis 1.1.7 → 1.1.9
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 +26 -37
- package/lib/install.js +3 -25
- package/package.json +1 -1
package/bin/reis.js
CHANGED
|
@@ -243,42 +243,41 @@ program.action(async () => {
|
|
|
243
243
|
|
|
244
244
|
if (isInstalled) {
|
|
245
245
|
console.log(chalk.yellow(' ⚠️ REIS is already installed at ~/.rovodev/reis/\n'));
|
|
246
|
-
console.log(chalk.white(' What would you like to do?\n'));
|
|
247
|
-
console.log(chalk.white(' 1) Keep existing installation'));
|
|
248
|
-
console.log(chalk.white(' 2) Reinstall (replace existing files)\n'));
|
|
249
246
|
|
|
250
247
|
// Use inquirer for simple input prompt
|
|
251
248
|
const inquirer = require('inquirer');
|
|
252
249
|
try {
|
|
253
|
-
const {
|
|
250
|
+
const { reinstall } = await inquirer.prompt([
|
|
254
251
|
{
|
|
255
|
-
type: '
|
|
256
|
-
name: '
|
|
257
|
-
message: '
|
|
258
|
-
default:
|
|
259
|
-
validate: (input) => {
|
|
260
|
-
if (input === '1' || input === '2') {
|
|
261
|
-
return true;
|
|
262
|
-
}
|
|
263
|
-
return 'Please enter 1 or 2';
|
|
264
|
-
}
|
|
252
|
+
type: 'confirm',
|
|
253
|
+
name: 'reinstall',
|
|
254
|
+
message: 'Reinstall and replace existing files?',
|
|
255
|
+
default: false
|
|
265
256
|
}
|
|
266
257
|
]);
|
|
267
258
|
|
|
268
259
|
console.log('');
|
|
269
260
|
|
|
270
|
-
if (
|
|
271
|
-
console.log(chalk.cyan('
|
|
261
|
+
if (reinstall) {
|
|
262
|
+
console.log(chalk.cyan(' Reinstalling to ~/.rovodev/reis/\n'));
|
|
272
263
|
|
|
273
264
|
// Perform installation directly
|
|
274
265
|
const { performInstallation } = require('../lib/install.js');
|
|
275
266
|
await performInstallation();
|
|
267
|
+
|
|
268
|
+
// Show completion message
|
|
269
|
+
console.log(chalk.bold.green('\n 🎉 REIS has been reinstalled successfully!'));
|
|
270
|
+
console.log(chalk.white(' Open Atlassian Rovo Dev and try: ') + chalk.cyan('use reis_planner') + chalk.white(' or ') + chalk.cyan('use reis_executor'));
|
|
271
|
+
console.log(chalk.white('\n For help, run: ') + chalk.cyan('npx @gravirei/reis help\n'));
|
|
276
272
|
} else {
|
|
277
273
|
console.log(chalk.cyan(' Keeping existing installation\n'));
|
|
278
274
|
console.log(chalk.green(' ✓ Using existing documentation'));
|
|
279
275
|
console.log(chalk.green(' ✓ Using existing templates'));
|
|
280
276
|
console.log(chalk.green(' ✓ Using existing subagents'));
|
|
281
277
|
console.log(chalk.green(` ✓ Current VERSION (${packageJson.version})\n`));
|
|
278
|
+
|
|
279
|
+
// Show help
|
|
280
|
+
console.log(chalk.white(' For help, run: ') + chalk.cyan('npx @gravirei/reis help\n'));
|
|
282
281
|
}
|
|
283
282
|
|
|
284
283
|
// Show completion message
|
|
@@ -295,32 +294,22 @@ program.action(async () => {
|
|
|
295
294
|
} else {
|
|
296
295
|
// First-time installation
|
|
297
296
|
console.log(chalk.green(' REIS is not installed yet.\n'));
|
|
298
|
-
console.log(chalk.white(' What would you like to do?\n'));
|
|
299
|
-
console.log(chalk.white(' 1) Install REIS'));
|
|
300
|
-
console.log(chalk.white(' 2) Cancel\n'));
|
|
301
|
-
|
|
302
|
-
let choice = '1';
|
|
303
297
|
|
|
298
|
+
// Use inquirer for simple input prompt
|
|
299
|
+
const inquirer = require('inquirer');
|
|
304
300
|
try {
|
|
305
|
-
const
|
|
301
|
+
const { confirm } = await inquirer.prompt([
|
|
306
302
|
{
|
|
307
|
-
type: '
|
|
308
|
-
name: '
|
|
309
|
-
message: '
|
|
310
|
-
default:
|
|
311
|
-
validate: (input) => {
|
|
312
|
-
if (input === '1' || input === '2') {
|
|
313
|
-
return true;
|
|
314
|
-
}
|
|
315
|
-
return 'Please enter 1 or 2';
|
|
316
|
-
}
|
|
303
|
+
type: 'confirm',
|
|
304
|
+
name: 'confirm',
|
|
305
|
+
message: 'Proceed with installation?',
|
|
306
|
+
default: true
|
|
317
307
|
}
|
|
318
308
|
]);
|
|
319
309
|
|
|
320
|
-
choice = result.choice;
|
|
321
310
|
console.log('');
|
|
322
311
|
|
|
323
|
-
if (
|
|
312
|
+
if (!confirm) {
|
|
324
313
|
console.log(chalk.yellow(' Installation cancelled\n'));
|
|
325
314
|
return;
|
|
326
315
|
}
|
|
@@ -332,12 +321,12 @@ program.action(async () => {
|
|
|
332
321
|
await performInstallation();
|
|
333
322
|
|
|
334
323
|
// Show completion message
|
|
335
|
-
console.log(chalk.bold.green(' 🎉 Congratulations! ') + chalk.white('REIS is now in your system.'));
|
|
324
|
+
console.log(chalk.bold.green('\n 🎉 Congratulations! ') + chalk.white('REIS is now in your system.'));
|
|
336
325
|
console.log(chalk.white(' Open Atlassian Rovo Dev and try: ') + chalk.cyan('use reis_planner') + chalk.white(' or ') + chalk.cyan('use reis_executor'));
|
|
337
326
|
console.log(chalk.white('\n For help, run: ') + chalk.cyan('npx @gravirei/reis help\n'));
|
|
338
327
|
|
|
339
328
|
} catch (err) {
|
|
340
|
-
// inquirer failed, auto-install as default
|
|
329
|
+
// inquirer failed, auto-install as default
|
|
341
330
|
console.log(chalk.gray(' Non-interactive mode - installing automatically...\n'));
|
|
342
331
|
console.log(chalk.cyan(' Installing to ~/.rovodev/reis/\n'));
|
|
343
332
|
|
|
@@ -346,7 +335,7 @@ program.action(async () => {
|
|
|
346
335
|
await performInstallation();
|
|
347
336
|
|
|
348
337
|
// Show completion message
|
|
349
|
-
console.log(chalk.bold.green(' 🎉 Congratulations! ') + chalk.white('REIS is now in your system.'));
|
|
338
|
+
console.log(chalk.bold.green('\n 🎉 Congratulations! ') + chalk.white('REIS is now in your system.'));
|
|
350
339
|
console.log(chalk.white(' Open Atlassian Rovo Dev and try: ') + chalk.cyan('use reis_planner') + chalk.white(' or ') + chalk.cyan('use reis_executor'));
|
|
351
340
|
console.log(chalk.white('\n For help, run: ') + chalk.cyan('npx @gravirei/reis help\n'));
|
|
352
341
|
}
|
package/lib/install.js
CHANGED
|
@@ -94,25 +94,18 @@ async function performInstallation() {
|
|
|
94
94
|
const templatesDir = path.join(reisDir, 'templates');
|
|
95
95
|
const subagentsDir = path.join(homeDir, '.rovodev', 'subagents');
|
|
96
96
|
|
|
97
|
-
console.log(chalk.cyan('📁 Creating directories...'));
|
|
98
|
-
|
|
99
97
|
// Create directories
|
|
100
98
|
ensureDir(reisDir);
|
|
101
99
|
ensureDir(templatesDir);
|
|
102
100
|
ensureDir(subagentsDir);
|
|
103
101
|
|
|
104
|
-
console.log(chalk.green('✓ Directories created\n'));
|
|
105
|
-
|
|
106
102
|
// Copy files
|
|
107
|
-
console.log(chalk.cyan('📦 Installing files...'));
|
|
108
|
-
|
|
109
103
|
const packageDir = path.join(__dirname, '..');
|
|
110
104
|
let fileCount = 0;
|
|
111
105
|
|
|
112
106
|
// Copy documentation files from docs/ to ~/.rovodev/reis/
|
|
113
107
|
const docsDir = path.join(packageDir, 'docs');
|
|
114
108
|
if (fs.existsSync(docsDir)) {
|
|
115
|
-
console.log(chalk.gray(' Copying documentation...'));
|
|
116
109
|
const docFiles = fs.readdirSync(docsDir);
|
|
117
110
|
docFiles.forEach(file => {
|
|
118
111
|
const src = path.join(docsDir, file);
|
|
@@ -126,7 +119,6 @@ async function performInstallation() {
|
|
|
126
119
|
// Copy templates from templates/ to ~/.rovodev/reis/templates/
|
|
127
120
|
const templatesSourceDir = path.join(packageDir, 'templates');
|
|
128
121
|
if (fs.existsSync(templatesSourceDir)) {
|
|
129
|
-
console.log(chalk.gray(' Copying templates...'));
|
|
130
122
|
const count = copyDirectory(templatesSourceDir, templatesDir);
|
|
131
123
|
fileCount += count;
|
|
132
124
|
}
|
|
@@ -134,7 +126,6 @@ async function performInstallation() {
|
|
|
134
126
|
// Copy subagents from subagents/ to ~/.rovodev/subagents/
|
|
135
127
|
const subagentsSourceDir = path.join(packageDir, 'subagents');
|
|
136
128
|
if (fs.existsSync(subagentsSourceDir)) {
|
|
137
|
-
console.log(chalk.gray(' Copying subagents...'));
|
|
138
129
|
const subagentFiles = fs.readdirSync(subagentsSourceDir);
|
|
139
130
|
subagentFiles.forEach(file => {
|
|
140
131
|
const src = path.join(subagentsSourceDir, file);
|
|
@@ -236,22 +227,9 @@ function copyDirectory(srcDir, destDir) {
|
|
|
236
227
|
|
|
237
228
|
// Show success message with next steps
|
|
238
229
|
function showSuccessMessage(fileCount, reisDir, templatesDir, subagentsDir) {
|
|
239
|
-
console.log(chalk.green
|
|
240
|
-
|
|
241
|
-
console.log(chalk.white.
|
|
242
|
-
console.log(chalk.cyan(` • Documentation: ${reisDir}/`));
|
|
243
|
-
console.log(chalk.cyan(` • Templates: ${templatesDir}/`));
|
|
244
|
-
console.log(chalk.cyan(` • Subagents: ${subagentsDir}/`));
|
|
245
|
-
console.log(chalk.gray(` (${fileCount} files total)\n`));
|
|
246
|
-
|
|
247
|
-
console.log(chalk.white.bold('🚀 Get started:'));
|
|
248
|
-
console.log(chalk.cyan(' reis help ') + chalk.gray('# Show all commands'));
|
|
249
|
-
console.log(chalk.cyan(' reis new [your idea] ') + chalk.gray('# Start a new project'));
|
|
250
|
-
console.log(chalk.cyan(' reis map ') + chalk.gray('# Map existing codebase'));
|
|
251
|
-
console.log('');
|
|
252
|
-
|
|
253
|
-
console.log(chalk.white.bold('📖 Documentation: ') + chalk.cyan(path.join(reisDir, 'README.md')));
|
|
254
|
-
console.log('');
|
|
230
|
+
console.log(chalk.green('\n✓ Installation complete\n'));
|
|
231
|
+
console.log(chalk.white(` Installed ${fileCount} files to ~/.rovodev/`));
|
|
232
|
+
console.log(chalk.white(` Run ${chalk.cyan('reis help')} to get started\n`));
|
|
255
233
|
}
|
|
256
234
|
|
|
257
235
|
// Run installation if called directly
|
package/package.json
CHANGED