@charcoal-ui/tailwind-diff 4.6.1-beta.0 → 4.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 +1 @@
1
- {"version":3,"file":"withPackages.d.ts","sourceRoot":"","sources":["../src/withPackages.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAErD;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAClC,kBAAkB,EAAE,kBAAkB,EACtC,kBAAkB,EAAE,SAAS,MAAM,EAAE,EACrC,QAAQ,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAC7B,OAAO,CAAC,CAAC,CAAC,CAuEZ"}
1
+ {"version":3,"file":"withPackages.d.ts","sourceRoot":"","sources":["../src/withPackages.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAErD;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAClC,kBAAkB,EAAE,kBAAkB,EACtC,kBAAkB,EAAE,SAAS,MAAM,EAAE,EACrC,QAAQ,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAC7B,OAAO,CAAC,CAAC,CAAC,CA2EZ"}
@@ -42,19 +42,19 @@ async function withPackages(packageManagerInfo, packageDescriptors, callback) {
42
42
  if (packageLock != null) {
43
43
  fs_1.default.copyFileSync(packageLock.path, packageLock.backup);
44
44
  }
45
- let cmd, recoverCmd;
45
+ let cmdArgs, recoverArgs;
46
46
  switch (packageManagerInfo.type) {
47
47
  case 'npm':
48
- cmd = `npm install ${packageDescriptors.join(' ')}`;
49
- recoverCmd = 'npm install';
48
+ cmdArgs = ['install', ...packageDescriptors];
49
+ recoverArgs = ['install'];
50
50
  break;
51
51
  case 'yarn':
52
- cmd = `yarn add ${packageDescriptors.join(' ')}`;
53
- recoverCmd = 'yarn install';
52
+ cmdArgs = ['add', ...packageDescriptors];
53
+ recoverArgs = ['install'];
54
54
  break;
55
55
  case 'pnpm':
56
- cmd = `pnpm add ${packageDescriptors.join(' ')}`;
57
- recoverCmd = 'pnpm install';
56
+ cmdArgs = ['add', ...packageDescriptors];
57
+ recoverArgs = ['install'];
58
58
  break;
59
59
  }
60
60
  // execに失敗してもファイルは回復してほしい
@@ -65,9 +65,13 @@ async function withPackages(packageManagerInfo, packageDescriptors, callback) {
65
65
  fs_1.default.unlinkSync(packageLock.path);
66
66
  fs_1.default.copyFileSync(packageLock.backup, packageLock.path);
67
67
  }
68
- child_process_1.default.execSync(recoverCmd);
68
+ child_process_1.default.spawnSync(packageManagerInfo.type, recoverArgs, {
69
+ stdio: 'inherit',
70
+ });
71
+ });
72
+ child_process_1.default.spawnSync(packageManagerInfo.type, cmdArgs, {
73
+ stdio: 'inherit',
69
74
  });
70
- child_process_1.default.execSync(cmd);
71
75
  return callback();
72
76
  }
73
77
  finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charcoal-ui/tailwind-diff",
3
- "version": "4.6.1-beta.0",
3
+ "version": "4.6.1",
4
4
  "bin": "bin/tailwind-diff.js",
5
5
  "dependencies": {
6
6
  "import-from": "^4.0.0",
@@ -53,19 +53,19 @@ export async function withPackages<T>(
53
53
  fs.copyFileSync(packageLock.path, packageLock.backup)
54
54
  }
55
55
 
56
- let cmd: string, recoverCmd: string
56
+ let cmdArgs: string[], recoverArgs: string[]
57
57
  switch (packageManagerInfo.type) {
58
58
  case 'npm':
59
- cmd = `npm install ${packageDescriptors.join(' ')}`
60
- recoverCmd = 'npm install'
59
+ cmdArgs = ['install', ...packageDescriptors]
60
+ recoverArgs = ['install']
61
61
  break
62
62
  case 'yarn':
63
- cmd = `yarn add ${packageDescriptors.join(' ')}`
64
- recoverCmd = 'yarn install'
63
+ cmdArgs = ['add', ...packageDescriptors]
64
+ recoverArgs = ['install']
65
65
  break
66
66
  case 'pnpm':
67
- cmd = `pnpm add ${packageDescriptors.join(' ')}`
68
- recoverCmd = 'pnpm install'
67
+ cmdArgs = ['add', ...packageDescriptors]
68
+ recoverArgs = ['install']
69
69
  break
70
70
  }
71
71
 
@@ -77,9 +77,13 @@ export async function withPackages<T>(
77
77
  fs.unlinkSync(packageLock.path)
78
78
  fs.copyFileSync(packageLock.backup, packageLock.path)
79
79
  }
80
- child_process.execSync(recoverCmd)
80
+ child_process.spawnSync(packageManagerInfo.type, recoverArgs, {
81
+ stdio: 'inherit',
82
+ })
83
+ })
84
+ child_process.spawnSync(packageManagerInfo.type, cmdArgs, {
85
+ stdio: 'inherit',
81
86
  })
82
- child_process.execSync(cmd)
83
87
 
84
88
  return callback()
85
89
  } finally {