@putout/engine-runner 21.1.0 → 22.0.0
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/README.md +2 -0
- package/lib/include.js +1 -7
- package/lib/merge-visitors.js +4 -1
- package/lib/validate.js +9 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -450,6 +450,8 @@ export const scan = (rootPath, {push, trackFile}) => {
|
|
|
450
450
|
};
|
|
451
451
|
```
|
|
452
452
|
|
|
453
|
+
☝️ *When you use `trackFile` use [`progress()`](https://github.com/coderaiser/putout/tree/master/packages/test#progressfilename-expected) for testing*
|
|
454
|
+
|
|
453
455
|
### Finder
|
|
454
456
|
|
|
455
457
|
**Finder** gives you all the control over traversing, but it's the slowest format.
|
package/lib/include.js
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
const log = require('debug')('putout:runner:include');
|
|
4
4
|
const maybeArray = require('./maybe-array');
|
|
5
|
+
const {validate} = require('./validate');
|
|
5
6
|
|
|
6
|
-
const {stringify} = JSON;
|
|
7
7
|
const stub = () => [];
|
|
8
8
|
const good = () => true;
|
|
9
|
-
const isFn = (a) => typeof a === 'function';
|
|
10
9
|
|
|
11
10
|
module.exports = ({rule, plugin, msg, options}) => {
|
|
12
11
|
const {
|
|
@@ -64,8 +63,3 @@ const getTraverse = (include, filter, rule) => ({push, options}) => {
|
|
|
64
63
|
|
|
65
64
|
return result;
|
|
66
65
|
};
|
|
67
|
-
|
|
68
|
-
function validate(name, fn) {
|
|
69
|
-
if (!isFn(fn))
|
|
70
|
-
throw Error(`☝️ Looks like '${name}' is not a 'function' but '${typeof fn}' with value: '${stringify(fn)}'. More on using Includer: https://git.io/JqcMn`);
|
|
71
|
-
}
|
package/lib/merge-visitors.js
CHANGED
|
@@ -6,6 +6,7 @@ const {generate} = require('@putout/engine-parser');
|
|
|
6
6
|
const runFix = require('./run-fix');
|
|
7
7
|
const {getPosition} = require('./get-position');
|
|
8
8
|
const maybeArray = require('./maybe-array');
|
|
9
|
+
const {validate} = require('./validate');
|
|
9
10
|
|
|
10
11
|
const {
|
|
11
12
|
listStore,
|
|
@@ -23,8 +24,10 @@ const {assign} = Object;
|
|
|
23
24
|
const parse = (name, plugin, options) => {
|
|
24
25
|
const list = [];
|
|
25
26
|
|
|
26
|
-
if (plugin[name])
|
|
27
|
+
if (plugin[name]) {
|
|
28
|
+
validate(name, plugin[name]);
|
|
27
29
|
list.push(...maybeArray(plugin[name]()));
|
|
30
|
+
}
|
|
28
31
|
|
|
29
32
|
if (options[name])
|
|
30
33
|
list.push(...maybeArray(options[name]));
|
package/lib/validate.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const isFn = (a) => typeof a === 'function';
|
|
4
|
+
const {stringify} = JSON;
|
|
5
|
+
|
|
6
|
+
module.exports.validate = (name, fn) => {
|
|
7
|
+
if (!isFn(fn))
|
|
8
|
+
throw Error(`☝️ Looks like '${name}' is not a 'function' but '${typeof fn}' with value: '${stringify(fn)}'. More on using Includer: https://git.io/JqcMn`);
|
|
9
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/engine-runner",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Run 🐊Putout plugins",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"changelog": false,
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "git://github.com/coderaiser/putout.git"
|
|
18
|
+
"url": "git+https://github.com/coderaiser/putout.git"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
21
|
"test": "madrun test",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@putout/babel": "^2.0.0",
|
|
32
32
|
"@putout/compare": "^14.0.0",
|
|
33
|
-
"@putout/engine-parser": "^
|
|
33
|
+
"@putout/engine-parser": "^11.0.0",
|
|
34
34
|
"@putout/operate": "^12.0.0",
|
|
35
35
|
"@putout/operator-declare": "^9.0.0",
|
|
36
36
|
"@putout/operator-filesystem": "^4.0.0",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
],
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@putout/plugin-minify": "*",
|
|
53
|
-
"c8": "^
|
|
53
|
+
"c8": "^10.0.0",
|
|
54
54
|
"eslint": "^9.0.0",
|
|
55
55
|
"eslint-plugin-n": "^17.0.0",
|
|
56
|
-
"eslint-plugin-putout": "^
|
|
57
|
-
"just-camel-case": "^
|
|
56
|
+
"eslint-plugin-putout": "^23.0.0",
|
|
57
|
+
"just-camel-case": "^6.2.0",
|
|
58
58
|
"lerna": "^6.0.1",
|
|
59
59
|
"madrun": "^10.0.0",
|
|
60
60
|
"mock-require": "^3.0.3",
|