@modern-js/utils 3.0.5 → 3.1.1

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.
@@ -25,15 +25,9 @@ var __webpack_exports__ = {};
25
25
  __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
27
  isVersionAtLeast18: ()=>isVersionAtLeast18,
28
- isVersionAtLeast1819: ()=>isVersionAtLeast1819,
29
28
  isVersionAtLeast20: ()=>isVersionAtLeast20,
30
29
  isVersionAtLeast22: ()=>isVersionAtLeast22
31
30
  });
32
- function isVersionAtLeast1819() {
33
- const nodeVersion = process.versions.node;
34
- const versionArr = nodeVersion.split('.').map(Number);
35
- return versionArr[0] > 18 || 18 === versionArr[0] && versionArr[1] >= 19;
36
- }
37
31
  function isVersionAtLeast18() {
38
32
  const nodeVersion = process.versions.node;
39
33
  const versionArr = nodeVersion.split('.').map(Number);
@@ -50,12 +44,10 @@ function isVersionAtLeast20() {
50
44
  return versionArr[0] >= 20;
51
45
  }
52
46
  exports.isVersionAtLeast18 = __webpack_exports__.isVersionAtLeast18;
53
- exports.isVersionAtLeast1819 = __webpack_exports__.isVersionAtLeast1819;
54
47
  exports.isVersionAtLeast20 = __webpack_exports__.isVersionAtLeast20;
55
48
  exports.isVersionAtLeast22 = __webpack_exports__.isVersionAtLeast22;
56
49
  for(var __rspack_i in __webpack_exports__)if (-1 === [
57
50
  "isVersionAtLeast18",
58
- "isVersionAtLeast1819",
59
51
  "isVersionAtLeast20",
60
52
  "isVersionAtLeast22"
61
53
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
@@ -35,7 +35,8 @@ __webpack_require__.d(__webpack_exports__, {
35
35
  SERVER_BUNDLE_DIRECTORY: ()=>SERVER_BUNDLE_DIRECTORY,
36
36
  SERVER_PLUGIN_BFF: ()=>SERVER_PLUGIN_BFF,
37
37
  SERVER_PLUGIN_POLYFILL: ()=>SERVER_PLUGIN_POLYFILL,
38
- SERVER_RENDER_FUNCTION_NAME: ()=>SERVER_RENDER_FUNCTION_NAME
38
+ SERVER_RENDER_FUNCTION_NAME: ()=>SERVER_RENDER_FUNCTION_NAME,
39
+ SSR_HYDRATION_ID_PREFIX: ()=>SSR_HYDRATION_ID_PREFIX
39
40
  });
40
41
  const ROUTE_MANIFEST = "_MODERNJS_ROUTE_MANIFEST";
41
42
  const ROUTE_MODULES = "_routeModules";
@@ -49,6 +50,7 @@ const SERVER_BUNDLE_DIRECTORY = 'bundles';
49
50
  const SERVER_RENDER_FUNCTION_NAME = 'serverRender';
50
51
  const SERVER_PLUGIN_BFF = '@modern-js/plugin-bff';
51
52
  const SERVER_PLUGIN_POLYFILL = '@modern-js/plugin-polyfill';
53
+ const SSR_HYDRATION_ID_PREFIX = 'modern-js-';
52
54
  exports.DEFAULT_ENTRY_NAME = __webpack_exports__.DEFAULT_ENTRY_NAME;
53
55
  exports.HTML_CHUNKSMAP_SEPARATOR = __webpack_exports__.HTML_CHUNKSMAP_SEPARATOR;
54
56
  exports.LOADER_REPORTER_NAME = __webpack_exports__.LOADER_REPORTER_NAME;
@@ -61,6 +63,7 @@ exports.SERVER_BUNDLE_DIRECTORY = __webpack_exports__.SERVER_BUNDLE_DIRECTORY;
61
63
  exports.SERVER_PLUGIN_BFF = __webpack_exports__.SERVER_PLUGIN_BFF;
62
64
  exports.SERVER_PLUGIN_POLYFILL = __webpack_exports__.SERVER_PLUGIN_POLYFILL;
63
65
  exports.SERVER_RENDER_FUNCTION_NAME = __webpack_exports__.SERVER_RENDER_FUNCTION_NAME;
66
+ exports.SSR_HYDRATION_ID_PREFIX = __webpack_exports__.SSR_HYDRATION_ID_PREFIX;
64
67
  for(var __rspack_i in __webpack_exports__)if (-1 === [
65
68
  "DEFAULT_ENTRY_NAME",
66
69
  "HTML_CHUNKSMAP_SEPARATOR",
@@ -73,7 +76,8 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
73
76
  "SERVER_BUNDLE_DIRECTORY",
74
77
  "SERVER_PLUGIN_BFF",
75
78
  "SERVER_PLUGIN_POLYFILL",
76
- "SERVER_RENDER_FUNCTION_NAME"
79
+ "SERVER_RENDER_FUNCTION_NAME",
80
+ "SSR_HYDRATION_ID_PREFIX"
77
81
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
78
82
  Object.defineProperty(exports, '__esModule', {
79
83
  value: true
@@ -1,4 +1,4 @@
1
- /*! For license information please see index.js.LICENSE.txt */
1
+ /*! LICENSE: index.js.LICENSE.txt */
2
2
  (()=>{
3
3
  var t = {
4
4
  372: (t, e, s)=>{
@@ -1,4 +1,4 @@
1
- /*! For license information please see index.js.LICENSE.txt */
1
+ /*! LICENSE: index.js.LICENSE.txt */
2
2
  (()=>{
3
3
  var t = {
4
4
  6491: (t, e, r)=>{
@@ -1,4 +1,4 @@
1
- /*! For license information please see index.js.LICENSE.txt */
1
+ /*! LICENSE: index.js.LICENSE.txt */
2
2
  (()=>{
3
3
  var i = {
4
4
  823: function(i) {
@@ -1,4 +1,4 @@
1
- /*! For license information please see index.js.LICENSE.txt */
1
+ /*! LICENSE: index.js.LICENSE.txt */
2
2
  (()=>{
3
3
  var e = {
4
4
  933: (e)=>{
@@ -1,4 +1,4 @@
1
- /*! For license information please see index.mjs.LICENSE.txt */
1
+ /*! LICENSE: index.mjs.LICENSE.txt */
2
2
  var e = {};
3
3
  (()=>{
4
4
  e.d = (t, r)=>{
@@ -1 +1 @@
1
- {"name":"lodash","author":"John-David Dalton <john.david.dalton@gmail.com>","version":"4.17.21","license":"MIT"}
1
+ {"name":"lodash-compiled","author":"John-David Dalton <john.david.dalton@gmail.com>","version":"4.17.21","license":"MIT"}
@@ -1,4 +1,4 @@
1
- /*! For license information please see index.js.LICENSE.txt */
1
+ /*! LICENSE: index.js.LICENSE.txt */
2
2
  (()=>{
3
3
  var a = {
4
4
  692: (a, e, i)=>{
@@ -1,4 +1,4 @@
1
- /*! For license information please see index.js.LICENSE.txt */
1
+ /*! LICENSE: index.js.LICENSE.txt */
2
2
  (()=>{
3
3
  var e = {
4
4
  695: (e, t, r)=>{
@@ -1,4 +1,3 @@
1
- import { DEFAULT_ENTRY_NAME, MAIN_ENTRY_NAME, NESTED_ROUTE_SPEC_FILE, ROUTE_SPEC_FILE, SERVER_BUNDLE_DIRECTORY, SERVER_PLUGIN_BFF, SERVER_PLUGIN_POLYFILL, SERVER_RENDER_FUNCTION_NAME } from "../universal/constants.mjs";
2
1
  const JS_EXTENSIONS = [
3
2
  '.js',
4
3
  '.ts',
@@ -26,4 +25,5 @@ const DEFAULT_DEV_HOST = '0.0.0.0';
26
25
  const INTERNAL_RUNTIME_PLUGINS = {
27
26
  '@modern-js/runtime': '@modern-js/runtime/cli'
28
27
  };
29
- export { API_DIR, CONFIG_CACHE_DIR, CONFIG_FILE_EXTENSIONS, DEFAULT_API_PREFIX, DEFAULT_DEV_HOST, DEFAULT_ENTRY_NAME, DEFAULT_RUNTIME_CONFIG, ENTRY_NAME_PATTERN, INTERNAL_RUNTIME_PLUGINS, JS_EXTENSIONS, LOADABLE_STATS_FILE, LOADER_ROUTES_DIR, MAIN_ENTRY_NAME, NESTED_ROUTE_SPEC_FILE, OUTPUT_CONFIG_FILE, ROUTE_MANIFEST_FILE, ROUTE_SPEC_FILE, SERVER_BUNDLE_DIRECTORY, SERVER_DIR, SERVER_PLUGIN_BFF, SERVER_PLUGIN_POLYFILL, SERVER_RENDER_FUNCTION_NAME, SERVER_WORKER_BUNDLE_DIRECTORY, SHARED_DIR };
28
+ export { DEFAULT_ENTRY_NAME, MAIN_ENTRY_NAME, NESTED_ROUTE_SPEC_FILE, ROUTE_SPEC_FILE, SERVER_BUNDLE_DIRECTORY, SERVER_PLUGIN_BFF, SERVER_PLUGIN_POLYFILL, SERVER_RENDER_FUNCTION_NAME } from "../universal/constants.mjs";
29
+ export { API_DIR, CONFIG_CACHE_DIR, CONFIG_FILE_EXTENSIONS, DEFAULT_API_PREFIX, DEFAULT_DEV_HOST, DEFAULT_RUNTIME_CONFIG, ENTRY_NAME_PATTERN, INTERNAL_RUNTIME_PLUGINS, JS_EXTENSIONS, LOADABLE_STATS_FILE, LOADER_ROUTES_DIR, OUTPUT_CONFIG_FILE, ROUTE_MANIFEST_FILE, SERVER_DIR, SERVER_WORKER_BUNDLE_DIRECTORY, SHARED_DIR };
@@ -1,8 +1,8 @@
1
+ export * from "./data.mjs";
2
+ export * from "./config.mjs";
1
3
  import path from "path";
2
4
  import { CONFIG_FILE_EXTENSIONS } from "../constants.mjs";
3
5
  import { findExists } from "../fs.mjs";
4
- export * from "./data.mjs";
5
- export * from "./config.mjs";
6
6
  const getServerConfig = async (appDirectory, configFile)=>{
7
7
  const configFilePath = findExists(CONFIG_FILE_EXTENSIONS.map((extension)=>path.resolve(appDirectory, `${configFile}${extension}`)));
8
8
  return configFilePath;
@@ -1,2 +1 @@
1
- import { createLogger, logger } from "rslog";
2
- export { createLogger, logger };
1
+ export { createLogger, logger } from "rslog";
@@ -1,5 +1,5 @@
1
1
  import { lodash } from "../compiled.mjs";
2
- const { cloneDeep } = lodash;
2
+ const { cloneDeep: cloneDeep } = lodash;
3
3
  function filterRoutesForServer(routes) {
4
4
  const clonedRoutes = cloneDeep(routes);
5
5
  const newRoutes = clonedRoutes.map((route)=>{
@@ -1,8 +1,3 @@
1
- function isVersionAtLeast1819() {
2
- const nodeVersion = process.versions.node;
3
- const versionArr = nodeVersion.split('.').map(Number);
4
- return versionArr[0] > 18 || 18 === versionArr[0] && versionArr[1] >= 19;
5
- }
6
1
  function isVersionAtLeast18() {
7
2
  const nodeVersion = process.versions.node;
8
3
  const versionArr = nodeVersion.split('.').map(Number);
@@ -18,4 +13,4 @@ function isVersionAtLeast20() {
18
13
  const versionArr = nodeVersion.split('.').map(Number);
19
14
  return versionArr[0] >= 20;
20
15
  }
21
- export { isVersionAtLeast18, isVersionAtLeast1819, isVersionAtLeast20, isVersionAtLeast22 };
16
+ export { isVersionAtLeast18, isVersionAtLeast20, isVersionAtLeast22 };
@@ -1,44 +1,8 @@
1
+ import { __webpack_require__ } from "./rslib-runtime.mjs";
1
2
  import { createRequire } from "node:module";
2
3
  import { Import } from "./import.mjs";
3
- import fs_extra from "../compiled/fs-extra/index.js";
4
- import ora from "../compiled/ora/index.js";
5
- import glob from "../compiled/glob/index.js";
6
- import js_yaml from "../compiled/js-yaml/index.mjs";
7
- import chalk from "../compiled/chalk/index.js";
8
- import debug from "../compiled/debug/index.js";
9
- import slash from "../compiled/slash/index.js";
10
- import execa from "../compiled/execa/index.js";
11
- import json5 from "../compiled/json5/index.js";
12
- import upath from "../compiled/upath/index.js";
13
- import pkg_up from "../compiled/pkg-up/index.js";
14
- import { nanoid } from "../compiled/nanoid/index.mjs";
15
- import semver from "../compiled/semver/index.js";
16
- import dotenv from "../compiled/dotenv/index.js";
17
- import lodash from "../compiled/lodash/index.js";
18
- import globby from "../compiled/globby/index.js";
19
- import address from "../compiled/address/index.js";
20
4
  import signale from "../compiled/signale/index.js";
21
- import url_join from "../compiled/url-join/index.js";
22
- import minimist from "../compiled/minimist/index.js";
23
- import fast_glob from "../compiled/fast-glob/index.js";
24
- import filesize from "../compiled/filesize/index.js";
25
- import gzip_size from "../compiled/gzip-size/index.js";
26
- import strip_ansi from "../compiled/strip-ansi/index.js";
27
- import dotenv_expand from "../compiled/dotenv-expand/index.js";
28
- import browserslist from "../compiled/browserslist/index.js";
29
- import { Command, program } from "../compiled/commander/index.mjs";
30
- var __webpack_require__ = {};
31
- (()=>{
32
- __webpack_require__.g = (()=>{
33
- if ('object' == typeof globalThis) return globalThis;
34
- try {
35
- return this || new Function('return this')();
36
- } catch (e) {
37
- if ('object' == typeof window) return window;
38
- }
39
- })();
40
- })();
41
- const { Signale } = signale;
5
+ const { Signale: Signale } = signale;
42
6
  const getNodeRequire = ()=>{
43
7
  if ('object' == typeof __webpack_require__.g && 'function' == typeof __webpack_require__.g.require) return __webpack_require__.g.require;
44
8
  if ('object' == typeof globalThis && 'function' == typeof globalThis.require) return globalThis.require;
@@ -47,4 +11,30 @@ const getNodeRequire = ()=>{
47
11
  const mime = Import.lazy('../compiled/mime-types', getNodeRequire);
48
12
  const chokidar = Import.lazy('../compiled/chokidar', getNodeRequire);
49
13
  const inquirer = Import.lazy('../compiled/inquirer', getNodeRequire);
50
- export { Command, Signale, address, browserslist, chalk, chokidar, debug, dotenv, dotenv_expand as dotenvExpand, execa, fast_glob as fastGlob, filesize, fs_extra as fs, glob, globby, gzip_size as gzipSize, inquirer, json5, lodash, mime, minimist, nanoid, ora, pkg_up as pkgUp, program, semver, signale, slash, strip_ansi as stripAnsi, upath, url_join as urlJoin, js_yaml as yaml };
14
+ export { default as fs } from "../compiled/fs-extra/index.js";
15
+ export { default as ora } from "../compiled/ora/index.js";
16
+ export { default as glob } from "../compiled/glob/index.js";
17
+ export { default as yaml } from "../compiled/js-yaml/index.mjs";
18
+ export { default as chalk } from "../compiled/chalk/index.js";
19
+ export { default as debug } from "../compiled/debug/index.js";
20
+ export { default as slash } from "../compiled/slash/index.js";
21
+ export { default as execa } from "../compiled/execa/index.js";
22
+ export { default as json5 } from "../compiled/json5/index.js";
23
+ export { default as upath } from "../compiled/upath/index.js";
24
+ export { default as pkgUp } from "../compiled/pkg-up/index.js";
25
+ export { nanoid } from "../compiled/nanoid/index.mjs";
26
+ export { default as semver } from "../compiled/semver/index.js";
27
+ export { default as dotenv } from "../compiled/dotenv/index.js";
28
+ export { default as lodash } from "../compiled/lodash/index.js";
29
+ export { default as globby } from "../compiled/globby/index.js";
30
+ export { default as address } from "../compiled/address/index.js";
31
+ export { default as urlJoin } from "../compiled/url-join/index.js";
32
+ export { default as minimist } from "../compiled/minimist/index.js";
33
+ export { default as fastGlob } from "../compiled/fast-glob/index.js";
34
+ export { default as filesize } from "../compiled/filesize/index.js";
35
+ export { default as gzipSize } from "../compiled/gzip-size/index.js";
36
+ export { default as stripAnsi } from "../compiled/strip-ansi/index.js";
37
+ export { default as dotenvExpand } from "../compiled/dotenv-expand/index.js";
38
+ export { default as browserslist } from "../compiled/browserslist/index.js";
39
+ export { Command, program } from "../compiled/commander/index.mjs";
40
+ export { Signale, chokidar, inquirer, mime, signale };
@@ -4,6 +4,6 @@ const lazy = (moduleName, getRequireFn)=>{
4
4
  return importLazyLocal(moduleName);
5
5
  };
6
6
  const Import = {
7
- lazy
7
+ lazy: lazy
8
8
  };
9
9
  export { Import, lazy as lazyImport };
@@ -0,0 +1,26 @@
1
+ var __webpack_module_cache__ = {};
2
+ function __webpack_require__(moduleId) {
3
+ var cachedModule = __webpack_module_cache__[moduleId];
4
+ if (void 0 !== cachedModule) return cachedModule.exports;
5
+ var module = __webpack_module_cache__[moduleId] = {
6
+ exports: {}
7
+ };
8
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
9
+ return module.exports;
10
+ }
11
+ (()=>{
12
+ __webpack_require__.add = function(modules) {
13
+ Object.assign(__webpack_require__.m, modules);
14
+ };
15
+ })();
16
+ (()=>{
17
+ __webpack_require__.g = (()=>{
18
+ if ('object' == typeof globalThis) return globalThis;
19
+ try {
20
+ return this || new Function('return this')();
21
+ } catch (e) {
22
+ if ('object' == typeof window) return window;
23
+ }
24
+ })();
25
+ })();
26
+ export { __webpack_require__ };
@@ -10,4 +10,5 @@ const SERVER_BUNDLE_DIRECTORY = 'bundles';
10
10
  const SERVER_RENDER_FUNCTION_NAME = 'serverRender';
11
11
  const SERVER_PLUGIN_BFF = '@modern-js/plugin-bff';
12
12
  const SERVER_PLUGIN_POLYFILL = '@modern-js/plugin-polyfill';
13
- export { DEFAULT_ENTRY_NAME, HTML_CHUNKSMAP_SEPARATOR, LOADER_REPORTER_NAME, MAIN_ENTRY_NAME, NESTED_ROUTE_SPEC_FILE, ROUTE_MANIFEST, ROUTE_MODULES, ROUTE_SPEC_FILE, SERVER_BUNDLE_DIRECTORY, SERVER_PLUGIN_BFF, SERVER_PLUGIN_POLYFILL, SERVER_RENDER_FUNCTION_NAME };
13
+ const SSR_HYDRATION_ID_PREFIX = 'modern-js-';
14
+ export { DEFAULT_ENTRY_NAME, HTML_CHUNKSMAP_SEPARATOR, LOADER_REPORTER_NAME, MAIN_ENTRY_NAME, NESTED_ROUTE_SPEC_FILE, ROUTE_MANIFEST, ROUTE_MODULES, ROUTE_SPEC_FILE, SERVER_BUNDLE_DIRECTORY, SERVER_PLUGIN_BFF, SERVER_PLUGIN_POLYFILL, SERVER_RENDER_FUNCTION_NAME, SSR_HYDRATION_ID_PREFIX };
@@ -1,2 +1 @@
1
- import { cutNameByHyphen } from "./path.mjs";
2
- export { cutNameByHyphen };
1
+ export { cutNameByHyphen } from "./path.mjs";
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- import { DEFAULT_ENTRY_NAME, MAIN_ENTRY_NAME, NESTED_ROUTE_SPEC_FILE, ROUTE_SPEC_FILE, SERVER_BUNDLE_DIRECTORY, SERVER_PLUGIN_BFF, SERVER_PLUGIN_POLYFILL, SERVER_RENDER_FUNCTION_NAME } from "../universal/constants.mjs";
3
2
  const JS_EXTENSIONS = [
4
3
  '.js',
5
4
  '.ts',
@@ -27,4 +26,5 @@ const DEFAULT_DEV_HOST = '0.0.0.0';
27
26
  const INTERNAL_RUNTIME_PLUGINS = {
28
27
  '@modern-js/runtime': '@modern-js/runtime/cli'
29
28
  };
30
- export { API_DIR, CONFIG_CACHE_DIR, CONFIG_FILE_EXTENSIONS, DEFAULT_API_PREFIX, DEFAULT_DEV_HOST, DEFAULT_ENTRY_NAME, DEFAULT_RUNTIME_CONFIG, ENTRY_NAME_PATTERN, INTERNAL_RUNTIME_PLUGINS, JS_EXTENSIONS, LOADABLE_STATS_FILE, LOADER_ROUTES_DIR, MAIN_ENTRY_NAME, NESTED_ROUTE_SPEC_FILE, OUTPUT_CONFIG_FILE, ROUTE_MANIFEST_FILE, ROUTE_SPEC_FILE, SERVER_BUNDLE_DIRECTORY, SERVER_DIR, SERVER_PLUGIN_BFF, SERVER_PLUGIN_POLYFILL, SERVER_RENDER_FUNCTION_NAME, SERVER_WORKER_BUNDLE_DIRECTORY, SHARED_DIR };
29
+ export { DEFAULT_ENTRY_NAME, MAIN_ENTRY_NAME, NESTED_ROUTE_SPEC_FILE, ROUTE_SPEC_FILE, SERVER_BUNDLE_DIRECTORY, SERVER_PLUGIN_BFF, SERVER_PLUGIN_POLYFILL, SERVER_RENDER_FUNCTION_NAME } from "../universal/constants.mjs";
30
+ export { API_DIR, CONFIG_CACHE_DIR, CONFIG_FILE_EXTENSIONS, DEFAULT_API_PREFIX, DEFAULT_DEV_HOST, DEFAULT_RUNTIME_CONFIG, ENTRY_NAME_PATTERN, INTERNAL_RUNTIME_PLUGINS, JS_EXTENSIONS, LOADABLE_STATS_FILE, LOADER_ROUTES_DIR, OUTPUT_CONFIG_FILE, ROUTE_MANIFEST_FILE, SERVER_DIR, SERVER_WORKER_BUNDLE_DIRECTORY, SHARED_DIR };
@@ -1,9 +1,9 @@
1
1
  import "node:module";
2
+ export * from "./data.mjs";
3
+ export * from "./config.mjs";
2
4
  import path from "path";
3
5
  import { CONFIG_FILE_EXTENSIONS } from "../constants.mjs";
4
6
  import { findExists } from "../fs.mjs";
5
- export * from "./data.mjs";
6
- export * from "./config.mjs";
7
7
  const getServerConfig = async (appDirectory, configFile)=>{
8
8
  const configFilePath = findExists(CONFIG_FILE_EXTENSIONS.map((extension)=>path.resolve(appDirectory, `${configFile}${extension}`)));
9
9
  return configFilePath;
@@ -1,3 +1,2 @@
1
1
  import "node:module";
2
- import { createLogger, logger } from "rslog";
3
- export { createLogger, logger };
2
+ export { createLogger, logger } from "rslog";
@@ -1,6 +1,6 @@
1
1
  import "node:module";
2
2
  import { lodash } from "../compiled.mjs";
3
- const { cloneDeep } = lodash;
3
+ const { cloneDeep: cloneDeep } = lodash;
4
4
  function filterRoutesForServer(routes) {
5
5
  const clonedRoutes = cloneDeep(routes);
6
6
  const newRoutes = clonedRoutes.map((route)=>{
@@ -1,9 +1,4 @@
1
1
  import "node:module";
2
- function isVersionAtLeast1819() {
3
- const nodeVersion = process.versions.node;
4
- const versionArr = nodeVersion.split('.').map(Number);
5
- return versionArr[0] > 18 || 18 === versionArr[0] && versionArr[1] >= 19;
6
- }
7
2
  function isVersionAtLeast18() {
8
3
  const nodeVersion = process.versions.node;
9
4
  const versionArr = nodeVersion.split('.').map(Number);
@@ -19,4 +14,4 @@ function isVersionAtLeast20() {
19
14
  const versionArr = nodeVersion.split('.').map(Number);
20
15
  return versionArr[0] >= 20;
21
16
  }
22
- export { isVersionAtLeast18, isVersionAtLeast1819, isVersionAtLeast20, isVersionAtLeast22 };
17
+ export { isVersionAtLeast18, isVersionAtLeast20, isVersionAtLeast22 };
@@ -1,34 +1,8 @@
1
1
  import "node:module";
2
2
  import { createRequire } from "node:module";
3
3
  import { Import } from "./import.mjs";
4
- import fs_extra from "../compiled/fs-extra/index.js";
5
- import ora from "../compiled/ora/index.js";
6
- import glob from "../compiled/glob/index.js";
7
- import js_yaml from "../compiled/js-yaml/index.mjs";
8
- import chalk from "../compiled/chalk/index.js";
9
- import debug from "../compiled/debug/index.js";
10
- import slash from "../compiled/slash/index.js";
11
- import execa from "../compiled/execa/index.js";
12
- import json5 from "../compiled/json5/index.js";
13
- import upath from "../compiled/upath/index.js";
14
- import pkg_up from "../compiled/pkg-up/index.js";
15
- import { nanoid } from "../compiled/nanoid/index.mjs";
16
- import semver from "../compiled/semver/index.js";
17
- import dotenv from "../compiled/dotenv/index.js";
18
- import lodash from "../compiled/lodash/index.js";
19
- import globby from "../compiled/globby/index.js";
20
- import address from "../compiled/address/index.js";
21
4
  import signale from "../compiled/signale/index.js";
22
- import url_join from "../compiled/url-join/index.js";
23
- import minimist from "../compiled/minimist/index.js";
24
- import fast_glob from "../compiled/fast-glob/index.js";
25
- import filesize from "../compiled/filesize/index.js";
26
- import gzip_size from "../compiled/gzip-size/index.js";
27
- import strip_ansi from "../compiled/strip-ansi/index.js";
28
- import dotenv_expand from "../compiled/dotenv-expand/index.js";
29
- import browserslist from "../compiled/browserslist/index.js";
30
- import { Command, program } from "../compiled/commander/index.mjs";
31
- const { Signale } = signale;
5
+ const { Signale: Signale } = signale;
32
6
  const getNodeRequire = ()=>{
33
7
  if ('object' == typeof global && 'function' == typeof global.require) return global.require;
34
8
  if ('object' == typeof globalThis && 'function' == typeof globalThis.require) return globalThis.require;
@@ -37,4 +11,30 @@ const getNodeRequire = ()=>{
37
11
  const mime = Import.lazy('../compiled/mime-types', getNodeRequire);
38
12
  const chokidar = Import.lazy('../compiled/chokidar', getNodeRequire);
39
13
  const inquirer = Import.lazy('../compiled/inquirer', getNodeRequire);
40
- export { Command, Signale, address, browserslist, chalk, chokidar, debug, dotenv, dotenv_expand as dotenvExpand, execa, fast_glob as fastGlob, filesize, fs_extra as fs, glob, globby, gzip_size as gzipSize, inquirer, json5, lodash, mime, minimist, nanoid, ora, pkg_up as pkgUp, program, semver, signale, slash, strip_ansi as stripAnsi, upath, url_join as urlJoin, js_yaml as yaml };
14
+ export { default as fs } from "../compiled/fs-extra/index.js";
15
+ export { default as ora } from "../compiled/ora/index.js";
16
+ export { default as glob } from "../compiled/glob/index.js";
17
+ export { default as yaml } from "../compiled/js-yaml/index.mjs";
18
+ export { default as chalk } from "../compiled/chalk/index.js";
19
+ export { default as debug } from "../compiled/debug/index.js";
20
+ export { default as slash } from "../compiled/slash/index.js";
21
+ export { default as execa } from "../compiled/execa/index.js";
22
+ export { default as json5 } from "../compiled/json5/index.js";
23
+ export { default as upath } from "../compiled/upath/index.js";
24
+ export { default as pkgUp } from "../compiled/pkg-up/index.js";
25
+ export { nanoid } from "../compiled/nanoid/index.mjs";
26
+ export { default as semver } from "../compiled/semver/index.js";
27
+ export { default as dotenv } from "../compiled/dotenv/index.js";
28
+ export { default as lodash } from "../compiled/lodash/index.js";
29
+ export { default as globby } from "../compiled/globby/index.js";
30
+ export { default as address } from "../compiled/address/index.js";
31
+ export { default as urlJoin } from "../compiled/url-join/index.js";
32
+ export { default as minimist } from "../compiled/minimist/index.js";
33
+ export { default as fastGlob } from "../compiled/fast-glob/index.js";
34
+ export { default as filesize } from "../compiled/filesize/index.js";
35
+ export { default as gzipSize } from "../compiled/gzip-size/index.js";
36
+ export { default as stripAnsi } from "../compiled/strip-ansi/index.js";
37
+ export { default as dotenvExpand } from "../compiled/dotenv-expand/index.js";
38
+ export { default as browserslist } from "../compiled/browserslist/index.js";
39
+ export { Command, program } from "../compiled/commander/index.mjs";
40
+ export { Signale, chokidar, inquirer, mime, signale };
@@ -5,6 +5,6 @@ const lazy = (moduleName, getRequireFn)=>{
5
5
  return importLazyLocal(moduleName);
6
6
  };
7
7
  const Import = {
8
- lazy
8
+ lazy: lazy
9
9
  };
10
10
  export { Import, lazy as lazyImport };
@@ -11,4 +11,5 @@ const SERVER_BUNDLE_DIRECTORY = 'bundles';
11
11
  const SERVER_RENDER_FUNCTION_NAME = 'serverRender';
12
12
  const SERVER_PLUGIN_BFF = '@modern-js/plugin-bff';
13
13
  const SERVER_PLUGIN_POLYFILL = '@modern-js/plugin-polyfill';
14
- export { DEFAULT_ENTRY_NAME, HTML_CHUNKSMAP_SEPARATOR, LOADER_REPORTER_NAME, MAIN_ENTRY_NAME, NESTED_ROUTE_SPEC_FILE, ROUTE_MANIFEST, ROUTE_MODULES, ROUTE_SPEC_FILE, SERVER_BUNDLE_DIRECTORY, SERVER_PLUGIN_BFF, SERVER_PLUGIN_POLYFILL, SERVER_RENDER_FUNCTION_NAME };
14
+ const SSR_HYDRATION_ID_PREFIX = 'modern-js-';
15
+ export { DEFAULT_ENTRY_NAME, HTML_CHUNKSMAP_SEPARATOR, LOADER_REPORTER_NAME, MAIN_ENTRY_NAME, NESTED_ROUTE_SPEC_FILE, ROUTE_MANIFEST, ROUTE_MODULES, ROUTE_SPEC_FILE, SERVER_BUNDLE_DIRECTORY, SERVER_PLUGIN_BFF, SERVER_PLUGIN_POLYFILL, SERVER_RENDER_FUNCTION_NAME, SSR_HYDRATION_ID_PREFIX };
@@ -1,3 +1,2 @@
1
1
  import "node:module";
2
- import { cutNameByHyphen } from "./path.mjs";
3
- export { cutNameByHyphen };
2
+ export { cutNameByHyphen } from "./path.mjs";
@@ -1,4 +1,3 @@
1
- export declare function isVersionAtLeast1819(): boolean;
2
1
  export declare function isVersionAtLeast18(): boolean;
3
2
  export declare function isVersionAtLeast22(): boolean;
4
3
  export declare function isVersionAtLeast20(): boolean;
@@ -40,3 +40,8 @@ export declare const SERVER_BUNDLE_DIRECTORY = "bundles";
40
40
  export declare const SERVER_RENDER_FUNCTION_NAME = "serverRender";
41
41
  export declare const SERVER_PLUGIN_BFF = "@modern-js/plugin-bff";
42
42
  export declare const SERVER_PLUGIN_POLYFILL = "@modern-js/plugin-polyfill";
43
+ /**
44
+ * React useId identifier prefix for SSR hydration consistency
45
+ * Ensures server and client generate the same ID prefixes
46
+ */
47
+ export declare const SSR_HYDRATION_ID_PREFIX = "modern-js-";
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.0.5",
18
+ "version": "3.1.1",
19
19
  "types": "./dist/types/index.d.ts",
20
20
  "main": "./dist/cjs/index.js",
21
21
  "module": "./dist/esm/index.mjs",
@@ -142,12 +142,12 @@
142
142
  "rslog": "^1.3.2"
143
143
  },
144
144
  "devDependencies": {
145
- "@rslib/core": "0.19.6",
145
+ "@rslib/core": "0.20.0",
146
146
  "@types/node": "^20",
147
- "happy-dom": "^20.7.0",
147
+ "happy-dom": "^20.8.4",
148
148
  "typescript": "^5",
149
149
  "@modern-js/rslib": "2.68.10",
150
- "@modern-js/types": "3.0.5",
150
+ "@modern-js/types": "3.1.1",
151
151
  "@scripts/rstest-config": "2.66.0"
152
152
  },
153
153
  "peerDependencies": {
File without changes