@kici-dev/shared 0.1.7 → 0.1.9
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/dist/tool-check.d.ts +6 -0
- package/dist/tool-check.js +9 -1
- package/package.json +1 -1
- package/sbom.spdx.json +5 -5
package/dist/tool-check.d.ts
CHANGED
|
@@ -9,12 +9,18 @@
|
|
|
9
9
|
* A single tool requirement declaration.
|
|
10
10
|
*
|
|
11
11
|
* - `path-binary`: a binary that must be found on PATH (e.g., 'git', 'ip', 'bash')
|
|
12
|
+
* - `any-path-binary`: at least one of `names` must be found on PATH (e.g.,
|
|
13
|
+
* 'docker' OR 'podman' for the container scaler runtime)
|
|
12
14
|
* - `file-access`: an absolute path that must exist with the specified access mode
|
|
13
15
|
*/
|
|
14
16
|
export type ToolRequirement = {
|
|
15
17
|
type: 'path-binary';
|
|
16
18
|
name: string;
|
|
17
19
|
reason: string;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'any-path-binary';
|
|
22
|
+
names: string[];
|
|
23
|
+
reason: string;
|
|
18
24
|
} | {
|
|
19
25
|
type: 'file-access';
|
|
20
26
|
path: string;
|
package/dist/tool-check.js
CHANGED
|
@@ -21,11 +21,19 @@ function validateRequiredTools(requirements) {
|
|
|
21
21
|
const seen = /* @__PURE__ */ new Set();
|
|
22
22
|
const errors = [];
|
|
23
23
|
for (const req of requirements) {
|
|
24
|
-
|
|
24
|
+
let key;
|
|
25
|
+
if (req.type === "path-binary") key = `path:${req.name}`;
|
|
26
|
+
else if (req.type === "any-path-binary") key = `any:${req.names.join(",")}`;
|
|
27
|
+
else key = `file:${req.path}`;
|
|
25
28
|
if (seen.has(key)) continue;
|
|
26
29
|
seen.add(key);
|
|
27
30
|
if (req.type === "path-binary") {
|
|
28
31
|
if (!isBinaryOnPath(req.name)) errors.push(`'${req.name}' not found on PATH — ${req.reason}`);
|
|
32
|
+
} else if (req.type === "any-path-binary") {
|
|
33
|
+
if (!req.names.some((name) => isBinaryOnPath(name))) {
|
|
34
|
+
const list = req.names.map((n) => `'${n}'`).join(" or ");
|
|
35
|
+
errors.push(`none of ${list} found on PATH — ${req.reason}`);
|
|
36
|
+
}
|
|
29
37
|
} else {
|
|
30
38
|
const mode = req.mode === "executable" ? constants.X_OK : constants.R_OK;
|
|
31
39
|
try {
|
package/package.json
CHANGED
package/sbom.spdx.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"spdxVersion": "SPDX-2.3",
|
|
3
3
|
"dataLicense": "CC0-1.0",
|
|
4
4
|
"SPDXID": "SPDXRef-DOCUMENT",
|
|
5
|
-
"name": "@kici-dev/shared@0.1.
|
|
6
|
-
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fshared/0.1.
|
|
5
|
+
"name": "@kici-dev/shared@0.1.9",
|
|
6
|
+
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fshared/0.1.9/2a0fe48d-9ace-447e-bf38-52dc8ec9bacf",
|
|
7
7
|
"creationInfo": {
|
|
8
|
-
"created": "2026-05-
|
|
8
|
+
"created": "2026-05-26T16:48:53Z",
|
|
9
9
|
"creators": [
|
|
10
10
|
"Tool: kici-sbom-generator"
|
|
11
11
|
]
|
|
@@ -947,7 +947,7 @@
|
|
|
947
947
|
{
|
|
948
948
|
"SPDXID": "SPDXRef-RootPackage",
|
|
949
949
|
"name": "@kici-dev/shared",
|
|
950
|
-
"versionInfo": "0.1.
|
|
950
|
+
"versionInfo": "0.1.9",
|
|
951
951
|
"downloadLocation": "NOASSERTION",
|
|
952
952
|
"filesAnalyzed": false,
|
|
953
953
|
"licenseConcluded": "NOASSERTION",
|
|
@@ -958,7 +958,7 @@
|
|
|
958
958
|
{
|
|
959
959
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
960
960
|
"referenceType": "purl",
|
|
961
|
-
"referenceLocator": "pkg:npm/%40kici-dev/shared@0.1.
|
|
961
|
+
"referenceLocator": "pkg:npm/%40kici-dev/shared@0.1.9"
|
|
962
962
|
}
|
|
963
963
|
],
|
|
964
964
|
"description": "Shared utilities for the KiCI CI/CD stack — logging, zx setup, crypto, telemetry, health and metrics routes. No business logic.",
|