@putout/test 5.4.0 → 5.5.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/processor/index.js +9 -1
- package/package.json +2 -2
package/lib/processor/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const {
|
|
4
|
+
readFile,
|
|
5
|
+
writeFile,
|
|
6
|
+
} = require('fs/promises');
|
|
4
7
|
const {
|
|
5
8
|
join,
|
|
6
9
|
extname,
|
|
@@ -12,6 +15,8 @@ const processFile = require('putout/process-file');
|
|
|
12
15
|
const {runProcessors} = require('@putout/engine-processor');
|
|
13
16
|
|
|
14
17
|
const isStr = (a) => typeof a === 'string';
|
|
18
|
+
const isUpdate = () => global.process.env.UPDATE;
|
|
19
|
+
|
|
15
20
|
const buildOptions = ({options, plugins, processors}) => ({
|
|
16
21
|
...options,
|
|
17
22
|
plugins: plugins || options.plugins,
|
|
@@ -110,6 +115,9 @@ async function process(filename, dir, {processors, plugins, extension, fix = tru
|
|
|
110
115
|
rawSource,
|
|
111
116
|
});
|
|
112
117
|
|
|
118
|
+
if (isUpdate() && !noChange)
|
|
119
|
+
await writeFile(outputName, processedSource);
|
|
120
|
+
|
|
113
121
|
return {
|
|
114
122
|
processedSource,
|
|
115
123
|
output,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/test",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "test runner for putout plugins ",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"c8": "^7.5.0",
|
|
65
65
|
"eslint": "^8.0.1",
|
|
66
66
|
"eslint-plugin-n": "^15.2.4",
|
|
67
|
-
"eslint-plugin-putout": "^
|
|
67
|
+
"eslint-plugin-putout": "^16.0.0",
|
|
68
68
|
"lerna": "^5.0.0",
|
|
69
69
|
"madrun": "^9.0.0",
|
|
70
70
|
"mock-require": "^3.0.3",
|