@putout/engine-loader 17.0.8 → 17.0.10
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 +2 -5
- package/package.json +1 -2
- package/lib/load/fixture/putout-plugin-hello.js +0 -1
- package/lib/load/fixture/putout-plugin-world/index.js +0 -1
- package/lib/load/fixture/putout-plugin-world/package.json +0 -4
- package/rules/README.md +0 -3
- package/rules/apply-import-module/fixture/apply-import-module-fix.js +0 -6
- package/rules/apply-import-module/fixture/apply-import-module.js +0 -3
- package/rules/apply-import-module/fixture/as-fix.js +0 -6
- package/rules/apply-import-module/fixture/as.js +0 -5
- package/rules/apply-import-module/fixture/stub.js +0 -4
- package/rules/apply-import-module/fixture/test.js +0 -4
- package/rules/apply-import-module/index.js +0 -32
package/lib/load/async-loader.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
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';
|
|
5
4
|
import {createRequire} from '../module.js';
|
|
6
5
|
import {simpleImport as _simpleImport} from './simple-import.js';
|
|
7
6
|
|
|
8
|
-
const {nanomemoize} = nano;
|
|
9
|
-
|
|
10
7
|
const require = createRequire(import.meta.url);
|
|
11
8
|
|
|
12
9
|
const {assign} = Object;
|
|
@@ -17,7 +14,7 @@ export const createAsyncLoader = (type, overrides = {}) => {
|
|
|
17
14
|
simpleImport = _simpleImport,
|
|
18
15
|
} = overrides;
|
|
19
16
|
|
|
20
|
-
return
|
|
17
|
+
return async (name) => {
|
|
21
18
|
if (name === 'none')
|
|
22
19
|
return stub();
|
|
23
20
|
|
|
@@ -46,7 +43,7 @@ export const createAsyncLoader = (type, overrides = {}) => {
|
|
|
46
43
|
simpleImport,
|
|
47
44
|
require,
|
|
48
45
|
});
|
|
49
|
-
}
|
|
46
|
+
};
|
|
50
47
|
};
|
|
51
48
|
|
|
52
49
|
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.10",
|
|
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,7 +25,6 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"diff-match-patch": "^1.0.4",
|
|
28
|
-
"nano-memoize": "^3.0.16",
|
|
29
28
|
"try-catch": "^4.0.0",
|
|
30
29
|
"try-to-catch": "^4.0.0"
|
|
31
30
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const report = () => 'hello';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports.report = () => 'hello';
|
package/rules/README.md
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {operator} from 'putout';
|
|
2
|
-
|
|
3
|
-
const {compare} = operator;
|
|
4
|
-
|
|
5
|
-
export const report = () => `Use 'import {createRequire}' -> 'import module' for rollup'`;
|
|
6
|
-
|
|
7
|
-
export const match = () => ({
|
|
8
|
-
'import {createRequire} from "node:module"': isTest,
|
|
9
|
-
'const require = createRequire(import.meta.url)': isTest,
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export const replace = () => ({
|
|
13
|
-
'import {createRequire} from "node:module"': `{
|
|
14
|
-
import module from "node:module";
|
|
15
|
-
const {createRequire = returns(noop)} = module;
|
|
16
|
-
}`,
|
|
17
|
-
'import {createRequire as __a} from "node:module"': `{
|
|
18
|
-
import module from "node:module";
|
|
19
|
-
const {createRequire: __a = returns(noop)} = module;
|
|
20
|
-
}`,
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
function isTest(vars, path) {
|
|
24
|
-
const {body} = path.parentPath.node;
|
|
25
|
-
|
|
26
|
-
for (const current of body) {
|
|
27
|
-
if (compare(current, 'import __imports from "supertape"'))
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return true;
|
|
32
|
-
}
|