@evolve.labs/devflow 0.9.0 → 0.9.2
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/lib/constants.js +1 -1
- package/lib/web.js +89 -3
- package/package.json +1 -1
- package/web/next.config.js +9 -1
- package/web/package.json +1 -1
package/lib/constants.js
CHANGED
package/lib/web.js
CHANGED
|
@@ -1,17 +1,100 @@
|
|
|
1
1
|
const { execSync, spawn } = require('node:child_process');
|
|
2
2
|
const path = require('node:path');
|
|
3
3
|
const fs = require('node:fs');
|
|
4
|
-
const
|
|
4
|
+
const os = require('node:os');
|
|
5
|
+
const { PACKAGE_ROOT, VERSION, WEB_COPY_DIRS, WEB_COPY_FILES } = require('./constants');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Fix node-pty spawn-helper permissions.
|
|
9
|
+
* npm install may strip the execute bit from prebuilt binaries.
|
|
10
|
+
*/
|
|
11
|
+
function fixSpawnHelperPermissions(webDir) {
|
|
12
|
+
try {
|
|
13
|
+
const prebuildsDir = path.join(webDir, 'node_modules', 'node-pty', 'prebuilds');
|
|
14
|
+
if (!fs.existsSync(prebuildsDir)) return;
|
|
15
|
+
const platforms = fs.readdirSync(prebuildsDir);
|
|
16
|
+
for (const platform of platforms) {
|
|
17
|
+
const helper = path.join(prebuildsDir, platform, 'spawn-helper');
|
|
18
|
+
if (fs.existsSync(helper)) {
|
|
19
|
+
fs.chmodSync(helper, 0o755);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
} catch {
|
|
23
|
+
// Non-critical on Windows or if prebuilds don't exist
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* When installed via npm, the web/ directory lives inside node_modules.
|
|
29
|
+
* Next.js/SWC does not properly compile TypeScript files within node_modules,
|
|
30
|
+
* so we copy the source to ~/.devflow/_web/ (a normal directory) and run from there.
|
|
31
|
+
*/
|
|
32
|
+
function resolveWebDir() {
|
|
33
|
+
const packageWebDir = path.join(PACKAGE_ROOT, 'web');
|
|
34
|
+
|
|
35
|
+
if (!fs.existsSync(packageWebDir)) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// If not inside node_modules, use directly (dev mode / cloned repo)
|
|
40
|
+
if (!PACKAGE_ROOT.includes('node_modules')) {
|
|
41
|
+
return packageWebDir;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Running from npm install — copy source to local cache
|
|
45
|
+
const cacheDir = path.join(os.homedir(), '.devflow', '_web');
|
|
46
|
+
const versionFile = path.join(cacheDir, '.devflow-version');
|
|
47
|
+
const cachedVersion = fs.existsSync(versionFile)
|
|
48
|
+
? fs.readFileSync(versionFile, 'utf-8').trim()
|
|
49
|
+
: '';
|
|
50
|
+
|
|
51
|
+
if (cachedVersion === VERSION && fs.existsSync(path.join(cacheDir, 'package.json'))) {
|
|
52
|
+
return cacheDir;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
console.log('Setting up web dashboard files...');
|
|
56
|
+
|
|
57
|
+
// Clean previous cache
|
|
58
|
+
if (fs.existsSync(cacheDir)) {
|
|
59
|
+
fs.rmSync(cacheDir, { recursive: true, force: true });
|
|
60
|
+
}
|
|
61
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
62
|
+
|
|
63
|
+
// Copy source directories
|
|
64
|
+
for (const dir of WEB_COPY_DIRS) {
|
|
65
|
+
const srcDir = path.join(PACKAGE_ROOT, dir);
|
|
66
|
+
const destDir = path.join(cacheDir, dir.replace(/^web\//, ''));
|
|
67
|
+
if (fs.existsSync(srcDir)) {
|
|
68
|
+
fs.cpSync(srcDir, destDir, { recursive: true });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Copy individual files
|
|
73
|
+
for (const file of WEB_COPY_FILES) {
|
|
74
|
+
const srcFile = path.join(PACKAGE_ROOT, file);
|
|
75
|
+
const destFile = path.join(cacheDir, file.replace(/^web\//, ''));
|
|
76
|
+
if (fs.existsSync(srcFile)) {
|
|
77
|
+
const destDir = path.dirname(destFile);
|
|
78
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
79
|
+
fs.copyFileSync(srcFile, destFile);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Write version marker
|
|
84
|
+
fs.writeFileSync(versionFile, VERSION);
|
|
85
|
+
|
|
86
|
+
return cacheDir;
|
|
87
|
+
}
|
|
5
88
|
|
|
6
89
|
/**
|
|
7
90
|
* devflow web - Start the DevFlow Web Dashboard
|
|
8
91
|
*/
|
|
9
92
|
async function webCommand(options) {
|
|
10
93
|
const port = options.port || '3000';
|
|
11
|
-
const webDir =
|
|
94
|
+
const webDir = resolveWebDir();
|
|
12
95
|
|
|
13
96
|
// 1. Verify web/ directory exists
|
|
14
|
-
if (!
|
|
97
|
+
if (!webDir) {
|
|
15
98
|
console.error('Error: Web IDE files not found.');
|
|
16
99
|
console.error('Re-install devflow with: npm install -g @evolve.labs/devflow');
|
|
17
100
|
process.exit(1);
|
|
@@ -34,6 +117,9 @@ async function webCommand(options) {
|
|
|
34
117
|
stdio: 'inherit',
|
|
35
118
|
timeout: 120_000,
|
|
36
119
|
});
|
|
120
|
+
|
|
121
|
+
// Fix node-pty spawn-helper permissions (npm may strip execute bit)
|
|
122
|
+
fixSpawnHelperPermissions(webDir);
|
|
37
123
|
} catch {
|
|
38
124
|
console.error('Failed to install dependencies.');
|
|
39
125
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evolve.labs/devflow",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Multi-agent system for software development with Claude Code. 6 specialized agents (Strategist, Architect, System Designer, Builder, Guardian, Chronicler) as slash commands.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
package/web/next.config.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
1
3
|
/** @type {import('next').NextConfig} */
|
|
2
4
|
const nextConfig = {
|
|
3
5
|
// Enable React strict mode for better development experience
|
|
@@ -14,8 +16,14 @@ const nextConfig = {
|
|
|
14
16
|
// Exclude native modules from client-side bundling
|
|
15
17
|
serverExternalPackages: ['node-pty'],
|
|
16
18
|
|
|
17
|
-
// Webpack config for native modules
|
|
19
|
+
// Webpack config for native modules and path resolution
|
|
18
20
|
webpack: (config, { isServer }) => {
|
|
21
|
+
// Ensure @/ alias resolves correctly even when running from node_modules
|
|
22
|
+
config.resolve.alias = {
|
|
23
|
+
...config.resolve.alias,
|
|
24
|
+
'@': path.resolve(__dirname),
|
|
25
|
+
};
|
|
26
|
+
|
|
19
27
|
if (!isServer) {
|
|
20
28
|
// Don't bundle node-pty on client side
|
|
21
29
|
config.resolve.fallback = {
|