redput 1.11.0 → 1.13.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 +13 -0
- package/lib/get-report/plugin-get-report/index.js +8 -3
- package/lib/parse-plugin.js +11 -0
- package/lib/redput.js +2 -2
- package/package.json +4 -4
package/ChangeLog
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
2023.11.21, v1.13.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 8ecf9d3 redput: @putout/plugin-putout v16.7.0
|
|
5
|
+
- afce39c redput: putout v33.9.1
|
|
6
|
+
- 3a70560 redput: get-report: improve support of template literals
|
|
7
|
+
|
|
8
|
+
2023.11.02, v1.12.0
|
|
9
|
+
|
|
10
|
+
feature:
|
|
11
|
+
- 99450ff redput: eslint-plugin-putout v21.0.1
|
|
12
|
+
- 5dac2ac redput: trim name
|
|
13
|
+
|
|
1
14
|
2023.10.12, v1.11.0
|
|
2
15
|
|
|
3
16
|
feature:
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
operator,
|
|
3
3
|
types,
|
|
4
|
+
print,
|
|
4
5
|
} from 'putout';
|
|
5
6
|
|
|
6
7
|
const {isStringLiteral} = types;
|
|
7
8
|
const {getTemplateValues} = operator;
|
|
8
9
|
|
|
9
|
-
const REPORT = 'export const report = () => __a';
|
|
10
|
-
const REPORT_COMMONJS = 'module.exports.report = () => __a';
|
|
10
|
+
const REPORT = 'export const report = (__args) => __a';
|
|
11
|
+
const REPORT_COMMONJS = 'module.exports.report = (__args) => __a';
|
|
11
12
|
const ASSIGN = 'export const report = __a';
|
|
12
13
|
|
|
13
14
|
const templates = [
|
|
@@ -47,5 +48,9 @@ function parseValue(a) {
|
|
|
47
48
|
if (isStringLiteral(a))
|
|
48
49
|
return a.value;
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
const value = print(a);
|
|
52
|
+
|
|
53
|
+
return value
|
|
54
|
+
.slice(1, -3)
|
|
55
|
+
.replaceAll('${', '{');
|
|
51
56
|
}
|
package/lib/redput.js
CHANGED
|
@@ -3,6 +3,7 @@ import {getReport} from './get-report/get-report.js';
|
|
|
3
3
|
import {readGist} from './read-gist/read-gist.js';
|
|
4
4
|
import {writePlugin} from './write/index.js';
|
|
5
5
|
import {parseLink} from './parse-link.js';
|
|
6
|
+
import {parsePlugin} from './parse-plugin.js';
|
|
6
7
|
|
|
7
8
|
const SUCCESS = [null, 'Done'];
|
|
8
9
|
|
|
@@ -20,8 +21,7 @@ export const redput = async (link, {token}) => {
|
|
|
20
21
|
const raw = result.data.files['transform.js'].content;
|
|
21
22
|
const fixture = result.data.files['source.js'].content;
|
|
22
23
|
|
|
23
|
-
const
|
|
24
|
-
const name = comment.replace(/\/\/\s+?/, '');
|
|
24
|
+
const {name, lines} = parsePlugin(raw);
|
|
25
25
|
|
|
26
26
|
if (name.includes(':') || name.includes('{'))
|
|
27
27
|
return [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "redput",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "CLI tool to convert source from 🐊Putout Editor to files",
|
|
5
5
|
"main": "lib/redput.js",
|
|
6
6
|
"bin": {
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@putout/plugin-convert-esm-to-commonjs": "^6.0.0",
|
|
61
61
|
"@putout/plugin-declare": "^2.0.1",
|
|
62
|
-
"@putout/plugin-putout": "^
|
|
62
|
+
"@putout/plugin-putout": "^16.7.0",
|
|
63
63
|
"@putout/plugin-remove-unused-variables": "^7.0.0",
|
|
64
64
|
"node-fetch": "^3.3.2",
|
|
65
65
|
"octokit": "^3.1.0",
|
|
66
|
-
"putout": "^
|
|
66
|
+
"putout": "^33.9.1",
|
|
67
67
|
"rendy": "^4.1.3",
|
|
68
68
|
"try-to-catch": "^3.0.1"
|
|
69
69
|
},
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"escover": "^3.4.0",
|
|
74
74
|
"eslint": "^8.0.0",
|
|
75
75
|
"eslint-plugin-n": "^16.0.1",
|
|
76
|
-
"eslint-plugin-putout": "^
|
|
76
|
+
"eslint-plugin-putout": "^21.0.1",
|
|
77
77
|
"madrun": "^9.3.0",
|
|
78
78
|
"montag": "^1.2.1",
|
|
79
79
|
"nodemon": "^3.0.1",
|