@quicktvui/web-cli 1.0.0-beta.17 → 1.0.0-beta.18

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/qt-web-cli.js CHANGED
@@ -47,8 +47,7 @@ Examples:
47
47
  qt-web-cli --config ./my.webpack.js
48
48
 
49
49
  特点:
50
- - 自动检测项目入口,优先使用 webMain
51
- - 若无 webMain,自动使用 src/web 或 @quicktvui/web-renderer 包
50
+ - 自动检测项目入口 (main-native.ts/js, main.ts/js)
52
51
  - 零配置启动 web 开发服务器
53
52
  `)
54
53
  process.exit(0)
@@ -78,30 +77,27 @@ async function main() {
78
77
 
79
78
  // 入口候选列表
80
79
  const entryCandidates = [
81
- { name: 'webMain', path: pkg.webMain, type: 'webmain' },
80
+ { name: 'src/main-native.ts', path: './src/main-native.ts', type: 'package' },
81
+ { name: 'src/main-native.js', path: './src/main-native.js', type: 'package' },
82
82
  { name: 'src/main.ts', path: './src/main.ts', type: 'package' },
83
83
  { name: 'src/main.js', path: './src/main.js', type: 'package' },
84
84
  { name: 'main (package.json)', path: pkg.main, type: 'package' },
85
85
  ]
86
86
 
87
- // 检查 src/web 本地渲染器
88
- const hasLocalWebRenderer = fs.existsSync(path.join(projectRoot, 'src/web/index.js'))
89
-
90
87
  for (const candidate of entryCandidates) {
91
88
  if (!candidate.path) continue
92
89
  const entryFullPath = path.resolve(projectRoot, candidate.path)
93
90
  if (fs.existsSync(entryFullPath)) {
94
91
  mainEntry = candidate.path
95
- entryType = hasLocalWebRenderer ? 'local' : candidate.type
92
+ entryType = candidate.type
96
93
  signale.info(`主入口: ${mainEntry}`)
97
- signale.info(`Web 渲染器: ${hasLocalWebRenderer ? 'src/web (本地)' : '@quicktvui/web-renderer (包)'}`)
98
94
  break
99
95
  }
100
96
  }
101
97
 
102
98
  if (!mainEntry) {
103
99
  signale.error('无法找到有效的入口文件,请检查以下路径:')
104
- signale.error(' - package.json 中的 webMain 字段')
100
+ signale.error(' - src/main-native.ts src/main-native.js')
105
101
  signale.error(' - src/main.ts 或 src/main.js')
106
102
  signale.error(' - package.json 中的 main 字段')
107
103
  process.exit(1)
@@ -143,11 +139,13 @@ async function main() {
143
139
  // 如果需要打开浏览器,等待服务器就绪后打开
144
140
  if (args.open) {
145
141
  const url = `http://localhost:${args.port}`
146
- waitForServer(url, 30000).then(() => {
147
- openOrRefreshBrowser(url)
148
- }).catch((err) => {
149
- signale.warn(`自动打开浏览器失败: ${err.message}`)
150
- })
142
+ waitForServer(url, 30000)
143
+ .then(() => {
144
+ openOrRefreshBrowser(url)
145
+ })
146
+ .catch((err) => {
147
+ signale.warn(`自动打开浏览器失败: ${err.message}`)
148
+ })
151
149
  }
152
150
 
153
151
  const result = exec(webpackCmd, { stdio: 'inherit' })
@@ -111,7 +111,6 @@ module.exports = {
111
111
  devServer: {
112
112
  port,
113
113
  hot: true,
114
- liveReload: true,
115
114
  proxy: [
116
115
  {
117
116
  context: ['/proxy'],
@@ -139,10 +138,6 @@ module.exports = {
139
138
  },
140
139
  },
141
140
  ],
142
- static: {
143
- directory: path.join(projectRoot, 'public'),
144
- publicPath: '/',
145
- },
146
141
  client: {
147
142
  overlay: { errors: true, warnings: false },
148
143
  },
@@ -281,9 +276,4 @@ module.exports = {
281
276
 
282
277
  // 忽略 entry-local.js 中动态 require 的警告(这是预期行为)
283
278
  ignoreWarnings: [/Critical dependency: the request of a dependency is an expression/],
284
-
285
- cache: {
286
- type: 'filesystem',
287
- buildDependencies: { config: [__filename] },
288
- },
289
279
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quicktvui/web-cli",
3
- "version": "1.0.0-beta.17",
3
+ "version": "1.0.0-beta.18",
4
4
  "description": "CLI tool for QuickTVUI web development - zero configuration",
5
5
  "author": "QuickTVUI Team",
6
6
  "license": "Apache-2.0",