@sylphx/flow 2.3.0 → 2.3.1
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/CHANGELOG.md +10 -0
- package/package.json +4 -5
- package/src/services/auto-upgrade.ts +39 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @sylphx/flow
|
|
2
2
|
|
|
3
|
+
## 2.3.1 (2025-12-02)
|
|
4
|
+
|
|
5
|
+
### 🐛 Bug Fixes
|
|
6
|
+
|
|
7
|
+
- **upgrade:** fix auto-upgrade using wrong package manager ([a8a2b92](https://github.com/SylphxAI/flow/commit/a8a2b927534b7f92de48c77df25ee1e11d345380))
|
|
8
|
+
|
|
9
|
+
### 🔧 Chores
|
|
10
|
+
|
|
11
|
+
- migrate from vitest to bun test and fix doctor issues ([af35a27](https://github.com/SylphxAI/flow/commit/af35a27546786a99cbd475dae3f5cfb874ee8ab8))
|
|
12
|
+
|
|
3
13
|
## 2.3.0 (2025-12-02)
|
|
4
14
|
|
|
5
15
|
### ✨ Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sylphx/flow",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "One CLI to rule them all. Unified orchestration layer for Claude Code, OpenCode, Cursor and all AI development tools. Auto-detection, auto-installation, auto-upgrade.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"scripts": {
|
|
20
20
|
"dev": "bun src/index.ts",
|
|
21
21
|
"start": "bun src/index.ts",
|
|
22
|
-
"test": "
|
|
23
|
-
"test:watch": "
|
|
22
|
+
"test": "bun test",
|
|
23
|
+
"test:watch": "bun test --watch",
|
|
24
24
|
"type-check": "tsc --noEmit",
|
|
25
25
|
"prepublishOnly": "echo 'Using assets from packages/flow/assets'"
|
|
26
26
|
},
|
|
@@ -38,8 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^24.9.2",
|
|
41
|
-
"typescript": "^5.9.3"
|
|
42
|
-
"vitest": "^4.0.6"
|
|
41
|
+
"typescript": "^5.9.3"
|
|
43
42
|
},
|
|
44
43
|
"publishConfig": {
|
|
45
44
|
"access": "public"
|
|
@@ -6,12 +6,16 @@
|
|
|
6
6
|
import { exec } from 'node:child_process';
|
|
7
7
|
import fs from 'node:fs/promises';
|
|
8
8
|
import path from 'node:path';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
9
10
|
import { promisify } from 'node:util';
|
|
10
11
|
import chalk from 'chalk';
|
|
11
12
|
import ora from 'ora';
|
|
12
13
|
import { detectPackageManager, getUpgradeCommand } from '../utils/package-manager-detector.js';
|
|
13
14
|
import { TargetInstaller } from './target-installer.js';
|
|
14
15
|
|
|
16
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
17
|
+
const __dirname = path.dirname(__filename);
|
|
18
|
+
|
|
15
19
|
const execAsync = promisify(exec);
|
|
16
20
|
|
|
17
21
|
export interface UpgradeStatus {
|
|
@@ -116,15 +120,47 @@ export class AutoUpgrade {
|
|
|
116
120
|
}
|
|
117
121
|
|
|
118
122
|
/**
|
|
119
|
-
*
|
|
123
|
+
* Detect which package manager was used to install Flow globally
|
|
124
|
+
* by checking the executable path
|
|
125
|
+
*/
|
|
126
|
+
private async detectFlowPackageManager(): Promise<'bun' | 'npm' | 'pnpm' | 'yarn'> {
|
|
127
|
+
try {
|
|
128
|
+
const { stdout } = await execAsync('which flow || where flow');
|
|
129
|
+
const flowPath = stdout.trim().toLowerCase();
|
|
130
|
+
|
|
131
|
+
if (flowPath.includes('bun')) {
|
|
132
|
+
return 'bun';
|
|
133
|
+
}
|
|
134
|
+
if (flowPath.includes('pnpm')) {
|
|
135
|
+
return 'pnpm';
|
|
136
|
+
}
|
|
137
|
+
if (flowPath.includes('yarn')) {
|
|
138
|
+
return 'yarn';
|
|
139
|
+
}
|
|
140
|
+
} catch {
|
|
141
|
+
// Fall through to default
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Default to bun as it's the recommended install method
|
|
145
|
+
return 'bun';
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Upgrade Flow to latest version using the package manager that installed it
|
|
120
150
|
* @returns True if upgrade successful, false otherwise
|
|
121
151
|
*/
|
|
122
152
|
async upgradeFlow(): Promise<boolean> {
|
|
123
|
-
const packageManager = detectPackageManager(this.projectPath);
|
|
124
153
|
const spinner = ora('Upgrading Flow...').start();
|
|
125
154
|
|
|
126
155
|
try {
|
|
127
|
-
|
|
156
|
+
// Detect which package manager was used to install Flow
|
|
157
|
+
const flowPm = await this.detectFlowPackageManager();
|
|
158
|
+
const upgradeCmd = getUpgradeCommand('@sylphx/flow', flowPm);
|
|
159
|
+
|
|
160
|
+
if (this.options.verbose) {
|
|
161
|
+
console.log(chalk.dim(` Using ${flowPm}: ${upgradeCmd}`));
|
|
162
|
+
}
|
|
163
|
+
|
|
128
164
|
await execAsync(upgradeCmd);
|
|
129
165
|
|
|
130
166
|
spinner.succeed(chalk.green('✓ Flow upgraded to latest version'));
|