@wundr.io/cli 1.0.10 → 1.0.12
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/wundr.js +8 -4
- package/package.json +23 -23
- package/src/ai/ai-service.ts +16 -17
- package/src/ai/claude-client.ts +16 -16
- package/src/ai/conversation-manager.ts +29 -29
- package/src/cli.ts +4 -4
- package/src/commands/ai.ts +246 -78
- package/src/commands/alignment.ts +74 -74
- package/src/commands/analyze-optimized.ts +111 -78
- package/src/commands/analyze.ts +14 -14
- package/src/commands/batch.ts +179 -42
- package/src/commands/chat.ts +37 -30
- package/src/commands/claude-init.ts +41 -45
- package/src/commands/claude-setup.ts +204 -119
- package/src/commands/computer-setup.ts +85 -43
- package/src/commands/create-command.ts +4 -4
- package/src/commands/create.ts +27 -27
- package/src/commands/dashboard.ts +24 -24
- package/src/commands/govern.ts +25 -25
- package/src/commands/governance.ts +34 -34
- package/src/commands/guardian.ts +56 -56
- package/src/commands/init.ts +25 -22
- package/src/commands/orchestrator.ts +68 -41
- package/src/commands/performance-optimizer.ts +34 -35
- package/src/commands/plugins.ts +27 -27
- package/src/commands/project-update.ts +175 -72
- package/src/commands/rag.ts +185 -78
- package/src/commands/session.ts +35 -35
- package/src/commands/setup.ts +40 -344
- package/src/commands/test-init.ts +3 -3
- package/src/commands/test.ts +4 -4
- package/src/commands/watch.ts +28 -29
- package/src/commands/worktree.ts +49 -49
- package/src/context/context-manager.ts +10 -10
- package/src/context/session-manager.ts +41 -41
- package/src/framework/command-interface.ts +520 -0
- package/src/framework/command-registry.ts +942 -0
- package/src/framework/completion-exporter.ts +383 -0
- package/src/framework/debug-logger.ts +519 -0
- package/src/framework/error-handler.ts +867 -0
- package/src/framework/help-generator.ts +540 -0
- package/src/framework/index.ts +169 -0
- package/src/framework/interactive-repl.ts +703 -0
- package/src/framework/output-formatter.ts +834 -0
- package/src/framework/progress-manager.ts +539 -0
- package/src/index.ts +4 -4
- package/src/interactive/interactive-mode.ts +16 -16
- package/src/lib/conflict-resolution.ts +799 -9
- package/src/lib/merge-strategy.ts +529 -7
- package/src/lib/safety-mechanisms.ts +422 -18
- package/src/lib/state-detection.ts +1015 -13
- package/src/nlp/command-mapper.ts +29 -29
- package/src/nlp/command-parser.ts +17 -17
- package/src/nlp/intent-classifier.ts +7 -7
- package/src/nlp/intent-parser.ts +54 -52
- package/src/plugins/plugin-manager.ts +61 -39
- package/src/tests/computer-setup-integration.test.ts +46 -15
- package/src/types/modules.d.ts +424 -1
- package/src/utils/backup-rollback-manager.ts +11 -8
- package/src/utils/config-manager.ts +3 -3
- package/src/utils/error-handler.ts +2 -2
- package/src/utils/logger.ts +22 -22
- package/templates/batch/ci-cd.yaml +7 -7
- package/test-suites/api/health.spec.ts +20 -23
- package/test-suites/helpers/test-config.ts +14 -13
- package/test-suites/ui/accessibility.spec.ts +27 -22
- package/test-suites/ui/smoke.spec.ts +26 -21
- package/LICENSE +0 -21
- package/dist/ai/ai-service.d.ts +0 -152
- package/dist/ai/ai-service.d.ts.map +0 -1
- package/dist/ai/ai-service.js +0 -430
- package/dist/ai/ai-service.js.map +0 -1
- package/dist/ai/claude-client.d.ts +0 -130
- package/dist/ai/claude-client.d.ts.map +0 -1
- package/dist/ai/claude-client.js +0 -340
- package/dist/ai/claude-client.js.map +0 -1
- package/dist/ai/conversation-manager.d.ts +0 -164
- package/dist/ai/conversation-manager.d.ts.map +0 -1
- package/dist/ai/conversation-manager.js +0 -614
- package/dist/ai/conversation-manager.js.map +0 -1
- package/dist/ai/index.d.ts +0 -5
- package/dist/ai/index.d.ts.map +0 -1
- package/dist/ai/index.js +0 -8
- package/dist/ai/index.js.map +0 -1
- package/dist/cli.d.ts +0 -36
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -192
- package/dist/cli.js.map +0 -1
- package/dist/commands/ai.d.ts +0 -89
- package/dist/commands/ai.d.ts.map +0 -1
- package/dist/commands/ai.js +0 -799
- package/dist/commands/ai.js.map +0 -1
- package/dist/commands/alignment.d.ts +0 -78
- package/dist/commands/alignment.d.ts.map +0 -1
- package/dist/commands/alignment.js +0 -817
- package/dist/commands/alignment.js.map +0 -1
- package/dist/commands/analyze-optimized.d.ts +0 -14
- package/dist/commands/analyze-optimized.d.ts.map +0 -1
- package/dist/commands/analyze-optimized.js +0 -600
- package/dist/commands/analyze-optimized.js.map +0 -1
- package/dist/commands/analyze.d.ts +0 -65
- package/dist/commands/analyze.d.ts.map +0 -1
- package/dist/commands/analyze.js +0 -435
- package/dist/commands/analyze.js.map +0 -1
- package/dist/commands/batch.d.ts +0 -71
- package/dist/commands/batch.d.ts.map +0 -1
- package/dist/commands/batch.js +0 -738
- package/dist/commands/batch.js.map +0 -1
- package/dist/commands/chat.d.ts +0 -71
- package/dist/commands/chat.d.ts.map +0 -1
- package/dist/commands/chat.js +0 -674
- package/dist/commands/chat.js.map +0 -1
- package/dist/commands/claude-init.d.ts +0 -28
- package/dist/commands/claude-init.d.ts.map +0 -1
- package/dist/commands/claude-init.js +0 -591
- package/dist/commands/claude-init.js.map +0 -1
- package/dist/commands/claude-setup.d.ts +0 -119
- package/dist/commands/claude-setup.d.ts.map +0 -1
- package/dist/commands/claude-setup.js +0 -1073
- package/dist/commands/claude-setup.js.map +0 -1
- package/dist/commands/computer-setup-commands.d.ts +0 -53
- package/dist/commands/computer-setup-commands.d.ts.map +0 -1
- package/dist/commands/computer-setup-commands.js +0 -705
- package/dist/commands/computer-setup-commands.js.map +0 -1
- package/dist/commands/computer-setup.d.ts +0 -7
- package/dist/commands/computer-setup.d.ts.map +0 -1
- package/dist/commands/computer-setup.js +0 -849
- package/dist/commands/computer-setup.js.map +0 -1
- package/dist/commands/create-command.d.ts +0 -7
- package/dist/commands/create-command.d.ts.map +0 -1
- package/dist/commands/create-command.js +0 -158
- package/dist/commands/create-command.js.map +0 -1
- package/dist/commands/create.d.ts +0 -74
- package/dist/commands/create.d.ts.map +0 -1
- package/dist/commands/create.js +0 -556
- package/dist/commands/create.js.map +0 -1
- package/dist/commands/dashboard.d.ts +0 -91
- package/dist/commands/dashboard.d.ts.map +0 -1
- package/dist/commands/dashboard.js +0 -538
- package/dist/commands/dashboard.js.map +0 -1
- package/dist/commands/govern.d.ts +0 -70
- package/dist/commands/govern.d.ts.map +0 -1
- package/dist/commands/govern.js +0 -481
- package/dist/commands/govern.js.map +0 -1
- package/dist/commands/governance.d.ts +0 -17
- package/dist/commands/governance.d.ts.map +0 -1
- package/dist/commands/governance.js +0 -703
- package/dist/commands/governance.js.map +0 -1
- package/dist/commands/guardian.d.ts +0 -20
- package/dist/commands/guardian.d.ts.map +0 -1
- package/dist/commands/guardian.js +0 -597
- package/dist/commands/guardian.js.map +0 -1
- package/dist/commands/init.d.ts +0 -59
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -650
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/orchestrator.d.ts +0 -7
- package/dist/commands/orchestrator.d.ts.map +0 -1
- package/dist/commands/orchestrator.js +0 -571
- package/dist/commands/orchestrator.js.map +0 -1
- package/dist/commands/performance-optimizer.d.ts +0 -30
- package/dist/commands/performance-optimizer.d.ts.map +0 -1
- package/dist/commands/performance-optimizer.js +0 -650
- package/dist/commands/performance-optimizer.js.map +0 -1
- package/dist/commands/plugins.d.ts +0 -87
- package/dist/commands/plugins.d.ts.map +0 -1
- package/dist/commands/plugins.js +0 -685
- package/dist/commands/plugins.js.map +0 -1
- package/dist/commands/rag.d.ts +0 -7
- package/dist/commands/rag.d.ts.map +0 -1
- package/dist/commands/rag.js +0 -748
- package/dist/commands/rag.js.map +0 -1
- package/dist/commands/session.d.ts +0 -41
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js +0 -441
- package/dist/commands/session.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -29
- package/dist/commands/setup.d.ts.map +0 -1
- package/dist/commands/setup.js +0 -397
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/test-init.d.ts +0 -9
- package/dist/commands/test-init.d.ts.map +0 -1
- package/dist/commands/test-init.js +0 -222
- package/dist/commands/test-init.js.map +0 -1
- package/dist/commands/test.d.ts +0 -25
- package/dist/commands/test.d.ts.map +0 -1
- package/dist/commands/test.js +0 -217
- package/dist/commands/test.js.map +0 -1
- package/dist/commands/vp.d.ts +0 -7
- package/dist/commands/vp.d.ts.map +0 -1
- package/dist/commands/vp.js +0 -571
- package/dist/commands/vp.js.map +0 -1
- package/dist/commands/watch.d.ts +0 -76
- package/dist/commands/watch.d.ts.map +0 -1
- package/dist/commands/watch.js +0 -613
- package/dist/commands/watch.js.map +0 -1
- package/dist/commands/worktree.d.ts +0 -63
- package/dist/commands/worktree.d.ts.map +0 -1
- package/dist/commands/worktree.js +0 -774
- package/dist/commands/worktree.js.map +0 -1
- package/dist/context/context-manager.d.ts +0 -155
- package/dist/context/context-manager.d.ts.map +0 -1
- package/dist/context/context-manager.js +0 -383
- package/dist/context/context-manager.js.map +0 -1
- package/dist/context/index.d.ts +0 -3
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js +0 -6
- package/dist/context/index.js.map +0 -1
- package/dist/context/session-manager.d.ts +0 -207
- package/dist/context/session-manager.d.ts.map +0 -1
- package/dist/context/session-manager.js +0 -686
- package/dist/context/session-manager.js.map +0 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -51
- package/dist/index.js.map +0 -1
- package/dist/interactive/interactive-mode.d.ts +0 -76
- package/dist/interactive/interactive-mode.d.ts.map +0 -1
- package/dist/interactive/interactive-mode.js +0 -732
- package/dist/interactive/interactive-mode.js.map +0 -1
- package/dist/nlp/command-mapper.d.ts +0 -174
- package/dist/nlp/command-mapper.d.ts.map +0 -1
- package/dist/nlp/command-mapper.js +0 -624
- package/dist/nlp/command-mapper.js.map +0 -1
- package/dist/nlp/command-parser.d.ts +0 -106
- package/dist/nlp/command-parser.d.ts.map +0 -1
- package/dist/nlp/command-parser.js +0 -417
- package/dist/nlp/command-parser.js.map +0 -1
- package/dist/nlp/index.d.ts +0 -5
- package/dist/nlp/index.d.ts.map +0 -1
- package/dist/nlp/index.js +0 -8
- package/dist/nlp/index.js.map +0 -1
- package/dist/nlp/intent-classifier.d.ts +0 -59
- package/dist/nlp/intent-classifier.d.ts.map +0 -1
- package/dist/nlp/intent-classifier.js +0 -384
- package/dist/nlp/intent-classifier.js.map +0 -1
- package/dist/nlp/intent-parser.d.ts +0 -152
- package/dist/nlp/intent-parser.d.ts.map +0 -1
- package/dist/nlp/intent-parser.js +0 -744
- package/dist/nlp/intent-parser.js.map +0 -1
- package/dist/plugins/plugin-manager.d.ts +0 -120
- package/dist/plugins/plugin-manager.d.ts.map +0 -1
- package/dist/plugins/plugin-manager.js +0 -595
- package/dist/plugins/plugin-manager.js.map +0 -1
- package/dist/types/index.d.ts +0 -224
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -3
- package/dist/types/index.js.map +0 -1
- package/dist/utils/backup-rollback-manager.d.ts +0 -72
- package/dist/utils/backup-rollback-manager.d.ts.map +0 -1
- package/dist/utils/backup-rollback-manager.js +0 -289
- package/dist/utils/backup-rollback-manager.js.map +0 -1
- package/dist/utils/claude-config-installer.d.ts +0 -98
- package/dist/utils/claude-config-installer.d.ts.map +0 -1
- package/dist/utils/claude-config-installer.js +0 -678
- package/dist/utils/claude-config-installer.js.map +0 -1
- package/dist/utils/config-manager.d.ts +0 -73
- package/dist/utils/config-manager.d.ts.map +0 -1
- package/dist/utils/config-manager.js +0 -339
- package/dist/utils/config-manager.js.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -46
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/error-handler.js +0 -169
- package/dist/utils/error-handler.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -25
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -105
- package/dist/utils/logger.js.map +0 -1
- package/src/commands/computer-setup-commands.ts +0 -872
|
@@ -14,18 +14,14 @@ import { Command } from 'commander';
|
|
|
14
14
|
import inquirer from 'inquirer';
|
|
15
15
|
import ora from 'ora';
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
createConflictResolver,
|
|
19
|
-
} from '../lib/conflict-resolution';
|
|
17
|
+
import { createConflictResolver } from '../lib/conflict-resolution';
|
|
20
18
|
import {
|
|
21
19
|
MergeStrategyManager,
|
|
22
20
|
MergeResult,
|
|
23
21
|
threeWayMerge,
|
|
24
22
|
detectFileType,
|
|
25
23
|
} from '../lib/merge-strategy';
|
|
26
|
-
import {
|
|
27
|
-
createSafetyManager,
|
|
28
|
-
} from '../lib/safety-mechanisms';
|
|
24
|
+
import { createSafetyManager } from '../lib/safety-mechanisms';
|
|
29
25
|
import {
|
|
30
26
|
detectProjectState,
|
|
31
27
|
CustomizationInfo,
|
|
@@ -38,17 +34,17 @@ import { logger } from '../utils/logger';
|
|
|
38
34
|
import type {
|
|
39
35
|
ConflictResolver,
|
|
40
36
|
UpdateConflict,
|
|
41
|
-
ConflictResolutionResult
|
|
37
|
+
ConflictResolutionResult,
|
|
38
|
+
} from '../lib/conflict-resolution';
|
|
42
39
|
import type {
|
|
43
40
|
SafetyManager,
|
|
44
41
|
UpdateBackup,
|
|
45
|
-
UpdateTransaction
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
UpdateTransaction,
|
|
43
|
+
} from '../lib/safety-mechanisms';
|
|
44
|
+
import type { ProjectState } from '../lib/state-detection';
|
|
48
45
|
import type { PluginManager } from '../plugins/plugin-manager';
|
|
49
46
|
import type { ConfigManager } from '../utils/config-manager';
|
|
50
47
|
|
|
51
|
-
|
|
52
48
|
/**
|
|
53
49
|
* Update options from CLI flags
|
|
54
50
|
*/
|
|
@@ -163,7 +159,10 @@ export class ProjectUpdateManager {
|
|
|
163
159
|
private updateLog: UpdateLogEntry[] = [];
|
|
164
160
|
private spinner: ReturnType<typeof ora> | null = null;
|
|
165
161
|
|
|
166
|
-
constructor(
|
|
162
|
+
constructor(
|
|
163
|
+
projectRoot: string,
|
|
164
|
+
options: Partial<ProjectUpdateOptions> = {}
|
|
165
|
+
) {
|
|
167
166
|
this.projectRoot = projectRoot;
|
|
168
167
|
this.options = { ...DEFAULT_UPDATE_OPTIONS, ...options };
|
|
169
168
|
|
|
@@ -210,13 +209,23 @@ export class ProjectUpdateManager {
|
|
|
210
209
|
this.log('detect', 'state', 'success', `Version: ${currentVersion}`);
|
|
211
210
|
|
|
212
211
|
// Step 2: Check if update is needed
|
|
213
|
-
const needsUpdate =
|
|
214
|
-
|
|
215
|
-
|
|
212
|
+
const needsUpdate =
|
|
213
|
+
currentState.isWundrOutdated ||
|
|
214
|
+
currentState.isPartialInstallation ||
|
|
215
|
+
this.options.force;
|
|
216
216
|
|
|
217
217
|
if (!needsUpdate && !this.options.force) {
|
|
218
218
|
console.log(chalk.green('\nProject is up to date!'));
|
|
219
|
-
return this.createResult(
|
|
219
|
+
return this.createResult(
|
|
220
|
+
true,
|
|
221
|
+
currentVersion,
|
|
222
|
+
currentVersion,
|
|
223
|
+
[],
|
|
224
|
+
[],
|
|
225
|
+
null,
|
|
226
|
+
[],
|
|
227
|
+
startTime
|
|
228
|
+
);
|
|
220
229
|
}
|
|
221
230
|
|
|
222
231
|
// Step 3: Show update plan
|
|
@@ -227,7 +236,16 @@ export class ProjectUpdateManager {
|
|
|
227
236
|
const confirmed = await this.confirmUpdate(currentState);
|
|
228
237
|
if (!confirmed) {
|
|
229
238
|
console.log(chalk.yellow('\nUpdate cancelled by user.'));
|
|
230
|
-
return this.createResult(
|
|
239
|
+
return this.createResult(
|
|
240
|
+
false,
|
|
241
|
+
currentVersion,
|
|
242
|
+
currentVersion,
|
|
243
|
+
[],
|
|
244
|
+
[],
|
|
245
|
+
null,
|
|
246
|
+
['Cancelled by user'],
|
|
247
|
+
startTime
|
|
248
|
+
);
|
|
231
249
|
}
|
|
232
250
|
}
|
|
233
251
|
|
|
@@ -240,11 +258,16 @@ export class ProjectUpdateManager {
|
|
|
240
258
|
filesToBackup,
|
|
241
259
|
'Pre-update backup',
|
|
242
260
|
currentVersion,
|
|
243
|
-
this.options.version || 'latest'
|
|
261
|
+
this.options.version || 'latest'
|
|
244
262
|
);
|
|
245
263
|
this.stopSpinner();
|
|
246
264
|
console.log(chalk.green(`Backup created: ${backup.id}`));
|
|
247
|
-
this.log(
|
|
265
|
+
this.log(
|
|
266
|
+
'backup',
|
|
267
|
+
backup.path,
|
|
268
|
+
'success',
|
|
269
|
+
`${backup.files.length} files backed up`
|
|
270
|
+
);
|
|
248
271
|
}
|
|
249
272
|
|
|
250
273
|
// Step 6: Start transaction
|
|
@@ -256,7 +279,7 @@ export class ProjectUpdateManager {
|
|
|
256
279
|
const { filesUpdated, conflicts, errors } = await this.performUpdates(
|
|
257
280
|
components,
|
|
258
281
|
currentState,
|
|
259
|
-
transaction
|
|
282
|
+
transaction
|
|
260
283
|
);
|
|
261
284
|
|
|
262
285
|
// Step 8: Resolve conflicts
|
|
@@ -280,7 +303,9 @@ export class ProjectUpdateManager {
|
|
|
280
303
|
|
|
281
304
|
// Success
|
|
282
305
|
const toVersion = this.options.version || 'latest';
|
|
283
|
-
console.log(
|
|
306
|
+
console.log(
|
|
307
|
+
chalk.green(`\nProject updated successfully to ${toVersion}!`)
|
|
308
|
+
);
|
|
284
309
|
|
|
285
310
|
return this.createResult(
|
|
286
311
|
true,
|
|
@@ -290,9 +315,8 @@ export class ProjectUpdateManager {
|
|
|
290
315
|
conflicts,
|
|
291
316
|
backup,
|
|
292
317
|
errors,
|
|
293
|
-
startTime
|
|
318
|
+
startTime
|
|
294
319
|
);
|
|
295
|
-
|
|
296
320
|
} catch (error) {
|
|
297
321
|
// Rollback on failure
|
|
298
322
|
if (this.options.rollbackOnFailure && backup) {
|
|
@@ -303,7 +327,6 @@ export class ProjectUpdateManager {
|
|
|
303
327
|
}
|
|
304
328
|
throw error;
|
|
305
329
|
}
|
|
306
|
-
|
|
307
330
|
} catch (error: any) {
|
|
308
331
|
logger.error('Project update failed', error);
|
|
309
332
|
this.log('update', 'project', 'failure', error.message);
|
|
@@ -317,7 +340,7 @@ export class ProjectUpdateManager {
|
|
|
317
340
|
[],
|
|
318
341
|
null,
|
|
319
342
|
[error.message],
|
|
320
|
-
startTime
|
|
343
|
+
startTime
|
|
321
344
|
);
|
|
322
345
|
}
|
|
323
346
|
}
|
|
@@ -382,9 +405,18 @@ export class ProjectUpdateManager {
|
|
|
382
405
|
private async showUpdatePlan(state: ProjectState): Promise<void> {
|
|
383
406
|
console.log(chalk.cyan('\n========== Update Plan ==========\n'));
|
|
384
407
|
|
|
385
|
-
console.log(
|
|
386
|
-
|
|
387
|
-
|
|
408
|
+
console.log(
|
|
409
|
+
chalk.white('Current Version:'),
|
|
410
|
+
chalk.yellow(state.wundrVersion || 'Not installed')
|
|
411
|
+
);
|
|
412
|
+
console.log(
|
|
413
|
+
chalk.white('Target Version:'),
|
|
414
|
+
chalk.green(this.options.version || state.latestWundrVersion || 'latest')
|
|
415
|
+
);
|
|
416
|
+
console.log(
|
|
417
|
+
chalk.white('Health Score:'),
|
|
418
|
+
chalk.yellow(`${state.healthScore}/100`)
|
|
419
|
+
);
|
|
388
420
|
|
|
389
421
|
if (state.recommendations.length > 0) {
|
|
390
422
|
console.log(chalk.white('\nRecommendations:'));
|
|
@@ -399,17 +431,26 @@ export class ProjectUpdateManager {
|
|
|
399
431
|
console.log(` - ${file}`);
|
|
400
432
|
}
|
|
401
433
|
if (state.customizations.customizedFiles.length > 5) {
|
|
402
|
-
console.log(
|
|
434
|
+
console.log(
|
|
435
|
+
chalk.gray(
|
|
436
|
+
` ... and ${state.customizations.customizedFiles.length - 5} more`
|
|
437
|
+
)
|
|
438
|
+
);
|
|
403
439
|
}
|
|
404
440
|
}
|
|
405
441
|
|
|
406
442
|
if (state.conflicts.hasConflicts) {
|
|
407
443
|
console.log(chalk.yellow('\nDetected Conflicts:'));
|
|
408
444
|
for (const conflict of state.conflicts.conflicts) {
|
|
409
|
-
const severityColor =
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
445
|
+
const severityColor =
|
|
446
|
+
conflict.severity === 'error'
|
|
447
|
+
? chalk.red
|
|
448
|
+
: conflict.severity === 'warning'
|
|
449
|
+
? chalk.yellow
|
|
450
|
+
: chalk.gray;
|
|
451
|
+
console.log(
|
|
452
|
+
severityColor(` [${conflict.severity}] ${conflict.description}`)
|
|
453
|
+
);
|
|
413
454
|
}
|
|
414
455
|
}
|
|
415
456
|
|
|
@@ -482,7 +523,7 @@ export class ProjectUpdateManager {
|
|
|
482
523
|
private async performUpdates(
|
|
483
524
|
components: UpdateComponent[],
|
|
484
525
|
state: ProjectState,
|
|
485
|
-
transaction: UpdateTransaction
|
|
526
|
+
transaction: UpdateTransaction
|
|
486
527
|
): Promise<{
|
|
487
528
|
filesUpdated: string[];
|
|
488
529
|
conflicts: UpdateConflict[];
|
|
@@ -496,7 +537,7 @@ export class ProjectUpdateManager {
|
|
|
496
537
|
let componentsToUpdate = components;
|
|
497
538
|
if (this.options.components.length > 0) {
|
|
498
539
|
componentsToUpdate = components.filter(c =>
|
|
499
|
-
this.options.components.includes(c.name)
|
|
540
|
+
this.options.components.includes(c.name)
|
|
500
541
|
);
|
|
501
542
|
}
|
|
502
543
|
|
|
@@ -508,7 +549,11 @@ export class ProjectUpdateManager {
|
|
|
508
549
|
}
|
|
509
550
|
|
|
510
551
|
try {
|
|
511
|
-
const result = await this.updateComponent(
|
|
552
|
+
const result = await this.updateComponent(
|
|
553
|
+
component,
|
|
554
|
+
state,
|
|
555
|
+
transaction
|
|
556
|
+
);
|
|
512
557
|
|
|
513
558
|
filesUpdated.push(...result.updated);
|
|
514
559
|
conflicts.push(...result.conflicts);
|
|
@@ -517,7 +562,12 @@ export class ProjectUpdateManager {
|
|
|
517
562
|
errors.push(...result.errors);
|
|
518
563
|
}
|
|
519
564
|
|
|
520
|
-
this.log(
|
|
565
|
+
this.log(
|
|
566
|
+
'update',
|
|
567
|
+
component.name,
|
|
568
|
+
'success',
|
|
569
|
+
`${result.updated.length} files updated`
|
|
570
|
+
);
|
|
521
571
|
} catch (error: any) {
|
|
522
572
|
errors.push(`Component ${component.name}: ${error.message}`);
|
|
523
573
|
this.log('update', component.name, 'failure', error.message);
|
|
@@ -535,7 +585,7 @@ export class ProjectUpdateManager {
|
|
|
535
585
|
private async updateComponent(
|
|
536
586
|
component: UpdateComponent,
|
|
537
587
|
state: ProjectState,
|
|
538
|
-
transaction: UpdateTransaction
|
|
588
|
+
transaction: UpdateTransaction
|
|
539
589
|
): Promise<{
|
|
540
590
|
updated: string[];
|
|
541
591
|
conflicts: UpdateConflict[];
|
|
@@ -597,11 +647,10 @@ export class ProjectUpdateManager {
|
|
|
597
647
|
// Create update conflicts
|
|
598
648
|
for (const conflict of mergeResult.conflicts) {
|
|
599
649
|
conflicts.push(
|
|
600
|
-
this.conflictResolver.createUpdateConflict(conflict, filePath)
|
|
650
|
+
this.conflictResolver.createUpdateConflict(conflict, filePath)
|
|
601
651
|
);
|
|
602
652
|
}
|
|
603
653
|
}
|
|
604
|
-
|
|
605
654
|
} catch (error: any) {
|
|
606
655
|
errors.push(`File ${filePath}: ${error.message}`);
|
|
607
656
|
transaction.failOperation(filePath, error.message);
|
|
@@ -616,7 +665,7 @@ export class ProjectUpdateManager {
|
|
|
616
665
|
*/
|
|
617
666
|
private async getTargetContent(
|
|
618
667
|
filePath: string,
|
|
619
|
-
component: UpdateComponent
|
|
668
|
+
component: UpdateComponent
|
|
620
669
|
): Promise<string | null> {
|
|
621
670
|
// In real implementation, would fetch from wundr registry
|
|
622
671
|
// For now, return null (no update available)
|
|
@@ -634,7 +683,7 @@ export class ProjectUpdateManager {
|
|
|
634
683
|
conflicts: UpdateConflict[],
|
|
635
684
|
backup: UpdateBackup | null,
|
|
636
685
|
errors: string[],
|
|
637
|
-
startTime: number
|
|
686
|
+
startTime: number
|
|
638
687
|
): UpdateResult {
|
|
639
688
|
return {
|
|
640
689
|
success,
|
|
@@ -658,7 +707,12 @@ export class ProjectUpdateManager {
|
|
|
658
707
|
/**
|
|
659
708
|
* Log an update action
|
|
660
709
|
*/
|
|
661
|
-
private log(
|
|
710
|
+
private log(
|
|
711
|
+
action: string,
|
|
712
|
+
target: string,
|
|
713
|
+
status: 'success' | 'failure' | 'skipped',
|
|
714
|
+
details?: string
|
|
715
|
+
): void {
|
|
662
716
|
this.updateLog.push({
|
|
663
717
|
timestamp: new Date().toISOString(),
|
|
664
718
|
action,
|
|
@@ -675,9 +729,12 @@ export class ProjectUpdateManager {
|
|
|
675
729
|
const logPath = path.join(this.projectRoot, '.wundr-update.log');
|
|
676
730
|
|
|
677
731
|
try {
|
|
678
|
-
const content = this.updateLog
|
|
679
|
-
|
|
680
|
-
|
|
732
|
+
const content = this.updateLog
|
|
733
|
+
.map(
|
|
734
|
+
entry =>
|
|
735
|
+
`[${entry.timestamp}] ${entry.action.toUpperCase()} ${entry.target} - ${entry.status}${entry.details ? `: ${entry.details}` : ''}`
|
|
736
|
+
)
|
|
737
|
+
.join('\n');
|
|
681
738
|
|
|
682
739
|
await fs.writeFile(logPath, content);
|
|
683
740
|
} catch (error) {
|
|
@@ -718,7 +775,7 @@ export class ProjectUpdateCommands {
|
|
|
718
775
|
constructor(
|
|
719
776
|
private program: Command,
|
|
720
777
|
private configManager: ConfigManager,
|
|
721
|
-
private pluginManager: PluginManager
|
|
778
|
+
private pluginManager: PluginManager
|
|
722
779
|
) {
|
|
723
780
|
this.registerCommands();
|
|
724
781
|
}
|
|
@@ -733,17 +790,25 @@ export class ProjectUpdateCommands {
|
|
|
733
790
|
updateCmd
|
|
734
791
|
.command('project')
|
|
735
792
|
.description('Update the entire project')
|
|
736
|
-
.option(
|
|
793
|
+
.option(
|
|
794
|
+
'--dry-run',
|
|
795
|
+
'Show what would be done without making changes',
|
|
796
|
+
false
|
|
797
|
+
)
|
|
737
798
|
.option('-f, --force', 'Force update without prompts', false)
|
|
738
799
|
.option('--skip-backup', 'Skip creating backup before update', false)
|
|
739
|
-
.option(
|
|
800
|
+
.option(
|
|
801
|
+
'-c, --components <names>',
|
|
802
|
+
'Specific components to update (comma-separated)',
|
|
803
|
+
''
|
|
804
|
+
)
|
|
740
805
|
.option('-v, --version <version>', 'Target version to update to')
|
|
741
806
|
.option('--no-interactive', 'Disable interactive mode')
|
|
742
807
|
.option('--verbose', 'Enable verbose output', false)
|
|
743
808
|
.option('--show-diff', 'Show differences during update', true)
|
|
744
809
|
.option('--auto-resolve', 'Automatically resolve conflicts', false)
|
|
745
810
|
.option('--no-rollback', 'Disable rollback on failure')
|
|
746
|
-
.action(async
|
|
811
|
+
.action(async options => {
|
|
747
812
|
await this.updateProject(options);
|
|
748
813
|
});
|
|
749
814
|
|
|
@@ -752,7 +817,7 @@ export class ProjectUpdateCommands {
|
|
|
752
817
|
.command('check')
|
|
753
818
|
.description('Check if updates are available')
|
|
754
819
|
.option('--verbose', 'Show detailed information')
|
|
755
|
-
.action(async
|
|
820
|
+
.action(async options => {
|
|
756
821
|
await this.checkUpdates(options);
|
|
757
822
|
});
|
|
758
823
|
|
|
@@ -761,7 +826,7 @@ export class ProjectUpdateCommands {
|
|
|
761
826
|
.command('history')
|
|
762
827
|
.description('Show update history')
|
|
763
828
|
.option('-n, --limit <number>', 'Number of entries to show', '10')
|
|
764
|
-
.action(async
|
|
829
|
+
.action(async options => {
|
|
765
830
|
await this.showHistory(options);
|
|
766
831
|
});
|
|
767
832
|
|
|
@@ -779,7 +844,7 @@ export class ProjectUpdateCommands {
|
|
|
779
844
|
.command('cleanup')
|
|
780
845
|
.description('Clean up old backups')
|
|
781
846
|
.option('-k, --keep <number>', 'Number of backups to keep', '5')
|
|
782
|
-
.action(async
|
|
847
|
+
.action(async options => {
|
|
783
848
|
await this.cleanup(options);
|
|
784
849
|
});
|
|
785
850
|
}
|
|
@@ -793,7 +858,9 @@ export class ProjectUpdateCommands {
|
|
|
793
858
|
dryRun: options.dryRun,
|
|
794
859
|
force: options.force,
|
|
795
860
|
skipBackup: options.skipBackup,
|
|
796
|
-
components: options.components
|
|
861
|
+
components: options.components
|
|
862
|
+
? options.components.split(',').map((c: string) => c.trim())
|
|
863
|
+
: [],
|
|
797
864
|
version: options.version || null,
|
|
798
865
|
interactive: options.interactive !== false,
|
|
799
866
|
verbose: options.verbose,
|
|
@@ -813,7 +880,7 @@ export class ProjectUpdateCommands {
|
|
|
813
880
|
'WUNDR_UPDATE_FAILED',
|
|
814
881
|
'Project update failed',
|
|
815
882
|
{ options },
|
|
816
|
-
true
|
|
883
|
+
true
|
|
817
884
|
);
|
|
818
885
|
}
|
|
819
886
|
}
|
|
@@ -830,9 +897,18 @@ export class ProjectUpdateCommands {
|
|
|
830
897
|
spinner.succeed('Update check complete');
|
|
831
898
|
|
|
832
899
|
console.log(chalk.cyan('\n========== Update Status ==========\n'));
|
|
833
|
-
console.log(
|
|
834
|
-
|
|
835
|
-
|
|
900
|
+
console.log(
|
|
901
|
+
chalk.white('Current Version:'),
|
|
902
|
+
chalk.yellow(state.wundrVersion || 'Not installed')
|
|
903
|
+
);
|
|
904
|
+
console.log(
|
|
905
|
+
chalk.white('Health Score:'),
|
|
906
|
+
chalk.yellow(`${state.healthScore}/100`)
|
|
907
|
+
);
|
|
908
|
+
console.log(
|
|
909
|
+
chalk.white('Needs Update:'),
|
|
910
|
+
state.isWundrOutdated ? chalk.red('Yes') : chalk.green('No')
|
|
911
|
+
);
|
|
836
912
|
|
|
837
913
|
if (state.recommendations.length > 0) {
|
|
838
914
|
console.log(chalk.white('\nRecommendations:'));
|
|
@@ -840,7 +916,9 @@ export class ProjectUpdateCommands {
|
|
|
840
916
|
console.log(chalk.gray(` - ${rec}`));
|
|
841
917
|
}
|
|
842
918
|
|
|
843
|
-
console.log(
|
|
919
|
+
console.log(
|
|
920
|
+
chalk.cyan('\nRun `wundr update project` to apply updates.')
|
|
921
|
+
);
|
|
844
922
|
}
|
|
845
923
|
|
|
846
924
|
console.log(chalk.cyan('\n====================================\n'));
|
|
@@ -880,7 +958,10 @@ export class ProjectUpdateCommands {
|
|
|
880
958
|
/**
|
|
881
959
|
* Rollback to previous state
|
|
882
960
|
*/
|
|
883
|
-
private async rollback(
|
|
961
|
+
private async rollback(
|
|
962
|
+
backupId: string | undefined,
|
|
963
|
+
options: any
|
|
964
|
+
): Promise<void> {
|
|
884
965
|
const safetyManager = createSafetyManager({ projectRoot: process.cwd() });
|
|
885
966
|
|
|
886
967
|
if (options.list) {
|
|
@@ -895,7 +976,7 @@ export class ProjectUpdateCommands {
|
|
|
895
976
|
for (const backup of backups) {
|
|
896
977
|
console.log(
|
|
897
978
|
` ${chalk.white(backup.id)} - ${chalk.gray(new Date(backup.timestamp).toLocaleString())} ` +
|
|
898
|
-
|
|
979
|
+
`(${backup.files.length} files)`
|
|
899
980
|
);
|
|
900
981
|
}
|
|
901
982
|
console.log(chalk.cyan('\n=======================================\n'));
|
|
@@ -905,9 +986,9 @@ export class ProjectUpdateCommands {
|
|
|
905
986
|
let backup: UpdateBackup | null;
|
|
906
987
|
|
|
907
988
|
if (backupId) {
|
|
908
|
-
backup = await safetyManager
|
|
909
|
-
|
|
910
|
-
|
|
989
|
+
backup = await safetyManager
|
|
990
|
+
.listBackups()
|
|
991
|
+
.then(backups => backups.find(b => b.id === backupId) || null);
|
|
911
992
|
} else {
|
|
912
993
|
backup = await safetyManager.getLatestBackup();
|
|
913
994
|
}
|
|
@@ -950,7 +1031,11 @@ export class ProjectUpdateCommands {
|
|
|
950
1031
|
const keepCount = parseInt(options.keep, 10);
|
|
951
1032
|
|
|
952
1033
|
if (backups.length <= keepCount) {
|
|
953
|
-
console.log(
|
|
1034
|
+
console.log(
|
|
1035
|
+
chalk.green(
|
|
1036
|
+
`Only ${backups.length} backup(s) found. Nothing to clean up.`
|
|
1037
|
+
)
|
|
1038
|
+
);
|
|
954
1039
|
return;
|
|
955
1040
|
}
|
|
956
1041
|
|
|
@@ -994,20 +1079,29 @@ export function createProjectUpdateCommand(): Command {
|
|
|
994
1079
|
cmd
|
|
995
1080
|
.command('project')
|
|
996
1081
|
.description('Update the entire project')
|
|
997
|
-
.option(
|
|
1082
|
+
.option(
|
|
1083
|
+
'--dry-run',
|
|
1084
|
+
'Show what would be done without making changes',
|
|
1085
|
+
false
|
|
1086
|
+
)
|
|
998
1087
|
.option('-f, --force', 'Force update without prompts', false)
|
|
999
1088
|
.option('--skip-backup', 'Skip creating backup before update', false)
|
|
1000
|
-
.option(
|
|
1089
|
+
.option(
|
|
1090
|
+
'-c, --components <names>',
|
|
1091
|
+
'Specific components to update (comma-separated)'
|
|
1092
|
+
)
|
|
1001
1093
|
.option('-v, --version <version>', 'Target version to update to')
|
|
1002
1094
|
.option('--no-interactive', 'Disable interactive mode')
|
|
1003
1095
|
.option('--verbose', 'Enable verbose output', false)
|
|
1004
1096
|
.option('--auto-resolve', 'Automatically resolve conflicts', false)
|
|
1005
|
-
.action(async
|
|
1097
|
+
.action(async options => {
|
|
1006
1098
|
const updateOptions: Partial<ProjectUpdateOptions> = {
|
|
1007
1099
|
dryRun: options.dryRun,
|
|
1008
1100
|
force: options.force,
|
|
1009
1101
|
skipBackup: options.skipBackup,
|
|
1010
|
-
components: options.components
|
|
1102
|
+
components: options.components
|
|
1103
|
+
? options.components.split(',').map((c: string) => c.trim())
|
|
1104
|
+
: [],
|
|
1011
1105
|
version: options.version || null,
|
|
1012
1106
|
interactive: options.interactive !== false,
|
|
1013
1107
|
verbose: options.verbose,
|
|
@@ -1031,9 +1125,18 @@ export function createProjectUpdateCommand(): Command {
|
|
|
1031
1125
|
const state = await detectProjectState();
|
|
1032
1126
|
spinner.succeed();
|
|
1033
1127
|
|
|
1034
|
-
console.log(
|
|
1035
|
-
|
|
1036
|
-
|
|
1128
|
+
console.log(
|
|
1129
|
+
chalk.white('\nCurrent Version:'),
|
|
1130
|
+
chalk.yellow(state.wundrVersion || 'Not installed')
|
|
1131
|
+
);
|
|
1132
|
+
console.log(
|
|
1133
|
+
chalk.white('Health Score:'),
|
|
1134
|
+
chalk.yellow(`${state.healthScore}/100`)
|
|
1135
|
+
);
|
|
1136
|
+
console.log(
|
|
1137
|
+
chalk.white('Needs Update:'),
|
|
1138
|
+
state.isWundrOutdated ? chalk.red('Yes') : chalk.green('No')
|
|
1139
|
+
);
|
|
1037
1140
|
|
|
1038
1141
|
if (state.recommendations.length > 0) {
|
|
1039
1142
|
console.log(chalk.white('\nRecommendations:'));
|