bunvm 1.0.0 → 1.0.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.
package/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  **BVM** is a simple and fast CLI tool to manage multiple versions of [Bun](https://bun.sh), the all-in-one JavaScript runtime. Inspired by tools like `nvm` and `rvm`, BVM lets you easily install, switch, and manage different Bun versions.
4
4
 
5
- > ⚠️ Currently in active development – contributions and feedback are welcome!
6
-
7
5
  ---
8
6
 
9
7
  ## 🚀 Features
@@ -33,22 +31,24 @@
33
31
 
34
32
  ## 📦 Installation
35
33
 
36
- ### Install from npm (Coming Soon)
34
+ ### Install from npm
37
35
 
38
36
  ```bash
39
37
  # With npm
40
- npm install -g bvm
38
+ npm install -g bunvm
41
39
 
42
40
  # With pnpm (recommended)
43
- pnpm add -g bvm
41
+ pnpm add -g bunvm
44
42
 
45
43
  # With yarn
46
- yarn global add bvm
44
+ yarn global add bunvm
47
45
 
48
- # Bun
49
- bun add -g bvm
46
+ # With Bun
47
+ bun add -g bunvm
50
48
  ```
51
49
 
50
+ After installation, you can use the `bvm` command from anywhere in your terminal.
51
+
52
52
  ### Install from source
53
53
 
54
54
  ```bash
package/dist/bvm.js CHANGED
@@ -13,5 +13,5 @@ ${r}${t}`,u=!0),c.includes(N)||(v+=`
13
13
  # bun completions
14
14
  ${o}`,u=!0),u&&(await Y(i,v),n.success(`Updated ${i} with Bun configuration`));return}catch(c){let u=c instanceof Error?c.message:String(c);n.warn(`Could not update ${i}: ${u}`)}n.warn(`No writable ${e} config file found. Please add manually.`)}async function W(){let e=X();if(!e){n.warn("Unknown shell. Please manually add Bun to your shell config.");return}await ke(e)}async function E(e){let r=Te(p,e,"bun");if(!Ce(r)){n.error(`Bun version ${e} is not installed.`),n.info(`Run ${Me.cyan(`bvm install ${e}`)} to install it.`);return}try{_(y),M(r,s),M(r,x),await J(),n.success(`Now using Bun ${e}`)}catch(t){n.error(`Failed to switch Bun version: ${t.message}`)}}async function q(e){let r=Z(p,e),t=Z(r,"bun");if(L(r)&&L(t)){n.warn(`Bun ${U.green(`v${e}`)} is already installed.`);return}if(Ve(r,{recursive:!0}),n.log(`${U.cyan("\u{1F4E5} Installing")} Bun ${U.green(`v${e}`)}...`),await G(e,t),!L(s)||!L(x)){n.warn("No previously installed Bun versions found. Setting up environment..."),_(y);try{await W()}catch(o){n.error(`Failed to configure shell: ${o.message}. Please set up completions manually.`)}await E(e);return}n.success(`Installed Bun ${U.bold(`v${e}`)}`)}import Q from"chalk";import De from"axios";function ee(){try{let e=V();n.log(`Current Bun version: ${e??"none"}`);let r=D();if(r.length===0){n.warn("No Bun versions installed yet.");return}n.log(Q.green(`\u{1F680} Installed Bun versions:
15
15
  `)),r.forEach(t=>{n.log(F(t,e,new Set(r)))})}catch{n.error("No Bun versions installed yet.")}}async function re(){try{let{data:e}=await De.get(H),r=e.map(({tag_name:i})=>i.replace(/^bun-v/,""));if(r.length===0){n.warn("No Bun versions found remotely.");return}let t=D(),o=new Set(t),a=V();n.log(Q.green(`\u{1F680} Available Bun versions:
16
- `)),r.forEach(i=>{n.log(F(i,a,o))})}catch(e){n.error(`Error fetching remote versions: ${e instanceof Error?e.message:e}`)}}import{join as ne,resolve as te}from"path";import{existsSync as A,readlinkSync as Fe,rmSync as oe}from"fs";import Ae from"chalk";function ie(e){let r=ne(p,e),t=ne(r,"bun");if(!A(r)||!A(t)){n.warn(`Bun version ${e} is not installed.`);return}if(A(s))try{te(Fe(s))===te(t)&&(oe(s,{force:!0}),n.log(`\u{1F517} Removed active symlink for Bun ${e}.`))}catch{}try{oe(r,{recursive:!0,force:!0}),n.log(Ae.green(`\u{1F5D1}\uFE0F Bun ${e} has been uninstalled.`))}catch(o){n.error(`Failed to uninstall Bun ${e}: ${o.message}`)}}var se="1.0.0";var h=new Oe;h.name("bvm").description("Bun Version Manager - Manage multiple Bun versions").version(se);h.command("install <version>").alias("i").description("Install a specific Bun version").action(q);h.command("use <version>").description("Use a specific Bun version").action(E);h.command("uninstall <version>").alias("u").description("Uninstall a specific Bun version").action(ie);h.command("list").alias("ls").description("List installed Bun versions").action(ee);h.command("remote").alias("r").description("List remote Bun versions").action(re);h.parse();
16
+ `)),r.forEach(i=>{n.log(F(i,a,o))})}catch(e){n.error(`Error fetching remote versions: ${e instanceof Error?e.message:e}`)}}import{join as ne,resolve as te}from"path";import{existsSync as A,readlinkSync as Fe,rmSync as oe}from"fs";import Ae from"chalk";function ie(e){let r=ne(p,e),t=ne(r,"bun");if(!A(r)||!A(t)){n.warn(`Bun version ${e} is not installed.`);return}if(A(s))try{te(Fe(s))===te(t)&&(oe(s,{force:!0}),n.log(`\u{1F517} Removed active symlink for Bun ${e}.`))}catch{}try{oe(r,{recursive:!0,force:!0}),n.log(Ae.green(`\u{1F5D1}\uFE0F Bun ${e} has been uninstalled.`))}catch(o){n.error(`Failed to uninstall Bun ${e}: ${o.message}`)}}var se="1.0.1";var h=new Oe;h.name("bvm").description("Bun Version Manager - Manage multiple Bun versions").version(se);h.command("install <version>").alias("i").description("Install a specific Bun version").action(q);h.command("use <version>").description("Use a specific Bun version").action(E);h.command("uninstall <version>").alias("u").description("Uninstall a specific Bun version").action(ie);h.command("list").alias("ls").description("List installed Bun versions").action(ee);h.command("remote").alias("r").description("List remote Bun versions").action(re);h.parse();
17
17
  //# sourceMappingURL=bvm.js.map
package/dist/bvm.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/bvm.ts","../src/commands/install.ts","../src/lib/constants.ts","../src/lib/logger.ts","../src/lib/utils.ts","../src/lib/file.ts","../src/commands/use.ts","../src/lib/shell.ts","../src/commands/versions.ts","../src/commands/uninstall.ts","../package.json"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from 'commander'\nimport { installBun } from './commands/install'\nimport { useVersion } from './commands/use'\nimport { listRemoteVersions, listVersions } from './commands/versions'\nimport { uninstallBun } from './commands/uninstall'\nimport { version } from '../package.json'\n\nconst program = new Command()\n\nprogram\n .name('bvm')\n .description('Bun Version Manager - Manage multiple Bun versions')\n .version(version)\n\nprogram\n .command('install <version>')\n .alias('i')\n .description('Install a specific Bun version')\n .action(installBun)\n\nprogram\n .command('use <version>')\n .description('Use a specific Bun version')\n .action(useVersion)\n\nprogram\n .command('uninstall <version>')\n .alias('u')\n .description('Uninstall a specific Bun version')\n .action(uninstallBun)\n\nprogram\n .command('list')\n .alias('ls')\n .description('List installed Bun versions')\n .action(listVersions)\n\nprogram\n .command('remote')\n .alias('r')\n .description('List remote Bun versions')\n .action(listRemoteVersions)\n\nprogram.parse()\n","import { mkdirSync, existsSync } from 'node:fs'\nimport { join } from 'node:path'\nimport chalk from 'chalk'\nimport {\n BUN_VERSIONS_DIR,\n BUN_BIN_DIR,\n BUNX_SYMLINK,\n BUN_SYMLINK,\n} from '../lib/constants'\nimport { log } from '../lib/logger'\nimport { downloadBun } from '../lib/utils'\nimport { ensureDirectoryExists } from '../lib/file'\nimport { useVersion } from './use'\nimport { autoConfigureShell } from '../lib/shell'\n\nexport async function installBun(version: string): Promise<void> {\n const versionDir = join(BUN_VERSIONS_DIR, version)\n const bunBinaryPath = join(versionDir, 'bun')\n\n if (existsSync(versionDir) && existsSync(bunBinaryPath)) {\n log.warn(`Bun ${chalk.green(`v${version}`)} is already installed.`)\n return\n }\n\n mkdirSync(versionDir, { recursive: true })\n\n log.log(`${chalk.cyan('📥 Installing')} Bun ${chalk.green(`v${version}`)}...`)\n\n await downloadBun(version, bunBinaryPath)\n\n if (!existsSync(BUN_SYMLINK) || !existsSync(BUNX_SYMLINK)) {\n log.warn(\n `No previously installed Bun versions found. Setting up environment...`,\n )\n\n ensureDirectoryExists(BUN_BIN_DIR)\n\n try {\n await autoConfigureShell()\n } catch (err) {\n log.error(\n `Failed to configure shell: ${(err as Error).message}. Please set up completions manually.`,\n )\n }\n\n await useVersion(version)\n return\n }\n\n log.success(`Installed Bun ${chalk.bold(`v${version}`)}`)\n}\n","import { homedir } from 'node:os'\nimport { join } from 'node:path'\n\nexport const BUN_DIR = join(homedir(), '.bun')\n\nexport const BUN_BIN_DIR = join(BUN_DIR, 'bin')\n\nexport const BUN_SYMLINK = join(BUN_BIN_DIR, 'bun')\n\nexport const BUNX_SYMLINK = join(BUN_BIN_DIR, 'bunx')\n\nexport const BVM_DIR = join(homedir(), '.bvm')\n\nexport const BUN_VERSIONS_DIR = join(BVM_DIR, 'versions')\n\nexport const GITHUB_API_URL = 'https://api.github.com'\n\nexport const GITHUB_RELEASES_URL = `${GITHUB_API_URL}/repos/oven-sh/bun/releases`\n\nexport const BUN_COMPLETION_FILE = join(BUN_DIR, '_bun')\n\nexport const FISH_CONFIG_PATH = join(\n homedir(),\n '.config',\n 'fish',\n 'config.fish',\n)\n","import chalk from 'chalk'\n\nexport const log = {\n log: (msg: string) => console.log(msg),\n info: (msg: string) => console.log(`${chalk.blue('i')} ${msg}`),\n success: (msg: string) => console.log(`${chalk.green('✅')} ${msg}`),\n warn: (msg: string) =>\n console.warn(`${chalk.yellow('⚠️')} ${chalk.yellow(msg)}`),\n error: (msg: string) => console.error(`${chalk.red('❌')} ${chalk.red(msg)}`),\n}\n","import { execSync } from 'node:child_process'\nimport { createReadStream, existsSync, readdirSync } from 'node:fs'\nimport { BUN_VERSIONS_DIR } from './constants'\nimport chalk from 'chalk'\nimport { dirname, join } from 'node:path'\nimport axios from 'axios'\nimport { log } from './logger'\nimport { pipeline } from 'node:stream/promises'\nimport unzipper from 'unzipper'\nimport { chmod } from 'node:fs/promises'\nimport { cleanPath, exists, formatBytes, streamToFile } from './file'\nimport cliProgress from 'cli-progress'\n\nexport function getCurrentBunVersion(): string | null {\n try {\n const output = execSync('bun --version', {\n encoding: 'utf8',\n stdio: ['pipe'],\n }).trim()\n return output || null\n } catch {\n return null\n }\n}\n\nexport function getInstalledBunVersions(): string[] {\n return existsSync(BUN_VERSIONS_DIR) ? readdirSync(BUN_VERSIONS_DIR) : []\n}\n\nexport function formatVersionInfo(\n version: string,\n currentVersion: string | null,\n installedVersions: Set<string>,\n): string {\n const isActive = currentVersion === version\n const isInstalled = installedVersions.has(version)\n\n if (isActive) {\n return `${chalk.magenta('v' + version)} ${chalk.yellow('⭐ (current)')}`\n }\n\n if (isInstalled) {\n return `${chalk.magenta('v' + version)} ${chalk.green('✓ (installed)')}`\n }\n\n return `${chalk.magenta('v' + version)} ${chalk.red('✗ (not installed)')}`\n}\n\nfunction getPlatformTarget(): string {\n return `${process.platform}-${process.arch}`\n}\n\nfunction registerCleanup(dir: string): () => void {\n async function cleanup() {\n console.log(chalk.red('\\nDownload interrupted. Cleaning up...'))\n await cleanPath(dir, true)\n process.exit(1)\n }\n\n process.once('SIGINT', cleanup)\n return () => process.removeListener('SIGINT', cleanup)\n}\n\nexport async function downloadBun(\n version: string,\n destPath: string,\n): Promise<void> {\n const target = getPlatformTarget()\n const url = `https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-${target}.zip`\n const zipPath = `${destPath}.zip`\n const destDir = dirname(destPath)\n const extractedDir = join(destDir, `bun-${target}`)\n const extractedBunPath = join(extractedDir, 'bun')\n\n const removeCleanupListener = registerCleanup(destDir)\n\n try {\n const response = await axios.get<NodeJS.ReadableStream>(url, {\n responseType: 'stream',\n })\n\n if (response.status !== 200) {\n throw new Error(`Failed to download ZIP file. Status: ${response.status}`)\n }\n\n const total = Number(response.headers['content-length']) || 0\n let downloaded = 0\n const progress = new cliProgress.SingleBar(\n {\n format: `${chalk.magenta('Downloading')} {bar} {percentage}% | {downloaded}/{totalSize}`,\n barCompleteChar: '█',\n barIncompleteChar: '░',\n hideCursor: true,\n },\n cliProgress.Presets.shades_classic,\n )\n\n if (total) {\n progress.start(total, 0, {\n downloaded: '0 B',\n totalSize: formatBytes(total),\n })\n }\n\n response.data.on('data', (chunk: Buffer) => {\n downloaded += chunk.length\n if (total) {\n progress.update(downloaded, {\n downloaded: formatBytes(downloaded),\n totalSize: formatBytes(total),\n })\n }\n })\n\n await streamToFile(response.data, zipPath)\n if (total) progress.stop()\n\n log.log(chalk.yellow('📦 Extracting...'))\n\n await pipeline(\n createReadStream(zipPath),\n unzipper.Extract({ path: destDir }),\n )\n\n if (!(await exists(extractedBunPath))) {\n throw new Error(`Expected binary not found at ${extractedBunPath}`)\n }\n\n await streamToFile(createReadStream(extractedBunPath), destPath)\n await chmod(destPath, 0o755)\n\n await cleanPath(extractedDir, true)\n await cleanPath(zipPath)\n\n log.success(`Downloaded Bun ${chalk.bold(`v${version}`)}`)\n } catch (error) {\n log.error(\n `Failed to install Bun: ${error instanceof Error ? error.message : error}`,\n )\n await cleanPath(destDir, true)\n process.exit(1)\n } finally {\n removeCleanupListener()\n }\n}\n","import {\n createWriteStream,\n existsSync,\n lstatSync,\n mkdirSync,\n rmSync,\n symlinkSync,\n} from 'node:fs'\nimport { rm, stat, unlink } from 'node:fs/promises'\nimport { log } from './logger'\n\nexport async function streamToFile(\n readable: NodeJS.ReadableStream,\n path: string,\n): Promise<void> {\n const writer = createWriteStream(path)\n await new Promise<void>((resolve, reject) => {\n writer.on('finish', resolve)\n writer.on('error', reject)\n readable.pipe(writer)\n })\n}\n\nexport async function exists(path: string): Promise<boolean> {\n try {\n await stat(path)\n return true\n } catch {\n return false\n }\n}\n\nexport async function cleanPath(\n path: string,\n isDirectory = false,\n): Promise<void> {\n try {\n if (await exists(path)) {\n if (isDirectory) {\n await rm(path, { recursive: true, force: true })\n } else {\n await unlink(path)\n }\n }\n } catch (error) {\n const err = error as NodeJS.ErrnoException\n if (err.code !== 'ENOENT') {\n log.warn(`Failed to clean path: ${path}`)\n }\n }\n}\n\nexport function formatBytes(bytes: number): string {\n const sizes = ['B', 'KB', 'MB', 'GB']\n if (bytes === 0) return '0 B'\n const i = Math.floor(Math.log(bytes) / Math.log(1024))\n return `${(bytes / Math.pow(1024, i)).toFixed(1)} ${sizes[i]}`\n}\n\nexport function ensureDirectoryExists(dir: string): void {\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true })\n }\n}\n\nexport function removeExistingLink(path: string): void {\n if (existsSync(path)) {\n const isSymlink = lstatSync(path).isSymbolicLink()\n try {\n rmSync(path, { force: true })\n if (!isSymlink) {\n log.warn(`Replaced non-symlink file at ${path}`)\n }\n } catch (error) {\n log.warn(\n `Couldn't remove existing file at ${path}: ${(error as Error).message}`,\n )\n }\n }\n}\n\nexport function createSymlink(src: string, dest: string): void {\n if (existsSync(src)) {\n removeExistingLink(dest)\n symlinkSync(src, dest)\n }\n}\n","import { join } from 'node:path'\nimport { existsSync } from 'node:fs'\nimport chalk from 'chalk'\nimport { log } from '../lib/logger'\nimport {\n BUN_BIN_DIR,\n BUN_SYMLINK,\n BUN_VERSIONS_DIR,\n BUNX_SYMLINK,\n} from '../lib/constants'\nimport { createSymlink, ensureDirectoryExists } from '../lib/file'\nimport { setupCompletions } from '../lib/shell'\n\nexport async function useVersion(version: string): Promise<void> {\n const versionBin = join(BUN_VERSIONS_DIR, version, 'bun')\n\n if (!existsSync(versionBin)) {\n log.error(`Bun version ${version} is not installed.`)\n log.info(`Run ${chalk.cyan(`bvm install ${version}`)} to install it.`)\n return\n }\n\n try {\n ensureDirectoryExists(BUN_BIN_DIR)\n createSymlink(versionBin, BUN_SYMLINK)\n createSymlink(versionBin, BUNX_SYMLINK)\n await setupCompletions()\n\n log.success(`Now using Bun ${version}`)\n } catch (err) {\n log.error(`Failed to switch Bun version: ${(err as Error).message}`)\n }\n}\n","import { homedir } from 'node:os'\nimport { join } from 'node:path'\nimport { log } from './logger'\nimport { readFile, writeFile } from 'node:fs/promises'\nimport {\n BUN_COMPLETION_FILE,\n BUN_DIR,\n BUN_SYMLINK,\n FISH_CONFIG_PATH,\n} from './constants'\nimport { exists } from './file'\nimport { execSync } from 'node:child_process'\nimport { Shell } from './types'\n\nexport async function setupCompletions(): Promise<void> {\n if (!(await exists(BUN_SYMLINK))) {\n log.error(`Bun binary not found at ${BUN_SYMLINK}, skipping completions`)\n return\n }\n\n const shell = getShell()\n\n if (!shell) {\n log.warn('Unknown shell. Please manually set up Bun completions.')\n return\n }\n\n try {\n execSync(`${BUN_SYMLINK} completions`, {\n env: {\n ...process.env,\n IS_BUN_AUTO_UPDATE: 'true',\n SHELL: shell,\n },\n stdio: 'ignore',\n })\n } catch (error) {\n log.error(`Failed to set up ${shell} completions: ${error}`)\n }\n}\n\nfunction getShell(): Shell | null {\n const shellPath = process.env.SHELL ?? ''\n if (shellPath.includes('bash')) return 'bash'\n if (shellPath.includes('zsh')) return 'zsh'\n if (shellPath.includes('fish')) return 'fish'\n return null\n}\n\nexport function getShellConfigPath(shell: Shell): string[] {\n const home = homedir()\n switch (shell) {\n case 'bash': {\n const xdg = process.env.XDG_CONFIG_HOME\n return [\n join(home, '.bashrc'),\n join(home, '.bash_profile'),\n ...(xdg\n ? [\n join(xdg, '.bashrc'),\n join(xdg, '.bash_profile'),\n join(xdg, 'bashrc'),\n join(xdg, 'bash_profile'),\n ]\n : []),\n ]\n }\n case 'zsh':\n return [join(home, '.zshrc')]\n case 'fish':\n return [join(home, '.config', 'fish', 'config.fish')]\n default:\n return []\n }\n}\n\nasync function configureFish(): Promise<void> {\n const fishLines = [\n `set --export BUN_INSTALL \"${BUN_DIR}\"`,\n `set --export PATH \"$BUN_INSTALL/bin\" $PATH`,\n ]\n\n if (await exists(FISH_CONFIG_PATH)) {\n try {\n const content = await readFile(FISH_CONFIG_PATH, 'utf8')\n const missingLines = fishLines.filter((line) => !content.includes(line))\n\n if (missingLines.length > 0) {\n const newContent = content + `\\n# bun\\n${missingLines.join('\\n')}\\n`\n await writeFile(FISH_CONFIG_PATH, newContent)\n log.success(`Updated ${FISH_CONFIG_PATH} with Bun configuration`)\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n log.warn(`Could not update Fish config: ${message}`)\n }\n } else {\n log.warn(\n 'Fish config file not found. Please add Bun configuration manually.',\n )\n }\n}\n\nasync function configureShell(shell: Shell): Promise<void> {\n if (!shell) {\n log.warn('Invalid shell provided')\n return\n }\n\n if (shell === 'fish') {\n await configureFish()\n return\n }\n\n const bunInstallLine = `export BUN_INSTALL=\"${BUN_DIR}\"\\n`\n const pathLine = `export PATH=\"$BUN_INSTALL/bin:$PATH\"\\n`\n const completionLine = `[ -s \"${BUN_COMPLETION_FILE}\" ] && source \"${BUN_COMPLETION_FILE}\"\\n`\n\n const configPaths = getShellConfigPath(shell)\n\n for (const configPath of configPaths) {\n if (await exists(configPath)) {\n try {\n const content = await readFile(configPath, 'utf8')\n let updated = false\n let newContent = content\n\n if (!content.includes('BUN_INSTALL')) {\n newContent += `\\n# bun\\n${bunInstallLine}${pathLine}`\n updated = true\n }\n\n if (!content.includes(BUN_COMPLETION_FILE)) {\n newContent += `\\n# bun completions\\n${completionLine}`\n updated = true\n }\n\n if (updated) {\n await writeFile(configPath, newContent)\n log.success(`Updated ${configPath} with Bun configuration`)\n }\n return\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n log.warn(`Could not update ${configPath}: ${message}`)\n }\n }\n }\n\n log.warn(`No writable ${shell} config file found. Please add manually.`)\n}\n\nexport async function autoConfigureShell(): Promise<void> {\n const shell = getShell()\n if (!shell) {\n log.warn('Unknown shell. Please manually add Bun to your shell config.')\n return\n }\n\n await configureShell(shell)\n}\n","import {\n formatVersionInfo,\n getCurrentBunVersion,\n getInstalledBunVersions,\n} from '../lib/utils'\nimport { GITHUB_RELEASES_URL } from '../lib/constants'\nimport { log } from '../lib/logger'\nimport chalk from 'chalk'\nimport axios from 'axios'\n\ntype Release = { tag_name: string }\n\nexport function listVersions(): void {\n try {\n const currentVersion = getCurrentBunVersion()\n log.log(`Current Bun version: ${currentVersion ?? 'none'}`)\n\n const versions = getInstalledBunVersions()\n\n if (versions.length === 0) {\n log.warn('No Bun versions installed yet.')\n return\n }\n\n log.log(chalk.green('🚀 Installed Bun versions:\\n'))\n versions.forEach((version) => {\n log.log(formatVersionInfo(version, currentVersion, new Set(versions)))\n })\n } catch {\n log.error('No Bun versions installed yet.')\n }\n}\n\nexport async function listRemoteVersions(): Promise<void> {\n try {\n const { data } = await axios.get<Release[]>(GITHUB_RELEASES_URL)\n const versions = data.map(({ tag_name }) => tag_name.replace(/^bun-v/, ''))\n\n if (versions.length === 0) {\n log.warn('No Bun versions found remotely.')\n return\n }\n\n const installedVersions = getInstalledBunVersions()\n const installedVersionsSet = new Set(installedVersions)\n const activeVersion = getCurrentBunVersion()\n\n log.log(chalk.green('🚀 Available Bun versions:\\n'))\n versions.forEach((version) => {\n log.log(formatVersionInfo(version, activeVersion, installedVersionsSet))\n })\n } catch (err) {\n log.error(\n `Error fetching remote versions: ${err instanceof Error ? err.message : err}`,\n )\n }\n}\n","import { join, resolve } from 'node:path'\nimport { existsSync, readlinkSync, rmSync } from 'node:fs'\nimport { log } from '../lib/logger'\nimport { BUN_SYMLINK, BUN_VERSIONS_DIR } from '../lib/constants'\nimport chalk from 'chalk'\n\nexport function uninstallBun(version: string): void {\n const versionDir = join(BUN_VERSIONS_DIR, version)\n const bunBinaryPath = join(versionDir, 'bun')\n\n if (!existsSync(versionDir) || !existsSync(bunBinaryPath)) {\n log.warn(`Bun version ${version} is not installed.`)\n return\n }\n\n // If the version is in use, remove the symlink.\n if (existsSync(BUN_SYMLINK)) {\n try {\n const target = resolve(readlinkSync(BUN_SYMLINK))\n if (target === resolve(bunBinaryPath)) {\n rmSync(BUN_SYMLINK, { force: true })\n log.log(`🔗 Removed active symlink for Bun ${version}.`)\n }\n } catch {\n // Ignore readlinkSync errors.\n }\n }\n\n try {\n rmSync(versionDir, { recursive: true, force: true })\n log.log(chalk.green(`🗑️ Bun ${version} has been uninstalled.`))\n } catch (err) {\n log.error(`Failed to uninstall Bun ${version}: ${(err as Error).message}`)\n }\n}\n","{\n \"name\": \"bunvm\",\n \"version\": \"1.0.0\",\n \"description\": \"Bun Version Manager - Switch between different versions of Bun easily\",\n \"bin\": {\n \"bvm\": \"./dist/bvm.js\"\n },\n \"type\": \"module\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.js\",\n \"scripts\": {\n \"build\": \"tsup\",\n \"dev\": \"tsx src/bvm.ts\",\n \"clean\": \"rm -rf dist\",\n \"prepublishOnly\": \"pnpm run clean && pnpm run build\",\n \"start\": \"node dist/bvm.js\",\n \"format\": \"prettier --write --ignore-path .gitignore --cache .\",\n \"lint\": \"eslint --ext .ts src --cache\",\n \"lint:fix\": \"eslint --ext .ts src --cache --fix\"\n },\n \"keywords\": [\n \"bun\",\n \"version\",\n \"manager\",\n \"version-manager\",\n \"bun version manager\",\n \"cli\",\n \"javascript\",\n \"typescript\",\n \"nodejs\"\n ],\n \"author\": \"Tarun Joshi\",\n \"license\": \"MIT\",\n \"homepage\": \"https://github.com/MrHacker26/bvm#readme\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/MrHacker26/bvm.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/MrHacker26/bvm/issues\"\n },\n \"files\": [\n \"dist\"\n ],\n \"packageManager\": \"pnpm@10.11.0\",\n \"dependencies\": {\n \"axios\": \"^1.9.0\",\n \"chalk\": \"^5.4.1\",\n \"cli-progress\": \"^3.12.0\",\n \"commander\": \"^13.1.0\",\n \"unzipper\": \"^0.12.3\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.27.0\",\n \"@types/cli-progress\": \"^3.11.6\",\n \"@types/node\": \"^22.15.18\",\n \"@types/unzipper\": \"^0.10.11\",\n \"@typescript-eslint/eslint-plugin\": \"^8.32.1\",\n \"@typescript-eslint/parser\": \"^8.32.1\",\n \"eslint\": \"^9.27.0\",\n \"globals\": \"^16.1.0\",\n \"prettier\": \"^3.5.3\",\n \"tsup\": \"^8.5.0\",\n \"tsx\": \"^4.19.4\",\n \"typescript\": \"^5.0.0\",\n \"typescript-eslint\": \"^8.32.1\"\n }\n}\n"],"mappings":";AAEA,OAAS,WAAAA,OAAe,YCFxB,OAAS,aAAAC,GAAW,cAAAC,MAAkB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAOC,MAAW,QCFlB,OAAS,WAA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MAAM,2BAA2BN,CAAO,KAAMW,EAAc,OAAO,EAAE,CAC3E,CACF,CChCE,IAAAC,GAAW,QVOb,IAAMC,EAAU,IAAIC,GAEpBD,EACG,KAAK,KAAK,EACV,YAAY,oDAAoD,EAChE,QAAQE,EAAO,EAElBF,EACG,QAAQ,mBAAmB,EAC3B,MAAM,GAAG,EACT,YAAY,gCAAgC,EAC5C,OAAOG,CAAU,EAEpBH,EACG,QAAQ,eAAe,EACvB,YAAY,4BAA4B,EACxC,OAAOI,CAAU,EAEpBJ,EACG,QAAQ,qBAAqB,EAC7B,MAAM,GAAG,EACT,YAAY,kCAAkC,EAC9C,OAAOK,EAAY,EAEtBL,EACG,QAAQ,MAAM,EACd,MAAM,IAAI,EACV,YAAY,6BAA6B,EACzC,OAAOM,EAAY,EAEtBN,EACG,QAAQ,QAAQ,EAChB,MAAM,GAAG,EACT,YAAY,0BAA0B,EACtC,OAAOO,EAAkB,EAE5BP,EAAQ,MAAM","names":["Command","mkdirSync","existsSync","join","chalk","homedir","join","BUN_DIR","BUN_BIN_DIR","BUN_SYMLINK","BUNX_SYMLINK","BVM_DIR","BUN_VERSIONS_DIR","GITHUB_API_URL","GITHUB_RELEASES_URL","BUN_COMPLETION_FILE","FISH_CONFIG_PATH","chalk","log","msg","execSync","createReadStream","existsSync","readdirSync","chalk","dirname","join","axios","pipeline","unzipper","chmod","createWriteStream","existsSync","lstatSync","mkdirSync","rmSync","symlinkSync","rm","stat","unlink","streamToFile","readable","path","writer","createWriteStream","resolve","reject","exists","stat","cleanPath","isDirectory","rm","unlink","error","log","formatBytes","bytes","sizes","i","ensureDirectoryExists","dir","existsSync","mkdirSync","removeExistingLink","isSymlink","lstatSync","rmSync","createSymlink","src","dest","symlinkSync","cliProgress","getCurrentBunVersion","execSync","getInstalledBunVersions","existsSync","BUN_VERSIONS_DIR","readdirSync","formatVersionInfo","version","currentVersion","installedVersions","isActive","isInstalled","chalk","getPlatformTarget","registerCleanup","dir","cleanup","cleanPath","downloadBun","destPath","target","url","zipPath","destDir","dirname","extractedDir","join","extractedBunPath","removeCleanupListener","response","axios","total","downloaded","progress","formatBytes","chunk","streamToFile","log","pipeline","createReadStream","unzipper","exists","chmod","error","join","existsSync","chalk","homedir","join","readFile","writeFile","execSync","setupCompletions","exists","BUN_SYMLINK","log","shell","getShell","error","shellPath","getShellConfigPath","home","homedir","xdg","join","configureFish","fishLines","BUN_DIR","FISH_CONFIG_PATH","content","readFile","missingLines","line","newContent","writeFile","message","configureShell","bunInstallLine","pathLine","completionLine","BUN_COMPLETION_FILE","configPaths","configPath","updated","autoConfigureShell","useVersion","version","versionBin","join","BUN_VERSIONS_DIR","existsSync","log","chalk","ensureDirectoryExists","BUN_BIN_DIR","createSymlink","BUN_SYMLINK","BUNX_SYMLINK","setupCompletions","err","installBun","version","versionDir","join","BUN_VERSIONS_DIR","bunBinaryPath","existsSync","log","chalk","mkdirSync","downloadBun","BUN_SYMLINK","BUNX_SYMLINK","ensureDirectoryExists","BUN_BIN_DIR","autoConfigureShell","err","useVersion","chalk","axios","listVersions","currentVersion","getCurrentBunVersion","log","versions","getInstalledBunVersions","version","formatVersionInfo","listRemoteVersions","data","GITHUB_RELEASES_URL","tag_name","installedVersions","installedVersionsSet","activeVersion","err","join","resolve","existsSync","readlinkSync","rmSync","chalk","uninstallBun","version","versionDir","join","BUN_VERSIONS_DIR","bunBinaryPath","existsSync","log","BUN_SYMLINK","resolve","readlinkSync","rmSync","err","version","program","Command","version","installBun","useVersion","uninstallBun","listVersions","listRemoteVersions"]}
1
+ {"version":3,"sources":["../src/bvm.ts","../src/commands/install.ts","../src/lib/constants.ts","../src/lib/logger.ts","../src/lib/utils.ts","../src/lib/file.ts","../src/commands/use.ts","../src/lib/shell.ts","../src/commands/versions.ts","../src/commands/uninstall.ts","../package.json"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from 'commander'\nimport { installBun } from './commands/install'\nimport { useVersion } from './commands/use'\nimport { listRemoteVersions, listVersions } from './commands/versions'\nimport { uninstallBun } from './commands/uninstall'\nimport { version } from '../package.json'\n\nconst program = new Command()\n\nprogram\n .name('bvm')\n .description('Bun Version Manager - Manage multiple Bun versions')\n .version(version)\n\nprogram\n .command('install <version>')\n .alias('i')\n .description('Install a specific Bun version')\n .action(installBun)\n\nprogram\n .command('use <version>')\n .description('Use a specific Bun version')\n .action(useVersion)\n\nprogram\n .command('uninstall <version>')\n .alias('u')\n .description('Uninstall a specific Bun version')\n .action(uninstallBun)\n\nprogram\n .command('list')\n .alias('ls')\n .description('List installed Bun versions')\n .action(listVersions)\n\nprogram\n .command('remote')\n .alias('r')\n .description('List remote Bun versions')\n .action(listRemoteVersions)\n\nprogram.parse()\n","import { mkdirSync, existsSync } from 'node:fs'\nimport { join } from 'node:path'\nimport chalk from 'chalk'\nimport {\n BUN_VERSIONS_DIR,\n BUN_BIN_DIR,\n BUNX_SYMLINK,\n BUN_SYMLINK,\n} from '../lib/constants'\nimport { log } from '../lib/logger'\nimport { downloadBun } from '../lib/utils'\nimport { ensureDirectoryExists } from '../lib/file'\nimport { useVersion } from './use'\nimport { autoConfigureShell } from '../lib/shell'\n\nexport async function installBun(version: string): Promise<void> {\n const versionDir = join(BUN_VERSIONS_DIR, version)\n const bunBinaryPath = join(versionDir, 'bun')\n\n if (existsSync(versionDir) && existsSync(bunBinaryPath)) {\n log.warn(`Bun ${chalk.green(`v${version}`)} is already installed.`)\n return\n }\n\n mkdirSync(versionDir, { recursive: true })\n\n log.log(`${chalk.cyan('📥 Installing')} Bun ${chalk.green(`v${version}`)}...`)\n\n await downloadBun(version, bunBinaryPath)\n\n if (!existsSync(BUN_SYMLINK) || !existsSync(BUNX_SYMLINK)) {\n log.warn(\n `No previously installed Bun versions found. Setting up environment...`,\n )\n\n ensureDirectoryExists(BUN_BIN_DIR)\n\n try {\n await autoConfigureShell()\n } catch (err) {\n log.error(\n `Failed to configure shell: ${(err as Error).message}. Please set up completions manually.`,\n )\n }\n\n await useVersion(version)\n return\n }\n\n log.success(`Installed Bun ${chalk.bold(`v${version}`)}`)\n}\n","import { homedir } from 'node:os'\nimport { join } from 'node:path'\n\nexport const BUN_DIR = join(homedir(), '.bun')\n\nexport const BUN_BIN_DIR = join(BUN_DIR, 'bin')\n\nexport const BUN_SYMLINK = join(BUN_BIN_DIR, 'bun')\n\nexport const BUNX_SYMLINK = join(BUN_BIN_DIR, 'bunx')\n\nexport const BVM_DIR = join(homedir(), '.bvm')\n\nexport const BUN_VERSIONS_DIR = join(BVM_DIR, 'versions')\n\nexport const GITHUB_API_URL = 'https://api.github.com'\n\nexport const GITHUB_RELEASES_URL = `${GITHUB_API_URL}/repos/oven-sh/bun/releases`\n\nexport const BUN_COMPLETION_FILE = join(BUN_DIR, '_bun')\n\nexport const FISH_CONFIG_PATH = join(\n homedir(),\n '.config',\n 'fish',\n 'config.fish',\n)\n","import chalk from 'chalk'\n\nexport const log = {\n log: (msg: string) => console.log(msg),\n info: (msg: string) => console.log(`${chalk.blue('i')} ${msg}`),\n success: (msg: string) => console.log(`${chalk.green('✅')} ${msg}`),\n warn: (msg: string) =>\n console.warn(`${chalk.yellow('⚠️')} ${chalk.yellow(msg)}`),\n error: (msg: string) => console.error(`${chalk.red('❌')} ${chalk.red(msg)}`),\n}\n","import { execSync } from 'node:child_process'\nimport { createReadStream, existsSync, readdirSync } from 'node:fs'\nimport { BUN_VERSIONS_DIR } from './constants'\nimport chalk from 'chalk'\nimport { dirname, join } from 'node:path'\nimport axios from 'axios'\nimport { log } from './logger'\nimport { pipeline } from 'node:stream/promises'\nimport unzipper from 'unzipper'\nimport { chmod } from 'node:fs/promises'\nimport { cleanPath, exists, formatBytes, streamToFile } from './file'\nimport cliProgress from 'cli-progress'\n\nexport function getCurrentBunVersion(): string | null {\n try {\n const output = execSync('bun --version', {\n encoding: 'utf8',\n stdio: ['pipe'],\n }).trim()\n return output || null\n } catch {\n return null\n }\n}\n\nexport function getInstalledBunVersions(): string[] {\n return existsSync(BUN_VERSIONS_DIR) ? readdirSync(BUN_VERSIONS_DIR) : []\n}\n\nexport function formatVersionInfo(\n version: string,\n currentVersion: string | null,\n installedVersions: Set<string>,\n): string {\n const isActive = currentVersion === version\n const isInstalled = installedVersions.has(version)\n\n if (isActive) {\n return `${chalk.magenta('v' + version)} ${chalk.yellow('⭐ (current)')}`\n }\n\n if (isInstalled) {\n return `${chalk.magenta('v' + version)} ${chalk.green('✓ (installed)')}`\n }\n\n return `${chalk.magenta('v' + version)} ${chalk.red('✗ (not installed)')}`\n}\n\nfunction getPlatformTarget(): string {\n return `${process.platform}-${process.arch}`\n}\n\nfunction registerCleanup(dir: string): () => void {\n async function cleanup() {\n console.log(chalk.red('\\nDownload interrupted. Cleaning up...'))\n await cleanPath(dir, true)\n process.exit(1)\n }\n\n process.once('SIGINT', cleanup)\n return () => process.removeListener('SIGINT', cleanup)\n}\n\nexport async function downloadBun(\n version: string,\n destPath: string,\n): Promise<void> {\n const target = getPlatformTarget()\n const url = `https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-${target}.zip`\n const zipPath = `${destPath}.zip`\n const destDir = dirname(destPath)\n const extractedDir = join(destDir, `bun-${target}`)\n const extractedBunPath = join(extractedDir, 'bun')\n\n const removeCleanupListener = registerCleanup(destDir)\n\n try {\n const response = await axios.get<NodeJS.ReadableStream>(url, {\n responseType: 'stream',\n })\n\n if (response.status !== 200) {\n throw new Error(`Failed to download ZIP file. Status: ${response.status}`)\n }\n\n const total = Number(response.headers['content-length']) || 0\n let downloaded = 0\n const progress = new cliProgress.SingleBar(\n {\n format: `${chalk.magenta('Downloading')} {bar} {percentage}% | {downloaded}/{totalSize}`,\n barCompleteChar: '█',\n barIncompleteChar: '░',\n hideCursor: true,\n },\n cliProgress.Presets.shades_classic,\n )\n\n if (total) {\n progress.start(total, 0, {\n downloaded: '0 B',\n totalSize: formatBytes(total),\n })\n }\n\n response.data.on('data', (chunk: Buffer) => {\n downloaded += chunk.length\n if (total) {\n progress.update(downloaded, {\n downloaded: formatBytes(downloaded),\n totalSize: formatBytes(total),\n })\n }\n })\n\n await streamToFile(response.data, zipPath)\n if (total) progress.stop()\n\n log.log(chalk.yellow('📦 Extracting...'))\n\n await pipeline(\n createReadStream(zipPath),\n unzipper.Extract({ path: destDir }),\n )\n\n if (!(await exists(extractedBunPath))) {\n throw new Error(`Expected binary not found at ${extractedBunPath}`)\n }\n\n await streamToFile(createReadStream(extractedBunPath), destPath)\n await chmod(destPath, 0o755)\n\n await cleanPath(extractedDir, true)\n await cleanPath(zipPath)\n\n log.success(`Downloaded Bun ${chalk.bold(`v${version}`)}`)\n } catch (error) {\n log.error(\n `Failed to install Bun: ${error instanceof Error ? error.message : error}`,\n )\n await cleanPath(destDir, true)\n process.exit(1)\n } finally {\n removeCleanupListener()\n }\n}\n","import {\n createWriteStream,\n existsSync,\n lstatSync,\n mkdirSync,\n rmSync,\n symlinkSync,\n} from 'node:fs'\nimport { rm, stat, unlink } from 'node:fs/promises'\nimport { log } from './logger'\n\nexport async function streamToFile(\n readable: NodeJS.ReadableStream,\n path: string,\n): Promise<void> {\n const writer = createWriteStream(path)\n await new Promise<void>((resolve, reject) => {\n writer.on('finish', resolve)\n writer.on('error', reject)\n readable.pipe(writer)\n })\n}\n\nexport async function exists(path: string): Promise<boolean> {\n try {\n await stat(path)\n return true\n } catch {\n return false\n }\n}\n\nexport async function cleanPath(\n path: string,\n isDirectory = false,\n): Promise<void> {\n try {\n if (await exists(path)) {\n if (isDirectory) {\n await rm(path, { recursive: true, force: true })\n } else {\n await unlink(path)\n }\n }\n } catch (error) {\n const err = error as NodeJS.ErrnoException\n if (err.code !== 'ENOENT') {\n log.warn(`Failed to clean path: ${path}`)\n }\n }\n}\n\nexport function formatBytes(bytes: number): string {\n const sizes = ['B', 'KB', 'MB', 'GB']\n if (bytes === 0) return '0 B'\n const i = Math.floor(Math.log(bytes) / Math.log(1024))\n return `${(bytes / Math.pow(1024, i)).toFixed(1)} ${sizes[i]}`\n}\n\nexport function ensureDirectoryExists(dir: string): void {\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true })\n }\n}\n\nexport function removeExistingLink(path: string): void {\n if (existsSync(path)) {\n const isSymlink = lstatSync(path).isSymbolicLink()\n try {\n rmSync(path, { force: true })\n if (!isSymlink) {\n log.warn(`Replaced non-symlink file at ${path}`)\n }\n } catch (error) {\n log.warn(\n `Couldn't remove existing file at ${path}: ${(error as Error).message}`,\n )\n }\n }\n}\n\nexport function createSymlink(src: string, dest: string): void {\n if (existsSync(src)) {\n removeExistingLink(dest)\n symlinkSync(src, dest)\n }\n}\n","import { join } from 'node:path'\nimport { existsSync } from 'node:fs'\nimport chalk from 'chalk'\nimport { log } from '../lib/logger'\nimport {\n BUN_BIN_DIR,\n BUN_SYMLINK,\n BUN_VERSIONS_DIR,\n BUNX_SYMLINK,\n} from '../lib/constants'\nimport { createSymlink, ensureDirectoryExists } from '../lib/file'\nimport { setupCompletions } from '../lib/shell'\n\nexport async function useVersion(version: string): Promise<void> {\n const versionBin = join(BUN_VERSIONS_DIR, version, 'bun')\n\n if (!existsSync(versionBin)) {\n log.error(`Bun version ${version} is not installed.`)\n log.info(`Run ${chalk.cyan(`bvm install ${version}`)} to install it.`)\n return\n }\n\n try {\n ensureDirectoryExists(BUN_BIN_DIR)\n createSymlink(versionBin, BUN_SYMLINK)\n createSymlink(versionBin, BUNX_SYMLINK)\n await setupCompletions()\n\n log.success(`Now using Bun ${version}`)\n } catch (err) {\n log.error(`Failed to switch Bun version: ${(err as Error).message}`)\n }\n}\n","import { homedir } from 'node:os'\nimport { join } from 'node:path'\nimport { log } from './logger'\nimport { readFile, writeFile } from 'node:fs/promises'\nimport {\n BUN_COMPLETION_FILE,\n BUN_DIR,\n BUN_SYMLINK,\n FISH_CONFIG_PATH,\n} from './constants'\nimport { exists } from './file'\nimport { execSync } from 'node:child_process'\nimport { Shell } from './types'\n\nexport async function setupCompletions(): Promise<void> {\n if (!(await exists(BUN_SYMLINK))) {\n log.error(`Bun binary not found at ${BUN_SYMLINK}, skipping completions`)\n return\n }\n\n const shell = getShell()\n\n if (!shell) {\n log.warn('Unknown shell. Please manually set up Bun completions.')\n return\n }\n\n try {\n execSync(`${BUN_SYMLINK} completions`, {\n env: {\n ...process.env,\n IS_BUN_AUTO_UPDATE: 'true',\n SHELL: shell,\n },\n stdio: 'ignore',\n })\n } catch (error) {\n log.error(`Failed to set up ${shell} completions: ${error}`)\n }\n}\n\nfunction getShell(): Shell | null {\n const shellPath = process.env.SHELL ?? ''\n if (shellPath.includes('bash')) return 'bash'\n if (shellPath.includes('zsh')) return 'zsh'\n if (shellPath.includes('fish')) return 'fish'\n return null\n}\n\nexport function getShellConfigPath(shell: Shell): string[] {\n const home = homedir()\n switch (shell) {\n case 'bash': {\n const xdg = process.env.XDG_CONFIG_HOME\n return [\n join(home, '.bashrc'),\n join(home, '.bash_profile'),\n ...(xdg\n ? [\n join(xdg, '.bashrc'),\n join(xdg, '.bash_profile'),\n join(xdg, 'bashrc'),\n join(xdg, 'bash_profile'),\n ]\n : []),\n ]\n }\n case 'zsh':\n return [join(home, '.zshrc')]\n case 'fish':\n return [join(home, '.config', 'fish', 'config.fish')]\n default:\n return []\n }\n}\n\nasync function configureFish(): Promise<void> {\n const fishLines = [\n `set --export BUN_INSTALL \"${BUN_DIR}\"`,\n `set --export PATH \"$BUN_INSTALL/bin\" $PATH`,\n ]\n\n if (await exists(FISH_CONFIG_PATH)) {\n try {\n const content = await readFile(FISH_CONFIG_PATH, 'utf8')\n const missingLines = fishLines.filter((line) => !content.includes(line))\n\n if (missingLines.length > 0) {\n const newContent = content + `\\n# bun\\n${missingLines.join('\\n')}\\n`\n await writeFile(FISH_CONFIG_PATH, newContent)\n log.success(`Updated ${FISH_CONFIG_PATH} with Bun configuration`)\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n log.warn(`Could not update Fish config: ${message}`)\n }\n } else {\n log.warn(\n 'Fish config file not found. Please add Bun configuration manually.',\n )\n }\n}\n\nasync function configureShell(shell: Shell): Promise<void> {\n if (!shell) {\n log.warn('Invalid shell provided')\n return\n }\n\n if (shell === 'fish') {\n await configureFish()\n return\n }\n\n const bunInstallLine = `export BUN_INSTALL=\"${BUN_DIR}\"\\n`\n const pathLine = `export PATH=\"$BUN_INSTALL/bin:$PATH\"\\n`\n const completionLine = `[ -s \"${BUN_COMPLETION_FILE}\" ] && source \"${BUN_COMPLETION_FILE}\"\\n`\n\n const configPaths = getShellConfigPath(shell)\n\n for (const configPath of configPaths) {\n if (await exists(configPath)) {\n try {\n const content = await readFile(configPath, 'utf8')\n let updated = false\n let newContent = content\n\n if (!content.includes('BUN_INSTALL')) {\n newContent += `\\n# bun\\n${bunInstallLine}${pathLine}`\n updated = true\n }\n\n if (!content.includes(BUN_COMPLETION_FILE)) {\n newContent += `\\n# bun completions\\n${completionLine}`\n updated = true\n }\n\n if (updated) {\n await writeFile(configPath, newContent)\n log.success(`Updated ${configPath} with Bun configuration`)\n }\n return\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n log.warn(`Could not update ${configPath}: ${message}`)\n }\n }\n }\n\n log.warn(`No writable ${shell} config file found. Please add manually.`)\n}\n\nexport async function autoConfigureShell(): Promise<void> {\n const shell = getShell()\n if (!shell) {\n log.warn('Unknown shell. Please manually add Bun to your shell config.')\n return\n }\n\n await configureShell(shell)\n}\n","import {\n formatVersionInfo,\n getCurrentBunVersion,\n getInstalledBunVersions,\n} from '../lib/utils'\nimport { GITHUB_RELEASES_URL } from '../lib/constants'\nimport { log } from '../lib/logger'\nimport chalk from 'chalk'\nimport axios from 'axios'\n\ntype Release = { tag_name: string }\n\nexport function listVersions(): void {\n try {\n const currentVersion = getCurrentBunVersion()\n log.log(`Current Bun version: ${currentVersion ?? 'none'}`)\n\n const versions = getInstalledBunVersions()\n\n if (versions.length === 0) {\n log.warn('No Bun versions installed yet.')\n return\n }\n\n log.log(chalk.green('🚀 Installed Bun versions:\\n'))\n versions.forEach((version) => {\n log.log(formatVersionInfo(version, currentVersion, new Set(versions)))\n })\n } catch {\n log.error('No Bun versions installed yet.')\n }\n}\n\nexport async function listRemoteVersions(): Promise<void> {\n try {\n const { data } = await axios.get<Release[]>(GITHUB_RELEASES_URL)\n const versions = data.map(({ tag_name }) => tag_name.replace(/^bun-v/, ''))\n\n if (versions.length === 0) {\n log.warn('No Bun versions found remotely.')\n return\n }\n\n const installedVersions = getInstalledBunVersions()\n const installedVersionsSet = new Set(installedVersions)\n const activeVersion = getCurrentBunVersion()\n\n log.log(chalk.green('🚀 Available Bun versions:\\n'))\n versions.forEach((version) => {\n log.log(formatVersionInfo(version, activeVersion, installedVersionsSet))\n })\n } catch (err) {\n log.error(\n `Error fetching remote versions: ${err instanceof Error ? err.message : err}`,\n )\n }\n}\n","import { join, resolve } from 'node:path'\nimport { existsSync, readlinkSync, rmSync } from 'node:fs'\nimport { log } from '../lib/logger'\nimport { BUN_SYMLINK, BUN_VERSIONS_DIR } from '../lib/constants'\nimport chalk from 'chalk'\n\nexport function uninstallBun(version: string): void {\n const versionDir = join(BUN_VERSIONS_DIR, version)\n const bunBinaryPath = join(versionDir, 'bun')\n\n if (!existsSync(versionDir) || !existsSync(bunBinaryPath)) {\n log.warn(`Bun version ${version} is not installed.`)\n return\n }\n\n // If the version is in use, remove the symlink.\n if (existsSync(BUN_SYMLINK)) {\n try {\n const target = resolve(readlinkSync(BUN_SYMLINK))\n if (target === resolve(bunBinaryPath)) {\n rmSync(BUN_SYMLINK, { force: true })\n log.log(`🔗 Removed active symlink for Bun ${version}.`)\n }\n } catch {\n // Ignore readlinkSync errors.\n }\n }\n\n try {\n rmSync(versionDir, { recursive: true, force: true })\n log.log(chalk.green(`🗑️ Bun ${version} has been uninstalled.`))\n } catch (err) {\n log.error(`Failed to uninstall Bun ${version}: ${(err as Error).message}`)\n }\n}\n","{\n \"name\": \"bunvm\",\n \"version\": \"1.0.1\",\n \"description\": \"Bun Version Manager - Switch between different versions of Bun easily\",\n \"bin\": {\n \"bvm\": \"./dist/bvm.js\"\n },\n \"type\": \"module\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.js\",\n \"scripts\": {\n \"build\": \"tsup\",\n \"dev\": \"tsx src/bvm.ts\",\n \"clean\": \"rm -rf dist\",\n \"prepublishOnly\": \"pnpm run clean && pnpm run build\",\n \"start\": \"node dist/bvm.js\",\n \"format\": \"prettier --write --ignore-path .gitignore --cache .\",\n \"lint\": \"eslint --ext .ts src --cache\",\n \"lint:fix\": \"eslint --ext .ts src --cache --fix\"\n },\n \"keywords\": [\n \"bun\",\n \"version\",\n \"manager\",\n \"version-manager\",\n \"bun version manager\",\n \"cli\",\n \"javascript\",\n \"typescript\",\n \"nodejs\"\n ],\n \"author\": \"Tarun Joshi\",\n \"license\": \"MIT\",\n \"homepage\": \"https://github.com/MrHacker26/bvm#readme\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/MrHacker26/bvm.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/MrHacker26/bvm/issues\"\n },\n \"files\": [\n \"dist\"\n ],\n \"packageManager\": \"pnpm@10.11.0\",\n \"dependencies\": {\n \"axios\": \"^1.9.0\",\n \"chalk\": \"^5.4.1\",\n \"cli-progress\": \"^3.12.0\",\n \"commander\": \"^13.1.0\",\n \"unzipper\": \"^0.12.3\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.27.0\",\n \"@types/cli-progress\": \"^3.11.6\",\n \"@types/node\": \"^22.15.18\",\n \"@types/unzipper\": \"^0.10.11\",\n \"@typescript-eslint/eslint-plugin\": \"^8.32.1\",\n \"@typescript-eslint/parser\": \"^8.32.1\",\n \"eslint\": \"^9.27.0\",\n \"globals\": \"^16.1.0\",\n \"prettier\": \"^3.5.3\",\n \"tsup\": \"^8.5.0\",\n \"tsx\": \"^4.19.4\",\n \"typescript\": \"^5.0.0\",\n \"typescript-eslint\": \"^8.32.1\"\n }\n}\n"],"mappings":";AAEA,OAAS,WAAAA,OAAe,YCFxB,OAAS,aAAAC,GAAW,cAAAC,MAAkB,KACtC,OAA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,CAAO,wBAAwB,CAAC,CAClE,OAASW,EAAK,CACZL,EAAI,MAAM,2BAA2BN,CAAO,KAAMW,EAAc,OAAO,EAAE,CAC3E,CACF,CChCE,IAAAC,GAAW,QVOb,IAAMC,EAAU,IAAIC,GAEpBD,EACG,KAAK,KAAK,EACV,YAAY,oDAAoD,EAChE,QAAQE,EAAO,EAElBF,EACG,QAAQ,mBAAmB,EAC3B,MAAM,GAAG,EACT,YAAY,gCAAgC,EAC5C,OAAOG,CAAU,EAEpBH,EACG,QAAQ,eAAe,EACvB,YAAY,4BAA4B,EACxC,OAAOI,CAAU,EAEpBJ,EACG,QAAQ,qBAAqB,EAC7B,MAAM,GAAG,EACT,YAAY,kCAAkC,EAC9C,OAAOK,EAAY,EAEtBL,EACG,QAAQ,MAAM,EACd,MAAM,IAAI,EACV,YAAY,6BAA6B,EACzC,OAAOM,EAAY,EAEtBN,EACG,QAAQ,QAAQ,EAChB,MAAM,GAAG,EACT,YAAY,0BAA0B,EACtC,OAAOO,EAAkB,EAE5BP,EAAQ,MAAM","names":["Command","mkdirSync","existsSync","join","chalk","homedir","join","BUN_DIR","BUN_BIN_DIR","BUN_SYMLINK","BUNX_SYMLINK","BVM_DIR","BUN_VERSIONS_DIR","GITHUB_API_URL","GITHUB_RELEASES_URL","BUN_COMPLETION_FILE","FISH_CONFIG_PATH","chalk","log","msg","execSync","createReadStream","existsSync","readdirSync","chalk","dirname","join","axios","pipeline","unzipper","chmod","createWriteStream","existsSync","lstatSync","mkdirSync","rmSync","symlinkSync","rm","stat","unlink","streamToFile","readable","path","writer","createWriteStream","resolve","reject","exists","stat","cleanPath","isDirectory","rm","unlink","error","log","formatBytes","bytes","sizes","i","ensureDirectoryExists","dir","existsSync","mkdirSync","removeExistingLink","isSymlink","lstatSync","rmSync","createSymlink","src","dest","symlinkSync","cliProgress","getCurrentBunVersion","execSync","getInstalledBunVersions","existsSync","BUN_VERSIONS_DIR","readdirSync","formatVersionInfo","version","currentVersion","installedVersions","isActive","isInstalled","chalk","getPlatformTarget","registerCleanup","dir","cleanup","cleanPath","downloadBun","destPath","target","url","zipPath","destDir","dirname","extractedDir","join","extractedBunPath","removeCleanupListener","response","axios","total","downloaded","progress","formatBytes","chunk","streamToFile","log","pipeline","createReadStream","unzipper","exists","chmod","error","join","existsSync","chalk","homedir","join","readFile","writeFile","execSync","setupCompletions","exists","BUN_SYMLINK","log","shell","getShell","error","shellPath","getShellConfigPath","home","homedir","xdg","join","configureFish","fishLines","BUN_DIR","FISH_CONFIG_PATH","content","readFile","missingLines","line","newContent","writeFile","message","configureShell","bunInstallLine","pathLine","completionLine","BUN_COMPLETION_FILE","configPaths","configPath","updated","autoConfigureShell","useVersion","version","versionBin","join","BUN_VERSIONS_DIR","existsSync","log","chalk","ensureDirectoryExists","BUN_BIN_DIR","createSymlink","BUN_SYMLINK","BUNX_SYMLINK","setupCompletions","err","installBun","version","versionDir","join","BUN_VERSIONS_DIR","bunBinaryPath","existsSync","log","chalk","mkdirSync","downloadBun","BUN_SYMLINK","BUNX_SYMLINK","ensureDirectoryExists","BUN_BIN_DIR","autoConfigureShell","err","useVersion","chalk","axios","listVersions","currentVersion","getCurrentBunVersion","log","versions","getInstalledBunVersions","version","formatVersionInfo","listRemoteVersions","data","GITHUB_RELEASES_URL","tag_name","installedVersions","installedVersionsSet","activeVersion","err","join","resolve","existsSync","readlinkSync","rmSync","chalk","uninstallBun","version","versionDir","join","BUN_VERSIONS_DIR","bunBinaryPath","existsSync","log","BUN_SYMLINK","resolve","readlinkSync","rmSync","err","version","program","Command","version","installBun","useVersion","uninstallBun","listVersions","listRemoteVersions"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunvm",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Bun Version Manager - Switch between different versions of Bun easily",
5
5
  "bin": {
6
6
  "bvm": "./dist/bvm.js"