redput 4.4.0 → 4.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/ChangeLog
CHANGED
package/lib/write/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {access} from 'node:fs/promises';
|
|
2
2
|
import {tryToCatch} from 'try-to-catch';
|
|
3
|
+
import {isTSCode} from './is-ts/index.js';
|
|
3
4
|
import {
|
|
4
5
|
updateNestedIndex,
|
|
5
6
|
updateOverallNestedFixtures,
|
|
@@ -13,7 +14,6 @@ import {
|
|
|
13
14
|
writeRule,
|
|
14
15
|
writeTests,
|
|
15
16
|
} from './simple.js';
|
|
16
|
-
import {isTSCode} from './is-ts/index.js';
|
|
17
17
|
|
|
18
18
|
export const writePlugin = async (name, {rule, fixture, report, options}) => {
|
|
19
19
|
const [isNested] = await tryToCatch(access, './package.json');
|
|
@@ -10,7 +10,7 @@ const {
|
|
|
10
10
|
isSpreadElement,
|
|
11
11
|
} = types;
|
|
12
12
|
|
|
13
|
-
const {
|
|
13
|
+
const {superTraverse} = operator;
|
|
14
14
|
|
|
15
15
|
export const report = () => `Insert 'getRule()'`;
|
|
16
16
|
|
|
@@ -69,7 +69,7 @@ const createCheck = (options) => ({__object}) => {
|
|
|
69
69
|
return false;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
superTraverse(__object, {
|
|
73
73
|
[`getRule('${name}')`]: () => {
|
|
74
74
|
exists = true;
|
|
75
75
|
},
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import putout from 'putout';
|
|
2
2
|
import * as putoutPlugin from '@putout/plugin-putout';
|
|
3
3
|
import * as declare from '@putout/plugin-declare';
|
|
4
|
+
import * as convertCommonjsToESM from '@putout/plugin-nodejs/convert-commonjs-to-esm';
|
|
4
5
|
import * as declareBeforeReference from '@putout/plugin-declare-before-reference';
|
|
5
6
|
|
|
6
7
|
export const prepareRule = (source) => {
|
|
7
8
|
const {code} = putout(source, {
|
|
8
9
|
plugins: [
|
|
10
|
+
['convert-commonjs-to-esm', convertCommonjsToESM],
|
|
9
11
|
['declare', declare],
|
|
10
12
|
['declare-before-reference', declareBeforeReference],
|
|
11
13
|
['putout', putoutPlugin],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "redput",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"description": "CLI tool to convert source from 🐊Putout Editor to files",
|
|
5
5
|
"main": "lib/redput.js",
|
|
6
6
|
"bin": {
|
|
@@ -16,13 +16,11 @@
|
|
|
16
16
|
"lint:fresh": "madrun lint:fresh",
|
|
17
17
|
"fix:lint": "madrun fix:lint",
|
|
18
18
|
"test": "madrun test",
|
|
19
|
-
"test:mock": "madrun test:mock",
|
|
20
19
|
"watch:test": "madrun watch:test",
|
|
21
20
|
"watch:tape": "madrun watch:tape",
|
|
22
21
|
"watch:lint": "madrun watch:lint",
|
|
23
22
|
"watcher": "madrun watcher",
|
|
24
23
|
"coverage": "madrun coverage",
|
|
25
|
-
"coverage:es": "madrun coverage:es",
|
|
26
24
|
"report": "madrun report",
|
|
27
25
|
"wisdom": "madrun wisdom"
|
|
28
26
|
},
|