@mindbase/node-tools 1.3.7 → 1.3.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindbase/node-tools",
3
- "version": "1.3.7",
3
+ "version": "1.3.11",
4
4
  "description": "Node.js 开发工具集合:清理 node_modules、查看 Git 日志、发布包",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  "cli-table3": "^0.6.3",
29
29
  "commander": "^11.0.0",
30
30
  "editor": "^1.0.0",
31
- "execa": "^9.6.1",
31
+ "execa": "^8.0.0",
32
32
  "glob": "^13.0.2",
33
33
  "prompts": "^2.4.2",
34
34
  "semver": "^7.7.4",
@@ -3,7 +3,7 @@
3
3
  * 检测和执行构建脚本
4
4
  */
5
5
 
6
- const { execaCommand } = require('execa');
6
+ const { execa } = require('execa');
7
7
 
8
8
  /**
9
9
  * 检测构建脚本
@@ -36,7 +36,7 @@ function detectBuildScripts(scripts) {
36
36
  */
37
37
  async function runBuild(pkgPath, scriptName) {
38
38
  try {
39
- const result = await execaCommand(`npm run ${scriptName}`, {
39
+ const result = await execa(`npm`, ['run', scriptName], {
40
40
  cwd: pkgPath,
41
41
  stdout: 'inherit',
42
42
  stderr: 'inherit'
@@ -3,7 +3,7 @@
3
3
  * 支持发布到 npm 兼容的注册源
4
4
  */
5
5
 
6
- const { execaCommand } = require('execa');
6
+ const { execa } = require('execa');
7
7
  const { writeFileSync, unlinkSync, existsSync } = require('fs');
8
8
  const { join } = require('path');
9
9
  const { BaseAdapter } = require('./base.js');
@@ -28,7 +28,7 @@ class NpmAdapter extends BaseAdapter {
28
28
  if (tag) args.push('--tag', tag);
29
29
  if (dryRun) args.push('--dry-run');
30
30
 
31
- await execaCommand('npm ' + args.join(' '), {
31
+ await execa('npm', args, {
32
32
  cwd: pkg.path,
33
33
  stdout: 'inherit',
34
34
  stderr: 'inherit'
@@ -43,7 +43,7 @@ class NpmAdapter extends BaseAdapter {
43
43
  } finally {
44
44
  // 清理临时 .npmrc
45
45
  if (existsSync(npmrcPath)) {
46
- // unlinkSync(npmrcPath);
46
+ unlinkSync(npmrcPath);
47
47
  }
48
48
  }
49
49
  }
@@ -62,7 +62,7 @@ class NpmAdapter extends BaseAdapter {
62
62
  writeFileSync(tmpNpmrcPath, npmrcContent, 'utf-8');
63
63
 
64
64
  try {
65
- const result = await execaCommand('npm whoami', {
65
+ const result = await execa('npm', ['whoami'], {
66
66
  env: {
67
67
  ...process.env,
68
68
  npm_config_userconfig: tmpNpmrcPath
@@ -100,7 +100,7 @@ class NpmAdapter extends BaseAdapter {
100
100
  args.push('--registry', this.registry);
101
101
  }
102
102
 
103
- await execaCommand('npm ' + args.join(' '), {
103
+ await execa('npm', args, {
104
104
  env: {
105
105
  ...process.env,
106
106
  npm_config_registry: this.registry