@modern-js/utils 3.1.0 → 3.1.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.
@@ -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)=>{
@@ -19714,7 +19714,7 @@
19714
19714
  },
19715
19715
  6333: (e, t, r)=>{
19716
19716
  var n = r(2781);
19717
- t = e.exports = through;
19717
+ e.exports = through;
19718
19718
  through.through = through;
19719
19719
  function through(e, t, r) {
19720
19720
  e = e || function(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,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,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,44 +1,8 @@
1
1
  import { createRequire } from "node:module";
2
2
  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";
3
+ import { __webpack_require__ } from "./rslib-runtime.mjs";
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,12 @@
1
+ var __webpack_require__ = {};
2
+ (()=>{
3
+ __webpack_require__.g = (()=>{
4
+ if ('object' == typeof globalThis) return globalThis;
5
+ try {
6
+ return this || new Function('return this')();
7
+ } catch (e) {
8
+ if ('object' == typeof window) return window;
9
+ }
10
+ })();
11
+ })();
12
+ export { __webpack_require__ };
@@ -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,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,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 };
@@ -1,3 +1,2 @@
1
1
  import "node:module";
2
- import { cutNameByHyphen } from "./path.mjs";
3
- export { cutNameByHyphen };
2
+ export { cutNameByHyphen } from "./path.mjs";
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.1.0",
18
+ "version": "3.1.2",
19
19
  "types": "./dist/types/index.d.ts",
20
20
  "main": "./dist/cjs/index.js",
21
21
  "module": "./dist/esm/index.mjs",
@@ -142,13 +142,13 @@
142
142
  "rslog": "^1.3.2"
143
143
  },
144
144
  "devDependencies": {
145
- "@rslib/core": "0.19.6",
145
+ "@rslib/core": "0.20.3",
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.1.0",
151
- "@scripts/rstest-config": "2.66.0"
150
+ "@scripts/rstest-config": "2.66.0",
151
+ "@modern-js/types": "3.1.2"
152
152
  },
153
153
  "peerDependencies": {
154
154
  "react": "^19.2.4",
File without changes