@agent-nexus/csreg 0.1.10 → 0.1.12
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/index.js +49 -25
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23,6 +23,9 @@ import {
|
|
|
23
23
|
|
|
24
24
|
// src/index.ts
|
|
25
25
|
import { Command as Command11 } from "commander";
|
|
26
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
27
|
+
import { fileURLToPath } from "url";
|
|
28
|
+
import { dirname as dirname2, join as join4 } from "path";
|
|
26
29
|
|
|
27
30
|
// src/commands/login.ts
|
|
28
31
|
import { Command } from "commander";
|
|
@@ -228,43 +231,62 @@ var releaseCommand = new Command6("release").description("Bump the version in SK
|
|
|
228
231
|
try {
|
|
229
232
|
const resolved = resolve3(dir);
|
|
230
233
|
const manifest = parseManifest(resolved);
|
|
234
|
+
let newVersion;
|
|
231
235
|
if (!manifest.version) {
|
|
232
|
-
|
|
233
|
-
'Add a version field: version: "1.0.0"'
|
|
234
|
-
]);
|
|
235
|
-
}
|
|
236
|
-
const currentVersion = manifest.version;
|
|
237
|
-
const nextPatch = bumpPatch(currentVersion);
|
|
238
|
-
info(`Current version: ${currentVersion}`);
|
|
239
|
-
const chosen = await select({
|
|
240
|
-
message: "Version to release:",
|
|
241
|
-
choices: [
|
|
242
|
-
{ name: `${nextPatch} (patch bump)`, value: nextPatch },
|
|
243
|
-
{ name: `${currentVersion} (current)`, value: currentVersion },
|
|
244
|
-
{ name: "Enter manually", value: "__manual__" }
|
|
245
|
-
]
|
|
246
|
-
});
|
|
247
|
-
let newVersion = chosen;
|
|
248
|
-
if (chosen === "__manual__") {
|
|
236
|
+
info("No version found in SKILL.md frontmatter.");
|
|
249
237
|
newVersion = await input3({
|
|
250
|
-
message: "
|
|
238
|
+
message: "Initial version:",
|
|
239
|
+
default: "1.0.0",
|
|
251
240
|
validate: (value) => {
|
|
252
241
|
const semver = /^\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?(\+[a-zA-Z0-9.]+)?$/;
|
|
253
|
-
if (!semver.test(value.trim())) return "Must be valid semver (e.g., 1.
|
|
242
|
+
if (!semver.test(value.trim())) return "Must be valid semver (e.g., 1.0.0).";
|
|
254
243
|
return true;
|
|
255
244
|
}
|
|
256
245
|
});
|
|
257
246
|
newVersion = newVersion.trim();
|
|
258
|
-
}
|
|
259
|
-
if (newVersion !== currentVersion) {
|
|
260
247
|
const skillPath = join2(resolved, "SKILL.md");
|
|
261
248
|
const raw = readFileSync(skillPath, "utf-8");
|
|
262
249
|
const updated = raw.replace(
|
|
263
|
-
/^(
|
|
264
|
-
`$
|
|
250
|
+
/^(---\s*\n[\s\S]*?\n)(---\s*\n?)/,
|
|
251
|
+
`$1version: "${newVersion}"
|
|
252
|
+
$2`
|
|
265
253
|
);
|
|
266
254
|
writeFileSync2(skillPath, updated, "utf-8");
|
|
267
|
-
info(`
|
|
255
|
+
info(`Set version to ${newVersion}`);
|
|
256
|
+
} else {
|
|
257
|
+
const currentVersion = manifest.version;
|
|
258
|
+
const nextPatch = bumpPatch(currentVersion);
|
|
259
|
+
info(`Current version: ${currentVersion}`);
|
|
260
|
+
const chosen = await select({
|
|
261
|
+
message: "Version to release:",
|
|
262
|
+
choices: [
|
|
263
|
+
{ name: `${nextPatch} (patch bump)`, value: nextPatch },
|
|
264
|
+
{ name: `${currentVersion} (current)`, value: currentVersion },
|
|
265
|
+
{ name: "Enter manually", value: "__manual__" }
|
|
266
|
+
]
|
|
267
|
+
});
|
|
268
|
+
newVersion = chosen;
|
|
269
|
+
if (chosen === "__manual__") {
|
|
270
|
+
newVersion = await input3({
|
|
271
|
+
message: "Version:",
|
|
272
|
+
validate: (value) => {
|
|
273
|
+
const semver = /^\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?(\+[a-zA-Z0-9.]+)?$/;
|
|
274
|
+
if (!semver.test(value.trim())) return "Must be valid semver (e.g., 1.2.3).";
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
newVersion = newVersion.trim();
|
|
279
|
+
}
|
|
280
|
+
if (newVersion !== currentVersion) {
|
|
281
|
+
const skillPath = join2(resolved, "SKILL.md");
|
|
282
|
+
const raw = readFileSync(skillPath, "utf-8");
|
|
283
|
+
const updated = raw.replace(
|
|
284
|
+
/^(version:\s*)"?[^"\n]+"?\s*$/m,
|
|
285
|
+
`$1"${newVersion}"`
|
|
286
|
+
);
|
|
287
|
+
writeFileSync2(skillPath, updated, "utf-8");
|
|
288
|
+
info(`Updated version to ${newVersion}`);
|
|
289
|
+
}
|
|
268
290
|
}
|
|
269
291
|
const { pushCommand: pushCommand2 } = await import("./push-X5G76LYV.js");
|
|
270
292
|
await pushCommand2.parseAsync([dir], { from: "user" });
|
|
@@ -648,8 +670,10 @@ var searchCommand = new Command10("search").description("Search for skills in th
|
|
|
648
670
|
});
|
|
649
671
|
|
|
650
672
|
// src/index.ts
|
|
673
|
+
var __dirname = dirname2(fileURLToPath(import.meta.url));
|
|
674
|
+
var pkg = JSON.parse(readFileSync3(join4(__dirname, "..", "package.json"), "utf-8"));
|
|
651
675
|
var program = new Command11();
|
|
652
|
-
program.name("csreg").description("Claude Skills Registry CLI").version(
|
|
676
|
+
program.name("csreg").description("Claude Skills Registry CLI").version(pkg.version);
|
|
653
677
|
program.addCommand(loginCommand);
|
|
654
678
|
program.addCommand(logoutCommand);
|
|
655
679
|
program.addCommand(whoamiCommand);
|