@bleedingdev/modern-js-utils 3.5.0-ultramodern.98 → 3.8.1-ultramodern.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.
- package/dist/cjs/cli/common.js +2 -4
- package/dist/cjs/cli/modulePath.js +12 -3
- package/dist/cjs/universal/index.js +15 -5
- package/dist/cjs/universal/wait.js +42 -0
- package/dist/esm/cli/common.mjs +2 -4
- package/dist/esm/cli/modulePath.mjs +12 -3
- package/dist/esm/universal/index.mjs +1 -0
- package/dist/esm/universal/wait.mjs +4 -0
- package/dist/esm-node/cli/common.mjs +2 -4
- package/dist/esm-node/cli/modulePath.mjs +12 -3
- package/dist/esm-node/universal/index.mjs +1 -0
- package/dist/esm-node/universal/wait.mjs +5 -0
- package/dist/types/cli/common.d.ts +1 -1
- package/dist/types/universal/index.d.ts +2 -1
- package/dist/types/universal/wait.d.ts +1 -0
- package/package.json +5 -5
package/dist/cjs/cli/common.js
CHANGED
|
@@ -39,17 +39,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
39
39
|
__webpack_require__.d(__webpack_exports__, {
|
|
40
40
|
clearConsole: ()=>clearConsole,
|
|
41
41
|
createDebugger: ()=>createDebugger,
|
|
42
|
-
wait: ()=>wait
|
|
42
|
+
wait: ()=>wait_js_namespaceObject.wait
|
|
43
43
|
});
|
|
44
44
|
const index_js_namespaceObject = require("../../compiled/debug/index.js");
|
|
45
45
|
var index_js_default = /*#__PURE__*/ __webpack_require__.n(index_js_namespaceObject);
|
|
46
|
+
const wait_js_namespaceObject = require("../universal/wait.js");
|
|
46
47
|
const createDebugger = (scope)=>index_js_default()(`modern-js:${scope}`);
|
|
47
48
|
const clearConsole = ()=>{
|
|
48
49
|
if (process.stdout.isTTY && !process.env.DEBUG) process.stdout.write('\x1B[H\x1B[2J');
|
|
49
50
|
};
|
|
50
|
-
const wait = (time = 0)=>new Promise((resolve)=>{
|
|
51
|
-
setTimeout(resolve, time);
|
|
52
|
-
});
|
|
53
51
|
exports.clearConsole = __webpack_exports__.clearConsole;
|
|
54
52
|
exports.createDebugger = __webpack_exports__.createDebugger;
|
|
55
53
|
exports.wait = __webpack_exports__.wait;
|
|
@@ -48,7 +48,13 @@ const external_node_path_namespaceObject = require("node:path");
|
|
|
48
48
|
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
49
49
|
const SOURCE_EXTENSIONS = [
|
|
50
50
|
'.ts',
|
|
51
|
-
'.
|
|
51
|
+
'.tsx',
|
|
52
|
+
'.js',
|
|
53
|
+
'.jsx'
|
|
54
|
+
];
|
|
55
|
+
const TS_EXTENSIONS = [
|
|
56
|
+
'.ts',
|
|
57
|
+
'.tsx'
|
|
52
58
|
];
|
|
53
59
|
const JS_LIKE_EXTENSION_RE = /\.(?:c|m)?js$/;
|
|
54
60
|
const isFile = (filepath)=>external_node_fs_default().existsSync(filepath) && external_node_fs_default().statSync(filepath).isFile();
|
|
@@ -57,8 +63,11 @@ const findSourceEntry = (resolvedPath)=>{
|
|
|
57
63
|
if (ext) {
|
|
58
64
|
if (isFile(resolvedPath)) return resolvedPath;
|
|
59
65
|
if (JS_LIKE_EXTENSION_RE.test(resolvedPath)) {
|
|
60
|
-
const
|
|
61
|
-
|
|
66
|
+
const withoutExt = resolvedPath.slice(0, -ext.length);
|
|
67
|
+
for (const candidateExt of TS_EXTENSIONS){
|
|
68
|
+
const tsPath = `${withoutExt}${candidateExt}`;
|
|
69
|
+
if (isFile(tsPath)) return tsPath;
|
|
70
|
+
}
|
|
62
71
|
}
|
|
63
72
|
return;
|
|
64
73
|
}
|
|
@@ -8,6 +8,9 @@ var __webpack_modules__ = {
|
|
|
8
8
|
},
|
|
9
9
|
"./surface-resolution" (module) {
|
|
10
10
|
module.exports = require("./surface-resolution/index.js");
|
|
11
|
+
},
|
|
12
|
+
"./wait" (module) {
|
|
13
|
+
module.exports = require("./wait.js");
|
|
11
14
|
}
|
|
12
15
|
};
|
|
13
16
|
var __webpack_module_cache__ = {};
|
|
@@ -64,16 +67,23 @@ var __webpack_exports__ = {};
|
|
|
64
67
|
"default"
|
|
65
68
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_backend_federation_contract__rspack_import_0[__rspack_import_key];
|
|
66
69
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
67
|
-
var
|
|
70
|
+
var _path__rspack_import_1 = __webpack_require__("./path");
|
|
71
|
+
var _surface_resolution__rspack_import_2 = __webpack_require__("./surface-resolution");
|
|
72
|
+
var __rspack_reexport = {};
|
|
73
|
+
for(const __rspack_import_key in _surface_resolution__rspack_import_2)if ([
|
|
74
|
+
"cutNameByHyphen",
|
|
75
|
+
"default"
|
|
76
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_surface_resolution__rspack_import_2[__rspack_import_key];
|
|
77
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
78
|
+
var _wait__rspack_import_3 = __webpack_require__("./wait");
|
|
68
79
|
var __rspack_reexport = {};
|
|
69
|
-
for(const __rspack_import_key in
|
|
80
|
+
for(const __rspack_import_key in _wait__rspack_import_3)if ([
|
|
70
81
|
"cutNameByHyphen",
|
|
71
82
|
"default"
|
|
72
|
-
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>
|
|
83
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_wait__rspack_import_3[__rspack_import_key];
|
|
73
84
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
74
|
-
var _path__rspack_import_2 = __webpack_require__("./path");
|
|
75
85
|
__webpack_require__.d(__webpack_exports__, {
|
|
76
|
-
cutNameByHyphen: ()=>
|
|
86
|
+
cutNameByHyphen: ()=>_path__rspack_import_1.cutNameByHyphen
|
|
77
87
|
});
|
|
78
88
|
})();
|
|
79
89
|
exports.cutNameByHyphen = __webpack_exports__.cutNameByHyphen;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
const wait = (milliseconds = 0)=>new Promise((resolve)=>{
|
|
31
|
+
setTimeout(resolve, milliseconds);
|
|
32
|
+
});
|
|
33
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
34
|
+
wait: wait
|
|
35
|
+
});
|
|
36
|
+
exports.wait = __webpack_exports__.wait;
|
|
37
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
38
|
+
"wait"
|
|
39
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
40
|
+
Object.defineProperty(exports, '__esModule', {
|
|
41
|
+
value: true
|
|
42
|
+
});
|
package/dist/esm/cli/common.mjs
CHANGED
|
@@ -3,7 +3,5 @@ const createDebugger = (scope)=>debug(`modern-js:${scope}`);
|
|
|
3
3
|
const clearConsole = ()=>{
|
|
4
4
|
if (process.stdout.isTTY && !process.env.DEBUG) process.stdout.write('\x1B[H\x1B[2J');
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
});
|
|
9
|
-
export { clearConsole, createDebugger, wait };
|
|
6
|
+
export { wait } from "../universal/wait.mjs";
|
|
7
|
+
export { clearConsole, createDebugger };
|
|
@@ -2,7 +2,13 @@ import node_fs from "node:fs";
|
|
|
2
2
|
import node_path from "node:path";
|
|
3
3
|
const SOURCE_EXTENSIONS = [
|
|
4
4
|
'.ts',
|
|
5
|
-
'.
|
|
5
|
+
'.tsx',
|
|
6
|
+
'.js',
|
|
7
|
+
'.jsx'
|
|
8
|
+
];
|
|
9
|
+
const TS_EXTENSIONS = [
|
|
10
|
+
'.ts',
|
|
11
|
+
'.tsx'
|
|
6
12
|
];
|
|
7
13
|
const JS_LIKE_EXTENSION_RE = /\.(?:c|m)?js$/;
|
|
8
14
|
const isFile = (filepath)=>node_fs.existsSync(filepath) && node_fs.statSync(filepath).isFile();
|
|
@@ -11,8 +17,11 @@ const findSourceEntry = (resolvedPath)=>{
|
|
|
11
17
|
if (ext) {
|
|
12
18
|
if (isFile(resolvedPath)) return resolvedPath;
|
|
13
19
|
if (JS_LIKE_EXTENSION_RE.test(resolvedPath)) {
|
|
14
|
-
const
|
|
15
|
-
|
|
20
|
+
const withoutExt = resolvedPath.slice(0, -ext.length);
|
|
21
|
+
for (const candidateExt of TS_EXTENSIONS){
|
|
22
|
+
const tsPath = `${withoutExt}${candidateExt}`;
|
|
23
|
+
if (isFile(tsPath)) return tsPath;
|
|
24
|
+
}
|
|
16
25
|
}
|
|
17
26
|
return;
|
|
18
27
|
}
|
|
@@ -4,7 +4,5 @@ const createDebugger = (scope)=>debug(`modern-js:${scope}`);
|
|
|
4
4
|
const clearConsole = ()=>{
|
|
5
5
|
if (process.stdout.isTTY && !process.env.DEBUG) process.stdout.write('\x1B[H\x1B[2J');
|
|
6
6
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
10
|
-
export { clearConsole, createDebugger, wait };
|
|
7
|
+
export { wait } from "../universal/wait.mjs";
|
|
8
|
+
export { clearConsole, createDebugger };
|
|
@@ -3,7 +3,13 @@ import node_fs from "node:fs";
|
|
|
3
3
|
import node_path from "node:path";
|
|
4
4
|
const SOURCE_EXTENSIONS = [
|
|
5
5
|
'.ts',
|
|
6
|
-
'.
|
|
6
|
+
'.tsx',
|
|
7
|
+
'.js',
|
|
8
|
+
'.jsx'
|
|
9
|
+
];
|
|
10
|
+
const TS_EXTENSIONS = [
|
|
11
|
+
'.ts',
|
|
12
|
+
'.tsx'
|
|
7
13
|
];
|
|
8
14
|
const JS_LIKE_EXTENSION_RE = /\.(?:c|m)?js$/;
|
|
9
15
|
const isFile = (filepath)=>node_fs.existsSync(filepath) && node_fs.statSync(filepath).isFile();
|
|
@@ -12,8 +18,11 @@ const findSourceEntry = (resolvedPath)=>{
|
|
|
12
18
|
if (ext) {
|
|
13
19
|
if (isFile(resolvedPath)) return resolvedPath;
|
|
14
20
|
if (JS_LIKE_EXTENSION_RE.test(resolvedPath)) {
|
|
15
|
-
const
|
|
16
|
-
|
|
21
|
+
const withoutExt = resolvedPath.slice(0, -ext.length);
|
|
22
|
+
for (const candidateExt of TS_EXTENSIONS){
|
|
23
|
+
const tsPath = `${withoutExt}${candidateExt}`;
|
|
24
|
+
if (isFile(tsPath)) return tsPath;
|
|
25
|
+
}
|
|
17
26
|
}
|
|
18
27
|
return;
|
|
19
28
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import debug from '../../compiled/debug';
|
|
2
|
+
export { wait } from '../universal/wait';
|
|
2
3
|
/**
|
|
3
4
|
* Create debug function with unified namespace prefix.
|
|
4
5
|
* @param scope - Custom module name of your debug function.
|
|
@@ -6,4 +7,3 @@ import debug from '../../compiled/debug';
|
|
|
6
7
|
*/
|
|
7
8
|
export declare const createDebugger: (scope: string) => debug.Debugger;
|
|
8
9
|
export declare const clearConsole: () => void;
|
|
9
|
-
export declare const wait: (time?: number) => Promise<unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const wait: (milliseconds?: number) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.
|
|
20
|
+
"version": "3.8.1-ultramodern.1",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"module": "./dist/esm/index.mjs",
|
|
@@ -187,16 +187,16 @@
|
|
|
187
187
|
"rslog": "^2.1.3"
|
|
188
188
|
},
|
|
189
189
|
"devDependencies": {
|
|
190
|
-
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.
|
|
190
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.8.1-ultramodern.1",
|
|
191
191
|
"@rslib/core": "0.23.2",
|
|
192
192
|
"@scripts/rstest-config": "2.66.0",
|
|
193
|
-
"@types/node": "^26.
|
|
193
|
+
"@types/node": "^26.2.0",
|
|
194
194
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
195
195
|
"happy-dom": "^20.10.6"
|
|
196
196
|
},
|
|
197
197
|
"peerDependencies": {
|
|
198
|
-
"react": "^19.2.
|
|
199
|
-
"react-dom": "^19.2.
|
|
198
|
+
"react": "^19.2.8",
|
|
199
|
+
"react-dom": "^19.2.8"
|
|
200
200
|
},
|
|
201
201
|
"peerDependenciesMeta": {
|
|
202
202
|
"react": {
|