Skip to content

[CI] Update API docs for OpenZeppelin/openzeppelin-contracts hardhat3#183

Open
github-actions[bot] wants to merge 6 commits into
mainfrom
docs-api-update-openzeppelin-contracts-hardhat3
Open

[CI] Update API docs for OpenZeppelin/openzeppelin-contracts hardhat3#183
github-actions[bot] wants to merge 6 commits into
mainfrom
docs-api-update-openzeppelin-contracts-hardhat3

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

API Documentation Update

This Pull Request updates the API documentation.

Source Information

  • Repository: OpenZeppelin/openzeppelin-contracts
  • Reference: hardhat3
  • Trigger Type: commit
  • Output Directory: content/contracts/latest/api
  • Timestamp: 2026-06-15 07:55:39 UTC

Auto-generated via workflow_dispatch

ernestognw and others added 6 commits May 28, 2026 22:56
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
@github-actions github-actions Bot requested review from a team and stevep0z as code owners June 15, 2026 07:55
@netlify

netlify Bot commented Jun 15, 2026

Copy link
Copy Markdown

Deploy Preview for openzeppelin-docs-v2 failed. Why did it fail? →

Name Link
🔨 Latest commit 5441bc5
🔍 Latest deploy log https://app.netlify.com/projects/openzeppelin-docs-v2/deploys/6a2fb007be665d00082eb44c

@Amxx

Amxx commented Jun 15, 2026

Copy link
Copy Markdown

DO NOT MERGE. Testing the doc generation process on the hardhat3 branch

@Amxx

Amxx commented Jun 15, 2026

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants