@modern-js/prod-server 2.18.0 → 2.18.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @modern-js/prod-server
2
2
 
3
+ ## 2.18.1
4
+
5
+ ### Patch Changes
6
+
7
+ - @modern-js/server-core@2.18.1
8
+ - @modern-js/utils@2.18.1
9
+
3
10
  ## 2.18.0
4
11
 
5
12
  ### Patch Changes
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "render", {
8
8
  });
9
9
  const _path = /* @__PURE__ */ _interop_require_default(require("path"));
10
10
  const _utils = require("@modern-js/utils");
11
- const _constants = require("@modern-js/utils/constants");
12
11
  const _cache = /* @__PURE__ */ _interop_require_default(require("./cache"));
13
12
  const _measure = require("./measure");
14
13
  const _utils1 = require("./utils");
@@ -21,9 +20,9 @@ const render = async (ctx, renderOptions, runner) => {
21
20
  var _ctx_res;
22
21
  const { urlPath, bundle, distDir, template, entryName, staticGenerate, enableUnsafeCtx = false } = renderOptions;
23
22
  const bundleJS = _path.default.join(distDir, bundle);
24
- const loadableUri = _path.default.join(distDir, _constants.LOADABLE_STATS_FILE);
23
+ const loadableUri = _path.default.join(distDir, _utils.LOADABLE_STATS_FILE);
25
24
  const loadableStats = _utils.fs.existsSync(loadableUri) ? require(loadableUri) : "";
26
- const routesManifestUri = _path.default.join(distDir, _constants.ROUTE_MANIFEST_FILE);
25
+ const routesManifestUri = _path.default.join(distDir, _utils.ROUTE_MANIFEST_FILE);
27
26
  const routeManifest = _utils.fs.existsSync(routesManifestUri) ? require(routesManifestUri) : void 0;
28
27
  const context = {
29
28
  request: {
@@ -59,7 +58,7 @@ const render = async (ctx, renderOptions, runner) => {
59
58
  context.logger = (0, _measure.createLogger)(context, ctx.logger);
60
59
  context.metrics = (0, _measure.createMetrics)(context, ctx.metrics);
61
60
  runner.extendSSRContext(context);
62
- const serverRender = require(bundleJS)[_constants.SERVER_RENDER_FUNCTION_NAME];
61
+ const serverRender = require(bundleJS)[_utils.SERVER_RENDER_FUNCTION_NAME];
63
62
  const content = await (0, _cache.default)(serverRender, ctx)(context);
64
63
  const { url, status = 302 } = context.redirection;
65
64
  if (url) {
@@ -130,8 +130,7 @@ var __generator = function(thisArg, body) {
130
130
  }
131
131
  };
132
132
  import path from "path";
133
- import { fs, mime } from "@modern-js/utils";
134
- import { LOADABLE_STATS_FILE, ROUTE_MANIFEST_FILE, SERVER_RENDER_FUNCTION_NAME } from "@modern-js/utils/constants";
133
+ import { fs, mime, LOADABLE_STATS_FILE, ROUTE_MANIFEST_FILE, SERVER_RENDER_FUNCTION_NAME } from "@modern-js/utils";
135
134
  import cache from "./cache";
136
135
  import { createLogger, createMetrics } from "./measure";
137
136
  import { injectServerDataStream, injectServerData } from "./utils";
@@ -1,6 +1,5 @@
1
1
  import path from "path";
2
- import { fs, mime } from "@modern-js/utils";
3
- import { LOADABLE_STATS_FILE, ROUTE_MANIFEST_FILE, SERVER_RENDER_FUNCTION_NAME } from "@modern-js/utils/constants";
2
+ import { fs, mime, LOADABLE_STATS_FILE, ROUTE_MANIFEST_FILE, SERVER_RENDER_FUNCTION_NAME } from "@modern-js/utils";
4
3
  import cache from "./cache";
5
4
  import { createLogger, createMetrics } from "./measure";
6
5
  import { injectServerDataStream, injectServerData } from "./utils";
@@ -2,7 +2,7 @@
2
2
  /// <reference types="node" />
3
3
  /// <reference types="node" />
4
4
  /// <reference types="node/http" />
5
- /// <reference types=".dts-temp/lIyYynl_tqbyW3x0CHHmc/src/type" />
5
+ /// <reference types=".dts-temp/zqSQqAITBl0q4ajYXnO0Q/src/type" />
6
6
  import { IncomingMessage, ServerResponse } from 'http';
7
7
  import qs from 'querystring';
8
8
  import type { ModernServerContext as ModernServerContextInterface } from '@modern-js/types';
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node/http" />
3
- /// <reference types=".dts-temp/lIyYynl_tqbyW3x0CHHmc/src/type" />
3
+ /// <reference types=".dts-temp/zqSQqAITBl0q4ajYXnO0Q/src/type" />
4
4
  import { IncomingMessage } from 'http';
5
5
  import type { OutputNormalizedConfig, HtmlNormalizedConfig } from '@modern-js/server-core';
6
6
  export declare const debug: any;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.18.0",
18
+ "version": "2.18.1",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -60,8 +60,8 @@
60
60
  "merge-deep": "^3.0.3",
61
61
  "path-to-regexp": "^6.2.0",
62
62
  "serve-static": "^1.14.1",
63
- "@modern-js/utils": "2.18.0",
64
- "@modern-js/server-core": "2.18.0"
63
+ "@modern-js/utils": "2.18.1",
64
+ "@modern-js/server-core": "2.18.1"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@types/cookie": "^0.4.1",
@@ -77,10 +77,10 @@
77
77
  "node-mocks-http": "^1.11.0",
78
78
  "portfinder": "^1.0.28",
79
79
  "typescript": "^4",
80
- "@modern-js/types": "2.18.0",
81
- "@modern-js/server-core": "2.18.0",
82
- "@scripts/jest-config": "2.18.0",
83
- "@scripts/build": "2.18.0"
80
+ "@modern-js/types": "2.18.1",
81
+ "@modern-js/server-core": "2.18.1",
82
+ "@scripts/build": "2.18.1",
83
+ "@scripts/jest-config": "2.18.1"
84
84
  },
85
85
  "sideEffects": false,
86
86
  "publishConfig": {