@gravirei/reis 1.1.8 → 1.2.0

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 (3) hide show
  1. package/bin/reis.js +12 -30
  2. package/lib/install.js +17 -38
  3. package/package.json +1 -1
package/bin/reis.js CHANGED
@@ -259,32 +259,21 @@ program.action(async () => {
259
259
  console.log('');
260
260
 
261
261
  if (reinstall) {
262
- console.log(chalk.cyan(' Reinstalling to ~/.rovodev/reis/\n'));
263
-
264
- // Perform installation directly
262
+ // Perform installation directly with overwrite
265
263
  const { performInstallation } = require('../lib/install.js');
266
- await performInstallation();
264
+ await performInstallation(true, true); // overwrite=true, silent=true
267
265
 
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'));
266
+ console.log(chalk.green(' āœ“ REIS reinstalled successfully'));
267
+ console.log(chalk.white(` Run ${chalk.cyan('reis help')} to get started\n`));
272
268
  } else {
273
269
  console.log(chalk.cyan(' Keeping existing installation\n'));
274
270
  console.log(chalk.green(' āœ“ Using existing documentation'));
275
271
  console.log(chalk.green(' āœ“ Using existing templates'));
276
272
  console.log(chalk.green(' āœ“ Using existing subagents'));
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'));
273
+ console.log(chalk.green(` āœ“ Current VERSION (${packageJson.version})`));
274
+ console.log(chalk.white(`\n Run ${chalk.cyan('reis help')} to get started\n`));
281
275
  }
282
276
 
283
- // Show completion message
284
- console.log(chalk.bold.green(' šŸŽ‰ Congratulations! ') + chalk.white('REIS is now in your system.'));
285
- console.log(chalk.white(' Open Atlassian Rovo Dev and try: ') + chalk.cyan('use reis_planner') + chalk.white(' or ') + chalk.cyan('use reis_executor'));
286
- console.log(chalk.white('\n For help, run: ') + chalk.cyan('npx @gravirei/reis help\n'));
287
-
288
277
  } catch (err) {
289
278
  // If inquirer fails (non-interactive), just show help
290
279
  console.log(chalk.gray(' Non-interactive mode - showing help...\n'));
@@ -314,30 +303,23 @@ program.action(async () => {
314
303
  return;
315
304
  }
316
305
 
317
- console.log(chalk.cyan(' Installing to ~/.rovodev/reis/\n'));
318
-
319
306
  // Perform installation directly
320
307
  const { performInstallation } = require('../lib/install.js');
321
- await performInstallation();
308
+ await performInstallation(false, true); // overwrite=false, silent=true
322
309
 
323
- // Show completion message
324
- console.log(chalk.bold.green('\n šŸŽ‰ Congratulations! ') + chalk.white('REIS is now in your system.'));
325
- console.log(chalk.white(' Open Atlassian Rovo Dev and try: ') + chalk.cyan('use reis_planner') + chalk.white(' or ') + chalk.cyan('use reis_executor'));
326
- console.log(chalk.white('\n For help, run: ') + chalk.cyan('npx @gravirei/reis help\n'));
310
+ console.log(chalk.green(' āœ“ REIS installed successfully'));
311
+ console.log(chalk.white(` Run ${chalk.cyan('reis help')} to get started\n`));
327
312
 
328
313
  } catch (err) {
329
314
  // inquirer failed, auto-install as default
330
315
  console.log(chalk.gray(' Non-interactive mode - installing automatically...\n'));
331
- console.log(chalk.cyan(' Installing to ~/.rovodev/reis/\n'));
332
316
 
333
317
  // Perform installation directly
334
318
  const { performInstallation } = require('../lib/install.js');
335
- await performInstallation();
319
+ await performInstallation(false, true); // overwrite=false, silent=true
336
320
 
337
- // Show completion message
338
- console.log(chalk.bold.green('\n šŸŽ‰ Congratulations! ') + chalk.white('REIS is now in your system.'));
339
- console.log(chalk.white(' Open Atlassian Rovo Dev and try: ') + chalk.cyan('use reis_planner') + chalk.white(' or ') + chalk.cyan('use reis_executor'));
340
- console.log(chalk.white('\n For help, run: ') + chalk.cyan('npx @gravirei/reis help\n'));
321
+ console.log(chalk.green(' āœ“ REIS installed successfully'));
322
+ console.log(chalk.white(` Run ${chalk.cyan('reis help')} to get started\n`));
341
323
  }
342
324
  }
343
325
  });
package/lib/install.js CHANGED
@@ -86,7 +86,7 @@ async function install() {
86
86
  }
87
87
 
88
88
  // Perform the actual installation
89
- async function performInstallation() {
89
+ async function performInstallation(overwrite = false, silent = false) {
90
90
  const homeDir = os.homedir();
91
91
 
92
92
  // Define target directories
@@ -94,30 +94,23 @@ 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);
119
112
  const dest = path.join(reisDir, file);
120
- if (copyFile(src, dest)) {
113
+ if (copyFile(src, dest, overwrite)) {
121
114
  fileCount++;
122
115
  }
123
116
  });
@@ -126,27 +119,27 @@ 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
- const count = copyDirectory(templatesSourceDir, templatesDir);
122
+ const count = copyDirectory(templatesSourceDir, templatesDir, overwrite);
131
123
  fileCount += count;
132
124
  }
133
125
 
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);
141
132
  const dest = path.join(subagentsDir, file);
142
- if (copyFile(src, dest)) {
133
+ if (copyFile(src, dest, overwrite)) {
143
134
  fileCount++;
144
135
  }
145
136
  });
146
137
  }
147
138
 
148
- // Success message and next steps
149
- showSuccessMessage(fileCount, reisDir, templatesDir, subagentsDir);
139
+ // Success message and next steps (only when called standalone)
140
+ if (!silent) {
141
+ showSuccessMessage(fileCount, reisDir, templatesDir, subagentsDir);
142
+ }
150
143
  }
151
144
 
152
145
  // Ensure directory exists
@@ -161,7 +154,7 @@ function ensureDir(dir) {
161
154
  }
162
155
 
163
156
  // Copy a single file
164
- function copyFile(src, dest) {
157
+ function copyFile(src, dest, overwrite = false) {
165
158
  try {
166
159
  // Check if source exists
167
160
  if (!fs.existsSync(src)) {
@@ -178,9 +171,8 @@ function copyFile(src, dest) {
178
171
  const destDir = path.dirname(dest);
179
172
  ensureDir(destDir);
180
173
 
181
- // Skip if file already exists (idempotent)
182
- if (fs.existsSync(dest)) {
183
- // Optionally update if source is newer, but for now just skip
174
+ // Skip if file already exists (unless overwrite is true)
175
+ if (fs.existsSync(dest) && !overwrite) {
184
176
  return false;
185
177
  }
186
178
 
@@ -195,7 +187,7 @@ function copyFile(src, dest) {
195
187
  }
196
188
 
197
189
  // Copy a directory recursively
198
- function copyDirectory(srcDir, destDir) {
190
+ function copyDirectory(srcDir, destDir, overwrite = false) {
199
191
  let count = 0;
200
192
 
201
193
  try {
@@ -217,10 +209,10 @@ function copyDirectory(srcDir, destDir) {
217
209
 
218
210
  if (entry.isDirectory()) {
219
211
  // Recursively copy subdirectory
220
- count += copyDirectory(srcPath, destPath);
212
+ count += copyDirectory(srcPath, destPath, overwrite);
221
213
  } else {
222
214
  // Copy file
223
- if (copyFile(srcPath, destPath)) {
215
+ if (copyFile(srcPath, destPath, overwrite)) {
224
216
  count++;
225
217
  }
226
218
  }
@@ -236,22 +228,9 @@ function copyDirectory(srcDir, destDir) {
236
228
 
237
229
  // Show success message with next steps
238
230
  function showSuccessMessage(fileCount, reisDir, templatesDir, subagentsDir) {
239
- console.log(chalk.green.bold('\nāœ“ REIS installed successfully!\n'));
240
-
241
- console.log(chalk.white.bold('šŸ“ Files installed to:'));
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('');
231
+ console.log(chalk.green('\nāœ“ Installation complete\n'));
232
+ console.log(chalk.white(` Installed ${fileCount} files to ~/.rovodev/`));
233
+ console.log(chalk.white(` Run ${chalk.cyan('reis help')} to get started\n`));
255
234
  }
256
235
 
257
236
  // Run installation if called directly
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravirei/reis",
3
- "version": "1.1.8",
3
+ "version": "1.2.0",
4
4
  "description": "Roadmap Execution & Implementation System - Systematic development with parallel subagent execution for Atlassian Rovo Dev",
5
5
  "main": "lib/index.js",
6
6
  "bin": {