-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added documentation for Npm and status for each detector --------- Co-authored-by: Jamie Magee <[email protected]>
- Loading branch information
1 parent
d92e45c
commit d95e235
Showing
3 changed files
with
120 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,107 @@ | ||
# Detectors | ||
|
||
- CocoaPods | ||
|
||
| Detector | Status | | ||
| -------------------- | ------ | | ||
| PodComponentDetector | Stable | | ||
|
||
- DockerFile | ||
|
||
| Detector | Status | | ||
| ------------------ | ---------- | | ||
| DockerFileDetector | DefaultOff | | ||
|
||
- [Go](go.md) | ||
|
||
| Detector | Status | | ||
| ------------------- | ------ | | ||
| GoComponentDetector | Stable | | ||
|
||
- [Gradle](gradle.md) | ||
|
||
| Detector | Status | | ||
| ----------------------- | ------ | | ||
| GradleComponentDetector | Stable | | ||
|
||
- Ivy | ||
|
||
| Detector | Status | | ||
| ----------- | ------------ | | ||
| IvyDetector | Experimental | | ||
|
||
- [Linux](linux.md) | ||
|
||
| Detector | Status | | ||
| ---------------------- | ------ | | ||
| LinuxContainerDetector | Stable | | ||
|
||
- [Maven](maven.md) | ||
- NPM | ||
|
||
| Detector | Status | | ||
| ------------------------- | ------ | | ||
| MavenCliComponentDetector | Stable | | ||
|
||
- [NPM](npm.md) | ||
|
||
| Detector | Status | | ||
| -------------------- | ------------ | | ||
| NpmComponentDetector | Stable | | ||
| NpmLockFileDetector | Stable | | ||
| NpmLockFile3Detector | Experimental | | ||
|
||
- NuGet | ||
|
||
| Detector | Status | | ||
| ------------------------------------------------ | ------ | | ||
| NugetComponentDetector | Stable | | ||
| NugetPackagesConfigDetector | Stable | | ||
| NuGetProjectModelProjectCentricComponentDetector | Stable | | ||
|
||
- [Pip](pip.md) | ||
|
||
| Detector | Status | | ||
| -------------------- | ------ | | ||
| PipComponentDetector | Stable | | ||
|
||
- Pnpm | ||
|
||
| Detector | Status | | ||
| --------------------- | ------ | | ||
| PnpmComponentDetector | Stable | | ||
|
||
- [Poetry](poetry.md) | ||
|
||
| Detector | Status | | ||
| ----------------------- | ------------ | | ||
| PoetryComponentDetector | Experimental | | ||
|
||
- Ruby | ||
|
||
| Detector | Status | | ||
| --------------------- | ------ | | ||
| RubyComponentDetector | Stable | | ||
|
||
- Rust | ||
|
||
| Detector | Status | | ||
| ----------------- | ------ | | ||
| RustCrateDetector | Stable | | ||
|
||
- Spdx | ||
|
||
| Detector | Status | | ||
| ----------------------- | ---------- | | ||
| Spdx22ComponentDetector | DefaultOff | | ||
|
||
- Vcpkg | ||
|
||
| Detector | Status | | ||
| ---------------------- | ------------ | | ||
| VcpkgComponentDetector | Experimental | | ||
|
||
- Yarn | ||
|
||
| Detector | Status | | ||
| ---------------- | ------ | | ||
| YarnLockDetector | Stable | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Npm Detection | ||
|
||
## Requirements | ||
|
||
There are multiple detectors that make up npm detection and each detector searches for the following files: | ||
|
||
- [The `NpmComponentDetector` detector searches for `package.json`][1] | ||
- [The `NpmComponentDetectorWithRoots` and `NpmLockfile3Detector` detectors search for `package-lock.json`, `npm-shrinkwrap.json`, and `lerna.json`][2] | ||
|
||
## Detection strategy | ||
|
||
npm detectors search for dependencies in `packages.json`, `package-lock.json`, `npm-shrinkwrap.json` and `lerna.json` in the scan directory. | ||
The lockfile detectors (`NpmComponentDetectorWithRoots` and `NpmLockfile3Detector`) are able to scan for transitive dependencies within the project. | ||
There is also an extension of the lockfile detector the NpmLockFilev3 detector that is able to scan [version 3 of lockfiles][3] | ||
|
||
## Known limitations | ||
|
||
Npm supports [`optionalDependencies`][4] which can cause an overreporting issue with the detector | ||
However, this is not much of an issue as the majority of projects only use `dependencies` and `devDependencies`. | ||
|
||
[1]: https://github.com/microsoft/component-detection/blob/251276d7951c7eaa880ed58b1a974b25dba92cd2/src/Microsoft.ComponentDetection.Detectors/npm/NpmComponentDetector.cs#L36 | ||
[2]: https://github.com/microsoft/component-detection/blob/251276d7951c7eaa880ed58b1a974b25dba92cd2/src/Microsoft.ComponentDetection.Detectors/npm/NpmLockfileDetectorBase.cs#L52 | ||
[3]: https://github.com/microsoft/component-detection/blob/251276d7951c7eaa880ed58b1a974b25dba92cd2/src/Microsoft.ComponentDetection.Detectors/npm/NpmLockfile3Detector.cs#L36 | ||
[4]: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#optionaldependencies |