@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.
- package/README.md +46 -7
- package/changelog.md +56 -19
- package/lib/app/apkshell.js +7 -44
- package/lib/app/index.js +5 -1
- package/lib/app/lpk_build.js +266 -56
- package/lib/app/lpk_build_images.js +424 -229
- package/lib/app/lpk_build_images_local.js +425 -0
- package/lib/app/lpk_build_images_pack_local.js +409 -0
- package/lib/app/lpk_create.js +158 -83
- package/lib/app/lpk_create_generator.js +35 -42
- package/lib/app/lpk_devshell.js +6 -2
- package/lib/app/lpk_installer.js +4 -3
- package/lib/app/manifest_build.js +259 -0
- package/lib/app/project_cp.js +5 -10
- package/lib/app/project_deploy.js +80 -11
- package/lib/app/project_exec.js +48 -11
- package/lib/app/project_info.js +59 -59
- package/lib/app/project_log.js +5 -10
- package/lib/app/project_runtime.js +113 -18
- package/lib/app/project_start.js +6 -11
- package/lib/app/project_sync.js +499 -0
- package/lib/appstore/apkshell.js +50 -0
- package/lib/appstore/publish.js +54 -15
- package/lib/build_remote.js +0 -1
- package/lib/config/index.js +1 -1
- package/lib/debug_bridge.js +217 -47
- package/lib/i18n/locales/en/translation.json +262 -262
- package/lib/i18n/locales/zh/translation.json +262 -262
- package/lib/lpk/core.js +2 -1
- package/lib/migrate/index.js +52 -0
- package/lib/package_info.js +135 -0
- package/lib/shellapi.js +35 -1
- package/lib/sig/core.js +2 -2
- package/lib/utils.js +92 -15
- package/package.json +89 -89
- package/scripts/cli.js +2 -0
- package/scripts/smoke/frontend-dev-entry.mjs +104 -0
- package/scripts/smoke/template-project.mjs +311 -0
- package/template/_lpk/README.md +6 -3
- package/template/_lpk/gui-vnc.manifest.yml.in +0 -9
- package/template/_lpk/hello-vue.manifest.yml.in +38 -0
- package/template/_lpk/manifest.yml.in +0 -9
- package/template/_lpk/package.yml.in +7 -0
- package/template/_lpk/todolist-golang.manifest.yml.in +23 -9
- package/template/_lpk/todolist-java.manifest.yml.in +23 -9
- package/template/_lpk/todolist-python.manifest.yml.in +31 -9
- package/template/_lpk/todolist-serverless.manifest.yml.in +38 -0
- package/template/blank/lzc-build.dev.yml +4 -0
- package/template/blank/lzc-build.yml +0 -2
- package/template/blank/lzc-manifest.yml +3 -12
- package/template/blank/package.yml +7 -0
- package/template/golang/Dockerfile +1 -1
- package/template/golang/Dockerfile.dev +20 -0
- package/template/golang/README.md +22 -11
- package/template/golang/_lzcdevignore +21 -0
- package/template/golang/lzc-build.dev.yml +12 -0
- package/template/golang/lzc-build.yml +0 -5
- package/template/golang/main.go +1 -1
- package/template/golang/manifest.dev.page.js +24 -0
- package/template/golang/run.sh +7 -0
- package/template/gui-vnc/README.md +5 -1
- package/template/gui-vnc/lzc-build.dev.yml +4 -0
- package/template/gui-vnc/lzc-build.yml +0 -5
- package/template/python/Dockerfile +2 -2
- package/template/python/Dockerfile.dev +18 -0
- package/template/python/README.md +28 -11
- package/template/python/_lzcdevignore +21 -0
- package/template/python/app.py +1 -1
- package/template/python/lzc-build.dev.yml +12 -0
- package/template/python/lzc-build.yml +0 -5
- package/template/python/manifest.dev.page.js +25 -0
- package/template/python/run.sh +12 -1
- package/template/springboot/Dockerfile +1 -1
- package/template/springboot/Dockerfile.dev +20 -0
- package/template/springboot/README.md +22 -11
- package/template/springboot/_lzcdevignore +21 -0
- package/template/springboot/lzc-build.dev.yml +12 -0
- package/template/springboot/lzc-build.yml +0 -5
- package/template/springboot/manifest.dev.page.js +24 -0
- package/template/springboot/run.sh +7 -0
- package/template/vue/README.md +14 -27
- package/template/vue/_gitignore +0 -1
- package/template/vue/lzc-build.dev.yml +7 -0
- package/template/vue/lzc-build.yml +0 -2
- package/template/vue/manifest.dev.page.js +50 -0
- package/template/vue/src/App.vue +1 -1
- package/template/vue-minidb/README.md +11 -19
- package/template/vue-minidb/_gitignore +0 -1
- package/template/vue-minidb/lzc-build.dev.yml +7 -0
- package/template/vue-minidb/lzc-build.yml +0 -2
- package/template/vue-minidb/manifest.dev.page.js +50 -0
- 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
|
+
}
|
package/template/vue/src/App.vue
CHANGED
|
@@ -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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
12
|
-
|
|
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
|
-
##
|
|
16
|
+
## Frontend Dev Loop
|
|
17
17
|
```bash
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Troubleshooting
|
|
22
|
-
```bash
|
|
23
|
-
lzc-cli project log -f
|
|
18
|
+
npm run dev
|
|
24
19
|
```
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
lzc-cli project build -o vue-minidb-app.lpk
|
|
29
|
-
```
|
|
21
|
+
Then refresh the app page.
|
|
30
22
|
|
|
31
|
-
##
|
|
23
|
+
## Logs
|
|
32
24
|
```bash
|
|
33
|
-
lzc-cli
|
|
25
|
+
lzc-cli project log -f
|
|
34
26
|
```
|
|
@@ -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
|