@modern-js/plugin-server 0.0.0-next-20250424075521 → 0.0.0-next-20250428072207

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.
@@ -103,8 +103,6 @@ var server_default = () => ({
103
103
  let factory;
104
104
  return {
105
105
  async prepare() {
106
- const { metaName } = api.useAppContext();
107
- await (0, import_utils2.checkServerMod)(metaName, pwd);
108
106
  await loadMod();
109
107
  },
110
108
  async reset() {
package/dist/cjs/utils.js CHANGED
@@ -28,7 +28,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var utils_exports = {};
30
30
  __export(utils_exports, {
31
- checkServerMod: () => checkServerMod,
32
31
  loadMiddleware: () => loadMiddleware,
33
32
  loadServerMod: () => loadServerMod
34
33
  });
@@ -59,24 +58,8 @@ const loadServerMod = async (pwd = process.cwd()) => {
59
58
  middleware
60
59
  };
61
60
  };
62
- const checkServerMod = async (metaName, pwd = process.cwd()) => {
63
- const webAppPath = import_path.default.resolve(pwd, import_utils.SERVER_DIR, WEB_APP_NAME);
64
- const final = {
65
- extensions: [
66
- ".ts",
67
- ".js"
68
- ],
69
- interop: true
70
- };
71
- const exist = (0, import_utils.findExists)(final.extensions.map((ext) => `${webAppPath}${ext}`));
72
- const meta = (0, import_utils.getMeta)(metaName);
73
- if (exist) {
74
- console.warn(`${import_utils.chalk.red("\n[Warning]")} ${import_utils.chalk.yellow.bold(`\`server/index.ts\``)} is no longer maintained. To extend the server, please migrate to ${import_utils.chalk.yellow.bold(`\`server/${meta}.server.ts\``)};`);
75
- }
76
- };
77
61
  // Annotate the CommonJS export names for ESM import in node:
78
62
  0 && (module.exports = {
79
- checkServerMod,
80
63
  loadMiddleware,
81
64
  loadServerMod
82
65
  });
@@ -3,7 +3,7 @@ import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
3
3
  import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
4
4
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
5
5
  import { isProd, logger } from "@modern-js/utils";
6
- import { checkServerMod, loadMiddleware, loadServerMod } from "./utils";
6
+ import { loadMiddleware, loadServerMod } from "./utils";
7
7
  var HOOKS;
8
8
  (function(HOOKS2) {
9
9
  HOOKS2["AFTER_MATCH"] = "afterMatch";
@@ -115,22 +115,14 @@ function server_default() {
115
115
  return {
116
116
  prepare: function prepare() {
117
117
  return _async_to_generator(function() {
118
- var metaName;
119
118
  return _ts_generator(this, function(_state) {
120
119
  switch (_state.label) {
121
120
  case 0:
122
- metaName = api.useAppContext().metaName;
123
- return [
124
- 4,
125
- checkServerMod(metaName, pwd)
126
- ];
127
- case 1:
128
- _state.sent();
129
121
  return [
130
122
  4,
131
123
  loadMod()
132
124
  ];
133
- case 2:
125
+ case 1:
134
126
  _state.sent();
135
127
  return [
136
128
  2
package/dist/esm/utils.js CHANGED
@@ -2,7 +2,7 @@ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
2
  import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
3
3
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
4
4
  import path from "path";
5
- import { SERVER_DIR, chalk, findExists, getMeta, requireExistModule } from "@modern-js/utils";
5
+ import { SERVER_DIR, requireExistModule } from "@modern-js/utils";
6
6
  var WEB_APP_NAME = "index";
7
7
  var loadMiddleware = function() {
8
8
  var _ref = _async_to_generator(function() {
@@ -73,38 +73,7 @@ var loadServerMod = function() {
73
73
  return _ref.apply(this, arguments);
74
74
  };
75
75
  }();
76
- var checkServerMod = function() {
77
- var _ref = _async_to_generator(function(metaName) {
78
- var pwd, webAppPath, final, exist, meta;
79
- var _arguments = arguments;
80
- return _ts_generator(this, function(_state) {
81
- pwd = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : process.cwd();
82
- webAppPath = path.resolve(pwd, SERVER_DIR, WEB_APP_NAME);
83
- final = {
84
- extensions: [
85
- ".ts",
86
- ".js"
87
- ],
88
- interop: true
89
- };
90
- exist = findExists(final.extensions.map(function(ext) {
91
- return "".concat(webAppPath).concat(ext);
92
- }));
93
- meta = getMeta(metaName);
94
- if (exist) {
95
- console.warn("".concat(chalk.red("\n[Warning]"), " ").concat(chalk.yellow.bold("`server/index.ts`"), " is no longer maintained. To extend the server, please migrate to ").concat(chalk.yellow.bold("`server/".concat(meta, ".server.ts`")), ";"));
96
- }
97
- return [
98
- 2
99
- ];
100
- });
101
- });
102
- return function checkServerMod2(metaName) {
103
- return _ref.apply(this, arguments);
104
- };
105
- }();
106
76
  export {
107
- checkServerMod,
108
77
  loadMiddleware,
109
78
  loadServerMod
110
79
  };
@@ -1,5 +1,5 @@
1
1
  import { isProd, logger } from "@modern-js/utils";
2
- import { checkServerMod, loadMiddleware, loadServerMod } from "./utils";
2
+ import { loadMiddleware, loadServerMod } from "./utils";
3
3
  var HOOKS;
4
4
  (function(HOOKS2) {
5
5
  HOOKS2["AFTER_MATCH"] = "afterMatch";
@@ -77,8 +77,6 @@ var server_default = () => ({
77
77
  let factory;
78
78
  return {
79
79
  async prepare() {
80
- const { metaName } = api.useAppContext();
81
- await checkServerMod(metaName, pwd);
82
80
  await loadMod();
83
81
  },
84
82
  async reset() {
@@ -1,5 +1,5 @@
1
1
  import path from "path";
2
- import { SERVER_DIR, chalk, findExists, getMeta, requireExistModule } from "@modern-js/utils";
2
+ import { SERVER_DIR, requireExistModule } from "@modern-js/utils";
3
3
  const WEB_APP_NAME = "index";
4
4
  const loadMiddleware = async (pwd = process.cwd()) => {
5
5
  const middlewarePath = path.resolve(pwd, SERVER_DIR, "_middleware");
@@ -24,23 +24,7 @@ const loadServerMod = async (pwd = process.cwd()) => {
24
24
  middleware
25
25
  };
26
26
  };
27
- const checkServerMod = async (metaName, pwd = process.cwd()) => {
28
- const webAppPath = path.resolve(pwd, SERVER_DIR, WEB_APP_NAME);
29
- const final = {
30
- extensions: [
31
- ".ts",
32
- ".js"
33
- ],
34
- interop: true
35
- };
36
- const exist = findExists(final.extensions.map((ext) => `${webAppPath}${ext}`));
37
- const meta = getMeta(metaName);
38
- if (exist) {
39
- console.warn(`${chalk.red("\n[Warning]")} ${chalk.yellow.bold(`\`server/index.ts\``)} is no longer maintained. To extend the server, please migrate to ${chalk.yellow.bold(`\`server/${meta}.server.ts\``)};`);
40
- }
41
- };
42
27
  export {
43
- checkServerMod,
44
28
  loadMiddleware,
45
29
  loadServerMod
46
30
  };
@@ -20,4 +20,3 @@ export declare const loadServerMod: (pwd?: string) => Promise<{
20
20
  };
21
21
  middleware: Middleware[];
22
22
  }>;
23
- export declare const checkServerMod: (metaName: string, pwd?: string) => Promise<void>;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-next-20250424075521",
18
+ "version": "0.0.0-next-20250428072207",
19
19
  "types": "./dist/types/cli.d.ts",
20
20
  "jsnext:source": "./src/cli",
21
21
  "main": "./dist/cjs/cli.js",
@@ -65,21 +65,21 @@
65
65
  },
66
66
  "dependencies": {
67
67
  "@swc/helpers": "0.5.13",
68
- "@modern-js/runtime-utils": "0.0.0-next-20250424075521",
69
- "@modern-js/server-utils": "0.0.0-next-20250424075521",
70
- "@modern-js/utils": "0.0.0-next-20250424075521"
68
+ "@modern-js/runtime-utils": "0.0.0-next-20250428072207",
69
+ "@modern-js/server-utils": "0.0.0-next-20250428072207",
70
+ "@modern-js/utils": "0.0.0-next-20250428072207"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@types/jest": "^29",
74
74
  "@types/node": "^14",
75
75
  "jest": "^29",
76
76
  "typescript": "^5",
77
- "@modern-js/app-tools": "0.0.0-next-20250424075521",
78
- "@modern-js/core": "0.0.0-next-20250424075521",
79
- "@modern-js/server-core": "0.0.0-next-20250424075521",
80
- "@modern-js/types": "0.0.0-next-20250424075521",
81
- "@scripts/build": "0.0.0-next-20250424075521",
82
- "@scripts/jest-config": "0.0.0-next-20250424075521"
77
+ "@modern-js/app-tools": "0.0.0-next-20250428072207",
78
+ "@modern-js/core": "0.0.0-next-20250428072207",
79
+ "@modern-js/server-core": "0.0.0-next-20250428072207",
80
+ "@modern-js/types": "0.0.0-next-20250428072207",
81
+ "@scripts/build": "0.0.0-next-20250428072207",
82
+ "@scripts/jest-config": "0.0.0-next-20250428072207"
83
83
  },
84
84
  "sideEffects": [
85
85
  "*.css",