mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-24 09:50:01 +00:00
fix: support description in changesets
This commit is contained in:
parent
223f26af0b
commit
401a9ccfa1
2 changed files with 14 additions and 4 deletions
|
|
@ -4,6 +4,7 @@ import { logger, printDivider, printHeader } from "utils";
|
|||
|
||||
interface ContractsBumpOptions {
|
||||
type: "major" | "minor" | "patch";
|
||||
description?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -47,17 +48,24 @@ export const contractsBump = async (options: ContractsBumpOptions) => {
|
|||
const changesetsDir = path.join(repoRoot, "contracts", ".changesets");
|
||||
const changesetPath = path.join(changesetsDir, changesetName);
|
||||
|
||||
// Write changeset file
|
||||
writeFileSync(changesetPath, bumpType);
|
||||
// Write changeset file (bump type on first line, optional description on subsequent lines)
|
||||
let changesetContent = bumpType;
|
||||
if (options.description) {
|
||||
changesetContent += `\n${options.description}`;
|
||||
}
|
||||
writeFileSync(changesetPath, changesetContent);
|
||||
|
||||
logger.success(`Created changeset: ${changesetName}`);
|
||||
logger.info(` Type: ${bumpType.toUpperCase()}`);
|
||||
if (options.description) {
|
||||
logger.info(` Description: ${options.description}`);
|
||||
}
|
||||
logger.info(` Path: ${changesetPath}`);
|
||||
logger.info("");
|
||||
logger.info("📋 Next steps:");
|
||||
logger.info(" 1. Commit this changeset file: git add contracts/.changesets/");
|
||||
logger.info(" 2. Push your changes");
|
||||
logger.info(" 3. On merge to main, CI will process the changeset");
|
||||
logger.info(" 3. Before release, manually run the version bump GitHub Action to create a PR");
|
||||
|
||||
printDivider();
|
||||
} catch (error) {
|
||||
|
|
|
|||
|
|
@ -401,10 +401,12 @@ contractsCommand
|
|||
.command("bump")
|
||||
.description("Create a changeset to declare a version bump for contract changes")
|
||||
.requiredOption("--type <value>", "Bump type: major, minor, or patch")
|
||||
.option("--description <value>", "Optional description of the changes (added after first line)")
|
||||
.action(async (options: any) => {
|
||||
const { contractsBump } = await import("./handlers");
|
||||
await contractsBump({
|
||||
type: options.type as "major" | "minor" | "patch"
|
||||
type: options.type as "major" | "minor" | "patch",
|
||||
description: options.description
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue