[CI] Update API docs for OpenZeppelin/openzeppelin-contracts hardhat3#183
Open
github-actions[bot] wants to merge 6 commits into
Open
[CI] Update API docs for OpenZeppelin/openzeppelin-contracts hardhat3#183github-actions[bot] wants to merge 6 commits into
github-actions[bot] wants to merge 6 commits into
Conversation
The injectTemplates pipeline assumed a Hardhat 2 / solidity-docgen layout (docs/config.js + docs/templates-md/). The hardhat3 branch of openzeppelin-contracts replaces solidity-docgen with an in-tree plugin that reads docs/config.mjs and templates from docs/templates/, emits .adoc by default, and loads helpers/properties only from helpers.ts/ properties.ts via ESM dynamic import — so the previous injection was silently ignored and AsciiDoc landed in content/, breaking every guide xref into the API. Detect the layout from the cloned repo and route accordingly: - New layout: overwrite docs/config.mjs with our canonical config (forces pageExtension '.mdx' and templates path 'docs/templates'), wipe and re-populate docs/templates/, rename helpers.js / properties.js to .cjs (Node treats .js as ESM under "type": "module" on hardhat3), patch the internal require, and emit thin ESM shim helpers.ts / properties.ts so the in-tree plugin's loader picks up named exports. - Legacy layout: unchanged behaviour. Rename the kebab-case Handlebars helpers (oz-version, has-functions, typed-params, …) to camelCase across the templates and helpers/ properties modules. ESM named exports cannot carry hyphens, and Handlebars is name-agnostic, so this is transparent to solidity-docgen on older tags. Verified by running against the hardhat3 branch locally: 200 → 1 broken links in next-validate-link, and the one residual is a pre-existing EIP712 NatSpec xref to /<base>/learn/upgrading-smart-contracts that also fails on current main's content/contracts/5.x. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The xref:learn::*.adoc[] pattern in NatSpec was resolved relative to the per-version docs base, producing /contracts/latest/learn/... on commit builds where no such content exists. Pin learn to /contracts/5.x/learn in both helpers.js and convert-adoc.js so the link points to the only location where learn content lives. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Apply review feedback from @Amxx: - Use `export { ... } from "..."` re-export form in tsShim; drops the unused varName parameter. - Inline newLayout detection as a single fs.access promise chain. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Repository: OpenZeppelin/openzeppelin-contracts - Ref: hardhat3 - Trigger: commit - Output: content/contracts/latest/api - Timestamp: 2026-06-15 07:55:38 UTC Auto-generated via workflow_dispatch
❌ Deploy Preview for openzeppelin-docs-v2 failed. Why did it fail? →
|
|
DO NOT MERGE. Testing the doc generation process on the hardhat3 branch |
|
TODO: we need to check that whatever is in the latest folder in the PR matches what is currently in the 5.x folder UPDATE: it looks consistent to me. We can see some changes related to unreleased features and tag difference (5.x vs latest). Other than that it looks identical. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
API Documentation Update
This Pull Request updates the API documentation.
Source Information
Auto-generated via workflow_dispatch