madrun 8.9.0 → 9.0.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,30 @@
1
+ 2022.02.17, v9.0.0
2
+
3
+ feature:
4
+ - (package) supertape v7.0.0
5
+ - (package) @putout/plugin-madrun v13.0.0
6
+ - (package) putout v25.0.0
7
+
8
+
9
+ 2022.01.14, v8.10.1
10
+
11
+ fix:
12
+ - (madrun) windows support
13
+
14
+ 2022.01.14, v8.10.0
15
+
16
+ feature:
17
+ - (madrun) get rid of simport
18
+ - (package) @putout/formatter-json v2.0.0
19
+ - (package) @putout/formatter-dump v3.0.2
20
+
21
+
22
+ 2022.01.12, v8.9.1
23
+
24
+ feature:
25
+ - (package) eslint-plugin-putout v13.0.0
26
+ - (package) putout v24.0.0
27
+
1
28
  2021.12.21, v8.9.0
2
29
 
3
30
  feature:
package/bin/init.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import {createRequire} from 'module';
1
2
  import {join} from 'path';
2
3
  import {
3
4
  writeFile,
@@ -6,13 +7,13 @@ import {
6
7
 
7
8
  import tryToCatch from 'try-to-catch';
8
9
  import montag from 'montag';
9
- import {createSimport} from 'simport';
10
+
11
+ const require = createRequire(import.meta.url);
10
12
 
11
13
  const {stringify} = JSON;
12
14
  const {keys} = Object;
13
15
 
14
- const simport = createSimport(import.meta.url);
15
- const supported = await simport('../supported.json');
16
+ const supported = require('../supported.json');
16
17
 
17
18
  export const createMadrun = async (cwd, info) => {
18
19
  let name = await findMadrun(cwd);
@@ -40,7 +41,7 @@ export const createMadrun = async (cwd, info) => {
40
41
  };
41
42
 
42
43
  export const patchPackage = async (name, info) => {
43
- const {default: content} = await simport(name);
44
+ const {default: content} = await import(name);
44
45
 
45
46
  const updatedScripts = updatePackage(content);
46
47
  const prepared = preparePackage(info, updatedScripts);
package/bin/madrun.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ import {createRequire} from 'module';
3
4
  import {
4
5
  dirname,
5
6
  basename,
@@ -8,12 +9,10 @@ import {
8
9
  import findUp from 'find-up';
9
10
  import tryToCatch from 'try-to-catch';
10
11
  import yargsParser from 'yargs-parser';
11
- import {createSimport} from 'simport';
12
12
 
13
13
  import {series} from '../lib/madrun.js';
14
14
  import check from '../lib/check.js';
15
-
16
- const simport = createSimport(import.meta.url);
15
+ const require = createRequire(import.meta.url);
17
16
 
18
17
  const {exit} = process;
19
18
  const {
@@ -47,13 +46,13 @@ const {
47
46
  } = args;
48
47
 
49
48
  if (help) {
50
- const {help} = await simport('../lib/help.js');
49
+ const {help} = require('../lib/help.js');
51
50
  console.log(help());
52
51
  process.exit();
53
52
  }
54
53
 
55
54
  if (version) {
56
- const {version} = await simport('../package.json');
55
+ const {version} = require('../package.json');
57
56
  console.log(`v${version}`);
58
57
  process.exit();
59
58
  }
@@ -62,11 +61,11 @@ if (init) {
62
61
  const {
63
62
  createMadrun,
64
63
  patchPackage,
65
- } = await simport('./init');
64
+ } = await import('./init.mjs');
66
65
 
67
66
  fix = true;
68
67
 
69
- const [errorPackage, info] = await tryToCatch(simport, `${cwd}/package.json`);
68
+ const [errorPackage, info] = await tryToCatch(require, `${cwd}/package.json`);
70
69
 
71
70
  if (errorPackage)
72
71
  console.error(errorPackage);
@@ -130,8 +129,8 @@ function getOutput({cmd, cwd}) {
130
129
  }
131
130
 
132
131
  async function execute(cmd) {
133
- const {execSync} = await simport('child_process');
134
- const tryCatch = await simport('try-catch');
132
+ const {execSync} = await import('child_process');
133
+ const tryCatch = (await import('try-catch')).default;
135
134
 
136
135
  const [error] = tryCatch(execSync, cmd, {
137
136
  stdio: [0, 1, 2],
@@ -152,7 +151,8 @@ function getOptions(args) {
152
151
  }
153
152
 
154
153
  async function getScript() {
155
- const supported = await simport('../supported.json');
154
+ const {pathToFileURL} = require('url');
155
+ const supported = require('../supported.json');
156
156
  const path = findUp.sync(supported);
157
157
 
158
158
  if (!path) {
@@ -160,7 +160,8 @@ async function getScript() {
160
160
  process.exit(1);
161
161
  }
162
162
 
163
- const esm = await simport(path);
163
+ // always convert path to url on windows
164
+ const esm = await import(pathToFileURL(path));
164
165
 
165
166
  return [
166
167
  dirname(path),
@@ -170,7 +171,7 @@ async function getScript() {
170
171
 
171
172
  async function putoutMadrun(dir, {fix}) {
172
173
  const name = `${dir}/.madrun.js`;
173
- const {runPutout} = await simport('../lib/fix');
174
+ const {runPutout} = await import('../lib/fix.mjs');
174
175
  const {
175
176
  readFile,
176
177
  writeFile,
package/lib/madrun.js CHANGED
@@ -3,7 +3,6 @@
3
3
  const keys = require('all-object-keys');
4
4
  const jessy = require('jessy');
5
5
  const findUp = require('find-up');
6
- const {createSimport} = require('simport');
7
6
 
8
7
  const wildcard = require('./wildcard');
9
8
  const check = require('./check');
@@ -12,15 +11,13 @@ const supported = require('../supported');
12
11
  const isStr = (a) => typeof a === 'string';
13
12
  const {isArray} = Array;
14
13
 
15
- const simport = createSimport(__filename);
16
-
17
14
  async function getScripts() {
18
15
  const path = findUp.sync(supported);
19
16
 
20
17
  if (!path)
21
18
  throw Error('.madrun.js is missing!');
22
19
 
23
- return await simport(path);
20
+ return (await import(path)).default;
24
21
  }
25
22
 
26
23
  module.exports.cutEnv = async (names, opts = '', env, scripts) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "madrun",
3
- "version": "8.9.0",
3
+ "version": "9.0.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",
@@ -51,36 +51,36 @@
51
51
  "homepage": "https://github.com/coderaiser/madrun",
52
52
  "license": "MIT",
53
53
  "engines": {
54
- "node": ">=14"
54
+ "node": ">=16"
55
55
  },
56
56
  "dependencies": {
57
- "@putout/formatter-dump": "^2.0.1",
58
- "@putout/plugin-madrun": "^11.0.0",
57
+ "@putout/formatter-dump": "^3.0.2",
58
+ "@putout/plugin-madrun": "^13.0.0",
59
59
  "all-object-keys": "^2.0.0",
60
60
  "find-up": "^5.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": "^23.0.0",
66
- "simport": "^1.0.3",
65
+ "putout": "^25.0.0",
67
66
  "try-catch": "^3.0.0",
68
67
  "try-to-catch": "^3.0.0",
69
68
  "yargs-parser": "^21.0.0"
70
69
  },
71
70
  "devDependencies": {
72
71
  "@cloudcmd/stub": "^3.1.0",
73
- "@putout/formatter-json": "^1.0.2",
72
+ "@putout/formatter-json": "^2.0.0",
74
73
  "c8": "^7.3.5",
75
- "eslint": "^8.0.0-beta.1",
74
+ "escover": "^1.1.6",
75
+ "eslint": "^8.0.0",
76
76
  "eslint-plugin-node": "^11.0.0",
77
- "eslint-plugin-putout": "^12.2.0",
77
+ "eslint-plugin-putout": "^13.0.0",
78
78
  "mock-import": "^2.1.1",
79
79
  "mock-require": "^3.0.3",
80
80
  "nodemon": "^2.0.0",
81
81
  "nyc": "^15.0.0",
82
82
  "runsome": "^1.0.0",
83
- "supertape": "^6.0.5"
83
+ "supertape": "^7.0.0"
84
84
  },
85
85
  "publishConfig": {
86
86
  "access": "public"