Skip to content

Commit d95e235

Browse files
OmotolaJamieMagee
andauthored
Update to detector docs (#608)
Added documentation for Npm and status for each detector --------- Co-authored-by: Jamie Magee <jamagee@microsoft.com>
1 parent d92e45c commit d95e235

File tree

3 files changed

+120
-2
lines changed

3 files changed

+120
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Detectors have 3 levels of "stability":
8989
* `Experimental`
9090
* `Stable`
9191

92-
DefaultOff detectors need to be explicitly enabled to run and produce a final graph output. Experimental detectors run by default but **will not** produce a final graph output. Stable detectors run and produce a final graph output by default. Here is how you can [enable default off/experimental](./docs/enable-default-off.md) detectors.
92+
DefaultOff detectors need to be explicitly enabled to run and produce a final graph output. Experimental detectors run by default but **will not** produce a final graph output. Stable detectors run and produce a final graph output by default. Here is how you can [enable default off/experimental](./docs/enable-default-off.md) detectors. The status of each detector can also be found [here](./docs/detectors/README.md)
9393

9494
# Telemetry
9595
By default, telemetry will output to your output file path and will be a JSON blob. No data is submitted to Microsoft.

docs/detectors/README.md

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,107 @@
11
# Detectors
22

33
- CocoaPods
4+
5+
| Detector | Status |
6+
| -------------------- | ------ |
7+
| PodComponentDetector | Stable |
8+
9+
- DockerFile
10+
11+
| Detector | Status |
12+
| ------------------ | ---------- |
13+
| DockerFileDetector | DefaultOff |
14+
415
- [Go](go.md)
16+
17+
| Detector | Status |
18+
| ------------------- | ------ |
19+
| GoComponentDetector | Stable |
20+
521
- [Gradle](gradle.md)
22+
23+
| Detector | Status |
24+
| ----------------------- | ------ |
25+
| GradleComponentDetector | Stable |
26+
27+
- Ivy
28+
29+
| Detector | Status |
30+
| ----------- | ------------ |
31+
| IvyDetector | Experimental |
32+
633
- [Linux](linux.md)
34+
35+
| Detector | Status |
36+
| ---------------------- | ------ |
37+
| LinuxContainerDetector | Stable |
38+
739
- [Maven](maven.md)
8-
- NPM
40+
41+
| Detector | Status |
42+
| ------------------------- | ------ |
43+
| MavenCliComponentDetector | Stable |
44+
45+
- [NPM](npm.md)
46+
47+
| Detector | Status |
48+
| -------------------- | ------------ |
49+
| NpmComponentDetector | Stable |
50+
| NpmLockFileDetector | Stable |
51+
| NpmLockFile3Detector | Experimental |
52+
953
- NuGet
54+
55+
| Detector | Status |
56+
| ------------------------------------------------ | ------ |
57+
| NugetComponentDetector | Stable |
58+
| NugetPackagesConfigDetector | Stable |
59+
| NuGetProjectModelProjectCentricComponentDetector | Stable |
60+
1061
- [Pip](pip.md)
62+
63+
| Detector | Status |
64+
| -------------------- | ------ |
65+
| PipComponentDetector | Stable |
66+
67+
- Pnpm
68+
69+
| Detector | Status |
70+
| --------------------- | ------ |
71+
| PnpmComponentDetector | Stable |
72+
1173
- [Poetry](poetry.md)
74+
75+
| Detector | Status |
76+
| ----------------------- | ------------ |
77+
| PoetryComponentDetector | Experimental |
78+
1279
- Ruby
80+
81+
| Detector | Status |
82+
| --------------------- | ------ |
83+
| RubyComponentDetector | Stable |
84+
1385
- Rust
86+
87+
| Detector | Status |
88+
| ----------------- | ------ |
89+
| RustCrateDetector | Stable |
90+
91+
- Spdx
92+
93+
| Detector | Status |
94+
| ----------------------- | ---------- |
95+
| Spdx22ComponentDetector | DefaultOff |
96+
97+
- Vcpkg
98+
99+
| Detector | Status |
100+
| ---------------------- | ------------ |
101+
| VcpkgComponentDetector | Experimental |
102+
103+
- Yarn
104+
105+
| Detector | Status |
106+
| ---------------- | ------ |
107+
| YarnLockDetector | Stable |

docs/detectors/npm.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Npm Detection
2+
3+
## Requirements
4+
5+
There are multiple detectors that make up npm detection and each detector searches for the following files:
6+
7+
- [The `NpmComponentDetector` detector searches for `package.json`][1]
8+
- [The `NpmComponentDetectorWithRoots` and `NpmLockfile3Detector` detectors search for `package-lock.json`, `npm-shrinkwrap.json`, and `lerna.json`][2]
9+
10+
## Detection strategy
11+
12+
npm detectors search for dependencies in `packages.json`, `package-lock.json`, `npm-shrinkwrap.json` and `lerna.json` in the scan directory.
13+
The lockfile detectors (`NpmComponentDetectorWithRoots` and `NpmLockfile3Detector`) are able to scan for transitive dependencies within the project.
14+
There is also an extension of the lockfile detector the NpmLockFilev3 detector that is able to scan [version 3 of lockfiles][3]
15+
16+
## Known limitations
17+
18+
Npm supports [`optionalDependencies`][4] which can cause an overreporting issue with the detector
19+
However, this is not much of an issue as the majority of projects only use `dependencies` and `devDependencies`.
20+
21+
[1]: https://github.com/microsoft/component-detection/blob/251276d7951c7eaa880ed58b1a974b25dba92cd2/src/Microsoft.ComponentDetection.Detectors/npm/NpmComponentDetector.cs#L36
22+
[2]: https://github.com/microsoft/component-detection/blob/251276d7951c7eaa880ed58b1a974b25dba92cd2/src/Microsoft.ComponentDetection.Detectors/npm/NpmLockfileDetectorBase.cs#L52
23+
[3]: https://github.com/microsoft/component-detection/blob/251276d7951c7eaa880ed58b1a974b25dba92cd2/src/Microsoft.ComponentDetection.Detectors/npm/NpmLockfile3Detector.cs#L36
24+
[4]: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#optionaldependencies

0 commit comments

Comments
 (0)