madrun 8.8.11 → 8.10.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,32 @@
1
+ 2022.01.14, v8.10.0
2
+
3
+ feature:
4
+ - (madrun) get rid of simport
5
+ - (package) @putout/formatter-json v2.0.0
6
+ - (package) @putout/formatter-dump v3.0.2
7
+
8
+
9
+ 2022.01.12, v8.9.1
10
+
11
+ feature:
12
+ - (package) eslint-plugin-putout v13.0.0
13
+ - (package) putout v24.0.0
14
+
15
+ 2021.12.21, v8.9.0
16
+
17
+ feature:
18
+ - (package) putout v23.0.0
19
+ - (package) yargs-parser v21.0.0
20
+ - (package) @putout/plugin-madrun v11.0.0
21
+ - (package) eslint-plugin-putout v12.2.0
22
+
23
+
24
+ 2021.11.10, v8.8.12
25
+
26
+ feature:
27
+ - (package) putout v22.0.0
28
+
29
+
1
30
  2021.10.31, v8.8.11
2
31
 
3
32
  feature:
package/README.md CHANGED
@@ -1,11 +1,9 @@
1
- # Madrun [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
1
+ # Madrun [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
2
2
 
3
3
  [NPMURL]: https://npmjs.org/package/madrun "npm"
4
4
  [NPMIMGURL]: https://img.shields.io/npm/v/madrun.svg?style=flat
5
5
  [BuildStatusURL]: https://github.com/coderaiser/madrun/actions?query=workflow%3A%22Node+CI%22 "Build Status"
6
6
  [BuildStatusIMGURL]: https://github.com/coderaiser/madrun/workflows/Node%20CI/badge.svg
7
- [DependencyStatusURL]: https://david-dm.org/coderaiser/madrun "Dependency Status"
8
- [DependencyStatusIMGURL]: https://img.shields.io/david/coderaiser/madrun.svg?style=flat
9
7
  [LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License"
10
8
  [LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat
11
9
  [CoverageURL]: https://coveralls.io/github/coderaiser/madrun?branch=master
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,7 @@ function getOptions(args) {
152
151
  }
153
152
 
154
153
  async function getScript() {
155
- const supported = await simport('../supported.json');
154
+ const supported = require('../supported.json');
156
155
  const path = findUp.sync(supported);
157
156
 
158
157
  if (!path) {
@@ -160,7 +159,7 @@ async function getScript() {
160
159
  process.exit(1);
161
160
  }
162
161
 
163
- const esm = await simport(path);
162
+ const esm = await import(path);
164
163
 
165
164
  return [
166
165
  dirname(path),
@@ -170,14 +169,14 @@ async function getScript() {
170
169
 
171
170
  async function putoutMadrun(dir, {fix}) {
172
171
  const name = `${dir}/.madrun.js`;
173
- const {runPutout} = await simport('../lib/fix');
172
+ const {runPutout} = await import('../lib/fix.mjs');
174
173
  const {
175
174
  readFile,
176
175
  writeFile,
177
176
  } = await import('fs/promises');
178
177
 
179
178
  const data = await readFile(name, 'utf8');
180
- const {places, code} = runPutout(data);
179
+ const {places, code} = await runPutout(data);
181
180
 
182
181
  if (fix)
183
182
  await writeFile(name, code);
package/lib/fix.mjs CHANGED
@@ -1,12 +1,13 @@
1
1
  import putout, {
2
2
  initReport,
3
3
  } from 'putout';
4
+
4
5
  import dumpFormatter from '@putout/formatter-dump';
5
6
  import madrun from '@putout/plugin-madrun';
6
7
 
7
8
  const report = initReport();
8
9
 
9
- export const runPutout = (data, options) => {
10
+ export const runPutout = async (data, options) => {
10
11
  const {code, places} = putout(data, {
11
12
  ...options,
12
13
  plugins: [{
@@ -16,7 +17,7 @@ export const runPutout = (data, options) => {
16
17
 
17
18
  return {
18
19
  code,
19
- places: report(dumpFormatter, {
20
+ places: await report(dumpFormatter, {
20
21
  name: '.madrun.js',
21
22
  places,
22
23
  }),
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.8.11",
3
+ "version": "8.10.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,27 +54,27 @@
54
54
  "node": ">=14"
55
55
  },
56
56
  "dependencies": {
57
- "@putout/formatter-dump": "^2.0.1",
58
- "@putout/plugin-madrun": "^10.0.0",
57
+ "@putout/formatter-dump": "^3.0.2",
58
+ "@putout/plugin-madrun": "^11.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": "^21.0.0",
66
- "simport": "^1.0.3",
65
+ "putout": "^24.0.0",
67
66
  "try-catch": "^3.0.0",
68
67
  "try-to-catch": "^3.0.0",
69
- "yargs-parser": "^20.0.0"
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": "^11.0.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",