release: WRNexusJS 0.6.0
This commit is contained in:
+19
-5
@@ -208,7 +208,11 @@ function prepare(all: PackageInfo[], version: string) {
|
||||
}
|
||||
|
||||
function verifyUiComponentReference(): void {
|
||||
const generatedFiles = ["packages/ui/component-reference.json", "packages/ui/COMPONENTS.md"];
|
||||
const generatedFiles = [
|
||||
"packages/ui/component-catalog.json",
|
||||
"packages/ui/component-reference.json",
|
||||
"packages/ui/COMPONENTS.md",
|
||||
];
|
||||
|
||||
const result = run(
|
||||
process.execPath,
|
||||
@@ -226,22 +230,32 @@ function verifyUiComponentReference(): void {
|
||||
throw new Error(`Failed to generate the UI component reference.${detail ? `\n${detail}` : ""}`);
|
||||
}
|
||||
|
||||
const changed = output("git", ["status", "--short", "--", ...generatedFiles], root).trim();
|
||||
// Do not use `git status --short` here. On Windows, the generator writes LF
|
||||
// while an autocrlf checkout may contain CRLF. `git status` can report those
|
||||
// files as modified even when their canonical Git content is identical.
|
||||
// `git diff --quiet` applies Git's normal text conversion and only fails for
|
||||
// a real generated-content difference.
|
||||
const changedStatus = run("git", ["diff", "--quiet", "--", ...generatedFiles], root, {
|
||||
capture: true,
|
||||
allowFailure: true,
|
||||
}).status;
|
||||
|
||||
if (!changed) {
|
||||
if (changedStatus === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const changed = output("git", ["diff", "--name-status", "--", ...generatedFiles], root);
|
||||
|
||||
throw new Error(
|
||||
[
|
||||
"UI component reference is stale.",
|
||||
"",
|
||||
changed,
|
||||
changed || generatedFiles.join("\n"),
|
||||
"",
|
||||
"Run:",
|
||||
" bun run scripts/generate-ui-component-reference.mjs",
|
||||
" bun run format",
|
||||
" git add packages/ui/component-reference.json packages/ui/COMPONENTS.md",
|
||||
" git add packages/ui/component-catalog.json packages/ui/component-reference.json packages/ui/COMPONENTS.md",
|
||||
' git commit -m "docs(ui): refresh component reference"',
|
||||
" git push origin main",
|
||||
].join("\n"),
|
||||
|
||||
Reference in New Issue
Block a user