@lazycatcloud/lzc-cli 1.1.2 → 1.1.5
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/cmds/app.js +137 -0
- package/cmds/config.js +55 -0
- package/cmds/create.js +55 -0
- package/cmds/dev.js +124 -0
- package/cmds/init.js +125 -0
- package/cmds/log.js +103 -0
- package/cmds/publish.js +116 -0
- package/lib/box/check_qemu.js +27 -0
- package/lib/box/hportal.js +1 -0
- package/lib/box/index.js +29 -10
- package/lib/box/qemu_vm_mgr.js +131 -46
- package/lib/builder.js +14 -3
- package/lib/dev.js +14 -4
- package/lib/env.js +1 -1
- package/lib/git/git-commit.sh +3 -3
- package/lib/sdk.js +25 -0
- package/package.json +7 -6
- package/scripts/cli.js +2 -2
- package/template/vue/vue.config.js +15 -0
- package/scripts/auto-completion.sh +0 -46
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lazycatcloud/lzc-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "lazycat cloud developer kit",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "mocha",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
"template",
|
|
16
16
|
"scripts",
|
|
17
|
-
"lib"
|
|
17
|
+
"lib",
|
|
18
|
+
"cmds"
|
|
18
19
|
],
|
|
19
20
|
"bin": {
|
|
20
21
|
"lzc-cli": "./scripts/cli.js"
|
|
@@ -30,8 +31,7 @@
|
|
|
30
31
|
"archiver": "^5.3.0",
|
|
31
32
|
"chalk": "^4.1.2",
|
|
32
33
|
"chokidar": "^3.5.3",
|
|
33
|
-
"
|
|
34
|
-
"commander-completion": "^1.0.1",
|
|
34
|
+
"command-exists": "^1.2.9",
|
|
35
35
|
"dockerfile-ast": "^0.4.1",
|
|
36
36
|
"dockerode": "^3.3.1",
|
|
37
37
|
"ejs": "^3.1.6",
|
|
@@ -48,16 +48,17 @@
|
|
|
48
48
|
"lodash.merge": "^4.6.2",
|
|
49
49
|
"lodash.mergewith": "^4.6.2",
|
|
50
50
|
"log-update": "^5.0.0",
|
|
51
|
-
"lz4": "^0.6.5",
|
|
52
51
|
"minimist": "^1.2.5",
|
|
53
52
|
"node-fetch": "^2.6.6",
|
|
54
53
|
"node-stream-zip": "^1.15.0",
|
|
55
54
|
"ora": "^6.0.1",
|
|
56
55
|
"semver": "^7.3.5",
|
|
57
56
|
"ssh2": "^1.5.0",
|
|
58
|
-
"ssh2-promise": "^1.0.2"
|
|
57
|
+
"ssh2-promise": "^1.0.2",
|
|
58
|
+
"yargs": "^17.5.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
+
"@types/command-exists": "^1.2.0",
|
|
61
62
|
"chai": "^4.3.6",
|
|
62
63
|
"mocha": "^9.2.2",
|
|
63
64
|
"prettier": "^2.5.0"
|
package/scripts/cli.js
CHANGED
|
@@ -129,7 +129,7 @@ program.command({
|
|
|
129
129
|
args.option("u", {
|
|
130
130
|
alias: "user",
|
|
131
131
|
describe: "多实例对应的用户",
|
|
132
|
-
demandOption:
|
|
132
|
+
demandOption: false,
|
|
133
133
|
type: "string",
|
|
134
134
|
});
|
|
135
135
|
},
|
|
@@ -159,4 +159,4 @@ program.command({
|
|
|
159
159
|
|
|
160
160
|
boxCommand(program);
|
|
161
161
|
|
|
162
|
-
program.parse();
|
|
162
|
+
program.showHelpOnFail(false, "使用 lzc-cli help 查看更多帮助").parse();
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
const nodeVersions = process.versions.node.split(".");
|
|
2
|
+
if (
|
|
3
|
+
nodeVersions[0] >= 17 &&
|
|
4
|
+
process.env["NODE_OPTIONS"].search(/--openssl-legacy-provider/) == -1
|
|
5
|
+
) {
|
|
6
|
+
console.warn(`
|
|
7
|
+
当前 nodejs 版本为 ${process.version}
|
|
8
|
+
|
|
9
|
+
nodejs 17.0.0 后的版本由于使用的 openssl 3.0 的原因。需要使用设置
|
|
10
|
+
export NODE_OPTIONS=--openssl-legacy-provider
|
|
11
|
+
|
|
12
|
+
推荐使用 vue3 进行开发。
|
|
13
|
+
`);
|
|
14
|
+
}
|
|
15
|
+
|
|
1
16
|
module.exports = {
|
|
2
17
|
devServer: {
|
|
3
18
|
historyApiFallback: true,
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# Forked from https://github.com/isaacs/npm/blob/v1.3.17/lib/utils/completion.sh
|
|
2
|
-
# Forked from https://github.com/twolfson/foundry/blob/4.3.3/bin/completion/foundry
|
|
3
|
-
#!/bin/bash
|
|
4
|
-
###-begin-lzc-cli-completion-###
|
|
5
|
-
#
|
|
6
|
-
# foundry command completion script
|
|
7
|
-
#
|
|
8
|
-
# Installation: lzc-cli completion >> ~/.bashrc (or ~/.zshrc)
|
|
9
|
-
# Or, maybe: lzc-cli completion > /usr/local/etc/bash_completion.d/lzc-cli
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
COMP_WORDBREAKS=${COMP_WORDBREAKS/=/}
|
|
13
|
-
COMP_WORDBREAKS=${COMP_WORDBREAKS/@/}
|
|
14
|
-
export COMP_WORDBREAKS
|
|
15
|
-
|
|
16
|
-
if type complete &>/dev/null; then
|
|
17
|
-
_lzc_cli_completion () {
|
|
18
|
-
local si="$IFS"
|
|
19
|
-
IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \
|
|
20
|
-
COMP_LINE="$COMP_LINE" \
|
|
21
|
-
COMP_POINT="$COMP_POINT" \
|
|
22
|
-
lzc-cli completion -- "${COMP_WORDS[@]}" \
|
|
23
|
-
2>/dev/null)) || return $?
|
|
24
|
-
IFS="$si"
|
|
25
|
-
}
|
|
26
|
-
complete -F _lzc_cli_completion lzc-cli
|
|
27
|
-
# DEV: We removed `compdef` due to issues with `zsh` (zsh 5.0.0 (x86_64-unknown-linux-gnu))
|
|
28
|
-
elif type compctl &>/dev/null; then
|
|
29
|
-
_lzc_cli_completion () {
|
|
30
|
-
local cword line point words si
|
|
31
|
-
read -Ac words
|
|
32
|
-
read -cn cword
|
|
33
|
-
let cword-=1
|
|
34
|
-
read -l line
|
|
35
|
-
read -ln point
|
|
36
|
-
si="$IFS"
|
|
37
|
-
IFS=$'\n' reply=($(COMP_CWORD="$cword" \
|
|
38
|
-
COMP_LINE="$line" \
|
|
39
|
-
COMP_POINT="$point" \
|
|
40
|
-
lzc-cli completion -- "${words[@]}" \
|
|
41
|
-
2>/dev/null)) || return $?
|
|
42
|
-
IFS="$si"
|
|
43
|
-
}
|
|
44
|
-
compctl -K _lzc_cli_completion lzc-cli
|
|
45
|
-
fi
|
|
46
|
-
###-end-lzc-cli-completion-###
|