@modern-js/runtime 2.58.4-alpha.1 → 2.58.4-alpha.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.
@@ -34,6 +34,7 @@ __export(code_exports, {
34
34
  module.exports = __toCommonJS(code_exports);
35
35
  var import_path = __toESM(require("path"));
36
36
  var import_utils = require("@modern-js/utils");
37
+ var import_route = require("@modern-js/utils/universal/route");
37
38
  var import_lodash = require("@modern-js/utils/lodash");
38
39
  var import_constants = require("../../../cli/constants");
39
40
  var import_constants2 = require("../constants");
@@ -84,7 +85,7 @@ const generateCode = async (appContext, config, entrypoints, api) => {
84
85
  const config2 = api.useResolvedConfigContext();
85
86
  const ssrByRouteIds = config2.server.ssrByRouteIds || [];
86
87
  const clonedRoutes = (0, import_lodash.cloneDeep)(initialRoutes);
87
- const markedRoutes = ssrByRouteIds.length > 0 ? (0, import_utils.markRoutes)(clonedRoutes, ssrByRouteIds) : initialRoutes;
88
+ const markedRoutes = ssrByRouteIds.length > 0 ? (0, import_route.markRoutes)(clonedRoutes, ssrByRouteIds) : initialRoutes;
88
89
  const { routes } = await hookRunners.modifyFileSystemRoutes({
89
90
  entrypoint,
90
91
  routes: markedRoutes
@@ -117,8 +118,8 @@ const generateCode = async (appContext, config, entrypoints, api) => {
117
118
  if (entrypoint.nestedRoutesEntry && (0, import_utils.isUseSSRBundle)(config2)) {
118
119
  var _config_output1, _config_output2;
119
120
  const routesServerFile = (0, import_utils2.getServerLoadersFile)(internalDirectory, entryName);
120
- const filtedRoutesForServer = (0, import_utils.filterRoutesForServer)(routes);
121
- const routesForServerLoaderMatches = (0, import_utils.filterRoutesLoader)(routes);
121
+ const filtedRoutesForServer = (0, import_route.filterRoutesForServer)(routes);
122
+ const routesForServerLoaderMatches = (0, import_route.filterRoutesLoader)(routes);
122
123
  const code2 = templates.routesForServer({
123
124
  routesForServerLoaderMatches
124
125
  });
@@ -37,6 +37,7 @@ __export(cli_exports, {
37
37
  module.exports = __toCommonJS(cli_exports);
38
38
  var import_node_path = __toESM(require("node:path"));
39
39
  var import_utils = require("@modern-js/utils");
40
+ var import_route = require("@modern-js/utils/universal/route");
40
41
  var import_entry = require("./entry");
41
42
  var import_handler = require("./handler");
42
43
  var import_entry2 = require("./entry");
@@ -115,7 +116,7 @@ const routerPlugin = () => ({
115
116
  },
116
117
  async modifyFileSystemRoutes({ entrypoint, routes }) {
117
118
  nestedRoutes[entrypoint.entryName] = routes;
118
- nestedRoutesForServer[entrypoint.entryName] = (0, import_utils.filterRoutesForServer)(routes);
119
+ nestedRoutesForServer[entrypoint.entryName] = (0, import_route.filterRoutesForServer)(routes);
119
120
  return {
120
121
  entrypoint,
121
122
  routes
@@ -1,7 +1,8 @@
1
1
  import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
2
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
3
3
  import path from "path";
4
- import { fs, filterRoutesForServer, filterRoutesLoader, getEntryOptions, isRouterV5, isSSGEntry, isUseSSRBundle, logger, markRoutes } from "@modern-js/utils";
4
+ import { fs, getEntryOptions, isRouterV5, isSSGEntry, isUseSSRBundle, logger } from "@modern-js/utils";
5
+ import { filterRoutesForServer, filterRoutesLoader, markRoutes } from "@modern-js/utils/universal/route";
5
6
  import { cloneDeep } from "@modern-js/utils/lodash";
6
7
  import { ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME } from "../../../cli/constants";
7
8
  import { FILE_SYSTEM_ROUTES_FILE_NAME } from "../constants";
@@ -3,7 +3,8 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
3
3
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
4
4
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
5
5
  import path from "node:path";
6
- import { fs, NESTED_ROUTE_SPEC_FILE, createRuntimeExportsUtils, filterRoutesForServer, getEntryOptions, isRouterV5 as isV5 } from "@modern-js/utils";
6
+ import { fs, NESTED_ROUTE_SPEC_FILE, createRuntimeExportsUtils, getEntryOptions, isRouterV5 as isV5 } from "@modern-js/utils";
7
+ import { filterRoutesForServer } from "@modern-js/utils/universal/route";
7
8
  import { isRouteEntry } from "./entry";
8
9
  import { handleFileChange, handleGeneratorEntryCode, handleModifyEntrypoints } from "./handler";
9
10
  import { isRouteEntry as isRouteEntry2 } from "./entry";
@@ -1,5 +1,6 @@
1
1
  import path from "path";
2
- import { fs, filterRoutesForServer, filterRoutesLoader, getEntryOptions, isRouterV5, isSSGEntry, isUseSSRBundle, logger, markRoutes } from "@modern-js/utils";
2
+ import { fs, getEntryOptions, isRouterV5, isSSGEntry, isUseSSRBundle, logger } from "@modern-js/utils";
3
+ import { filterRoutesForServer, filterRoutesLoader, markRoutes } from "@modern-js/utils/universal/route";
3
4
  import { cloneDeep } from "@modern-js/utils/lodash";
4
5
  import { ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME } from "../../../cli/constants";
5
6
  import { FILE_SYSTEM_ROUTES_FILE_NAME } from "../constants";
@@ -1,5 +1,6 @@
1
1
  import path from "node:path";
2
- import { fs, NESTED_ROUTE_SPEC_FILE, createRuntimeExportsUtils, filterRoutesForServer, getEntryOptions, isRouterV5 as isV5 } from "@modern-js/utils";
2
+ import { fs, NESTED_ROUTE_SPEC_FILE, createRuntimeExportsUtils, getEntryOptions, isRouterV5 as isV5 } from "@modern-js/utils";
3
+ import { filterRoutesForServer } from "@modern-js/utils/universal/route";
3
4
  import { isRouteEntry } from "./entry";
4
5
  import { handleFileChange, handleGeneratorEntryCode, handleModifyEntrypoints } from "./handler";
5
6
  import { isRouteEntry as isRouteEntry2 } from "./entry";
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.58.4-alpha.1",
18
+ "version": "2.58.4-alpha.2",
19
19
  "engines": {
20
20
  "node": ">=14.17.6"
21
21
  },
@@ -199,11 +199,11 @@
199
199
  "react-is": "^18",
200
200
  "react-side-effect": "^2.1.1",
201
201
  "styled-components": "^5.3.1",
202
- "@modern-js/plugin-data-loader": "2.58.3",
203
202
  "@modern-js/plugin": "2.58.3",
204
- "@modern-js/utils": "2.58.4-alpha.0",
203
+ "@modern-js/types": "2.58.3",
205
204
  "@modern-js/runtime-utils": "2.58.3",
206
- "@modern-js/types": "2.58.3"
205
+ "@modern-js/plugin-data-loader": "2.58.3",
206
+ "@modern-js/utils": "2.58.4-alpha.2"
207
207
  },
208
208
  "peerDependencies": {
209
209
  "react": ">=17",
@@ -226,10 +226,10 @@
226
226
  "ts-jest": "^29.1.0",
227
227
  "typescript": "^5",
228
228
  "webpack": "^5.93.0",
229
- "@modern-js/core": "2.58.3",
230
229
  "@modern-js/app-tools": "2.58.3",
231
- "@scripts/build": "2.58.3",
232
- "@scripts/jest-config": "2.58.3"
230
+ "@modern-js/core": "2.58.3",
231
+ "@scripts/jest-config": "2.58.3",
232
+ "@scripts/build": "2.58.3"
233
233
  },
234
234
  "sideEffects": false,
235
235
  "publishConfig": {