Skip to content

Commit 88e955e

Browse files
authored
refactor: Switch to tinyexec to reduce install size (#27)
1 parent e8f20fa commit 88e955e

File tree

3 files changed

+15
-212
lines changed

3 files changed

+15
-212
lines changed

package-lock.json

Lines changed: 7 additions & 206 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
],
2525
"dependencies": {
2626
"@clack/prompts": "^0.6.3",
27-
"execa": "^8.0.1",
28-
"kolorist": "^1.8.0"
27+
"kolorist": "^1.8.0",
28+
"tinyexec": "^0.3.1"
2929
},
3030
"devDependencies": {
3131
"@types/node": "^20.2.3",

src/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { promises as fs, existsSync } from 'node:fs';
33
import { dirname, resolve } from 'node:path';
44
import { fileURLToPath } from 'node:url';
55
import * as prompts from '@clack/prompts';
6-
import { execa } from 'execa';
6+
import { x } from 'tinyexec';
77
import * as kl from 'kolorist';
88

99
const s = prompts.spinner();
@@ -238,7 +238,7 @@ async function installDeps(to, opts) {
238238
* @param {{ packageManager: 'yarn' | 'pnpm' | 'npm', to: string, dev?: boolean }} opts
239239
*/
240240
function installPackages(pkgs, opts) {
241-
return execa(
241+
return x(
242242
opts.packageManager,
243243
[
244244
// `yarn add` will fail if nothing is provided
@@ -247,8 +247,10 @@ function installPackages(pkgs, opts) {
247247
...pkgs,
248248
].filter(Boolean),
249249
{
250-
stdio: 'ignore',
251-
cwd: opts.to,
250+
nodeOptions: {
251+
stdio: 'ignore',
252+
cwd: opts.to,
253+
}
252254
},
253255
);
254256
}

0 commit comments

Comments
 (0)