feat: devtools editor & advanced mdx collocations - #476
Draft
Kinfe123 wants to merge 1 commit into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@farming-labs/astro
@farming-labs/astro-theme
@farming-labs/docs
@farming-labs/farmjs
@farming-labs/theme
@farming-labs/next
@farming-labs/nuxt
@farming-labs/nuxt-theme
@farming-labs/svelte
@farming-labs/svelte-theme
@farming-labs/tanstack-start
commit: |
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.
Status
Draft. This restores the work from the original PR #200 so it can continue being developed and reviewed before merging again.
Scope
History
The original PR was reverted by #474 because it was not ready to ship. This branch reproduces the original PR tree exactly, without unrelated changes.
Next steps
Continue refining and testing this work here. The runtime theme tweaks are maintained as a separate draft stacked on this branch.
Summary by cubic
Adds a local DevTools visual editor for MDX docs and the API endpoints it needs, gated behind a new
devToolsconfig. Themes no longer inject a Tabs style default to avoid leaking into React’s reservedstyleprop.devTools: trueindefineDocs(); hidden whenstaticExport: true. The API rejects DevTools requests unless enabled and the request is local or not in production./api/docs?devtools=pageGET returns{ relativePath, content }for the current route; POST writes file changes and invalidates indexes. Resolves customdocsPathback toapp/docs/**/page.mdx./api/docs?devtools=themePOST rewritesapp/global.cssanddocs.config.tsximports/initializer to switch@farming-labs/theme/*./api/docs?devtools=nav-itemPOST updates frontmatter (e.g.,title) of the target page./api/docs?devtools=publishPOST forwards to Cloud; requiresFARMING_CLOUD_API_KEYorFARMING_API_KEY.DocsPageClientmounts<DocsDevTools>and marks the content region (data-dt-content) when enabled.ui.components.Tabsdefaults across presets to avoid Reactstyleprop conflicts; pass tab style where you render Tabs if you relied on theme defaults.devToolstoDocsConfigtypes and public docs; examples updated to demonstrate block-level MDX editing.Written for commit 0b97114. Summary will update on new commits.