Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: build-docs failure with React 19 #1892

Merged
merged 2 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/proud-windows-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@redocly/cli": patch
---

Fixed an issue where the `build-docs` command failed when React 19 was installed in the project folder.
4 changes: 2 additions & 2 deletions .github/workflows/smoke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,9 @@ jobs:
docker run --rm -v $PWD:/spec redocly/cli:latest bundle openapi.yaml --ext json
docker run --rm -v $PWD:/spec redocly/cli:latest build-docs openapi.yaml
# Check for broken styles (related issue: https://github.com/Redocly/redocly-cli/issues/1073)
if [[ "$(wc -l redoc-static.html)" == "300 redoc-static.html" ]]; then
if [[ "$(wc -l redoc-static.html)" == "324 redoc-static.html" ]]; then
echo "Docs built correctly."
else
echo "Docs built incorrectly. Received lines: $(wc -l redoc-static.html) (expected 300 lines in redoc-static.html)."
echo "Docs built incorrectly. Received lines: $(wc -l redoc-static.html) (expected 324 lines in redoc-static.html)."
exit 1
fi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`E2E build-docs build docs with config option 1`] = `
Found nested/redocly.yaml and using theme.openapi options
Prerendering docs
🎉 bundled successfully in: nested/redoc-static.html (33 KiB) [⏱ <test>ms].
🎉 bundled successfully in: nested/redoc-static.html (36 KiB) [⏱ <test>ms].
`;
2 changes: 1 addition & 1 deletion __tests__/build-docs/simple-build-docs/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`E2E build-docs simple build-docs 1`] = `
Found undefined and using theme.openapi options
Prerendering docs

🎉 bundled successfully in: redoc-static.html (324 KiB) [⏱ <test>ms].
🎉 bundled successfully in: redoc-static.html (330 KiB) [⏱ <test>ms].


`;
2 changes: 1 addition & 1 deletion __tests__/commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ describe('E2E', () => {
(<any>expect(cleanupOutput(result))).toMatchSpecificSnapshot(join(testPath, 'snapshot.js'));

expect(fs.existsSync(join(testPath, 'nested/redoc-static.html'))).toEqual(true);
expect(fs.statSync(join(testPath, 'nested/redoc-static.html')).size).toEqual(32952);
expect(fs.statSync(join(testPath, 'nested/redoc-static.html')).size).toEqual(36237);
});
});

Expand Down
4 changes: 2 additions & 2 deletions __tests__/smoke/run-smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ $2 redocly-lint
$2 redocly-bundle
$2 redocly-build-docs
# Check for broken styles (related issue: https://github.com/Redocly/redocly-cli/issues/1073)
if [[ "$(wc -l redoc-static.html)" == "300 redoc-static.html" ]]; then
if [[ "$(wc -l redoc-static.html)" == "324 redoc-static.html" ]]; then
echo "Docs built correctly."
else
echo "Docs built incorrectly. Received lines: $(wc -l redoc-static.html) (expected 300 lines in redoc-static.html)."
echo "Docs built incorrectly. Received lines: $(wc -l redoc-static.html) (expected 324 lines in redoc-static.html)."
exit 1
fi
Loading
Loading