@jayfong/x-server 2.69.0 → 2.71.0

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.
@@ -27,6 +27,7 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
27
27
  describe: '使用 tsx 运行',
28
28
  type: 'boolean'
29
29
  }).positional('channel', {
30
+ alias: 'h',
30
31
  describe: '渠道',
31
32
  type: 'string'
32
33
  }), async argv => {
@@ -97,6 +98,7 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
97
98
  type: 'boolean',
98
99
  default: false
99
100
  }).positional('channel', {
101
+ alias: 'h',
100
102
  describe: '渠道',
101
103
  type: 'string'
102
104
  }), async argv => {
@@ -126,6 +128,7 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
126
128
  });
127
129
  console.log('构建成功');
128
130
  }).command('api', '生成 API', _ => _.positional('channel', {
131
+ alias: 'h',
129
132
  describe: '渠道',
130
133
  type: 'string'
131
134
  }), async argv => {
@@ -142,6 +145,7 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
142
145
  type: 'boolean',
143
146
  default: false
144
147
  }).positional('channel', {
148
+ alias: 'h',
145
149
  describe: '渠道',
146
150
  type: 'string'
147
151
  }), async argv => {
@@ -176,6 +180,7 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
176
180
  type: 'boolean',
177
181
  default: false
178
182
  }).positional('channel', {
183
+ alias: 'h',
179
184
  describe: '渠道',
180
185
  type: 'string'
181
186
  }).positional('tsx', {
@@ -206,6 +211,7 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
206
211
  type: 'string',
207
212
  choices: ['env']
208
213
  }).positional('channel', {
214
+ alias: 'h',
209
215
  describe: '渠道',
210
216
  type: 'string'
211
217
  }), async argv => {
@@ -224,6 +230,7 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
224
230
  host: deployEnv.HOST,
225
231
  user: deployEnv.USER,
226
232
  key: deployEnv.KEY,
233
+ pass: deployEnv.PASSWORD,
227
234
  token: appEnv.APP_TOKEN,
228
235
  port: appEnv.APP_PORT,
229
236
  env: appEnv
@@ -234,6 +241,7 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
234
241
  host: deployEnv.HOST,
235
242
  user: deployEnv.USER,
236
243
  key: deployEnv.KEY,
244
+ pass: deployEnv.PASSWORD,
237
245
  dir: deployEnv.DIR,
238
246
  cmd: deployEnv.CMD,
239
247
  memory: deployEnv.MEMORY,
@@ -18,7 +18,8 @@ class DeployUtil {
18
18
  await ssh.connect({
19
19
  host: options.host,
20
20
  username: options.user,
21
- privateKey: options.key
21
+ privateKey: options.key,
22
+ password: options.pass
22
23
  });
23
24
  const appName = pkgContent.name;
24
25
  const appDir = `./${appName}`;
@@ -52,7 +53,8 @@ class DeployUtil {
52
53
  await ssh.connect({
53
54
  host: options.host,
54
55
  username: options.user,
55
- privateKey: options.key
56
+ privateKey: options.key,
57
+ password: options.pass
56
58
  });
57
59
  await ssh.execCommand((0, _vtils.dedent)`
58
60
  set -ex
package/lib/cli/cli.js CHANGED
@@ -24,6 +24,7 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
24
24
  describe: '使用 tsx 运行',
25
25
  type: 'boolean'
26
26
  }).positional('channel', {
27
+ alias: 'h',
27
28
  describe: '渠道',
28
29
  type: 'string'
29
30
  }), async argv => {
@@ -94,6 +95,7 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
94
95
  type: 'boolean',
95
96
  default: false
96
97
  }).positional('channel', {
98
+ alias: 'h',
97
99
  describe: '渠道',
98
100
  type: 'string'
99
101
  }), async argv => {
@@ -123,6 +125,7 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
123
125
  });
124
126
  console.log('构建成功');
125
127
  }).command('api', '生成 API', _ => _.positional('channel', {
128
+ alias: 'h',
126
129
  describe: '渠道',
127
130
  type: 'string'
128
131
  }), async argv => {
@@ -139,6 +142,7 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
139
142
  type: 'boolean',
140
143
  default: false
141
144
  }).positional('channel', {
145
+ alias: 'h',
142
146
  describe: '渠道',
143
147
  type: 'string'
144
148
  }), async argv => {
@@ -173,6 +177,7 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
173
177
  type: 'boolean',
174
178
  default: false
175
179
  }).positional('channel', {
180
+ alias: 'h',
176
181
  describe: '渠道',
177
182
  type: 'string'
178
183
  }).positional('tsx', {
@@ -203,6 +208,7 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
203
208
  type: 'string',
204
209
  choices: ['env']
205
210
  }).positional('channel', {
211
+ alias: 'h',
206
212
  describe: '渠道',
207
213
  type: 'string'
208
214
  }), async argv => {
@@ -221,6 +227,7 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
221
227
  host: deployEnv.HOST,
222
228
  user: deployEnv.USER,
223
229
  key: deployEnv.KEY,
230
+ pass: deployEnv.PASSWORD,
224
231
  token: appEnv.APP_TOKEN,
225
232
  port: appEnv.APP_PORT,
226
233
  env: appEnv
@@ -231,6 +238,7 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
231
238
  host: deployEnv.HOST,
232
239
  user: deployEnv.USER,
233
240
  key: deployEnv.KEY,
241
+ pass: deployEnv.PASSWORD,
234
242
  dir: deployEnv.DIR,
235
243
  cmd: deployEnv.CMD,
236
244
  memory: deployEnv.MEMORY,
@@ -2,7 +2,8 @@ export interface DeployOptions {
2
2
  cwd: string;
3
3
  host: string;
4
4
  user: string;
5
- key: string;
5
+ key?: string;
6
+ pass?: string;
6
7
  dir: string;
7
8
  memory?: string;
8
9
  cron?: string;
@@ -11,7 +12,8 @@ export interface DeployOptions {
11
12
  export interface DeployEnvOptions {
12
13
  host: string;
13
14
  user: string;
14
- key: string;
15
+ key?: string;
16
+ pass?: string;
15
17
  port: number;
16
18
  token: string;
17
19
  env: Record<string, any>;
@@ -13,7 +13,8 @@ export class DeployUtil {
13
13
  await ssh.connect({
14
14
  host: options.host,
15
15
  username: options.user,
16
- privateKey: options.key
16
+ privateKey: options.key,
17
+ password: options.pass
17
18
  });
18
19
  const appName = pkgContent.name;
19
20
  const appDir = `./${appName}`;
@@ -47,7 +48,8 @@ export class DeployUtil {
47
48
  await ssh.connect({
48
49
  host: options.host,
49
50
  username: options.user,
50
- privateKey: options.key
51
+ privateKey: options.key,
52
+ password: options.pass
51
53
  });
52
54
  await ssh.execCommand(dedent`
53
55
  set -ex
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-server",
3
- "version": "2.69.0",
3
+ "version": "2.71.0",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",