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 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
@@ -132,10 +132,7 @@ npm i madrun -D
132
132
  Let's create file `.madrun.js`:
133
133
 
134
134
  ```js
135
- import {
136
- run,
137
- cutEnv,
138
- } from 'madrun';
135
+ import {run, cutEnv} from 'madrun';
139
136
 
140
137
  const env = {
141
138
  CI: 1,
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
 
@@ -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
- dirname,
6
- basename,
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 = findUp.sync(supported);
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 path = findUp.sync(supported);
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.0.0",
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": "^4.0.0",
57
+ "@putout/formatter-dump": "^5.0.0",
58
58
  "all-object-keys": "^2.0.0",
59
59
  "enquirer": "^2.3.6",
60
- "find-up": "^5.0.0",
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": "^34.0.0",
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": "^8.0.0",
73
- "escover": "^3.4.0",
74
- "eslint": "^8.0.0",
75
- "eslint-plugin-n": "^16.0.1",
76
- "eslint-plugin-putout": "^21.0.1",
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": "^8.1.0"
80
+ "supertape": "^10.0.0"
83
81
  },
84
82
  "publishConfig": {
85
83
  "access": "public"