@putout/engine-loader 17.0.6 → 17.0.8
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/lib/load/async-loader.js +5 -2
- package/package.json +4 -3
package/lib/load/async-loader.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import process from 'node:process';
|
|
2
2
|
import {join} from 'node:path';
|
|
3
3
|
import {tryToCatch} from 'try-to-catch';
|
|
4
|
+
import nano from 'nano-memoize';
|
|
4
5
|
import {createRequire} from '../module.js';
|
|
5
6
|
import {simpleImport as _simpleImport} from './simple-import.js';
|
|
6
7
|
|
|
8
|
+
const {nanomemoize} = nano;
|
|
9
|
+
|
|
7
10
|
const require = createRequire(import.meta.url);
|
|
8
11
|
|
|
9
12
|
const {assign} = Object;
|
|
@@ -14,7 +17,7 @@ export const createAsyncLoader = (type, overrides = {}) => {
|
|
|
14
17
|
simpleImport = _simpleImport,
|
|
15
18
|
} = overrides;
|
|
16
19
|
|
|
17
|
-
return async (name) => {
|
|
20
|
+
return nanomemoize(async (name) => {
|
|
18
21
|
if (name === 'none')
|
|
19
22
|
return stub();
|
|
20
23
|
|
|
@@ -43,7 +46,7 @@ export const createAsyncLoader = (type, overrides = {}) => {
|
|
|
43
46
|
simpleImport,
|
|
44
47
|
require,
|
|
45
48
|
});
|
|
46
|
-
};
|
|
49
|
+
});
|
|
47
50
|
};
|
|
48
51
|
|
|
49
52
|
async function cleverLoad(names, overrides) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/engine-loader",
|
|
3
|
-
"version": "17.0.
|
|
3
|
+
"version": "17.0.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "load plugins and prepare them to run",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"diff-match-patch": "^1.0.4",
|
|
28
|
+
"nano-memoize": "^3.0.16",
|
|
28
29
|
"try-catch": "^4.0.0",
|
|
29
30
|
"try-to-catch": "^4.0.0"
|
|
30
31
|
},
|
|
@@ -44,14 +45,14 @@
|
|
|
44
45
|
"@putout/plugin-remove-debugger": "*",
|
|
45
46
|
"@putout/processor-javascript": "*",
|
|
46
47
|
"@putout/processor-markdown": "*",
|
|
47
|
-
"@putout/test": "^
|
|
48
|
+
"@putout/test": "^15.0.0",
|
|
48
49
|
"c8": "^10.0.0",
|
|
49
50
|
"eslint": "^10.0.0-alpha.0",
|
|
50
51
|
"eslint-plugin-n": "^17.0.0",
|
|
51
52
|
"eslint-plugin-putout": "^29.0.0",
|
|
52
53
|
"estrace": "^6.0.0",
|
|
53
54
|
"just-camel-case": "^6.2.0",
|
|
54
|
-
"madrun": "^
|
|
55
|
+
"madrun": "^12.0.0",
|
|
55
56
|
"montag": "^1.0.0",
|
|
56
57
|
"nodemon": "^3.0.1",
|
|
57
58
|
"putout": "*",
|