@nice-move/cli 0.6.0 → 0.6.1

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.
@@ -1,9 +1,10 @@
1
- 'use strict';
1
+ import { createRequire } from 'module';
2
2
 
3
- const { isReachable } = require('settingz');
3
+ import { execa } from 'execa';
4
+ import { isReachable } from 'settingz';
4
5
 
5
6
  // eslint-disable-next-line consistent-return
6
- module.exports = function svgoCaller() {
7
+ export function svgoCaller() {
7
8
  if (
8
9
  isReachable('svgo/package.json') &&
9
10
  isReachable('svgo-config/package.json')
@@ -12,7 +13,8 @@ module.exports = function svgoCaller() {
12
13
  command: 'svgo',
13
14
  describe: 'Run `svgo` to optimize `*.svg`',
14
15
  handler({ _: [_, path = './'] }) {
15
- const execa = require('execa');
16
+ const require = createRequire(import.meta.url);
17
+
16
18
  execa('svgo', [
17
19
  '-r',
18
20
  '-q',
@@ -20,7 +22,7 @@ module.exports = function svgoCaller() {
20
22
  '--indent',
21
23
  '2',
22
24
  '--config',
23
- 'node_modules/svgo-config/config.json',
25
+ require.resolve('svgo-config'),
24
26
  '-f',
25
27
  path,
26
28
  ])
@@ -34,4 +36,4 @@ module.exports = function svgoCaller() {
34
36
  },
35
37
  };
36
38
  }
37
- };
39
+ }
package/index.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { Cheetor } from 'cheetor';
4
4
 
5
- import svgoCaller from './cmd/svgo.cjs';
5
+ import { svgoCaller } from './cmd/svgo.mjs';
6
6
 
7
7
  process.on('SIGINT', () => {});
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-move/cli",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Frontend develop helper for frontend development",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -34,10 +34,10 @@
34
34
  "nice-move": "index.mjs"
35
35
  },
36
36
  "dependencies": {
37
- "@nice-move/lint": "^0.3.4",
37
+ "@nice-move/lint": "^0.3.5",
38
38
  "cheetor": "^0.12.2",
39
- "execa": "^5.1.1",
40
- "settingz": "^0.1.0"
39
+ "execa": "^6.0.0",
40
+ "settingz": "^0.1.5"
41
41
  },
42
42
  "engines": {
43
43
  "node": "^12.22.0 || ^14.17.0 || >=16.13.0"