altair-fastify-plugin 4.4.1 → 4.4.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/dist/index.js +6 -6
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -5,18 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const altair_static_1 = require("altair-static");
|
|
7
7
|
const fastify_plugin_1 = __importDefault(require("fastify-plugin"));
|
|
8
|
-
const
|
|
8
|
+
const static_1 = __importDefault(require("@fastify/static"));
|
|
9
9
|
const fastifyAltairPlugin = (fastify, { path = '/altair', baseURL = '/altair/', endpointURL = '/graphql', ...renderOptions } = {}, done) => {
|
|
10
|
-
fastify.register(
|
|
11
|
-
root: altair_static_1.getDistDirectory(),
|
|
10
|
+
fastify.register(static_1.default, {
|
|
11
|
+
root: (0, altair_static_1.getDistDirectory)(),
|
|
12
12
|
prefix: baseURL,
|
|
13
13
|
});
|
|
14
|
-
const altairPage = altair_static_1.renderAltair({ baseURL, endpointURL, ...renderOptions });
|
|
14
|
+
const altairPage = (0, altair_static_1.renderAltair)({ baseURL, endpointURL, ...renderOptions });
|
|
15
15
|
fastify.get(path, (_req, res) => {
|
|
16
16
|
res.type('text/html').send(altairPage);
|
|
17
17
|
});
|
|
18
18
|
if (renderOptions.serveInitialOptionsInSeperateRequest) {
|
|
19
|
-
const initialOptions = altair_static_1.renderInitialOptions(renderOptions);
|
|
19
|
+
const initialOptions = (0, altair_static_1.renderInitialOptions)(renderOptions);
|
|
20
20
|
const initOptPath = path + '/initial_options.js';
|
|
21
21
|
fastify.get(initOptPath, (_req, res) => {
|
|
22
22
|
res.type('application/javascript').send(initialOptions);
|
|
@@ -24,7 +24,7 @@ const fastifyAltairPlugin = (fastify, { path = '/altair', baseURL = '/altair/',
|
|
|
24
24
|
}
|
|
25
25
|
done();
|
|
26
26
|
};
|
|
27
|
-
exports.default = fastify_plugin_1.default(fastifyAltairPlugin, {
|
|
27
|
+
exports.default = (0, fastify_plugin_1.default)(fastifyAltairPlugin, {
|
|
28
28
|
fastify: '>= 3.x',
|
|
29
29
|
name: 'altair-fastify-plugin',
|
|
30
30
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "altair-fastify-plugin",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.2",
|
|
4
4
|
"description": "Fastify Plugin of Altair GraphQL Client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graphql",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"test": "echo \"Error: no test specified\" && exit 0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"fastify-
|
|
34
|
+
"@fastify/static": "^5.0.0",
|
|
35
|
+
"altair-static": "^4.4.2",
|
|
36
|
+
"fastify-plugin": "^2.3.4"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"fastify": "^3.
|
|
39
|
+
"fastify": "^3.29.0",
|
|
40
40
|
"mercurius": "^6.0.0",
|
|
41
41
|
"ts-node": "^9.0.0",
|
|
42
42
|
"typescript": "^4.0.3"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"fastify": "^3.1.1"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "44bf6dbb486b9afb51be1cb56228903346f515d4"
|
|
48
48
|
}
|