putout 35.35.7 → 35.35.8

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,14 @@
1
+ 2024.06.25, v35.35.8
2
+
3
+ feature:
4
+ - c999629ba putout: @putout/plugin-remove-useless-return v7.0.0
5
+ - 08198fb04 @putotu/plugin-remove-useless-return: drop support of 🐊 < 35'
6
+ - eaaef62ed @putout/plugin-remove-useless-return: not argument
7
+ - 74819bb59 putout: kill when hang after --inspect
8
+ - 34b1b4c73 @putout/plugin-putout: check-replace-code: split more
9
+ - 4e4f39572 @putout/plugin-putout: check-replace-code: split
10
+ - d675e3d21 @putout/plugin-putout: check-replace-code: esm
11
+
1
12
  2024.06.24, v35.35.7
2
13
 
3
14
  fix:
@@ -0,0 +1,17 @@
1
+ import chalk from 'chalk';
2
+
3
+ export const onDebuggerExit = ({log, process, inspector}) => {
4
+ const {pid} = process;
5
+
6
+ process.once('exit', (code) => {
7
+ if (code !== 1)
8
+ return;
9
+
10
+ if (!inspector.url())
11
+ return;
12
+
13
+ inspector.close();
14
+ log(chalk.bgBlueBright(`node --inspect: 'kill ${pid}'`));
15
+ process.kill(pid);
16
+ });
17
+ };
package/bin/putout.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import process from 'node:process';
4
+ import inspector from 'node:inspector';
4
5
  import {readFile, writeFile} from 'node:fs/promises';
5
6
  import {subscribe} from '@putout/engine-reporter/subscribe';
6
7
  import {createTrace} from './trace.mjs';
@@ -10,11 +11,18 @@ import {createCommunication} from './communication.mjs';
10
11
  import cli from '../lib/cli/index.js';
11
12
  import {parseArgs} from '../lib/cli/parse-args.js';
12
13
  import {createExit} from '../lib/cli/exit.mjs';
14
+ import {onDebuggerExit} from './debuger-exit.mjs';
13
15
 
14
16
  const halt = process.exit;
15
17
  const logError = console.error;
16
18
  const {log} = console;
17
19
 
20
+ onDebuggerExit({
21
+ log,
22
+ process,
23
+ inspector,
24
+ });
25
+
18
26
  const {
19
27
  worker,
20
28
  workerData,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "putout",
3
- "version": "35.35.7",
3
+ "version": "35.35.8",
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",
@@ -166,7 +166,7 @@
166
166
  "@putout/plugin-remove-useless-map": "^1.0.0",
167
167
  "@putout/plugin-remove-useless-operand": "^2.0.0",
168
168
  "@putout/plugin-remove-useless-replace": "^1.0.1",
169
- "@putout/plugin-remove-useless-return": "^6.0.0",
169
+ "@putout/plugin-remove-useless-return": "^7.0.0",
170
170
  "@putout/plugin-remove-useless-spread": "^11.0.0",
171
171
  "@putout/plugin-remove-useless-template-expressions": "^2.0.0",
172
172
  "@putout/plugin-remove-useless-variables": "^11.0.0",