@jayfong/x-server 1.11.3 → 1.11.4
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/CHANGELOG.md +7 -0
- package/lib/_cjs/cli/build_util.js +11 -0
- package/lib/_cjs/cli/cli.js +1 -4
- package/lib/cli/build_util.js +10 -0
- package/lib/cli/cli.js +1 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.11.4](https://github.com/jfWorks/x-server/compare/v1.11.3...v1.11.4) (2022-04-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* 下载 centos (rhel-openssl-1.0.x) 的可执行文件 ([1b5a13f](https://github.com/jfWorks/x-server/commit/1b5a13f30dd46d0cc5d76ee1697580ad07ab03cd))
|
|
11
|
+
|
|
5
12
|
### [1.11.3](https://github.com/jfWorks/x-server/compare/v1.11.2...v1.11.3) (2022-04-20)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -15,6 +15,8 @@ var _execa = _interopRequireDefault(require("execa"));
|
|
|
15
15
|
|
|
16
16
|
var _fsExtra = _interopRequireDefault(require("fs-extra"));
|
|
17
17
|
|
|
18
|
+
var _os = _interopRequireDefault(require("os"));
|
|
19
|
+
|
|
18
20
|
var _nodePath = _interopRequireDefault(require("node:path"));
|
|
19
21
|
|
|
20
22
|
var _vtils = require("vtils");
|
|
@@ -109,6 +111,15 @@ class BuildUtil {
|
|
|
109
111
|
const prismaSchemaFile = _nodePath.default.join(options.cwd, 'src/db/schema.prisma');
|
|
110
112
|
|
|
111
113
|
if (await _fsExtra.default.pathExists(prismaSchemaFile)) {
|
|
114
|
+
// 下载 centos (rhel-openssl-1.0.x) 的可执行文件
|
|
115
|
+
await (0, _execa.default)('node', [require.resolve('@prisma/engines/download/index.js')], {
|
|
116
|
+
env: {
|
|
117
|
+
// https://www.prisma.io/docs/reference/api-reference/environment-variables-reference#prisma_cli_binary_targets
|
|
118
|
+
// https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#binarytargets-options
|
|
119
|
+
PRISMA_CLI_BINARY_TARGETS: `${_os.default.platform() === 'darwin' ? 'darwin' : 'windows'},rhel-openssl-1.0.x`
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
|
|
112
123
|
const distPrismaSchemaFile = _nodePath.default.join(distDir, 'schema.prisma');
|
|
113
124
|
|
|
114
125
|
await _fsExtra.default.copyFile(prismaSchemaFile, distPrismaSchemaFile);
|
package/lib/_cjs/cli/cli.js
CHANGED
|
@@ -131,10 +131,7 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
131
131
|
type: 'boolean',
|
|
132
132
|
default: false
|
|
133
133
|
}), async argv => {
|
|
134
|
-
process.env.NODE_ENV = argv.production ? 'production' : 'development';
|
|
135
|
-
// https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#binarytargets-options
|
|
136
|
-
|
|
137
|
-
process.env.PRISMA_CLI_BINARY_TARGETS = 'darwin,rhel-openssl-1.0.x';
|
|
134
|
+
process.env.NODE_ENV = argv.production ? 'production' : 'development';
|
|
138
135
|
await _env_util.EnvUtil.importFile({
|
|
139
136
|
cwd: process.cwd(),
|
|
140
137
|
file: '.env'
|
package/lib/cli/build_util.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as esbuild from 'esbuild';
|
|
2
2
|
import compressing from 'compressing';
|
|
3
3
|
import exec from 'execa';
|
|
4
|
+
import execa from 'execa';
|
|
4
5
|
import fs from 'fs-extra';
|
|
6
|
+
import os from 'os';
|
|
5
7
|
import path from 'node:path';
|
|
6
8
|
import { dedent, uniq } from 'vtils';
|
|
7
9
|
export class BuildUtil {
|
|
@@ -85,6 +87,14 @@ export class BuildUtil {
|
|
|
85
87
|
const prismaSchemaFile = path.join(options.cwd, 'src/db/schema.prisma');
|
|
86
88
|
|
|
87
89
|
if (await fs.pathExists(prismaSchemaFile)) {
|
|
90
|
+
// 下载 centos (rhel-openssl-1.0.x) 的可执行文件
|
|
91
|
+
await execa('node', [require.resolve('@prisma/engines/download/index.js')], {
|
|
92
|
+
env: {
|
|
93
|
+
// https://www.prisma.io/docs/reference/api-reference/environment-variables-reference#prisma_cli_binary_targets
|
|
94
|
+
// https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#binarytargets-options
|
|
95
|
+
PRISMA_CLI_BINARY_TARGETS: `${os.platform() === 'darwin' ? 'darwin' : 'windows'},rhel-openssl-1.0.x`
|
|
96
|
+
}
|
|
97
|
+
});
|
|
88
98
|
const distPrismaSchemaFile = path.join(distDir, 'schema.prisma');
|
|
89
99
|
await fs.copyFile(prismaSchemaFile, distPrismaSchemaFile);
|
|
90
100
|
await fs.copyFile(require.resolve('@prisma/engines/libquery_engine-rhel-openssl-1.0.x.so.node'), path.join(distDir, 'libquery_engine-rhel-openssl-1.0.x.so.node'));
|
package/lib/cli/cli.js
CHANGED
|
@@ -113,10 +113,7 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
113
113
|
type: 'boolean',
|
|
114
114
|
default: false
|
|
115
115
|
}), async argv => {
|
|
116
|
-
process.env.NODE_ENV = argv.production ? 'production' : 'development';
|
|
117
|
-
// https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#binarytargets-options
|
|
118
|
-
|
|
119
|
-
process.env.PRISMA_CLI_BINARY_TARGETS = 'darwin,rhel-openssl-1.0.x';
|
|
116
|
+
process.env.NODE_ENV = argv.production ? 'production' : 'development';
|
|
120
117
|
await EnvUtil.importFile({
|
|
121
118
|
cwd: process.cwd(),
|
|
122
119
|
file: '.env'
|