@leanspec/ui 0.2.19-dev.21389425071 → 0.2.20
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/leanspec-ui.js +32 -9
- package/package.json +5 -5
package/bin/leanspec-ui.js
CHANGED
|
@@ -29,21 +29,46 @@ if (!existsSync(DIST_DIR)) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* Try to resolve @leanspec/http-server
|
|
32
|
+
* Try to resolve @leanspec/http-server from multiple locations
|
|
33
33
|
*/
|
|
34
34
|
function resolveHttpServer() {
|
|
35
|
+
// Try local resolution first
|
|
35
36
|
try {
|
|
36
37
|
return require.resolve('@leanspec/http-server/bin/leanspec-http.js');
|
|
37
38
|
} catch {
|
|
38
|
-
|
|
39
|
+
// Continue to try other locations
|
|
39
40
|
}
|
|
41
|
+
|
|
42
|
+
// Try resolving from global npm modules
|
|
43
|
+
try {
|
|
44
|
+
const npmRoot = spawnSync('npm', ['root', '-g'], {
|
|
45
|
+
encoding: 'utf8',
|
|
46
|
+
shell: true
|
|
47
|
+
});
|
|
48
|
+
if (npmRoot.status === 0 && npmRoot.stdout) {
|
|
49
|
+
const globalPath = join(
|
|
50
|
+
npmRoot.stdout.trim(),
|
|
51
|
+
'@leanspec',
|
|
52
|
+
'http-server',
|
|
53
|
+
'bin',
|
|
54
|
+
'leanspec-http.js'
|
|
55
|
+
);
|
|
56
|
+
if (existsSync(globalPath)) {
|
|
57
|
+
return globalPath;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
} catch {
|
|
61
|
+
// Continue
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return null;
|
|
40
65
|
}
|
|
41
66
|
|
|
42
67
|
/**
|
|
43
|
-
* Auto-install @leanspec/http-server using npm
|
|
68
|
+
* Auto-install @leanspec/http-server globally using npm
|
|
44
69
|
*/
|
|
45
70
|
function installHttpServer() {
|
|
46
|
-
console.log('📦 @leanspec/http-server not found, installing
|
|
71
|
+
console.log('📦 @leanspec/http-server not found, installing globally...');
|
|
47
72
|
console.log('');
|
|
48
73
|
|
|
49
74
|
// Get the version of @leanspec/ui to match
|
|
@@ -55,10 +80,8 @@ function installHttpServer() {
|
|
|
55
80
|
? '@leanspec/http-server@dev'
|
|
56
81
|
: `@leanspec/http-server@^${version}`;
|
|
57
82
|
|
|
58
|
-
// Install
|
|
59
|
-
const
|
|
60
|
-
const result = spawnSync('npm', ['install', '--no-save', packageSpec], {
|
|
61
|
-
cwd: installDir,
|
|
83
|
+
// Install globally so it persists across npx runs
|
|
84
|
+
const result = spawnSync('npm', ['install', '-g', packageSpec], {
|
|
62
85
|
stdio: 'inherit',
|
|
63
86
|
shell: true
|
|
64
87
|
});
|
|
@@ -73,7 +96,7 @@ function installHttpServer() {
|
|
|
73
96
|
}
|
|
74
97
|
|
|
75
98
|
console.log('');
|
|
76
|
-
console.log('✅ @leanspec/http-server installed
|
|
99
|
+
console.log('✅ @leanspec/http-server installed globally');
|
|
77
100
|
console.log('');
|
|
78
101
|
}
|
|
79
102
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leanspec/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.20",
|
|
4
4
|
"description": "LeanSpec web UI launcher for visual spec management (Vite SPA)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@ai-sdk/react": "^3.0.41",
|
|
26
26
|
"@dagrejs/dagre": "^1.1.8",
|
|
27
|
-
"@leanspec/ai-worker": "0.2.
|
|
28
|
-
"@leanspec/ui-components": "0.2.
|
|
27
|
+
"@leanspec/ai-worker": "0.2.20",
|
|
28
|
+
"@leanspec/ui-components": "0.2.20",
|
|
29
29
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
30
30
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
31
31
|
"@radix-ui/react-collapsible": "^1.1.12",
|
|
@@ -87,10 +87,10 @@
|
|
|
87
87
|
"use-stick-to-bottom": "^1.1.2"
|
|
88
88
|
},
|
|
89
89
|
"optionalDependencies": {
|
|
90
|
-
"@leanspec/chat-server": "0.2.
|
|
90
|
+
"@leanspec/chat-server": "0.2.20"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
|
-
"@leanspec/http-server": "0.2.
|
|
93
|
+
"@leanspec/http-server": "0.2.20"
|
|
94
94
|
},
|
|
95
95
|
"peerDependenciesMeta": {
|
|
96
96
|
"@leanspec/http-server": {
|