@modern-js/runtime 2.54.0 → 2.54.2

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.
@@ -28,6 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var entry_exports = {};
30
30
  __export(entry_exports, {
31
+ hasApp: () => hasApp,
31
32
  isRuntimeEntry: () => isRuntimeEntry
32
33
  });
33
34
  module.exports = __toCommonJS(entry_exports);
@@ -38,5 +39,6 @@ const hasApp = (dir) => (0, import_utils.findExists)(import_utils.JS_EXTENSIONS.
38
39
  const isRuntimeEntry = (dir) => hasApp(dir);
39
40
  // Annotate the CommonJS export names for ESM import in node:
40
41
  0 && (module.exports = {
42
+ hasApp,
41
43
  isRuntimeEntry
42
44
  });
@@ -36,6 +36,7 @@ __export(entry_exports, {
36
36
  module.exports = __toCommonJS(entry_exports);
37
37
  var import_path = __toESM(require("path"));
38
38
  var import_utils = require("@modern-js/utils");
39
+ var import_entry = require("../../cli/entry");
39
40
  var import_constants = require("./constants");
40
41
  const hasPages = (dir) => import_utils.fs.existsSync(import_path.default.join(dir, import_constants.PAGES_DIR_NAME));
41
42
  const hasNestedRoutes = (dir) => import_utils.fs.existsSync(import_path.default.join(dir, import_constants.NESTED_ROUTES_DIR));
@@ -53,6 +54,10 @@ const modifyEntrypoints = (entrypoints, config = {}) => {
53
54
  if (!entrypoint.isAutoMount) {
54
55
  return entrypoint;
55
56
  }
57
+ const isHasApp = (0, import_entry.hasApp)(entrypoint.absoluteEntryDir);
58
+ if (isHasApp) {
59
+ return entrypoint;
60
+ }
56
61
  const isHasNestedRoutes = hasNestedRoutes(entrypoint.absoluteEntryDir);
57
62
  const isHasPages = hasPages(entrypoint.absoluteEntryDir);
58
63
  if (!isHasNestedRoutes && !isHasPages) {
@@ -10,5 +10,6 @@ var isRuntimeEntry = function(dir) {
10
10
  return hasApp(dir);
11
11
  };
12
12
  export {
13
+ hasApp,
13
14
  isRuntimeEntry
14
15
  };
@@ -1,5 +1,6 @@
1
1
  import path from "path";
2
2
  import { JS_EXTENSIONS, findExists, fs, isRouterV5 } from "@modern-js/utils";
3
+ import { hasApp } from "../../cli/entry";
3
4
  import { FILE_SYSTEM_ROUTES_GLOBAL_LAYOUT, NESTED_ROUTES_DIR, PAGES_DIR_NAME } from "./constants";
4
5
  var hasPages = function(dir) {
5
6
  return fs.existsSync(path.join(dir, PAGES_DIR_NAME));
@@ -22,6 +23,10 @@ var modifyEntrypoints = function(entrypoints) {
22
23
  if (!entrypoint.isAutoMount) {
23
24
  return entrypoint;
24
25
  }
26
+ var isHasApp = hasApp(entrypoint.absoluteEntryDir);
27
+ if (isHasApp) {
28
+ return entrypoint;
29
+ }
25
30
  var isHasNestedRoutes = hasNestedRoutes(entrypoint.absoluteEntryDir);
26
31
  var isHasPages = hasPages(entrypoint.absoluteEntryDir);
27
32
  if (!isHasNestedRoutes && !isHasPages) {
@@ -4,5 +4,6 @@ import { APP_FILE_NAME } from "./constants";
4
4
  const hasApp = (dir) => findExists(JS_EXTENSIONS.map((ext) => path.resolve(dir, `${APP_FILE_NAME}${ext}`)));
5
5
  const isRuntimeEntry = (dir) => hasApp(dir);
6
6
  export {
7
+ hasApp,
7
8
  isRuntimeEntry
8
9
  };
@@ -1,5 +1,6 @@
1
1
  import path from "path";
2
2
  import { JS_EXTENSIONS, findExists, fs, isRouterV5 } from "@modern-js/utils";
3
+ import { hasApp } from "../../cli/entry";
3
4
  import { FILE_SYSTEM_ROUTES_GLOBAL_LAYOUT, NESTED_ROUTES_DIR, PAGES_DIR_NAME } from "./constants";
4
5
  const hasPages = (dir) => fs.existsSync(path.join(dir, PAGES_DIR_NAME));
5
6
  const hasNestedRoutes = (dir) => fs.existsSync(path.join(dir, NESTED_ROUTES_DIR));
@@ -17,6 +18,10 @@ const modifyEntrypoints = (entrypoints, config = {}) => {
17
18
  if (!entrypoint.isAutoMount) {
18
19
  return entrypoint;
19
20
  }
21
+ const isHasApp = hasApp(entrypoint.absoluteEntryDir);
22
+ if (isHasApp) {
23
+ return entrypoint;
24
+ }
20
25
  const isHasNestedRoutes = hasNestedRoutes(entrypoint.absoluteEntryDir);
21
26
  const isHasPages = hasPages(entrypoint.absoluteEntryDir);
22
27
  if (!isHasNestedRoutes && !isHasPages) {
@@ -1 +1,2 @@
1
+ export declare const hasApp: (dir: string) => string | false;
1
2
  export declare const isRuntimeEntry: (dir: string) => string | false;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.54.0",
18
+ "version": "2.54.2",
19
19
  "engines": {
20
20
  "node": ">=14.17.6"
21
21
  },
@@ -195,11 +195,11 @@
195
195
  "react-side-effect": "^2.1.1",
196
196
  "styled-components": "^5.3.1",
197
197
  "@swc/helpers": "0.5.3",
198
- "@modern-js/plugin": "2.54.0",
199
- "@modern-js/types": "2.54.0",
200
- "@modern-js/runtime-utils": "2.54.0",
201
- "@modern-js/plugin-data-loader": "2.54.0",
202
- "@modern-js/utils": "2.54.0"
198
+ "@modern-js/plugin": "2.54.2",
199
+ "@modern-js/types": "2.54.2",
200
+ "@modern-js/utils": "2.54.2",
201
+ "@modern-js/plugin-data-loader": "2.54.2",
202
+ "@modern-js/runtime-utils": "2.54.2"
203
203
  },
204
204
  "peerDependencies": {
205
205
  "react": ">=17",
@@ -220,11 +220,11 @@
220
220
  "ts-jest": "^29.1.0",
221
221
  "typescript": "^5",
222
222
  "webpack": "^5.92.0",
223
- "@modern-js/app-tools": "2.54.0",
224
- "@modern-js/core": "2.54.0",
225
- "@modern-js/server-core": "2.54.0",
226
- "@scripts/build": "2.54.0",
227
- "@scripts/jest-config": "2.54.0"
223
+ "@modern-js/app-tools": "2.54.2",
224
+ "@modern-js/server-core": "2.54.2",
225
+ "@modern-js/core": "2.54.2",
226
+ "@scripts/build": "2.54.2",
227
+ "@scripts/jest-config": "2.54.2"
228
228
  },
229
229
  "sideEffects": false,
230
230
  "publishConfig": {