@theholocron/cli 3.3.14 → 3.4.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.
@@ -152,6 +152,11 @@ interface Source extends ProviderIdentity {
152
152
  * Optional — providers that don't support setting descriptions omit this.
153
153
  */
154
154
  syncDescription?(description: string): Promise<string>;
155
+ /**
156
+ * Set the repository homepage URL (the "Website" field on the repo landing page).
157
+ * Optional — providers that don't support setting a homepage omit this.
158
+ */
159
+ syncHomepage?(homepage: string): Promise<string>;
155
160
  }
156
161
  type CiRunStatus = "queued" | "in_progress" | "completed" | "cancelled" | "failure" | "success" | "skipped";
157
162
  interface CiRun {
package/dist/cli.mjs CHANGED
@@ -251,6 +251,7 @@ function resolveConfig(raw) {
251
251
  return {
252
252
  name: raw.name,
253
253
  description: raw.description,
254
+ homepage: raw.homepage,
254
255
  repo: raw.repo,
255
256
  workflows: raw.workflows,
256
257
  providers,
@@ -3317,7 +3318,19 @@ async function installSkills({ agent, skills, repoRoot }) {
3317
3318
  try {
3318
3319
  skillsRoot = dirname(require.resolve("@theholocron/skills/package.json"));
3319
3320
  } catch {
3320
- throw new Error("@theholocron/skills not found — run: pnpm add -D @theholocron/skills");
3321
+ if (spawnSync("pnpm", [
3322
+ "add",
3323
+ "-D",
3324
+ "@theholocron/skills"
3325
+ ], {
3326
+ cwd: repoRoot,
3327
+ stdio: "inherit"
3328
+ }).status !== 0) throw new Error("failed to auto-install @theholocron/skills");
3329
+ try {
3330
+ skillsRoot = dirname(require.resolve("@theholocron/skills/package.json"));
3331
+ } catch {
3332
+ throw new Error("failed to auto-install @theholocron/skills");
3333
+ }
3321
3334
  }
3322
3335
  const gitignorePath = join(repoRoot, ".gitignore");
3323
3336
  const existingContent = await readFile(gitignorePath, "utf8").catch(() => "");
@@ -3558,9 +3571,14 @@ const SYNC_STEPS = [
3558
3571
  "teams",
3559
3572
  "topics",
3560
3573
  "keywords",
3561
- "description"
3574
+ "description",
3575
+ "homepage"
3562
3576
  ];
3563
- const LOCAL_STEPS = /* @__PURE__ */ new Set(["keywords", "description"]);
3577
+ const LOCAL_STEPS = /* @__PURE__ */ new Set([
3578
+ "keywords",
3579
+ "description",
3580
+ "homepage"
3581
+ ]);
3564
3582
  async function runSync(input) {
3565
3583
  const print = input.print ?? ((line) => console.log(line));
3566
3584
  const loader = input.loader ?? new PluginLoader(input.loaded.resolved, input.context);
@@ -3694,7 +3712,11 @@ async function runSync(input) {
3694
3712
  }
3695
3713
  }
3696
3714
  }
3697
- for (const stepName of ["keywords", "description"]) {
3715
+ for (const stepName of [
3716
+ "keywords",
3717
+ "description",
3718
+ "homepage"
3719
+ ]) {
3698
3720
  if (requestedSteps !== void 0 && !requestedSteps.includes(stepName)) continue;
3699
3721
  if (stepName === "keywords") {
3700
3722
  const topics = config.repo?.topics ?? [];
@@ -3738,6 +3760,29 @@ async function runSync(input) {
3738
3760
  print(formatSyncStep(steps[steps.length - 1]));
3739
3761
  }
3740
3762
  }
3763
+ if (stepName === "homepage") {
3764
+ const homepage = config.homepage;
3765
+ if (!homepage) {
3766
+ steps.push({
3767
+ capability: "local",
3768
+ step: "sync homepage",
3769
+ status: "skip",
3770
+ message: "no homepage configured"
3771
+ });
3772
+ print(formatSyncStep(steps[steps.length - 1]));
3773
+ } else {
3774
+ const source = loader.has("source") ? loader.get("source") : null;
3775
+ steps.push(await runSyncStep("local", "sync homepage", dryRun, async () => {
3776
+ const pkgWrote = await writePackageJsonField(input.context.repoRoot, "homepage", homepage);
3777
+ if (source?.syncHomepage) await source.syncHomepage(homepage);
3778
+ const parts = [];
3779
+ if (pkgWrote) parts.push("package.json");
3780
+ if (source?.syncHomepage) parts.push("GitHub");
3781
+ return parts.length > 0 ? parts.join(", ") + " updated" : "homepage synced";
3782
+ }));
3783
+ print(formatSyncStep(steps[steps.length - 1]));
3784
+ }
3785
+ }
3741
3786
  }
3742
3787
  const summary = steps.reduce((acc, s) => {
3743
3788
  if (s.status === "ok") acc.ok += 1;