@darkrymit/crunes-cli 0.8.3 → 0.8.5

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 (30) hide show
  1. package/dist/chunks/{apply-YC6JEPUN.js → apply-J4YICV6H.js} +6 -5
  2. package/dist/chunks/{benchmark-BJEAAFWG.js → benchmark-AKKV7G32.js} +4 -4
  3. package/dist/chunks/{chunk-DZJRYFOP.js → chunk-BTIPUR5S.js} +3 -3
  4. package/dist/chunks/{chunk-H3BVJCIL.js → chunk-GSA432UC.js} +12 -27
  5. package/dist/chunks/{chunk-65J65MAP.js → chunk-GTCPZ22N.js} +15 -1
  6. package/dist/chunks/{chunk-2PBPDTRD.js → chunk-KII6KW5Z.js} +1 -1
  7. package/dist/chunks/{chunk-NAEVMRNA.js → chunk-T53L5CJW.js} +90 -10
  8. package/dist/chunks/{chunk-JU6FKUBY.js → chunk-WJRZN7BR.js} +173 -91
  9. package/dist/chunks/{create-ZFFV3Z2P.js → create-L6DJN4ME.js} +2 -2
  10. package/dist/chunks/{create-OZACMPEU.js → create-VYZRWRGQ.js} +6 -2
  11. package/dist/chunks/disable-FGJ7VMPO.js +47 -0
  12. package/dist/chunks/{doctor-N43QEMAH.js → doctor-7NWBJAH7.js} +1 -1
  13. package/dist/chunks/{enable-327OMBPC.js → enable-ZL6QOC2I.js} +1 -1
  14. package/dist/chunks/{install-RRLUOYFO.js → install-FIYRMVLR.js} +2 -2
  15. package/dist/chunks/{intro-4CICBP2J.js → intro-36OLGNYN.js} +68 -40
  16. package/dist/chunks/{list-CK5X2YN3.js → list-2JYMBMZC.js} +2 -2
  17. package/dist/chunks/{list-FLAYJQKN.js → list-AIYNOPNZ.js} +1 -1
  18. package/dist/chunks/{list-WH7KESMV.js → list-NZ5DHXJF.js} +4 -4
  19. package/dist/chunks/{registry-3QIL5SVL.js → registry-RG34DPD7.js} +3 -1
  20. package/dist/chunks/{repl-VGC5FUJG.js → repl-BPEWARN7.js} +5 -5
  21. package/dist/chunks/{resolver-QMIY33FM.js → resolver-36V72VKR.js} +4 -2
  22. package/dist/chunks/{run-T33CMCFZ.js → run-IVL23SMW.js} +4 -4
  23. package/dist/chunks/{rune-UBRVWG5A.js → rune-XRREUL56.js} +63 -16
  24. package/dist/chunks/{uninstall-55YTHZRH.js → uninstall-G56DZRFG.js} +2 -2
  25. package/dist/chunks/{update-G6XO4RIM.js → update-KSC6VRMU.js} +2 -2
  26. package/dist/chunks/{utils-XOWJQWNR.js → utils-3SJFSUSV.js} +1 -1
  27. package/dist/chunks/{version-2W2M74UT.js → version-YG2M7HER.js} +3 -2
  28. package/dist/cli.js +22 -28
  29. package/package.json +3 -2
  30. package/dist/chunks/disable-TMG2K3BF.js +0 -47
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-CGZL5SSH.js";
7
7
  import {
8
8
  loadConfig
9
- } from "./chunk-H3BVJCIL.js";
9
+ } from "./chunk-GSA432UC.js";
10
10
  import {
11
11
  output
12
12
  } from "./chunk-6XLT25GS.js";
@@ -14,7 +14,7 @@ import "./chunk-WCODTMDN.js";
14
14
  import {
15
15
  loadRegistry,
16
16
  resolvePluginKey
17
- } from "./chunk-65J65MAP.js";
17
+ } from "./chunk-GTCPZ22N.js";
18
18
  import "./chunk-6MRZXASS.js";
19
19
  import {
20
20
  loadPluginJson
@@ -61,12 +61,13 @@ async function resolveTemplate(sourceName, templateName, projectRoot) {
61
61
  }
62
62
  const templateMeta = (pluginJson.templates ?? {})[templateName];
63
63
  if (templateMeta) {
64
- matches.push({ pluginName, pluginEntry, pluginJson, templateMeta });
64
+ matches.push({ pluginKey, pluginName, pluginEntry, pluginJson, templateMeta });
65
65
  }
66
66
  }
67
67
  if (matches.length > 1) {
68
- const sources = matches.map((m) => m.pluginName).join(", ");
69
- output.error(`"${templateName}" matches templates in multiple sources: ${sources}. Use source:${templateName}.`);
68
+ const sources = matches.map((m) => m.pluginKey).join(", ");
69
+ const options = matches.map((m) => `${m.pluginKey}:${templateName}`).join(" or ");
70
+ output.error(`"${templateName}" matches templates in multiple sources: ${sources}. Use ${options}.`);
70
71
  process.exit(1);
71
72
  }
72
73
  if (matches.length === 1) {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  parseBracketKey
3
- } from "./chunk-DZJRYFOP.js";
3
+ } from "./chunk-BTIPUR5S.js";
4
4
  import {
5
5
  loadConfig
6
- } from "./chunk-H3BVJCIL.js";
6
+ } from "./chunk-GSA432UC.js";
7
7
  import {
8
8
  runRune
9
- } from "./chunk-JU6FKUBY.js";
9
+ } from "./chunk-WJRZN7BR.js";
10
10
  import "./chunk-J3GZ3DXD.js";
11
11
  import "./chunk-ZJDKCC2Y.js";
12
12
  import "./chunk-NDEYEYSU.js";
@@ -19,7 +19,7 @@ import {
19
19
  import {
20
20
  source_default
21
21
  } from "./chunk-WCODTMDN.js";
22
- import "./chunk-65J65MAP.js";
22
+ import "./chunk-GTCPZ22N.js";
23
23
  import "./chunk-6MRZXASS.js";
24
24
  import "./chunk-G3U4V32O.js";
25
25
  import {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  loadConfig
3
- } from "./chunk-H3BVJCIL.js";
3
+ } from "./chunk-GSA432UC.js";
4
4
  import {
5
5
  isGlobMatch,
6
6
  isWildcardMatch,
7
7
  runRune
8
- } from "./chunk-JU6FKUBY.js";
8
+ } from "./chunk-WJRZN7BR.js";
9
9
  import {
10
10
  isVerbose,
11
11
  output
@@ -195,7 +195,7 @@ async function handler({
195
195
  process.exit(1);
196
196
  }
197
197
  if (isBatch) {
198
- const { resolvePluginRune } = await import("./resolver-QMIY33FM.js");
198
+ const { resolvePluginRune } = await import("./resolver-36V72VKR.js");
199
199
  const { loadPluginJson } = await import("./manifest-7RVNKBOH.js");
200
200
  for (const seg of segments) {
201
201
  let entry = config.runes?.[seg.key] ?? {};
@@ -12,7 +12,7 @@ function isObject(item) {
12
12
  function mergeConfigs(shared, local) {
13
13
  const merged = { ...shared };
14
14
  for (const [key, value] of Object.entries(local)) {
15
- if (key !== "runes" && key !== "vars" && key !== "permissions" && key !== "plugins") {
15
+ if (key !== "runes" && key !== "plugins") {
16
16
  merged[key] = value;
17
17
  }
18
18
  }
@@ -31,20 +31,6 @@ function mergeConfigs(shared, local) {
31
31
  }
32
32
  }
33
33
  }
34
- if (local.vars) {
35
- merged.vars = { ...shared.vars };
36
- for (const [key, localVarsObj] of Object.entries(local.vars)) {
37
- const sharedVarsObj = shared.vars?.[key];
38
- if (sharedVarsObj && isObject(sharedVarsObj) && isObject(localVarsObj)) {
39
- merged.vars[key] = { ...sharedVarsObj, ...localVarsObj };
40
- } else {
41
- merged.vars[key] = localVarsObj;
42
- }
43
- }
44
- }
45
- if (local.permissions) {
46
- merged.permissions = { ...shared.permissions, ...local.permissions };
47
- }
48
34
  if (local.plugins) {
49
35
  const combined = [...shared.plugins ?? [], ...local.plugins ?? []];
50
36
  merged.plugins = Array.from(new Set(combined));
@@ -52,18 +38,6 @@ function mergeConfigs(shared, local) {
52
38
  return merged;
53
39
  }
54
40
  function validateConfig(config, fileName = "config.json") {
55
- if (config.permissions && typeof config.permissions === "object") {
56
- for (const [runeKey, perms] of Object.entries(config.permissions)) {
57
- if (Array.isArray(perms)) {
58
- throw new Error(`${fileName}: permissions for "${runeKey}" must be lifecycle-scoped (e.g. permissions["${runeKey}"].run.allow)`);
59
- }
60
- if (perms && typeof perms === "object") {
61
- if (Array.isArray(perms.allow) || Array.isArray(perms.deny)) {
62
- throw new Error(`${fileName}: permissions for "${runeKey}" must be lifecycle-scoped (e.g. permissions["${runeKey}"].run.allow)`);
63
- }
64
- }
65
- }
66
- }
67
41
  if (config.runes && typeof config.runes === "object") {
68
42
  for (const [runeKey, entry] of Object.entries(config.runes)) {
69
43
  if (entry && typeof entry === "object" && entry.permissions) {
@@ -80,6 +54,17 @@ function validateConfig(config, fileName = "config.json") {
80
54
  }
81
55
  }
82
56
  }
57
+ if (entry && typeof entry === "object" && !entry.path && !entry.plugin) {
58
+ const colonIdx = runeKey.indexOf(":");
59
+ if (colonIdx !== -1) {
60
+ const pluginPart = runeKey.slice(0, colonIdx);
61
+ if (!pluginPart.includes("@")) {
62
+ throw new Error(
63
+ `${fileName}: runes["${runeKey}"] has no path or plugin, so it can only be a plugin-rune override \u2014 but "${pluginPart}" is missing the marketplace prefix. Use the full "marketplace@plugin:${runeKey.slice(colonIdx + 1)}" form.`
64
+ );
65
+ }
66
+ }
67
+ }
83
68
  }
84
69
  }
85
70
  }
@@ -49,11 +49,25 @@ function resolvePluginKey(nameOrKey, registry) {
49
49
  throw new Error(`Ambiguous plugin "${nameOrKey}". Use the full key: ${matches.join(", ")}`);
50
50
  return matches[0] ?? null;
51
51
  }
52
+ function resolvePluginKeyScoped(nameOrKey, registry, enabledPlugins) {
53
+ if (nameOrKey.includes("@")) return nameOrKey;
54
+ const allMatches = Object.keys(registry.plugins ?? {}).filter((k) => k.slice(k.indexOf("@") + 1) === nameOrKey);
55
+ const scopedMatches = allMatches.filter((k) => enabledPlugins.includes(k));
56
+ if (scopedMatches.length === 1) return scopedMatches[0];
57
+ if (scopedMatches.length > 1) {
58
+ throw new Error(`Ambiguous plugin "${nameOrKey}". Use the full key: ${scopedMatches.join(", ")}`);
59
+ }
60
+ if (allMatches.length === 0) return null;
61
+ throw new Error(
62
+ `Plugin "${nameOrKey}" is not enabled in this project (installed as ${allMatches.join(", ")}). Run: crunes plugin enable ${allMatches.length === 1 ? allMatches[0] : "<one of the above>"}`
63
+ );
64
+ }
52
65
 
53
66
  export {
54
67
  loadRegistry,
55
68
  saveRegistry,
56
69
  registerPlugin,
57
70
  removePlugin,
58
- resolvePluginKey
71
+ resolvePluginKey,
72
+ resolvePluginKeyScoped
59
73
  };
@@ -7,7 +7,7 @@ import {
7
7
  loadRegistry,
8
8
  registerPlugin,
9
9
  removePlugin
10
- } from "./chunk-65J65MAP.js";
10
+ } from "./chunk-GTCPZ22N.js";
11
11
  import {
12
12
  ensureStoreDirs,
13
13
  getPluginCacheDir,
@@ -7146,13 +7146,45 @@ var utils_api_default = {
7146
7146
  kind: "text",
7147
7147
  text: "Returns true if the environment variable exists and is permitted.\nRequires "
7148
7148
  },
7149
+ {
7150
+ kind: "code",
7151
+ text: "`env.read:<key>`"
7152
+ },
7153
+ {
7154
+ kind: "text",
7155
+ text: " (no source prefix \u2014 checks "
7156
+ },
7157
+ {
7158
+ kind: "code",
7159
+ text: "`process.env`"
7160
+ },
7161
+ {
7162
+ kind: "text",
7163
+ text: ", then "
7164
+ },
7165
+ {
7166
+ kind: "code",
7167
+ text: "`.env.local`"
7168
+ },
7169
+ {
7170
+ kind: "text",
7171
+ text: ", then "
7172
+ },
7173
+ {
7174
+ kind: "code",
7175
+ text: "`.env`"
7176
+ },
7177
+ {
7178
+ kind: "text",
7179
+ text: ", in that order, returning true on the first match) or the source-scoped "
7180
+ },
7149
7181
  {
7150
7182
  kind: "code",
7151
7183
  text: "`env.read:<source>::<key>`"
7152
7184
  },
7153
7185
  {
7154
7186
  kind: "text",
7155
- text: " permission (where source is "
7187
+ text: " (where source is "
7156
7188
  },
7157
7189
  {
7158
7190
  kind: "code",
@@ -7160,15 +7192,15 @@ var utils_api_default = {
7160
7192
  },
7161
7193
  {
7162
7194
  kind: "text",
7163
- text: " or a .env filename like "
7195
+ text: " or any .env filename, e.g. a custom "
7164
7196
  },
7165
7197
  {
7166
7198
  kind: "code",
7167
- text: "`.env`"
7199
+ text: "`.env.production`"
7168
7200
  },
7169
7201
  {
7170
7202
  kind: "text",
7171
- text: "). "
7203
+ text: ") permission. "
7172
7204
  },
7173
7205
  {
7174
7206
  kind: "code",
@@ -7178,6 +7210,14 @@ var utils_api_default = {
7178
7210
  kind: "text",
7179
7211
  text: " matches any characters in the key (e.g. "
7180
7212
  },
7213
+ {
7214
+ kind: "code",
7215
+ text: "`env.read:GITHUB_*`"
7216
+ },
7217
+ {
7218
+ kind: "text",
7219
+ text: " or "
7220
+ },
7181
7221
  {
7182
7222
  kind: "code",
7183
7223
  text: "`env.read:process::GITHUB_*`"
@@ -7247,13 +7287,45 @@ var utils_api_default = {
7247
7287
  kind: "text",
7248
7288
  text: "Returns the value of an environment variable, or fallback if absent.\nRequires "
7249
7289
  },
7290
+ {
7291
+ kind: "code",
7292
+ text: "`env.read:<key>`"
7293
+ },
7294
+ {
7295
+ kind: "text",
7296
+ text: " (no source prefix \u2014 checks "
7297
+ },
7298
+ {
7299
+ kind: "code",
7300
+ text: "`process.env`"
7301
+ },
7302
+ {
7303
+ kind: "text",
7304
+ text: ", then "
7305
+ },
7306
+ {
7307
+ kind: "code",
7308
+ text: "`.env.local`"
7309
+ },
7310
+ {
7311
+ kind: "text",
7312
+ text: ", then "
7313
+ },
7314
+ {
7315
+ kind: "code",
7316
+ text: "`.env`"
7317
+ },
7318
+ {
7319
+ kind: "text",
7320
+ text: ", in that order, returning the first match) or the source-scoped "
7321
+ },
7250
7322
  {
7251
7323
  kind: "code",
7252
7324
  text: "`env.read:<source>::<key>`"
7253
7325
  },
7254
7326
  {
7255
7327
  kind: "text",
7256
- text: " permission (where source is "
7328
+ text: " (where source is "
7257
7329
  },
7258
7330
  {
7259
7331
  kind: "code",
@@ -7261,15 +7333,15 @@ var utils_api_default = {
7261
7333
  },
7262
7334
  {
7263
7335
  kind: "text",
7264
- text: " or a .env filename like "
7336
+ text: " or any .env filename, e.g. a custom "
7265
7337
  },
7266
7338
  {
7267
7339
  kind: "code",
7268
- text: "`.env`"
7340
+ text: "`.env.production`"
7269
7341
  },
7270
7342
  {
7271
7343
  kind: "text",
7272
- text: "). "
7344
+ text: ") permission. "
7273
7345
  },
7274
7346
  {
7275
7347
  kind: "code",
@@ -7279,6 +7351,14 @@ var utils_api_default = {
7279
7351
  kind: "text",
7280
7352
  text: " matches any characters in the key (e.g. "
7281
7353
  },
7354
+ {
7355
+ kind: "code",
7356
+ text: "`env.read:GITHUB_*`"
7357
+ },
7358
+ {
7359
+ kind: "text",
7360
+ text: " or "
7361
+ },
7282
7362
  {
7283
7363
  kind: "code",
7284
7364
  text: "`env.read:process::GITHUB_*`"
@@ -16231,7 +16311,7 @@ var utils_api_default = {
16231
16311
  summary: [
16232
16312
  {
16233
16313
  kind: "text",
16234
- text: "Creates a markdown section containing the formatted CLI help text."
16314
+ text: "Creates a markdown section containing the formatted CLI help text. Always renders the full rune command tree (all subcommands, all options) \u2014 there is no way to scope this to just the matched subcommand."
16235
16315
  }
16236
16316
  ]
16237
16317
  },
@@ -16266,7 +16346,7 @@ var utils_api_default = {
16266
16346
  summary: [
16267
16347
  {
16268
16348
  kind: "text",
16269
- text: "Returns the formatted CLI help text for the current rune. Empty string if no args schema."
16349
+ text: "Returns the formatted CLI help text for the current rune. Empty string if no args schema. Always renders the full rune command tree (all subcommands, all options) \u2014 there is no way to scope this to just the matched subcommand."
16270
16350
  }
16271
16351
  ]
16272
16352
  },