cj-tauri 2.0.0 → 2.1.0
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/README.md +113 -99
- package/bin/cj-tauri.js +287 -287
- package/cjpm.toml +63 -52
- package/cli/cjpm.toml +22 -22
- package/cli/src/doctor.cj +308 -306
- package/cli/src/main.cj +129 -129
- package/cli/src/manifest.cj +632 -558
- package/cli/src/manifest_test.cj +87 -0
- package/cli/src/project.cj +770 -770
- package/cli/src/resolve.cj +348 -348
- package/cli/src/scaffold.cj +369 -369
- package/cli/src/sync.cj +526 -526
- package/cli/src/util.cj +168 -168
- package/cli/templates/app/README.md +51 -48
- package/cli/templates/app/assets/capabilities/default.json +7 -7
- package/cli/templates/app/assets/ui/index.html +120 -118
- package/cli/templates/app/cj-tauri.toml +32 -22
- package/cli/templates/app/cjpm.toml +34 -34
- package/cli/templates/app/src/main.cj +101 -90
- package/cli/templates/app-react/README.md +56 -56
- package/cli/templates/app-react/assets/capabilities/default.json +7 -7
- package/cli/templates/app-react/assets/ui/index.html +25 -25
- package/cli/templates/app-react/assets/ui/package.json +19 -19
- package/cli/templates/app-react/assets/ui/src/App.css +67 -67
- package/cli/templates/app-react/assets/ui/src/App.jsx +124 -124
- package/cli/templates/app-react/assets/ui/src/main.jsx +6 -6
- package/cli/templates/app-react/assets/ui/vite.config.js +24 -24
- package/cli/templates/app-react/cj-tauri.toml +33 -23
- package/cli/templates/app-react/cjpm.toml +34 -34
- package/cli/templates/app-react/src/main.cj +91 -91
- package/cli/templates/app-vue/README.md +56 -56
- package/cli/templates/app-vue/assets/capabilities/default.json +7 -7
- package/cli/templates/app-vue/assets/ui/index.html +25 -25
- package/cli/templates/app-vue/assets/ui/package.json +18 -18
- package/cli/templates/app-vue/assets/ui/src/App.vue +176 -176
- package/cli/templates/app-vue/assets/ui/src/main.js +4 -4
- package/cli/templates/app-vue/assets/ui/vite.config.js +24 -24
- package/cli/templates/app-vue/cj-tauri.toml +33 -23
- package/cli/templates/app-vue/cjpm.toml +34 -34
- package/cli/templates/app-vue/src/main.cj +91 -91
- package/cli/templates/ohos-skeleton/AppScope/app.json5 +13 -13
- package/cli/templates/ohos-skeleton/AppScope/resources/base/element/string.json +8 -8
- package/cli/templates/ohos-skeleton/AppScope/resources/base/media/layered_image.json +6 -6
- package/cli/templates/ohos-skeleton/README.md +84 -79
- package/cli/templates/ohos-skeleton/build-hap.sh +15 -0
- package/cli/templates/ohos-skeleton/build-profile.json5 +46 -46
- package/cli/templates/ohos-skeleton/entry/build-profile.json5 +26 -26
- package/cli/templates/ohos-skeleton/entry/cjpm.toml +51 -43
- package/cli/templates/ohos-skeleton/entry/hvigorfile.ts +6 -6
- package/cli/templates/ohos-skeleton/entry/oh-package.json5 +9 -9
- package/cli/templates/ohos-skeleton/entry/src/main/cangjie/ability_stage.cj +17 -17
- package/cli/templates/ohos-skeleton/entry/src/main/cangjie/app_host.cj +94 -94
- package/cli/templates/ohos-skeleton/entry/src/main/cangjie/dialog_host.cj +217 -0
- package/cli/templates/ohos-skeleton/entry/src/main/cangjie/index.cj +527 -167
- package/cli/templates/ohos-skeleton/entry/src/main/cangjie/main_ability.cj +139 -139
- package/cli/templates/ohos-skeleton/entry/src/main/module.json5 +57 -49
- package/cli/templates/ohos-skeleton/entry/src/main/resources/base/element/color.json +8 -8
- package/cli/templates/ohos-skeleton/entry/src/main/resources/base/element/string.json +16 -16
- package/cli/templates/ohos-skeleton/entry/src/main/resources/base/media/layered_image.json +6 -6
- package/cli/templates/ohos-skeleton/entry/src/main/resources/base/profile/main_pages.json +2 -2
- package/cli/templates/ohos-skeleton/entry/src/main/resources/rawfile/capabilities.json +6 -6
- package/cli/templates/ohos-skeleton/entry/src/main/resources/rawfile/index.html +92 -92
- package/cli/templates/ohos-skeleton/hvigor/hvigor-config.json5 +5 -5
- package/cli/templates/ohos-skeleton/hvigorfile.ts +6 -6
- package/cli/templates/ohos-skeleton/oh-package.json5 +10 -10
- package/native/build_win.bat +62 -62
- package/native/core/bridge_core.c +1681 -1626
- package/native/core/bridge_core.h +675 -618
- package/native/core/bridge_js.h +108 -108
- package/native/platforms/harmonyos/README.md +115 -6
- package/native/platforms/linux/bridge_linux.c +2787 -2485
- package/native/platforms/windows/bridge_win.c +3740 -3248
- package/native/tests/gtk_threading_probe.c +143 -143
- package/native/tests/test_bridge_core.c +1339 -1228
- package/package.json +53 -53
- package/prebuilt/linux-x64/cj-tauri +0 -0
- package/src/api_system.cj +67 -67
- package/src/app.cj +325 -969
- package/src/app_events.cj +166 -0
- package/src/app_host_ops.cj +287 -0
- package/src/app_run.cj +283 -0
- package/src/app_spec.cj +76 -76
- package/src/arkweb_menu.cj +216 -0
- package/src/arkweb_script.cj +142 -142
- package/src/capability.cj +409 -409
- package/src/clipboard_bridge.cj +178 -0
- package/src/dialog_spec.cj +79 -0
- package/src/dragdrop.cj +26 -26
- package/src/embedded_assets.cj +98 -98
- package/src/host.cj +752 -607
- package/src/host_arkweb.cj +924 -778
- package/src/host_webkit.cj +663 -570
- package/src/host_webview2.cj +663 -570
- package/src/hotkey.cj +66 -66
- package/src/ipc_hub.cj +337 -337
- package/src/ipc_message.cj +286 -286
- package/src/launch.cj +62 -62
- package/src/logging.cj +127 -127
- package/src/menu.cj +197 -197
- package/src/platform/platform_app_context.cj +77 -77
- package/src/platform/platform_assets.cj +33 -33
- package/src/platform/platform_discover.cj +176 -176
- package/src/platform/platform_env.cj +29 -29
- package/src/platform/platform_feature.cj +31 -31
- package/src/platform/platform_page_source.cj +87 -87
- package/src/platform/platform_target_info.cj +32 -32
- package/src/platform_host_provider.cj +87 -87
- package/src/plugin.cj +333 -333
- package/src/plugins/clipboard/plugin_clipboard.cj +152 -152
- package/src/plugins/dialog/plugin_dialog.cj +209 -209
- package/src/plugins/fs/plugin_fs.cj +105 -1
- package/src/plugins/http/http_backend.cj +131 -0
- package/src/plugins/http/http_desktop.cj +195 -0
- package/src/plugins/http/http_ohos.cj +204 -0
- package/src/plugins/http/plugin_http.cj +310 -459
- package/src/plugins/log/plugin_log.cj +105 -105
- package/src/plugins/menu/plugin_menu.cj +158 -158
- package/src/plugins/notification/plugin_notification.cj +154 -154
- package/src/plugins/serial/plugin_serial.cj +458 -454
- package/src/plugins/serial/serial_bridge.cj +194 -194
- package/src/plugins/serial/serial_manager_ohos.cj +92 -0
- package/src/plugins/serial/serial_ohos.cj +529 -0
- package/src/plugins/shell/plugin_shell.cj +258 -258
- package/src/plugins/sqlite/plugin_sqlite.cj +705 -710
- package/src/plugins/sqlite/sqlite_ffi.cj +206 -211
- package/src/plugins/ws/plugin_ws.cj +488 -470
- package/src/process_hidden.cj +174 -174
- package/src/scope.cj +391 -391
- package/src/shell_event.cj +69 -69
- package/src/tests/app_spec_test.cj +126 -127
- package/src/tests/capability_test.cj +243 -243
- package/src/tests/dialog_spec_test.cj +73 -0
- package/src/tests/fake_host.cj +201 -201
- package/src/tests/ipc_hub_test.cj +487 -487
- package/src/tests/logging_test.cj +62 -62
- package/src/tests/platform_contract_test.cj +251 -251
- package/src/tests/plugin_clipboard_test.cj +222 -222
- package/src/tests/plugin_dialog_test.cj +237 -237
- package/src/tests/plugin_fs_test.cj +207 -0
- package/src/tests/plugin_http_test.cj +124 -124
- package/src/tests/plugin_notification_test.cj +205 -205
- package/src/tests/plugin_serial_test.cj +48 -0
- package/src/tests/plugin_test.cj +605 -585
- package/src/tests/plugin_ws_test.cj +40 -40
- package/src/tests/process_hidden_test.cj +129 -129
- package/src/tests/scope_test.cj +350 -350
- package/src/tests/system_host_test.cj +99 -81
- package/src/tests/urlutil_test.cj +53 -53
- package/src/tests/version_test.cj +75 -75
- package/src/tests/window_registry_test.cj +123 -123
- package/src/tray.cj +90 -90
- package/src/urlutil.cj +159 -159
- package/src/version.cj +44 -44
- package/src/window.cj +51 -51
- package/src/window_registry.cj +116 -116
- package/prebuilt/win32-x64/cj-tauri.exe +0 -0
- package/src/plugins/serial/serial_ohos_stub.cj +0 -61
- package/src/plugins/sqlite/sqlite_ohos_stub.cj +0 -91
package/cjpm.toml
CHANGED
|
@@ -1,52 +1,63 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
cjc-version = "1.0.5"
|
|
3
|
-
name = "cjTauri"
|
|
4
|
-
description = "仓颉版 Tauri:轻量跨端混合开发框架(WebView 宿主 + IPC 桥 + 能力安全模型)"
|
|
5
|
-
version = "2.
|
|
6
|
-
target-dir = ""
|
|
7
|
-
output-type = "static"
|
|
8
|
-
compile-option = ""
|
|
9
|
-
override-compile-option = ""
|
|
10
|
-
link-option = ""
|
|
11
|
-
package-configuration = {}
|
|
12
|
-
|
|
13
|
-
[dependencies]
|
|
14
|
-
|
|
15
|
-
[target.x86_64-unknown-linux-gnu]
|
|
16
|
-
# -lsqlite3:sqlite 插件直连发行版系统库(D-018 第 8 条);Windows 侧未落地,故 mingw 段不加
|
|
17
|
-
link-option = "-Lnative -lcjtbridge -lsqlite3 -lwebkit2gtk-4.1 -lgtk-3 -lgdk-3 -lglib-2.0 -lgio-2.0 -lsoup-3.0 -ljavascriptcoregtk-4.1 -lgobject-2.0"
|
|
18
|
-
|
|
19
|
-
[target.x86_64-unknown-linux-gnu.bin-dependencies]
|
|
20
|
-
path-option = ["${CANGJIE_STDX}"]
|
|
21
|
-
|
|
22
|
-
[target.x86_64-w64-mingw32]
|
|
23
|
-
# -lsqlite3:sqlite 插件子包需要(导入库 libsqlite3.a 由 sqlite3.def 生成,DLL 本身不入库——
|
|
24
|
-
# 跑 sqlite 相关测试/应用时本机自备 native/sqlite3.dll;不碰 sqlite 的应用不引用它就不链接)
|
|
25
|
-
link-option = "-Lnative -lcjtbridge -lsqlite3"
|
|
26
|
-
|
|
27
|
-
[target.x86_64-w64-mingw32.bin-dependencies]
|
|
28
|
-
path-option = ["${CANGJIE_STDX}"]
|
|
29
|
-
|
|
30
|
-
[target.aarch64-linux-ohos]
|
|
31
|
-
# 鸿蒙目标(真机 / 鸿蒙 PC):交叉编译工具链与 sysroot 由 DevEco 仓颉套件提供,
|
|
32
|
-
# 四个路径全部走环境变量展开——hvigor 构建时由插件注入前两个,命令行交叉编译时自行 export 同名变量。
|
|
33
|
-
# 照抄 DevEco 生成的工程(TestCj2)同一串参数,避免两套口径。
|
|
34
|
-
# 末尾的 `--dy-std` 不可省:鸿蒙上应用模块(entry)是 `output-type = "dynamic"` 且用动态 std,
|
|
35
|
-
# 框架包若按默认的静态 std 编,两者混进同一个 .so 就会出现**两套 std 运行时**——表象是
|
|
36
|
-
# 启动即崩在框架包全局初始化(`cjTauri::package_global_init` → 跨包 `_CGP*` 包初始化符号
|
|
37
|
-
# 解析到模块内偏移、跳到未映射地址 0x50xxx),窗口起不来且 hilog 只有一行 SIGSEGV。
|
|
38
|
-
# 只加在鸿蒙段:桌面两平台仍是静态 std,产物形态不变。
|
|
39
|
-
compile-option = "-B \"${DEVECO_CANGJIE_HOME}/build-tools/third_party/llvm/bin\" -B \"${DEVECO_OH_NATIVE_HOME}/sysroot/usr/lib/aarch64-linux-ohos\" -L \"${DEVECO_OH_NATIVE_HOME}/sysroot/usr/lib/aarch64-linux-ohos\" -L \"${DEVECO_OH_NATIVE_HOME}/llvm/lib/clang/15.0.4/lib/aarch64-linux-ohos\" -L \"${DEVECO_OH_NATIVE_HOME}/llvm/lib/aarch64-linux-ohos\" --sysroot \"${DEVECO_OH_NATIVE_HOME}/sysroot\" --dy-std"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
[package]
|
|
2
|
+
cjc-version = "1.0.5"
|
|
3
|
+
name = "cjTauri"
|
|
4
|
+
description = "仓颉版 Tauri:轻量跨端混合开发框架(WebView 宿主 + IPC 桥 + 能力安全模型)"
|
|
5
|
+
version = "2.1.0"
|
|
6
|
+
target-dir = ""
|
|
7
|
+
output-type = "static"
|
|
8
|
+
compile-option = ""
|
|
9
|
+
override-compile-option = ""
|
|
10
|
+
link-option = ""
|
|
11
|
+
package-configuration = {}
|
|
12
|
+
|
|
13
|
+
[dependencies]
|
|
14
|
+
|
|
15
|
+
[target.x86_64-unknown-linux-gnu]
|
|
16
|
+
# -lsqlite3:sqlite 插件直连发行版系统库(D-018 第 8 条);Windows 侧未落地,故 mingw 段不加
|
|
17
|
+
link-option = "-Lnative -lcjtbridge -lsqlite3 -lwebkit2gtk-4.1 -lgtk-3 -lgdk-3 -lglib-2.0 -lgio-2.0 -lsoup-3.0 -ljavascriptcoregtk-4.1 -lgobject-2.0"
|
|
18
|
+
|
|
19
|
+
[target.x86_64-unknown-linux-gnu.bin-dependencies]
|
|
20
|
+
path-option = ["${CANGJIE_STDX}"]
|
|
21
|
+
|
|
22
|
+
[target.x86_64-w64-mingw32]
|
|
23
|
+
# -lsqlite3:sqlite 插件子包需要(导入库 libsqlite3.a 由 sqlite3.def 生成,DLL 本身不入库——
|
|
24
|
+
# 跑 sqlite 相关测试/应用时本机自备 native/sqlite3.dll;不碰 sqlite 的应用不引用它就不链接)
|
|
25
|
+
link-option = "-Lnative -lcjtbridge -lsqlite3"
|
|
26
|
+
|
|
27
|
+
[target.x86_64-w64-mingw32.bin-dependencies]
|
|
28
|
+
path-option = ["${CANGJIE_STDX}"]
|
|
29
|
+
|
|
30
|
+
[target.aarch64-linux-ohos]
|
|
31
|
+
# 鸿蒙目标(真机 / 鸿蒙 PC):交叉编译工具链与 sysroot 由 DevEco 仓颉套件提供,
|
|
32
|
+
# 四个路径全部走环境变量展开——hvigor 构建时由插件注入前两个,命令行交叉编译时自行 export 同名变量。
|
|
33
|
+
# 照抄 DevEco 生成的工程(TestCj2)同一串参数,避免两套口径。
|
|
34
|
+
# 末尾的 `--dy-std` 不可省:鸿蒙上应用模块(entry)是 `output-type = "dynamic"` 且用动态 std,
|
|
35
|
+
# 框架包若按默认的静态 std 编,两者混进同一个 .so 就会出现**两套 std 运行时**——表象是
|
|
36
|
+
# 启动即崩在框架包全局初始化(`cjTauri::package_global_init` → 跨包 `_CGP*` 包初始化符号
|
|
37
|
+
# 解析到模块内偏移、跳到未映射地址 0x50xxx),窗口起不来且 hilog 只有一行 SIGSEGV。
|
|
38
|
+
# 只加在鸿蒙段:桌面两平台仍是静态 std,产物形态不变。
|
|
39
|
+
compile-option = "-B \"${DEVECO_CANGJIE_HOME}/build-tools/third_party/llvm/bin\" -B \"${DEVECO_OH_NATIVE_HOME}/sysroot/usr/lib/aarch64-linux-ohos\" -L \"${DEVECO_OH_NATIVE_HOME}/sysroot/usr/lib/aarch64-linux-ohos\" -L \"${DEVECO_OH_NATIVE_HOME}/llvm/lib/clang/15.0.4/lib/aarch64-linux-ohos\" -L \"${DEVECO_OH_NATIVE_HOME}/llvm/lib/aarch64-linux-ohos\" --sysroot \"${DEVECO_OH_NATIVE_HOME}/sysroot\" --dy-std"
|
|
40
|
+
|
|
41
|
+
# -lpasteboard -ludmf:剪贴板宿主能力直连系统粘贴板服务(`src/clipboard_bridge.cj` 的鸿蒙段用
|
|
42
|
+
# `OH_Pasteboard_*` / `OH_Udmf*` / `OH_UdsPlainText_*` 原生 C API——仓颉套件里没有 `ohos.pasteboard`
|
|
43
|
+
# 包,6.1 的 ohos 包里 340 个都没有它,只有旧的 5.0 Beta 带)。两组符号分属两个库
|
|
44
|
+
# (`OH_Pasteboard_*` 在 libpasteboard、其余在 libudmf),所以两个都要给。
|
|
45
|
+
# 库就在同一 sysroot 的 `usr/lib/aarch64-linux-ohos`(上面的 `-L` 已指着),运行时由系统提供
|
|
46
|
+
# (设备侧落在 `/system/lib64/ndk/`,DT_NEEDED 由 loader 在 ndk 命名空间里解析)。
|
|
47
|
+
# 注意:**真正生效的开关在 entry 模块的 cjpm.toml**(`output-type = dynamic`,链接发生在那儿);
|
|
48
|
+
# `cli/src/manifest.cj` 的 `renderOhosEntryToml` 会把它写进 `targets/ohos/entry/cjpm.toml`。
|
|
49
|
+
# 这里留着是给「直接 cjpm 交叉编译框架」的口径一致,漏了不影响 hap 构建。
|
|
50
|
+
link-option = "-lpasteboard -ludmf"
|
|
51
|
+
|
|
52
|
+
[target.aarch64-linux-ohos.bin-dependencies]
|
|
53
|
+
# stdx 必须用鸿蒙版(官方发布 cangjie-stdx-ohos-aarch64-<cjc 版本>.zip,桌面版 ABI 不通);
|
|
54
|
+
# CANGJIE_OHOS_LIBS 指 DevEco 套件的 api/lib/linux_ohos_aarch64_cjnative/ohos(仓颉标准库 + ohos API 绑定)。
|
|
55
|
+
#
|
|
56
|
+
# 后两项是 ArkUI 的**宏库**与 kit 绑定,hvigor 构建时由 cangjie-build-support 注入
|
|
57
|
+
# (cangjie-path-impl.js 的 getBuildEnvByAbi):AARCH64_MACRO_LIBS = <sdk>/api/macro/ohos
|
|
58
|
+
# (`lib-macro_ohos.arkui.state_macro_manage.dll` 就在里面),AARCH64_KIT_LIBS =
|
|
59
|
+
# .../linux_ohos_aarch64_cjnative/kit。**宏库目录漏挂的症状极具误导性**:`@Component` 的
|
|
60
|
+
# 声明能解析到(.cjo 在 ohos 目录里),但宏实现库找不到,报的是
|
|
61
|
+
# `macro evaluation has failed for macro call 'Component'`——看着像「宏不能用在框架包里」。
|
|
62
|
+
# 命令行交叉编译时这两个变量要自己 export,取值见上。
|
|
63
|
+
path-option = ["${CANGJIE_STDX_OHOS}", "${CANGJIE_OHOS_LIBS}", "${AARCH64_MACRO_LIBS}", "${AARCH64_KIT_LIBS}"]
|
package/cli/cjpm.toml
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
cjc-version = "1.0.5"
|
|
3
|
-
name = "cli"
|
|
4
|
-
description = "cj-tauri CLI:脚手架 create / dev / build / run / info"
|
|
5
|
-
version = "2.
|
|
6
|
-
target-dir = ""
|
|
7
|
-
output-type = "executable"
|
|
8
|
-
compile-option = ""
|
|
9
|
-
override-compile-option = ""
|
|
10
|
-
link-option = ""
|
|
11
|
-
package-configuration = {}
|
|
12
|
-
|
|
13
|
-
[dependencies]
|
|
14
|
-
|
|
15
|
-
[target.x86_64-unknown-linux-gnu.bin-dependencies]
|
|
16
|
-
path-option = ["${CANGJIE_STDX}"]
|
|
17
|
-
|
|
18
|
-
[target.x86_64-w64-mingw32.bin-dependencies]
|
|
19
|
-
# 与根 cjpm.toml 同口径:CLI 也 import stdx.encoding.json,Windows 上缺这一段时
|
|
20
|
-
# cjpm 报的是 `root package 'cli' imports package 'stdx.encoding.json' … not added as a
|
|
21
|
-
# dependency in cjpm.toml`(看着像 toml 漏配,其实是 Windows 目标段没声明 stdx)。
|
|
22
|
-
path-option = ["${CANGJIE_STDX}"]
|
|
1
|
+
[package]
|
|
2
|
+
cjc-version = "1.0.5"
|
|
3
|
+
name = "cli"
|
|
4
|
+
description = "cj-tauri CLI:脚手架 create / dev / build / run / info"
|
|
5
|
+
version = "2.1.0"
|
|
6
|
+
target-dir = ""
|
|
7
|
+
output-type = "executable"
|
|
8
|
+
compile-option = ""
|
|
9
|
+
override-compile-option = ""
|
|
10
|
+
link-option = ""
|
|
11
|
+
package-configuration = {}
|
|
12
|
+
|
|
13
|
+
[dependencies]
|
|
14
|
+
|
|
15
|
+
[target.x86_64-unknown-linux-gnu.bin-dependencies]
|
|
16
|
+
path-option = ["${CANGJIE_STDX}"]
|
|
17
|
+
|
|
18
|
+
[target.x86_64-w64-mingw32.bin-dependencies]
|
|
19
|
+
# 与根 cjpm.toml 同口径:CLI 也 import stdx.encoding.json,Windows 上缺这一段时
|
|
20
|
+
# cjpm 报的是 `root package 'cli' imports package 'stdx.encoding.json' … not added as a
|
|
21
|
+
# dependency in cjpm.toml`(看着像 toml 漏配,其实是 Windows 目标段没声明 stdx)。
|
|
22
|
+
path-option = ["${CANGJIE_STDX}"]
|