@lazycatcloud/lzc-cli 1.2.22 → 1.2.25

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/lib/shellapi.js CHANGED
@@ -14,12 +14,13 @@ const bannerfileContent = `˄=ᆽ=ᐟ \\`;
14
14
  */
15
15
  function getShellAPIConfigDir() {
16
16
  const home = os.homedir();
17
- const isMacos = process.platform == "darwin";
18
- let sufix = "/.config/hportal-client";
19
- if (isMacos) {
20
- sufix = "/Library/Application Support/hportal-client";
21
- } // TODO: need reimpl fetch windows
22
- const SHELLAPI_CONFIG_DIR = path.join(home, sufix);
17
+ let suffix = "/.config/hportal-client";
18
+ if (process.platform === "darwin") {
19
+ suffix = "/Library/Application Support/hportal-client";
20
+ } else if (process.platform === "win32") {
21
+ suffix = "\\AppData\\Roaming\\hportal-client";
22
+ }
23
+ const SHELLAPI_CONFIG_DIR = path.join(home, suffix);
23
24
  return SHELLAPI_CONFIG_DIR;
24
25
  }
25
26
 
package/lib/utils.js CHANGED
@@ -14,7 +14,7 @@ import zlib from "node:zlib";
14
14
  import process from "node:process";
15
15
  import { spawnSync } from "node:child_process";
16
16
  import logger from "loglevel";
17
- import tar from "tar";
17
+ import * as tar from "tar";
18
18
 
19
19
  export const envsubstr = async (templateContents, args) => {
20
20
  const parse = await importDefault("envsub/js/envsub-parser.js");
@@ -61,7 +61,7 @@ export function dumpToYaml(template, target) {
61
61
  styles: {
62
62
  "!!null": "empty", // dump null as ""
63
63
  },
64
- })
64
+ }),
65
65
  );
66
66
  }
67
67
 
@@ -89,7 +89,7 @@ export async function envTemplateFile(templateFile, env) {
89
89
  "!!null": "empty", // dump null as ""
90
90
  },
91
91
  }),
92
- { options }
92
+ { options },
93
93
  );
94
94
  }
95
95
 
@@ -173,7 +173,7 @@ export function isFileExist(path) {
173
173
  try {
174
174
  fs.accessSync(
175
175
  path,
176
- fs.constants.W_OK | fs.constants.R_OK | fs.constants.F_OK
176
+ fs.constants.W_OK | fs.constants.R_OK | fs.constants.F_OK,
177
177
  );
178
178
  return true;
179
179
  } catch {
@@ -220,7 +220,7 @@ export class Downloader {
220
220
  received +
221
221
  " bytes downloaded out of " +
222
222
  total +
223
- " bytes."
223
+ " bytes.",
224
224
  );
225
225
  }
226
226
 
@@ -329,7 +329,7 @@ export async function tarContentDir(from, to, cwd = "./") {
329
329
  gid: 0,
330
330
  },
331
331
  },
332
- from
332
+ from,
333
333
  )
334
334
  .pipe(dest)
335
335
  .on("close", () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazycatcloud/lzc-cli",
3
- "version": "1.2.22",
3
+ "version": "1.2.25",
4
4
  "description": "lazycat cloud developer kit",
5
5
  "files": [
6
6
  "template",
@@ -18,31 +18,31 @@
18
18
  "license": "ISC",
19
19
  "dependencies": {
20
20
  "@balena/dockerignore": "^1.0.2",
21
- "@grpc/grpc-js": "^1.8.18",
22
- "@grpc/proto-loader": "^0.7.8",
23
- "archiver": "^5.3.0",
24
- "chalk": "^4.1.2",
25
- "chokidar": "^3.5.3",
21
+ "@grpc/grpc-js": "^1.11.1",
22
+ "@grpc/proto-loader": "^0.7.13",
23
+ "archiver": "^7.0.1",
24
+ "chalk": "^5.3.0",
25
+ "chokidar": "^3.6.0",
26
26
  "command-exists": "^1.2.9",
27
- "dockerfile-ast": "^0.5.0",
28
- "envsub": "^4.0.7",
29
- "fast-glob": "^3.2.7",
27
+ "dockerfile-ast": "^0.6.1",
28
+ "envsub": "^4.1.0",
29
+ "fast-glob": "^3.3.2",
30
30
  "form-data": "^4.0.0",
31
- "ignore": "^5.2.0",
32
- "inquirer": "^8.2.0",
33
- "isbinaryfile": "^4.0.8",
31
+ "ignore": "^5.3.2",
32
+ "inquirer": "^10.1.8",
33
+ "isbinaryfile": "^5.0.2",
34
34
  "js-yaml": "^4.1.0",
35
35
  "lodash.debounce": "^4.0.8",
36
36
  "lodash.merge": "^4.6.2",
37
37
  "lodash.mergewith": "^4.6.2",
38
- "loglevel": "^1.8.0",
39
- "node-fetch": "^2.6.6",
40
- "tar": "^6.1.11",
41
- "yargs": "^17.5.1"
38
+ "loglevel": "^1.9.1",
39
+ "node-fetch": "^3.3.2",
40
+ "tar": "^7.4.3",
41
+ "yargs": "^17.7.2"
42
42
  },
43
43
  "devDependencies": {
44
- "@types/command-exists": "^1.2.0",
45
- "prettier": "^2.5.0"
44
+ "@types/command-exists": "^1.2.3",
45
+ "prettier": "^3.3.3"
46
46
  },
47
47
  "publishConfig": {
48
48
  "registry": "https://registry.npmjs.org",
@@ -1,4 +1,4 @@
1
- FROM alpine:3.16
1
+ FROM registry.lazycat.cloud/alpine:3.18
2
2
 
3
3
  RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
4
4
 
@@ -1,4 +1,4 @@
1
- FROM alpine
1
+ FROM registry.lazycat.cloud/alpine:3.18
2
2
 
3
3
  RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
4
4
 
@@ -1,6 +1,6 @@
1
1
  lzc-sdk-version: 0.1
2
2
 
3
- package: ${package} # app的唯一标识符
3
+ package: ${package} # app的唯一标识符
4
4
  version: ${version} # app的版本
5
5
  name: ${name} # app名称
6
6
  description: ${description} # app描述
@@ -13,7 +13,7 @@ author: ${author} # app author
13
13
  application:
14
14
  subdomain: ${subdomain} #期望的app域名
15
15
  routes:
16
- - /=https://www.linakesi.com
16
+ - /=https://lazycat.cloud
17
17
  handlers:
18
18
  error_page_templates:
19
19
  502: /lzcapp/pkg/content/502.html.tpl
@@ -1,6 +1,6 @@
1
1
  lzc-sdk-version: 0.1
2
2
 
3
- package: ${package} # app的唯一标识符
3
+ package: ${package} # app的唯一标识符
4
4
  version: ${version} # app的版本
5
5
  name: ${name} # app名称
6
6
  description: ${description} # app描述
@@ -1,4 +1,4 @@
1
- # 整个文件中,可以通过 ${var} 的方式,使用 manifest.yml 文件中定义的值
1
+ # 整个文件中,可以通过 ${var} 的方式,使用 manifest 字段指定的文件定义的值
2
2
 
3
3
  # buildscript
4
4
  # - 可以为构建脚本的路径地址
@@ -30,7 +30,7 @@ icon: ./lazycat.png
30
30
  # devshell:
31
31
  # routes:
32
32
  # - /=http://127.0.0.1:3000
33
- # image: registry.lazycat.cloud/lzc-cli/devshell:0.0.4
33
+ # image: registry.lazycat.cloud/lzc-cli/devshell:v0.0.5
34
34
 
35
35
  # devshell 指定构建Dockerfile
36
36
  # image 字段如果没有定义,将默认使用 ${package}-devshell:${version}
@@ -42,7 +42,7 @@ icon: ./lazycat.png
42
42
  # build: .
43
43
 
44
44
  # dvshell 指定开发依赖的情况
45
- # 这种情况下,选用 apline:3.16 作为基础镜像,在 dependencies 中添加所需要的开发依赖即可
45
+ # 这种情况下,选用 alpine:latest 作为基础镜像,在 dependencies 中添加所需要的开发依赖即可
46
46
  # 如果 dependencies 和 build 同时存在,将会优先使用 dependencies
47
47
  devshell:
48
48
  routes:
@@ -1,4 +1,4 @@
1
- # 整个文件中,可以通过 ${var} 的方式,使用 manifest.yml 文件中定义的值
1
+ # 整个文件中,可以通过 ${var} 的方式,使用 manifest 字段指定的文件定义的值
2
2
 
3
3
  # buildscript
4
4
  # - 可以为构建脚本的路径地址
@@ -30,7 +30,7 @@ icon: ./lazycat.png
30
30
  # devshell:
31
31
  # routes:
32
32
  # - /=http://127.0.0.1:3000
33
- # image: registry.lazycat.cloud/lzc-cli/devshell:0.0.4
33
+ # image: registry.lazycat.cloud/lzc-cli/devshell:v0.0.5
34
34
 
35
35
  # devshell 指定构建Dockerfile
36
36
  # image 字段如果没有定义,将默认使用 ${package}-devshell:${version}
@@ -42,7 +42,7 @@ icon: ./lazycat.png
42
42
  # build: .
43
43
 
44
44
  # dvshell 指定开发依赖的情况
45
- # 这种情况下,选用 apline:3.16 作为基础镜像,在 dependencies 中添加所需要的开发依赖即可
45
+ # 这种情况下,选用 alpine:latest 作为基础镜像,在 dependencies 中添加所需要的开发依赖即可
46
46
  # 如果 dependencies 和 build 同时存在,将会优先使用 dependencies
47
47
  devshell:
48
48
  routes:
@@ -1,4 +1,4 @@
1
- # 整个文件中,可以通过 ${var} 的方式,使用 manifest.yml 文件中定义的值
1
+ # 整个文件中,可以通过 ${var} 的方式,使用 manifest 字段指定的文件定义的值
2
2
 
3
3
  # buildscript
4
4
  # - 可以为构建脚本的路径地址
@@ -30,7 +30,7 @@ icon: ./lazycat.png
30
30
  # devshell:
31
31
  # routes:
32
32
  # - /=http://127.0.0.1:3000
33
- # image: registry.lazycat.cloud/lzc-cli/devshell:0.0.4
33
+ # image: registry.lazycat.cloud/lzc-cli/devshell:v0.0.5
34
34
 
35
35
  # devshell 指定构建Dockerfile
36
36
  # image 字段如果没有定义,将默认使用 ${package}-devshell:${version}
@@ -42,7 +42,7 @@ icon: ./lazycat.png
42
42
  # build: .
43
43
 
44
44
  # dvshell 指定开发依赖的情况
45
- # 这种情况下,选用 apline:3.16 作为基础镜像,在 dependencies 中添加所需要的开发依赖即可
45
+ # 这种情况下,选用 alpine:latest 作为基础镜像,在 dependencies 中添加所需要的开发依赖即可
46
46
  # 如果 dependencies 和 build 同时存在,将会优先使用 dependencies
47
47
  devshell:
48
48
  routes:
@@ -1,4 +1,4 @@
1
- # 整个文件中,可以通过 ${var} 的方式,使用 manifest.yml 文件中定义的值
1
+ # 整个文件中,可以通过 ${var} 的方式,使用 manifest 字段指定的文件定义的值
2
2
 
3
3
  # buildscript
4
4
  # - 可以为构建脚本的路径地址
@@ -6,7 +6,7 @@
6
6
  # buildscript: ./build.sh
7
7
 
8
8
  # manifest: 指定 lpk 包的 manifest.yml 文件路径
9
- # manifest: ./lzc-manifest.yml
9
+ manifest: ./lzc-manifest.yml
10
10
 
11
11
  # contentdir: 指定打包的内容,将会打包到 lpk 中
12
12
  contentdir: ./error_pages
@@ -29,7 +29,7 @@ icon: ./lazycat.png
29
29
  # devshell:
30
30
  # routes:
31
31
  # - /=http://127.0.0.1:3000
32
- # image: registry.lazycat.cloud/lzc-cli/devshell:0.0.4
32
+ # image: registry.lazycat.cloud/lzc-cli/devshell:v0.0.5
33
33
 
34
34
  # devshell 指定构建Dockerfile
35
35
  # image 字段如果没有定义,将默认使用 ${package}-devshell:${version}
@@ -41,7 +41,7 @@ icon: ./lazycat.png
41
41
  # build: .
42
42
 
43
43
  # dvshell 指定开发依赖的情况
44
- # 这种情况下,选用 apline:3.16 作为基础镜像,在 dependencies 中添加所需要的开发依赖即可
44
+ # 这种情况下,选用 alpine:latest 作为基础镜像,在 dependencies 中添加所需要的开发依赖即可
45
45
  # 如果 dependencies 和 build 同时存在,将会优先使用 dependencies
46
46
  # devshell:
47
47
  # routes: