@sberpay-cli/cli-diagnostic 0.0.0-stage → 0.4.0-dev.4

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.
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ // @sberpay-cli/cli-diagnostic: проверка версии Node, затем бандл. Собирает scripts/release/build.ts.
3
+ const MIN_MINOR = {"22":19,"24":5};
4
+ const [major = 0, minor = 0] = process.versions.node.split(".").map(Number);
5
+ const refuse = (code, message, hint) => {
6
+ if (process.argv.includes("--json")) process.stdout.write(`${JSON.stringify({ error: { code, message, hint } })}\n`);
7
+ else process.stderr.write(`✗ ${message}\n → ${hint}\n`);
8
+ process.exit(4);
9
+ };
10
+ if (!(major > 24 || (MIN_MINOR[major] !== undefined && minor >= MIN_MINOR[major]))) {
11
+ refuse("NODE_TOO_OLD", `Node ${process.versions.node} — нужен Node 22.19+ или 24.5+`, "Обновите Node до 22.19+ или 24.5+ (лучше 24 LTS) и повторите");
12
+ }
13
+ // Без проверки сертификатов Шлюз ЭК может подменить кто угодно в сети: вшитый корень Минцифры тогда ничего не даёт.
14
+ if (process.env.NODE_TLS_REJECT_UNAUTHORIZED === "0") {
15
+ refuse("INSECURE_TLS", "NODE_TLS_REJECT_UNAUTHORIZED=0 выключает проверку сертификатов", "Уберите NODE_TLS_REJECT_UNAUTHORIZED из окружения");
16
+ }
17
+ await import("../dist/npm-entry.mjs");
@@ -0,0 +1,9 @@
1
+ {
2
+ "profile": "diagnostic",
3
+ "version": "0.4.0-dev.4",
4
+ "sourceCommit": "69476eab9e2bcd3f503aa72e038d52d8cafc2752",
5
+ "sourceTreeDigest": "e261ad6dd23878e6ef9be3a0a570de371af3731b70058b6f413998f6c76c925b",
6
+ "snapshot": false,
7
+ "buildId": "6d8b6eea2ebe1f18ae50f84e91691805b835ed957455ed0334bc9158d7c229cf",
8
+ "stateFormat": 2
9
+ }