redput 4.8.1 → 4.9.1

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
+ 2026.09.27, v4.9.1
2
+
3
+ fix:
4
+ - 1970bbf redput: write: rm useless catch
5
+
6
+ 2026.09.13, v4.9.0
7
+
8
+ feature:
9
+ - 4ede7d0 redput: run-rule: putout
10
+
1
11
  2026.09.10, v4.8.1
2
12
 
3
13
  fix:
@@ -9,7 +9,9 @@ export const replace = () => ({
9
9
  const [__aPath, __bPath] = path.get('elements');
10
10
  const status = isStringLiteral(__a) ? __a.value : __aPath.toString();
11
11
 
12
- const name = isStringLiteral(__b) ? __b.value
12
+ const name = isStringLiteral(__b)
13
+ ? __b.value
14
+
13
15
  : __bPath
14
16
  .toString()
15
17
  .replace(/\s/g, '') +
@@ -2,6 +2,8 @@ import path from 'node:path';
2
2
  import {putout} from 'putout';
3
3
  import {compileRule} from '../compile-rule/compile-rule.js';
4
4
 
5
+ const {assign} = Object;
6
+
5
7
  const noop = () => '';
6
8
 
7
9
  export const runRule = (ruleSource, source) => {
@@ -10,7 +12,9 @@ export const runRule = (ruleSource, source) => {
10
12
  if (name === 'path' || name === 'node:path')
11
13
  return path;
12
14
 
13
- return putout;
15
+ return assign(putout, {
16
+ putout,
17
+ });
14
18
  },
15
19
  });
16
20
 
@@ -3,20 +3,19 @@ import {tryToCatch} from 'try-to-catch';
3
3
  import {isTSCode} from './is-ts/index.js';
4
4
  import {runRule} from '../run-rule/run-rule.js';
5
5
  import {writeReadme} from './nested/write-readme/write-readme.js';
6
- import {
7
- updateNestedIndex,
8
- updateOverallNestedFixtures,
9
- updateOverallNestedTest,
10
- writeNestedFixtures,
11
- writeNestedRule,
12
- writeNestedTests,
13
- } from './nested/nested.js';
6
+ import * as nested from './nested/nested.js';
14
7
  import {
15
8
  writeFixtures,
16
9
  writeRule,
17
10
  writeTests,
18
11
  } from './simple.js';
19
12
 
13
+ const {
14
+ updateNestedIndex,
15
+ updateOverallNestedFixtures,
16
+ updateOverallNestedTest,
17
+ } = nested;
18
+
20
19
  export const writePlugin = async (name, {rule, fixture, report, options, link}) => {
21
20
  const [isNested] = await tryToCatch(access, './package.json');
22
21
 
@@ -36,7 +35,21 @@ export const writePlugin = async (name, {rule, fixture, report, options, link})
36
35
  });
37
36
  };
38
37
 
39
- export const writeNested = async (name, {rule, fixture, report, options, link}) => {
38
+ export const writeNested = async (name, overrides) => {
39
+ const {
40
+ rule,
41
+ fixture,
42
+ report,
43
+ options,
44
+ link,
45
+ writeNestedRule,
46
+ writeNestedFixtures,
47
+ writeNestedTests,
48
+ } = {
49
+ ...nested,
50
+ ...overrides,
51
+ };
52
+
40
53
  const isTS = isTSCode(fixture);
41
54
  const ext = isTS ? 'ts' : 'js';
42
55
  const correct = runRule(rule, fixture);
@@ -45,7 +58,7 @@ export const writeNested = async (name, {rule, fixture, report, options, link})
45
58
  await writeNestedFixtures(name, fixture, ext, correct);
46
59
  await writeNestedTests(name, report);
47
60
 
48
- await tryToCatch(writeNestedOptional, name, {
61
+ await writeNestedOptional(name, {
49
62
  options,
50
63
  fixture,
51
64
  ext,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redput",
3
- "version": "4.8.1",
3
+ "version": "4.9.1",
4
4
  "description": "CLI tool to convert source from 🐊Putout Editor to files",
5
5
  "main": "lib/redput.js",
6
6
  "bin": {