@modern-js/prod-server 2.55.0 → 2.56.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/dist/cjs/apply.js CHANGED
@@ -48,10 +48,15 @@ async function applyPlugins(serverBase, options, nodeServer) {
48
48
  return c.html((0, import_server_core.createErrorHtml)(500), 500);
49
49
  });
50
50
  const plugins = [
51
+ ...nodeServer ? [
52
+ (0, import_node.injectNodeSeverPlugin)({
53
+ nodeServer
54
+ })
55
+ ] : [],
56
+ (0, import_server_core.initMonitorsPlugin)(),
57
+ (0, import_server_core.injectloggerPluigin)(getLogger()),
58
+ (0, import_server_core.injectServerTiming)(options.metaName),
51
59
  ...options.plugins || [],
52
- (0, import_server_core.monitorPlugin)({
53
- logger: getLogger()
54
- }),
55
60
  (0, import_server_core.processedByPlugin)(),
56
61
  (0, import_server_core.logPlugin)(),
57
62
  (0, import_node.injectResourcePlugin)(),
@@ -62,11 +67,6 @@ async function applyPlugins(serverBase, options, nodeServer) {
62
67
  cacheConfig
63
68
  })
64
69
  ];
65
- if (nodeServer) {
66
- plugins.unshift((0, import_node.injectNodeSeverPlugin)({
67
- nodeServer
68
- }));
69
- }
70
70
  serverBase.addPlugins(plugins);
71
71
  }
72
72
  // Annotate the CommonJS export names for ESM import in node:
package/dist/esm/apply.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
2
  import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
3
3
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
4
- import { ErrorDigest, createErrorHtml, faviconPlugin, logPlugin, monitorPlugin, onError, processedByPlugin, renderPlugin } from "@modern-js/server-core";
4
+ import { ErrorDigest, createErrorHtml, faviconPlugin, logPlugin, initMonitorsPlugin, injectloggerPluigin, injectServerTiming, onError, processedByPlugin, renderPlugin } from "@modern-js/server-core";
5
5
  import { serverStaticPlugin, injectResourcePlugin, loadCacheConfig, injectNodeSeverPlugin } from "@modern-js/server-core/node";
6
6
  import { createLogger, isProd } from "@modern-js/utils";
7
7
  function getLogger() {
@@ -33,10 +33,15 @@ function _applyPlugins() {
33
33
  onError(ErrorDigest.EINTER, err, logger, c.req.raw);
34
34
  return c.html(createErrorHtml(500), 500);
35
35
  });
36
- plugins = _to_consumable_array(options.plugins || []).concat([
37
- monitorPlugin({
38
- logger: getLogger()
39
- }),
36
+ plugins = _to_consumable_array(nodeServer ? [
37
+ injectNodeSeverPlugin({
38
+ nodeServer
39
+ })
40
+ ] : []).concat([
41
+ initMonitorsPlugin(),
42
+ injectloggerPluigin(getLogger()),
43
+ injectServerTiming(options.metaName)
44
+ ], _to_consumable_array(options.plugins || []), [
40
45
  processedByPlugin(),
41
46
  logPlugin(),
42
47
  injectResourcePlugin(),
@@ -47,11 +52,6 @@ function _applyPlugins() {
47
52
  cacheConfig
48
53
  })
49
54
  ]);
50
- if (nodeServer) {
51
- plugins.unshift(injectNodeSeverPlugin({
52
- nodeServer
53
- }));
54
- }
55
55
  serverBase.addPlugins(plugins);
56
56
  return [
57
57
  2
@@ -1,4 +1,4 @@
1
- import { ErrorDigest, createErrorHtml, faviconPlugin, logPlugin, monitorPlugin, onError, processedByPlugin, renderPlugin } from "@modern-js/server-core";
1
+ import { ErrorDigest, createErrorHtml, faviconPlugin, logPlugin, initMonitorsPlugin, injectloggerPluigin, injectServerTiming, onError, processedByPlugin, renderPlugin } from "@modern-js/server-core";
2
2
  import { serverStaticPlugin, injectResourcePlugin, loadCacheConfig, injectNodeSeverPlugin } from "@modern-js/server-core/node";
3
3
  import { createLogger, isProd } from "@modern-js/utils";
4
4
  function getLogger() {
@@ -25,10 +25,15 @@ async function applyPlugins(serverBase, options, nodeServer) {
25
25
  return c.html(createErrorHtml(500), 500);
26
26
  });
27
27
  const plugins = [
28
+ ...nodeServer ? [
29
+ injectNodeSeverPlugin({
30
+ nodeServer
31
+ })
32
+ ] : [],
33
+ initMonitorsPlugin(),
34
+ injectloggerPluigin(getLogger()),
35
+ injectServerTiming(options.metaName),
28
36
  ...options.plugins || [],
29
- monitorPlugin({
30
- logger: getLogger()
31
- }),
32
37
  processedByPlugin(),
33
38
  logPlugin(),
34
39
  injectResourcePlugin(),
@@ -39,11 +44,6 @@ async function applyPlugins(serverBase, options, nodeServer) {
39
44
  cacheConfig
40
45
  })
41
46
  ];
42
- if (nodeServer) {
43
- plugins.unshift(injectNodeSeverPlugin({
44
- nodeServer
45
- }));
46
- }
47
47
  serverBase.addPlugins(plugins);
48
48
  }
49
49
  export {
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.55.0",
18
+ "version": "2.56.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -42,9 +42,9 @@
42
42
  "dependencies": {
43
43
  "source-map-support": "0.5.21",
44
44
  "@swc/helpers": "0.5.3",
45
- "@modern-js/server-core": "2.55.0",
46
- "@modern-js/runtime-utils": "2.55.0",
47
- "@modern-js/utils": "2.55.0"
45
+ "@modern-js/server-core": "2.56.0",
46
+ "@modern-js/runtime-utils": "2.56.0",
47
+ "@modern-js/utils": "2.56.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/merge-deep": "^3.0.0",
@@ -58,10 +58,10 @@
58
58
  "tsx": "^3.12.7",
59
59
  "@types/jest": "^29",
60
60
  "typescript": "~5.0.4",
61
- "@modern-js/eslint-config": "2.55.0",
62
- "@scripts/build": "2.55.0",
63
- "@modern-js/types": "2.55.0",
64
- "@scripts/jest-config": "2.55.0"
61
+ "@modern-js/types": "2.56.0",
62
+ "@modern-js/eslint-config": "2.56.0",
63
+ "@scripts/jest-config": "2.56.0",
64
+ "@scripts/build": "2.56.0"
65
65
  },
66
66
  "sideEffects": [],
67
67
  "engines": {