redput 1.11.0 → 1.12.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
@@ -1,3 +1,9 @@
1
+ 2023.11.02, v1.12.0
2
+
3
+ feature:
4
+ - 99450ff redput: eslint-plugin-putout v21.0.1
5
+ - 5dac2ac redput: trim name
6
+
1
7
  2023.10.12, v1.11.0
2
8
 
3
9
  feature:
@@ -0,0 +1,11 @@
1
+ export const parsePlugin = (raw) => {
2
+ const [comment, ...lines] = raw.split('\n');
3
+ const name = comment
4
+ .replace('//', '')
5
+ .trimStart();
6
+
7
+ return {
8
+ name,
9
+ lines,
10
+ };
11
+ };
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 [comment, ...lines] = raw.split('\n');
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.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "CLI tool to convert source from 🐊Putout Editor to files",
5
5
  "main": "lib/redput.js",
6
6
  "bin": {
@@ -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": "^20.0.0",
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",