madrun 10.0.1 → 10.2.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,8 +1,24 @@
1
+ 2024.09.25, v10.2.0
2
+
3
+ feature:
4
+ - 1760b28 madrun: eslint-plugin-putout v23.1.0
5
+ - 886aa46 madrun: avoid pre
6
+
7
+ 2024.07.16, v10.1.0
8
+
9
+ feature:
10
+ - 2b73d5e madrun: find-up v7.0.0
11
+ - 4914a09 madrun: eslint v9.7.0
12
+ - 12b1a56 madrun: @putout/formatter-dump v5.0.0
13
+ - 1b4748f madrun: c8 v10.1.2
14
+ - 4755c8c madrun: putout v36.0.0
15
+ - 125f774 madrun: supertape v10.0.0
16
+
1
17
  2024.01.19, v10.0.1
2
18
 
3
19
  feature:
4
20
  - 3222754 madrun: eslint-plugin-putout v22.3.0
5
- - ede4dad madrun: c8 v9.1.0
21
+ - edge4dad madrun: c8 v9.1.0
6
22
  - 57f7b7a madrun: mock-import v4.0.2
7
23
  - 1a91317 madrun: supertape v9.5.0
8
24
  - d523038 madrun: putout v35.0.0
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
 
@@ -61,6 +58,10 @@ function updatePackage(scripts) {
61
58
  const result = {};
62
59
 
63
60
  for (const key of keys(scripts)) {
61
+ if (key.startsWith('pre'))
62
+ continue;
63
+
64
+ console.log('xxxx', key);
64
65
  result[key] = `madrun ${key}`;
65
66
  }
66
67
 
@@ -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';
@@ -132,7 +129,7 @@ function getOutput({cmd, cwd}) {
132
129
  }
133
130
 
134
131
  async function execute(cmd) {
135
- const {execSync} = await import('child_process');
132
+ const {execSync} = await import('node:child_process');
136
133
  const tryCatch = (await import('try-catch')).default;
137
134
 
138
135
  const [error] = tryCatch(execSync, cmd, {
@@ -154,9 +151,9 @@ function getOptions(args) {
154
151
  }
155
152
 
156
153
  async function getScript() {
157
- const {pathToFileURL} = require('url');
154
+ const {pathToFileURL} = require('node:url');
158
155
  const supported = require('../supported.json');
159
- const path = findUp.sync(supported);
156
+ const path = findUpSync(supported);
160
157
 
161
158
  if (!path) {
162
159
  console.error('file ".madrun.js" not found!');
@@ -175,7 +172,7 @@ async function getScript() {
175
172
  async function putoutMadrun(dir, {fix}) {
176
173
  const name = `${dir}/.madrun.js`;
177
174
  const {runPutout} = await import('../lib/fix.mjs');
178
- const {readFile, writeFile} = await import('fs/promises');
175
+ const {readFile, writeFile} = await import('node:fs/promises');
179
176
  const data = await readFile(name, 'utf8');
180
177
  const {places, code} = await runPutout(data);
181
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,18 @@ 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
+
20
+ return findUpSync;
21
+ }
22
+
15
23
  async function getScripts() {
16
- const path = findUp.sync(supported);
24
+ const findUp = await getFindUp();
25
+ const path = findUp(supported);
17
26
 
18
27
  if (!path)
19
28
  throw Error('.madrun.js is missing!');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "madrun",
3
- "version": "10.0.1",
3
+ "version": "10.2.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": "^35.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": "^9.1.0",
72
+ "c8": "^10.1.2",
73
73
  "escover": "^4.0.0",
74
- "eslint": "^8.0.0",
75
- "eslint-plugin-n": "^16.0.1",
76
- "eslint-plugin-putout": "^22.3.0",
74
+ "eslint": "^9.7.0",
75
+ "eslint-plugin-putout": "^23.1.0",
77
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": "^9.5.0"
80
+ "supertape": "^10.0.0"
83
81
  },
84
82
  "publishConfig": {
85
83
  "access": "public"