kantban-cli 0.1.34 → 0.1.36
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/chunk-4VT3TGJ5.js +68 -0
- package/dist/chunk-4VT3TGJ5.js.map +1 -0
- package/dist/{chunk-ZTQJMXJM.js → chunk-DAFLEMLK.js} +1 -1
- package/dist/chunk-DAFLEMLK.js.map +1 -0
- package/dist/{chunk-2P25AHSD.js → chunk-GCDCGOWL.js} +12 -7
- package/dist/chunk-GCDCGOWL.js.map +1 -0
- package/dist/{chunk-7HJZFR7Y.js → chunk-YFBFQAFI.js} +17 -13
- package/dist/chunk-YFBFQAFI.js.map +1 -0
- package/dist/{cron-RG4VCGME.js → cron-HKGLRBVM.js} +4 -3
- package/dist/{cron-RG4VCGME.js.map → cron-HKGLRBVM.js.map} +1 -1
- package/dist/index.js +4 -4
- package/dist/lib/gate-proxy-server.js +3 -2
- package/dist/lib/gate-proxy-server.js.map +1 -1
- package/dist/{pipeline-L4HFDBM4.js → pipeline-N7Z43P6P.js} +78 -55
- package/dist/pipeline-N7Z43P6P.js.map +1 -0
- package/dist/{work-2V33NZAT.js → work-RECDDPXT.js} +7 -2
- package/dist/work-RECDDPXT.js.map +1 -0
- package/package.json +4 -3
- package/dist/chunk-2P25AHSD.js.map +0 -1
- package/dist/chunk-7HJZFR7Y.js.map +0 -1
- package/dist/chunk-ZTQJMXJM.js.map +0 -1
- package/dist/pipeline-L4HFDBM4.js.map +0 -1
- package/dist/work-2V33NZAT.js.map +0 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// src/lib/platform.ts
|
|
2
|
+
import { platform } from "os";
|
|
3
|
+
import { execFileSync } from "child_process";
|
|
4
|
+
var IS_WINDOWS = platform() === "win32";
|
|
5
|
+
function normalizeEol(text) {
|
|
6
|
+
return text.replace(/\r\n|\r/g, "\n");
|
|
7
|
+
}
|
|
8
|
+
function shellArgs() {
|
|
9
|
+
if (IS_WINDOWS) {
|
|
10
|
+
const comspec = process.env.COMSPEC || "cmd.exe";
|
|
11
|
+
if (/pwsh|powershell/i.test(comspec)) {
|
|
12
|
+
return [comspec, ["-NoProfile", "-Command"]];
|
|
13
|
+
}
|
|
14
|
+
return [comspec, ["/c"]];
|
|
15
|
+
}
|
|
16
|
+
return ["/bin/sh", ["-c"]];
|
|
17
|
+
}
|
|
18
|
+
function crossSpawnOptions(opts) {
|
|
19
|
+
return { ...opts ?? {}, shell: IS_WINDOWS };
|
|
20
|
+
}
|
|
21
|
+
function killProcessTree(pid, signal = "SIGTERM") {
|
|
22
|
+
if (IS_WINDOWS) {
|
|
23
|
+
try {
|
|
24
|
+
execFileSync("taskkill", ["/pid", String(pid), "/t", "/f"], { stdio: "pipe" });
|
|
25
|
+
return;
|
|
26
|
+
} catch {
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
process.kill(pid);
|
|
30
|
+
} catch {
|
|
31
|
+
}
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
process.kill(-pid, signal);
|
|
36
|
+
return;
|
|
37
|
+
} catch {
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
process.kill(pid, signal);
|
|
41
|
+
} catch {
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function npxCommand() {
|
|
45
|
+
return IS_WINDOWS ? "npx.cmd" : "npx";
|
|
46
|
+
}
|
|
47
|
+
function defaultPath() {
|
|
48
|
+
if (IS_WINDOWS) {
|
|
49
|
+
return [
|
|
50
|
+
process.env.SystemRoot ? `${process.env.SystemRoot}\\System32` : "C:\\Windows\\System32",
|
|
51
|
+
process.env.SystemRoot || "C:\\Windows",
|
|
52
|
+
"C:\\Program Files\\nodejs",
|
|
53
|
+
process.env.APPDATA ? `${process.env.APPDATA}\\npm` : ""
|
|
54
|
+
].filter(Boolean).join(";");
|
|
55
|
+
}
|
|
56
|
+
return "/usr/local/bin:/usr/bin:/bin";
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
IS_WINDOWS,
|
|
61
|
+
normalizeEol,
|
|
62
|
+
shellArgs,
|
|
63
|
+
crossSpawnOptions,
|
|
64
|
+
killProcessTree,
|
|
65
|
+
npxCommand,
|
|
66
|
+
defaultPath
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=chunk-4VT3TGJ5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/platform.ts"],"sourcesContent":["import { platform } from 'node:os';\nimport { execFileSync } from 'node:child_process';\n\nexport const IS_WINDOWS = platform() === 'win32';\n\n/** Normalize line endings to Unix-style (\\n). Strips \\r\\n and bare \\r. */\nexport function normalizeEol(text: string): string {\n return text.replace(/\\r\\n|\\r/g, '\\n');\n}\n\n/** Returns [shellExecutable, argsPrefix] for running shell commands.\n * Unix: ['/bin/sh', ['-c']] Windows: [cmd.exe /c] or [pwsh -NoProfile -Command] */\nexport function shellArgs(): [string, string[]] {\n if (IS_WINDOWS) {\n const comspec = process.env.COMSPEC || 'cmd.exe';\n // Detect PowerShell — uses -Command instead of /c\n if (/pwsh|powershell/i.test(comspec)) {\n return [comspec, ['-NoProfile', '-Command']];\n }\n return [comspec, ['/c']];\n }\n return ['/bin/sh', ['-c']];\n}\n\n/** Returns spawn options with shell:true on Windows for .cmd/.bat resolution. */\nexport function crossSpawnOptions<T extends Record<string, unknown>>(opts?: T): T & { shell: boolean } {\n return { ...(opts ?? {} as T), shell: IS_WINDOWS } as T & { shell: boolean };\n}\n\n/** Kill a process and its children. On Unix, tries process group first.\n * On Windows, uses `taskkill /T` for tree kill. Never throws. */\nexport function killProcessTree(pid: number, signal: NodeJS.Signals = 'SIGTERM'): void {\n if (IS_WINDOWS) {\n // taskkill /T kills the process tree; /F forces termination\n try { execFileSync('taskkill', ['/pid', String(pid), '/t', '/f'], { stdio: 'pipe' }); return; } catch { /* fall through */ }\n try { process.kill(pid); } catch { /* already dead */ }\n return;\n }\n // Unix: try process group kill first\n try { process.kill(-pid, signal); return; } catch { /* fall through */ }\n try { process.kill(pid, signal); } catch { /* already dead */ }\n}\n\n/** Returns platform-appropriate npx command ('npx' on Unix, 'npx.cmd' on Windows). */\nexport function npxCommand(): string {\n return IS_WINDOWS ? 'npx.cmd' : 'npx';\n}\n\n/** Returns platform-appropriate default PATH when process.env.PATH is undefined. */\nexport function defaultPath(): string {\n if (IS_WINDOWS) {\n return [\n process.env.SystemRoot ? `${process.env.SystemRoot}\\\\System32` : 'C:\\\\Windows\\\\System32',\n process.env.SystemRoot || 'C:\\\\Windows',\n 'C:\\\\Program Files\\\\nodejs',\n process.env.APPDATA ? `${process.env.APPDATA}\\\\npm` : '',\n ].filter(Boolean).join(';');\n }\n return '/usr/local/bin:/usr/bin:/bin';\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAEtB,IAAM,aAAa,SAAS,MAAM;AAGlC,SAAS,aAAa,MAAsB;AACjD,SAAO,KAAK,QAAQ,YAAY,IAAI;AACtC;AAIO,SAAS,YAAgC;AAC9C,MAAI,YAAY;AACd,UAAM,UAAU,QAAQ,IAAI,WAAW;AAEvC,QAAI,mBAAmB,KAAK,OAAO,GAAG;AACpC,aAAO,CAAC,SAAS,CAAC,cAAc,UAAU,CAAC;AAAA,IAC7C;AACA,WAAO,CAAC,SAAS,CAAC,IAAI,CAAC;AAAA,EACzB;AACA,SAAO,CAAC,WAAW,CAAC,IAAI,CAAC;AAC3B;AAGO,SAAS,kBAAqD,MAAkC;AACrG,SAAO,EAAE,GAAI,QAAQ,CAAC,GAAS,OAAO,WAAW;AACnD;AAIO,SAAS,gBAAgB,KAAa,SAAyB,WAAiB;AACrF,MAAI,YAAY;AAEd,QAAI;AAAE,mBAAa,YAAY,CAAC,QAAQ,OAAO,GAAG,GAAG,MAAM,IAAI,GAAG,EAAE,OAAO,OAAO,CAAC;AAAG;AAAA,IAAQ,QAAQ;AAAA,IAAqB;AAC3H,QAAI;AAAE,c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