@theholocron/cli 3.3.15 → 3.5.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.
- package/dist/capabilities/index.d.mts +5 -0
- package/dist/cli.mjs +36 -3
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +3 -0
- package/dist/index.mjs +1 -0
- package/package.json +1 -1
|
@@ -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,
|
|
@@ -3570,9 +3571,14 @@ const SYNC_STEPS = [
|
|
|
3570
3571
|
"teams",
|
|
3571
3572
|
"topics",
|
|
3572
3573
|
"keywords",
|
|
3573
|
-
"description"
|
|
3574
|
+
"description",
|
|
3575
|
+
"homepage"
|
|
3574
3576
|
];
|
|
3575
|
-
const LOCAL_STEPS = /* @__PURE__ */ new Set([
|
|
3577
|
+
const LOCAL_STEPS = /* @__PURE__ */ new Set([
|
|
3578
|
+
"keywords",
|
|
3579
|
+
"description",
|
|
3580
|
+
"homepage"
|
|
3581
|
+
]);
|
|
3576
3582
|
async function runSync(input) {
|
|
3577
3583
|
const print = input.print ?? ((line) => console.log(line));
|
|
3578
3584
|
const loader = input.loader ?? new PluginLoader(input.loaded.resolved, input.context);
|
|
@@ -3706,7 +3712,11 @@ async function runSync(input) {
|
|
|
3706
3712
|
}
|
|
3707
3713
|
}
|
|
3708
3714
|
}
|
|
3709
|
-
for (const stepName of [
|
|
3715
|
+
for (const stepName of [
|
|
3716
|
+
"keywords",
|
|
3717
|
+
"description",
|
|
3718
|
+
"homepage"
|
|
3719
|
+
]) {
|
|
3710
3720
|
if (requestedSteps !== void 0 && !requestedSteps.includes(stepName)) continue;
|
|
3711
3721
|
if (stepName === "keywords") {
|
|
3712
3722
|
const topics = config.repo?.topics ?? [];
|
|
@@ -3750,6 +3760,29 @@ async function runSync(input) {
|
|
|
3750
3760
|
print(formatSyncStep(steps[steps.length - 1]));
|
|
3751
3761
|
}
|
|
3752
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
|
+
}
|
|
3753
3786
|
}
|
|
3754
3787
|
const summary = steps.reduce((acc, s) => {
|
|
3755
3788
|
if (s.status === "ok") acc.ok += 1;
|