@putout/engine-runner 23.0.6 → 23.1.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 CHANGED
@@ -496,7 +496,7 @@ const places = runPlugins({
496
496
  ast,
497
497
  shebang: false, // default
498
498
  fix: false, // default
499
- fixCount: 0, // default
499
+ fixCount: 1, // default
500
500
  plugins,
501
501
  parser: 'babel', // default
502
502
  });
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const {traverse} = require('@putout/babel');
3
+ const {traverse: defaultTraverse} = require('@putout/babel');
4
4
  const once = require('once');
5
5
  const debug = require('debug')('putout:runner:find');
6
6
 
@@ -18,7 +18,7 @@ const {getPath, getPosition} = require('./get-position');
18
18
 
19
19
  const isRemoved = (a) => a?.removed;
20
20
 
21
- module.exports.runPlugins = ({ast, shebang, fix, fixCount, plugins, progress = createProgress()}) => {
21
+ module.exports.runPlugins = ({ast, shebang, fix, fixCount = 1, plugins, progress = createProgress(), traverse = defaultTraverse}) => {
22
22
  let places = [];
23
23
 
24
24
  const merge = once(mergeVisitors);
@@ -38,6 +38,7 @@ module.exports.runPlugins = ({ast, shebang, fix, fixCount, plugins, progress = c
38
38
  pluginsTraverse,
39
39
  merge,
40
40
  template,
41
+ traverse,
41
42
  });
42
43
 
43
44
  progress.reset();
@@ -53,7 +54,7 @@ module.exports.runPlugins = ({ast, shebang, fix, fixCount, plugins, progress = c
53
54
 
54
55
  module.exports.getPosition = getPosition;
55
56
 
56
- const run = ({ast, fix, shebang, pluginsFind, pluginsTraverse, template, merge}) => [
57
+ const run = ({ast, fix, shebang, pluginsFind, pluginsTraverse, template, merge, traverse}) => [
57
58
  ...runWithoutMerge({
58
59
  ast,
59
60
  fix,
@@ -68,10 +69,11 @@ const run = ({ast, fix, shebang, pluginsFind, pluginsTraverse, template, merge})
68
69
  template,
69
70
  pluginsTraverse,
70
71
  merge,
72
+ traverse,
71
73
  }),
72
74
  ];
73
75
 
74
- function runWithMerge({ast, fix, shebang, template, pluginsTraverse, merge}) {
76
+ function runWithMerge({ast, fix, shebang, template, pluginsTraverse, merge, traverse}) {
75
77
  const {entries, visitor} = merge(pluginsTraverse, {
76
78
  fix,
77
79
  shebang,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/engine-runner",
3
- "version": "23.0.6",
3
+ "version": "23.1.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Run 🐊Putout plugins",
@@ -49,14 +49,14 @@
49
49
  "putout-engine"
50
50
  ],
51
51
  "devDependencies": {
52
+ "@putout/engine-loader": "*",
52
53
  "@putout/eslint-flat": "^2.0.0",
53
54
  "@putout/plugin-minify": "*",
54
55
  "c8": "^10.0.0",
55
56
  "eslint": "^9.0.0",
56
57
  "eslint-plugin-n": "^17.0.0",
57
- "eslint-plugin-putout": "^24.0.0",
58
+ "eslint-plugin-putout": "^25.0.1",
58
59
  "just-camel-case": "^6.2.0",
59
- "lerna": "^6.0.1",
60
60
  "madrun": "^10.0.0",
61
61
  "mock-require": "^3.0.3",
62
62
  "montag": "^1.0.0",