vxrn 0.1.63 → 0.1.65
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/cjs/exports/createServer.js +9 -34
- package/dist/cjs/exports/createServer.js.map +2 -2
- package/dist/cjs/exports/createServer.native.js +42 -72
- package/dist/cjs/exports/createServer.native.js.map +2 -2
- package/dist/cjs/exports/serve.js +9 -3
- package/dist/cjs/exports/serve.js.map +2 -2
- package/dist/cjs/exports/serve.native.js +7 -3
- package/dist/cjs/exports/serve.native.js.map +2 -2
- package/dist/esm/exports/createServer.js +9 -25
- package/dist/esm/exports/createServer.js.map +1 -1
- package/dist/esm/exports/createServer.mjs +7 -33
- package/dist/esm/exports/createServer.native.js +42 -63
- package/dist/esm/exports/createServer.native.js.map +2 -2
- package/dist/esm/exports/serve.js +9 -4
- package/dist/esm/exports/serve.js.map +1 -1
- package/dist/esm/exports/serve.mjs +9 -5
- package/dist/esm/exports/serve.native.js +7 -4
- package/dist/esm/exports/serve.native.js.map +2 -2
- package/dist/esm/vendor/debugger-app/src/index.mjs +1 -1
- package/package.json +12 -9
- package/src/exports/createServer.ts +47 -28
- package/src/exports/serve.ts +8 -4
- package/src/types.ts +2 -2
- package/types/exports/createServer.d.ts +2 -1
- package/types/types.d.ts +2 -2
- package/types/utils/getOptionsFilled.d.ts +1 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
7
|
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
@@ -12,44 +11,20 @@ var __export = (target, all) => {
|
|
|
12
11
|
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
12
|
return to;
|
|
14
13
|
};
|
|
15
|
-
var
|
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
-
mod
|
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
15
|
var createServer_exports = {};
|
|
24
16
|
__export(createServer_exports, {
|
|
25
17
|
createProdServer: () => createProdServer
|
|
26
18
|
});
|
|
27
19
|
module.exports = __toCommonJS(createServer_exports);
|
|
28
|
-
var
|
|
20
|
+
var import_hono = require("hono"), import_compress = require("hono/compress"), import_serve_static = require("@hono/node-server/serve-static");
|
|
29
21
|
const createProdServer = async (options) => {
|
|
30
|
-
const app =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
await new Promise((response) => {
|
|
36
|
-
sirvStaticMiddleware(req, res, () => {
|
|
37
|
-
response();
|
|
38
|
-
});
|
|
39
|
-
});
|
|
22
|
+
const app = new import_hono.Hono();
|
|
23
|
+
return app.use((0, import_compress.compress)()), app.use(
|
|
24
|
+
"*",
|
|
25
|
+
(0, import_serve_static.serveStatic)({
|
|
26
|
+
root: "./dist/client"
|
|
40
27
|
})
|
|
41
|
-
);
|
|
42
|
-
const sirvMiddleware = (0, import_sirv.default)("dist/client", {
|
|
43
|
-
gzip: !0
|
|
44
|
-
});
|
|
45
|
-
return app.use(
|
|
46
|
-
(0, import_h3.defineEventHandler)(async ({ node: { req, res } }) => {
|
|
47
|
-
await new Promise((response) => {
|
|
48
|
-
sirvMiddleware(req, res, () => {
|
|
49
|
-
response();
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
})
|
|
53
|
-
), app;
|
|
28
|
+
), options.serve && options.serve(options, app), app;
|
|
54
29
|
};
|
|
55
30
|
//# sourceMappingURL=createServer.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/exports/createServer.ts"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": [
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB,iBACrB,kBAAyB,0BAEzB,sBAA4B;AAIrB,MAAM,mBAAmB,OAAO,YAAwB;AAC7D,QAAM,MAAM,IAAI,iBAAK;AAErB,aAAI,QAAI,0BAAS,CAAC,GAElB,IAAI;AAAA,IACF;AAAA,QACA,iCAAY;AAAA,MACV,MAAM;AAAA,IACR,CAAC;AAAA,EACH,GAUI,QAAQ,SACV,QAAQ,MAAM,SAAS,GAAG,GAGrB;AACT;",
|
|
5
|
+
"names": []
|
|
6
6
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
6
|
var __export = (target, all) => {
|
|
8
7
|
for (var name in all)
|
|
9
8
|
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
@@ -13,20 +12,13 @@ var __export = (target, all) => {
|
|
|
13
12
|
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
13
|
return to;
|
|
15
14
|
};
|
|
16
|
-
var
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
|
-
mod
|
|
23
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
16
|
var createServer_exports = {};
|
|
25
17
|
__export(createServer_exports, {
|
|
26
18
|
createProdServer: () => createProdServer
|
|
27
19
|
});
|
|
28
20
|
module.exports = __toCommonJS(createServer_exports);
|
|
29
|
-
var
|
|
21
|
+
var import_hono = require("hono"), import_compress = require("hono/compress"), import_serve_static = require("@hono/node-server/serve-static");
|
|
30
22
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
31
23
|
try {
|
|
32
24
|
var info = gen[key](arg), value = info.value;
|
|
@@ -143,67 +135,45 @@ function _ts_generator(thisArg, body) {
|
|
|
143
135
|
}
|
|
144
136
|
}
|
|
145
137
|
var createProdServer = function() {
|
|
146
|
-
var _ref = _async_to_generator(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
return
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
new Promise(function(response) {
|
|
186
|
-
sirvMiddleware(req, res, function() {
|
|
187
|
-
response();
|
|
188
|
-
});
|
|
189
|
-
})
|
|
190
|
-
];
|
|
191
|
-
case 1:
|
|
192
|
-
return _state2.sent(), [
|
|
193
|
-
2
|
|
194
|
-
];
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
});
|
|
198
|
-
return function(_) {
|
|
199
|
-
return _ref2.apply(this, arguments);
|
|
200
|
-
};
|
|
201
|
-
}())), [
|
|
202
|
-
2,
|
|
203
|
-
app
|
|
204
|
-
];
|
|
205
|
-
});
|
|
206
|
-
});
|
|
138
|
+
var _ref = _async_to_generator(
|
|
139
|
+
function(options) {
|
|
140
|
+
var app;
|
|
141
|
+
return _ts_generator(this, function(_state) {
|
|
142
|
+
return app = new import_hono.Hono(), app.use((0, import_compress.compress)()), app.use("*", (0, import_serve_static.serveStatic)({
|
|
143
|
+
root: "./dist/client"
|
|
144
|
+
})), options.serve && options.serve(options, app), [
|
|
145
|
+
2,
|
|
146
|
+
app
|
|
147
|
+
];
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
// // testing cache
|
|
151
|
+
// const caches = {}
|
|
152
|
+
// function createCache(name: string) {
|
|
153
|
+
// if (caches[name]) return caches[name] as any
|
|
154
|
+
// const store = {}
|
|
155
|
+
// const cache = {
|
|
156
|
+
// async match(key: string) {
|
|
157
|
+
// console.log('matching', key)
|
|
158
|
+
// return store[key]
|
|
159
|
+
// },
|
|
160
|
+
// async put(key: string, val) {
|
|
161
|
+
// store[key] = val
|
|
162
|
+
// },
|
|
163
|
+
// async delete(key: string) {
|
|
164
|
+
// delete store[key]
|
|
165
|
+
// },
|
|
166
|
+
// }
|
|
167
|
+
// caches[name] = cache
|
|
168
|
+
// return cache
|
|
169
|
+
// }
|
|
170
|
+
// globalThis.caches = {
|
|
171
|
+
// ...createCache(''),
|
|
172
|
+
// async open(name: string) {
|
|
173
|
+
// return createCache(name)
|
|
174
|
+
// },
|
|
175
|
+
// }
|
|
176
|
+
);
|
|
207
177
|
return function(options) {
|
|
208
178
|
return _ref.apply(this, arguments);
|
|
209
179
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/exports/Users/n8/vxrn/packages/vxrn/src/exports/createServer.ts"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": ["createProdServer", "options", "app", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA,kBAAqB,iBACrB,kBAAyB,0BAEzB,sBAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIrB,IAAMA,mBAAAA,WAAAA;aAAmB;IAAA,SAAOC,SAAAA;UAC/BC;;AAAAA,qBAAM,IAAIC,iBAAAA,GAEhBD,IAAIE,QAAIC,0BAAAA,CAAAA,GAERH,IAAIE,IACF,SACAE,iCAAY;UACVC,MAAM;QACR,CAAA,CAAA,GAWEN,QAAQO,SACVP,QAAQO,MAAMP,SAASC,GAAAA,GAGzB;;UAAOA;;;IACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAzBuCD,SAAAA;;;;",
|
|
5
|
+
"names": ["createProdServer", "options", "app", "Hono", "use", "compress", "serveStatic", "root", "serve"]
|
|
6
6
|
}
|
|
@@ -17,10 +17,16 @@ __export(serve_exports, {
|
|
|
17
17
|
serve: () => serve
|
|
18
18
|
});
|
|
19
19
|
module.exports = __toCommonJS(serve_exports);
|
|
20
|
-
var
|
|
20
|
+
var import_node_server = require("@hono/node-server"), import_createServer = require("./createServer"), import_getOptionsFilled = require("../utils/getOptionsFilled");
|
|
21
21
|
const serve = async (optionsIn) => {
|
|
22
|
-
const options = await (0, import_getOptionsFilled.getOptionsFilled)(optionsIn, { mode: "prod" }), app = await (0, import_createServer.createProdServer)(options)
|
|
23
|
-
await new Promise((res) => setTimeout(res, 1))
|
|
22
|
+
const options = await (0, import_getOptionsFilled.getOptionsFilled)(optionsIn, { mode: "prod" }), app = await (0, import_createServer.createProdServer)(options);
|
|
23
|
+
await new Promise((res) => setTimeout(res, 1));
|
|
24
|
+
const server = (0, import_node_server.serve)({
|
|
25
|
+
fetch: app.fetch,
|
|
26
|
+
port: options.port,
|
|
27
|
+
hostname: options.host
|
|
28
|
+
});
|
|
29
|
+
console.info(`Listening on http://${options.host}:${options.port}`), await new Promise((res) => {
|
|
24
30
|
server.on("close", () => {
|
|
25
31
|
res();
|
|
26
32
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/exports/serve.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
5
|
-
"names": []
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAmC,8BAGnC,sBAAiC,2BACjC,0BAAiC;AAE1B,MAAM,QAAQ,OAAO,cAA0B;AACpD,QAAM,UAAU,UAAM,0CAAiB,WAAW,EAAE,MAAM,OAAO,CAAC,GAC5D,MAAM,UAAM,sCAAiB,OAAO;AAE1C,QAAM,IAAI,QAAQ,CAAC,QAAQ,WAAW,KAAK,CAAC,CAAC;AAC7C,QAAM,aAAS,mBAAAA,OAAU;AAAA,IACvB,OAAO,IAAI;AAAA,IACX,MAAM,QAAQ;AAAA,IACd,UAAU,QAAQ;AAAA,EACpB,CAAC;AAED,UAAQ,KAAK,uBAAuB,QAAQ,IAAI,IAAI,QAAQ,IAAI,EAAE,GAClE,MAAM,IAAI,QAAc,CAAC,QAAQ;AAC/B,WAAO,GAAG,SAAS,MAAM;AACvB,UAAI;AAAA,IACN,CAAC;AAAA,EACH,CAAC;AACH;",
|
|
5
|
+
"names": ["honoServe"]
|
|
6
6
|
}
|
|
@@ -18,7 +18,7 @@ __export(serve_exports, {
|
|
|
18
18
|
serve: () => serve
|
|
19
19
|
});
|
|
20
20
|
module.exports = __toCommonJS(serve_exports);
|
|
21
|
-
var
|
|
21
|
+
var import_node_server = require("@hono/node-server"), import_createServer = require("./createServer"), import_getOptionsFilled = require("../utils/getOptionsFilled");
|
|
22
22
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
23
23
|
try {
|
|
24
24
|
var info = gen[key](arg), value = info.value;
|
|
@@ -152,14 +152,18 @@ var serve = function() {
|
|
|
152
152
|
(0, import_createServer.createProdServer)(options)
|
|
153
153
|
];
|
|
154
154
|
case 2:
|
|
155
|
-
return app = _state.sent(),
|
|
155
|
+
return app = _state.sent(), [
|
|
156
156
|
4,
|
|
157
157
|
new Promise(function(res) {
|
|
158
158
|
return setTimeout(res, 1);
|
|
159
159
|
})
|
|
160
160
|
];
|
|
161
161
|
case 3:
|
|
162
|
-
return _state.sent(), server
|
|
162
|
+
return _state.sent(), server = (0, import_node_server.serve)({
|
|
163
|
+
fetch: app.fetch,
|
|
164
|
+
port: options.port,
|
|
165
|
+
hostname: options.host
|
|
166
|
+
}), console.info("Listening on http://".concat(options.host, ":").concat(options.port)), [
|
|
163
167
|
4,
|
|
164
168
|
new Promise(function(res) {
|
|
165
169
|
server.on("close", function() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/exports/Users/n8/vxrn/packages/vxrn/src/exports/serve.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA,
|
|
5
|
-
"names": ["serve", "optionsIn", "options", "app", "server", "getOptionsFilled", "mode", "createProdServer", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA,yBAAmC,8BAGnC,sBAAiC,2BACjC,0BAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE1B,IAAMA,QAAAA,WAAAA;aAAQ,oBAAA,SAAOC,WAAAA;QACpBC,SACAC,KAGAC;;;;AAJU,iBAAA;;gBAAMC,0CAAiBJ,WAAW;cAAEK,MAAM;YAAO,CAAA;;;AAA3DJ,2BAAU,OAAA,KAAA,GACJ;;gBAAMK,sCAAiBL,OAAAA;;;AAA7BC,uBAAM,OAAA,KAAA,GAEZ;;YAAM,IAAIK,QAAQ,SAACC,KAAAA;qBAAQC,WAAWD,KAAK,CAAA;;;;AAA3C,wBAAA,KAAA,GACML,aAASO,mBAAAA,OAAU;YACvBC,OAAOT,IAAIS;YACXC,MAAMX,QAAQW;YACdC,UAAUZ,QAAQa;UACpB,CAAA,GAEAC,QAAQC,KAAM,uBAAsCf,OAAhBA,QAAQa,MAAK,GAAA,EAAgB,OAAbb,QAAQW,IAAI,CAAA,GAChE;;YAAM,IAAIL,QAAc,SAACC,KAAAA;AACvBL,qBAAOc,GAAG,SAAS,WAAA;AACjBT,oBAAAA;cACF,CAAA;YACF,CAAA;;;AAJA,wBAAA,KAAA;;;;;EAKF,CAAA;kBAjB4BR,WAAAA;;;;",
|
|
5
|
+
"names": ["serve", "optionsIn", "options", "app", "server", "getOptionsFilled", "mode", "createProdServer", "Promise", "res", "setTimeout", "honoServe", "fetch", "port", "hostname", "host", "console", "info", "on"]
|
|
6
6
|
}
|
|
@@ -1,30 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Hono } from "hono";
|
|
2
|
+
import { compress } from "hono/compress";
|
|
3
|
+
import { serveStatic } from "@hono/node-server/serve-static";
|
|
3
4
|
const createProdServer = async (options) => {
|
|
4
|
-
const app =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
await new Promise((response) => {
|
|
10
|
-
sirvStaticMiddleware(req, res, () => {
|
|
11
|
-
response();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
5
|
+
const app = new Hono();
|
|
6
|
+
return app.use(compress()), app.use(
|
|
7
|
+
"*",
|
|
8
|
+
serveStatic({
|
|
9
|
+
root: "./dist/client"
|
|
14
10
|
})
|
|
15
|
-
);
|
|
16
|
-
const sirvMiddleware = sirv("dist/client", {
|
|
17
|
-
gzip: !0
|
|
18
|
-
});
|
|
19
|
-
return app.use(
|
|
20
|
-
defineEventHandler(async ({ node: { req, res } }) => {
|
|
21
|
-
await new Promise((response) => {
|
|
22
|
-
sirvMiddleware(req, res, () => {
|
|
23
|
-
response();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
})
|
|
27
|
-
), app;
|
|
11
|
+
), options.serve && options.serve(options, app), app;
|
|
28
12
|
};
|
|
29
13
|
export {
|
|
30
14
|
createProdServer
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/exports/createServer.ts"],
|
|
4
|
-
"mappings": "AAAA,SAAS,
|
|
4
|
+
"mappings": "AAAA,SAAS,YAAY;AACrB,SAAS,gBAAgB;AAEzB,SAAS,mBAAmB;AAIrB,MAAM,mBAAmB,OAAO,YAAwB;AAC7D,QAAM,MAAM,IAAI,KAAK;AAErB,aAAI,IAAI,SAAS,CAAC,GAElB,IAAI;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV,MAAM;AAAA,IACR,CAAC;AAAA,EACH,GAUI,QAAQ,SACV,QAAQ,MAAM,SAAS,GAAG,GAGrB;AACT;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,36 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Hono } from "hono";
|
|
2
|
+
import { compress } from "hono/compress";
|
|
3
|
+
import { serveStatic } from "@hono/node-server/serve-static";
|
|
3
4
|
const createProdServer = async options => {
|
|
4
|
-
const app =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
options.serve && options.serve(options, app), app.use(defineEventHandler(async ({
|
|
9
|
-
node: {
|
|
10
|
-
req,
|
|
11
|
-
res
|
|
12
|
-
}
|
|
13
|
-
}) => {
|
|
14
|
-
await new Promise(response => {
|
|
15
|
-
sirvStaticMiddleware(req, res, () => {
|
|
16
|
-
response();
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
}));
|
|
20
|
-
const sirvMiddleware = sirv("dist/client", {
|
|
21
|
-
gzip: !0
|
|
22
|
-
});
|
|
23
|
-
return app.use(defineEventHandler(async ({
|
|
24
|
-
node: {
|
|
25
|
-
req,
|
|
26
|
-
res
|
|
27
|
-
}
|
|
28
|
-
}) => {
|
|
29
|
-
await new Promise(response => {
|
|
30
|
-
sirvMiddleware(req, res, () => {
|
|
31
|
-
response();
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
})), app;
|
|
5
|
+
const app = new Hono();
|
|
6
|
+
return app.use(compress()), app.use("*", serveStatic({
|
|
7
|
+
root: "./dist/client"
|
|
8
|
+
})), options.serve && options.serve(options, app), app;
|
|
35
9
|
};
|
|
36
10
|
export { createProdServer };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Hono } from "hono";
|
|
2
|
+
import { compress } from "hono/compress";
|
|
3
|
+
import { serveStatic } from "@hono/node-server/serve-static";
|
|
3
4
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
4
5
|
try {
|
|
5
6
|
var info = gen[key](arg), value = info.value;
|
|
@@ -116,67 +117,45 @@ function _ts_generator(thisArg, body) {
|
|
|
116
117
|
}
|
|
117
118
|
}
|
|
118
119
|
var createProdServer = function() {
|
|
119
|
-
var _ref = _async_to_generator(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
new Promise(function(response) {
|
|
159
|
-
sirvMiddleware(req, res, function() {
|
|
160
|
-
response();
|
|
161
|
-
});
|
|
162
|
-
})
|
|
163
|
-
];
|
|
164
|
-
case 1:
|
|
165
|
-
return _state2.sent(), [
|
|
166
|
-
2
|
|
167
|
-
];
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
return function(_) {
|
|
172
|
-
return _ref2.apply(this, arguments);
|
|
173
|
-
};
|
|
174
|
-
}())), [
|
|
175
|
-
2,
|
|
176
|
-
app
|
|
177
|
-
];
|
|
178
|
-
});
|
|
179
|
-
});
|
|
120
|
+
var _ref = _async_to_generator(
|
|
121
|
+
function(options) {
|
|
122
|
+
var app;
|
|
123
|
+
return _ts_generator(this, function(_state) {
|
|
124
|
+
return app = new Hono(), app.use(compress()), app.use("*", serveStatic({
|
|
125
|
+
root: "./dist/client"
|
|
126
|
+
})), options.serve && options.serve(options, app), [
|
|
127
|
+
2,
|
|
128
|
+
app
|
|
129
|
+
];
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
// // testing cache
|
|
133
|
+
// const caches = {}
|
|
134
|
+
// function createCache(name: string) {
|
|
135
|
+
// if (caches[name]) return caches[name] as any
|
|
136
|
+
// const store = {}
|
|
137
|
+
// const cache = {
|
|
138
|
+
// async match(key: string) {
|
|
139
|
+
// console.log('matching', key)
|
|
140
|
+
// return store[key]
|
|
141
|
+
// },
|
|
142
|
+
// async put(key: string, val) {
|
|
143
|
+
// store[key] = val
|
|
144
|
+
// },
|
|
145
|
+
// async delete(key: string) {
|
|
146
|
+
// delete store[key]
|
|
147
|
+
// },
|
|
148
|
+
// }
|
|
149
|
+
// caches[name] = cache
|
|
150
|
+
// return cache
|
|
151
|
+
// }
|
|
152
|
+
// globalThis.caches = {
|
|
153
|
+
// ...createCache(''),
|
|
154
|
+
// async open(name: string) {
|
|
155
|
+
// return createCache(name)
|
|
156
|
+
// },
|
|
157
|
+
// }
|
|
158
|
+
);
|
|
180
159
|
return function(options) {
|
|
181
160
|
return _ref.apply(this, arguments);
|
|
182
161
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/exports/Users/n8/vxrn/packages/vxrn/src/exports/createServer.ts"],
|
|
4
|
-
"mappings": "AAAA,SAASA,
|
|
5
|
-
"names": ["
|
|
4
|
+
"mappings": "AAAA,SAASA,YAAY;AACrB,SAASC,gBAAgB;AAEzB,SAASC,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIrB,IAAMC,mBAAAA,WAAAA;aAAmB;IAAA,SAAOC,SAAAA;UAC/BC;;AAAAA,qBAAM,IAAIL,KAAAA,GAEhBK,IAAIC,IAAIL,SAAAA,CAAAA,GAERI,IAAIC,IACF,KACAJ,YAAY;UACVK,MAAM;QACR,CAAA,CAAA,GAWEH,QAAQI,SACVJ,QAAQI,MAAMJ,SAASC,GAAAA,GAGzB;;UAAOA;;;IACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAzBuCD,SAAAA;;;;",
|
|
5
|
+
"names": ["Hono", "compress", "serveStatic", "createProdServer", "options", "app", "use", "root", "serve"]
|
|
6
6
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createServer } from "node:http";
|
|
1
|
+
import { serve as honoServe } from "@hono/node-server";
|
|
3
2
|
import { createProdServer } from "./createServer";
|
|
4
3
|
import { getOptionsFilled } from "../utils/getOptionsFilled";
|
|
5
4
|
const serve = async (optionsIn) => {
|
|
6
|
-
const options = await getOptionsFilled(optionsIn, { mode: "prod" }), app = await createProdServer(options)
|
|
7
|
-
await new Promise((res) => setTimeout(res, 1))
|
|
5
|
+
const options = await getOptionsFilled(optionsIn, { mode: "prod" }), app = await createProdServer(options);
|
|
6
|
+
await new Promise((res) => setTimeout(res, 1));
|
|
7
|
+
const server = honoServe({
|
|
8
|
+
fetch: app.fetch,
|
|
9
|
+
port: options.port,
|
|
10
|
+
hostname: options.host
|
|
11
|
+
});
|
|
12
|
+
console.info(`Listening on http://${options.host}:${options.port}`), await new Promise((res) => {
|
|
8
13
|
server.on("close", () => {
|
|
9
14
|
res();
|
|
10
15
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/exports/serve.ts"],
|
|
4
|
-
"mappings": "AAAA,SAAS,
|
|
4
|
+
"mappings": "AAAA,SAAS,SAAS,iBAAiB;AAGnC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAE1B,MAAM,QAAQ,OAAO,cAA0B;AACpD,QAAM,UAAU,MAAM,iBAAiB,WAAW,EAAE,MAAM,OAAO,CAAC,GAC5D,MAAM,MAAM,iBAAiB,OAAO;AAE1C,QAAM,IAAI,QAAQ,CAAC,QAAQ,WAAW,KAAK,CAAC,CAAC;AAC7C,QAAM,SAAS,UAAU;AAAA,IACvB,OAAO,IAAI;AAAA,IACX,MAAM,QAAQ;AAAA,IACd,UAAU,QAAQ;AAAA,EACpB,CAAC;AAED,UAAQ,KAAK,uBAAuB,QAAQ,IAAI,IAAI,QAAQ,IAAI,EAAE,GAClE,MAAM,IAAI,QAAc,CAAC,QAAQ;AAC/B,WAAO,GAAG,SAAS,MAAM;AACvB,UAAI;AAAA,IACN,CAAC;AAAA,EACH,CAAC;AACH;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createServer } from "node:http";
|
|
1
|
+
import { serve as honoServe } from "@hono/node-server";
|
|
3
2
|
import { createProdServer } from "./createServer.mjs";
|
|
4
3
|
import { getOptionsFilled } from "../utils/getOptionsFilled.mjs";
|
|
5
4
|
const serve = async optionsIn => {
|
|
6
5
|
const options = await getOptionsFilled(optionsIn, {
|
|
7
6
|
mode: "prod"
|
|
8
7
|
}),
|
|
9
|
-
app = await createProdServer(options)
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
app = await createProdServer(options);
|
|
9
|
+
await new Promise(res => setTimeout(res, 1));
|
|
10
|
+
const server = honoServe({
|
|
11
|
+
fetch: app.fetch,
|
|
12
|
+
port: options.port,
|
|
13
|
+
hostname: options.host
|
|
14
|
+
});
|
|
15
|
+
console.info(`Listening on http://${options.host}:${options.port}`), await new Promise(res => {
|
|
12
16
|
server.on("close", () => {
|
|
13
17
|
res();
|
|
14
18
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createServer } from "node:http";
|
|
1
|
+
import { serve as honoServe } from "@hono/node-server";
|
|
3
2
|
import { createProdServer } from "./createServer";
|
|
4
3
|
import { getOptionsFilled } from "../utils/getOptionsFilled";
|
|
5
4
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -135,14 +134,18 @@ var serve = function() {
|
|
|
135
134
|
createProdServer(options)
|
|
136
135
|
];
|
|
137
136
|
case 2:
|
|
138
|
-
return app = _state.sent(),
|
|
137
|
+
return app = _state.sent(), [
|
|
139
138
|
4,
|
|
140
139
|
new Promise(function(res) {
|
|
141
140
|
return setTimeout(res, 1);
|
|
142
141
|
})
|
|
143
142
|
];
|
|
144
143
|
case 3:
|
|
145
|
-
return _state.sent(), server
|
|
144
|
+
return _state.sent(), server = honoServe({
|
|
145
|
+
fetch: app.fetch,
|
|
146
|
+
port: options.port,
|
|
147
|
+
hostname: options.host
|
|
148
|
+
}), console.info("Listening on http://".concat(options.host, ":").concat(options.port)), [
|
|
146
149
|
4,
|
|
147
150
|
new Promise(function(res) {
|
|
148
151
|
server.on("close", function() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/exports/Users/n8/vxrn/packages/vxrn/src/exports/serve.ts"],
|
|
4
|
-
"mappings": "AAAA,SAASA,
|
|
5
|
-
"names": ["
|
|
4
|
+
"mappings": "AAAA,SAASA,SAASC,iBAAiB;AAGnC,SAASC,wBAAwB;AACjC,SAASC,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE1B,IAAMH,QAAAA,WAAAA;aAAQ,oBAAA,SAAOI,WAAAA;QACpBC,SACAC,KAGAC;;;;AAJU,iBAAA;;YAAMJ,iBAAiBC,WAAW;cAAEI,MAAM;YAAO,CAAA;;;AAA3DH,2BAAU,OAAA,KAAA,GACJ;;YAAMH,iBAAiBG,OAAAA;;;AAA7BC,uBAAM,OAAA,KAAA,GAEZ;;YAAM,IAAIG,QAAQ,SAACC,KAAAA;qBAAQC,WAAWD,KAAK,CAAA;;;;AAA3C,wBAAA,KAAA,GACMH,SAASN,UAAU;YACvBW,OAAON,IAAIM;YACXC,MAAMR,QAAQQ;YACdC,UAAUT,QAAQU;UACpB,CAAA,GAEAC,QAAQC,KAAM,uBAAsCZ,OAAhBA,QAAQU,MAAK,GAAA,EAAgB,OAAbV,QAAQQ,IAAI,CAAA,GAChE;;YAAM,IAAIJ,QAAc,SAACC,KAAAA;AACvBH,qBAAOW,GAAG,SAAS,WAAA;AACjBR,oBAAAA;cACF,CAAA;YACF,CAAA;;;AAJA,wBAAA,KAAA;;;;;EAKF,CAAA;kBAjB4BN,WAAAA;;;;",
|
|
5
|
+
"names": ["serve", "honoServe", "createProdServer", "getOptionsFilled", "optionsIn", "options", "app", "server", "mode", "Promise", "res", "setTimeout", "fetch", "port", "hostname", "host", "console", "info", "on"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxrn",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.65",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -32,14 +32,15 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/code-frame": "^7.21.4",
|
|
35
|
+
"@hono/node-server": "^1.11.1",
|
|
35
36
|
"@vitejs/plugin-react": "^4.2.1",
|
|
36
37
|
"@vitejs/plugin-react-swc": "^3.6.0",
|
|
37
|
-
"@vxrn/react-native-prebuilt": "0.1.
|
|
38
|
-
"@vxrn/safe-area": "0.1.
|
|
39
|
-
"@vxrn/vite-flow": "0.1.
|
|
40
|
-
"@vxrn/vite-native-client": "0.1.
|
|
41
|
-
"@vxrn/vite-native-hmr": "0.1.
|
|
42
|
-
"@vxrn/vite-native-swc": "0.1.
|
|
38
|
+
"@vxrn/react-native-prebuilt": "0.1.65",
|
|
39
|
+
"@vxrn/safe-area": "0.1.65",
|
|
40
|
+
"@vxrn/vite-flow": "0.1.65",
|
|
41
|
+
"@vxrn/vite-native-client": "0.1.65",
|
|
42
|
+
"@vxrn/vite-native-hmr": "0.1.65",
|
|
43
|
+
"@vxrn/vite-native-swc": "0.1.65",
|
|
43
44
|
"citty": "^0.1.6",
|
|
44
45
|
"crossws": "^0.2.4",
|
|
45
46
|
"es-module-lexer": "^1.3.0",
|
|
@@ -51,7 +52,9 @@
|
|
|
51
52
|
"get-port-please": "^3.1.2",
|
|
52
53
|
"glob": "^10.3.12",
|
|
53
54
|
"h3": "^1.11.1",
|
|
55
|
+
"h3-compression": "^0.3.2",
|
|
54
56
|
"h3-proxy": "^1.13.0",
|
|
57
|
+
"hono": "^4.3.10",
|
|
55
58
|
"import-meta-resolve": "^4.0.0",
|
|
56
59
|
"jiti": "^1.21.0",
|
|
57
60
|
"metro-inspector-proxy": "^0.71.0",
|
|
@@ -66,12 +69,12 @@
|
|
|
66
69
|
"source-map": "^0.7.3",
|
|
67
70
|
"url": "^0.11.0",
|
|
68
71
|
"vite": "6.0.0-alpha.11",
|
|
69
|
-
"vxs": "0.1.
|
|
72
|
+
"vxs": "0.1.65",
|
|
70
73
|
"ws": "^8.7.0"
|
|
71
74
|
},
|
|
72
75
|
"devDependencies": {
|
|
73
76
|
"@biomejs/biome": "^1.6.3",
|
|
74
|
-
"@tamagui/build": "^1.
|
|
77
|
+
"@tamagui/build": "^1.99.1",
|
|
75
78
|
"@types/find-node-modules": "^2.1.2",
|
|
76
79
|
"@types/ws": "^8.5.10",
|
|
77
80
|
"rollup": "^3.29.4"
|
|
@@ -1,41 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Hono } from 'hono'
|
|
2
|
+
import { compress } from 'hono/compress'
|
|
3
|
+
// import { cache } from 'hono/cache'
|
|
4
|
+
import { serveStatic } from '@hono/node-server/serve-static'
|
|
5
|
+
|
|
3
6
|
import type { VXRNConfig } from '../types'
|
|
4
7
|
|
|
5
8
|
export const createProdServer = async (options: VXRNConfig) => {
|
|
6
|
-
const app =
|
|
7
|
-
|
|
8
|
-
const sirvStaticMiddleware = sirv('dist/static', {
|
|
9
|
-
gzip: true,
|
|
10
|
-
})
|
|
9
|
+
const app = new Hono()
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
options.serve(options, app)
|
|
14
|
-
}
|
|
11
|
+
app.use(compress())
|
|
15
12
|
|
|
16
13
|
app.use(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
response()
|
|
21
|
-
})
|
|
22
|
-
})
|
|
14
|
+
'*',
|
|
15
|
+
serveStatic({
|
|
16
|
+
root: './dist/client',
|
|
23
17
|
})
|
|
24
18
|
)
|
|
25
19
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
// app.get(
|
|
21
|
+
// '*',
|
|
22
|
+
// cache({
|
|
23
|
+
// cacheName: 'my-app',
|
|
24
|
+
// cacheControl: 'max-age=3600',
|
|
25
|
+
// })
|
|
26
|
+
// )
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
sirvMiddleware(req, res, () => {
|
|
34
|
-
response()
|
|
35
|
-
})
|
|
36
|
-
})
|
|
37
|
-
})
|
|
38
|
-
)
|
|
28
|
+
if (options.serve) {
|
|
29
|
+
options.serve(options, app)
|
|
30
|
+
}
|
|
39
31
|
|
|
40
32
|
return app
|
|
41
33
|
}
|
|
34
|
+
|
|
35
|
+
// // testing cache
|
|
36
|
+
// const caches = {}
|
|
37
|
+
// function createCache(name: string) {
|
|
38
|
+
// if (caches[name]) return caches[name] as any
|
|
39
|
+
// const store = {}
|
|
40
|
+
// const cache = {
|
|
41
|
+
// async match(key: string) {
|
|
42
|
+
// console.log('matching', key)
|
|
43
|
+
// return store[key]
|
|
44
|
+
// },
|
|
45
|
+
// async put(key: string, val) {
|
|
46
|
+
// store[key] = val
|
|
47
|
+
// },
|
|
48
|
+
// async delete(key: string) {
|
|
49
|
+
// delete store[key]
|
|
50
|
+
// },
|
|
51
|
+
// }
|
|
52
|
+
// caches[name] = cache
|
|
53
|
+
// return cache
|
|
54
|
+
// }
|
|
55
|
+
// globalThis.caches = {
|
|
56
|
+
// ...createCache(''),
|
|
57
|
+
// async open(name: string) {
|
|
58
|
+
// return createCache(name)
|
|
59
|
+
// },
|
|
60
|
+
// }
|
package/src/exports/serve.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { serve as honoServe } from '@hono/node-server'
|
|
2
|
+
|
|
3
3
|
import type { VXRNConfig } from '../types'
|
|
4
4
|
import { createProdServer } from './createServer'
|
|
5
5
|
import { getOptionsFilled } from '../utils/getOptionsFilled'
|
|
@@ -7,10 +7,14 @@ import { getOptionsFilled } from '../utils/getOptionsFilled'
|
|
|
7
7
|
export const serve = async (optionsIn: VXRNConfig) => {
|
|
8
8
|
const options = await getOptionsFilled(optionsIn, { mode: 'prod' })
|
|
9
9
|
const app = await createProdServer(options)
|
|
10
|
-
const server = createServer(toNodeListener(app))
|
|
11
10
|
// strange prevents a cant listen on port issue
|
|
12
11
|
await new Promise((res) => setTimeout(res, 1))
|
|
13
|
-
server
|
|
12
|
+
const server = honoServe({
|
|
13
|
+
fetch: app.fetch,
|
|
14
|
+
port: options.port,
|
|
15
|
+
hostname: options.host,
|
|
16
|
+
})
|
|
17
|
+
// server.listen(options.port, options.host)
|
|
14
18
|
console.info(`Listening on http://${options.host}:${options.port}`)
|
|
15
19
|
await new Promise<void>((res) => {
|
|
16
20
|
server.on('close', () => {
|
package/src/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options as FlowOptions } from '@vxrn/vite-flow'
|
|
2
|
-
import type {
|
|
2
|
+
import type { Hono } from 'hono'
|
|
3
3
|
import type { OutputAsset, OutputChunk } from 'rollup'
|
|
4
4
|
import type { InlineConfig, UserConfig } from 'vite'
|
|
5
5
|
|
|
@@ -41,7 +41,7 @@ export type VXRNConfig = {
|
|
|
41
41
|
|
|
42
42
|
afterBuild?: (props: AfterBuildProps) => void | Promise<void>
|
|
43
43
|
|
|
44
|
-
serve?: (options: VXRNConfig, app:
|
|
44
|
+
serve?: (options: VXRNConfig, app: Hono) => void
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export type HMRListener = (update: { file: string; contents: string }) => void
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
1
2
|
import type { VXRNConfig } from '../types';
|
|
2
|
-
export declare const createProdServer: (options: VXRNConfig) => Promise<import("
|
|
3
|
+
export declare const createProdServer: (options: VXRNConfig) => Promise<Hono<import("hono").Env, import("hono/types").BlankSchema, "/">>;
|
|
3
4
|
//# sourceMappingURL=createServer.d.ts.map
|
package/types/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options as FlowOptions } from '@vxrn/vite-flow';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Hono } from 'hono';
|
|
3
3
|
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
4
4
|
import type { InlineConfig, UserConfig } from 'vite';
|
|
5
5
|
export type AfterBuildProps = {
|
|
@@ -36,7 +36,7 @@ export type VXRNConfig = {
|
|
|
36
36
|
nativeConfig?: InlineConfig;
|
|
37
37
|
flow?: FlowOptions;
|
|
38
38
|
afterBuild?: (props: AfterBuildProps) => void | Promise<void>;
|
|
39
|
-
serve?: (options: VXRNConfig, app:
|
|
39
|
+
serve?: (options: VXRNConfig, app: Hono) => void;
|
|
40
40
|
};
|
|
41
41
|
export type HMRListener = (update: {
|
|
42
42
|
file: string;
|
|
@@ -20,7 +20,7 @@ export declare function getOptionsFilled(options: VXRNConfig, internal?: {
|
|
|
20
20
|
nativeConfig?: import("vite").InlineConfig | undefined;
|
|
21
21
|
flow?: import("@vxrn/vite-flow").Options | undefined;
|
|
22
22
|
afterBuild?: ((props: import("..").AfterBuildProps) => void | Promise<void>) | undefined;
|
|
23
|
-
serve?: ((options: VXRNConfig, app: import("
|
|
23
|
+
serve?: ((options: VXRNConfig, app: import("hono").Hono<import("hono").Env, import("hono/types").BlankSchema, "/">) => void) | undefined;
|
|
24
24
|
}>;
|
|
25
25
|
type State = {
|
|
26
26
|
applyPatches?: boolean;
|