@jayfong/x-server 2.81.1 → 2.83.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/build_util.js +15 -14
- package/lib/_cjs/cli/cli.js +6 -1
- package/lib/cli/build_util.d.ts +1 -0
- package/lib/cli/build_util.js +15 -14
- package/lib/cli/cli.js +6 -1
- package/package.json +1 -1
|
@@ -178,21 +178,22 @@ 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
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
181
|
+
if (!options.noPrismaEngine) {
|
|
182
|
+
// 复制查询引擎
|
|
183
|
+
const libqueryEngineFiles = await (0, _globby.default)('libquery_engine-*', {
|
|
184
|
+
cwd: _nodePath.default.join(options.cwd, 'node_modules/.prisma/client'),
|
|
185
|
+
ignore: ['libquery_engine-{darwin,windows}*'],
|
|
186
|
+
onlyFiles: true,
|
|
187
|
+
absolute: true
|
|
188
|
+
});
|
|
189
|
+
const prismaCliBinaryTargets = options.prismaCliBinaryTargets?.split(',') || [];
|
|
190
|
+
for (const libqueryEngineFile of libqueryEngineFiles) {
|
|
191
|
+
const libqueryEngineFileBaseName = _nodePath.default.basename(libqueryEngineFile);
|
|
192
|
+
if (prismaCliBinaryTargets.length && prismaCliBinaryTargets.every(prismaCliBinaryTarget => !libqueryEngineFile.includes(prismaCliBinaryTarget))) {
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
await _fsExtra.default.copyFile(libqueryEngineFile, _nodePath.default.join(distDir, libqueryEngineFileBaseName));
|
|
194
196
|
}
|
|
195
|
-
await _fsExtra.default.copyFile(libqueryEngineFile, _nodePath.default.join(distDir, libqueryEngineFileBaseName));
|
|
196
197
|
}
|
|
197
198
|
}
|
|
198
199
|
|
package/lib/_cjs/cli/cli.js
CHANGED
|
@@ -164,6 +164,10 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
164
164
|
describe: '构建时排除的文件',
|
|
165
165
|
type: 'string',
|
|
166
166
|
array: true
|
|
167
|
+
}).positional('no-prisma-engine', {
|
|
168
|
+
describe: '是否不包含 Prisma 引擎',
|
|
169
|
+
type: 'boolean',
|
|
170
|
+
default: false
|
|
167
171
|
}), async argv => {
|
|
168
172
|
await _env_util.EnvUtil.withChannel({
|
|
169
173
|
cwd: process.cwd(),
|
|
@@ -202,7 +206,8 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
202
206
|
beforeReplace: v => (0, _vtils.escapeRegExp)(v)
|
|
203
207
|
});
|
|
204
208
|
}),
|
|
205
|
-
prismaCliBinaryTargets: envMap.PRISMA_CLI_BINARY_TARGETS
|
|
209
|
+
prismaCliBinaryTargets: envMap.PRISMA_CLI_BINARY_TARGETS,
|
|
210
|
+
noPrismaEngine: argv['no-prisma-engine']
|
|
206
211
|
});
|
|
207
212
|
console.log('构建成功');
|
|
208
213
|
if (argv.deploy) {
|
package/lib/cli/build_util.d.ts
CHANGED
package/lib/cli/build_util.js
CHANGED
|
@@ -172,21 +172,22 @@ export class BuildUtil {
|
|
|
172
172
|
const distMultipleSchemaDir = path.join(distDir, path.basename(multipleSchemaDir));
|
|
173
173
|
await fs.copy(multipleSchemaDir, distMultipleSchemaDir);
|
|
174
174
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
175
|
+
if (!options.noPrismaEngine) {
|
|
176
|
+
// 复制查询引擎
|
|
177
|
+
const libqueryEngineFiles = await globby('libquery_engine-*', {
|
|
178
|
+
cwd: path.join(options.cwd, 'node_modules/.prisma/client'),
|
|
179
|
+
ignore: ['libquery_engine-{darwin,windows}*'],
|
|
180
|
+
onlyFiles: true,
|
|
181
|
+
absolute: true
|
|
182
|
+
});
|
|
183
|
+
const prismaCliBinaryTargets = options.prismaCliBinaryTargets?.split(',') || [];
|
|
184
|
+
for (const libqueryEngineFile of libqueryEngineFiles) {
|
|
185
|
+
const libqueryEngineFileBaseName = path.basename(libqueryEngineFile);
|
|
186
|
+
if (prismaCliBinaryTargets.length && prismaCliBinaryTargets.every(prismaCliBinaryTarget => !libqueryEngineFile.includes(prismaCliBinaryTarget))) {
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
await fs.copyFile(libqueryEngineFile, path.join(distDir, libqueryEngineFileBaseName));
|
|
188
190
|
}
|
|
189
|
-
await fs.copyFile(libqueryEngineFile, path.join(distDir, libqueryEngineFileBaseName));
|
|
190
191
|
}
|
|
191
192
|
}
|
|
192
193
|
|
package/lib/cli/cli.js
CHANGED
|
@@ -162,6 +162,10 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
162
162
|
describe: '构建时排除的文件',
|
|
163
163
|
type: 'string',
|
|
164
164
|
array: true
|
|
165
|
+
}).positional('no-prisma-engine', {
|
|
166
|
+
describe: '是否不包含 Prisma 引擎',
|
|
167
|
+
type: 'boolean',
|
|
168
|
+
default: false
|
|
165
169
|
}), async argv => {
|
|
166
170
|
await EnvUtil.withChannel({
|
|
167
171
|
cwd: process.cwd(),
|
|
@@ -200,7 +204,8 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
200
204
|
beforeReplace: v => escapeRegExp(v)
|
|
201
205
|
});
|
|
202
206
|
}),
|
|
203
|
-
prismaCliBinaryTargets: envMap.PRISMA_CLI_BINARY_TARGETS
|
|
207
|
+
prismaCliBinaryTargets: envMap.PRISMA_CLI_BINARY_TARGETS,
|
|
208
|
+
noPrismaEngine: argv['no-prisma-engine']
|
|
204
209
|
});
|
|
205
210
|
console.log('构建成功');
|
|
206
211
|
if (argv.deploy) {
|