@jayfong/x-server 2.46.0 → 2.47.1

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.
@@ -159,7 +159,8 @@ class BuildUtil {
159
159
 
160
160
  // .nvmrc
161
161
  const nvmrcFile = _nodePath.default.join(options.cwd, '.nvmrc');
162
- if (await _fsExtra.default.pathExists(nvmrcFile)) {
162
+ const hasNvmrc = await _fsExtra.default.pathExists(nvmrcFile);
163
+ if (hasNvmrc) {
163
164
  await _fsExtra.default.writeFile(distNvmrcFile, await _fsExtra.default.readFile(nvmrcFile));
164
165
  }
165
166
 
@@ -170,6 +171,10 @@ class BuildUtil {
170
171
  {
171
172
  name: ${JSON.stringify(pkgContent.name)},
172
173
  script: './main.js',
174
+ ...(${JSON.stringify(hasNvmrc ? {
175
+ interpreter: 'fnm',
176
+ interpreter_args: 'exec node'
177
+ } : {})}),
173
178
  ...(process.env.PM2_MEMORY ? { max_memory_restart: process.env.PM2_MEMORY } : {}),
174
179
  },
175
180
  ],
@@ -38,7 +38,6 @@ class DeployUtil {
38
38
  tar -zxvf ${remoteAppFile} -C ${appDir}
39
39
  cd ${appDir}/dist
40
40
  [ -f no_install.lock ] && yarn_disable_self_update_check=true tyn
41
- [ -f .nvmrc ] && eval "$(fnm env)"
42
41
  ${options.cmd || ''}
43
42
  ${options.memory ? `PM2_MEMORY=${options.memory} ` : ''}pm2 startOrReload pm2.config.js
44
43
  `, {
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
4
  exports.__esModule = true;
5
- exports.FileParserPlugin = void 0;
6
- var _multipart = _interopRequireDefault(require("@fastify/multipart"));
5
+ exports.MultipartFile = exports.FileParserPlugin = void 0;
6
+ var _multipart = _interopRequireWildcard(require("@fastify/multipart"));
7
+ exports.MultipartFile = _multipart.MultipartFile;
7
8
  var _vtils = require("vtils");
8
9
  /**
9
10
  * file 解析器插件
@@ -153,7 +153,8 @@ export class BuildUtil {
153
153
 
154
154
  // .nvmrc
155
155
  const nvmrcFile = path.join(options.cwd, '.nvmrc');
156
- if (await fs.pathExists(nvmrcFile)) {
156
+ const hasNvmrc = await fs.pathExists(nvmrcFile);
157
+ if (hasNvmrc) {
157
158
  await fs.writeFile(distNvmrcFile, await fs.readFile(nvmrcFile));
158
159
  }
159
160
 
@@ -164,6 +165,10 @@ export class BuildUtil {
164
165
  {
165
166
  name: ${JSON.stringify(pkgContent.name)},
166
167
  script: './main.js',
168
+ ...(${JSON.stringify(hasNvmrc ? {
169
+ interpreter: 'fnm',
170
+ interpreter_args: 'exec node'
171
+ } : {})}),
167
172
  ...(process.env.PM2_MEMORY ? { max_memory_restart: process.env.PM2_MEMORY } : {}),
168
173
  },
169
174
  ],
@@ -33,7 +33,6 @@ export class DeployUtil {
33
33
  tar -zxvf ${remoteAppFile} -C ${appDir}
34
34
  cd ${appDir}/dist
35
35
  [ -f no_install.lock ] && yarn_disable_self_update_check=true tyn
36
- [ -f .nvmrc ] && eval "$(fnm env)"
37
36
  ${options.cmd || ''}
38
37
  ${options.memory ? `PM2_MEMORY=${options.memory} ` : ''}pm2 startOrReload pm2.config.js
39
38
  `, {
@@ -1,6 +1,7 @@
1
1
  import { FastifyMultipartOptions } from '@fastify/multipart';
2
- import { BasePlugin } from './base';
3
2
  import { FastifyInstance } from 'fastify';
3
+ import { BasePlugin } from './base';
4
+ export { MultipartFile } from '@fastify/multipart';
4
5
  export interface FileParserPluginOptions extends FastifyMultipartOptions {
5
6
  }
6
7
  /**
@@ -1,5 +1,6 @@
1
1
  import FastifyMultipart from '@fastify/multipart';
2
2
  import { bytes } from 'vtils';
3
+ export { MultipartFile } from '@fastify/multipart';
3
4
  /**
4
5
  * file 解析器插件
5
6
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-server",
3
- "version": "2.46.0",
3
+ "version": "2.47.1",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",