Preprocess imported Markdown snippets#93
Draft
remorses wants to merge 3 commits into
Draft
Conversation
Process imported `.md` and `.mdx` files even when they are not listed in docs.json, then expose those preprocessed files to safe-mdx as normal MDX modules. This lets page imports, snippet imports, and nested snippet imports share the same preprocessing path for Mintlify transforms, images, and module resolution. The Vite virtual modules now keep JS/TS imports as lazy loaders and expose imported Markdown through a serializable markdown registry. safe-mdx owns recursive MDX module resolution, so Holocron no longer needs to generate per-snippet wrapper modules or use raw `?raw` imports for Markdown snippets. Validation: - pnpm --filter @holocron.so/vite build - pnpm --filter @holocron.so/vite test - pnpm --dir integration-tests test-e2e --project=mdx-imports - pnpm --dir integration-tests test-e2e Depends on safe-mdx PR #21 for the recursive MDX module API. Session: ses_2bbe7a7767674a57abc0855d8b43490b
Point Holocron at the safe-mdx branch that exposes the recursive MDX module API so the draft PR can install and validate in CI without relying on a sibling checkout. This is a temporary dependency shape until safe-mdx is released, at which point the dependency should go back to a normal semver range. Validation: - pnpm --filter @holocron.so/vite build - pnpm --filter @holocron.so/vite test - pnpm --dir integration-tests test-e2e --project=mdx-imports Session: ses_2bbe7a7767674a57abc0855d8b43490b
Allow the temporary safe-mdx git dependency to run its prepare build in CI. This keeps the draft Holocron integration branch installable while the recursive MDX module API lives on a safe-mdx branch instead of a published semver release. Validation: - pnpm install --frozen-lockfile Session: ses_2bbe7a7767674a57abc0855d8b43490b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.mdand.mdxsnippets even when they are not listed indocs.json.?rawsnippet loading with a preprocessed markdown registry that safe-mdx resolves recursively.Validation
pnpm --filter @holocron.so/vite buildpnpm --filter @holocron.so/vite testpnpm --dir integration-tests test-e2e --project=mdx-importspnpm --dir integration-tests test-e2epassed 211 tests before the final dead-code cleanup. The targeted mdx-imports suite passed again after cleanup and after switching to the git dependency.Dependency note
This is draft because it depends on safe-mdx PR #21 for the recursive MDX module API. The branch temporarily points
safe-mdxatgithub:remorses/safe-mdx#recursive-mdx-modulesso CI can install the unreleased API. Before this merges, safe-mdx should be released and the dependency should be changed back to a normal semver range.