@cdxgen/cdxgen 13.0.1 → 13.1.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.
- package/README.md +26 -13
- package/bin/audit.js +6 -0
- package/bin/cdxgen.js +125 -4
- package/bin/evinse.js +1 -1
- package/data/component-tags.json +8 -1
- package/data/frameworks-list.json +86 -1
- package/data/remediations.json +1144 -0
- package/data/rules/asar-archives.yaml +1 -1
- package/data/rules/build-fidelity.yaml +782 -0
- package/data/rules/package-integrity.yaml +13 -13
- package/lib/audit/index.js +48 -4
- package/lib/audit/scoring.js +2 -8
- package/lib/cli/bomAssembly.js +20 -1
- package/lib/cli/cliOptions.js +94 -7
- package/lib/cli/index.js +76 -48
- package/lib/cli/jsBom.js +32 -3
- package/lib/cli/jvmBom.js +1494 -1315
- package/lib/cli/managedBom.js +97 -28
- package/lib/cli/nativeBom.js +189 -10
- package/lib/core/buildLedger.js +799 -0
- package/lib/core/deferredExit.js +141 -0
- package/lib/core/env.js +69 -1
- package/lib/core/fs.js +60 -0
- package/lib/core/logger.js +12 -99
- package/lib/core/severity.js +16 -0
- package/lib/core/syncFileWriter.js +106 -0
- package/lib/ecosystems/ecosystems.js +9 -0
- package/lib/ecosystems/gradleutils.js +355 -15
- package/lib/ecosystems/parsers-js.js +26 -0
- package/lib/ecosystems/parsers-jvm.js +9 -0
- package/lib/ecosystems/parsers-misc.js +16 -2
- package/lib/ecosystems/parsers-python.js +171 -35
- package/lib/ecosystems/parsers-rust.js +12 -2
- package/lib/ecosystems/pypiClassifiers.js +326 -0
- package/lib/ecosystems/pythonutils.js +49 -1
- package/lib/ecosystems/rubyutils.js +13 -0
- package/lib/evinser/evinser.js +30 -12
- package/lib/helpers/remote/dependency-track.js +81 -14
- package/lib/inventory/auditCategories.js +9 -0
- package/lib/inventory/depsUtils.js +72 -0
- package/lib/inventory/dosai.js +431 -22
- package/lib/inventory/envcontext.js +206 -18
- package/lib/inventory/fetchBatch.js +57 -0
- package/lib/inventory/jvmToolEnv.js +593 -0
- package/lib/inventory/osinfo.js +1 -0
- package/lib/inventory/toolRequirements.js +903 -0
- package/lib/managers/binary.js +24 -0
- package/lib/managers/docker.js +26 -5
- package/lib/server/server.js +1 -1
- package/lib/stages/postgen/annotationBuilder.js +97 -0
- package/lib/stages/postgen/auditBom.js +76 -79
- package/lib/stages/postgen/introspection/annotate.js +320 -0
- package/lib/stages/postgen/introspection/commandFacts.js +293 -0
- package/lib/stages/postgen/introspection/emit.js +192 -0
- package/lib/stages/postgen/introspection/formulationEvidence.js +427 -0
- package/lib/stages/postgen/introspection/markers.js +227 -0
- package/lib/stages/postgen/introspection/reflect.js +1214 -0
- package/lib/stages/postgen/introspection/report.js +1208 -0
- package/lib/stages/postgen/introspection/score.js +1067 -0
- package/lib/stages/postgen/introspection/shapeCommand.js +304 -0
- package/lib/stages/postgen/parentEdge.js +156 -0
- package/lib/stages/postgen/postgen.js +115 -2
- package/lib/stages/postgen/ruleEngine.js +17 -0
- package/lib/stages/pregen/envAudit.js +42 -2
- package/lib/stages/pregen/pregen.js +1171 -6
- package/lib/validator/bomValidator.js +11 -2
- package/package.json +14 -14
- package/types/lib/audit/index.d.ts.map +1 -1
- package/types/lib/audit/scoring.d.ts +2 -8
- package/types/lib/audit/scoring.d.ts.map +1 -1
- package/types/lib/cli/bomAssembly.d.ts.map +1 -1
- package/types/lib/cli/cliOptions.d.ts +2 -1
- package/types/lib/cli/cliOptions.d.ts.map +1 -1
- package/types/lib/cli/index.d.ts +8 -0
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/cli/jsBom.d.ts.map +1 -1
- package/types/lib/cli/jvmBom.d.ts.map +1 -1
- package/types/lib/cli/managedBom.d.ts.map +1 -1
- package/types/lib/cli/nativeBom.d.ts.map +1 -1
- package/types/lib/core/buildLedger.d.ts +272 -0
- package/types/lib/core/buildLedger.d.ts.map +1 -0
- package/types/lib/core/deferredExit.d.ts +84 -0
- package/types/lib/core/deferredExit.d.ts.map +1 -0
- package/types/lib/core/env.d.ts +22 -1
- package/types/lib/core/env.d.ts.map +1 -1
- package/types/lib/core/fs.d.ts +21 -0
- package/types/lib/core/fs.d.ts.map +1 -1
- package/types/lib/core/logger.d.ts +2 -11
- package/types/lib/core/logger.d.ts.map +1 -1
- package/types/lib/core/severity.d.ts +11 -0
- package/types/lib/core/severity.d.ts.map +1 -0
- package/types/lib/core/syncFileWriter.d.ts +33 -0
- package/types/lib/core/syncFileWriter.d.ts.map +1 -0
- package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
- package/types/lib/ecosystems/gradleutils.d.ts +33 -0
- package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-jvm.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-rust.d.ts.map +1 -1
- package/types/lib/ecosystems/pypiClassifiers.d.ts +80 -0
- package/types/lib/ecosystems/pypiClassifiers.d.ts.map +1 -0
- package/types/lib/ecosystems/pythonutils.d.ts +20 -0
- package/types/lib/ecosystems/pythonutils.d.ts.map +1 -1
- package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
- package/types/lib/evinser/evinser.d.ts +5 -1
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/helpers/remote/dependency-track.d.ts +45 -4
- package/types/lib/helpers/remote/dependency-track.d.ts.map +1 -1
- package/types/lib/inventory/auditCategories.d.ts +8 -0
- package/types/lib/inventory/auditCategories.d.ts.map +1 -1
- package/types/lib/inventory/depsUtils.d.ts.map +1 -1
- package/types/lib/inventory/dosai.d.ts +20 -0
- package/types/lib/inventory/dosai.d.ts.map +1 -1
- package/types/lib/inventory/envcontext.d.ts.map +1 -1
- package/types/lib/inventory/fetchBatch.d.ts +9 -0
- package/types/lib/inventory/fetchBatch.d.ts.map +1 -1
- package/types/lib/inventory/jvmToolEnv.d.ts +189 -0
- package/types/lib/inventory/jvmToolEnv.d.ts.map +1 -0
- package/types/lib/inventory/osinfo.d.ts.map +1 -1
- package/types/lib/inventory/toolRequirements.d.ts +216 -0
- package/types/lib/inventory/toolRequirements.d.ts.map +1 -0
- package/types/lib/managers/binary.d.ts.map +1 -1
- package/types/lib/managers/docker.d.ts.map +1 -1
- package/types/lib/stages/postgen/annotationBuilder.d.ts +53 -0
- package/types/lib/stages/postgen/annotationBuilder.d.ts.map +1 -0
- package/types/lib/stages/postgen/auditBom.d.ts.map +1 -1
- package/types/lib/stages/postgen/introspection/annotate.d.ts +81 -0
- package/types/lib/stages/postgen/introspection/annotate.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/commandFacts.d.ts +32 -0
- package/types/lib/stages/postgen/introspection/commandFacts.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/emit.d.ts +71 -0
- package/types/lib/stages/postgen/introspection/emit.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/formulationEvidence.d.ts +154 -0
- package/types/lib/stages/postgen/introspection/formulationEvidence.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/markers.d.ts +57 -0
- package/types/lib/stages/postgen/introspection/markers.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/reflect.d.ts +77 -0
- package/types/lib/stages/postgen/introspection/reflect.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/report.d.ts +85 -0
- package/types/lib/stages/postgen/introspection/report.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/score.d.ts +149 -0
- package/types/lib/stages/postgen/introspection/score.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/shapeCommand.d.ts +79 -0
- package/types/lib/stages/postgen/introspection/shapeCommand.d.ts.map +1 -0
- package/types/lib/stages/postgen/parentEdge.d.ts +35 -0
- package/types/lib/stages/postgen/parentEdge.d.ts.map +1 -0
- package/types/lib/stages/postgen/postgen.d.ts +2 -2
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
- package/types/lib/stages/pregen/envAudit.d.ts.map +1 -1
- package/types/lib/stages/pregen/pregen.d.ts +131 -0
- package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
- package/types/lib/validator/bomValidator.d.ts.map +1 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command shaping for remediation actions.
|
|
3
|
+
*
|
|
4
|
+
* The remediation catalog authors commands with template variables where the
|
|
5
|
+
* right value depends on the scanned project: which maven or gradle
|
|
6
|
+
* executable the repo wraps, which Python manager owns its lock files, which
|
|
7
|
+
* client npm itself should use. This module substitutes those variables from
|
|
8
|
+
* a facts object the caller gathered earlier, and names on every shaped
|
|
9
|
+
* command the detection it relied on, so a reviewer can tell a correct
|
|
10
|
+
* detection from a lucky default.
|
|
11
|
+
*
|
|
12
|
+
* Every function here is pure: the facts object is the only input beyond the
|
|
13
|
+
* template string, nothing reads the filesystem, and the same facts always
|
|
14
|
+
* yield the same command. The filesystem reads live in the collector
|
|
15
|
+
* (`commandFacts.js`).
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Template variables this module substitutes, beside the `{{version}}` and
|
|
19
|
+
* `{{major}}` placeholders the version cascade fills.
|
|
20
|
+
*
|
|
21
|
+
* @type {Readonly<string[]>}
|
|
22
|
+
*/
|
|
23
|
+
export declare const SHAPE_VARIABLES: Readonly<string[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Python managers a command can name, with the lock command each catalog
|
|
26
|
+
* entry pairs the variable with.
|
|
27
|
+
*
|
|
28
|
+
* @type {Readonly<string[]>}
|
|
29
|
+
*/
|
|
30
|
+
export declare const PYTHON_MANAGERS: Readonly<string[]>;
|
|
31
|
+
export type CommandFacts = {
|
|
32
|
+
/**
|
|
33
|
+
* Directory the facts were gathered from.
|
|
34
|
+
*/
|
|
35
|
+
projectRoot?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Platform the command targets; defaults to posix.
|
|
38
|
+
*/
|
|
39
|
+
platform?: "posix" | "windows";
|
|
40
|
+
/**
|
|
41
|
+
* Wrapper presence facts, executable-bit included for the platform's script.
|
|
42
|
+
*/
|
|
43
|
+
wrappers?: {
|
|
44
|
+
mvnw?: boolean;
|
|
45
|
+
mvnwInexecutable?: boolean;
|
|
46
|
+
mvnwCmd?: boolean;
|
|
47
|
+
gradlew?: boolean;
|
|
48
|
+
gradlewInexecutable?: boolean;
|
|
49
|
+
gradlewBat?: boolean;
|
|
50
|
+
composerPhar?: boolean;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* The Python manager in play.
|
|
54
|
+
*/
|
|
55
|
+
pythonManager?: string | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Every manager detected, when two or more compete.
|
|
58
|
+
*/
|
|
59
|
+
pythonManagerCandidates?: string[];
|
|
60
|
+
/**
|
|
61
|
+
* The npm client the project names or locks.
|
|
62
|
+
*/
|
|
63
|
+
npmClient?: string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Shape one command string: substitute the template variables the catalog
|
|
67
|
+
* authors into it and report which detection drove the result. A command
|
|
68
|
+
* without any `{{` marker is returned byte-identical and unshaped.
|
|
69
|
+
*
|
|
70
|
+
* @param {string} templateCommand Catalog command template.
|
|
71
|
+
* @param {CommandFacts} [facts] Facts gathered for the scanned project.
|
|
72
|
+
* @returns {{command: string, shapedBy: string|undefined, shapedNote: string|undefined}} The shaped command, the detection behind it, and the question to surface when shaping could not answer.
|
|
73
|
+
*/
|
|
74
|
+
export declare function shapeCommand(templateCommand: string, facts?: CommandFacts): {
|
|
75
|
+
command: string;
|
|
76
|
+
shapedBy: string | undefined;
|
|
77
|
+
shapedNote: string | undefined;
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=shapeCommand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shapeCommand.d.ts","sourceRoot":"","sources":["../../../../../lib/stages/postgen/introspection/shapeCommand.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAFlB,QAAQ,CAAC,MAAM,EAAE,CAazB,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAFlB,QAAQ,CAAC,MAAM,EAAE,CAEoD,CAAC;AAO7E,YAAkB,YAAY,GAC9B;;;;IAAoB,WAAW,AAA/B,CACA,EADW,MAAM,CACjB;;;;IAA+B,QAAQ,AAAvC,CACA,EADW,OAAO,GAAC,SAAS,CAC5B;;;;IAAoB,QAAQ,AAA5B,CAQA,EAPA;QAA8B,IAAI,AAAlC,CACA,EADW,OAAO,CAClB;QAA8B,gBAAgB,AAA9C,CACA,EADW,OAAO,CAClB;QAA8B,OAAO,AAArC,CACA,EADW,OAAO,CAClB;QAA8B,OAAO,AAArC,CACA,EADW,OAAO,CAClB;QAA8B,mBAAmB,AAAjD,CACA,EADW,OAAO,CAClB;QAA8B,UAAU,AAAxC,CACA,EADW,OAAO,CAClB;QAA8B,YAAY,AAA1C,CACA,EADW,OAAO,CAClB;KAAA,CAAA;;;;IAA8B,aAAa,AAA3C,CACA,EADW,MAAM,GAAC,SAAS,CAC3B;;;;IAAsB,uBAAuB,AAA7C,CACA,EADW,MAAM,EAAE,CACnB;;;;IAAoB,SAAS,AAA7B,CACF,EADa,MAAM,CACnB;CAAA,CAAA;AA2MD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,eAAe,EAJjC,MAIiC,EAAE,KAAK,AAHhD,CACA,EADQ,YAG6C,GAF3C;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAC,SAAS,CAAC;IAAC,UAAU,EAAE,MAAM,GAAC,SAAS,CAAA;CAAC,CA8BvF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Root reachability repair for the `dependencies` graph.
|
|
3
|
+
*
|
|
4
|
+
* CycloneDX expects `metadata.component` to appear in `dependencies` with the
|
|
5
|
+
* first level of the tree in its `dependsOn`. That edge is emitted by each
|
|
6
|
+
* ecosystem leg from whatever manifest declares the direct dependencies, so a
|
|
7
|
+
* leg that resolves a project entirely from a lock file, an export command, or
|
|
8
|
+
* a pre-resolved graph can produce a complete transitive tree that no consumer
|
|
9
|
+
* can enter: every edge is present, but nothing is reachable from the root.
|
|
10
|
+
*
|
|
11
|
+
* This module repairs that shape at finalization time, independent of the
|
|
12
|
+
* ecosystem. When the parent has no outgoing edge and the tree does contain
|
|
13
|
+
* edges, the components that nothing else points to are the roots of the graph,
|
|
14
|
+
* and attaching them to the parent restores reachability for the whole tree.
|
|
15
|
+
*
|
|
16
|
+
* The repair is deliberately weaker than a leg that knows the manifest: a
|
|
17
|
+
* direct dependency that some transitive dependency also requires is not a
|
|
18
|
+
* root here and stays out of the parent's `dependsOn`. It is a safety net that
|
|
19
|
+
* keeps a tree traversable, not a replacement for emitting the edge at the
|
|
20
|
+
* source, and it records what it inferred so consumers can tell the two apart.
|
|
21
|
+
*/
|
|
22
|
+
/** Property recording how many root edges were inferred rather than observed. */
|
|
23
|
+
export declare const INFERRED_ROOTS_PROPERTY = "cdx:bom:inferredRootDependencies";
|
|
24
|
+
/**
|
|
25
|
+
* Adds the missing edge from the parent component to the roots of the
|
|
26
|
+
* dependency graph. A no-op unless the document has a parent component with no
|
|
27
|
+
* outgoing edge, a tree that already contains edges, and at least one component
|
|
28
|
+
* that nothing points to.
|
|
29
|
+
*
|
|
30
|
+
* @param {Object} bomJson CycloneDX BOM
|
|
31
|
+
*
|
|
32
|
+
* @returns {Object} The same BOM, repaired in place when applicable
|
|
33
|
+
*/
|
|
34
|
+
export declare function repairParentDependencyEdge(bomJson: Object): Object;
|
|
35
|
+
//# sourceMappingURL=parentEdge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parentEdge.d.ts","sourceRoot":"","sources":["../../../../lib/stages/postgen/parentEdge.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,iFAAiF;AACjF,eAAO,MAAM,uBAAuB,qCAAqC,CAAC;AAoC1E;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAJvC,MAIuC,GAFrC,MAAM,CAqFlB"}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* @param {Object} options CLI options
|
|
6
6
|
* @param {string} [filePath] Source path used for formulation and metadata context
|
|
7
7
|
*
|
|
8
|
-
* @returns {Object} Modified bomNSData
|
|
8
|
+
* @returns {Promise<Object>} Modified bomNSData
|
|
9
9
|
*/
|
|
10
|
-
export declare function postProcess(bomNSData: Object, options: Object, filePath?: string): Object
|
|
10
|
+
export declare function postProcess(bomNSData: Object, options: Object, filePath?: string): Promise<Object>;
|
|
11
11
|
/**
|
|
12
12
|
* Apply additional metadata based on components
|
|
13
13
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgen.d.ts","sourceRoot":"","sources":["../../../../lib/stages/postgen/postgen.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"postgen.d.ts","sourceRoot":"","sources":["../../../../lib/stages/postgen/postgen.js"],"names":[],"mappings":"AAgiBA;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAAC,SAAS,EANhC,MAMgC,EAAE,OAAO,EALzC,MAKyC,EAAE,QAAQ,AAJ3D,CAEA,EAFQ,MAImD,GAFjD,OAAO,CAAC,MAAM,CAAC,CA4D3B;AAgHD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAL1B,MAK0B,EAAE,OAAO,EAJnC,MAImC,GAFjC,MAAM,CA8HlB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAL3B,MAK2B,EAAE,OAAO,EAJpC,MAIoC,GAFlC,MAAM,CAqClB;AAkED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,OAAO,EALtB,MAKsB,EAAE,OAAO,EAJ/B,MAI+B,GAF7B,MAAM,CA0MlB;AAUD;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,KAAA,QAUlC;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,IAFhB,IAAI,CAYhB;AAMD;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EALrB,MAKqB,EAAE,OAAO,EAJ9B,MAI8B,GAF5B,MAAM,CA2HlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ruleEngine.d.ts","sourceRoot":"","sources":["../../../../lib/stages/postgen/ruleEngine.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ruleEngine.d.ts","sourceRoot":"","sources":["../../../../lib/stages/postgen/ruleEngine.js"],"names":[],"mappings":"AAogBA;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,QAAQ,EAH7B,MAG6B,GAF3B,OAAO,OAAO,CAuF1B;AAiCD;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAJ5B,MAI4B,EAAE,OAAO,EAHrC,MAGqC,EAAE,OAAO,KAAK,GAFjD,OAAO,OAAO,CAuF1B;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,KAAK,KAAA,EAAE,OAAO,KAAA,EAAE,OAAO,KAAK,kBAY/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envAudit.d.ts","sourceRoot":"","sources":["../../../../lib/stages/pregen/envAudit.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"envAudit.d.ts","sourceRoot":"","sources":["../../../../lib/stages/pregen/envAudit.js"],"names":[],"mappings":"AA2JA;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,AAJjC,CACA,EADQ,MAIuC,EAAE,OAAO,AAHxD,CACA,EADQ,MAGqD,GAFnD,MAAM,EAAE,CAsQpB"}
|
|
@@ -11,6 +11,137 @@ export declare function prepareEnv(filePath: string, options: Object): void;
|
|
|
11
11
|
* @param {String} projectType Project type
|
|
12
12
|
*/
|
|
13
13
|
export declare function prepareSdkmanBuild(projectType: string): boolean | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Method to detect and provision JVM build tools (maven, gradle, sbt, scala)
|
|
16
|
+
* plus a compatible JDK before BOM generation.
|
|
17
|
+
*
|
|
18
|
+
* Two styles are supported:
|
|
19
|
+
* - Explicit: a versioned project type such as `-t maven3.9.9` installs that
|
|
20
|
+
* exact sdkman version and pins it for the generation step.
|
|
21
|
+
* - Automatic: with the `jvm-tool-setup` feature flag, tool versions are
|
|
22
|
+
* derived from repo markers (`.sdkmanrc`, build tool wrappers,
|
|
23
|
+
* `project/build.properties`) and missing tools are provisioned. Projects
|
|
24
|
+
* pinning a tool through a wrapper are left alone because the wrapper
|
|
25
|
+
* provisions itself; only JDK compatibility is checked.
|
|
26
|
+
*
|
|
27
|
+
* @param {String} filePath Project path
|
|
28
|
+
* @param {Object} options CLI options
|
|
29
|
+
*
|
|
30
|
+
* @returns {String|undefined} The `javaNN` project type whose JDK this call
|
|
31
|
+
* already provisioned, so the caller can skip installing it again.
|
|
32
|
+
*/
|
|
33
|
+
export declare function prepareJvmBuildEnv(filePath: string, options: Object): string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Report the JVM toolchain that would be provisioned, without provisioning it.
|
|
36
|
+
*
|
|
37
|
+
* Dry-run exists so that the reader can see every side effect cdxgen would
|
|
38
|
+
* cause before allowing it to run for real, and provisioning a toolchain is
|
|
39
|
+
* the largest side effect this stage has: it downloads and installs software
|
|
40
|
+
* and then rewrites the command environment used for the rest of the run.
|
|
41
|
+
* Skipping the stage silently would hide exactly what dry-run is for, so each
|
|
42
|
+
* install, each JDK decision, and each environment variable that would change
|
|
43
|
+
* is recorded as a blocked activity instead.
|
|
44
|
+
*
|
|
45
|
+
* @param {Object} options CLI options
|
|
46
|
+
* @param {Array} installPins Tools that would be installed
|
|
47
|
+
* @param {Object} detected Repo detection result
|
|
48
|
+
*/
|
|
49
|
+
export declare function recordJvmBuildEnvIntent(options: Object, installPins: any[], detected: Object): void;
|
|
50
|
+
/**
|
|
51
|
+
* Detect the JVM build tools a project needs from its own version pins, in
|
|
52
|
+
* precedence order: MAVEN_TOOL style overrides, `.sdkmanrc`, container/CI
|
|
53
|
+
* version hints, then build tool wrappers and repo markers. Wrapper-pinned
|
|
54
|
+
* tools are returned as known versions without an install because the
|
|
55
|
+
* wrapper downloads its own distribution.
|
|
56
|
+
*
|
|
57
|
+
* @param {String} filePath Project path
|
|
58
|
+
* @param {Array} explicitPins Pins collected from versioned project types
|
|
59
|
+
*
|
|
60
|
+
* @returns {Object} `{ installPins, wrapperVersions, javaVersionHint }`
|
|
61
|
+
*/
|
|
62
|
+
export declare function detectJvmToolsFromRepo(filePath: string, explicitPins: any[]): Object;
|
|
63
|
+
/**
|
|
64
|
+
* Resolve a tool pin to an exact, locally known version. Exact versions that
|
|
65
|
+
* are already installed pass through untouched; otherwise the available
|
|
66
|
+
* sdkman versions are consulted to resolve partial prefixes such as `3.9`
|
|
67
|
+
* and to pick defaults.
|
|
68
|
+
*
|
|
69
|
+
* @param {Object} pin `{ tool, version?, source }`
|
|
70
|
+
*
|
|
71
|
+
* @returns {Object|undefined} Pin with an exact version, or undefined when no
|
|
72
|
+
* version could be determined.
|
|
73
|
+
*/
|
|
74
|
+
export declare function resolveJvmToolPinVersion(pin: Object): Object | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Fetch the versions available for a candidate via `sdk list`.
|
|
77
|
+
*
|
|
78
|
+
* @param {String} tool sdkman candidate name
|
|
79
|
+
*
|
|
80
|
+
* @returns {String|undefined} Command output, or undefined on failure.
|
|
81
|
+
*/
|
|
82
|
+
export declare function fetchSdkmanVersionList(tool: string): string | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Check whether a JVM build tool already has a usable command, honouring the
|
|
85
|
+
* existing `MVN_CMD`/`GRADLE_CMD`/`SBT_CMD` overrides.
|
|
86
|
+
*
|
|
87
|
+
* The probe deliberately runs outside the scanned project. Build tool
|
|
88
|
+
* launchers read JVM arguments from the working directory before doing
|
|
89
|
+
* anything else - Maven from `.mvn/jvm.config` and sbt from `.jvmopts` or
|
|
90
|
+
* `.sbtopts` - so a `--version` call inside a project would let that project
|
|
91
|
+
* inject options such as `-javaagent` into the probe. Only the presence of a
|
|
92
|
+
* working command is being established here, which the project cannot affect.
|
|
93
|
+
*
|
|
94
|
+
* @param {String} tool Tool name
|
|
95
|
+
*
|
|
96
|
+
* @returns {Boolean} True when the tool responds to `--version`.
|
|
97
|
+
*/
|
|
98
|
+
export declare function isJvmToolUsable(tool: string): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Ensure a JDK compatible with the pinned tools is active. Installs a JDK
|
|
101
|
+
* only when the current java is missing or older than required; an explicit
|
|
102
|
+
* `javaNN` project type is honoured as-is with a warning when it is too old.
|
|
103
|
+
*
|
|
104
|
+
* @param {String} filePath Project path
|
|
105
|
+
* @param {Object} options CLI options
|
|
106
|
+
* @param {Array} knownToolVersions Tool versions that will run
|
|
107
|
+
* @param {Number} javaVersionHint JDK major requested by the repo
|
|
108
|
+
*
|
|
109
|
+
* @returns {Number|undefined} Effective JDK major after the check.
|
|
110
|
+
*/
|
|
111
|
+
export declare function ensureCompatibleJdk(filePath: string, options: Object, knownToolVersions: any[], javaVersionHint: number): number | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* Pick the closest `javaNN` alias covering a required JDK major.
|
|
114
|
+
*
|
|
115
|
+
* @param {Number} major Required JDK major
|
|
116
|
+
*
|
|
117
|
+
* @returns {String|undefined} Alias such as `java17`.
|
|
118
|
+
*/
|
|
119
|
+
export declare function pickJavaAliasForMajor(major: number): string | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Warn when the Gradle version in play cannot run on the effective JDK.
|
|
122
|
+
*
|
|
123
|
+
* @param {Array} knownToolVersions Tool versions that will run
|
|
124
|
+
* @param {Number} javaMajor Effective JDK major
|
|
125
|
+
*/
|
|
126
|
+
export declare function warnGradleJavaIncompatibility(knownToolVersions: any[], javaMajor: number): void;
|
|
127
|
+
/**
|
|
128
|
+
* Install a pinned tool unless it is already available, applying the failure
|
|
129
|
+
* policy used by the ruby preparation: continue with whatever exists unless
|
|
130
|
+
* both `deep` and `failOnError` are set.
|
|
131
|
+
*
|
|
132
|
+
* @param {Object} pin `{ tool, version, source }`
|
|
133
|
+
* @param {Object} options CLI options
|
|
134
|
+
*
|
|
135
|
+
* @returns {Boolean} True when the exact version is active.
|
|
136
|
+
*/
|
|
137
|
+
export declare function provisionJvmTool(pin: Object, options: Object): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Point the tool command environment variables at the freshly provisioned
|
|
140
|
+
* binary so the existing resolvers pick it up deterministically.
|
|
141
|
+
*
|
|
142
|
+
* @param {Object} pin `{ tool, version }`
|
|
143
|
+
*/
|
|
144
|
+
export declare function setJvmToolCommandEnv(pin: Object): void;
|
|
14
145
|
/**
|
|
15
146
|
* Method to check and prepare the environment for python
|
|
16
147
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pregen.d.ts","sourceRoot":"","sources":["../../../../lib/stages/pregen/pregen.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pregen.d.ts","sourceRoot":"","sources":["../../../../lib/stages/pregen/pregen.js"],"names":[],"mappings":"AAqEA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,QAAA,EAAE,OAAO,EAFjC,MAEiC,QA6B3C;AAoED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,QAAA,uBAS7C;AAyCD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,QAAA,EAAE,OAAO,EALzC,MAKyC,GAHvC,SAAO,SAAS,CA8F5B;AAmBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAJpC,MAIoC,EAAE,WAAW,OAAA,EAAE,QAAQ,EAF3D,MAE2D,QA2ErE;AAgBD;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,QAAA,EAAE,YAAY,OAAA,GAFhD,MAAM,CA0HlB;AA+BD;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EALjC,MAKiC,GAH/B,MAAM,GAAC,SAAS,CAgE5B;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,QAAA,GAF9B,SAAO,SAAS,CAkB5B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,IAAI,QAAA,WAiFnC;AAwBD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,QAAA,EACR,OAAO,EARE,MAQF,EACP,iBAAiB,OAAA,EACjB,eAAe,QAAA,GANJ,SAAO,SAAS,CAoE5B;AA+BD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,QAAA,GAF9B,SAAO,SAAS,CAW5B;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,iBAAiB,OAAA,EAAE,SAAS,QAAA,QAwBzE;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EALzB,MAKyB,EAAE,OAAO,EAJlC,MAIkC,WA4C5C;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAF7B,MAE6B,QA2BvC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,QAAA,EAAE,OAAO,EAFxC,MAEwC,QAwDlD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,QAAA,EAAE,OAAO,EAFrC,MAEqC,QAuE/C;AA+BD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,QAAA,WAsBnD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,QAAQ,QAAA,EAAE,WAAW,QAAA,QAyDjD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,QAAA,EAAE,OAAO,EAFtC,MAEsC,QA8FhD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,QAAA,EAAE,OAAO,EAFrC,MAEqC,QAyU/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bomValidator.d.ts","sourceRoot":"","sources":["../../../lib/validator/bomValidator.js"],"names":[],"mappings":"AAqPA;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,YAJb,MAAM,KAEJ,OAAO,SAmCnB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,aAHd,MAAM,GAAC,MAAM,KACX,OAyLZ,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,YAFlB,MAAM,YAmEhB,CAAC;AA4CF;;;;GAIG;AACH,eAAO,MAAM,aAAa,YAFf,MAAM,
|
|
1
|
+
{"version":3,"file":"bomValidator.d.ts","sourceRoot":"","sources":["../../../lib/validator/bomValidator.js"],"names":[],"mappings":"AAqPA;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,YAJb,MAAM,KAEJ,OAAO,SAmCnB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,aAHd,MAAM,GAAC,MAAM,KACX,OAyLZ,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,YAFlB,MAAM,YAmEhB,CAAC;AA4CF;;;;GAIG;AACH,eAAO,MAAM,aAAa,YAFf,MAAM,YA+HhB,CAAC;AA2CF;;;;GAIG;AACH,eAAO,MAAM,YAAY,YAFd,MAAM,YAwFhB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAF1B,MAE0B,WAkIpC"}
|