MDX files can import JSON/YAML data from outside the section (e.g.
admin_docs/configuration/country-map-tools.mdx imports
../../data/countries.json). Without intervention, the snapshot keeps
reading the live data file, so the historical version's content
silently changes whenever the data file is updated upstream.
Add a freezeDataImports step to manage-versions.mjs that runs at cut
time, before the depth-aware path rewriter:
- Walks the freshly-snapshotted section dir
- For each .md/.mdx file, finds escaping JSON/YAML imports (one or more
../) and resolves them against the file's original location
- Copies the resolved file into <snapshot>/_versioned_data/, preserving
its path relative to docs/ (the underscore prefix keeps Docusaurus
from treating it as content)
- Rewrites the import to point at the snapshot-local copy
Verified end-to-end with a throwaway admin_docs cut: the snapshot's
country-map-tools page renders all 201 countries from a frozen JSON,
and a subsequent edit to the live docs/data/countries.json does not
affect the snapshot's rendered output.
Tooling-only prep for the upcoming docs version cut. Snapshots will land
in a follow-up PR.
- Finish the developer_portal -> developer_docs rename: update package.json
scripts, manage-versions.mjs usage strings, DocVersionBadge plugin id list
(replaces bogus 'tutorials' and 'developer_portal' ids with the real
'default', 'components', 'admin_docs', 'developer_docs'), DocVersionBanner
dead branch, DOCS_CLAUDE.md, README.md
- Add admin_docs version add/remove scripts (which previously didn't exist)
- Generalize fixVersionedImports in manage-versions.mjs to walk every
section's snapshot dir with a depth-aware regex, and skip fenced code
blocks; replaces the previous hard-coded two-file list
- Remove orphan files: developer_portal_versions.json, tutorials_versions.json
(no such plugin), and the empty docs/components/versions.json and
docs/developer_docs/versions.json that were accidentally tracked inside
content directories
- Exclude auto-generated sidebar.js and sidebar.ts from the ASF license check
(these are produced by docs/scripts/convert-api-sidebar.mjs from the
OpenAPI spec, and a future version cut would otherwise commit them)