@modern-js/plugin-ssg 2.67.7 → 2.67.9

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.
@@ -24,9 +24,21 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  var import_node_assert = __toESM(require("node:assert"));
25
25
  var import_node_http = require("node:http");
26
26
  var import_prod_server = require("@modern-js/prod-server");
27
+ var import_utils = require("@modern-js/utils");
27
28
  var import_portfinder = __toESM(require("portfinder"));
28
29
  var import_util = require("../libs/util");
29
30
  var import_consts = require("./consts");
31
+ function getLogger() {
32
+ const logger = (0, import_utils.createLogger)({
33
+ level: "verbose"
34
+ });
35
+ return {
36
+ ...logger,
37
+ error: (...args) => {
38
+ console.error(...args);
39
+ }
40
+ };
41
+ }
30
42
  const MAX_CONCURRENT_REQUESTS = 10;
31
43
  process.on("message", async (chunk) => {
32
44
  if (chunk === import_consts.CLOSE_SIGN) {
@@ -48,7 +60,8 @@ process.on("message", async (chunk) => {
48
60
  serverConfigPath: "",
49
61
  routes,
50
62
  plugins: await (0, import_prod_server.loadServerPlugins)(plugins, appContext.appDirectory || distDirectory),
51
- staticGenerate: true
63
+ staticGenerate: true,
64
+ logger: getLogger()
52
65
  };
53
66
  (0, import_node_assert.default)(process.send, "process.send is not available");
54
67
  const sendProcessMessage = process.send.bind(process);
@@ -1,12 +1,30 @@
1
1
  import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
2
  import { _ as _instanceof } from "@swc/helpers/_/_instanceof";
3
+ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
4
+ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
5
+ import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
3
6
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
4
7
  import assert from "node:assert";
5
8
  import { request } from "node:http";
6
9
  import { createProdServer, loadServerPlugins } from "@modern-js/prod-server";
10
+ import { createLogger } from "@modern-js/utils";
7
11
  import portfinder from "portfinder";
8
12
  import { chunkArray } from "../libs/util";
9
13
  import { CLOSE_SIGN } from "./consts";
14
+ function getLogger() {
15
+ var logger = createLogger({
16
+ level: "verbose"
17
+ });
18
+ return _object_spread_props(_object_spread({}, logger), {
19
+ error: function() {
20
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
21
+ args[_key] = arguments[_key];
22
+ }
23
+ var _console;
24
+ (_console = console).error.apply(_console, _to_consumable_array(args));
25
+ }
26
+ });
27
+ }
10
28
  var MAX_CONCURRENT_REQUESTS = 10;
11
29
  process.on("message", function() {
12
30
  var _ref = _async_to_generator(function(chunk) {
@@ -50,7 +68,7 @@ process.on("message", function() {
50
68
  loadServerPlugins(plugins, appContext.appDirectory || distDirectory)
51
69
  ];
52
70
  case 3:
53
- serverOptions = (_tmp.plugins = _state.sent(), _tmp.staticGenerate = true, _tmp);
71
+ serverOptions = (_tmp.plugins = _state.sent(), _tmp.staticGenerate = true, _tmp.logger = getLogger(), _tmp);
54
72
  assert(process.send, "process.send is not available");
55
73
  sendProcessMessage = process.send.bind(process);
56
74
  return [
@@ -1,9 +1,21 @@
1
1
  import assert from "node:assert";
2
2
  import { request } from "node:http";
3
3
  import { createProdServer, loadServerPlugins } from "@modern-js/prod-server";
4
+ import { createLogger } from "@modern-js/utils";
4
5
  import portfinder from "portfinder";
5
6
  import { chunkArray } from "../libs/util";
6
7
  import { CLOSE_SIGN } from "./consts";
8
+ function getLogger() {
9
+ const logger = createLogger({
10
+ level: "verbose"
11
+ });
12
+ return {
13
+ ...logger,
14
+ error: (...args) => {
15
+ console.error(...args);
16
+ }
17
+ };
18
+ }
7
19
  const MAX_CONCURRENT_REQUESTS = 10;
8
20
  process.on("message", async (chunk) => {
9
21
  if (chunk === CLOSE_SIGN) {
@@ -25,7 +37,8 @@ process.on("message", async (chunk) => {
25
37
  serverConfigPath: "",
26
38
  routes,
27
39
  plugins: await loadServerPlugins(plugins, appContext.appDirectory || distDirectory),
28
- staticGenerate: true
40
+ staticGenerate: true,
41
+ logger: getLogger()
29
42
  };
30
43
  assert(process.send, "process.send is not available");
31
44
  const sendProcessMessage = process.send.bind(process);
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.67.7",
18
+ "version": "2.67.9",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -63,8 +63,8 @@
63
63
  "node-mocks-http": "^1.11.0",
64
64
  "normalize-path": "3.0.0",
65
65
  "portfinder": "^1.0.28",
66
- "@modern-js/prod-server": "2.67.7",
67
- "@modern-js/utils": "2.67.7"
66
+ "@modern-js/prod-server": "2.67.9",
67
+ "@modern-js/utils": "2.67.9"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "react-router-dom": ">=5.1.2"
@@ -82,10 +82,10 @@
82
82
  "react-dom": "^18.3.1",
83
83
  "react-router-dom": "6.27.0",
84
84
  "typescript": "^5",
85
- "@modern-js/app-tools": "2.67.7",
86
- "@modern-js/types": "2.67.7",
87
- "@scripts/jest-config": "2.66.0",
88
- "@scripts/build": "2.66.0"
85
+ "@modern-js/app-tools": "2.67.9",
86
+ "@modern-js/types": "2.67.9",
87
+ "@scripts/build": "2.66.0",
88
+ "@scripts/jest-config": "2.66.0"
89
89
  },
90
90
  "sideEffects": false,
91
91
  "publishConfig": {