@putout/engine-runner 17.2.1 → 18.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/lib/index.js +1 -1
- package/lib/merge-visitors.js +1 -1
- package/lib/replace/index.js +8 -8
- package/lib/replace/watermark.js +2 -3
- package/lib/store.js +1 -3
- package/lib/super-find.js +1 -2
- package/package.json +3 -4
package/lib/index.js
CHANGED
package/lib/merge-visitors.js
CHANGED
package/lib/replace/index.js
CHANGED
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const {template, print} = require('@putout/engine-parser');
|
|
4
4
|
const {remove, replaceWith} = require('@putout/operate');
|
|
5
|
-
const {
|
|
6
|
-
isExpression,
|
|
7
|
-
isStatement,
|
|
8
|
-
isExpressionStatement,
|
|
9
|
-
} = require('@babel/types');
|
|
5
|
+
const {types} = require('@putout/babel');
|
|
10
6
|
|
|
11
7
|
const {
|
|
12
8
|
compare,
|
|
@@ -19,6 +15,12 @@ const debug = require('debug')('putout:runner:replace');
|
|
|
19
15
|
const maybeArray = require('../maybe-array');
|
|
20
16
|
|
|
21
17
|
const watermark = require('./watermark');
|
|
18
|
+
const {
|
|
19
|
+
isExpression,
|
|
20
|
+
isStatement,
|
|
21
|
+
isExpressionStatement,
|
|
22
|
+
} = types;
|
|
23
|
+
|
|
22
24
|
const PRINT_OPTIONS = {
|
|
23
25
|
printer: ['putout', {
|
|
24
26
|
format: {
|
|
@@ -178,9 +180,7 @@ function parseTo(to, values, path) {
|
|
|
178
180
|
if (!isString(toStr))
|
|
179
181
|
throw Error(`☝️ Looks like you passed 'replace' value with a wrong type. Allowed: 'string', 'node' and 'path'. Received: '${typeof toStr}' with value '${toStr}'.`);
|
|
180
182
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
return node;
|
|
183
|
+
return template.ast.fresh(toStr);
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
function validateMatchProperty(match) {
|
package/lib/replace/watermark.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const {isProgram} = require('@babel/types');
|
|
4
3
|
const wraptile = require('wraptile');
|
|
5
|
-
|
|
6
4
|
const findPath = require('./find-path');
|
|
7
|
-
|
|
5
|
+
const {types} = require('@putout/babel');
|
|
6
|
+
const {isProgram} = types;
|
|
8
7
|
const name = '__putout_runner_replace';
|
|
9
8
|
const hasWatermark = (watermark) => (path) => path.node?.[name]?.has(watermark);
|
|
10
9
|
|
package/lib/store.js
CHANGED
|
@@ -35,9 +35,7 @@ module.exports.upStore = createStore({
|
|
|
35
35
|
|
|
36
36
|
module.exports.upListStore = createStore({
|
|
37
37
|
get(map) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return result;
|
|
38
|
+
return values(map).map(notRemoved);
|
|
41
39
|
},
|
|
42
40
|
set(map, name, data) {
|
|
43
41
|
map[name] = map[name] || new Set();
|
package/lib/super-find.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const babelTraverse = require('@babel
|
|
4
|
-
const {types} = require('@babel/types');
|
|
3
|
+
const {traverse: babelTraverse, types} = require('@putout/babel');
|
|
5
4
|
|
|
6
5
|
const {generate} = require('@putout/engine-parser');
|
|
7
6
|
const {merge} = babelTraverse.visitors;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/engine-runner",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Run 🐊Putout plugins",
|
|
@@ -24,8 +24,7 @@
|
|
|
24
24
|
"report": "madrun report"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@babel
|
|
28
|
-
"@babel/types": "^7.12.7",
|
|
27
|
+
"@putout/babel": "^1.0.5",
|
|
29
28
|
"@putout/compare": "^11.0.0",
|
|
30
29
|
"@putout/engine-parser": "^7.0.0",
|
|
31
30
|
"@putout/operate": "^9.0.0",
|
|
@@ -47,7 +46,7 @@
|
|
|
47
46
|
"c8": "^8.0.0",
|
|
48
47
|
"eslint": "^8.0.1",
|
|
49
48
|
"eslint-plugin-n": "^16.0.0",
|
|
50
|
-
"eslint-plugin-putout": "^
|
|
49
|
+
"eslint-plugin-putout": "^19.0.0",
|
|
51
50
|
"just-camel-case": "^4.0.2",
|
|
52
51
|
"lerna": "^6.0.1",
|
|
53
52
|
"madrun": "^9.0.0",
|