@quicktvui/web-cli 1.0.0-beta.15 → 1.0.0-beta.16

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.
@@ -66,6 +66,20 @@ function detectModules() {
66
66
  if (fs.existsSync(cwdNodeModules) && !modules.includes(cwdNodeModules)) {
67
67
  modules.push(cwdNodeModules)
68
68
  }
69
+ // 添加 web-cli 自身的 node_modules 路径(支持全局安装)
70
+ const cliNodeModules = path.resolve(__dirname, '../node_modules')
71
+ if (fs.existsSync(cliNodeModules) && !modules.includes(cliNodeModules)) {
72
+ modules.push(cliNodeModules)
73
+ }
74
+ // 添加全局 node_modules 路径
75
+ try {
76
+ const globalNodeModules = require('child_process')
77
+ .execSync('npm root -g', { encoding: 'utf-8' })
78
+ .trim()
79
+ if (fs.existsSync(globalNodeModules) && !modules.includes(globalNodeModules)) {
80
+ modules.push(globalNodeModules)
81
+ }
82
+ } catch (e) {}
69
83
  return modules
70
84
  }
71
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quicktvui/web-cli",
3
- "version": "1.0.0-beta.15",
3
+ "version": "1.0.0-beta.16",
4
4
  "description": "CLI tool for QuickTVUI web development - zero configuration",
5
5
  "author": "QuickTVUI Team",
6
6
  "license": "Apache-2.0",