From 03a122fe38d24b41c0511c7d7c79b755389922a4 Mon Sep 17 00:00:00 2001 From: AdrianGonz97 <31664583+AdrianGonz97@users.noreply.github.com> Date: Thu, 17 Oct 2024 11:08:32 -0400 Subject: [PATCH 1/2] remove auto install --- packages/cli/common.ts | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/packages/cli/common.ts b/packages/cli/common.ts index 981af31da..d7dad929b 100644 --- a/packages/cli/common.ts +++ b/packages/cli/common.ts @@ -50,32 +50,28 @@ export async function formatFiles(cwd: string, paths: string[]): Promise { type PackageManagerOptions = Array<{ value: AgentName | null; label: AgentName | 'None' }>; export async function suggestInstallingDependencies(cwd: string): Promise<'installed' | 'skipped'> { - const detectedPm = detectSync({ cwd }); - let selectedPm = detectedPm?.agent ?? null; + const detected = detectSync({ cwd }); + const agent = detected?.agent ?? getUserAgent() ?? null; const agents = AGENTS.filter((agent): agent is AgentName => !agent.includes('@')); const options: PackageManagerOptions = agents.map((pm) => ({ value: pm, label: pm })); options.unshift({ label: 'None', value: null }); - if (!selectedPm) { - const pm = await p.select({ - message: 'Which package manager do you want to install dependencies with?', - options, - initialValue: getUserAgent() - }); - if (p.isCancel(pm)) { - p.cancel('Operation cancelled.'); - process.exit(1); - } - - selectedPm = pm; + const pm = await p.select({ + message: 'Which package manager do you want to install dependencies with?', + options, + initialValue: agent + }); + if (p.isCancel(pm)) { + p.cancel('Operation cancelled.'); + process.exit(1); } - if (!selectedPm || !COMMANDS[selectedPm]) { + if (!pm) { return 'skipped'; } - const { command, args } = constructCommand(COMMANDS[selectedPm].install, [])!; + const { command, args } = constructCommand(COMMANDS[pm].install, [])!; const loadingSpinner = p.spinner(); loadingSpinner.start('Installing dependencies...'); From ea57fb3e86c3eeb2f5447c6ada408638fd9dfc2f Mon Sep 17 00:00:00 2001 From: AdrianGonz97 <31664583+AdrianGonz97@users.noreply.github.com> Date: Thu, 17 Oct 2024 11:11:29 -0400 Subject: [PATCH 2/2] changesets --- .changeset/few-pots-fold.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/few-pots-fold.md diff --git a/.changeset/few-pots-fold.md b/.changeset/few-pots-fold.md new file mode 100644 index 000000000..cd2b07949 --- /dev/null +++ b/.changeset/few-pots-fold.md @@ -0,0 +1,5 @@ +--- +'sv': patch +--- + +chore: remove auto-installing dependencies