release: WRNexusJS 0.3.4

This commit is contained in:
2026-07-22 21:30:37 +05:30
parent d51662826d
commit e543fd026d
+21 -31
View File
@@ -196,7 +196,7 @@ function prepare(all: PackageInfo[], version: string) {
requireMigration(version); requireMigration(version);
console.log(`\nPreparing WRNexusJS ${version} (${all.length} packages)…\n`); 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", "format"]);
run(process.execPath, ["run", "check"]); run(process.execPath, ["run", "check"]);
@@ -208,6 +208,8 @@ function prepare(all: PackageInfo[], version: string) {
} }
function verifyUiComponentReference(): void { function verifyUiComponentReference(): void {
const generatedFiles = ["packages/ui/component-reference.json", "packages/ui/COMPONENTS.md"];
const result = run( const result = run(
process.execPath, process.execPath,
["run", "scripts/generate-ui-component-reference.mjs"], ["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}` : ""}`); throw new Error(`Failed to generate the UI component reference.${detail ? `\n${detail}` : ""}`);
} }
const changed = const changed = output("git", ["status", "--short", "--", ...generatedFiles], root).trim();
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();
if (changed) { if (!changed) {
throw new Error( return;
"UI component reference is stale. Run " +
"`bun run scripts/generate-ui-component-reference.mjs`, " +
"then format, commit, and push the generated files.",
);
} }
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) { function publish(all: PackageInfo[], version: string) {