redput 2.4.0 → 2.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
@@ -1,3 +1,13 @@
1
+ 2024.07.14, v2.5.0
2
+
3
+ feature:
4
+ - 33feb59 redput: parseComment: ^[a-z-]$: avoid any parsing use as is
5
+
6
+ 2024.06.17, v2.4.1
7
+
8
+ feature:
9
+ - 6f4eada redput: get-report: body
10
+
1
11
  2024.06.17, v2.4.0
2
12
 
3
13
  feature:
@@ -57,7 +57,13 @@ function parseValue(a) {
57
57
  });
58
58
 
59
59
  if (!value)
60
- value = print(a).slice(1, -3);
60
+ value = print(a);
61
+
62
+ if (value.startsWith('`'))
63
+ value = value.slice(1, -1);
64
+
65
+ if (value.endsWith(';'))
66
+ value = value.slice(0, -2);
61
67
 
62
68
  return value.replaceAll('${', '{');
63
69
  }
@@ -22,6 +22,9 @@ function parseComment(comment) {
22
22
  .replace('//', '')
23
23
  .trimStart();
24
24
 
25
+ if (/^[a-z-]+$/.test(raw))
26
+ return ['', raw];
27
+
25
28
  const [error, data] = tryCatch(JSON.parse, raw);
26
29
 
27
30
  if (!error)
@@ -1,8 +1,8 @@
1
1
  import putout from 'putout';
2
- import * as insertGetRulePlugin from './plugin-insert-get-rule/index.js';
3
2
  import pluginPutout from '@putout/plugin-putout';
4
3
  import nodejs from '@putout/plugin-nodejs';
5
4
  import removeUnusedVariables from '@putout/plugin-remove-unused-variables';
5
+ import * as insertGetRulePlugin from './plugin-insert-get-rule/index.js';
6
6
 
7
7
  export const addRule = (name, source, ruleOptions) => {
8
8
  const {code} = putout(source, {
@@ -8,8 +8,8 @@ import {
8
8
  dirname,
9
9
  join,
10
10
  } from 'node:path';
11
- import rendy from 'rendy';
12
11
  import process from 'node:process';
12
+ import rendy from 'rendy';
13
13
  import {addRule} from './add-rule/add-rule.js';
14
14
  import {insertTest} from './insert-test/insert-test.js';
15
15
  import {prepareRule} from './prepare-rule/prepare-rule.js';
@@ -8,8 +8,8 @@ import {
8
8
  dirname,
9
9
  join,
10
10
  } from 'node:path';
11
- import rendy from 'rendy';
12
11
  import process from 'node:process';
12
+ import rendy from 'rendy';
13
13
 
14
14
  export const writeRule = async (name, data) => {
15
15
  await mkdir(`./lib`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redput",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "CLI tool to convert source from 🐊Putout Editor to files",
5
5
  "main": "lib/redput.js",
6
6
  "bin": {