@darkrymit/crunes-cli 0.8.5 → 0.9.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.
Files changed (72) hide show
  1. package/dist/chunks/{add-CBHWFGCA.js → add-IT3IHBPO.js} +2 -2
  2. package/dist/chunks/{apply-J4YICV6H.js → apply-YY7MIM64.js} +9 -9
  3. package/dist/chunks/{benchmark-AKKV7G32.js → benchmark-BQNMULOO.js} +17 -14
  4. package/dist/chunks/{browse-JZFU52ET.js → browse-PHMBDREQ.js} +2 -2
  5. package/dist/chunks/{chunk-6MRZXASS.js → chunk-2Q3KLBE6.js} +16 -0
  6. package/dist/chunks/{chunk-KII6KW5Z.js → chunk-34F4ZURL.js} +40 -37
  7. package/dist/chunks/{chunk-ZJDKCC2Y.js → chunk-4GJMCFR6.js} +6 -3
  8. package/dist/chunks/chunk-CY6C6ADU.js +2787 -0
  9. package/dist/chunks/{chunk-J3GZ3DXD.js → chunk-GVMT55GH.js} +3 -2
  10. package/dist/chunks/{chunk-JOAL437H.js → chunk-I6MHDUCW.js} +16 -1
  11. package/dist/chunks/{chunk-6XLT25GS.js → chunk-MIKWIFYR.js} +47 -0
  12. package/dist/chunks/chunk-MRNZFUXZ.js +70 -0
  13. package/dist/chunks/{chunk-T53L5CJW.js → chunk-PBGUKXT6.js} +2887 -1874
  14. package/dist/chunks/chunk-QYRF3R35.js +154 -0
  15. package/dist/chunks/{chunk-BTIPUR5S.js → chunk-SNC7AOT7.js} +78 -12
  16. package/dist/chunks/{chunk-63H5VXZY.js → chunk-UEUUOAJY.js} +4 -1
  17. package/dist/chunks/{chunk-GTCPZ22N.js → chunk-VST6HAB6.js} +1 -1
  18. package/dist/chunks/{chunk-NDEYEYSU.js → chunk-WJII3LZK.js} +4 -3
  19. package/dist/chunks/chunk-X7PZN73N.js +44 -0
  20. package/dist/chunks/{chunk-NYLRTAAA.js → chunk-YVN3VDRE.js} +1 -1
  21. package/dist/chunks/{chunk-WJRZN7BR.js → chunk-YXCHIMLW.js} +843 -3027
  22. package/dist/chunks/{clear-YBDIPEEH.js → clear-AT7HNUV4.js} +2 -2
  23. package/dist/chunks/{create-GPDE2YKL.js → create-ET6DT5ZE.js} +22 -18
  24. package/dist/chunks/{create-VYZRWRGQ.js → create-LM7U3CJS.js} +22 -18
  25. package/dist/chunks/{create-L6DJN4ME.js → create-TLPM7HJE.js} +3 -3
  26. package/dist/chunks/{delete-LNOYM5KG.js → delete-5R3WBLVD.js} +5 -5
  27. package/dist/chunks/{delete-E4TEBRPX.js → delete-GKYA2W5Z.js} +4 -2
  28. package/dist/chunks/{delete-C4UJ7X5K.js → delete-U4STA2QZ.js} +5 -5
  29. package/dist/chunks/disable-TNTEIAKO.js +39 -0
  30. package/dist/chunks/doctor-VXAQYMTR.js +101 -0
  31. package/dist/chunks/enable-GUQCB4CU.js +31 -0
  32. package/dist/chunks/{globals-H2WF344Y.js → globals-SNQFCHMP.js} +1 -1
  33. package/dist/chunks/{init-HU5OMHEH.js → init-PJSCFOC6.js} +14 -8
  34. package/dist/chunks/{install-FIYRMVLR.js → install-4YP7FALO.js} +18 -16
  35. package/dist/chunks/{intro-36OLGNYN.js → intro-SA7MWV3Z.js} +50 -8
  36. package/dist/chunks/{kill-2UG7PHUV.js → kill-TX3PC73P.js} +2 -1
  37. package/dist/chunks/list-7R6NASFI.js +92 -0
  38. package/dist/chunks/{list-4X3JFQGS.js → list-EHREZR6M.js} +2 -1
  39. package/dist/chunks/{list-U7PAYNAH.js → list-LC6HB3H3.js} +2 -2
  40. package/dist/chunks/{list-AIYNOPNZ.js → list-OMMZAQ23.js} +2 -2
  41. package/dist/chunks/{list-7VHJIUDX.js → list-U4EMHQZT.js} +2 -2
  42. package/dist/chunks/{list-PTAWQYWG.js → list-V7VVD5AG.js} +2 -1
  43. package/dist/chunks/{list-A5WVDBWF.js → list-VA73WPK6.js} +2 -2
  44. package/dist/chunks/{list-2JYMBMZC.js → list-WKNPZZOV.js} +5 -4
  45. package/dist/chunks/{output-RJ6JSNY7.js → output-QN5CVJ62.js} +4 -1
  46. package/dist/chunks/{query-AW7WYILM.js → query-2US3CPYT.js} +2 -2
  47. package/dist/chunks/{registry-RG34DPD7.js → registry-K5DV5NAK.js} +2 -2
  48. package/dist/chunks/{remove-QUH2D3S5.js → remove-BCFTF23J.js} +2 -2
  49. package/dist/chunks/{repl-STBZC4P2.js → repl-2YWTHUWT.js} +4 -0
  50. package/dist/chunks/{repl-BPEWARN7.js → repl-ZB3DIJ4K.js} +84 -26
  51. package/dist/chunks/resolver-QIYYFIDX.js +34 -0
  52. package/dist/chunks/run-22B65ZWZ.js +29 -0
  53. package/dist/chunks/rune-SYK4N642.js +425 -0
  54. package/dist/chunks/{search-MSSDGJTF.js → search-B7IM7JRJ.js} +2 -2
  55. package/dist/chunks/shell-explain-QLITLHW7.js +74 -0
  56. package/dist/chunks/{uninstall-G56DZRFG.js → uninstall-4WR5IHLC.js} +15 -11
  57. package/dist/chunks/{unset-YASSMSE5.js → unset-P6IUF7SS.js} +2 -2
  58. package/dist/chunks/{update-KSC6VRMU.js → update-ACLDK6E6.js} +19 -18
  59. package/dist/chunks/{update-EWWDROKW.js → update-WXT7CHYA.js} +2 -2
  60. package/dist/chunks/{utils-3SJFSUSV.js → utils-B2QULX5J.js} +8 -4
  61. package/dist/chunks/{version-YG2M7HER.js → version-EULYWNXN.js} +2 -2
  62. package/dist/cli.js +92 -64
  63. package/package.json +1 -1
  64. package/dist/chunks/chunk-ASZKAC24.js +0 -103
  65. package/dist/chunks/chunk-GSA432UC.js +0 -90
  66. package/dist/chunks/disable-FGJ7VMPO.js +0 -47
  67. package/dist/chunks/doctor-7NWBJAH7.js +0 -53
  68. package/dist/chunks/enable-ZL6QOC2I.js +0 -47
  69. package/dist/chunks/list-NZ5DHXJF.js +0 -111
  70. package/dist/chunks/resolver-36V72VKR.js +0 -28
  71. package/dist/chunks/run-IVL23SMW.js +0 -26
  72. package/dist/chunks/rune-XRREUL56.js +0 -186
@@ -2,9 +2,10 @@ import {
2
2
  storageKey
3
3
  } from "./chunk-G4ZAUHHA.js";
4
4
  import {
5
+ getLocalBase,
5
6
  getSqliteBasePath,
6
7
  getSqliteJsonPath
7
- } from "./chunk-6MRZXASS.js";
8
+ } from "./chunk-2Q3KLBE6.js";
8
9
  import {
9
10
  init_require_shim
10
11
  } from "./chunk-TPK5AGRA.js";
@@ -40,7 +41,7 @@ async function listSqliteDbs() {
40
41
  }
41
42
  async function listLocalSqliteDbs(projectDir) {
42
43
  const results = [];
43
- const localSqliteDir = path.join(projectDir, ".crunes", "sqlite");
44
+ const localSqliteDir = path.join(getLocalBase(projectDir), "sqlite");
44
45
  async function scanScope(scopeDir, scope, pluginId = null) {
45
46
  let entries;
46
47
  try {
@@ -6,6 +6,7 @@ import {
6
6
  init_require_shim();
7
7
  var KIND_MODULE = 2;
8
8
  var KIND_NAMESPACE = 4;
9
+ var KIND_VARIABLE = 32;
9
10
  var KIND_FUNCTION = 64;
10
11
  var KIND_CLASS = 128;
11
12
  var KIND_INTERFACE = 256;
@@ -146,6 +147,13 @@ function walkChildren(children) {
146
147
  returnsDescription: returnsComment(sig.comment) || void 0
147
148
  });
148
149
  }
150
+ } else if (child.kind === KIND_VARIABLE) {
151
+ members.push({
152
+ kind: "variable",
153
+ name: child.name,
154
+ type: typeStr(child.type),
155
+ description: commentText(child.comment) || void 0
156
+ });
149
157
  } else if (child.kind === KIND_CLASS) {
150
158
  members.push({ kind: "class", ...walkClassOrInterface(child) });
151
159
  } else if (child.kind === KIND_INTERFACE) {
@@ -218,6 +226,11 @@ function renderFunction(node, indent) {
218
226
  lines.push(...renderFunctionBody(node, indent));
219
227
  return lines.join("\n");
220
228
  }
229
+ function renderVariable(node, indent) {
230
+ const lines = [`${indent}${node.name}: ${node.type}`];
231
+ if (node.description) lines.push(`${indent} ${indentDesc(node.description, indent + " ")}`);
232
+ return lines.join("\n");
233
+ }
221
234
  function renderProperty(p, indent) {
222
235
  const ro = p.readonly ? "readonly " : "";
223
236
  const opt = p.optional ? "?" : "";
@@ -278,6 +291,8 @@ function formatNode(node, { prefix = "", indent = "" } = {}) {
278
291
  return renderNamespace(node, { prefix, indent });
279
292
  case "function":
280
293
  return renderFunction(node, indent);
294
+ case "variable":
295
+ return renderVariable(node, indent);
281
296
  case "class":
282
297
  case "interface":
283
298
  return renderClassOrInterface(node, indent);
@@ -287,7 +302,7 @@ function formatNode(node, { prefix = "", indent = "" } = {}) {
287
302
  }
288
303
  function formatMembers(members, { prefix = "", indent = "" } = {}) {
289
304
  const sorted = [...members ?? []].sort((a, b) => {
290
- const rank = (k) => k === "namespace" ? 0 : k === "function" ? 1 : 2;
305
+ const rank = (k) => k === "namespace" ? 0 : k === "variable" ? 1 : k === "function" ? 2 : 3;
291
306
  return rank(a.kind) - rank(b.kind);
292
307
  });
293
308
  return sorted.map((m) => formatNode(m, { prefix, indent })).filter(Boolean).join("\n\n");
@@ -1,3 +1,10 @@
1
+ import {
2
+ Ce,
3
+ R2 as R,
4
+ fe,
5
+ ge,
6
+ ye
7
+ } from "./chunk-CGZL5SSH.js";
1
8
  import {
2
9
  source_default
3
10
  } from "./chunk-WCODTMDN.js";
@@ -9,6 +16,9 @@ import {
9
16
  init_require_shim();
10
17
  var _plain = false;
11
18
  var isVerbose = false;
19
+ function isPlain() {
20
+ return _plain;
21
+ }
12
22
  function configure({ plain = false, verbose = false } = {}) {
13
23
  _plain = plain;
14
24
  isVerbose = verbose;
@@ -40,11 +50,48 @@ var output = {
40
50
  },
41
51
  info(msg) {
42
52
  console.log(`${sym.info()} ${msg}`);
53
+ },
54
+ // clack draws its frame with box characters and knows nothing about --plain, whose
55
+ // contract is "no box-drawing". Under --plain these degrade to ordinary lines.
56
+ intro(msg) {
57
+ if (_plain) console.log(`${sym.info()} ${msg}`);
58
+ else ye(msg);
59
+ },
60
+ outro(msg) {
61
+ if (_plain) console.log(`${sym.ok()} ${msg}`);
62
+ else fe(msg);
63
+ },
64
+ cancel(msg) {
65
+ if (_plain) console.error(`${sym.err()} ${msg}`);
66
+ else ge(msg);
67
+ },
68
+ note(body, title) {
69
+ if (_plain) {
70
+ console.log(`=== ${title} ===`);
71
+ console.log(body);
72
+ } else {
73
+ Ce(body, title);
74
+ }
75
+ },
76
+ log: {
77
+ success(msg) {
78
+ if (_plain) console.log(`${sym.ok()} ${msg}`);
79
+ else R.success(msg);
80
+ },
81
+ warn(msg) {
82
+ if (_plain) console.warn(`${sym.warn()} ${msg}`);
83
+ else R.warn(msg);
84
+ },
85
+ error(msg) {
86
+ if (_plain) console.error(`${sym.err()} ${msg}`);
87
+ else R.error(msg);
88
+ }
43
89
  }
44
90
  };
45
91
 
46
92
  export {
47
93
  isVerbose,
94
+ isPlain,
48
95
  configure,
49
96
  output
50
97
  };
@@ -0,0 +1,70 @@
1
+ import {
2
+ getRune
3
+ } from "./chunk-YXCHIMLW.js";
4
+ import {
5
+ enabledPluginKeys
6
+ } from "./chunk-QYRF3R35.js";
7
+ import {
8
+ init_require_shim
9
+ } from "./chunk-TPK5AGRA.js";
10
+
11
+ // src/rune/enumerate.js
12
+ init_require_shim();
13
+ async function enumerateRunes(config) {
14
+ const runes = config?.runes ?? {};
15
+ const entries = [];
16
+ const overrideKeys = [];
17
+ for (const key of Object.keys(runes)) {
18
+ if (/@[^:]+:/.test(key)) {
19
+ overrideKeys.push(key);
20
+ continue;
21
+ }
22
+ const entry = getRune(config, key);
23
+ const source = entry.plugin ? `\u2192 ${entry.plugin}` : entry.path ?? "";
24
+ entries.push({ key, source, name: entry.name ?? null, description: entry.description ?? null });
25
+ }
26
+ const enabledPlugins = enabledPluginKeys(config);
27
+ if (enabledPlugins.length > 0) {
28
+ try {
29
+ const { loadRegistry } = await import("./registry-K5DV5NAK.js");
30
+ const { loadPluginJson } = await import("./manifest-7RVNKBOH.js");
31
+ const registry = await loadRegistry();
32
+ for (const pluginKey of enabledPlugins) {
33
+ const entry = registry.plugins?.[pluginKey];
34
+ if (!entry) continue;
35
+ let pluginJson;
36
+ try {
37
+ pluginJson = await loadPluginJson(entry.path);
38
+ } catch {
39
+ continue;
40
+ }
41
+ for (const [runeKey, runeEntry] of Object.entries(pluginJson.runes ?? {})) {
42
+ const idx = pluginKey.indexOf("@");
43
+ const shortName = idx !== -1 ? pluginKey.slice(idx + 1) : pluginKey;
44
+ const displayKey = `${shortName}:${runeKey}`;
45
+ if (!entries.some((e) => e.key === displayKey)) {
46
+ entries.push({
47
+ key: displayKey,
48
+ source: `plugin: ${pluginKey}`,
49
+ name: runeEntry.name ?? null,
50
+ description: runeEntry.description ?? null
51
+ });
52
+ }
53
+ }
54
+ }
55
+ } catch {
56
+ }
57
+ }
58
+ for (const key of overrideKeys) {
59
+ const runeKey = key.slice(key.lastIndexOf(":") + 1);
60
+ const shortName = key.slice(key.indexOf("@") + 1, key.lastIndexOf(":"));
61
+ if (entries.some((e) => e.key === `${shortName}:${runeKey}`)) continue;
62
+ const entry = getRune(config, key);
63
+ entries.push({ key, source: entry.path ?? "", name: entry.name ?? null, description: entry.description ?? null });
64
+ }
65
+ return entries;
66
+ }
67
+
68
+ export {
69
+ enumerateRunes
70
+ };