release: WRNexusJS 0.3.4
This commit is contained in:
+21
-31
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user