@putout/engine-runner 17.2.0 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const traverse = require('@babel/traverse').default;
3
+ const {traverse} = require('@putout/babel');
4
4
  const once = require('once');
5
5
  const debug = require('debug')('putout:runner:find');
6
6
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const traverse = require('@babel/traverse').default;
3
+ const {traverse} = require('@putout/babel');
4
4
  const {generate} = require('@putout/engine-parser');
5
5
 
6
6
  const runFix = require('./run-fix');
@@ -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
- const node = template.ast.fresh(toStr);
182
-
183
- return node;
183
+ return template.ast.fresh(toStr);
184
184
  }
185
185
 
186
186
  function validateMatchProperty(match) {
@@ -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
- const result = values(map).map(notRemoved);
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/traverse').default;
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": "17.2.0",
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/traverse": "^7.12.7",
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": "^18.0.0",
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",
@@ -57,6 +56,9 @@
57
56
  "putout": "*",
58
57
  "supertape": "^8.0.0"
59
58
  },
59
+ "peerDependencies": {
60
+ "putout": "*"
61
+ },
60
62
  "license": "MIT",
61
63
  "engines": {
62
64
  "node": ">=16"