@jayfong/x-server 2.88.0 → 2.88.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/lib/_cjs/cli/build_util.js +8 -1
- package/lib/_cjs/cli/cli.js +10 -9
- package/lib/_cjs/cli/deploy_util.js +1 -1
- package/lib/cli/build_util.js +8 -1
- package/lib/cli/cli.js +10 -9
- package/lib/cli/deploy_util.js +1 -1
- package/package.json +1 -1
|
@@ -178,7 +178,14 @@ class BuildUtil {
|
|
|
178
178
|
const distMultipleSchemaDir = _nodePath.default.join(distDir, _nodePath.default.basename(multipleSchemaDir));
|
|
179
179
|
await _fsExtra.default.copy(multipleSchemaDir, distMultipleSchemaDir);
|
|
180
180
|
}
|
|
181
|
-
if (
|
|
181
|
+
if (options.noPrismaEngine) {
|
|
182
|
+
const prismaEngineFiles = await (0, _globby.default)('libquery_engine-*', {
|
|
183
|
+
cwd: distDir,
|
|
184
|
+
onlyFiles: true,
|
|
185
|
+
absolute: true
|
|
186
|
+
});
|
|
187
|
+
await Promise.all(prismaEngineFiles.map(file => _fsExtra.default.remove(file)));
|
|
188
|
+
} else {
|
|
182
189
|
// 复制查询引擎
|
|
183
190
|
const libqueryEngineFiles = await (0, _globby.default)('libquery_engine-*', {
|
|
184
191
|
cwd: _nodePath.default.join(options.cwd, 'node_modules/.prisma/client'),
|
package/lib/_cjs/cli/cli.js
CHANGED
|
@@ -140,11 +140,10 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
140
140
|
describe: '是否压缩',
|
|
141
141
|
type: 'boolean',
|
|
142
142
|
default: true
|
|
143
|
-
}).positional('
|
|
144
|
-
|
|
145
|
-
describe: '是否不本地安装外部依赖',
|
|
143
|
+
}).positional('local-install', {
|
|
144
|
+
describe: '是否本地安装外部依赖',
|
|
146
145
|
type: 'boolean',
|
|
147
|
-
default:
|
|
146
|
+
default: true
|
|
148
147
|
}).positional('channel', {
|
|
149
148
|
alias: 'h',
|
|
150
149
|
describe: '渠道',
|
|
@@ -164,10 +163,12 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
164
163
|
describe: '构建时排除的文件',
|
|
165
164
|
type: 'string',
|
|
166
165
|
array: true
|
|
167
|
-
})
|
|
168
|
-
|
|
166
|
+
})
|
|
167
|
+
// 注意:不要加 no 前缀,其会自动处理
|
|
168
|
+
.positional('prisma-engine', {
|
|
169
|
+
describe: '是否包含 Prisma 引擎',
|
|
169
170
|
type: 'boolean',
|
|
170
|
-
default:
|
|
171
|
+
default: true
|
|
171
172
|
}), async argv => {
|
|
172
173
|
await _env_util.EnvUtil.withChannel({
|
|
173
174
|
cwd: process.cwd(),
|
|
@@ -197,7 +198,7 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
197
198
|
external: externals,
|
|
198
199
|
inlineEnvs: envMap,
|
|
199
200
|
minify: argv.minify,
|
|
200
|
-
noInstall: argv['
|
|
201
|
+
noInstall: argv['local-install'] === false,
|
|
201
202
|
channel: channel,
|
|
202
203
|
excludeFiles: (argv.exclude ? (0, _vtils.castArray)(argv.exclude) : []).map(item => {
|
|
203
204
|
return _vtils.StringTemplate.render(item, envMap, {
|
|
@@ -207,7 +208,7 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
207
208
|
});
|
|
208
209
|
}),
|
|
209
210
|
prismaCliBinaryTargets: envMap.PRISMA_CLI_BINARY_TARGETS,
|
|
210
|
-
noPrismaEngine: argv['
|
|
211
|
+
noPrismaEngine: argv['prisma-engine'] === false
|
|
211
212
|
});
|
|
212
213
|
console.log('构建成功');
|
|
213
214
|
if (argv.deploy) {
|
|
@@ -36,7 +36,7 @@ class DeployUtil {
|
|
|
36
36
|
await ssh.putFile(appFile, remoteAppFile);
|
|
37
37
|
await ssh.execCommand((0, _vtils.dedent)`
|
|
38
38
|
set -ex
|
|
39
|
-
tar -
|
|
39
|
+
tar -zxf ${remoteAppFile} -C ${appDir}
|
|
40
40
|
cd "${appDir}/${options.channel || 'dist'}"
|
|
41
41
|
[ -f no_install.lock ] && yarn_disable_self_update_check=true tyn
|
|
42
42
|
${options.cmd || ''}
|
package/lib/cli/build_util.js
CHANGED
|
@@ -172,7 +172,14 @@ export class BuildUtil {
|
|
|
172
172
|
const distMultipleSchemaDir = path.join(distDir, path.basename(multipleSchemaDir));
|
|
173
173
|
await fs.copy(multipleSchemaDir, distMultipleSchemaDir);
|
|
174
174
|
}
|
|
175
|
-
if (
|
|
175
|
+
if (options.noPrismaEngine) {
|
|
176
|
+
const prismaEngineFiles = await globby('libquery_engine-*', {
|
|
177
|
+
cwd: distDir,
|
|
178
|
+
onlyFiles: true,
|
|
179
|
+
absolute: true
|
|
180
|
+
});
|
|
181
|
+
await Promise.all(prismaEngineFiles.map(file => fs.remove(file)));
|
|
182
|
+
} else {
|
|
176
183
|
// 复制查询引擎
|
|
177
184
|
const libqueryEngineFiles = await globby('libquery_engine-*', {
|
|
178
185
|
cwd: path.join(options.cwd, 'node_modules/.prisma/client'),
|
package/lib/cli/cli.js
CHANGED
|
@@ -138,11 +138,10 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
138
138
|
describe: '是否压缩',
|
|
139
139
|
type: 'boolean',
|
|
140
140
|
default: true
|
|
141
|
-
}).positional('
|
|
142
|
-
|
|
143
|
-
describe: '是否不本地安装外部依赖',
|
|
141
|
+
}).positional('local-install', {
|
|
142
|
+
describe: '是否本地安装外部依赖',
|
|
144
143
|
type: 'boolean',
|
|
145
|
-
default:
|
|
144
|
+
default: true
|
|
146
145
|
}).positional('channel', {
|
|
147
146
|
alias: 'h',
|
|
148
147
|
describe: '渠道',
|
|
@@ -162,10 +161,12 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
162
161
|
describe: '构建时排除的文件',
|
|
163
162
|
type: 'string',
|
|
164
163
|
array: true
|
|
165
|
-
})
|
|
166
|
-
|
|
164
|
+
})
|
|
165
|
+
// 注意:不要加 no 前缀,其会自动处理
|
|
166
|
+
.positional('prisma-engine', {
|
|
167
|
+
describe: '是否包含 Prisma 引擎',
|
|
167
168
|
type: 'boolean',
|
|
168
|
-
default:
|
|
169
|
+
default: true
|
|
169
170
|
}), async argv => {
|
|
170
171
|
await EnvUtil.withChannel({
|
|
171
172
|
cwd: process.cwd(),
|
|
@@ -195,7 +196,7 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
195
196
|
external: externals,
|
|
196
197
|
inlineEnvs: envMap,
|
|
197
198
|
minify: argv.minify,
|
|
198
|
-
noInstall: argv['
|
|
199
|
+
noInstall: argv['local-install'] === false,
|
|
199
200
|
channel: channel,
|
|
200
201
|
excludeFiles: (argv.exclude ? castArray(argv.exclude) : []).map(item => {
|
|
201
202
|
return StringTemplate.render(item, envMap, {
|
|
@@ -205,7 +206,7 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
205
206
|
});
|
|
206
207
|
}),
|
|
207
208
|
prismaCliBinaryTargets: envMap.PRISMA_CLI_BINARY_TARGETS,
|
|
208
|
-
noPrismaEngine: argv['
|
|
209
|
+
noPrismaEngine: argv['prisma-engine'] === false
|
|
209
210
|
});
|
|
210
211
|
console.log('构建成功');
|
|
211
212
|
if (argv.deploy) {
|
package/lib/cli/deploy_util.js
CHANGED
|
@@ -31,7 +31,7 @@ export class DeployUtil {
|
|
|
31
31
|
await ssh.putFile(appFile, remoteAppFile);
|
|
32
32
|
await ssh.execCommand(dedent`
|
|
33
33
|
set -ex
|
|
34
|
-
tar -
|
|
34
|
+
tar -zxf ${remoteAppFile} -C ${appDir}
|
|
35
35
|
cd "${appDir}/${options.channel || 'dist'}"
|
|
36
36
|
[ -f no_install.lock ] && yarn_disable_self_update_check=true tyn
|
|
37
37
|
${options.cmd || ''}
|