fix(release): format generated UI references before verification
This commit is contained in:
+7
-7
@@ -230,11 +230,11 @@ 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}` : ""}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do not use `git status --short` here. On Windows, the generator writes LF
|
// Format generated files before comparing them with Git.
|
||||||
// while an autocrlf checkout may contain CRLF. `git status` can report those
|
// The generator expands JSON arrays, while Prettier may place short arrays
|
||||||
// files as modified even when their canonical Git content is identical.
|
// on one line. Comparing before formatting creates a permanent false diff.
|
||||||
// `git diff --quiet` applies Git's normal text conversion and only fails for
|
run(process.execPath, ["x", "prettier", "--write", ...generatedFiles], root);
|
||||||
// a real generated-content difference.
|
|
||||||
const changedStatus = run("git", ["diff", "--quiet", "--", ...generatedFiles], root, {
|
const changedStatus = run("git", ["diff", "--quiet", "--", ...generatedFiles], root, {
|
||||||
capture: true,
|
capture: true,
|
||||||
allowFailure: true,
|
allowFailure: true,
|
||||||
@@ -254,9 +254,9 @@ function verifyUiComponentReference(): void {
|
|||||||
"",
|
"",
|
||||||
"Run:",
|
"Run:",
|
||||||
" bun run scripts/generate-ui-component-reference.mjs",
|
" bun run scripts/generate-ui-component-reference.mjs",
|
||||||
" bun run format",
|
" bunx prettier --write packages/ui/component-catalog.json 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 add packages/ui/component-catalog.json packages/ui/component-reference.json packages/ui/COMPONENTS.md",
|
||||||
' git commit -m "docs(ui): refresh component reference"',
|
' git commit -m \\"docs(ui): refresh component reference\\"',
|
||||||
" git push origin main",
|
" git push origin main",
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user