@jayfong/x-server 2.88.2 → 2.90.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.
package/lib/_cjs/cli/cli.js
CHANGED
|
@@ -169,6 +169,10 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
169
169
|
describe: '是否包含 Prisma 引擎',
|
|
170
170
|
type: 'boolean',
|
|
171
171
|
default: true
|
|
172
|
+
}).positional('empty-dist-dir', {
|
|
173
|
+
describe: '是否清空构建目录',
|
|
174
|
+
type: 'boolean',
|
|
175
|
+
default: true
|
|
172
176
|
}), async argv => {
|
|
173
177
|
await _env_util.EnvUtil.withChannel({
|
|
174
178
|
cwd: process.cwd(),
|
|
@@ -208,7 +212,8 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
208
212
|
});
|
|
209
213
|
}),
|
|
210
214
|
prismaCliBinaryTargets: envMap.PRISMA_CLI_BINARY_TARGETS,
|
|
211
|
-
noPrismaEngine: argv['prisma-engine'] === false
|
|
215
|
+
noPrismaEngine: argv['prisma-engine'] === false,
|
|
216
|
+
noEmptyDistDir: argv['empty-dist-dir'] === false
|
|
212
217
|
});
|
|
213
218
|
console.log('构建成功');
|
|
214
219
|
if (argv.deploy) {
|
|
@@ -25,14 +25,14 @@ class DeployUtil {
|
|
|
25
25
|
const appDir = `./${appName}`;
|
|
26
26
|
await ssh.execCommand((0, _vtils.dedent)`
|
|
27
27
|
set -ex
|
|
28
|
-
mkdir -p ./app_files/${appName}
|
|
28
|
+
mkdir -p ./app_files/${appName}/${options.channel || 'dist'}
|
|
29
29
|
mkdir -p ${appDir}
|
|
30
30
|
`, {
|
|
31
31
|
cwd: options.dir,
|
|
32
32
|
onStdout: buf => console.log(buf.toString()),
|
|
33
33
|
onStderr: buf => console.log(buf.toString())
|
|
34
34
|
});
|
|
35
|
-
const remoteAppFile = `${options.dir}/app_files/${appName}/${_path.default.basename(appFile)}`;
|
|
35
|
+
const remoteAppFile = `${options.dir}/app_files/${appName}/${options.channel || 'dist'}/${_path.default.basename(appFile)}`;
|
|
36
36
|
await ssh.putFile(appFile, remoteAppFile);
|
|
37
37
|
await ssh.execCommand((0, _vtils.dedent)`
|
|
38
38
|
set -ex
|
package/lib/cli/build_util.d.ts
CHANGED
package/lib/cli/build_util.js
CHANGED
package/lib/cli/cli.js
CHANGED
|
@@ -167,6 +167,10 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
167
167
|
describe: '是否包含 Prisma 引擎',
|
|
168
168
|
type: 'boolean',
|
|
169
169
|
default: true
|
|
170
|
+
}).positional('empty-dist-dir', {
|
|
171
|
+
describe: '是否清空构建目录',
|
|
172
|
+
type: 'boolean',
|
|
173
|
+
default: true
|
|
170
174
|
}), async argv => {
|
|
171
175
|
await EnvUtil.withChannel({
|
|
172
176
|
cwd: process.cwd(),
|
|
@@ -206,7 +210,8 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
206
210
|
});
|
|
207
211
|
}),
|
|
208
212
|
prismaCliBinaryTargets: envMap.PRISMA_CLI_BINARY_TARGETS,
|
|
209
|
-
noPrismaEngine: argv['prisma-engine'] === false
|
|
213
|
+
noPrismaEngine: argv['prisma-engine'] === false,
|
|
214
|
+
noEmptyDistDir: argv['empty-dist-dir'] === false
|
|
210
215
|
});
|
|
211
216
|
console.log('构建成功');
|
|
212
217
|
if (argv.deploy) {
|
package/lib/cli/deploy_util.js
CHANGED
|
@@ -20,14 +20,14 @@ export class DeployUtil {
|
|
|
20
20
|
const appDir = `./${appName}`;
|
|
21
21
|
await ssh.execCommand(dedent`
|
|
22
22
|
set -ex
|
|
23
|
-
mkdir -p ./app_files/${appName}
|
|
23
|
+
mkdir -p ./app_files/${appName}/${options.channel || 'dist'}
|
|
24
24
|
mkdir -p ${appDir}
|
|
25
25
|
`, {
|
|
26
26
|
cwd: options.dir,
|
|
27
27
|
onStdout: buf => console.log(buf.toString()),
|
|
28
28
|
onStderr: buf => console.log(buf.toString())
|
|
29
29
|
});
|
|
30
|
-
const remoteAppFile = `${options.dir}/app_files/${appName}/${path.basename(appFile)}`;
|
|
30
|
+
const remoteAppFile = `${options.dir}/app_files/${appName}/${options.channel || 'dist'}/${path.basename(appFile)}`;
|
|
31
31
|
await ssh.putFile(appFile, remoteAppFile);
|
|
32
32
|
await ssh.execCommand(dedent`
|
|
33
33
|
set -ex
|