feat(install): add support for clean installation (#259)

Signed-off-by: DiegoRamil <nxquumodding@gmail.com>
This commit is contained in:
Diego Ramil Álvarez
2026-05-13 20:52:41 +05:30
committed by GitHub
parent 3848cc78e0
commit 6249d0781d
3 changed files with 37 additions and 1 deletions
+9
View File
@@ -265,6 +265,15 @@ jobs:
test -f bun.lock test -f bun.lock
test -d node_modules/express test -d node_modules/express
test -d node_modules/lodash test -d node_modules/lodash
echo "Testing Bun frozen manifest installation with bun ci..."
rm -rf node_modules
pmg --proxy-mode=false bun ci
# Verification: bun lockfile and modules exist after frozen manifest install
test -f bun.lock
test -d node_modules/express
test -d node_modules/lodash
cd .. && rm -rf bun-test cd .. && rm -rf bun-test
- name: Test Yarn - Single Package & Manifest - name: Test Yarn - Single Package & Manifest
+1 -1
View File
@@ -48,7 +48,7 @@ func DefaultPnpmPackageManagerConfig() NpmPackageManagerConfig {
func DefaultBunPackageManagerConfig() NpmPackageManagerConfig { func DefaultBunPackageManagerConfig() NpmPackageManagerConfig {
return NpmPackageManagerConfig{ return NpmPackageManagerConfig{
InstallCommands: []string{"install", "i", "add"}, InstallCommands: []string{"install", "i", "add", "ci"},
NonDownloadCommands: []string{ NonDownloadCommands: []string{
// Removal // Removal
"remove", "rm", "remove", "rm",
+27
View File
@@ -413,6 +413,26 @@ func TestBunParseCommand(t *testing.T) {
assert.Equal(t, 0, len(parsedCommand.InstallTargets)) assert.Equal(t, 0, len(parsedCommand.InstallTargets))
}, },
}, },
{
name: "manifest installation with short form",
command: "bun i",
assert: func(t *testing.T, parsedCommand *ParsedCommand, err error) {
assert.NoError(t, err)
assert.Equal(t, true, parsedCommand.IsManifestInstall)
assert.Equal(t, 0, len(parsedCommand.InstallTargets))
assert.True(t, parsedCommand.IsInstallationCommand())
},
},
{
name: "manifest installation with ci",
command: "bun ci",
assert: func(t *testing.T, parsedCommand *ParsedCommand, err error) {
assert.NoError(t, err)
assert.Equal(t, true, parsedCommand.IsManifestInstall)
assert.Equal(t, 0, len(parsedCommand.InstallTargets))
assert.True(t, parsedCommand.IsInstallationCommand())
},
},
{ {
name: "multiple package installations", name: "multiple package installations",
command: "bun add @types/node @types/react", command: "bun add @types/node @types/react",
@@ -475,6 +495,13 @@ func TestNpmProxyBehavior(t *testing.T) {
isKnownNonDownloadCmd: false, isKnownNonDownloadCmd: false,
isInstallationCommand: false, isInstallationCommand: false,
}, },
{
name: "bun ci — manifest install",
pm: func() (*npmPackageManager, error) { return NewNpmPackageManager(DefaultBunPackageManagerConfig()) },
command: "bun ci",
isKnownNonDownloadCmd: false,
isInstallationCommand: true,
},
{ {
name: "npm exec — proxy runs (may download and run package)", name: "npm exec — proxy runs (may download and run package)",
pm: func() (*npmPackageManager, error) { return NewNpmPackageManager(DefaultNpmPackageManagerConfig()) }, pm: func() (*npmPackageManager, error) { return NewNpmPackageManager(DefaultNpmPackageManagerConfig()) },