Skip to content

chore(scripts): generate CLI and native pages as .mdx - #4692

Open
thetaPC wants to merge 1 commit into
mainfrom
FW-6456-pt7
Open

chore(scripts): generate CLI and native pages as .mdx#4692
thetaPC wants to merge 1 commit into
mainfrom
FW-6456-pt7

Conversation

@thetaPC

@thetaPC thetaPC commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Issue URL: internal

What is the current behavior?

Every doc page in the repository is now named .mdx except two directories: the CLI command pages and the Capacitor plugin pages, which are written by scripts/cli.mjs and scripts/native.mjs on every build and still land as .md.

These are pages, not fragments. They get routes, sidebar entries, and URLs like any other page, so the rule worth having is simply that doc pages are .mdx. Right now it is that doc pages are .mdx except two directories, and the exception is invisible: the output is gitignored, so it only appears on a local disk after a build.

There is also a practical risk. If anyone adds an import or a component to those generator templates, the output breaks once Strict MDX is enabled, and the failure shows up as a blank section rather than an error.

What is the new behavior?

The two generators emit .mdx, and the 54 links pointing into those trees are updated to match.

That is the whole change: two lines in the generators, and 32 pages containing links to the pages they produce. Nothing is renamed in git, because the output is untracked. The old .md files disappear the next time the generators run.

Does this introduce a breaking change?

  • Yes
  • No

Other information

This deliberately lands before the removal of the transitional MDX compatibility code, so it can be verified on its own.

That ordering matters for an unobvious reason. The resolve.extensionAlias entry currently maps a .md import onto a .mdx file, so while it is in place a missed link would resolve anyway and the build would stay green. A passing build here is therefore weaker evidence than it looks.

What actually verifies this change is a static check rather than the build: every link was resolved against a real file on disk, and there are now zero .md links and zero .md imports left anywhere in docs or versioned_docs/version-v8. That check does not depend on the alias. Removing the alias in the follow-up is what proves it properly, since anything missed will then fail loudly.

Verification, compared against a build taken before the change:

The build completes with 0 errors. Broken links stay at 21 and broken anchors at 47, with none introduced. Prettier reports no differences, and the spell checker reports none across 10,918 files. All 73 generated pages build and are reachable.

How to test

Nothing should look different. These pages are generated from the same source data as before, so a failure shows up as a missing page or a dead link rather than as changed content.

Check that a CLI command page and a Capacitor plugin page still render, for example the ionic build command page and the Camera plugin page, and that both appear in the sidebar in their usual positions.

Then follow a link into one of those trees from a hand-written page. The framework getting-started guides link to the Camera, Filesystem, and Preferences plugin pages, and the CLI configuration and livereload pages link to individual command pages. Those inbound links are the part this PR changes.

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-docs Ready Ready Preview Sep 1, 2026 10:59pm UTC

Request Review

@thetaPC
thetaPC marked this pull request as ready for review September 1, 2026 23:23
@thetaPC
thetaPC requested a review from a team as a code owner September 1, 2026 23:23
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.

1 participant