@agent-nexus/csreg 0.1.11 → 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.
Files changed (2) hide show
  1. package/dist/index.js +43 -24
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -231,43 +231,62 @@ var releaseCommand = new Command6("release").description("Bump the version in SK
231
231
  try {
232
232
  const resolved = resolve3(dir);
233
233
  const manifest = parseManifest(resolved);
234
+ let newVersion;
234
235
  if (!manifest.version) {
235
- throw new CliError('Missing "version" in SKILL.md frontmatter.', [
236
- 'Add a version field: version: "1.0.0"'
237
- ]);
238
- }
239
- const currentVersion = manifest.version;
240
- const nextPatch = bumpPatch(currentVersion);
241
- info(`Current version: ${currentVersion}`);
242
- const chosen = await select({
243
- message: "Version to release:",
244
- choices: [
245
- { name: `${nextPatch} (patch bump)`, value: nextPatch },
246
- { name: `${currentVersion} (current)`, value: currentVersion },
247
- { name: "Enter manually", value: "__manual__" }
248
- ]
249
- });
250
- let newVersion = chosen;
251
- if (chosen === "__manual__") {
236
+ info("No version found in SKILL.md frontmatter.");
252
237
  newVersion = await input3({
253
- message: "Version:",
238
+ message: "Initial version:",
239
+ default: "1.0.0",
254
240
  validate: (value) => {
255
241
  const semver = /^\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?(\+[a-zA-Z0-9.]+)?$/;
256
- if (!semver.test(value.trim())) return "Must be valid semver (e.g., 1.2.3).";
242
+ if (!semver.test(value.trim())) return "Must be valid semver (e.g., 1.0.0).";
257
243
  return true;
258
244
  }
259
245
  });
260
246
  newVersion = newVersion.trim();
261
- }
262
- if (newVersion !== currentVersion) {
263
247
  const skillPath = join2(resolved, "SKILL.md");
264
248
  const raw = readFileSync(skillPath, "utf-8");
265
249
  const updated = raw.replace(
266
- /^(version:\s*)"?[^"\n]+"?\s*$/m,
267
- `$1"${newVersion}"`
250
+ /^(---\s*\n[\s\S]*?\n)(---\s*\n?)/,
251
+ `$1version: "${newVersion}"
252
+ $2`
268
253
  );
269
254
  writeFileSync2(skillPath, updated, "utf-8");
270
- info(`Updated version to ${newVersion}`);
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
+ }
271
290
  }
272
291
  const { pushCommand: pushCommand2 } = await import("./push-X5G76LYV.js");
273
292
  await pushCommand2.parseAsync([dir], { from: "user" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-nexus/csreg",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "CLI for Claude Skills Registry",
5
5
  "license": "MIT",
6
6
  "type": "module",