@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 +29 -7
- package/package.json +1 -1
- package/src/build-info.json +1 -1
- package/src/opencode/config.yaml +1 -1
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.
|
|
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.
|
|
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
|
-
.
|
|
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
|
-
|
|
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
|
-
|
|
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
package/src/build-info.json
CHANGED
package/src/opencode/config.yaml
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# PROJECT CONFIGURATION
|
|
7
7
|
# =============================================================================
|
|
8
8
|
project_name: "ai-wf"
|
|
9
|
-
version: "3.
|
|
9
|
+
version: "3.5.0"
|
|
10
10
|
|
|
11
11
|
# =============================================================================
|
|
12
12
|
# USER CONFIGURATION
|