Files
superset2/docs/scripts
Claude Code 4081d85de0 chore(docs): freeze data imports when cutting a docs version
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.
2026-05-13 17:15:29 -07:00
..