@comfanion/workflow 3.4.0 → 3.5.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.
package/bin/cli.js CHANGED
@@ -18,7 +18,7 @@ const program = new Command();
18
18
  program
19
19
  .name('create-opencode-workflow')
20
20
  .description('Initialize OpenCode Workflow system for AI-assisted development')
21
- .version('3.0.0');
21
+ .version('3.5.0');
22
22
 
23
23
  program
24
24
  .command('init')
@@ -29,7 +29,7 @@ program
29
29
  .option('--stub', 'Use STUB methodology')
30
30
  .option('--full', 'Create full repo structure')
31
31
  .action(async (options) => {
32
- console.log(chalk.blue.bold('\nšŸš€ OpenCode Workflow v3.0\n'));
32
+ console.log(chalk.blue.bold('\nšŸš€ OpenCode Workflow v3.5\n'));
33
33
 
34
34
  let config = {
35
35
  user_name: 'Developer',
@@ -273,7 +273,8 @@ program
273
273
  program
274
274
  .command('update')
275
275
  .description('Update .opencode/ to latest version (preserves config.yaml)')
276
- .action(async () => {
276
+ .option('--no-backup', 'Skip creating backup')
277
+ .action(async (options) => {
277
278
  const spinner = ora('Updating OpenCode Workflow...').start();
278
279
 
279
280
  try {
@@ -285,18 +286,39 @@ program
285
286
  }
286
287
 
287
288
  const configPath = path.join(targetDir, 'config.yaml');
289
+ const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19);
290
+ const backupDir = path.join(process.cwd(), `.opencode.backup-${timestamp}`);
288
291
 
289
- // Backup config
292
+ // Backup config.yaml content
293
+ spinner.text = 'Reading config.yaml...';
290
294
  const configBackup = await fs.readFile(configPath, 'utf8');
291
295
 
296
+ // Create full backup (unless --no-backup)
297
+ if (options.backup !== false) {
298
+ spinner.text = 'Creating backup...';
299
+ await fs.copy(targetDir, backupDir);
300
+ }
301
+
302
+ // Remove old .opencode directory completely
303
+ spinner.text = 'Removing old files...';
304
+ await fs.remove(targetDir);
305
+
292
306
  // Copy new files
293
- await fs.copy(OPENCODE_SRC, targetDir, { overwrite: true });
307
+ spinner.text = 'Installing new version...';
308
+ await fs.copy(OPENCODE_SRC, targetDir);
294
309
 
295
- // Restore config
310
+ // Restore user's config.yaml
311
+ spinner.text = 'Restoring config.yaml...';
296
312
  await fs.writeFile(configPath, configBackup);
297
313
 
298
314
  spinner.succeed(chalk.green('OpenCode Workflow updated!'));
299
- console.log(chalk.yellow('\nāœ… Your config.yaml was preserved.\n'));
315
+
316
+ if (options.backup !== false) {
317
+ console.log(chalk.yellow(`\nšŸ“¦ Backup created: ${chalk.cyan(`.opencode.backup-${timestamp}/`)}`));
318
+ console.log(chalk.gray(' You can delete it after verifying the update works.\n'));
319
+ }
320
+
321
+ console.log(chalk.green('āœ… Your config.yaml was preserved.\n'));
300
322
 
301
323
  } catch (error) {
302
324
  spinner.fail(chalk.red('Failed to update'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comfanion/workflow",
3
- "version": "3.4.0",
3
+ "version": "3.5.0",
4
4
  "description": "Initialize OpenCode Workflow system for AI-assisted development",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "3.0.0",
3
- "buildDate": "2026-01-23T16:19:12.609Z",
3
+ "buildDate": "2026-01-23T16:24:04.259Z",
4
4
  "files": [
5
5
  "config.yaml",
6
6
  "FLOW.yaml",
@@ -6,7 +6,7 @@
6
6
  # PROJECT CONFIGURATION
7
7
  # =============================================================================
8
8
  project_name: "ai-wf"
9
- version: "3.4.0"
9
+ version: "3.5.0"
10
10
 
11
11
  # =============================================================================
12
12
  # USER CONFIGURATION