Skip to content

chore(filecheck): drop index.html support and fs-extra#44608

Merged
LeoMcA merged 5 commits into
mainfrom
refine-filecheck
Jul 10, 2026
Merged

chore(filecheck): drop index.html support and fs-extra#44608
LeoMcA merged 5 commits into
mainfrom
refine-filecheck

Conversation

@caugner

@caugner caugner commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Description

Refactor the filecheck script:

  • Remove index.html support, so only the adjacent index.md is considered when checking whether an attachment is referenced.
  • Replace fs-extra with node:fs/promises and drop the dependency.

Motivation

All documents migrated to index.md long ago, so the index.html fallback is dead code. node:fs/promises covers everything we used fs-extra for, so the extra dependency is no longer needed.

Additional details

  • Test fixtures are consolidated directly under fixtures, dropping the now-redundant duplicate "not mentioned" test.
  • fse.exists → the adjacent index.md is read directly, throwing the "no document file" error when the read fails; fse.copyFileSyncfs.copyFile; fse.removeSyncfs.rm(..., { recursive: true, force: true }).

Related issues and pull requests

caugner added 2 commits June 30, 2026 17:28
We migrated all documents to `index.md` long ago, so only the adjacent
`index.md` is considered when checking whether an attachment is
referenced. Consolidate the test fixtures into a single `md` directory
accordingly.
`node:fs/promises` covers everything we used `fs-extra` for: a small
`pathExists` helper wraps `fs.access`, `fse.copyFileSync` becomes
`fs.copyFile`, and `fse.removeSync` becomes `fs.rm` with `recursive` and
`force`. Drop the `fs-extra` dependency.
@github-actions github-actions Bot added system [PR only] Infrastructure and configuration for the project size/m [PR only] 51-500 LoC changed labels Jun 30, 2026
caugner added 2 commits July 7, 2026 14:27
Read the adjacent `index.md` directly and throw the "no document
file" `FixableError` on failure, instead of a separate `fs.access`
probe. Removes the single-use `pathExists` helper and the extra
filesystem round-trip.
Move fixture files up one level and rename the `MD_FIXTURES` constant to
`FIXTURES`, since the `md` subdirectory is the only fixtures directory.
@caugner caugner changed the title refactor(filecheck): drop index.html support and fs-extra chore(filecheck): drop index.html support and fs-extra Jul 7, 2026
@caugner caugner marked this pull request as ready for review July 7, 2026 13:32
@caugner caugner requested review from a team and mdn-bot as code owners July 7, 2026 13:32
@caugner caugner requested review from LeoMcA and removed request for a team July 7, 2026 13:32

@LeoMcA LeoMcA left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup!

@LeoMcA LeoMcA merged commit acc64b6 into main Jul 10, 2026
20 checks passed
@LeoMcA LeoMcA deleted the refine-filecheck branch July 10, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m [PR only] 51-500 LoC changed system [PR only] Infrastructure and configuration for the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants