@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
@@ -1,18 +1,9 @@
1
- name: helloworld # 应用名称(启动器里显示)
2
- package: cloud.lazycat.app.helloworld # 应用唯一ID,建议使用反向域名格式
3
- version: 0.0.1 # 应用版本,建议遵循 semver
4
- description: # 应用描述
5
- license: https://choosealicense.com/licenses/mit/
6
- homepage: # 项目主页或文档地址
7
- author: # 作者信息
8
-
9
1
  # application 是默认前台服务,对应固定 service 名 app
10
2
  application:
11
3
  subdomain: helloworld # 默认访问子域名前缀
12
4
  routes:
13
5
  # 路由示例:把首页转发到一个外部站点
14
6
  # 常见写法:
15
- # - /=file:///lzcapp/pkg/content/dist (静态前端)
16
- # - /=exec://3000,/app/run.sh (执行命令并转发到端口)
17
- # - /api/=http://backend:3000/api/ (转发到其他 service)
18
- - /=https://developer.lazycat.cloud/
7
+ # - /=http://example.com
8
+ # - /=file:///lzcapp/pkg/content/html
9
+ - /=http://example.com
@@ -0,0 +1,7 @@
1
+ package: cloud.lazycat.app.helloworld # 应用唯一ID,建议使用反向域名格式
2
+ version: 0.0.1 # 应用版本
3
+ name: helloworld # 应用名称
4
+ description: # 应用描述
5
+ author: # 作者信息
6
+ license: https://choosealicense.com/licenses/mit/
7
+ homepage: # 项目主页或文档地址
@@ -13,7 +13,7 @@ WORKDIR /app
13
13
  COPY --from=builder /workspace/app /app/app
14
14
  COPY run.sh /app/run.sh
15
15
  RUN chmod +x /app/run.sh /app/app
16
- COPY web /lzcapp/pkg/content/web
16
+ COPY web /app/web
17
17
 
18
18
  EXPOSE 3000
19
19
  CMD ["/app/run.sh"]
@@ -0,0 +1,20 @@
1
+ FROM registry.lazycat.cloud/lzc/lzcapp:3.20.3 AS builder
2
+
3
+ RUN apk add --no-cache go
4
+ WORKDIR /workspace
5
+
6
+ COPY go.mod ./
7
+ COPY main.go ./
8
+ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /workspace/app ./main.go
9
+
10
+ FROM registry.lazycat.cloud/lzc/lzcapp:3.20.3
11
+
12
+ RUN apk add --no-cache go
13
+ WORKDIR /app
14
+ COPY --from=builder /workspace/app /app/app
15
+ COPY run.sh /app/run.sh
16
+ RUN chmod +x /app/run.sh /app/app
17
+ COPY web /app/web
18
+
19
+ EXPOSE 3000
20
+ CMD ["sh", "-lc", "trap : TERM INT; sleep infinity & wait"]
@@ -6,7 +6,28 @@ 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`.
12
+
13
+ Open the app first.
14
+ In dev mode, the app will not auto-start the Golang service.
15
+ If the backend service is not ready yet, the app page will show the expected port and what to do next.
16
+
17
+ ## Recommended Backend Dev Loop
18
+ ```bash
19
+ lzc-cli project sync --watch
20
+ lzc-cli project exec /bin/sh
21
+ /app/run.sh
22
+ ```
23
+
24
+ You can also build locally and use `lzc-cli project cp` instead of `project sync --watch`.
25
+
26
+ ## Troubleshooting
27
+ ```bash
28
+ lzc-cli project log -f
29
+ lzc-cli project exec /bin/sh
30
+ ```
10
31
 
11
32
  ## API
12
33
  ```text
@@ -21,13 +42,3 @@ DELETE /api/todos/{id}
21
42
  ```text
22
43
  /lzcapp/var/todos.json
23
44
  ```
24
-
25
- ## Build LPK
26
- ```bash
27
- lzc-cli project build -o golang-app.lpk
28
- ```
29
-
30
- ## Install
31
- ```bash
32
- lzc-cli lpk install golang-app.lpk
33
- ```
@@ -0,0 +1,21 @@
1
+ .git
2
+ .git/**
3
+ node_modules
4
+ node_modules/**
5
+ .venv
6
+ .venv/**
7
+ dist
8
+ dist/**
9
+ build
10
+ build/**
11
+ __pycache__
12
+ __pycache__/**
13
+ .idea
14
+ .idea/**
15
+ .vscode
16
+ .vscode/**
17
+ .DS_Store
18
+ .lzc-cli-*
19
+ .lzc-cli-*/**
20
+ *.lpk
21
+ *.lpk.tar
@@ -0,0 +1,12 @@
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
8
+
9
+ images:
10
+ app-runtime:
11
+ context: ./
12
+ dockerfile: ./Dockerfile.dev
@@ -1,11 +1,6 @@
1
- # 可选基础文件: lzc-build.base.yml(与当前文件同目录,先加载再与当前文件合并)
2
-
3
1
  # manifest: 指定 lpk 的 manifest 文件
4
2
  manifest: ./lzc-manifest.yml
5
3
 
6
- # contentdir: 需要打包进 lpk 的目录
7
- contentdir: ./
8
-
9
4
  # pkgout: lpk 输出目录
10
5
  pkgout: ./
11
6
 
@@ -247,6 +247,6 @@ func main() {
247
247
  writeJSON(w, http.StatusOK, map[string]bool{"ok": true})
248
248
  })
249
249
 
250
- mux.Handle("/", http.FileServer(http.Dir("/lzcapp/pkg/content/web")))
250
+ mux.Handle("/", http.FileServer(http.Dir("/app/web")))
251
251
  _ = http.ListenAndServe(":3000", mux)
252
252
  }
@@ -0,0 +1,24 @@
1
+ function renderDevPage(port) {
2
+ const title = "Backend dev service is not ready";
3
+ const subtitle = "This app is running in dev mode and expects the backend service to be started manually inside the app container.";
4
+ const pageTitle = "Backend Dev";
5
+ const steps = [
6
+ "Sync your latest code into the container with <code>lzc-cli project sync --watch</code> or copy it with <code>lzc-cli project cp</code>.",
7
+ "Open a shell with <code>lzc-cli project exec /bin/sh</code> and start or restart the backend process with <code>/app/run.sh</code>.",
8
+ "Refresh this page after port <code>" + String(port) + "</code> is ready.",
9
+ ];
10
+ const portText = port === undefined || port === null ? "" : String(port);
11
+ const items = steps.map(function (step) {
12
+ return "<li>" + step + "</li>";
13
+ }).join("");
14
+ const portBadge = portText ? "<div class=\"pill\">Expected local port: " + portText + "</div>" : "";
15
+ return [
16
+ "<!doctype html>",
17
+ "<html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><title>", pageTitle, "</title><style>",
18
+ "body{margin:0;padding:32px;font-family:ui-sans-serif,system-ui,sans-serif;background:#f5f8fc;color:#112033}",
19
+ ".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)}",
20
+ "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}",
21
+ "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}",
22
+ "</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>",
23
+ ].join("");
24
+ }
@@ -1,3 +1,10 @@
1
1
  #!/bin/sh
2
2
  set -e
3
+
4
+ mirror_root="/lzcapp/cache/project-mirror"
5
+ if command -v go >/dev/null 2>&1 && [ -f "$mirror_root/main.go" ]; then
6
+ cd "$mirror_root"
7
+ exec go run ./main.go
8
+ fi
9
+
3
10
  exec /app/app
@@ -6,11 +6,15 @@ lzc-cli project deploy
6
6
  lzc-cli project info
7
7
  ```
8
8
 
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`.
12
+
9
13
  Then open the app from launcher or browser.
10
14
 
11
15
  ## Build LPK
12
16
  ```bash
13
- lzc-cli project release -f lzc-build.yml -o gui-vnc.lpk
17
+ lzc-cli project release -o gui-vnc.lpk
14
18
  ```
15
19
 
16
20
  ## Install
@@ -0,0 +1,4 @@
1
+ # 开发态覆盖配置
2
+
3
+ # pkg_id_suffix: append an extra package id segment for dev deploys
4
+ pkg_id_suffix: dev
@@ -1,11 +1,6 @@
1
- # 可选基础文件: lzc-build.base.yml(与当前文件同目录,先加载再与当前文件合并)
2
-
3
1
  # manifest: 指定 lpk 的 manifest 文件
4
2
  manifest: ./lzc-manifest.yml
5
3
 
6
- # contentdir: 需要打包进 lpk 的目录
7
- contentdir: ./
8
-
9
4
  # pkgout: lpk 输出目录
10
5
  pkgout: ./
11
6
 
@@ -9,7 +9,7 @@ RUN pip3 install --no-cache-dir -r /app/requirements.txt --break-system-packages
9
9
  COPY app.py /app/app.py
10
10
  COPY run.sh /app/run.sh
11
11
  RUN chmod +x /app/run.sh
12
- COPY web /lzcapp/pkg/content/web
12
+ COPY web /app/web
13
13
 
14
14
  EXPOSE 3000
15
- CMD ["python3", "/app/app.py"]
15
+ CMD ["/app/run.sh"]
@@ -0,0 +1,18 @@
1
+ FROM registry.lazycat.cloud/lzc/lzcapp:3.20.3
2
+
3
+ RUN apk add --no-cache python3 py3-pip
4
+ WORKDIR /app
5
+
6
+ ENV LZC_PY_DEV=1
7
+ ENV PYTHONUNBUFFERED=1
8
+
9
+ COPY requirements.txt /app/requirements.txt
10
+ RUN pip3 install --no-cache-dir -r /app/requirements.txt --break-system-packages
11
+
12
+ COPY app.py /app/app.py
13
+ COPY run.sh /app/run.sh
14
+ RUN chmod +x /app/run.sh
15
+ COPY web /app/web
16
+
17
+ EXPOSE 3000
18
+ CMD ["/app/run.sh"]
@@ -6,7 +6,34 @@ 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`.
12
+
13
+ Open the app first.
14
+ In dev mode, the Python service starts automatically.
15
+ If the page still shows the backend dev guide, it will tell you the expected port and next step.
16
+
17
+ ## Recommended Backend Dev Loop
18
+ ```bash
19
+ lzc-cli project sync --watch
20
+ ```
21
+
22
+ The dev image starts the Python service automatically and reloads on source changes.
23
+ If you changed dependencies or need to restart the process manually:
24
+
25
+ ```bash
26
+ lzc-cli project exec /bin/sh
27
+ /app/run.sh
28
+ ```
29
+
30
+ You can also build locally and use `lzc-cli project cp` instead of `project sync --watch`.
31
+
32
+ ## Troubleshooting
33
+ ```bash
34
+ lzc-cli project log -f
35
+ lzc-cli project exec /bin/sh
36
+ ```
10
37
 
11
38
  ## API
12
39
  ```text
@@ -21,13 +48,3 @@ DELETE /api/todos/{id}
21
48
  ```text
22
49
  /lzcapp/var/todos.json
23
50
  ```
24
-
25
- ## Build LPK
26
- ```bash
27
- lzc-cli project build -o python-app.lpk
28
- ```
29
-
30
- ## Install
31
- ```bash
32
- lzc-cli lpk install python-app.lpk
33
- ```
@@ -0,0 +1,21 @@
1
+ .git
2
+ .git/**
3
+ node_modules
4
+ node_modules/**
5
+ .venv
6
+ .venv/**
7
+ dist
8
+ dist/**
9
+ build
10
+ build/**
11
+ __pycache__
12
+ __pycache__/**
13
+ .idea
14
+ .idea/**
15
+ .vscode
16
+ .vscode/**
17
+ .DS_Store
18
+ .lzc-cli-*
19
+ .lzc-cli-*/**
20
+ *.lpk
21
+ *.lpk.tar
@@ -3,7 +3,7 @@ import os
3
3
  import time
4
4
  from flask import Flask, send_from_directory, request
5
5
 
6
- app = Flask(__name__, static_folder="/lzcapp/pkg/content/web", static_url_path="")
6
+ app = Flask(__name__, static_folder="/app/web", static_url_path="")
7
7
  DATA_FILE = "/lzcapp/var/todos.json"
8
8
  todos = []
9
9
  next_id = 1
@@ -0,0 +1,12 @@
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
8
+
9
+ images:
10
+ app-runtime:
11
+ context: ./
12
+ dockerfile: ./Dockerfile.dev
@@ -1,11 +1,6 @@
1
- # 可选基础文件: lzc-build.base.yml(与当前文件同目录,先加载再与当前文件合并)
2
-
3
1
  # manifest: 指定 lpk 的 manifest 文件
4
2
  manifest: ./lzc-manifest.yml
5
3
 
6
- # contentdir: 需要打包进 lpk 的目录
7
- contentdir: ./
8
-
9
4
  # pkgout: lpk 输出目录
10
5
  pkgout: ./
11
6
 
@@ -0,0 +1,25 @@
1
+ function renderDevPage(port) {
2
+ const title = "Python dev service is not ready";
3
+ const subtitle = "This app starts the Python dev service automatically in dev mode. If the page still shows this guide, the process is still starting or needs attention.";
4
+ const pageTitle = "Backend Dev";
5
+ const steps = [
6
+ "Sync your latest code into the container with <code>lzc-cli project sync --watch</code> or copy it with <code>lzc-cli project cp</code>.",
7
+ "Check the service log with <code>lzc-cli project log -f</code>.",
8
+ "If you need to restart the process manually, open <code>lzc-cli project exec /bin/sh</code> and run <code>/app/run.sh</code>.",
9
+ "Refresh this page after port <code>" + String(port) + "</code> is ready.",
10
+ ];
11
+ const portText = port === undefined || port === null ? "" : String(port);
12
+ const items = steps.map(function (step) {
13
+ return "<li>" + step + "</li>";
14
+ }).join("");
15
+ const portBadge = portText ? "<div class=\"pill\">Expected local port: " + portText + "</div>" : "";
16
+ return [
17
+ "<!doctype html>",
18
+ "<html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><title>", pageTitle, "</title><style>",
19
+ "body{margin:0;padding:32px;font-family:ui-sans-serif,system-ui,sans-serif;background:#f5f8fc;color:#112033}",
20
+ ".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)}",
21
+ "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}",
22
+ "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}",
23
+ "</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>",
24
+ ].join("");
25
+ }
@@ -1,3 +1,14 @@
1
1
  #!/bin/sh
2
2
  set -e
3
- exec python3 /app/app.py
3
+
4
+ mirror_root="/lzcapp/cache/project-mirror"
5
+ app_file="/app/app.py"
6
+ if [ -f "$mirror_root/app.py" ]; then
7
+ app_file="$mirror_root/app.py"
8
+ fi
9
+
10
+ if [ "${LZC_PY_DEV:-}" = "1" ]; then
11
+ exec python3 -m flask --app "$app_file" run --debug --host 0.0.0.0 --port 3000
12
+ fi
13
+
14
+ exec python3 "$app_file"
@@ -17,4 +17,4 @@ COPY run.sh /app/run.sh
17
17
  RUN chmod +x /app/run.sh
18
18
 
19
19
  EXPOSE 8080
20
- CMD ["java", "-jar", "/app/app.jar"]
20
+ CMD ["/app/run.sh"]
@@ -0,0 +1,20 @@
1
+ FROM registry.lazycat.cloud/lzc/lzcapp:3.20.3 AS builder
2
+
3
+ RUN apk add --no-cache openjdk17 maven
4
+ WORKDIR /workspace
5
+
6
+ COPY pom.xml ./
7
+ COPY src ./src
8
+ RUN mvn -DskipTests package
9
+
10
+ FROM registry.lazycat.cloud/lzc/lzcapp:3.20.3
11
+
12
+ RUN apk add --no-cache openjdk17 maven
13
+ WORKDIR /app
14
+
15
+ COPY --from=builder /workspace/target/*.jar /app/app.jar
16
+ COPY run.sh /app/run.sh
17
+ RUN chmod +x /app/run.sh
18
+
19
+ EXPOSE 8080
20
+ CMD ["sh", "-lc", "trap : TERM INT; sleep infinity & wait"]
@@ -6,7 +6,28 @@ 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`.
12
+
13
+ Open the app first.
14
+ If the backend dev service is not ready yet, the app page will show the expected port and what to do next.
15
+ In dev mode, the Spring Boot service is started manually inside the app container.
16
+
17
+ ## Recommended Backend Dev Loop
18
+ ```bash
19
+ lzc-cli project sync --watch
20
+ lzc-cli project exec /bin/sh
21
+ /app/run.sh
22
+ ```
23
+
24
+ You can also build locally and use `lzc-cli project cp` instead of `project sync --watch`.
25
+
26
+ ## Troubleshooting
27
+ ```bash
28
+ lzc-cli project log -f
29
+ lzc-cli project exec /bin/sh
30
+ ```
10
31
 
11
32
  ## API
12
33
  ```text
@@ -21,13 +42,3 @@ DELETE /api/todos/{id}
21
42
  ```text
22
43
  /lzcapp/var/todos.json
23
44
  ```
24
-
25
- ## Build LPK
26
- ```bash
27
- lzc-cli project build -o springboot-app.lpk
28
- ```
29
-
30
- ## Install
31
- ```bash
32
- lzc-cli lpk install springboot-app.lpk
33
- ```
@@ -0,0 +1,21 @@
1
+ .git
2
+ .git/**
3
+ node_modules
4
+ node_modules/**
5
+ .venv
6
+ .venv/**
7
+ dist
8
+ dist/**
9
+ build
10
+ build/**
11
+ __pycache__
12
+ __pycache__/**
13
+ .idea
14
+ .idea/**
15
+ .vscode
16
+ .vscode/**
17
+ .DS_Store
18
+ .lzc-cli-*
19
+ .lzc-cli-*/**
20
+ *.lpk
21
+ *.lpk.tar
@@ -0,0 +1,12 @@
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
8
+
9
+ images:
10
+ app-runtime:
11
+ context: ./
12
+ dockerfile: ./Dockerfile.dev
@@ -1,11 +1,6 @@
1
- # 可选基础文件: lzc-build.base.yml(与当前文件同目录,先加载再与当前文件合并)
2
-
3
1
  # manifest: 指定 lpk 的 manifest 文件
4
2
  manifest: ./lzc-manifest.yml
5
3
 
6
- # contentdir: 需要打包进 lpk 的目录
7
- contentdir: ./
8
-
9
4
  # pkgout: lpk 输出目录
10
5
  pkgout: ./
11
6
 
@@ -0,0 +1,24 @@
1
+ function renderDevPage(port) {
2
+ const title = "Backend dev service is not ready";
3
+ const subtitle = "This app is running in dev mode and expects the backend service to be started manually inside the app container.";
4
+ const pageTitle = "Backend Dev";
5
+ const steps = [
6
+ "Sync your latest code into the container with <code>lzc-cli project sync --watch</code> or copy it with <code>lzc-cli project cp</code>.",
7
+ "Open a shell with <code>lzc-cli project exec /bin/sh</code> and start or restart the backend process with <code>/app/run.sh</code>.",
8
+ "Refresh this page after port <code>" + String(port) + "</code> is ready.",
9
+ ];
10
+ const portText = port === undefined || port === null ? "" : String(port);
11
+ const items = steps.map(function (step) {
12
+ return "<li>" + step + "</li>";
13
+ }).join("");
14
+ const portBadge = portText ? "<div class=\"pill\">Expected local port: " + portText + "</div>" : "";
15
+ return [
16
+ "<!doctype html>",
17
+ "<html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><title>", pageTitle, "</title><style>",
18
+ "body{margin:0;padding:32px;font-family:ui-sans-serif,system-ui,sans-serif;background:#f5f8fc;color:#112033}",
19
+ ".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)}",
20
+ "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}",
21
+ "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}",
22
+ "</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>",
23
+ ].join("");
24
+ }
@@ -1,3 +1,10 @@
1
1
  #!/bin/sh
2
2
  set -e
3
+
4
+ mirror_root="/lzcapp/cache/project-mirror"
5
+ if command -v mvn >/dev/null 2>&1 && [ -f "$mirror_root/pom.xml" ]; then
6
+ cd "$mirror_root"
7
+ exec mvn spring-boot:run
8
+ fi
9
+
3
10
  exec java -jar /app/app.jar
@@ -1,39 +1,26 @@
1
- # 懒猫云应用
1
+ # Lazycat Vue App
2
2
 
3
- ## 第一次部署(先看到结果)
4
- ```
3
+ ## First Deploy
4
+ ```bash
5
5
  lzc-cli project deploy
6
6
  lzc-cli project info
7
7
  ```
8
8
 
9
- 执行完成后:
10
- 1. 在微服启动器点击应用图标打开。
11
- 2. 或根据 `project info` 输出中的域名在手机/PC浏览器访问。
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`.
12
12
 
13
- ## 修改源码后再次部署
14
- ```bash
15
- lzc-cli project deploy
16
- ```
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.
17
15
 
18
- 建议同时打开日志排查问题:
16
+ ## Frontend Dev Loop
19
17
  ```bash
20
- lzc-cli project log -f
18
+ npm run dev
21
19
  ```
22
20
 
23
- ## 构建
24
- ```
25
- lzc-cli project build -o you-awesome.lpk
26
- ```
21
+ Then refresh the app page.
27
22
 
28
- 会在当前的目录下构建出一个 lpk 包。
29
-
30
- ## 安装
31
- ```
32
- lzc-cli lpk install you-awesome.lpk
23
+ ## Logs
24
+ ```bash
25
+ lzc-cli project log -f
33
26
  ```
34
-
35
- 会安装在你的微服应用中,安装成功后可在懒猫微服启动器中查看!
36
-
37
- ## 交流和帮助
38
-
39
- 你可以在 https://bbs.lazycat.cloud/ 畅所欲言。
@@ -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 的命令