@jayfong/x-server 2.79.1 → 2.80.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 +0 -0
- package/lib/_cjs/exports.js +6 -0
- package/lib/_cjs/plugins/compress.js +18 -0
- package/lib/exports.d.ts +1 -0
- package/lib/exports.js +1 -0
- package/lib/plugins/compress.d.ts +13 -0
- package/lib/plugins/compress.js +12 -0
- package/package.json +5 -2
package/lib/_cjs/cli/cli.js
CHANGED
|
File without changes
|
package/lib/_cjs/exports.js
CHANGED
|
@@ -97,6 +97,12 @@ Object.keys(_base).forEach(function (key) {
|
|
|
97
97
|
if (key in exports && exports[key] === _base[key]) return;
|
|
98
98
|
exports[key] = _base[key];
|
|
99
99
|
});
|
|
100
|
+
var _compress = require("./plugins/compress");
|
|
101
|
+
Object.keys(_compress).forEach(function (key) {
|
|
102
|
+
if (key === "default" || key === "__esModule") return;
|
|
103
|
+
if (key in exports && exports[key] === _compress[key]) return;
|
|
104
|
+
exports[key] = _compress[key];
|
|
105
|
+
});
|
|
100
106
|
var _cookie = require("./plugins/cookie");
|
|
101
107
|
Object.keys(_cookie).forEach(function (key) {
|
|
102
108
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.CompressPlugin = void 0;
|
|
6
|
+
var _compress = _interopRequireDefault(require("@fastify/compress"));
|
|
7
|
+
/**
|
|
8
|
+
* 响应压缩插件
|
|
9
|
+
*/
|
|
10
|
+
class CompressPlugin {
|
|
11
|
+
constructor(options) {
|
|
12
|
+
this.options = options;
|
|
13
|
+
}
|
|
14
|
+
register(fastify) {
|
|
15
|
+
fastify.register(_compress.default, this.options);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.CompressPlugin = CompressPlugin;
|
package/lib/exports.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './core/http_redirect';
|
|
|
14
14
|
export * from './core/server';
|
|
15
15
|
export * from './core/types';
|
|
16
16
|
export * from './plugins/base';
|
|
17
|
+
export * from './plugins/compress';
|
|
17
18
|
export * from './plugins/cookie';
|
|
18
19
|
export * from './plugins/cors';
|
|
19
20
|
export * from './plugins/file_parser';
|
package/lib/exports.js
CHANGED
|
@@ -15,6 +15,7 @@ export * from "./core/http_redirect";
|
|
|
15
15
|
export * from "./core/server";
|
|
16
16
|
export * from "./core/types";
|
|
17
17
|
export * from "./plugins/base";
|
|
18
|
+
export * from "./plugins/compress";
|
|
18
19
|
export * from "./plugins/cookie";
|
|
19
20
|
export * from "./plugins/cors";
|
|
20
21
|
export * from "./plugins/file_parser";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FastifyCompressOptions } from '@fastify/compress';
|
|
2
|
+
import { FastifyInstance } from 'fastify';
|
|
3
|
+
import { BasePlugin } from './base';
|
|
4
|
+
export interface CompressPluginOptions extends FastifyCompressOptions {
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 响应压缩插件
|
|
8
|
+
*/
|
|
9
|
+
export declare class CompressPlugin implements BasePlugin {
|
|
10
|
+
private options?;
|
|
11
|
+
constructor(options?: CompressPluginOptions | undefined);
|
|
12
|
+
register(fastify: FastifyInstance<any, any, any, any, any>): void;
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jayfong/x-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.80.0",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "lib/_cjs/index.js",
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
"bin": {
|
|
10
10
|
"xs": "lib/_cjs/cli/cli.js"
|
|
11
11
|
},
|
|
12
|
-
"files": [
|
|
12
|
+
"files": [
|
|
13
|
+
"lib"
|
|
14
|
+
],
|
|
13
15
|
"scripts": {
|
|
14
16
|
"build": "haoma compile",
|
|
15
17
|
"build_test_pkg": "tyn build && rm -rf ./lib_test && mkdir -p ./lib_test && cp -r ./lib ./lib_test/lib && cp ./package.json ./lib_test/package.json && cd ./tests/app && tyn add file:../../lib_test",
|
|
@@ -19,6 +21,7 @@
|
|
|
19
21
|
"test_api_qiqi": "cd /Users/admin/Documents/jfWorks/qiqi-server && DEBUG=api tsx /Users/admin/Documents/jfWorks/x/packages/x-server/src/cli/cli.ts api"
|
|
20
22
|
},
|
|
21
23
|
"dependencies": {
|
|
24
|
+
"@fastify/compress": "^8.0.1",
|
|
22
25
|
"@fastify/cookie": "^9.4.0",
|
|
23
26
|
"@fastify/cors": "^8.3.0",
|
|
24
27
|
"@fastify/formbody": "^7.4.0",
|