madrun 10.0.0 → 10.1.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 +21 -0
- package/README.md +1 -4
- package/bin/init.mjs +1 -4
- package/bin/madrun-completion.js +3 -3
- package/bin/madrun.mjs +8 -12
- package/lib/madrun.js +11 -3
- package/package.json +10 -12
package/ChangeLog
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
2024.07.16, v10.1.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 2b73d5e madrun: find-up v7.0.0
|
|
5
|
+
- 4914a09 madrun: eslint v9.7.0
|
|
6
|
+
- 12b1a56 madrun: @putout/formatter-dump v5.0.0
|
|
7
|
+
- 1b4748f madrun: c8 v10.1.2
|
|
8
|
+
- 4755c8c madrun: putout v36.0.0
|
|
9
|
+
- 125f774 madrun: supertape v10.0.0
|
|
10
|
+
|
|
11
|
+
2024.01.19, v10.0.1
|
|
12
|
+
|
|
13
|
+
feature:
|
|
14
|
+
- 3222754 madrun: eslint-plugin-putout v22.3.0
|
|
15
|
+
- edge4dad madrun: c8 v9.1.0
|
|
16
|
+
- 57f7b7a madrun: mock-import v4.0.2
|
|
17
|
+
- 1a91317 madrun: supertape v9.5.0
|
|
18
|
+
- d523038 madrun: putout v35.0.0
|
|
19
|
+
- 1c45483 madrun: escover v4.0.0
|
|
20
|
+
- 9bdbf8c madrun: mock-import v3.4.1
|
|
21
|
+
|
|
1
22
|
2023.12.09, v10.0.0
|
|
2
23
|
|
|
3
24
|
feature:
|
package/README.md
CHANGED
package/bin/init.mjs
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import {createRequire} from 'node:module';
|
|
2
2
|
import {join} from 'node:path';
|
|
3
|
-
import {
|
|
4
|
-
writeFile,
|
|
5
|
-
access,
|
|
6
|
-
} from 'node:fs/promises';
|
|
3
|
+
import {writeFile, access} from 'node:fs/promises';
|
|
7
4
|
import tryToCatch from 'try-to-catch';
|
|
8
5
|
import montag from 'montag';
|
|
9
6
|
|
package/bin/madrun-completion.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
const process = require('process');
|
|
6
|
-
const fs = require('fs');
|
|
7
|
-
const path = require('path');
|
|
5
|
+
const process = require('node:process');
|
|
6
|
+
const fs = require('node:fs');
|
|
7
|
+
const path = require('node:path');
|
|
8
8
|
|
|
9
9
|
const filename = path.join(__dirname, '..', 'shell/redrun-completion.sh');
|
|
10
10
|
const read = fs.createReadStream(filename);
|
package/bin/madrun.mjs
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import {createRequire} from 'node:module';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from 'node:path';
|
|
8
|
-
import findUp from 'find-up';
|
|
4
|
+
import {dirname, basename} from 'node:path';
|
|
5
|
+
import process from 'node:process';
|
|
6
|
+
import {findUpSync} from 'find-up';
|
|
9
7
|
import tryToCatch from 'try-to-catch';
|
|
10
8
|
import yargsParser from 'yargs-parser';
|
|
11
|
-
import process from 'node:process';
|
|
12
9
|
import {series} from '../lib/madrun.js';
|
|
13
10
|
import check from '../lib/check.js';
|
|
14
11
|
import {choose} from '../lib/choose.mjs';
|
|
@@ -101,9 +98,8 @@ if (problems) {
|
|
|
101
98
|
exit(1);
|
|
102
99
|
}
|
|
103
100
|
|
|
104
|
-
if (!names.length)
|
|
101
|
+
if (!names.length)
|
|
105
102
|
names = await choose(scripts);
|
|
106
|
-
}
|
|
107
103
|
|
|
108
104
|
if (!names.length)
|
|
109
105
|
exit();
|
|
@@ -133,7 +129,7 @@ function getOutput({cmd, cwd}) {
|
|
|
133
129
|
}
|
|
134
130
|
|
|
135
131
|
async function execute(cmd) {
|
|
136
|
-
const {execSync} = await import('child_process');
|
|
132
|
+
const {execSync} = await import('node:child_process');
|
|
137
133
|
const tryCatch = (await import('try-catch')).default;
|
|
138
134
|
|
|
139
135
|
const [error] = tryCatch(execSync, cmd, {
|
|
@@ -155,9 +151,9 @@ function getOptions(args) {
|
|
|
155
151
|
}
|
|
156
152
|
|
|
157
153
|
async function getScript() {
|
|
158
|
-
const {pathToFileURL} = require('url');
|
|
154
|
+
const {pathToFileURL} = require('node:url');
|
|
159
155
|
const supported = require('../supported.json');
|
|
160
|
-
const path =
|
|
156
|
+
const path = findUpSync(supported);
|
|
161
157
|
|
|
162
158
|
if (!path) {
|
|
163
159
|
console.error('file ".madrun.js" not found!');
|
|
@@ -176,7 +172,7 @@ async function getScript() {
|
|
|
176
172
|
async function putoutMadrun(dir, {fix}) {
|
|
177
173
|
const name = `${dir}/.madrun.js`;
|
|
178
174
|
const {runPutout} = await import('../lib/fix.mjs');
|
|
179
|
-
const {readFile, writeFile} = await import('fs/promises');
|
|
175
|
+
const {readFile, writeFile} = await import('node:fs/promises');
|
|
180
176
|
const data = await readFile(name, 'utf8');
|
|
181
177
|
const {places, code} = await runPutout(data);
|
|
182
178
|
|
package/lib/madrun.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const {pathToFileURL} = require('url');
|
|
3
|
+
const {pathToFileURL} = require('node:url');
|
|
4
4
|
const keys = require('all-object-keys');
|
|
5
5
|
const jessy = require('jessy');
|
|
6
|
-
const findUp = require('find-up');
|
|
7
6
|
|
|
8
7
|
const wildcard = require('./wildcard');
|
|
9
8
|
const check = require('./check');
|
|
@@ -12,8 +11,17 @@ const maybeArray = (a) => isArray(a) ? a : [a];
|
|
|
12
11
|
const isStr = (a) => typeof a === 'string';
|
|
13
12
|
const {isArray} = Array;
|
|
14
13
|
|
|
14
|
+
async function getFindUp() {
|
|
15
|
+
if (global.MADRUN_FINDUP)
|
|
16
|
+
return global.MADRUN_FINDUP;
|
|
17
|
+
|
|
18
|
+
const {findUpSync} = await import('find-up');
|
|
19
|
+
return findUpSync;
|
|
20
|
+
}
|
|
21
|
+
|
|
15
22
|
async function getScripts() {
|
|
16
|
-
const
|
|
23
|
+
const findUp = await getFindUp();
|
|
24
|
+
const path = findUp(supported);
|
|
17
25
|
|
|
18
26
|
if (!path)
|
|
19
27
|
throw Error('.madrun.js is missing!');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "madrun",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"description": "CLI tool to run multiple npm-scripts in a madly comfortable way",
|
|
5
5
|
"main": "lib/madrun.js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -54,32 +54,30 @@
|
|
|
54
54
|
"node": ">=18"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@putout/formatter-dump": "^
|
|
57
|
+
"@putout/formatter-dump": "^5.0.0",
|
|
58
58
|
"all-object-keys": "^2.0.0",
|
|
59
59
|
"enquirer": "^2.3.6",
|
|
60
|
-
"find-up": "^
|
|
60
|
+
"find-up": "^7.0.0",
|
|
61
61
|
"jessy": "^3.0.0",
|
|
62
62
|
"mapsome": "^1.0.0",
|
|
63
63
|
"montag": "^1.0.0",
|
|
64
64
|
"once": "^1.4.0",
|
|
65
|
-
"putout": "^
|
|
65
|
+
"putout": "^36.0.0",
|
|
66
66
|
"try-catch": "^3.0.0",
|
|
67
67
|
"try-to-catch": "^3.0.0",
|
|
68
68
|
"yargs-parser": "^21.0.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@putout/formatter-json": "^2.0.0",
|
|
72
|
-
"c8": "^
|
|
73
|
-
"escover": "^
|
|
74
|
-
"eslint": "^
|
|
75
|
-
"eslint-plugin-
|
|
76
|
-
"
|
|
77
|
-
"mock-import": "^3.0.0",
|
|
72
|
+
"c8": "^10.1.2",
|
|
73
|
+
"escover": "^4.0.0",
|
|
74
|
+
"eslint": "^9.7.0",
|
|
75
|
+
"eslint-plugin-putout": "^22.3.0",
|
|
76
|
+
"mock-import": "^4.0.2",
|
|
78
77
|
"mock-require": "^3.0.3",
|
|
79
78
|
"nodemon": "^3.0.1",
|
|
80
|
-
"nyc": "^15.0.0",
|
|
81
79
|
"runsome": "^1.0.0",
|
|
82
|
-
"supertape": "^
|
|
80
|
+
"supertape": "^10.0.0"
|
|
83
81
|
},
|
|
84
82
|
"publishConfig": {
|
|
85
83
|
"access": "public"
|