@lazycatcloud/lzc-cli 2.0.0-pre.0 → 2.0.0-pre.2

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 (92) hide show
  1. package/README.md +46 -7
  2. package/changelog.md +56 -19
  3. package/lib/app/apkshell.js +7 -44
  4. package/lib/app/index.js +5 -1
  5. package/lib/app/lpk_build.js +266 -56
  6. package/lib/app/lpk_build_images.js +424 -229
  7. package/lib/app/lpk_build_images_local.js +425 -0
  8. package/lib/app/lpk_build_images_pack_local.js +409 -0
  9. package/lib/app/lpk_create.js +158 -83
  10. package/lib/app/lpk_create_generator.js +35 -42
  11. package/lib/app/lpk_devshell.js +6 -2
  12. package/lib/app/lpk_installer.js +4 -3
  13. package/lib/app/manifest_build.js +259 -0
  14. package/lib/app/project_cp.js +5 -10
  15. package/lib/app/project_deploy.js +80 -11
  16. package/lib/app/project_exec.js +48 -11
  17. package/lib/app/project_info.js +59 -59
  18. package/lib/app/project_log.js +5 -10
  19. package/lib/app/project_runtime.js +113 -18
  20. package/lib/app/project_start.js +6 -11
  21. package/lib/app/project_sync.js +499 -0
  22. package/lib/appstore/apkshell.js +50 -0
  23. package/lib/appstore/publish.js +54 -15
  24. package/lib/build_remote.js +0 -1
  25. package/lib/config/index.js +1 -1
  26. package/lib/debug_bridge.js +217 -47
  27. package/lib/i18n/locales/en/translation.json +262 -262
  28. package/lib/i18n/locales/zh/translation.json +262 -262
  29. package/lib/lpk/core.js +2 -1
  30. package/lib/migrate/index.js +52 -0
  31. package/lib/package_info.js +135 -0
  32. package/lib/shellapi.js +35 -1
  33. package/lib/sig/core.js +2 -2
  34. package/lib/utils.js +92 -15
  35. package/package.json +89 -89
  36. package/scripts/cli.js +2 -0
  37. package/scripts/smoke/frontend-dev-entry.mjs +104 -0
  38. package/scripts/smoke/template-project.mjs +311 -0
  39. package/template/_lpk/README.md +6 -3
  40. package/template/_lpk/gui-vnc.manifest.yml.in +0 -9
  41. package/template/_lpk/hello-vue.manifest.yml.in +38 -0
  42. package/template/_lpk/manifest.yml.in +0 -9
  43. package/template/_lpk/package.yml.in +7 -0
  44. package/template/_lpk/todolist-golang.manifest.yml.in +23 -9
  45. package/template/_lpk/todolist-java.manifest.yml.in +23 -9
  46. package/template/_lpk/todolist-python.manifest.yml.in +31 -9
  47. package/template/_lpk/todolist-serverless.manifest.yml.in +38 -0
  48. package/template/blank/lzc-build.dev.yml +4 -0
  49. package/template/blank/lzc-build.yml +0 -2
  50. package/template/blank/lzc-manifest.yml +3 -12
  51. package/template/blank/package.yml +7 -0
  52. package/template/golang/Dockerfile +1 -1
  53. package/template/golang/Dockerfile.dev +20 -0
  54. package/template/golang/README.md +22 -11
  55. package/template/golang/_lzcdevignore +21 -0
  56. package/template/golang/lzc-build.dev.yml +12 -0
  57. package/template/golang/lzc-build.yml +0 -5
  58. package/template/golang/main.go +1 -1
  59. package/template/golang/manifest.dev.page.js +24 -0
  60. package/template/golang/run.sh +7 -0
  61. package/template/gui-vnc/README.md +5 -1
  62. package/template/gui-vnc/lzc-build.dev.yml +4 -0
  63. package/template/gui-vnc/lzc-build.yml +0 -5
  64. package/template/python/Dockerfile +2 -2
  65. package/template/python/Dockerfile.dev +18 -0
  66. package/template/python/README.md +28 -11
  67. package/template/python/_lzcdevignore +21 -0
  68. package/template/python/app.py +1 -1
  69. package/template/python/lzc-build.dev.yml +12 -0
  70. package/template/python/lzc-build.yml +0 -5
  71. package/template/python/manifest.dev.page.js +25 -0
  72. package/template/python/run.sh +12 -1
  73. package/template/springboot/Dockerfile +1 -1
  74. package/template/springboot/Dockerfile.dev +20 -0
  75. package/template/springboot/README.md +22 -11
  76. package/template/springboot/_lzcdevignore +21 -0
  77. package/template/springboot/lzc-build.dev.yml +12 -0
  78. package/template/springboot/lzc-build.yml +0 -5
  79. package/template/springboot/manifest.dev.page.js +24 -0
  80. package/template/springboot/run.sh +7 -0
  81. package/template/vue/README.md +14 -27
  82. package/template/vue/_gitignore +0 -1
  83. package/template/vue/lzc-build.dev.yml +7 -0
  84. package/template/vue/lzc-build.yml +0 -2
  85. package/template/vue/manifest.dev.page.js +50 -0
  86. package/template/vue/src/App.vue +1 -1
  87. package/template/vue-minidb/README.md +11 -19
  88. package/template/vue-minidb/_gitignore +0 -1
  89. package/template/vue-minidb/lzc-build.dev.yml +7 -0
  90. package/template/vue-minidb/lzc-build.yml +0 -2
  91. package/template/vue-minidb/manifest.dev.page.js +50 -0
  92. package/template/blank/_gitignore +0 -1
@@ -0,0 +1,50 @@
1
+ function renderDevPage(state, port) {
2
+ const pageTitle = "Frontend Dev";
3
+ const portText = port === undefined || port === null ? "" : String(port);
4
+ const configs = {
5
+ not_linked: {
6
+ title: "Dev machine is not linked yet",
7
+ subtitle: "This app is waiting for a frontend dev server from the machine that runs lzc-cli project deploy.",
8
+ steps: [
9
+ "Run <code>lzc-cli project deploy</code> on your dev machine.",
10
+ "Start your local dev server with <code>npm run dev</code>.",
11
+ "Refresh this page after the dev server is listening on port <code>" + portText + "</code>.",
12
+ ],
13
+ },
14
+ offline: {
15
+ title: "Dev machine is offline",
16
+ subtitle: "The linked dev machine is not reachable right now.",
17
+ steps: [
18
+ "Bring the dev machine online.",
19
+ "Start your local dev server with <code>npm run dev</code>.",
20
+ "Refresh this page after port <code>" + portText + "</code> is ready.",
21
+ ],
22
+ },
23
+ not_ready: {
24
+ title: "Frontend dev server is not ready",
25
+ subtitle: "This app is running in dev mode and will proxy requests to your linked dev machine.",
26
+ steps: [
27
+ "Start your local dev server with <code>npm run dev</code>.",
28
+ "Make sure the dev server listens on port <code>" + portText + "</code>.",
29
+ "Refresh this page after the server is ready.",
30
+ ],
31
+ },
32
+ };
33
+ const config = configs[state] ?? configs.not_ready;
34
+ const title = config.title;
35
+ const subtitle = config.subtitle;
36
+ const steps = config.steps;
37
+ const items = steps.map(function (step) {
38
+ return "<li>" + step + "</li>";
39
+ }).join("");
40
+ const portBadge = portText ? "<div class=\"pill\">Expected local port: " + portText + "</div>" : "";
41
+ return [
42
+ "<!doctype html>",
43
+ "<html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><title>", pageTitle, "</title><style>",
44
+ "body{margin:0;padding:32px;font-family:ui-sans-serif,system-ui,sans-serif;background:#f5f8fc;color:#112033}",
45
+ ".card{max-width:760px;margin:0 auto;background:#fff;border:1px solid #d9e4f2;border-radius:18px;padding:24px;box-shadow:0 16px 40px rgba(17,32,51,.08)}",
46
+ "h1{margin:0 0 12px;font-size:32px}.muted{color:#51627a}.pill{display:inline-block;margin:16px 0 0;padding:6px 10px;border-radius:999px;background:#eef5ff;color:#0c5dd6;font-weight:600}",
47
+ "ol{margin:18px 0 0;padding-left:20px;line-height:1.8}code{background:#f2f6fb;border-radius:8px;padding:2px 6px}button{margin-top:20px;border:0;border-radius:10px;padding:10px 14px;background:#112033;color:#fff;cursor:pointer}",
48
+ "</style></head><body><main class=\"card\"><h1>", title, "</h1><p class=\"muted\">", subtitle, "</p>", portBadge, "<ol>", items, "</ol><button onclick=\"location.reload()\">Refresh</button></main></body></html>",
49
+ ].join("");
50
+ }
@@ -19,7 +19,7 @@ const highlights = [
19
19
  <main class="hero-shell">
20
20
  <section class="hero-card">
21
21
  <p class="tag">Lazycat Cloud App Template</p>
22
- <h1>Welcome to Lazycat Microservice</h1>
22
+ <h1>Welcome to Lazycat Microserver</h1>
23
23
  <p class="lead">
24
24
  This Vue starter is tailored for Lazycat Cloud. Build your app UI, deploy with lzc-cli,
25
25
  and deliver a consistent experience across devices.
@@ -1,4 +1,4 @@
1
- # Lazycat Vue MiniDB App
1
+ # Lazycat Serverless Todo App
2
2
 
3
3
  ## First Deploy
4
4
  ```bash
@@ -6,29 +6,21 @@ lzc-cli project deploy
6
6
  lzc-cli project info
7
7
  ```
8
8
 
9
- Then open the app from launcher or browser.
9
+ By default, project commands use `lzc-build.dev.yml` when it exists.
10
+ Each command prints the active `Build config`.
11
+ Use `--release` if you want to operate on `lzc-build.yml`.
10
12
 
11
- ## What this template includes
12
- - Vue 3 + Vite
13
- - @lazycatcloud/minidb
14
- - A minimal todo example with add/update/delete
13
+ Open the app first.
14
+ If the frontend dev server is not running yet, the app page will show the expected port and next step.
15
15
 
16
- ## Redeploy after code changes
16
+ ## Frontend Dev Loop
17
17
  ```bash
18
- lzc-cli project deploy
19
- ```
20
-
21
- ## Troubleshooting
22
- ```bash
23
- lzc-cli project log -f
18
+ npm run dev
24
19
  ```
25
20
 
26
- ## Build LPK
27
- ```bash
28
- lzc-cli project build -o vue-minidb-app.lpk
29
- ```
21
+ Then refresh the app page.
30
22
 
31
- ## Install
23
+ ## Logs
32
24
  ```bash
33
- lzc-cli lpk install vue-minidb-app.lpk
25
+ lzc-cli project log -f
34
26
  ```
@@ -23,4 +23,3 @@ pnpm-debug.log*
23
23
  *.sw?
24
24
  .temp
25
25
  .cache
26
- lzc-build.base.yml
@@ -0,0 +1,7 @@
1
+ # 开发态覆盖配置
2
+
3
+ # pkg_id_suffix: append an extra package id segment for dev deploys
4
+ pkg_id_suffix: dev
5
+
6
+ envs:
7
+ - DEV_MODE=1
@@ -1,5 +1,3 @@
1
- # 可选基础文件: lzc-build.base.yml(与当前文件同目录,先加载再与当前文件合并)
2
-
3
1
  # buildscript
4
2
  # - 可以为构建脚本的路径地址
5
3
  # - 如果构建命令简单,也可以直接写 sh 的命令
@@ -0,0 +1,50 @@
1
+ function renderDevPage(state, port) {
2
+ const pageTitle = "Frontend Dev";
3
+ const portText = port === undefined || port === null ? "" : String(port);
4
+ const configs = {
5
+ not_linked: {
6
+ title: "Dev machine is not linked yet",
7
+ subtitle: "This app is waiting for a frontend dev server from the machine that runs lzc-cli project deploy.",
8
+ steps: [
9
+ "Run <code>lzc-cli project deploy</code> on your dev machine.",
10
+ "Start your local dev server with <code>npm run dev</code>.",
11
+ "Refresh this page after the dev server is listening on port <code>" + portText + "</code>.",
12
+ ],
13
+ },
14
+ offline: {
15
+ title: "Dev machine is offline",
16
+ subtitle: "The linked dev machine is not reachable right now.",
17
+ steps: [
18
+ "Bring the dev machine online.",
19
+ "Start your local dev server with <code>npm run dev</code>.",
20
+ "Refresh this page after port <code>" + portText + "</code> is ready.",
21
+ ],
22
+ },
23
+ not_ready: {
24
+ title: "Frontend dev server is not ready",
25
+ subtitle: "This app is running in dev mode and will proxy requests to your linked dev machine.",
26
+ steps: [
27
+ "Start your local dev server with <code>npm run dev</code>.",
28
+ "Make sure the dev server listens on port <code>" + portText + "</code>.",
29
+ "Refresh this page after the server is ready.",
30
+ ],
31
+ },
32
+ };
33
+ const config = configs[state] ?? configs.not_ready;
34
+ const title = config.title;
35
+ const subtitle = config.subtitle;
36
+ const steps = config.steps;
37
+ const items = steps.map(function (step) {
38
+ return "<li>" + step + "</li>";
39
+ }).join("");
40
+ const portBadge = portText ? "<div class=\"pill\">Expected local port: " + portText + "</div>" : "";
41
+ return [
42
+ "<!doctype html>",
43
+ "<html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><title>", pageTitle, "</title><style>",
44
+ "body{margin:0;padding:32px;font-family:ui-sans-serif,system-ui,sans-serif;background:#f5f8fc;color:#112033}",
45
+ ".card{max-width:760px;margin:0 auto;background:#fff;border:1px solid #d9e4f2;border-radius:18px;padding:24px;box-shadow:0 16px 40px rgba(17,32,51,.08)}",
46
+ "h1{margin:0 0 12px;font-size:32px}.muted{color:#51627a}.pill{display:inline-block;margin:16px 0 0;padding:6px 10px;border-radius:999px;background:#eef5ff;color:#0c5dd6;font-weight:600}",
47
+ "ol{margin:18px 0 0;padding-left:20px;line-height:1.8}code{background:#f2f6fb;border-radius:8px;padding:2px 6px}button{margin-top:20px;border:0;border-radius:10px;padding:10px 14px;background:#112033;color:#fff;cursor:pointer}",
48
+ "</style></head><body><main class=\"card\"><h1>", title, "</h1><p class=\"muted\">", subtitle, "</p>", portBadge, "<ol>", items, "</ol><button onclick=\"location.reload()\">Refresh</button></main></body></html>",
49
+ ].join("");
50
+ }
@@ -1 +0,0 @@
1
- lzc-build.base.yml