From e543fd026d1370a6022bd94be906a7d20b22e9f0 Mon Sep 17 00:00:00 2001 From: Ajay Ghanwat Date: Wed, 22 Jul 2026 21:30:37 +0530 Subject: [PATCH] release: WRNexusJS 0.3.4 --- scripts/release.ts | 52 +++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/scripts/release.ts b/scripts/release.ts index 124a7700..f2b59883 100644 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -196,7 +196,7 @@ function prepare(all: PackageInfo[], version: string) { requireMigration(version); console.log(`\nPreparing WRNexusJS ${version} (${all.length} packages)…\n`); - run(process.execPath, ["run", "scripts/generate-ui-component-reference.mjs"]); + run(process.execPath, ["run", "scripts/generate-ui-component-reference.mjs"], root); run(process.execPath, ["run", "format"]); run(process.execPath, ["run", "check"]); @@ -208,6 +208,8 @@ function prepare(all: PackageInfo[], version: string) { } function verifyUiComponentReference(): void { + const generatedFiles = ["packages/ui/component-reference.json", "packages/ui/COMPONENTS.md"]; + const result = run( process.execPath, ["run", "scripts/generate-ui-component-reference.mjs"], @@ -224,38 +226,26 @@ function verifyUiComponentReference(): void { throw new Error(`Failed to generate the UI component reference.${detail ? `\n${detail}` : ""}`); } - const changed = - output( - "git", - [ - "diff", - "--name-only", - "--", - "packages/ui/component-reference.json", - "packages/ui/COMPONENTS.md", - ], - root, - ).trim() || - output( - "git", - [ - "ls-files", - "--others", - "--exclude-standard", - "--", - "packages/ui/component-reference.json", - "packages/ui/COMPONENTS.md", - ], - root, - ).trim(); + const changed = output("git", ["status", "--short", "--", ...generatedFiles], root).trim(); - if (changed) { - throw new Error( - "UI component reference is stale. Run " + - "`bun run scripts/generate-ui-component-reference.mjs`, " + - "then format, commit, and push the generated files.", - ); + if (!changed) { + return; } + + throw new Error( + [ + "UI component reference is stale.", + "", + changed, + "", + "Run:", + " bun run scripts/generate-ui-component-reference.mjs", + " bun run format", + " git add packages/ui/component-reference.json packages/ui/COMPONENTS.md", + ' git commit -m "docs(ui): refresh component reference"', + " git push origin main", + ].join("\n"), + ); } function publish(all: PackageInfo[], version: string) {