Skip to content

Commit

Permalink
refactor: Switch to tinyexec to reduce install size (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian authored Nov 19, 2024
1 parent e8f20fa commit 88e955e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 212 deletions.
213 changes: 7 additions & 206 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
],
"dependencies": {
"@clack/prompts": "^0.6.3",
"execa": "^8.0.1",
"kolorist": "^1.8.0"
"kolorist": "^1.8.0",
"tinyexec": "^0.3.1"
},
"devDependencies": {
"@types/node": "^20.2.3",
Expand Down
10 changes: 6 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { promises as fs, existsSync } from 'node:fs';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import * as prompts from '@clack/prompts';
import { execa } from 'execa';
import { x } from 'tinyexec';
import * as kl from 'kolorist';

const s = prompts.spinner();
Expand Down Expand Up @@ -238,7 +238,7 @@ async function installDeps(to, opts) {
* @param {{ packageManager: 'yarn' | 'pnpm' | 'npm', to: string, dev?: boolean }} opts
*/
function installPackages(pkgs, opts) {
return execa(
return x(
opts.packageManager,
[
// `yarn add` will fail if nothing is provided
Expand All @@ -247,8 +247,10 @@ function installPackages(pkgs, opts) {
...pkgs,
].filter(Boolean),
{
stdio: 'ignore',
cwd: opts.to,
nodeOptions: {
stdio: 'ignore',
cwd: opts.to,
}
},
);
}
Expand Down

0 comments on commit 88e955e

Please sign in to comment.