@darkrymit/crunes-cli 0.13.0 → 0.14.1

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 (26) hide show
  1. package/dist/chunks/{benchmark-2TVN6HDF.js → benchmark-Y2FTRSOP.js} +3 -3
  2. package/dist/chunks/{chunk-THGPCLJD.js → chunk-2N6X32LY.js} +5 -3
  3. package/dist/chunks/{chunk-CBWT3DFR.js → chunk-5L2GJWCD.js} +4 -0
  4. package/dist/chunks/{chunk-3VFNNPQI.js → chunk-JDPQACG7.js} +3 -3
  5. package/dist/chunks/{chunk-ATI5HNNC.js → chunk-NCSTZMBQ.js} +2 -2
  6. package/dist/chunks/{chunk-KP4EW2DS.js → chunk-SPXPSPM7.js} +221 -57
  7. package/dist/chunks/{chunk-QAP63JIK.js → chunk-W2A4ECOP.js} +5 -5
  8. package/dist/chunks/chunk-XPEVUBUK.js +40 -0
  9. package/dist/chunks/{chunk-TXCUSUZ6.js → chunk-ZO2JKBJX.js} +2552 -2372
  10. package/dist/chunks/{doctor-SXKAEYUF.js → doctor-Q6FZHDMH.js} +1 -1
  11. package/dist/chunks/{install-FSJAC3CL.js → install-2K5BNXDO.js} +1 -1
  12. package/dist/chunks/{intro-PN7LT6ZG.js → intro-PTGUS5FN.js} +1 -1
  13. package/dist/chunks/{kill-Z7ZDY5MB.js → kill-IX7HNMVP.js} +12 -4
  14. package/dist/chunks/{list-45SHVKXO.js → list-BJTV6SPK.js} +1 -1
  15. package/dist/chunks/{repl-PSADU3MJ.js → repl-QNXLTQYU.js} +4 -4
  16. package/dist/chunks/{resolver-YEUZSOS4.js → resolver-4IZNQ3QJ.js} +2 -2
  17. package/dist/chunks/{run-CYGL3HTA.js → run-BFGVSKV7.js} +3 -3
  18. package/dist/chunks/{rune-OQX5EYSQ.js → rune-RNJCIH4L.js} +5 -4
  19. package/dist/chunks/{runner-VUSHR2OR.js → runner-RYJO4AN3.js} +3 -2
  20. package/dist/chunks/{uninstall-MSCIWDWV.js → uninstall-X75QTERD.js} +1 -1
  21. package/dist/chunks/{update-IHCYA3JW.js → update-HHIDPHGX.js} +1 -1
  22. package/dist/chunks/{utils-DJ3BXOQC.js → utils-N6QJKOAO.js} +1 -1
  23. package/dist/chunks/{version-SBE7LQ5C.js → version-CYVVKOVG.js} +1 -1
  24. package/dist/cli.js +14 -14
  25. package/dist/test/index.js +227 -44
  26. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runRunBlock
3
- } from "./chunk-ATI5HNNC.js";
3
+ } from "./chunk-NCSTZMBQ.js";
4
4
  import {
5
5
  isNativeRune,
6
6
  trustDigest,
@@ -127,7 +127,7 @@ async function runPluginMatch({ match, pluginJson, projectPerms, projectVars, ke
127
127
  });
128
128
  return result2?.directExitCode !== void 0 ? result2 : normaliseResult(result2);
129
129
  }
130
- const { executePluginRune } = await import("./runner-VUSHR2OR.js");
130
+ const { executePluginRune } = await import("./runner-RYJO4AN3.js");
131
131
  const result = await executePluginRune({
132
132
  pluginDir,
133
133
  pluginCacheDir,
@@ -225,7 +225,7 @@ async function resolveRuneEntry(projectDir, config, key, configDir = projectDir)
225
225
  const vars = { ...pluginJson.runes[runeKey]?.vars ?? {}, ...config.runes?.[`${pluginKey}:${runeKey}`]?.vars ?? {} };
226
226
  return {
227
227
  async createReplSession(args, opts = {}) {
228
- const { getPluginRunePath, runRuneInRepl } = await import("./runner-VUSHR2OR.js");
228
+ const { getPluginRunePath, runRuneInRepl } = await import("./runner-RYJO4AN3.js");
229
229
  const runeFile = getPluginRunePath(pluginDir, runeKey, pluginJson, "repl");
230
230
  const nodeModulesDir = join(pluginCacheDir, "node_modules");
231
231
  return runRuneInRepl(runeFile, effective, args, projectDir, {
@@ -251,7 +251,7 @@ async function resolveRuneEntry(projectDir, config, key, configDir = projectDir)
251
251
  const vars = entry.vars ?? {};
252
252
  return {
253
253
  async createReplSession(args, opts = {}) {
254
- const { runRuneInRepl } = await import("./runner-VUSHR2OR.js");
254
+ const { runRuneInRepl } = await import("./runner-RYJO4AN3.js");
255
255
  return runRuneInRepl(runeFile, effective, args, projectDir, {
256
256
  vars,
257
257
  runeKey: key,
@@ -275,7 +275,7 @@ async function resolveRuneEntry(projectDir, config, key, configDir = projectDir)
275
275
  const vars = { ...pluginJson.runes[runeKey]?.vars ?? {}, ...config.runes?.[`${pluginKey}:${runeKey}`]?.vars ?? {} };
276
276
  return {
277
277
  async createReplSession(args, opts = {}) {
278
- const { getPluginRunePath, runRuneInRepl } = await import("./runner-VUSHR2OR.js");
278
+ const { getPluginRunePath, runRuneInRepl } = await import("./runner-RYJO4AN3.js");
279
279
  const runeFile = getPluginRunePath(pluginDir, runeKey, pluginJson, "repl");
280
280
  const nodeModulesDir = join(pluginCacheDir, "node_modules");
281
281
  return runRuneInRepl(runeFile, effective, args, projectDir, {
@@ -0,0 +1,40 @@
1
+ import {
2
+ isAlive,
3
+ jobPgidPath
4
+ } from "./chunk-5L2GJWCD.js";
5
+ import {
6
+ resolveShell
7
+ } from "./chunk-ZT4QFTQM.js";
8
+ import {
9
+ init_require_shim
10
+ } from "./chunk-FATG2PA7.js";
11
+
12
+ // src/job/kill-tree.js
13
+ init_require_shim();
14
+ import { spawn } from "node:child_process";
15
+ import { readFile } from "node:fs/promises";
16
+ function run(command, args) {
17
+ return new Promise((resolve) => {
18
+ const child = spawn(command, args, { stdio: "ignore", windowsHide: true });
19
+ child.on("error", resolve);
20
+ child.on("close", resolve);
21
+ });
22
+ }
23
+ async function readGroup(projectDir, id) {
24
+ const raw = (await readFile(jobPgidPath(projectDir, id), "utf8").catch(() => "")).trim();
25
+ return /^\d+$/.test(raw) && Number(raw) > 1 ? raw : null;
26
+ }
27
+ async function killWindowsShellJob(projectDir, record) {
28
+ const group = isAlive(record.pid) ? await readGroup(projectDir, record.id) : null;
29
+ if (group) {
30
+ try {
31
+ await run(resolveShell("bash").path, ["-c", `kill -9 -- -${group}`]);
32
+ } catch {
33
+ }
34
+ }
35
+ await run("taskkill", ["/F", "/T", "/PID", String(record.pid)]);
36
+ }
37
+
38
+ export {
39
+ killWindowsShellJob
40
+ };