@quicktvui/web-cli 1.0.0-beta.1 → 1.0.0-beta.10
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/entry-package.js +65 -4
- package/package.json +6 -3
package/lib/entry-package.js
CHANGED
|
@@ -1,16 +1,77 @@
|
|
|
1
1
|
// @quicktvui/web-cli - web entry (package)
|
|
2
2
|
// 此文件由 CLI 自动加载,使用 @quicktvui/web-renderer 包
|
|
3
3
|
// 主入口路径通过 __QUICKTVUI_MAIN_ENTRY__ 注入
|
|
4
|
+
//
|
|
5
|
+
// 初始化流程参考 main-web.js,直接使用 web-renderer 导出的函数
|
|
4
6
|
|
|
5
7
|
console.log('[Web Renderer] === Starting initialization ===')
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
// 直接从 @quicktvui/web-renderer 导入所有需要的函数
|
|
10
|
+
import {
|
|
11
|
+
initAsyncLocalStorage,
|
|
12
|
+
initAutoProxy,
|
|
13
|
+
setupSceneBuilder,
|
|
14
|
+
createWebEngine,
|
|
15
|
+
applyAllPatches,
|
|
16
|
+
TVFocusManager,
|
|
17
|
+
startWebEngine,
|
|
18
|
+
APP_NAME,
|
|
19
|
+
IJKPlayerComponent,
|
|
20
|
+
} from '@quicktvui/web-renderer'
|
|
8
21
|
|
|
9
|
-
|
|
22
|
+
// Step 0: Initialize async localStorage (must be first, before any code uses localStorage)
|
|
23
|
+
initAsyncLocalStorage()
|
|
10
24
|
|
|
25
|
+
// Step 0.1: Initialize auto proxy for development
|
|
26
|
+
initAutoProxy()
|
|
27
|
+
|
|
28
|
+
// Step 0.2: Register IJKPlayerComponent for web video
|
|
29
|
+
global.__WEB_COMPONENTS__ = global.__WEB_COMPONENTS__ || {}
|
|
30
|
+
global.__WEB_COMPONENTS__['IJKPlayerComponent'] = IJKPlayerComponent
|
|
31
|
+
|
|
32
|
+
// Step 1: Setup SceneBuilder (must be done before main.ts loads)
|
|
33
|
+
setupSceneBuilder()
|
|
34
|
+
|
|
35
|
+
// Step 2: Create the web engine
|
|
36
|
+
const engine = createWebEngine()
|
|
37
|
+
|
|
38
|
+
// Step 3: Apply all patches BEFORE starting
|
|
39
|
+
applyAllPatches(engine)
|
|
40
|
+
|
|
41
|
+
// Step 4: Initialize TV Focus Manager
|
|
42
|
+
const focusManager = new TVFocusManager()
|
|
43
|
+
global.__TV_FOCUS_MANAGER__ = focusManager
|
|
44
|
+
console.log('[Web Renderer] TVFocusManager initialized')
|
|
45
|
+
|
|
46
|
+
// Step 5: Inject global CSS to match Android layout behavior
|
|
47
|
+
const styleEl = document.createElement('style')
|
|
48
|
+
styleEl.id = 'web-platform-reset'
|
|
49
|
+
styleEl.textContent = `
|
|
50
|
+
/* Web-Android Layout Compatibility Reset */
|
|
51
|
+
|
|
52
|
+
/* Disable flex cross-axis stretching (Android behavior) */
|
|
53
|
+
/* In Android, children don't auto-fill parent's cross dimension */
|
|
54
|
+
#app,
|
|
55
|
+
#app * {
|
|
56
|
+
align-items: flex-start;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Elements with explicit style should override the reset */
|
|
60
|
+
[style*="align-items"] {
|
|
61
|
+
align-items: var(--align-items, center) !important;
|
|
62
|
+
}
|
|
63
|
+
`
|
|
64
|
+
document.head.appendChild(styleEl)
|
|
65
|
+
console.log('[Web Renderer] Global CSS reset injected for Android-compatible layout')
|
|
66
|
+
|
|
67
|
+
// Step 6: Import main module (this will initialize Vue app and router)
|
|
11
68
|
console.log('[Web Renderer] Importing main module...')
|
|
12
69
|
import(__QUICKTVUI_MAIN_ENTRY__)
|
|
13
70
|
|
|
71
|
+
// Step 7: Start the engine
|
|
14
72
|
console.log('[Web Renderer] Starting engine...')
|
|
15
|
-
|
|
16
|
-
|
|
73
|
+
startWebEngine(engine, APP_NAME)
|
|
74
|
+
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
console.log('[Web Renderer] === Initialization complete ===')
|
|
77
|
+
}, 1000)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quicktvui/web-cli",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.10",
|
|
4
4
|
"description": "CLI tool for QuickTVUI web development - zero configuration",
|
|
5
5
|
"author": "QuickTVUI Team",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"minimist": "^1.2.8",
|
|
25
25
|
"shelljs": "^0.10.0",
|
|
26
|
-
"signale": "^1.4.0"
|
|
26
|
+
"signale": "^1.4.0",
|
|
27
|
+
"@quicktvui/web-renderer": "^1.0.5",
|
|
28
|
+
"scope-loader": "^1.0.3"
|
|
27
29
|
},
|
|
28
30
|
"peerDependencies": {
|
|
29
31
|
"webpack": "^5.0.0",
|
|
@@ -35,7 +37,8 @@
|
|
|
35
37
|
"babel-loader": "^9.0.0",
|
|
36
38
|
"ts-loader": "^9.4.0",
|
|
37
39
|
"css-loader": "^6.0.0",
|
|
38
|
-
"extscreen-router": ">=3.0.1"
|
|
40
|
+
"@extscreen/es3-router": ">=3.0.1",
|
|
41
|
+
"@extscreen/es3-vue": ">=3.0.0"
|
|
39
42
|
},
|
|
40
43
|
"peerDependenciesMeta": {
|
|
41
44
|
"less-loader": { "optional": true },
|