putout 35.24.1 → 35.25.1
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 +12 -0
- package/bin/tracer.mjs +12 -9
- package/lib/cli/exit.mjs +20 -0
- package/lib/cli/index.js +2 -20
- package/package.json +2 -2
package/ChangeLog
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
2024.05.21, v35.25.1
|
|
2
|
+
|
|
3
|
+
fix:
|
|
4
|
+
- aa613221b putout: show error when syntax errors in config file
|
|
5
|
+
|
|
6
|
+
2024.05.20, v35.25.0
|
|
7
|
+
|
|
8
|
+
feature:
|
|
9
|
+
- 79ca8de10 putout: @putout/plugin-putout v20.0.0
|
|
10
|
+
- fafba2dfe @putout/plugin-putout: add-traverse-args
|
|
11
|
+
- 067414ae0 @putout/plugin-putout: add-args -> add-test-args
|
|
12
|
+
|
|
1
13
|
2024.05.19, v35.24.1
|
|
2
14
|
|
|
3
15
|
feature:
|
package/bin/tracer.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import process from 'node:process';
|
|
4
3
|
import {Worker} from 'node:worker_threads';
|
|
5
|
-
import {
|
|
6
|
-
import {parseArgs} from '../lib/cli/parse-args.js';
|
|
7
|
-
|
|
8
|
-
const {
|
|
4
|
+
import process, {
|
|
9
5
|
cwd,
|
|
10
|
-
exit,
|
|
11
6
|
stdout,
|
|
12
|
-
|
|
7
|
+
exit as halt,
|
|
8
|
+
} from 'node:process';
|
|
9
|
+
|
|
10
|
+
import {subscribe} from '@putout/engine-reporter/subscribe';
|
|
11
|
+
import {parseArgs} from '../lib/cli/parse-args.js';
|
|
12
|
+
import {createExit} from '../lib/cli/exit.mjs';
|
|
13
13
|
|
|
14
14
|
const args = parseArgs(process.argv.slice(2));
|
|
15
15
|
const write = stdout.write.bind(stdout);
|
|
16
16
|
|
|
17
17
|
if (!args.worker) {
|
|
18
18
|
await import('./putout.mjs');
|
|
19
|
-
|
|
19
|
+
halt();
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const slave = new URL('./putout.mjs', import.meta.url);
|
|
@@ -29,9 +29,12 @@ const worker = new Worker(slave, {
|
|
|
29
29
|
subscribe({
|
|
30
30
|
args,
|
|
31
31
|
worker,
|
|
32
|
-
exit,
|
|
33
32
|
cwd,
|
|
34
33
|
write,
|
|
34
|
+
exit: createExit({
|
|
35
|
+
halt,
|
|
36
|
+
logError: console.error,
|
|
37
|
+
}),
|
|
35
38
|
});
|
|
36
39
|
|
|
37
40
|
function dropInteractive(argv) {
|
package/lib/cli/exit.mjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
|
|
3
|
+
const {red} = chalk;
|
|
4
|
+
|
|
5
|
+
export const createExit = ({halt, raw, logError}) => (code, e) => {
|
|
6
|
+
if (!code)
|
|
7
|
+
return halt(0);
|
|
8
|
+
|
|
9
|
+
if (!e)
|
|
10
|
+
return halt(code);
|
|
11
|
+
|
|
12
|
+
const message = raw ? e : red(`🐊 ${e.message || e}`);
|
|
13
|
+
|
|
14
|
+
logError(message);
|
|
15
|
+
halt(code);
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
exited: true,
|
|
19
|
+
};
|
|
20
|
+
};
|
package/lib/cli/index.js
CHANGED
|
@@ -99,10 +99,9 @@ module.exports = async ({argv, halt, log, write, logError, readFile, writeFile,
|
|
|
99
99
|
plugins,
|
|
100
100
|
} = args;
|
|
101
101
|
|
|
102
|
-
const {
|
|
102
|
+
const {createExit} = await simpleImport('./exit.mjs');
|
|
103
103
|
|
|
104
|
-
const exit =
|
|
105
|
-
red,
|
|
104
|
+
const exit = createExit({
|
|
106
105
|
raw,
|
|
107
106
|
halt,
|
|
108
107
|
logError,
|
|
@@ -321,23 +320,6 @@ module.exports = async ({argv, halt, log, write, logError, readFile, writeFile,
|
|
|
321
320
|
exit(exitCode);
|
|
322
321
|
};
|
|
323
322
|
|
|
324
|
-
const getExit = ({red, halt, raw, logError}) => (code, e) => {
|
|
325
|
-
if (!code)
|
|
326
|
-
return halt(0);
|
|
327
|
-
|
|
328
|
-
if (!e)
|
|
329
|
-
return halt(code);
|
|
330
|
-
|
|
331
|
-
const message = raw ? e : red(`🐊 ${e.message || e}`);
|
|
332
|
-
|
|
333
|
-
logError(message);
|
|
334
|
-
halt(code);
|
|
335
|
-
|
|
336
|
-
return {
|
|
337
|
-
exited: true,
|
|
338
|
-
};
|
|
339
|
-
};
|
|
340
|
-
|
|
341
323
|
module.exports._addOnce = addOnce;
|
|
342
324
|
function addOnce(emitter, name, fn) {
|
|
343
325
|
if (!emitter.listenerCount(name))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "putout",
|
|
3
|
-
"version": "35.
|
|
3
|
+
"version": "35.25.1",
|
|
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",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"@putout/plugin-npmignore": "^5.0.0",
|
|
136
136
|
"@putout/plugin-package-json": "^7.0.0",
|
|
137
137
|
"@putout/plugin-promises": "^15.0.0",
|
|
138
|
-
"@putout/plugin-putout": "^
|
|
138
|
+
"@putout/plugin-putout": "^20.0.0",
|
|
139
139
|
"@putout/plugin-putout-config": "^5.0.0",
|
|
140
140
|
"@putout/plugin-regexp": "^8.0.0",
|
|
141
141
|
"@putout/plugin-remove-console": "^6.0.0",
|