putout 41.1.3 → 41.1.4

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/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ 2025.12.30, v41.1.4
2
+
3
+ feature:
4
+ - bc7b89136 putout: cli: migrate to ESM
5
+
1
6
  2025.12.30, v41.1.3
2
7
 
3
8
  fix:
package/bin/putout.mjs CHANGED
@@ -8,7 +8,7 @@ import {createTrace} from './trace.mjs';
8
8
  import {createIsStop} from './is-stop.mjs';
9
9
  import {createWrite} from './write.mjs';
10
10
  import {createCommunication} from './communication.mjs';
11
- import cli from '../lib/cli/index.js';
11
+ import cli from '../lib/cli/index.mjs';
12
12
  import {parseArgs} from '../lib/cli/parse-args.js';
13
13
  import {createExit} from '../lib/cli/exit.mjs';
14
14
  import {onDebuggerExit} from './debugger-exit.mjs';
@@ -1,34 +1,31 @@
1
- 'use strict';
2
-
3
- const process = require('node:process');
4
- const tryToCatch = require('try-to-catch');
5
-
6
- const {isCI: _isCI} = require('ci-info');
7
- const {nanomemoize} = require('nano-memoize');
8
- const tryCatch = require('try-catch');
9
- const wraptile = require('wraptile');
10
- const fullstore = require('fullstore');
11
- const _cliStaged = require('@putout/cli-staged');
12
-
13
- const {
14
- runProcessors: _runProcessors,
15
- getFilePatterns: _getFilePatterns,
16
- getProcessorRunners: _getProcessorRunners,
1
+ import process from 'node:process';
2
+ import {createRequire} from 'node:module';
3
+ import tryToCatch from 'try-to-catch';
4
+ import {isCI as _isCI} from 'ci-info';
5
+ import tryCatch from 'try-catch';
6
+ import wraptile from 'wraptile';
7
+ import fullstore from 'fullstore';
8
+ import nano from 'nano-memoize';
9
+ import * as _cliStaged from '@putout/cli-staged';
10
+ import {initReport as _initReport} from '@putout/engine-reporter/report';
11
+ import {keypress as _keypress} from '@putout/cli-keypress';
12
+ import {getFormatter} from '@putout/engine-reporter/formatter';
13
+ import {
14
+ runProcessors as _runProcessors,
15
+ getFilePatterns as _getFilePatterns,
16
+ getProcessorRunners as _getProcessorRunners,
17
17
  defaultProcessors,
18
- } = require('@putout/engine-processor');
18
+ } from '@putout/engine-processor';
19
+ import supportedFiles from './supported-files.js';
20
+ import _getOptions from './get-options.js';
21
+ import {argvConfig, parseArgs} from './parse-args.js';
22
+ import {getFiles as _getFiles} from './get-files.mjs';
23
+ import {simpleImport as _simpleImport} from './simple-import.js';
24
+ import {run} from './runner/runner.js';
19
25
 
20
- const {initReport: _initReport} = require('@putout/engine-reporter/report');
21
- const {keypress: _keypress} = require('@putout/cli-keypress');
22
-
23
- const supportedFiles = require('./supported-files');
24
- const _getOptions = require('./get-options');
25
- const {argvConfig, parseArgs} = require('./parse-args');
26
-
27
- const {getFiles: _getFiles} = require('./get-files.mjs');
28
- const {version, dependencies} = require('../../package.json');
26
+ const require = createRequire(import.meta.url);
29
27
  const {formatter: defaultFormatter} = require('../../putout.json');
30
- const {simpleImport: _simpleImport} = require('./simple-import');
31
- const {run} = require('./runner/runner.js');
28
+ const {version, dependencies} = require('../../package.json');
32
29
 
33
30
  const {
34
31
  OK,
@@ -46,11 +43,10 @@ const {
46
43
  INTERACTIVE_CANCELED,
47
44
  } = require('./exit-codes');
48
45
 
49
- const noop = () => {};
50
- const {keys} = Object;
46
+ const _getFormatter = nano.nanomemoize(getFormatter);
51
47
  const {isSupported} = supportedFiles;
52
- const _getFormatter = nanomemoize(require('@putout/engine-reporter/formatter').getFormatter);
53
-
48
+ const {keys} = Object;
49
+ const noop = () => {};
54
50
  const cwd = process.cwd();
55
51
  const {env} = process;
56
52
 
@@ -69,7 +65,7 @@ const parseIsStop = (passedIsStop, {keypress}) => {
69
65
  return isStop;
70
66
  };
71
67
 
72
- module.exports = async (overrides = {}) => {
68
+ export default async (overrides = {}) => {
73
69
  const {
74
70
  argv,
75
71
  halt,
@@ -358,7 +354,8 @@ module.exports = async (overrides = {}) => {
358
354
  exit(exitCode);
359
355
  };
360
356
 
361
- module.exports._addOnce = addOnce;
357
+ export const _addOnce = addOnce;
358
+
362
359
  function addOnce(emitter, name, fn) {
363
360
  if (!emitter.listenerCount(name))
364
361
  emitter.on(name, fn);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "putout",
3
- "version": "41.1.3",
3
+ "version": "41.1.4",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊 Pluggable and configurable code transformer with built-in ESLint, Babel and support of js, jsx, typescript, flow, markdown, yaml and json",
@@ -19,7 +19,7 @@
19
19
  "import": "./lib/cli/exit-codes.mjs",
20
20
  "require": "./lib/cli/exit-codes.js"
21
21
  },
22
- "./cli": "./lib/cli/index.js",
22
+ "./cli": "./lib/cli/index.mjs",
23
23
  "./cli/get-options": "./lib/cli/get-options.js",
24
24
  "./package.json": "./package.json",
25
25
  "./putout.json": "./putout.json",