Skip to content

Commit

Permalink
Update version
Browse files Browse the repository at this point in the history
  • Loading branch information
FernandoRojo committed Oct 28, 2024
1 parent 449457d commit c6f131f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class PnpmComponentDetectorFactory : FileComponentDetector
/// <summary>
/// The maximum version of the report specification that this detector can handle.
/// </summary>
private static readonly Version MaxLockfileVersion = new(6, 0);
private static readonly Version MaxLockfileVersion = new(9, 0);

public PnpmComponentDetectorFactory(
IComponentStreamEnumerableFactory componentStreamEnumerableFactory,
Expand All @@ -41,7 +41,7 @@ public PnpmComponentDetectorFactory(

public override IEnumerable<ComponentType> SupportedComponentTypes { get; } = [ComponentType.Npm];

public override int Version { get; } = 6;
public override int Version { get; } = 7;

public override bool NeedsAutomaticRootDependencyCalculation => true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,10 @@ public async Task TestPnpmDetector_V9_GoodLockVersion_SkipsFileAndLinkDependenci
dependencies:
sampleIndirectDependency: 3.3.3
sampleIndirectDependency2: 2.2.2
'file://../sampleFile': 'link:../\\'
[email protected]: {}
[email protected]: {}
'file://../sampleFile@link:../': {}
";

var (scanResult, componentRecorder) = await this.DetectorTestUtility
Expand Down Expand Up @@ -780,4 +782,30 @@ public async Task TestPnpmDetector_V9_GoodLockVersion_SkipsFileAndLinkDependenci
indirectDependencyComponent2.Component.Id,
parentComponent => parentComponent.Name == "sampleDependency");
}

[TestMethod]
public async Task TestPnpmDetector_V9_GoodLockVersion_MissingSnapshotsSuccess()
{
var yamlFile = @"
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
dependencies:
SampleLinkDependency:
specifier: workspace:*
version: link:SampleLinkDependency
";

var (scanResult, componentRecorder) = await this.DetectorTestUtility
.WithFile("pnpm-lock.yaml", yamlFile)
.ExecuteDetectorAsync();

scanResult.ResultCode.Should().Be(ProcessingResultCode.Success);

var detectedComponents = componentRecorder.GetDetectedComponents();
detectedComponents.Should().BeEmpty();
}
}

0 comments on commit c6f131f

Please sign in to comment.