@cdxgen/cdxgen 13.3.0 → 13.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/README.md +9 -6
  2. package/bin/cdxgen.js +90 -26
  3. package/bin/evinse.js +18 -1
  4. package/bin/repl.js +86 -0
  5. package/bin/sign.js +45 -15
  6. package/bin/tracebom.js +5 -1
  7. package/bin/validate.js +84 -18
  8. package/bin/verify.js +155 -86
  9. package/data/helpers/init.gradle +46 -21
  10. package/data/remediations.json +61 -0
  11. package/data/rules/dependency-sources.yaml +67 -0
  12. package/data/rules/scala-evidence.yaml +115 -0
  13. package/lib/audit/index.js +38 -6
  14. package/lib/cli/index.js +113 -54
  15. package/lib/cli/jsBom.js +50 -29
  16. package/lib/cli/jvmBom.js +665 -138
  17. package/lib/cli/managedBom.js +320 -200
  18. package/lib/cli/nativeBom.js +139 -30
  19. package/lib/core/activity.js +12 -0
  20. package/lib/core/env.js +17 -9
  21. package/lib/core/fs.js +3 -2
  22. package/lib/core/httpClient.js +159 -24
  23. package/lib/core/pluginRun.js +184 -0
  24. package/lib/core/processTree.js +100 -0
  25. package/lib/core/runState.js +39 -0
  26. package/lib/core/toml.js +72 -0
  27. package/lib/ecosystems/asarutils.js +4 -2
  28. package/lib/ecosystems/bunutils.js +5 -7
  29. package/lib/ecosystems/cargoCache.js +231 -8
  30. package/lib/ecosystems/cmakeResolver.js +10 -21
  31. package/lib/ecosystems/cppBuildContext.js +631 -0
  32. package/lib/ecosystems/cppEvidence.js +337 -22
  33. package/lib/ecosystems/cppIncludeResolver.js +294 -0
  34. package/lib/ecosystems/denoutils.js +93 -66
  35. package/lib/ecosystems/ecosystems.js +1967 -788
  36. package/lib/ecosystems/golem.js +28 -12
  37. package/lib/ecosystems/gradleutils.js +314 -30
  38. package/lib/ecosystems/jsEvidence.js +85 -24
  39. package/lib/ecosystems/kosi.js +21 -4
  40. package/lib/ecosystems/npmutils.js +64 -0
  41. package/lib/ecosystems/parsers-dotnet.js +567 -151
  42. package/lib/ecosystems/parsers-elm.js +46 -28
  43. package/lib/ecosystems/parsers-gleam.js +3 -4
  44. package/lib/ecosystems/parsers-go.js +324 -61
  45. package/lib/ecosystems/parsers-js.js +92 -26
  46. package/lib/ecosystems/parsers-julia.js +2 -3
  47. package/lib/ecosystems/parsers-jvm.js +204 -12
  48. package/lib/ecosystems/parsers-misc.js +182 -55
  49. package/lib/ecosystems/parsers-python.js +141 -10
  50. package/lib/ecosystems/parsers-rust.js +4 -4
  51. package/lib/ecosystems/parsers-terraform.js +1573 -19
  52. package/lib/ecosystems/pythonutils.js +102 -6
  53. package/lib/ecosystems/remote/huggingface.js +3 -0
  54. package/lib/ecosystems/rubyutils.js +67 -17
  55. package/lib/ecosystems/rusi.js +22 -9
  56. package/lib/ecosystems/sbtutils.js +243 -187
  57. package/lib/ecosystems/scalacliutils.js +342 -0
  58. package/lib/ecosystems/scalasem.js +2618 -0
  59. package/lib/ecosystems/terraformRegistry.js +288 -0
  60. package/lib/ecosystems/utils.js +2 -0
  61. package/lib/ecosystems/vendoredCode.js +156 -0
  62. package/lib/evinser/evinser.js +578 -69
  63. package/lib/helpers/agenticToolutils.js +2 -2
  64. package/lib/helpers/bomSigner.js +576 -128
  65. package/lib/inventory/aiCollector.js +4 -1
  66. package/lib/inventory/analyzer.js +110 -127
  67. package/lib/inventory/atomUtils.js +171 -48
  68. package/lib/inventory/auditCategories.js +7 -0
  69. package/lib/inventory/buildToolRateLimit.js +144 -0
  70. package/lib/inventory/cacheCommands.js +2 -1
  71. package/lib/inventory/cmakeBuildDirs.js +254 -0
  72. package/lib/inventory/deps.js +501 -124
  73. package/lib/inventory/dosai.js +248 -44
  74. package/lib/inventory/dosaiParsers.js +310 -15
  75. package/lib/inventory/dynamic.js +52 -6
  76. package/lib/inventory/evidenceUtils.js +154 -109
  77. package/lib/inventory/fetchBatch.js +574 -38
  78. package/lib/inventory/fetchDiskCache.js +597 -0
  79. package/lib/inventory/forgeEnricher.js +14 -5
  80. package/lib/inventory/jvmLocalRepos.js +917 -0
  81. package/lib/inventory/mcpConfigParser.js +2 -3
  82. package/lib/inventory/parentSelection.js +146 -0
  83. package/lib/inventory/rustFormulationParser.js +3 -4
  84. package/lib/inventory/scalaCoords.js +153 -0
  85. package/lib/inventory/source.js +8 -8
  86. package/lib/inventory/spdx.js +101 -0
  87. package/lib/inventory/traceRunner.js +88 -7
  88. package/lib/inventory/tracedCrypto.js +294 -0
  89. package/lib/managers/docker.js +33 -32
  90. package/lib/managers/oci.js +24 -2
  91. package/lib/parsers/cmakeCache.js +69 -0
  92. package/lib/parsers/cmakeLists.js +16 -2
  93. package/lib/parsers/cmakePresets.js +400 -0
  94. package/lib/parsers/compileCommands.js +557 -0
  95. package/lib/parsers/strictJson.js +322 -0
  96. package/lib/parsers/terraformConfig.js +1073 -0
  97. package/lib/parsers/terraformSource.js +652 -0
  98. package/lib/server/server.js +23 -0
  99. package/lib/stages/postgen/introspection/markers.js +1 -1
  100. package/lib/stages/postgen/postgen.js +15 -1
  101. package/lib/stages/postgen/specVersionCompat.js +32 -0
  102. package/lib/validator/index.js +25 -10
  103. package/lib/validator/reporters/json.js +1 -0
  104. package/package.json +21 -21
  105. package/types/lib/audit/index.d.ts.map +1 -1
  106. package/types/lib/cli/index.d.ts.map +1 -1
  107. package/types/lib/cli/jsBom.d.ts.map +1 -1
  108. package/types/lib/cli/jvmBom.d.ts +24 -1
  109. package/types/lib/cli/jvmBom.d.ts.map +1 -1
  110. package/types/lib/cli/managedBom.d.ts +7 -4
  111. package/types/lib/cli/managedBom.d.ts.map +1 -1
  112. package/types/lib/cli/nativeBom.d.ts +3 -1
  113. package/types/lib/cli/nativeBom.d.ts.map +1 -1
  114. package/types/lib/core/activity.d.ts.map +1 -1
  115. package/types/lib/core/env.d.ts +9 -0
  116. package/types/lib/core/env.d.ts.map +1 -1
  117. package/types/lib/core/fs.d.ts.map +1 -1
  118. package/types/lib/core/httpClient.d.ts +13 -8
  119. package/types/lib/core/httpClient.d.ts.map +1 -1
  120. package/types/lib/core/pluginRun.d.ts +97 -0
  121. package/types/lib/core/pluginRun.d.ts.map +1 -0
  122. package/types/lib/core/processTree.d.ts +36 -0
  123. package/types/lib/core/processTree.d.ts.map +1 -0
  124. package/types/lib/core/runState.d.ts +29 -0
  125. package/types/lib/core/runState.d.ts.map +1 -0
  126. package/types/lib/core/toml.d.ts +20 -0
  127. package/types/lib/core/toml.d.ts.map +1 -0
  128. package/types/lib/ecosystems/asarutils.d.ts.map +1 -1
  129. package/types/lib/ecosystems/bunutils.d.ts.map +1 -1
  130. package/types/lib/ecosystems/cargoCache.d.ts +12 -0
  131. package/types/lib/ecosystems/cargoCache.d.ts.map +1 -1
  132. package/types/lib/ecosystems/cmakeResolver.d.ts +5 -3
  133. package/types/lib/ecosystems/cmakeResolver.d.ts.map +1 -1
  134. package/types/lib/ecosystems/cppBuildContext.d.ts +55 -0
  135. package/types/lib/ecosystems/cppBuildContext.d.ts.map +1 -0
  136. package/types/lib/ecosystems/cppEvidence.d.ts +18 -2
  137. package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
  138. package/types/lib/ecosystems/cppIncludeResolver.d.ts +92 -0
  139. package/types/lib/ecosystems/cppIncludeResolver.d.ts.map +1 -0
  140. package/types/lib/ecosystems/denoutils.d.ts +9 -3
  141. package/types/lib/ecosystems/denoutils.d.ts.map +1 -1
  142. package/types/lib/ecosystems/ecosystems.d.ts +62 -13
  143. package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
  144. package/types/lib/ecosystems/golem.d.ts.map +1 -1
  145. package/types/lib/ecosystems/gradleutils.d.ts +50 -0
  146. package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
  147. package/types/lib/ecosystems/jsEvidence.d.ts.map +1 -1
  148. package/types/lib/ecosystems/kosi.d.ts.map +1 -1
  149. package/types/lib/ecosystems/npmutils.d.ts +15 -0
  150. package/types/lib/ecosystems/npmutils.d.ts.map +1 -1
  151. package/types/lib/ecosystems/parsers-dotnet.d.ts +118 -4
  152. package/types/lib/ecosystems/parsers-dotnet.d.ts.map +1 -1
  153. package/types/lib/ecosystems/parsers-elm.d.ts.map +1 -1
  154. package/types/lib/ecosystems/parsers-gleam.d.ts.map +1 -1
  155. package/types/lib/ecosystems/parsers-go.d.ts +44 -2
  156. package/types/lib/ecosystems/parsers-go.d.ts.map +1 -1
  157. package/types/lib/ecosystems/parsers-js.d.ts +6 -1
  158. package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
  159. package/types/lib/ecosystems/parsers-julia.d.ts.map +1 -1
  160. package/types/lib/ecosystems/parsers-jvm.d.ts +46 -1
  161. package/types/lib/ecosystems/parsers-jvm.d.ts.map +1 -1
  162. package/types/lib/ecosystems/parsers-misc.d.ts +3 -1
  163. package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
  164. package/types/lib/ecosystems/parsers-python.d.ts +53 -3
  165. package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
  166. package/types/lib/ecosystems/parsers-terraform.d.ts +38 -21
  167. package/types/lib/ecosystems/parsers-terraform.d.ts.map +1 -1
  168. package/types/lib/ecosystems/pythonutils.d.ts +27 -2
  169. package/types/lib/ecosystems/pythonutils.d.ts.map +1 -1
  170. package/types/lib/ecosystems/remote/huggingface.d.ts.map +1 -1
  171. package/types/lib/ecosystems/rubyutils.d.ts +21 -1
  172. package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
  173. package/types/lib/ecosystems/rusi.d.ts.map +1 -1
  174. package/types/lib/ecosystems/sbtutils.d.ts +88 -2
  175. package/types/lib/ecosystems/sbtutils.d.ts.map +1 -1
  176. package/types/lib/ecosystems/scalacliutils.d.ts +56 -0
  177. package/types/lib/ecosystems/scalacliutils.d.ts.map +1 -0
  178. package/types/lib/ecosystems/scalasem.d.ts +311 -0
  179. package/types/lib/ecosystems/scalasem.d.ts.map +1 -0
  180. package/types/lib/ecosystems/terraformRegistry.d.ts +9 -0
  181. package/types/lib/ecosystems/terraformRegistry.d.ts.map +1 -0
  182. package/types/lib/ecosystems/utils.d.ts +2 -2
  183. package/types/lib/ecosystems/utils.d.ts.map +1 -1
  184. package/types/lib/ecosystems/vendoredCode.d.ts +32 -0
  185. package/types/lib/ecosystems/vendoredCode.d.ts.map +1 -0
  186. package/types/lib/evinser/evinser.d.ts +75 -8
  187. package/types/lib/evinser/evinser.d.ts.map +1 -1
  188. package/types/lib/helpers/bomSigner.d.ts +80 -4
  189. package/types/lib/helpers/bomSigner.d.ts.map +1 -1
  190. package/types/lib/inventory/aiCollector.d.ts.map +1 -1
  191. package/types/lib/inventory/analyzer.d.ts.map +1 -1
  192. package/types/lib/inventory/atomUtils.d.ts +82 -10
  193. package/types/lib/inventory/atomUtils.d.ts.map +1 -1
  194. package/types/lib/inventory/auditCategories.d.ts +3 -0
  195. package/types/lib/inventory/auditCategories.d.ts.map +1 -1
  196. package/types/lib/inventory/buildToolRateLimit.d.ts +38 -0
  197. package/types/lib/inventory/buildToolRateLimit.d.ts.map +1 -0
  198. package/types/lib/inventory/cacheCommands.d.ts +2 -1
  199. package/types/lib/inventory/cacheCommands.d.ts.map +1 -1
  200. package/types/lib/inventory/cmakeBuildDirs.d.ts +58 -0
  201. package/types/lib/inventory/cmakeBuildDirs.d.ts.map +1 -0
  202. package/types/lib/inventory/deps.d.ts +59 -1
  203. package/types/lib/inventory/deps.d.ts.map +1 -1
  204. package/types/lib/inventory/dosai.d.ts +57 -8
  205. package/types/lib/inventory/dosai.d.ts.map +1 -1
  206. package/types/lib/inventory/dosaiParsers.d.ts +53 -7
  207. package/types/lib/inventory/dosaiParsers.d.ts.map +1 -1
  208. package/types/lib/inventory/dynamic.d.ts +10 -0
  209. package/types/lib/inventory/dynamic.d.ts.map +1 -1
  210. package/types/lib/inventory/evidenceUtils.d.ts +19 -4
  211. package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
  212. package/types/lib/inventory/fetchBatch.d.ts +83 -14
  213. package/types/lib/inventory/fetchBatch.d.ts.map +1 -1
  214. package/types/lib/inventory/fetchDiskCache.d.ts +169 -0
  215. package/types/lib/inventory/fetchDiskCache.d.ts.map +1 -0
  216. package/types/lib/inventory/forgeEnricher.d.ts.map +1 -1
  217. package/types/lib/inventory/jvmLocalRepos.d.ts +178 -0
  218. package/types/lib/inventory/jvmLocalRepos.d.ts.map +1 -0
  219. package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
  220. package/types/lib/inventory/parentSelection.d.ts +34 -0
  221. package/types/lib/inventory/parentSelection.d.ts.map +1 -0
  222. package/types/lib/inventory/rustFormulationParser.d.ts.map +1 -1
  223. package/types/lib/inventory/scalaCoords.d.ts +80 -0
  224. package/types/lib/inventory/scalaCoords.d.ts.map +1 -0
  225. package/types/lib/inventory/source.d.ts.map +1 -1
  226. package/types/lib/inventory/spdx.d.ts +9 -0
  227. package/types/lib/inventory/spdx.d.ts.map +1 -1
  228. package/types/lib/inventory/traceRunner.d.ts +12 -0
  229. package/types/lib/inventory/traceRunner.d.ts.map +1 -1
  230. package/types/lib/inventory/tracedCrypto.d.ts +42 -0
  231. package/types/lib/inventory/tracedCrypto.d.ts.map +1 -0
  232. package/types/lib/managers/docker.d.ts.map +1 -1
  233. package/types/lib/managers/oci.d.ts +3 -1
  234. package/types/lib/managers/oci.d.ts.map +1 -1
  235. package/types/lib/parsers/cmakeCache.d.ts +16 -0
  236. package/types/lib/parsers/cmakeCache.d.ts.map +1 -1
  237. package/types/lib/parsers/cmakeLists.d.ts +2 -1
  238. package/types/lib/parsers/cmakeLists.d.ts.map +1 -1
  239. package/types/lib/parsers/cmakePresets.d.ts +78 -0
  240. package/types/lib/parsers/cmakePresets.d.ts.map +1 -0
  241. package/types/lib/parsers/compileCommands.d.ts +115 -0
  242. package/types/lib/parsers/compileCommands.d.ts.map +1 -0
  243. package/types/lib/parsers/strictJson.d.ts +46 -0
  244. package/types/lib/parsers/strictJson.d.ts.map +1 -0
  245. package/types/lib/parsers/terraformConfig.d.ts +70 -0
  246. package/types/lib/parsers/terraformConfig.d.ts.map +1 -0
  247. package/types/lib/parsers/terraformSource.d.ts +66 -0
  248. package/types/lib/parsers/terraformSource.d.ts.map +1 -0
  249. package/types/lib/server/server.d.ts.map +1 -1
  250. package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
  251. package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
  252. package/types/lib/validator/index.d.ts +8 -0
  253. package/types/lib/validator/index.d.ts.map +1 -1
  254. package/types/lib/validator/reporters/json.d.ts.map +1 -1
  255. package/lib/third-party/arborist/snapshots/calc-dep-flags.test.cjs +0 -462
@@ -1,27 +1,12 @@
1
1
  /**
2
- * Terraform and OpenTofu parser for `.terraform.lock.hcl`.
2
+ * Whether a path holds any Terraform or OpenTofu configuration or lock file
3
+ * the workspace assembly would consider; used by project-type autodetection.
3
4
  *
4
- * The lock file pins every provider the configuration resolves to, with its
5
- * exact version, the version constraints that produced it, and content
6
- * hashes. It is written in a small, regular subset of HCL: provider blocks,
7
- * `version` and `constraints` attributes, and a `hashes` list of prefixed
8
- * digests. A line scanner is sufficient and avoids a general HCL parser.
9
- *
10
- * Provider addresses look like `registry.terraform.io/hashicorp/aws`; the
11
- * registry host and namespace identify the provider upstream, so they are
12
- * kept in the component group and a generic purl
13
- * (`pkg:generic/<host>/<namespace>/<type>@<version>`), with the intended type
14
- * recorded as a `cdx:purl:proposedType` property because no `terraform`
15
- * purl type is registered.
16
- *
17
- * The two hash schemes in the `hashes` list mean different things. A `zh:`
18
- * digest is a SHA-256 of the official `.zip` package as the registry indexes
19
- * it, so it is the one a consumer can check an artifact against and the one
20
- * emitted in the CycloneDX `hashes` array. An `h1:` digest is base64 over a
21
- * hash of the package's *contents* rather than the archive, which lets
22
- * Terraform verify an unpacked directory but makes it useless as an artifact
23
- * checksum; it is kept as a property instead of being mislabelled SHA-256.
5
+ * @param {string} scanPath Directory to scan
6
+ * @param {Object} [options] CLI options
7
+ * @returns {boolean}
24
8
  */
9
+ export declare function hasTerraformConfiguration(scanPath: string, options?: Object): boolean;
25
10
  /**
26
11
  * Parse a `.terraform.lock.hcl` file.
27
12
  *
@@ -31,4 +16,36 @@
31
16
  export declare function parseTerraformLockFile(lockFile: string): {
32
17
  pkgList: object[];
33
18
  };
19
+ /**
20
+ * Locate the Terraform roots under `scanPath`: directories that own a
21
+ * configuration — those with a lock file or module manifest, plus config
22
+ * directories no other config directory references through a local module
23
+ * call.
24
+ *
25
+ * @param {string} scanPath Directory to scan
26
+ * @param {Object} options CLI options
27
+ * @returns {{ dir: string, lockFile?: string, manifestFile?: string }[]} Roots sorted by relative POSIX path
28
+ */
29
+ export declare function findTerraformRoots(scanPath: string, options?: Object): {
30
+ dir: string;
31
+ lockFile?: string;
32
+ manifestFile?: string;
33
+ }[];
34
+ /**
35
+ * Inventory a Terraform workspace: providers from the lock file and
36
+ * `required_providers`, modules from the manifest or the configuration, the
37
+ * dependency graph between them, and offline licenses from the installed
38
+ * packages.
39
+ *
40
+ * @param {string} scanPath Directory to scan
41
+ * @param {Object} options CLI options
42
+ * @param {string} parentRef `bom-ref` of the parent component the CLI built
43
+ * @returns {{ pkgList: object[], dependencies: object[], parentProperties: object[], srcFiles: string[] }}
44
+ */
45
+ export declare function parseTerraformWorkspace(scanPath: string, options: Object, parentRef: string): {
46
+ pkgList: object[];
47
+ dependencies: object[];
48
+ parentProperties: object[];
49
+ srcFiles: string[];
50
+ };
34
51
  //# sourceMappingURL=parsers-terraform.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parsers-terraform.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/parsers-terraform.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAHpC,MAGoC,GAFlC;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAkEjC"}
1
+ {"version":3,"file":"parsers-terraform.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/parsers-terraform.js"],"names":[],"mappings":"AAuHA;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAJvC,MAIuC,EAAE,OAAO,AAHxD,CACA,EADQ,MAGqD,GAFnD,OAAO,CAInB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAHpC,MAGoC,GAFlC;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAkEjC;AAuLD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAJhC,MAIgC,EAAE,OAAO,GAHzC,MAG8C,GAF5C;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,CA+DvE;AAiGD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EALrC,MAKqC,EAAE,OAAO,EAJ9C,MAI8C,EAAE,SAAS,EAHzD,MAGyD,GAFvD;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAoDzG"}
@@ -15,6 +15,17 @@ export declare function getVenvMetadata(env?: Object, explicitPath?: string): Ob
15
15
  * @returns {string} Path to the Python executable or the fallback command name
16
16
  */
17
17
  export declare function get_python_command_from_env(env: string): string;
18
+ /**
19
+ * The top-level packages and modules a project provides, wherever they sit
20
+ * in its tree: each outermost package directory (one with an `__init__.py`
21
+ * whose parent has none), and the module files beside such packages, since
22
+ * their directory is a source root. Directories of installed packages
23
+ * (virtual environments, `site-packages`) are not the project's.
24
+ *
25
+ * @param {string} src Path to the project being analysed
26
+ * @returns {Set<string>} Module names
27
+ */
28
+ export declare function projectModuleNames(src: string): Set<string>;
18
29
  /**
19
30
  * Is this import satisfied by a module that lives in the project itself?
20
31
  *
@@ -28,13 +39,27 @@ export declare function get_python_command_from_env(env: string): string;
28
39
  * filesystem whether the module is ours answers it exactly.
29
40
  *
30
41
  * Checks the project root and a `src/` layout for a module file, a package directory,
31
- * and a PEP 420 namespace package directory.
42
+ * and a PEP 420 namespace package directory, then the top-level packages found
43
+ * anywhere in the project and the modules beside them (tool-heavy repositories
44
+ * keep their Python libraries in places such as `dev_tools/pylibs/`).
32
45
  *
33
46
  * @param {string} src Path to the project being analysed
34
47
  * @param {string} name Imported top-level module name
35
48
  * @returns {boolean} `true` if the project supplies this module itself
36
49
  */
37
50
  export declare function isFirstPartyModule(src: string, name: string): boolean;
51
+ /**
52
+ * Whether a directory holds Python sources for atom to parse.
53
+ *
54
+ * The search skips the directories the manifest searches skip, such as
55
+ * node_modules and dot directories, and honours the exclude patterns, so a
56
+ * Python file shipped inside an npm package does not count.
57
+ *
58
+ * @param {string} src directory
59
+ * @param {Object} options CLI options
60
+ * @returns {boolean} true when the directory holds at least one Python file
61
+ */
62
+ export declare function hasPythonSources(src: string, options?: Object): boolean;
38
63
  /**
39
64
  * Method to find python modules by parsing the imports and then checking with PyPI to obtain the latest version
40
65
  *
@@ -71,9 +96,9 @@ export declare function createUVLock(basePath: string, options: Object): void;
71
96
  */
72
97
  export declare function getPipFrozenTree(basePath: string, reqOrSetupFile: string, tempVenvDir: string, parentComponent: Object, projectRoot: any, getTreeWithPluginFn: any): Object;
73
98
  export declare function getPipTreeForPackages(basePath: any, pkgList: any, tempVenvDir: any, parentComponent: any, getTreeWithPluginFn: any): {
99
+ rootList?: undefined;
74
100
  dependenciesList?: undefined;
75
101
  failedPkgList?: undefined;
76
- rootList?: undefined;
77
102
  } | {
78
103
  failedPkgList: any[];
79
104
  rootList: {
@@ -1 +1 @@
1
- {"version":3,"file":"pythonutils.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/pythonutils.js"],"names":[],"mappings":"AAiCA;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,G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,CAAC,CAwCvB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAJ3B,MAI2B,EAAE,IAAI,EAHjC,MAGiC,GAF/B,OAAO,CA+BnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAJzB,MAIyB,EAAE,OAAO,GAHlC,MAGuC,GAFrC,OAAO,CAInB;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAL3B,MAK2B,EAAE,QAAQ,OAAA,EAAE,OAAO,EAH9C,MAG8C;;;;;;;;GAoFxD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAH1B,MAG0B,EAAE,OAAO,EAFnC,MAEmC,QAgD7C;AAED;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EARC,MAQD,EACR,cAAc,EARL,MAQK,EACd,WAAW,EARF,MAQE,EACX,eAAe,EARN,MAQM,EACf,WAAW,KAAA,EACX,mBAAmB,KAAA,GARR,MAAM,CAmkBlB;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,KAAA,EACR,OAAO,KAAA,EACP,WAAW,KAAA,EACX,eAAe,KAAA,EACf,mBAAmB,KAAA;;;;;;;;;;;;;;;;EAwNpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"huggingface.d.ts","sourceRoot":"","sources":["../../../../lib/ecosystems/remote/huggingface.js"],"names":[],"mappings":"AA4JA,OAAO,EACL,6BAA6B,EAC7B,iBAAiB,GAClB,MAAM,mCAAmC,CAAC;AAE3C;;GAEG;AACH,wBAAgB,4BAA4B,SAG3C;AAq6BD;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,aAH5B,MAAM,KACJ,OAOV,CAAC;AAEJ;;;;;;;GAOG;AACH,wBAAsB,8BAA8B,CAClD,SAAS,EANA,MAMA,EACT,MAAM,EANG,MAMH,EACN,OAAO,AANN,CACA,EADQ,MAMG,GALD,OAAO,CAAC,MAAM,GAAC,SAAS,CAAC,CA0MrC;AAED;;;;;;;GAOG;AACH,wBAAsB,6BAA6B,CACjD,SAAS,EANA,MAMA,EACT,MAAM,EANG,MAMH,EACN,OAAO,AANN,CACA,EADQ,MAMG,GALD,OAAO,CAAC,MAAM,GAAC,SAAS,CAAC,CAarC"}
1
+ {"version":3,"file":"huggingface.d.ts","sourceRoot":"","sources":["../../../../lib/ecosystems/remote/huggingface.js"],"names":[],"mappings":"AA6JA,OAAO,EACL,6BAA6B,EAC7B,iBAAiB,GAClB,MAAM,mCAAmC,CAAC;AAE3C;;GAEG;AACH,wBAAgB,4BAA4B,SAG3C;AAu6BD;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,aAH5B,MAAM,KACJ,OAOV,CAAC;AAEJ;;;;;;;GAOG;AACH,wBAAsB,8BAA8B,CAClD,SAAS,EANA,MAMA,EACT,MAAM,EANG,MAMH,EACN,OAAO,AANN,CACA,EADQ,MAMG,GALD,OAAO,CAAC,MAAM,GAAC,SAAS,CAAC,CA0MrC;AAED;;;;;;;GAOG;AACH,wBAAsB,6BAA6B,CACjD,SAAS,EANA,MAMA,EACT,MAAM,EANG,MAMH,EACN,OAAO,AANN,CACA,EADQ,MAMG,GALD,OAAO,CAAC,MAAM,GAAC,SAAS,CAAC,CAarC"}
@@ -209,9 +209,17 @@ export declare function collectGemModuleNames(rubyCommand: string, bundleCommand
209
209
  * @param {Object} [options] Parse options
210
210
  * @param {Object<string, string>} [options.lockedVersions] Locked versions of
211
211
  * the gems the project directory serves, by gem name
212
+ * @param {boolean} [options.projectGemspec] The gemspec describes the project
213
+ * being scanned. No registry holds the project, so its gem is never looked
214
+ * up and keeps what the gemspec says.
215
+ * @param {boolean} [options.noFetch] Read the gemspec for the fields it holds
216
+ * without asking the registry about the gem. The local cache enricher uses
217
+ * this, since the caller is responsible for the registry round.
212
218
  */
213
219
  export declare function parseGemspecData(gemspecData: string, gemspecFile: string, options?: {
214
220
  lockedVersions?: Record<string, string>;
221
+ projectGemspec?: boolean;
222
+ noFetch?: boolean;
215
223
  }): Promise<any[]>;
216
224
  /**
217
225
  * Method to parse Gemfile.lock
@@ -221,10 +229,22 @@ export declare function parseGemspecData(gemspecData: string, gemspecFile: strin
221
229
  * directory (`PATH` with `remote: .`), which is how Bundler records the gem a
222
230
  * project builds when its Gemfile uses the `gemspec` directive.
223
231
  *
232
+ * Gems the lockfile serves from a git remote or from a path outside the
233
+ * project are never sent to rubygems.org: no public registry holds the release
234
+ * they pinned. Before the registry round, the caches on this machine are read
235
+ * first, so a gem whose installed gemspec or compact index entry is present
236
+ * keeps those answers.
237
+ *
224
238
  * @param {object} gemLockData Gemfile.lock data
225
239
  * @param {string} lockFile Lock file
240
+ * @param {object} [options] Options
241
+ * @param {string} [options.gemHome] GEM_HOME to read installed gemspecs from
242
+ * @param {string} [options.compactIndexCacheDir] Bundler compact index cache
226
243
  */
227
- export declare function parseGemfileLockData(gemLockData: object, lockFile: string): Promise<any[] | {
244
+ export declare function parseGemfileLockData(gemLockData: object, lockFile: string, options?: {
245
+ gemHome?: string;
246
+ compactIndexCacheDir?: string;
247
+ }): Promise<any[] | {
228
248
  pkgList: any[];
229
249
  dependenciesList: {
230
250
  ref: string;
@@ -1 +1 @@
1
- {"version":3,"file":"rubyutils.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/rubyutils.js"],"names":[],"mappings":"AAsEA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAHzB,MAGyB,GAFvB,OAAO,CAOnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAHlC,MAAM,GAAG,SAGyB,GAFhC,MAAM,GAAG,SAAS,CAO9B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAHrC,MAAM,GAAG,SAG4B,GAFnC;IAAC,OAAO,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAAC,QAAQ,EAAE,C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C,SAAS,CA2B5B;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,GAJnC,MAIwC,EAAE,UAAU,QAAK,GAFvD,MAAM,CA8DlB"}
@@ -59,6 +59,14 @@ export declare function testUrlExists(url: string): Promise<boolean>;
59
59
  * @returns {string|null} local jar path or null
60
60
  */
61
61
  export declare function findLocalJarPath(group: string, name: string, version: string): string | null;
62
+ /**
63
+ * Forget every memoised Coursier lookup, including misses. A long-lived
64
+ * process calls this per scan so that artifacts downloaded since the previous
65
+ * scan are found.
66
+ *
67
+ * @returns {void}
68
+ */
69
+ export declare function resetSbtResolutionCaches(): void;
62
70
  /**
63
71
  * Resolve the repo/jar download URLs and optional hashes for a Maven coordinate.
64
72
  *
@@ -87,9 +95,12 @@ export declare function resolveJarDistribution(group: string, name: string, vers
87
95
  * coordinates, building a hierarchical dependency graph. Evicted packages and ranges are ignored.
88
96
  *
89
97
  * @param {string} sbtTreeFile Path to the sbt dependency tree output file
98
+ * @param {string} [srcFile] Build definition the tree was resolved from, named as the
99
+ * identity source of every component. The tree file itself is a temporary file cdxgen
100
+ * deletes after the scan, and naming it would make the BOM differ between two runs.
90
101
  * @returns {{ pkgList: Object[], dependenciesList: Object[] }}
91
102
  */
92
- export declare function parseSbtTree(sbtTreeFile: string): {
103
+ export declare function parseSbtTree(sbtTreeFile: string, srcFile?: string): {
93
104
  pkgList: Object[];
94
105
  dependenciesList: Object[];
95
106
  };
@@ -100,7 +111,7 @@ export declare function parseSbtTree(sbtTreeFile: string): {
100
111
  */
101
112
  export declare function parseSbtLock(pkgLockFile: string): Promise<{
102
113
  group: any;
103
- name: any;
114
+ name: string;
104
115
  version: any;
105
116
  _integrity: string;
106
117
  scope: string | undefined;
@@ -169,6 +180,34 @@ export declare function parseSbtProjects(stdout: string): {
169
180
  projects: string[];
170
181
  root: string | undefined;
171
182
  };
183
+ /**
184
+ * Whether an sbt version is sbt 2 or later, the release candidates of sbt 2
185
+ * included: `2.0.0-RC12` is below `2.0.0` in semver order.
186
+ *
187
+ * @param {string|null|undefined} sbtVersion Version from project/build.properties
188
+ * @returns {boolean} True for sbt 2.x and later
189
+ */
190
+ export declare function isSbt2Version(sbtVersion: string | null | undefined): boolean;
191
+ /**
192
+ * Build the single command line an sbt 2 dependency tree session runs.
193
+ *
194
+ * sbt 2 joins separate command-line arguments into one command line, so the
195
+ * commands are joined with `;` and passed as one argument. sbt 2 ships the
196
+ * dependency tree tasks itself, and `dependencyTree / toFile` became
197
+ * `dependencyTree --out`, so every tree is written to its own file, the
198
+ * extra roots a tree may list included. The trees are not aggregated: the
199
+ * tree of an aggregating root would otherwise be overwritten by the trees of
200
+ * the projects it aggregates. Each tree is scoped to its project, so one
201
+ * unresolvable subproject cannot fail the others.
202
+ *
203
+ * @param {{project?: string, file: string}[]} trees The project id of each
204
+ * tree, none for the current project, and the file it is written to
205
+ * @returns {string} The `;`-joined command line
206
+ */
207
+ export declare function sbt2DependencyTreeCommand(trees: {
208
+ project?: string;
209
+ file: string;
210
+ }[]): string;
172
211
  /**
173
212
  * Parse plugins.sbt files to extract sbt plugins as development dependencies.
174
213
  *
@@ -176,4 +215,51 @@ export declare function parseSbtProjects(stdout: string): {
176
215
  * @returns {Object[]} List of parsed dependency components
177
216
  */
178
217
  export declare function parseSbtPlugins(projectPath: string): Object[];
218
+ /**
219
+ * The sbt launcher jar beside the `sbt.bat` on PATH, or under `SBT_HOME`.
220
+ * `SBT_LAUNCH_JAR` names one directly.
221
+ *
222
+ * @returns {string|undefined} Path of `sbt-launch.jar`
223
+ */
224
+ export declare function sbtLaunchJar(): string | undefined;
225
+ /**
226
+ * Split sbt arguments written for a POSIX shell into the arguments the shell
227
+ * would pass: whitespace separates them outside quotes, and single or double
228
+ * quotes group words without escapes, so a Windows path keeps its
229
+ * backslashes.
230
+ *
231
+ * @param {string[]} args Shell-quoted argument fragments
232
+ * @returns {string[]} The arguments
233
+ */
234
+ export declare function splitSbtShellArgs(args: string[]): string[];
235
+ /**
236
+ * The command line that starts sbt from its launcher jar. The options
237
+ * `sbt.bat` handles itself become what it makes of them: `-no-colors` and
238
+ * `-D` properties are JVM options, `-addPluginSbtFile` is sbt's own
239
+ * `--addPluginSbtFile`, and `-batch` and the thin client switches have no
240
+ * meaning there. The JVM options of `SBT_OPTS`, `JAVA_OPTS` and the build's
241
+ * `.jvmopts` are kept.
242
+ *
243
+ * @param {string[]} args Arguments as given to `sbt`
244
+ * @param {string} jar The sbt launcher jar
245
+ * @param {string} [dir] Build directory
246
+ * @returns {{ command: string, args: string[] }}
247
+ */
248
+ export declare function sbtLauncherCommand(args: string[], jar: string, dir?: string): {
249
+ command: string;
250
+ args: string[];
251
+ };
252
+ /**
253
+ * Run sbt. On Windows, `sbt.bat` parses its arguments as batch syntax, which
254
+ * keeps the POSIX quoting of the commands and mangles quotes inside them, so
255
+ * sbt starts there from its launcher jar with each command one argument.
256
+ * Elsewhere, or without a launcher jar, sbt runs as given.
257
+ *
258
+ * @param {string} sbtCmd sbt executable
259
+ * @param {string[]} args sbt arguments
260
+ * @param {Object} options Spawn options, as for safeSpawnSync
261
+ * @param {boolean} [shellQuoted] Whether the arguments carry POSIX shell quoting
262
+ * @returns {Object} The spawn result
263
+ */
264
+ export declare function sbtSpawnSync(sbtCmd: string, args: string[], options: Object, shellQuoted?: boolean): Object;
179
265
  //# sourceMappingURL=sbtutils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sbtutils.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/sbtutils.js"],"names":[],"mappings":"AAmEA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAF/B,MAE+B,OAEzC;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAFpC,MAEoC,iBAa9C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAH1B,MAG0B,EAAE,MAAM,EAFlC,MAEkC,iBAc5C;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CA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,EAH7B,MAAM,GAAC,IAAI,GAAC,SAGiB,GAF3B,OAAO,CAInB;AAcD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAJpC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,EAII,GAFlC,MAAM,CAalB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAHhC,MAGgC,GAF9B,MAAM,EAAE,CAwDpB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAFf,MAAM,GAAC,SAAS,CAwB5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAH3B,MAAM,EAGqB,GAFzB,MAAM,EAAE,CAkCpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAL5B,MAAM,EAKsB,EAAE,GAAG,EAJjC,MAIiC,EAAE,GAAG,AAH9C,CACA,EADQ,MAGsC,GAFpC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAoC/C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,MAAM,EANxB,MAMwB,EAAE,IAAI,EAL9B,MAAM,EAKwB,EAAE,OAAO,EAJvC,MAIuC,EAAE,WAAW,AAH5D,CACA,EADQ,OAG4D,GAF1D,MAAM,CAoBlB"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Parse the `//> using` directives of a scala-cli source file.
3
+ *
4
+ * @param {string} sourceFile Path of the source file
5
+ * @returns {{ scalaVersion: string|null, platform: string|null, nativeVersion: string|null, deps: Object[] }}
6
+ * The declared scala version and platform, and the declared dependencies as
7
+ * `{ group, artifact, version, cross, test }` entries, where `cross` is
8
+ * `::`, `:::` or `none`
9
+ */
10
+ export declare function parseScalaCliDirectives(sourceFile: string): {
11
+ scalaVersion: string | null;
12
+ platform: string | null;
13
+ nativeVersion: string | null;
14
+ deps: Object[];
15
+ };
16
+ /**
17
+ * Build a component for a scala-cli dependency in the sbt purl form: the
18
+ * Scala binary suffix is not part of the name, the platform suffix of the
19
+ * declared platform is, and the Scala binary version is recorded as
20
+ * cdx:scala:compilerVersion.
21
+ *
22
+ * @param {Object} dep Parsed dependency declaration
23
+ * @param {Object} project Directives of the file the dependency was declared in
24
+ * @param {string} sourceFile File the dependency was declared in
25
+ * @returns {Object|null} The component, or null for malformed declarations
26
+ */
27
+ export declare function scalaCliComponent(dep: Object, project: Object, sourceFile: string): Object | null;
28
+ /**
29
+ * Map a jar path of the Coursier cache to its Maven coordinates.
30
+ *
31
+ * Only the https cache layout with a well-known repository path segment is
32
+ * parsed; anything else returns null rather than guessing a group id.
33
+ *
34
+ * @param {string} jarPath Path of a jar in the Coursier cache
35
+ * @returns {{ group: string, name: string, version: string }|null} The coordinates
36
+ */
37
+ export declare function coordinatesFromCoursierPath(jarPath: string): {
38
+ group: string;
39
+ name: string;
40
+ version: string;
41
+ } | null;
42
+ /**
43
+ * Collect the components a scala-cli project declares through its
44
+ * `//> using` directives.
45
+ *
46
+ * Transitive dependencies are added from the class path of
47
+ * `scala-cli compile --print-class-path` when dependency installation is
48
+ * allowed, by mapping the Coursier cache paths back to coordinates.
49
+ *
50
+ * @param {string} dirPath Directory of the scala-cli project
51
+ * @param {Object} options CLI options
52
+ * @returns {Object[]} Component list, empty when the project declares no
53
+ * scala-cli directives
54
+ */
55
+ export declare function collectScalaCliComponents(dirPath: string, options?: Object): Object[];
56
+ //# sourceMappingURL=scalacliutils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scalacliutils.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/scalacliutils.js"],"names":[],"mappings":"AAwCA;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EANvC,MAMuC,GALrC;IAAE,YAAY,EAAE,MAAM,GAAC,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAC,IAAI,CAAC;IAAC,aAAa,EAAE,MAAM,GAAC,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAyD5G;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAL1B,MAK0B,EAAE,OAAO,EAJnC,MAImC,EAAE,UAAU,EAH/C,MAG+C,GAF7C,MAAM,GAAC,IAAI,CAuDvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAHxC,MAGwC,GAFtC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAC,IAAI,CAkCjE;AAsBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EALtC,MAKsC,EAAE,OAAO,GAJ/C,MAIoD,GAHlD,MAAM,EAAE,CAmGpB"}