@evolve.labs/devflow 0.9.0 → 0.9.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/lib/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const path = require('node:path');
2
2
 
3
- const VERSION = '0.9.0';
3
+ const VERSION = '0.9.1';
4
4
 
5
5
  // Root of the installed npm package (where source files live)
6
6
  const PACKAGE_ROOT = path.resolve(__dirname, '..');
package/lib/web.js CHANGED
@@ -1,17 +1,80 @@
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 { PACKAGE_ROOT } = require('./constants');
4
+ const os = require('node:os');
5
+ const { PACKAGE_ROOT, VERSION, WEB_COPY_DIRS, WEB_COPY_FILES } = require('./constants');
6
+
7
+ /**
8
+ * When installed via npm, the web/ directory lives inside node_modules.
9
+ * Next.js/SWC does not properly compile TypeScript files within node_modules,
10
+ * so we copy the source to ~/.devflow/_web/ (a normal directory) and run from there.
11
+ */
12
+ function resolveWebDir() {
13
+ const packageWebDir = path.join(PACKAGE_ROOT, 'web');
14
+
15
+ if (!fs.existsSync(packageWebDir)) {
16
+ return null;
17
+ }
18
+
19
+ // If not inside node_modules, use directly (dev mode / cloned repo)
20
+ if (!PACKAGE_ROOT.includes('node_modules')) {
21
+ return packageWebDir;
22
+ }
23
+
24
+ // Running from npm install — copy source to local cache
25
+ const cacheDir = path.join(os.homedir(), '.devflow', '_web');
26
+ const versionFile = path.join(cacheDir, '.devflow-version');
27
+ const cachedVersion = fs.existsSync(versionFile)
28
+ ? fs.readFileSync(versionFile, 'utf-8').trim()
29
+ : '';
30
+
31
+ if (cachedVersion === VERSION && fs.existsSync(path.join(cacheDir, 'package.json'))) {
32
+ return cacheDir;
33
+ }
34
+
35
+ console.log('Setting up web dashboard files...');
36
+
37
+ // Clean previous cache
38
+ if (fs.existsSync(cacheDir)) {
39
+ fs.rmSync(cacheDir, { recursive: true, force: true });
40
+ }
41
+ fs.mkdirSync(cacheDir, { recursive: true });
42
+
43
+ // Copy source directories
44
+ for (const dir of WEB_COPY_DIRS) {
45
+ const srcDir = path.join(PACKAGE_ROOT, dir);
46
+ const destDir = path.join(cacheDir, dir.replace(/^web\//, ''));
47
+ if (fs.existsSync(srcDir)) {
48
+ fs.cpSync(srcDir, destDir, { recursive: true });
49
+ }
50
+ }
51
+
52
+ // Copy individual files
53
+ for (const file of WEB_COPY_FILES) {
54
+ const srcFile = path.join(PACKAGE_ROOT, file);
55
+ const destFile = path.join(cacheDir, file.replace(/^web\//, ''));
56
+ if (fs.existsSync(srcFile)) {
57
+ const destDir = path.dirname(destFile);
58
+ fs.mkdirSync(destDir, { recursive: true });
59
+ fs.copyFileSync(srcFile, destFile);
60
+ }
61
+ }
62
+
63
+ // Write version marker
64
+ fs.writeFileSync(versionFile, VERSION);
65
+
66
+ return cacheDir;
67
+ }
5
68
 
6
69
  /**
7
70
  * devflow web - Start the DevFlow Web Dashboard
8
71
  */
9
72
  async function webCommand(options) {
10
73
  const port = options.port || '3000';
11
- const webDir = path.join(PACKAGE_ROOT, 'web');
74
+ const webDir = resolveWebDir();
12
75
 
13
76
  // 1. Verify web/ directory exists
14
- if (!fs.existsSync(webDir)) {
77
+ if (!webDir) {
15
78
  console.error('Error: Web IDE files not found.');
16
79
  console.error('Re-install devflow with: npm install -g @evolve.labs/devflow');
17
80
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evolve.labs/devflow",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
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",
@@ -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 = {
package/web/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devflow-ide",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "dev": "./node_modules/.bin/next dev",