mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
feat(install): add support for clean installation (#259)
Signed-off-by: DiegoRamil <nxquumodding@gmail.com>
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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()) },
|
||||||
|
|||||||
Reference in New Issue
Block a user