redlint 5.4.1 β 5.4.2
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 +5 -0
- package/bin/redlint.js +9 -3
- package/lib/edit/edit.js +2 -0
- package/lib/edit/help.js +15 -0
- package/lib/edit/rename-files/rename-files-full-plugin/index.js +4 -1
- package/lib/help/help.js +0 -1
- package/lib/help/logo.js +0 -1
- package/package.json +4 -1
package/ChangeLog
CHANGED
package/bin/redlint.js
CHANGED
|
@@ -9,6 +9,7 @@ import formatterDump from '@putout/formatter-dump';
|
|
|
9
9
|
import ora from 'ora';
|
|
10
10
|
import {isCI} from 'ci-info';
|
|
11
11
|
import {bundle} from '@putout/bundler';
|
|
12
|
+
import {edit, editHelp} from '#edit';
|
|
12
13
|
import {help} from '../lib/help/help.js';
|
|
13
14
|
import {choose} from '../lib/choose.js';
|
|
14
15
|
import {buildTree} from '../lib/redlint.js';
|
|
@@ -28,7 +29,6 @@ import {convert} from '../lib/convert/convert.js';
|
|
|
28
29
|
import {masterConvert} from '../lib/convert/master.js';
|
|
29
30
|
import {askFilename} from '../lib/dialog.js';
|
|
30
31
|
import {masterRename} from '../lib/rename/master.js';
|
|
31
|
-
import {edit} from '../lib/edit/edit.js';
|
|
32
32
|
import {view} from '../lib/view/view.js';
|
|
33
33
|
import {test} from '../lib/test/test.js';
|
|
34
34
|
import {
|
|
@@ -159,12 +159,19 @@ async function uiLoop(arg) {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
if (isEdit(arg)) {
|
|
162
|
-
const spinner = ora(`πͺΆedit filesystem`).start();
|
|
163
162
|
const args = argOptions.join('');
|
|
164
163
|
const nested = /-n|--nested/.test(args);
|
|
165
164
|
const full = /-f|--full/.test(args);
|
|
165
|
+
const isHelp = /-h|--help/.test(args);
|
|
166
|
+
|
|
167
|
+
if (isHelp) {
|
|
168
|
+
editHelp();
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
166
171
|
|
|
172
|
+
const spinner = ora(`πͺΆedit filesystem`).start();
|
|
167
173
|
spinner.succeed();
|
|
174
|
+
|
|
168
175
|
return edit(filesystem, {
|
|
169
176
|
dir: CWD,
|
|
170
177
|
type: 'rename',
|
|
@@ -331,4 +338,3 @@ function done(message) {
|
|
|
331
338
|
const spinner = ora(message).start();
|
|
332
339
|
spinner.succeed();
|
|
333
340
|
}
|
|
334
|
-
|
package/lib/edit/edit.js
CHANGED
|
@@ -5,6 +5,8 @@ import {readDirectory} from './read-directory/index.js';
|
|
|
5
5
|
import {writeTmpFile as _writeTmpFile} from './write-tmp-file.js';
|
|
6
6
|
import {renameFiles as _renameFiles} from './rename-files/index.js';
|
|
7
7
|
|
|
8
|
+
export {help as editHelp} from './help.js';
|
|
9
|
+
|
|
8
10
|
export const edit = (filesystem, {dir, nested, full}, overrides = {}) => {
|
|
9
11
|
const {
|
|
10
12
|
execute = execSync,
|
package/lib/edit/help.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import process from 'node:process';
|
|
2
|
+
import montag from 'montag';
|
|
3
|
+
|
|
4
|
+
const {stdout} = process;
|
|
5
|
+
|
|
6
|
+
export const help = () => {
|
|
7
|
+
stdout.write(`Usage: redlint edit\n`);
|
|
8
|
+
stdout.write(montag`
|
|
9
|
+
Options:
|
|
10
|
+
-n, --nested - edit nested file paths
|
|
11
|
+
-f, --full - edit full paths
|
|
12
|
+
`);
|
|
13
|
+
stdout.write('\n');
|
|
14
|
+
};
|
|
15
|
+
|
|
@@ -46,7 +46,10 @@ const addFromTo = (namesFrom, namesTo) => (a, i) => [
|
|
|
46
46
|
];
|
|
47
47
|
|
|
48
48
|
export const scan = (path, {push, trackFile, options}) => {
|
|
49
|
-
const {
|
|
49
|
+
const {
|
|
50
|
+
from = [],
|
|
51
|
+
to = [],
|
|
52
|
+
} = options;
|
|
50
53
|
|
|
51
54
|
if (from.length !== to.length)
|
|
52
55
|
return;
|
package/lib/help/help.js
CHANGED
package/lib/help/logo.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "redlint",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Lint Filesystem with πPutout",
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
"exports": {
|
|
13
13
|
".": "./lib/redlint.js"
|
|
14
14
|
},
|
|
15
|
+
"imports": {
|
|
16
|
+
"#edit": "./lib/edit/edit.js"
|
|
17
|
+
},
|
|
15
18
|
"repository": {
|
|
16
19
|
"type": "git",
|
|
17
20
|
"url": "git+https://github.com/putoutjs/redlint.git"
|