@yufengtadian/freedom-cli 1.12.0 → 1.12.12

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.
Files changed (57) hide show
  1. package/README.md +25 -29
  2. package/lib/build.js +1 -1
  3. package/lib/cli.js +10 -10
  4. package/lib/config.js +115 -31
  5. package/lib/tui.js +1 -1
  6. package/lib/utils.js +7 -3
  7. package/package.json +1 -1
  8. package/shell/win-x64/freedom-shell.exe +0 -0
  9. package/templates/go/build_out.txt +0 -0
  10. package/templates/go/err.txt +2 -0
  11. package/templates/go/err10.txt +0 -0
  12. package/templates/go/err11.txt +0 -0
  13. package/templates/go/err2.txt +0 -0
  14. package/templates/go/err3.txt +0 -0
  15. package/templates/go/err4.txt +1 -0
  16. package/templates/go/err5.txt +0 -0
  17. package/templates/go/err6.txt +0 -0
  18. package/templates/go/err7.txt +0 -0
  19. package/templates/go/err8.txt +0 -0
  20. package/templates/go/err9.txt +0 -0
  21. package/templates/go/go.mod +6 -0
  22. package/templates/go/go.mod.bak_gbk +11 -0
  23. package/templates/go/go.sum +2 -2
  24. package/templates/go/pkg/freedom/assets/freedom.js +6 -0
  25. package/templates/go/pkg/freedom/assets/index.html +1 -1
  26. package/templates/go/pkg/freedom/configfile.go +0 -2
  27. package/templates/go/pkg/freedom/freedom.go +16 -10
  28. package/templates/go/pkg/freedom/window_other.go +60 -12
  29. package/templates/go/pkg/freedom/window_windows.go +244 -29
  30. package/templates/go/tidy.txt +0 -0
  31. package/templates/go/vet_out.txt +0 -0
  32. package/templates/go/webview_go/.github/workflows/ci.yaml +62 -0
  33. package/templates/go/webview_go/CHANGELOG.md +15 -0
  34. package/templates/go/webview_go/LICENSE +22 -0
  35. package/templates/go/webview_go/README.md +50 -0
  36. package/templates/go/webview_go/examples/basic/main.go +12 -0
  37. package/templates/go/webview_go/examples/bind/main.go +38 -0
  38. package/templates/go/webview_go/glue.c +36 -0
  39. package/templates/go/webview_go/go.mod +3 -0
  40. package/templates/go/webview_go/go.sum +0 -0
  41. package/templates/go/webview_go/libs/mswebview2/LICENSE +27 -0
  42. package/templates/go/webview_go/libs/mswebview2/include/WebView2.h +23568 -0
  43. package/templates/go/webview_go/libs/mswebview2/include/vendor.go +2 -0
  44. package/templates/go/webview_go/libs/mswebview2/vendor.go +2 -0
  45. package/templates/go/webview_go/libs/mswebview2/version.txt +1 -0
  46. package/templates/go/webview_go/libs/webview/LICENSE +22 -0
  47. package/templates/go/webview_go/libs/webview/include/vendor.go +2 -0
  48. package/templates/go/webview_go/libs/webview/include/webview.h +3840 -0
  49. package/templates/go/webview_go/libs/webview/vendor.go +2 -0
  50. package/templates/go/webview_go/libs/webview/version.txt +1 -0
  51. package/templates/go/webview_go/webview.cc +1 -0
  52. package/templates/go/webview_go/webview.go +371 -0
  53. package/templates/go/webview_go/webview_test.go +50 -0
  54. package/templates/project/freedom.config.js +5 -5
  55. package/templates/project/index.html +45 -5
  56. package/templates/project/src/main.js +140 -6
  57. package/tutorial/tutorial.html +4 -5
@@ -48,9 +48,8 @@ npm install</code></pre>
48
48
 
49
49
  <h2>2. 调整标题栏(终端一键切换)</h2>
50
50
  <ul>
51
- <li><code>freedom titlebar native</code> — 保留系统原生标题栏(默认)</li>
52
- <li><code>freedom titlebar hidden</code> — 隐藏标题栏视觉,仅保留 Windows 原生最小化 / 最大化 / 关闭按钮</li>
53
- <li><code>freedom titlebar frameless</code> — 完全无边框,按钮由前端自绘(模板已内置示例)</li>
51
+ <li><code>freedom titlebar native</code> — 保留系统原生标题栏,标题栏图标与 exe 图标一致</li>
52
+ <li><code>freedom titlebar frameless</code> — 完全无边框(默认),标题栏与 Windows 原生最小化 / 最大化 / 关闭按钮均不存在,按钮由前端自绘(模板已内置示例)</li>
54
53
  </ul>
55
54
  <p>也可以直接编辑 <code>freedom.config.js</code> 里的 <code>titlebar</code> 字段。</p>
56
55
 
@@ -58,7 +57,7 @@ npm install</code></pre>
58
57
  <pre><code>freedom build
59
58
  freedom build --platform all # 三平台全量(win + mac + linux)
60
59
  freedom build --platform win-x64 # 仅 Windows
61
- freedom build --platform mac-arm64 # 仅 macOS Apple Silicon
60
+ freedom build --platform darwin-arm64 # 仅 macOS Apple Silicon
62
61
  freedom build --platform linux-x64 # 仅 Linux</code></pre>
63
62
  <p>前端经 Vite 打成单文件 HTML 后写入 <code>dist/resources/</code>,与随包分发的预编译壳二进制合并出可执行文件。不再依赖本机 Go 工具链,任一平台都能一键产出三平台产物。产物以 GUI 子系统运行,不会弹出 cmd 黑窗。</p>
64
63
  <p><code>resources/</code> 内含壳运行时加载的前端页面 <code>index.html</code> 与配置 <code>config.json</code>;声明了 <code>backend</code> 时 <code>backend/</code> 目录会被原样分发到 <code>resources/backend/</code>,壳启动后自动以 <code>resources/</code> 为工作目录拉起后端进程(黑窗同样隐藏)。</p>
@@ -75,7 +74,7 @@ freedom config set outDir dist # 恢复默认 dist/</code></pre>
75
74
  minWidth: 400, minHeight: 300,
76
75
  center: true, // 启动居中
77
76
  debug: false, // 开发者工具
78
- titlebar: 'native', // native | hidden | frameless
77
+ titlebar: 'frameless', // native | frameless
79
78
  outDir: 'dist', // 产物目录:dist(默认)| .(项目根目录)| 任意路径
80
79
  backend: undefined, // 任意语言后端进程,如 { command: 'node', args: ['backend/main.mjs'] }
81
80
  }</code></pre>