@modern-js/server-core 3.1.0 → 3.1.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.
@@ -46,14 +46,14 @@ function _class_private_method_init(obj, privateSet) {
46
46
  var _applyMiddlewares = /*#__PURE__*/ new WeakSet();
47
47
  class ServerBase {
48
48
  async init() {
49
- const { serverConfig, config: cliConfig } = this.options;
49
+ const { serverConfig, config: cliConfig } = this.serverOptions;
50
50
  const mergedConfig = (0, index_js_namespaceObject.loadConfig)({
51
51
  cliConfig,
52
52
  serverConfig: serverConfig || {}
53
53
  });
54
54
  const { serverContext } = await server_namespaceObject.server.run({
55
55
  plugins: this.plugins,
56
- options: this.options,
56
+ options: this.serverOptions,
57
57
  config: mergedConfig,
58
58
  handleSetupResult: hooks_js_namespaceObject.handleSetupResult
59
59
  });
@@ -78,6 +78,9 @@ class ServerBase {
78
78
  get get() {
79
79
  return this.app.get.bind(this.app);
80
80
  }
81
+ get options() {
82
+ return this.app.options.bind(this.app);
83
+ }
81
84
  get post() {
82
85
  return this.app.post.bind(this.app);
83
86
  }
@@ -106,7 +109,7 @@ class ServerBase {
106
109
  _class_private_method_init(this, _applyMiddlewares);
107
110
  this.plugins = [];
108
111
  this.serverContext = null;
109
- this.options = options;
112
+ this.serverOptions = options;
110
113
  this.app = new external_hono_namespaceObject.Hono();
111
114
  this.app.use('*', external_context_js_namespaceObject.run);
112
115
  }
@@ -1,6 +1,5 @@
1
- import { loadServerEnv } from "./loadEnv.mjs";
2
- import { loadServerPlugins } from "./loadPlugin.mjs";
3
- import { loadServerCliConfig, loadServerRuntimeConfig } from "./loadConfig.mjs";
4
- import { loadCacheConfig } from "./loadCache.mjs";
5
- import { isResFinalized } from "./utils.mjs";
6
- export { isResFinalized, loadCacheConfig, loadServerCliConfig, loadServerEnv, loadServerPlugins, loadServerRuntimeConfig };
1
+ export { loadServerEnv } from "./loadEnv.mjs";
2
+ export { loadServerPlugins } from "./loadPlugin.mjs";
3
+ export { loadServerCliConfig, loadServerRuntimeConfig } from "./loadConfig.mjs";
4
+ export { loadCacheConfig } from "./loadCache.mjs";
5
+ export { isResFinalized } from "./utils.mjs";
@@ -1,5 +1,4 @@
1
- import { connectMid2HonoMid, connectMockMid2HonoMid, httpCallBack2HonoMid } from "./hono.mjs";
2
- import { createNodeServer, createWebRequest, sendResponse } from "./node.mjs";
3
- import { getHtmlTemplates, getServerManifest, injectNodeSeverPlugin, injectResourcePlugin, injectRscManifestPlugin, serverStaticPlugin } from "./plugins/index.mjs";
4
- import { loadCacheConfig, loadServerCliConfig, loadServerEnv, loadServerPlugins, loadServerRuntimeConfig } from "./helper/index.mjs";
5
- export { connectMid2HonoMid, connectMockMid2HonoMid, createNodeServer, createWebRequest, getHtmlTemplates, getServerManifest, httpCallBack2HonoMid, injectNodeSeverPlugin, injectResourcePlugin, injectRscManifestPlugin, loadCacheConfig, loadServerCliConfig, loadServerEnv, loadServerPlugins, loadServerRuntimeConfig, sendResponse, serverStaticPlugin };
1
+ export { connectMid2HonoMid, connectMockMid2HonoMid, httpCallBack2HonoMid } from "./hono.mjs";
2
+ export { createNodeServer, createWebRequest, sendResponse } from "./node.mjs";
3
+ export { getHtmlTemplates, getServerManifest, injectNodeSeverPlugin, injectResourcePlugin, injectRscManifestPlugin, serverStaticPlugin } from "./plugins/index.mjs";
4
+ export { loadCacheConfig, loadServerCliConfig, loadServerEnv, loadServerPlugins, loadServerRuntimeConfig } from "./helper/index.mjs";
@@ -25,4 +25,4 @@ var constants_ServerTimings = /*#__PURE__*/ function(ServerTimings) {
25
25
  const SERVER_TIMING = 'Server-Timing';
26
26
  const X_RENDER_CACHE = 'x-render-cache';
27
27
  const X_MODERNJS_RENDER = 'x-modernjs-render';
28
- export { AGGRED_DIR, REPLACE_REG, SERVER_TIMING, constants_ServerTimings as ServerTimings, X_MODERNJS_RENDER, X_RENDER_CACHE };
28
+ export { AGGRED_DIR, REPLACE_REG, SERVER_TIMING, X_MODERNJS_RENDER, X_RENDER_CACHE, constants_ServerTimings as ServerTimings };
@@ -1,3 +1,3 @@
1
1
  import { createStorage } from "./utils/storage.mjs";
2
- const { run, useHonoContext } = createStorage();
2
+ const { run: run, useHonoContext: useHonoContext } = createStorage();
3
3
  export { run, useHonoContext };
package/dist/esm/hono.mjs CHANGED
@@ -1,3 +1,2 @@
1
- import { deleteCookie, getCookie, setCookie } from "hono/cookie";
2
- import { languageDetector } from "hono/language";
3
- export { deleteCookie, getCookie, languageDetector, setCookie };
1
+ export { deleteCookie, getCookie, setCookie } from "hono/cookie";
2
+ export { languageDetector } from "hono/language";
@@ -1,13 +1,12 @@
1
- import { ErrorDigest, createErrorHtml, onError } from "./utils/index.mjs";
2
- import { getPublicDirConfig, getPublicDirPatterns, getPublicDirRoutePrefixes, normalizePublicDir, normalizePublicDirPath, resolvePublicDirPaths } from "./utils/publicDir.mjs";
3
- import { AGGRED_DIR } from "./constants.mjs";
4
- import { createServerBase } from "./serverBase.mjs";
5
- import { run, useHonoContext } from "./context.mjs";
6
- import { Hono } from "hono";
7
- import { getLoaderCtx } from "./helper.mjs";
8
1
  export * from "./plugins/index.mjs";
9
2
  export * from "./types/plugins/index.mjs";
10
3
  export * from "./types/render.mjs";
11
4
  export * from "./types/config/index.mjs";
12
5
  export * from "./types/requestHandler.mjs";
13
- export { AGGRED_DIR, ErrorDigest, Hono, createErrorHtml, createServerBase, getLoaderCtx, getPublicDirConfig, getPublicDirPatterns, getPublicDirRoutePrefixes, normalizePublicDir, normalizePublicDirPath, onError, resolvePublicDirPaths, run, useHonoContext };
6
+ export { ErrorDigest, createErrorHtml, onError } from "./utils/index.mjs";
7
+ export { getPublicDirConfig, getPublicDirPatterns, getPublicDirRoutePrefixes, normalizePublicDir, normalizePublicDirPath, resolvePublicDirPaths } from "./utils/publicDir.mjs";
8
+ export { AGGRED_DIR } from "./constants.mjs";
9
+ export { createServerBase } from "./serverBase.mjs";
10
+ export { run, useHonoContext } from "./context.mjs";
11
+ export { Hono } from "hono";
12
+ export { getLoaderCtx } from "./helper.mjs";
@@ -1,9 +1,8 @@
1
- import { getRenderHandler, injectRenderHandlerPlugin, renderPlugin } from "./render/index.mjs";
2
- import { faviconPlugin } from "./favicon.mjs";
3
- import { injectServerTiming, injectloggerPlugin } from "./monitors.mjs";
4
- import { processedByPlugin } from "./processedBy.mjs";
5
- import { logPlugin } from "./log.mjs";
6
- import { createDefaultPlugins } from "./default.mjs";
7
- import { compatPlugin, handleSetupResult } from "./compat/index.mjs";
8
- import { injectConfigMiddlewarePlugin } from "./middlewares.mjs";
9
- export { compatPlugin, createDefaultPlugins, faviconPlugin, getRenderHandler, handleSetupResult, injectConfigMiddlewarePlugin, injectRenderHandlerPlugin, injectServerTiming, injectloggerPlugin, logPlugin, processedByPlugin, renderPlugin };
1
+ export { getRenderHandler, injectRenderHandlerPlugin, renderPlugin } from "./render/index.mjs";
2
+ export { faviconPlugin } from "./favicon.mjs";
3
+ export { injectServerTiming, injectloggerPlugin } from "./monitors.mjs";
4
+ export { processedByPlugin } from "./processedBy.mjs";
5
+ export { logPlugin } from "./log.mjs";
6
+ export { createDefaultPlugins } from "./default.mjs";
7
+ export { compatPlugin, handleSetupResult } from "./compat/index.mjs";
8
+ export { injectConfigMiddlewarePlugin } from "./middlewares.mjs";
@@ -1,4 +1,3 @@
1
- import * as __rspack_external__modern_js_runtime_utils_router_2aa8d96f from "@modern-js/runtime-utils/router";
2
1
  import { cutNameByHyphen } from "@modern-js/utils/universal";
3
2
  import { TrieRouter } from "hono/router/trie-router";
4
3
  import { X_MODERNJS_RENDER } from "../../constants.mjs";
@@ -8,21 +7,13 @@ import { dataHandler } from "./dataHandler.mjs";
8
7
  import { renderRscHandler } from "./renderRscHandler.mjs";
9
8
  import { serverActionHandler } from "./serverActionHandler.mjs";
10
9
  import { ssrRender } from "./ssrRender.mjs";
11
- var __webpack_modules__ = {
10
+ import { __webpack_require__ } from "../../rslib-runtime.mjs";
11
+ import * as __rspack_external__modern_js_runtime_utils_router_2aa8d96f from "@modern-js/runtime-utils/router";
12
+ __webpack_require__.add({
12
13
  "@modern-js/runtime-utils/router" (module) {
13
14
  module.exports = __rspack_external__modern_js_runtime_utils_router_2aa8d96f;
14
15
  }
15
- };
16
- var __webpack_module_cache__ = {};
17
- function __webpack_require__(moduleId) {
18
- var cachedModule = __webpack_module_cache__[moduleId];
19
- if (void 0 !== cachedModule) return cachedModule.exports;
20
- var module = __webpack_module_cache__[moduleId] = {
21
- exports: {}
22
- };
23
- __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
24
- return module.exports;
25
- }
16
+ });
26
17
  const DYNAMIC_ROUTE_REG = /\/:./;
27
18
  function getRouter(routes) {
28
19
  const dynamicRoutes = [];
@@ -0,0 +1,18 @@
1
+ var __webpack_modules__ = {};
2
+ var __webpack_module_cache__ = {};
3
+ function __webpack_require__(moduleId) {
4
+ var cachedModule = __webpack_module_cache__[moduleId];
5
+ if (void 0 !== cachedModule) return cachedModule.exports;
6
+ var module = __webpack_module_cache__[moduleId] = {
7
+ exports: {}
8
+ };
9
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
10
+ return module.exports;
11
+ }
12
+ __webpack_require__.m = __webpack_modules__;
13
+ (()=>{
14
+ __webpack_require__.add = function(modules) {
15
+ Object.assign(__webpack_require__.m, modules);
16
+ };
17
+ })();
18
+ export { __webpack_require__ };
@@ -17,14 +17,14 @@ function _class_private_method_init(obj, privateSet) {
17
17
  var _applyMiddlewares = /*#__PURE__*/ new WeakSet();
18
18
  class ServerBase {
19
19
  async init() {
20
- const { serverConfig, config: cliConfig } = this.options;
20
+ const { serverConfig, config: cliConfig } = this.serverOptions;
21
21
  const mergedConfig = loadConfig({
22
22
  cliConfig,
23
23
  serverConfig: serverConfig || {}
24
24
  });
25
25
  const { serverContext } = await server_server.run({
26
26
  plugins: this.plugins,
27
- options: this.options,
27
+ options: this.serverOptions,
28
28
  config: mergedConfig,
29
29
  handleSetupResult: handleSetupResult
30
30
  });
@@ -49,6 +49,9 @@ class ServerBase {
49
49
  get get() {
50
50
  return this.app.get.bind(this.app);
51
51
  }
52
+ get options() {
53
+ return this.app.options.bind(this.app);
54
+ }
52
55
  get post() {
53
56
  return this.app.post.bind(this.app);
54
57
  }
@@ -77,7 +80,7 @@ class ServerBase {
77
80
  _class_private_method_init(this, _applyMiddlewares);
78
81
  this.plugins = [];
79
82
  this.serverContext = null;
80
- this.options = options;
83
+ this.serverOptions = options;
81
84
  this.app = new Hono();
82
85
  this.app.use('*', run);
83
86
  }
@@ -50,4 +50,4 @@ function onError(digest, error, monitors, req) {
50
50
  else if (req) console.error(`Server Error - ${digest}, error = ${error instanceof Error ? error.stack || error.message : error}, req.url = ${req.url}, req.headers = ${JSON.stringify(headerData)}`);
51
51
  else console.error(`Server Error - ${digest}, error = ${error instanceof Error ? error.stack || error.message : error} `);
52
52
  }
53
- export { error_ErrorDigest as ErrorDigest, createErrorHtml, onError };
53
+ export { createErrorHtml, error_ErrorDigest as ErrorDigest, onError };
@@ -1,7 +1,7 @@
1
- import { AsyncLocalStorage } from "async_hooks";
1
+ import * as __rspack_external_async_hooks from "async_hooks";
2
2
  const createStorage = ()=>{
3
3
  let storage;
4
- if (void 0 !== AsyncLocalStorage) storage = new AsyncLocalStorage();
4
+ if (void 0 !== __rspack_external_async_hooks.AsyncLocalStorage) storage = new __rspack_external_async_hooks.AsyncLocalStorage();
5
5
  const run = (context, cb)=>{
6
6
  if (!storage) throw new Error(`Unable to use async_hook, please confirm the node version >= 12.17
7
7
  `);
@@ -1,7 +1,6 @@
1
1
  import "node:module";
2
- import { loadServerEnv } from "./loadEnv.mjs";
3
- import { loadServerPlugins } from "./loadPlugin.mjs";
4
- import { loadServerCliConfig, loadServerRuntimeConfig } from "./loadConfig.mjs";
5
- import { loadCacheConfig } from "./loadCache.mjs";
6
- import { isResFinalized } from "./utils.mjs";
7
- export { isResFinalized, loadCacheConfig, loadServerCliConfig, loadServerEnv, loadServerPlugins, loadServerRuntimeConfig };
2
+ export { loadServerEnv } from "./loadEnv.mjs";
3
+ export { loadServerPlugins } from "./loadPlugin.mjs";
4
+ export { loadServerCliConfig, loadServerRuntimeConfig } from "./loadConfig.mjs";
5
+ export { loadCacheConfig } from "./loadCache.mjs";
6
+ export { isResFinalized } from "./utils.mjs";
@@ -1,6 +1,5 @@
1
1
  import "node:module";
2
- import { connectMid2HonoMid, connectMockMid2HonoMid, httpCallBack2HonoMid } from "./hono.mjs";
3
- import { createNodeServer, createWebRequest, sendResponse } from "./node.mjs";
4
- import { getHtmlTemplates, getServerManifest, injectNodeSeverPlugin, injectResourcePlugin, injectRscManifestPlugin, serverStaticPlugin } from "./plugins/index.mjs";
5
- import { loadCacheConfig, loadServerCliConfig, loadServerEnv, loadServerPlugins, loadServerRuntimeConfig } from "./helper/index.mjs";
6
- export { connectMid2HonoMid, connectMockMid2HonoMid, createNodeServer, createWebRequest, getHtmlTemplates, getServerManifest, httpCallBack2HonoMid, injectNodeSeverPlugin, injectResourcePlugin, injectRscManifestPlugin, loadCacheConfig, loadServerCliConfig, loadServerEnv, loadServerPlugins, loadServerRuntimeConfig, sendResponse, serverStaticPlugin };
2
+ export { connectMid2HonoMid, connectMockMid2HonoMid, httpCallBack2HonoMid } from "./hono.mjs";
3
+ export { createNodeServer, createWebRequest, sendResponse } from "./node.mjs";
4
+ export { getHtmlTemplates, getServerManifest, injectNodeSeverPlugin, injectResourcePlugin, injectRscManifestPlugin, serverStaticPlugin } from "./plugins/index.mjs";
5
+ export { loadCacheConfig, loadServerCliConfig, loadServerEnv, loadServerPlugins, loadServerRuntimeConfig } from "./helper/index.mjs";
@@ -26,4 +26,4 @@ var constants_ServerTimings = /*#__PURE__*/ function(ServerTimings) {
26
26
  const SERVER_TIMING = 'Server-Timing';
27
27
  const X_RENDER_CACHE = 'x-render-cache';
28
28
  const X_MODERNJS_RENDER = 'x-modernjs-render';
29
- export { AGGRED_DIR, REPLACE_REG, SERVER_TIMING, constants_ServerTimings as ServerTimings, X_MODERNJS_RENDER, X_RENDER_CACHE };
29
+ export { AGGRED_DIR, REPLACE_REG, SERVER_TIMING, X_MODERNJS_RENDER, X_RENDER_CACHE, constants_ServerTimings as ServerTimings };
@@ -1,4 +1,4 @@
1
1
  import "node:module";
2
2
  import { createStorage } from "./utils/storage.mjs";
3
- const { run, useHonoContext } = createStorage();
3
+ const { run: run, useHonoContext: useHonoContext } = createStorage();
4
4
  export { run, useHonoContext };
@@ -1,4 +1,3 @@
1
1
  import "node:module";
2
- import { deleteCookie, getCookie, setCookie } from "hono/cookie";
3
- import { languageDetector } from "hono/language";
4
- export { deleteCookie, getCookie, languageDetector, setCookie };
2
+ export { deleteCookie, getCookie, setCookie } from "hono/cookie";
3
+ export { languageDetector } from "hono/language";
@@ -1,14 +1,13 @@
1
1
  import "node:module";
2
- import { ErrorDigest, createErrorHtml, onError } from "./utils/index.mjs";
3
- import { getPublicDirConfig, getPublicDirPatterns, getPublicDirRoutePrefixes, normalizePublicDir, normalizePublicDirPath, resolvePublicDirPaths } from "./utils/publicDir.mjs";
4
- import { AGGRED_DIR } from "./constants.mjs";
5
- import { createServerBase } from "./serverBase.mjs";
6
- import { run, useHonoContext } from "./context.mjs";
7
- import { Hono } from "hono";
8
- import { getLoaderCtx } from "./helper.mjs";
9
2
  export * from "./plugins/index.mjs";
10
3
  export * from "./types/plugins/index.mjs";
11
4
  export * from "./types/render.mjs";
12
5
  export * from "./types/config/index.mjs";
13
6
  export * from "./types/requestHandler.mjs";
14
- export { AGGRED_DIR, ErrorDigest, Hono, createErrorHtml, createServerBase, getLoaderCtx, getPublicDirConfig, getPublicDirPatterns, getPublicDirRoutePrefixes, normalizePublicDir, normalizePublicDirPath, onError, resolvePublicDirPaths, run, useHonoContext };
7
+ export { ErrorDigest, createErrorHtml, onError } from "./utils/index.mjs";
8
+ export { getPublicDirConfig, getPublicDirPatterns, getPublicDirRoutePrefixes, normalizePublicDir, normalizePublicDirPath, resolvePublicDirPaths } from "./utils/publicDir.mjs";
9
+ export { AGGRED_DIR } from "./constants.mjs";
10
+ export { createServerBase } from "./serverBase.mjs";
11
+ export { run, useHonoContext } from "./context.mjs";
12
+ export { Hono } from "hono";
13
+ export { getLoaderCtx } from "./helper.mjs";
@@ -1,10 +1,9 @@
1
1
  import "node:module";
2
- import { getRenderHandler, injectRenderHandlerPlugin, renderPlugin } from "./render/index.mjs";
3
- import { faviconPlugin } from "./favicon.mjs";
4
- import { injectServerTiming, injectloggerPlugin } from "./monitors.mjs";
5
- import { processedByPlugin } from "./processedBy.mjs";
6
- import { logPlugin } from "./log.mjs";
7
- import { createDefaultPlugins } from "./default.mjs";
8
- import { compatPlugin, handleSetupResult } from "./compat/index.mjs";
9
- import { injectConfigMiddlewarePlugin } from "./middlewares.mjs";
10
- export { compatPlugin, createDefaultPlugins, faviconPlugin, getRenderHandler, handleSetupResult, injectConfigMiddlewarePlugin, injectRenderHandlerPlugin, injectServerTiming, injectloggerPlugin, logPlugin, processedByPlugin, renderPlugin };
2
+ export { getRenderHandler, injectRenderHandlerPlugin, renderPlugin } from "./render/index.mjs";
3
+ export { faviconPlugin } from "./favicon.mjs";
4
+ export { injectServerTiming, injectloggerPlugin } from "./monitors.mjs";
5
+ export { processedByPlugin } from "./processedBy.mjs";
6
+ export { logPlugin } from "./log.mjs";
7
+ export { createDefaultPlugins } from "./default.mjs";
8
+ export { compatPlugin, handleSetupResult } from "./compat/index.mjs";
9
+ export { injectConfigMiddlewarePlugin } from "./middlewares.mjs";
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- import * as __rspack_external__modern_js_runtime_utils_router_2aa8d96f from "@modern-js/runtime-utils/router";
3
2
  import { cutNameByHyphen } from "@modern-js/utils/universal";
4
3
  import { TrieRouter } from "hono/router/trie-router";
5
4
  import { X_MODERNJS_RENDER } from "../../constants.mjs";
@@ -9,21 +8,13 @@ import { dataHandler } from "./dataHandler.mjs";
9
8
  import { renderRscHandler } from "./renderRscHandler.mjs";
10
9
  import { serverActionHandler } from "./serverActionHandler.mjs";
11
10
  import { ssrRender } from "./ssrRender.mjs";
12
- var __webpack_modules__ = {
11
+ import { __webpack_require__ } from "../../rslib-runtime.mjs";
12
+ import * as __rspack_external__modern_js_runtime_utils_router_2aa8d96f from "@modern-js/runtime-utils/router";
13
+ __webpack_require__.add({
13
14
  "@modern-js/runtime-utils/router" (module) {
14
15
  module.exports = __rspack_external__modern_js_runtime_utils_router_2aa8d96f;
15
16
  }
16
- };
17
- var __webpack_module_cache__ = {};
18
- function __webpack_require__(moduleId) {
19
- var cachedModule = __webpack_module_cache__[moduleId];
20
- if (void 0 !== cachedModule) return cachedModule.exports;
21
- var module = __webpack_module_cache__[moduleId] = {
22
- exports: {}
23
- };
24
- __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
25
- return module.exports;
26
- }
17
+ });
27
18
  const DYNAMIC_ROUTE_REG = /\/:./;
28
19
  function getRouter(routes) {
29
20
  const dynamicRoutes = [];
@@ -0,0 +1,19 @@
1
+ import "node:module";
2
+ var __webpack_modules__ = {};
3
+ var __webpack_module_cache__ = {};
4
+ function __webpack_require__(moduleId) {
5
+ var cachedModule = __webpack_module_cache__[moduleId];
6
+ if (void 0 !== cachedModule) return cachedModule.exports;
7
+ var module = __webpack_module_cache__[moduleId] = {
8
+ exports: {}
9
+ };
10
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
11
+ return module.exports;
12
+ }
13
+ __webpack_require__.m = __webpack_modules__;
14
+ (()=>{
15
+ __webpack_require__.add = function(modules) {
16
+ Object.assign(__webpack_require__.m, modules);
17
+ };
18
+ })();
19
+ export { __webpack_require__ };
@@ -18,14 +18,14 @@ function _class_private_method_init(obj, privateSet) {
18
18
  var _applyMiddlewares = /*#__PURE__*/ new WeakSet();
19
19
  class ServerBase {
20
20
  async init() {
21
- const { serverConfig, config: cliConfig } = this.options;
21
+ const { serverConfig, config: cliConfig } = this.serverOptions;
22
22
  const mergedConfig = loadConfig({
23
23
  cliConfig,
24
24
  serverConfig: serverConfig || {}
25
25
  });
26
26
  const { serverContext } = await server_server.run({
27
27
  plugins: this.plugins,
28
- options: this.options,
28
+ options: this.serverOptions,
29
29
  config: mergedConfig,
30
30
  handleSetupResult: handleSetupResult
31
31
  });
@@ -50,6 +50,9 @@ class ServerBase {
50
50
  get get() {
51
51
  return this.app.get.bind(this.app);
52
52
  }
53
+ get options() {
54
+ return this.app.options.bind(this.app);
55
+ }
53
56
  get post() {
54
57
  return this.app.post.bind(this.app);
55
58
  }
@@ -78,7 +81,7 @@ class ServerBase {
78
81
  _class_private_method_init(this, _applyMiddlewares);
79
82
  this.plugins = [];
80
83
  this.serverContext = null;
81
- this.options = options;
84
+ this.serverOptions = options;
82
85
  this.app = new Hono();
83
86
  this.app.use('*', run);
84
87
  }
@@ -51,4 +51,4 @@ function onError(digest, error, monitors, req) {
51
51
  else if (req) console.error(`Server Error - ${digest}, error = ${error instanceof Error ? error.stack || error.message : error}, req.url = ${req.url}, req.headers = ${JSON.stringify(headerData)}`);
52
52
  else console.error(`Server Error - ${digest}, error = ${error instanceof Error ? error.stack || error.message : error} `);
53
53
  }
54
- export { error_ErrorDigest as ErrorDigest, createErrorHtml, onError };
54
+ export { createErrorHtml, error_ErrorDigest as ErrorDigest, onError };
@@ -1,8 +1,8 @@
1
1
  import "node:module";
2
- import { AsyncLocalStorage } from "async_hooks";
2
+ import * as __rspack_external_async_hooks from "async_hooks";
3
3
  const createStorage = ()=>{
4
4
  let storage;
5
- if (void 0 !== AsyncLocalStorage) storage = new AsyncLocalStorage();
5
+ if (void 0 !== __rspack_external_async_hooks.AsyncLocalStorage) storage = new __rspack_external_async_hooks.AsyncLocalStorage();
6
6
  const run = (context, cb)=>{
7
7
  if (!storage) throw new Error(`Unable to use async_hook, please confirm the node version >= 12.17
8
8
  `);
@@ -9,7 +9,7 @@ export interface ServerBaseOptions extends ServerCreateOptions {
9
9
  }
10
10
  export declare class ServerBase<E extends Env = any> {
11
11
  #private;
12
- options: ServerBaseOptions;
12
+ serverOptions: ServerBaseOptions;
13
13
  private app;
14
14
  private plugins;
15
15
  private serverContext;
@@ -25,6 +25,7 @@ export declare class ServerBase<E extends Env = any> {
25
25
  get all(): import("hono/types").HandlerInterface<E, "all", import("hono/types").BlankSchema, "/", "/">;
26
26
  get use(): import("hono/types").MiddlewareHandlerInterface<E, import("hono/types").BlankSchema, "/">;
27
27
  get get(): import("hono/types").HandlerInterface<E, "get", import("hono/types").BlankSchema, "/", "/">;
28
+ get options(): import("hono/types").HandlerInterface<E, "options", import("hono/types").BlankSchema, "/", "/">;
28
29
  get post(): import("hono/types").HandlerInterface<E, "post", import("hono/types").BlankSchema, "/", "/">;
29
30
  get put(): import("hono/types").HandlerInterface<E, "put", import("hono/types").BlankSchema, "/", "/">;
30
31
  get delete(): import("hono/types").HandlerInterface<E, "delete", import("hono/types").BlankSchema, "/", "/">;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.1.0",
18
+ "version": "3.1.2",
19
19
  "types": "./dist/types/index.d.ts",
20
20
  "main": "./dist/cjs/index.js",
21
21
  "exports": {
@@ -68,22 +68,22 @@
68
68
  "@web-std/file": "^3.0.3",
69
69
  "@web-std/stream": "^1.0.3",
70
70
  "cloneable-readable": "^3.0.0",
71
- "flatted": "^3.4.0",
71
+ "flatted": "^3.4.2",
72
72
  "hono": "^4.11.7",
73
73
  "ts-deepmerge": "7.0.3",
74
- "@modern-js/plugin": "3.1.0",
75
- "@modern-js/runtime-utils": "3.1.0",
76
- "@modern-js/utils": "3.1.0"
74
+ "@modern-js/plugin": "3.1.2",
75
+ "@modern-js/utils": "3.1.2",
76
+ "@modern-js/runtime-utils": "3.1.2"
77
77
  },
78
78
  "devDependencies": {
79
- "@rslib/core": "0.19.6",
79
+ "@rslib/core": "0.20.3",
80
80
  "@types/cloneable-readable": "^2.0.3",
81
81
  "@types/merge-deep": "^3.0.3",
82
82
  "@types/node": "^20",
83
83
  "http-proxy-middleware": "^2.0.9",
84
84
  "typescript": "^5",
85
+ "@modern-js/types": "3.1.2",
85
86
  "@modern-js/rslib": "2.68.10",
86
- "@modern-js/types": "3.1.0",
87
87
  "@scripts/rstest-config": "2.66.0"
88
88
  },
89
89
  "sideEffects": false,
File without changes