@modern-js/server 2.35.1 → 2.36.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.
Files changed (52) hide show
  1. package/dist/cjs/constants.js +26 -9
  2. package/dist/cjs/dev-tools/dev-middleware/hmr-client/createSocketUrl.js +27 -17
  3. package/dist/cjs/dev-tools/dev-middleware/hmr-client/index.js +30 -12
  4. package/dist/cjs/dev-tools/dev-middleware/index.js +39 -18
  5. package/dist/cjs/dev-tools/dev-middleware/socketServer.js +41 -19
  6. package/dist/cjs/dev-tools/https/index.js +29 -12
  7. package/dist/cjs/dev-tools/mock/getMockData.js +27 -18
  8. package/dist/cjs/dev-tools/mock/index.js +43 -18
  9. package/dist/cjs/dev-tools/register/index.js +47 -21
  10. package/dist/cjs/dev-tools/watcher/dependencyTree.js +43 -24
  11. package/dist/cjs/dev-tools/watcher/index.js +50 -34
  12. package/dist/cjs/dev-tools/watcher/statsCache.js +45 -19
  13. package/dist/cjs/index.js +27 -18
  14. package/dist/cjs/server/devServer.js +80 -55
  15. package/dist/cjs/server/index.js +28 -11
  16. package/dist/cjs/server/workerSSRRender.js +38 -12
  17. package/dist/cjs/types.js +15 -3
  18. package/dist/esm/constants.js +4 -1
  19. package/dist/esm/dev-tools/dev-middleware/hmr-client/createSocketUrl.js +6 -2
  20. package/dist/esm/dev-tools/dev-middleware/hmr-client/index.js +148 -139
  21. package/dist/esm/dev-tools/dev-middleware/index.js +5 -4
  22. package/dist/esm/dev-tools/dev-middleware/socketServer.js +7 -5
  23. package/dist/esm/dev-tools/https/index.js +4 -1
  24. package/dist/esm/dev-tools/mock/getMockData.js +6 -2
  25. package/dist/esm/dev-tools/mock/index.js +4 -1
  26. package/dist/esm/dev-tools/register/index.js +7 -4
  27. package/dist/esm/dev-tools/watcher/dependencyTree.js +7 -3
  28. package/dist/esm/dev-tools/watcher/index.js +9 -4
  29. package/dist/esm/dev-tools/watcher/statsCache.js +4 -1
  30. package/dist/esm/index.js +5 -2
  31. package/dist/esm/server/devServer.js +17 -14
  32. package/dist/esm/server/index.js +4 -1
  33. package/dist/esm/server/workerSSRRender.js +6 -3
  34. package/dist/esm/types.js +0 -1
  35. package/dist/esm-node/constants.js +4 -1
  36. package/dist/esm-node/dev-tools/dev-middleware/hmr-client/createSocketUrl.js +6 -2
  37. package/dist/esm-node/dev-tools/dev-middleware/hmr-client/index.js +134 -125
  38. package/dist/esm-node/dev-tools/dev-middleware/index.js +4 -3
  39. package/dist/esm-node/dev-tools/dev-middleware/socketServer.js +3 -1
  40. package/dist/esm-node/dev-tools/https/index.js +4 -1
  41. package/dist/esm-node/dev-tools/mock/getMockData.js +6 -2
  42. package/dist/esm-node/dev-tools/mock/index.js +4 -1
  43. package/dist/esm-node/dev-tools/register/index.js +4 -1
  44. package/dist/esm-node/dev-tools/watcher/dependencyTree.js +6 -2
  45. package/dist/esm-node/dev-tools/watcher/index.js +9 -4
  46. package/dist/esm-node/dev-tools/watcher/statsCache.js +4 -1
  47. package/dist/esm-node/index.js +5 -2
  48. package/dist/esm-node/server/devServer.js +4 -1
  49. package/dist/esm-node/server/index.js +4 -1
  50. package/dist/esm-node/server/workerSSRRender.js +4 -1
  51. package/dist/esm-node/types.js +0 -1
  52. package/package.json +10 -11
@@ -3,7 +3,7 @@ import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
3
3
  import axios from "axios";
4
4
  import { mime } from "@modern-js/utils";
5
5
  var PORT = 9230;
6
- export function workerSSRRender(ctx, renderOptions, _runner) {
6
+ function workerSSRRender(ctx, renderOptions, _runner) {
7
7
  return _workerSSRRender.apply(this, arguments);
8
8
  }
9
9
  function _workerSSRRender() {
@@ -20,8 +20,8 @@ function _workerSSRRender() {
20
20
  axios.get(url, {
21
21
  timeout: 5e3,
22
22
  responseType: "text",
23
- headers: headers,
24
- params: params
23
+ headers,
24
+ params
25
25
  })
26
26
  ];
27
27
  case 1:
@@ -38,3 +38,6 @@ function _workerSSRRender() {
38
38
  });
39
39
  return _workerSSRRender.apply(this, arguments);
40
40
  }
41
+ export {
42
+ workerSSRRender
43
+ };
package/dist/esm/types.js CHANGED
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +1,5 @@
1
1
  import { HMR_SOCK_PATH } from "@modern-js/utils/universal/constants";
2
- export const getDefaultDevOptions = () => {
2
+ const getDefaultDevOptions = () => {
3
3
  return {
4
4
  client: {
5
5
  path: HMR_SOCK_PATH,
@@ -20,3 +20,6 @@ export const getDefaultDevOptions = () => {
20
20
  liveReload: true
21
21
  };
22
22
  };
23
+ export {
24
+ getDefaultDevOptions
25
+ };
@@ -1,5 +1,5 @@
1
1
  import { HMR_SOCK_PATH } from "@modern-js/utils/universal/constants";
2
- export function createSocketUrl(resourceQuery) {
2
+ function createSocketUrl(resourceQuery) {
3
3
  const searchParams = resourceQuery.substr(1).split("&");
4
4
  const options = {};
5
5
  for (const pair of searchParams) {
@@ -9,7 +9,7 @@ export function createSocketUrl(resourceQuery) {
9
9
  const currentLocation = self.location;
10
10
  return getSocketUrl(options, currentLocation);
11
11
  }
12
- export function formatURL({ port, protocol, hostname, pathname }) {
12
+ function formatURL({ port, protocol, hostname, pathname }) {
13
13
  if (window.URL) {
14
14
  const url = new URL("http://localhost");
15
15
  url.port = port;
@@ -30,3 +30,7 @@ function getSocketUrl(urlParts, location) {
30
30
  pathname: path || HMR_SOCK_PATH
31
31
  });
32
32
  }
33
+ export {
34
+ createSocketUrl,
35
+ formatURL
36
+ };
@@ -1,136 +1,145 @@
1
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2
+ var __commonJS = (cb, mod) => function __require() {
3
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
4
+ };
1
5
  import stripAnsi from "@modern-js/utils/strip-ansi";
2
6
  import { formatWebpackMessages } from "@modern-js/utils/universal/format-webpack";
3
7
  import { createSocketUrl } from "./createSocketUrl";
4
- const hadRuntimeError = false;
5
- const socketUrl = createSocketUrl(__resourceQuery);
6
- const connection = new WebSocket(socketUrl);
7
- connection.onopen = function() {
8
- if (typeof console !== "undefined" && typeof console.info === "function") {
9
- console.info("[HMR] connected.");
10
- }
11
- };
12
- connection.onclose = function() {
13
- if (typeof console !== "undefined" && typeof console.info === "function") {
14
- console.info("[HMR] disconnected. Refresh the page if necessary.");
15
- }
16
- };
17
- let isFirstCompilation = true;
18
- let mostRecentCompilationHash = null;
19
- let hasCompileErrors = false;
20
- function clearOutdatedErrors() {
21
- if (typeof console !== "undefined" && typeof console.clear === "function") {
22
- if (hasCompileErrors) {
23
- console.clear();
8
+ var require_hmr_client = __commonJS({
9
+ "src/dev-tools/dev-middleware/hmr-client/index.ts"(exports, module) {
10
+ const hadRuntimeError = false;
11
+ const socketUrl = createSocketUrl(__resourceQuery);
12
+ const connection = new WebSocket(socketUrl);
13
+ connection.onopen = function() {
14
+ if (typeof console !== "undefined" && typeof console.info === "function") {
15
+ console.info("[HMR] connected.");
16
+ }
17
+ };
18
+ connection.onclose = function() {
19
+ if (typeof console !== "undefined" && typeof console.info === "function") {
20
+ console.info("[HMR] disconnected. Refresh the page if necessary.");
21
+ }
22
+ };
23
+ let isFirstCompilation = true;
24
+ let mostRecentCompilationHash = null;
25
+ let hasCompileErrors = false;
26
+ function clearOutdatedErrors() {
27
+ if (typeof console !== "undefined" && typeof console.clear === "function") {
28
+ if (hasCompileErrors) {
29
+ console.clear();
30
+ }
31
+ }
24
32
  }
25
- }
26
- }
27
- function handleSuccess() {
28
- clearOutdatedErrors();
29
- const isHotUpdate = !isFirstCompilation;
30
- isFirstCompilation = false;
31
- hasCompileErrors = false;
32
- if (isHotUpdate) {
33
- tryApplyUpdates();
34
- }
35
- }
36
- function handleWarnings(warnings) {
37
- clearOutdatedErrors();
38
- const isHotUpdate = !isFirstCompilation;
39
- isFirstCompilation = false;
40
- hasCompileErrors = false;
41
- function printWarnings() {
42
- const formatted = formatWebpackMessages({
43
- warnings,
44
- errors: []
45
- });
46
- if (typeof console !== "undefined" && typeof console.warn === "function") {
47
- for (let i = 0; i < formatted.warnings.length; i++) {
48
- if (i === 5) {
49
- console.warn("There were more warnings in other files.\nYou can find a complete log in the terminal.");
50
- break;
33
+ function handleSuccess() {
34
+ clearOutdatedErrors();
35
+ const isHotUpdate = !isFirstCompilation;
36
+ isFirstCompilation = false;
37
+ hasCompileErrors = false;
38
+ if (isHotUpdate) {
39
+ tryApplyUpdates();
40
+ }
41
+ }
42
+ function handleWarnings(warnings) {
43
+ clearOutdatedErrors();
44
+ const isHotUpdate = !isFirstCompilation;
45
+ isFirstCompilation = false;
46
+ hasCompileErrors = false;
47
+ function printWarnings() {
48
+ const formatted = formatWebpackMessages({
49
+ warnings,
50
+ errors: []
51
+ });
52
+ if (typeof console !== "undefined" && typeof console.warn === "function") {
53
+ for (let i = 0; i < formatted.warnings.length; i++) {
54
+ if (i === 5) {
55
+ console.warn("There were more warnings in other files.\nYou can find a complete log in the terminal.");
56
+ break;
57
+ }
58
+ console.warn(stripAnsi(formatted.warnings[i]));
59
+ }
51
60
  }
52
- console.warn(stripAnsi(formatted.warnings[i]));
61
+ }
62
+ printWarnings();
63
+ if (isHotUpdate) {
64
+ tryApplyUpdates();
53
65
  }
54
66
  }
55
- }
56
- printWarnings();
57
- if (isHotUpdate) {
58
- tryApplyUpdates();
59
- }
60
- }
61
- function handleErrors(errors) {
62
- clearOutdatedErrors();
63
- isFirstCompilation = false;
64
- hasCompileErrors = true;
65
- const formatted = formatWebpackMessages({
66
- errors,
67
- warnings: []
68
- });
69
- if (typeof console !== "undefined" && typeof console.error === "function") {
70
- for (const error of formatted.errors) {
71
- console.error(stripAnsi(error));
67
+ function handleErrors(errors) {
68
+ clearOutdatedErrors();
69
+ isFirstCompilation = false;
70
+ hasCompileErrors = true;
71
+ const formatted = formatWebpackMessages({
72
+ errors,
73
+ warnings: []
74
+ });
75
+ if (typeof console !== "undefined" && typeof console.error === "function") {
76
+ for (const error of formatted.errors) {
77
+ console.error(stripAnsi(error));
78
+ }
79
+ }
72
80
  }
73
- }
74
- }
75
- function handleAvailableHash(hash) {
76
- mostRecentCompilationHash = hash;
77
- }
78
- connection.onmessage = function(e) {
79
- const message = JSON.parse(e.data);
80
- switch (message.type) {
81
- case "hash":
82
- handleAvailableHash(message.data);
83
- break;
84
- case "still-ok":
85
- case "ok":
86
- handleSuccess();
87
- break;
88
- case "content-changed":
89
- window.location.reload();
90
- break;
91
- case "warnings":
92
- handleWarnings(message.data);
93
- break;
94
- case "errors":
95
- handleErrors(message.data);
96
- break;
97
- default:
98
- }
99
- };
100
- function isUpdateAvailable() {
101
- return mostRecentCompilationHash !== __webpack_hash__;
102
- }
103
- function canApplyUpdates() {
104
- return module.hot.status() === "idle";
105
- }
106
- function tryApplyUpdates() {
107
- if (!module.hot) {
108
- window.location.reload();
109
- return;
110
- }
111
- if (!isUpdateAvailable() || !canApplyUpdates()) {
112
- return;
113
- }
114
- function handleApplyUpdates(err, updatedModules) {
115
- const wantsForcedReload = err || !updatedModules || hadRuntimeError;
116
- if (wantsForcedReload) {
117
- window.location.reload();
118
- return;
81
+ function handleAvailableHash(hash) {
82
+ mostRecentCompilationHash = hash;
119
83
  }
120
- if (isUpdateAvailable()) {
121
- tryApplyUpdates();
84
+ connection.onmessage = function(e) {
85
+ const message = JSON.parse(e.data);
86
+ switch (message.type) {
87
+ case "hash":
88
+ handleAvailableHash(message.data);
89
+ break;
90
+ case "still-ok":
91
+ case "ok":
92
+ handleSuccess();
93
+ break;
94
+ case "content-changed":
95
+ window.location.reload();
96
+ break;
97
+ case "warnings":
98
+ handleWarnings(message.data);
99
+ break;
100
+ case "errors":
101
+ handleErrors(message.data);
102
+ break;
103
+ default:
104
+ }
105
+ };
106
+ function isUpdateAvailable() {
107
+ return mostRecentCompilationHash !== __webpack_hash__;
108
+ }
109
+ function canApplyUpdates() {
110
+ return module.hot.status() === "idle";
111
+ }
112
+ function tryApplyUpdates() {
113
+ if (!module.hot) {
114
+ window.location.reload();
115
+ return;
116
+ }
117
+ if (!isUpdateAvailable() || !canApplyUpdates()) {
118
+ return;
119
+ }
120
+ function handleApplyUpdates(err, updatedModules) {
121
+ const wantsForcedReload = err || !updatedModules || hadRuntimeError;
122
+ if (wantsForcedReload) {
123
+ window.location.reload();
124
+ return;
125
+ }
126
+ if (isUpdateAvailable()) {
127
+ tryApplyUpdates();
128
+ }
129
+ }
130
+ const result = module.hot.check(
131
+ /* autoApply */
132
+ true,
133
+ handleApplyUpdates
134
+ );
135
+ if (result === null || result === void 0 ? void 0 : result.then) {
136
+ result.then((updatedModules) => {
137
+ handleApplyUpdates(null, updatedModules);
138
+ }, (err) => {
139
+ handleApplyUpdates(err, null);
140
+ });
141
+ }
122
142
  }
123
143
  }
124
- const result = module.hot.check(
125
- /* autoApply */
126
- true,
127
- handleApplyUpdates
128
- );
129
- if (result === null || result === void 0 ? void 0 : result.then) {
130
- result.then((updatedModules) => {
131
- handleApplyUpdates(null, updatedModules);
132
- }, (err) => {
133
- handleApplyUpdates(err, null);
134
- });
135
- }
136
- }
144
+ });
145
+ export default require_hmr_client();
@@ -1,5 +1,4 @@
1
1
  import { _ as _define_property } from "@swc/helpers/_/_define_property";
2
- import { sep } from "path";
3
2
  import { EventEmitter } from "events";
4
3
  import SocketServer from "./socketServer";
5
4
  const noop = () => {
@@ -10,7 +9,7 @@ function getHMRClientPath(client) {
10
9
  const path = (client === null || client === void 0 ? void 0 : client.path) ? `&path=${client.path}` : "";
11
10
  const port = (client === null || client === void 0 ? void 0 : client.port) ? `&port=${client.port}` : "";
12
11
  const clientEntry = `${require.resolve("@modern-js/server/hmr-client")}?${host}${path}${port}${protocol}`;
13
- return clientEntry.replace(`${sep}cjs${sep}dev-tools`, `${sep}esm${sep}dev-tools`);
12
+ return clientEntry;
14
13
  }
15
14
  class DevMiddleware extends EventEmitter {
16
15
  init(app) {
@@ -60,4 +59,6 @@ class DevMiddleware extends EventEmitter {
60
59
  }
61
60
  }
62
61
  }
63
- export { DevMiddleware as default };
62
+ export {
63
+ DevMiddleware as default
64
+ };
@@ -143,4 +143,6 @@ class SocketServer {
143
143
  this.options = options;
144
144
  }
145
145
  }
146
- export { SocketServer as default };
146
+ export {
147
+ SocketServer as default
148
+ };
@@ -1,5 +1,5 @@
1
1
  import { chalk, getPackageManager, logger } from "@modern-js/utils";
2
- export const genHttpsOptions = async (userOptions, pwd) => {
2
+ const genHttpsOptions = async (userOptions, pwd) => {
3
3
  const httpsOptions = typeof userOptions === "boolean" ? {} : userOptions;
4
4
  if (!httpsOptions.key || !httpsOptions.cert) {
5
5
  let devcertPath;
@@ -25,3 +25,6 @@ export const genHttpsOptions = async (userOptions, pwd) => {
25
25
  }
26
26
  return httpsOptions;
27
27
  };
28
+ export {
29
+ genHttpsOptions
30
+ };
@@ -25,7 +25,7 @@ const allowTypes = [
25
25
  "object",
26
26
  "function"
27
27
  ];
28
- export default (mockConfig) => Object.keys(mockConfig).reduce((acc, key) => {
28
+ var getMockData_default = (mockConfig) => Object.keys(mockConfig).reduce((acc, key) => {
29
29
  const handler = mockConfig[key];
30
30
  const type = typeof handler;
31
31
  if (!allowTypes.includes(type)) {
@@ -60,7 +60,7 @@ const parseKey = (key) => {
60
60
  path: key
61
61
  };
62
62
  };
63
- export const getMatched = (context, mockApiList) => {
63
+ const getMatched = (context, mockApiList) => {
64
64
  const { path: targetPathname, method: targetMethod } = context;
65
65
  const matched = mockApiList.find((mockApi) => {
66
66
  const { method, path: pathname } = mockApi;
@@ -74,3 +74,7 @@ export const getMatched = (context, mockApiList) => {
74
74
  });
75
75
  return matched;
76
76
  };
77
+ export {
78
+ getMockData_default as default,
79
+ getMatched
80
+ };
@@ -2,7 +2,7 @@ import path from "path";
2
2
  import { compatRequire, fs } from "@modern-js/utils";
3
3
  import { AGGRED_DIR } from "@modern-js/prod-server";
4
4
  import getMockData, { getMatched } from "./getMockData";
5
- export const createMockHandler = ({ pwd }) => {
5
+ const createMockHandler = ({ pwd }) => {
6
6
  const exts = [
7
7
  ".ts",
8
8
  ".js"
@@ -46,3 +46,6 @@ export const createMockHandler = ({ pwd }) => {
46
46
  return matched.handler(context, next);
47
47
  };
48
48
  };
49
+ export {
50
+ createMockHandler
51
+ };
@@ -12,7 +12,7 @@ const checkDep = (depName, paths) => {
12
12
  }
13
13
  return Boolean(packagePath);
14
14
  };
15
- export const enableRegister = (projectRoot, config) => {
15
+ const enableRegister = (projectRoot, config) => {
16
16
  const registerDirs = [
17
17
  "./api",
18
18
  "./server",
@@ -107,3 +107,6 @@ export const enableRegister = (projectRoot, config) => {
107
107
  });
108
108
  }
109
109
  };
110
+ export {
111
+ enableRegister
112
+ };
@@ -1,13 +1,13 @@
1
1
  import { _ as _define_property } from "@swc/helpers/_/_define_property";
2
2
  import minimatch from "minimatch";
3
- export const defaultIgnores = [
3
+ const defaultIgnores = [
4
4
  "**/coverage/**",
5
5
  "**/node_modules/**",
6
6
  "**/.*/**",
7
7
  "**/*.d.ts",
8
8
  "**/*.log"
9
9
  ];
10
- export class DependencyTree {
10
+ class DependencyTree {
11
11
  getNode(path) {
12
12
  return this.tree.get(path);
13
13
  }
@@ -64,3 +64,7 @@ export class DependencyTree {
64
64
  ];
65
65
  }
66
66
  }
67
+ export {
68
+ DependencyTree,
69
+ defaultIgnores
70
+ };
@@ -3,12 +3,12 @@ import path from "path";
3
3
  import { fs, chokidar } from "@modern-js/utils";
4
4
  import { DependencyTree } from "./dependencyTree";
5
5
  import { StatsCache } from "./statsCache";
6
- export const defaultWatchOptions = {
6
+ const defaultWatchOptions = {
7
7
  // 初始化的时候不触发 add、addDir 事件
8
8
  ignoreInitial: true,
9
9
  ignored: /api\/typings\/.*/
10
10
  };
11
- export const getWatchedFiles = (watcher) => {
11
+ const getWatchedFiles = (watcher) => {
12
12
  const watched = watcher.getWatched();
13
13
  const files = [];
14
14
  Object.keys(watched).forEach((dir) => {
@@ -18,7 +18,7 @@ export const getWatchedFiles = (watcher) => {
18
18
  });
19
19
  return files;
20
20
  };
21
- export const mergeWatchOptions = (options) => {
21
+ const mergeWatchOptions = (options) => {
22
22
  const watchOptions = {
23
23
  ...options
24
24
  };
@@ -94,4 +94,9 @@ class Watcher {
94
94
  _define_property(this, "watcher", void 0);
95
95
  }
96
96
  }
97
- export { Watcher as default };
97
+ export {
98
+ Watcher as default,
99
+ defaultWatchOptions,
100
+ getWatchedFiles,
101
+ mergeWatchOptions
102
+ };
@@ -1,7 +1,7 @@
1
1
  import { _ as _define_property } from "@swc/helpers/_/_define_property";
2
2
  import fs from "fs";
3
3
  import crypto from "crypto";
4
- export class StatsCache {
4
+ class StatsCache {
5
5
  add(files) {
6
6
  const { cachedHash, cachedSize } = this;
7
7
  for (const filename of files) {
@@ -54,3 +54,6 @@ export class StatsCache {
54
54
  _define_property(this, "cachedSize", {});
55
55
  }
56
56
  }
57
+ export {
58
+ StatsCache
59
+ };
@@ -1,9 +1,12 @@
1
1
  import { DevServer as Server } from "./server";
2
- export { Server };
3
- export default (options) => {
2
+ var src_default = (options) => {
4
3
  if (options == null) {
5
4
  throw new Error("can not start server without options");
6
5
  }
7
6
  const server = new Server(options);
8
7
  return server.init();
9
8
  };
9
+ export {
10
+ Server,
11
+ src_default as default
12
+ };
@@ -11,7 +11,7 @@ import { enableRegister } from "../dev-tools/register";
11
11
  import Watcher, { mergeWatchOptions } from "../dev-tools/watcher";
12
12
  import DevMiddleware from "../dev-tools/dev-middleware";
13
13
  import { workerSSRRender } from "./workerSSRRender";
14
- export class ModernDevServer extends ModernServer {
14
+ class ModernDevServer extends ModernServer {
15
15
  getDevOptions(options) {
16
16
  const devOptions = typeof options.dev === "boolean" ? {} : options.dev;
17
17
  const defaultOptions = getDefaultDevOptions();
@@ -330,3 +330,6 @@ export class ModernDevServer extends ModernServer {
330
330
  enableRegister(this.pwd, this.conf);
331
331
  }
332
332
  }
333
+ export {
334
+ ModernDevServer
335
+ };
@@ -3,7 +3,7 @@ import { ModernDevServer } from "./devServer";
3
3
  const createDevServer = (options) => {
4
4
  return new ModernDevServer(options);
5
5
  };
6
- export class DevServer extends Server {
6
+ class DevServer extends Server {
7
7
  constructor(options) {
8
8
  super(options);
9
9
  if (options.dev) {
@@ -11,3 +11,6 @@ export class DevServer extends Server {
11
11
  }
12
12
  }
13
13
  }
14
+ export {
15
+ DevServer
16
+ };
@@ -1,7 +1,7 @@
1
1
  import axios from "axios";
2
2
  import { mime } from "@modern-js/utils";
3
3
  const PORT = 9230;
4
- export async function workerSSRRender(ctx, renderOptions, _runner) {
4
+ async function workerSSRRender(ctx, renderOptions, _runner) {
5
5
  const { headers, params } = ctx;
6
6
  const { urlPath } = renderOptions;
7
7
  const url = `http://0.0.0.0:${PORT}/${urlPath}`;
@@ -16,3 +16,6 @@ export async function workerSSRRender(ctx, renderOptions, _runner) {
16
16
  contentType: mime.contentType("html")
17
17
  };
18
18
  }
19
+ export {
20
+ workerSSRRender
21
+ };
@@ -1 +0,0 @@
1
- export {};
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.35.1",
18
+ "version": "2.36.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -32,10 +32,9 @@
32
32
  "./hmr-client": {
33
33
  "node": {
34
34
  "jsnext:source": "./src/dev-tools/dev-middleware/hmr-client/index.ts",
35
- "import": "./dist/esm/dev-tools/dev-middleware/hmr-client/index.js",
36
35
  "require": "./dist/cjs/dev-tools/dev-middleware/hmr-client/index.js"
37
36
  },
38
- "default": "./dist/esm/dev-tools/dev-middleware/hmr-client/index.js"
37
+ "default": "./dist/cjs/dev-tools/dev-middleware/hmr-client/index.js"
39
38
  }
40
39
  },
41
40
  "dependencies": {
@@ -48,11 +47,11 @@
48
47
  "path-to-regexp": "^6.2.0",
49
48
  "ws": "^8.2.0",
50
49
  "axios": "^1.2.1",
51
- "@modern-js/prod-server": "2.35.1",
52
- "@modern-js/server-utils": "2.35.1",
53
- "@modern-js/types": "2.35.1",
54
- "@modern-js/utils": "2.35.1",
55
- "@modern-js/runtime-utils": "2.35.1"
50
+ "@modern-js/runtime-utils": "2.36.0",
51
+ "@modern-js/prod-server": "2.36.0",
52
+ "@modern-js/server-utils": "2.36.0",
53
+ "@modern-js/types": "2.36.0",
54
+ "@modern-js/utils": "2.36.0"
56
55
  },
57
56
  "devDependencies": {
58
57
  "@types/connect-history-api-fallback": "^1.3.5",
@@ -67,9 +66,9 @@
67
66
  "typescript": "^5",
68
67
  "webpack": "^5.88.1",
69
68
  "websocket": "^1",
70
- "@modern-js/server-core": "2.35.1",
71
- "@scripts/jest-config": "2.35.1",
72
- "@scripts/build": "2.35.1"
69
+ "@modern-js/server-core": "2.36.0",
70
+ "@scripts/build": "2.36.0",
71
+ "@scripts/jest-config": "2.36.0"
73
72
  },
74
73
  "peerDependencies": {
75
74
  "devcert": "^1.0.0",