Repository navigation
fix: resolve Cookbook from the site for content outside it, and docs precision fixes - #216
Merged
Merged
Conversation
- configuration.md: the brand contrast value is a target, not a floor; a site-wide tableOfContents: false yields to a page's own setting. - theme-and-components.md: a brand target matters only above the floors, so the default changes nothing. - cli.md: astro dev stops on the contrast errors too. - troubleshooting.md: doctor prints the page count on success or with --json. - architecture.md: Markdown copies are conditional too; "default sources" replaces the old convention-mode term. - custom-components.md: the TypeScript ESLint entry is added, not a replacement. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Gr8S7DePcxFzSN3gkPVNcb
…side it A component module beside content outside the site's folder, such as docs/components/StatusBadge.ts in a site created with --source, failed in astro dev and astro build: Node resolution from that folder cannot reach the site's node_modules, so `@tenphi/cookbook/styling` was not found. MDX pages were unaffected, which is why the custom components guide looked right. The integration now adds `@tenphi/cookbook` to Vite's resolve.dedupe, so Cookbook's own entries resolve from the site for every importer. The existing server-side filter only removes react and react-dom. check:development puts a component module in its external content root and checks it on the dev server and in the build; it failed without the fix. The custom components guide says other packages a component imports resolve from the module's own folder. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Gr8S7DePcxFzSN3gkPVNcb
Merged
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.
Why
Two things that #214 left out:
docs/custom-components.mdsays to put a component indocs/components/StatusBadge.tsand import it from an MDX page.--source,docs/sits in the repository, outside the site's folder. Node resolution from there cannot reach the site'snode_modules.astro devandastro buildboth fail:Rolldown failed to resolve import "@tenphi/cookbook/styling" from ".../repo/docs/components/StatusBadge.ts".--sourcesite installed from the packed packages. MDX pages themselves were fine, because Cookbook resolves their imports from the site.What changes
Fix (
@tenphi/renderer)@tenphi/cookbookto Vite'sresolve.dedupein theresolveblock it already configures. Cookbook's own entries then resolve from the site for every importer.dedupefilter only removesreactandreact-dom, so the two don't interact.check:developmentalready keeps content in../content, outside the site. It now writesdocs/components/badge.jsthere, imports it from an MDX page, and checks the page on the dev server and in the production build.Cannot find module '@tenphi/cookbook/styling' imported from '.../content/docs/components/badge.js'.custom-components.md: a component outside the site resolves@tenphi/cookbookfrom the site. Any other package it imports resolves from the module's own folder.@tenphi/renderer.Docs precision fixes (from the verification round)
configuration.md:tableOfContents: falsegives way to a page's own setting.theme-and-components.md: a brand target matters only above the built-in floors.cli.md:astro devstops on the contrast errors too.troubleshooting.md:doctorprints the page count on success or with--json.architecture.md: Markdown copies are conditional, and "default sources" replaces "convention-mode".custom-components.md: the TypeScript ESLint entry is added beside the.js/.mjsentry, not used instead of it.Checks
check:developmentfails before the fix and passes after it, in both dev and build.--sourcesite created by the local creator and installed from freshly packed tarballs builds withdocs/components/StatusBadge.ts, with no workaround in itsastro.config.ts. The badge renders, and its CSS is extracted.prettier --checkandcookbook doctorwith fragment checks pass.check:themingandcheck:authoringrun in CI.Entropy
Slightly Decreased. Sites whose content lives outside their folder no longer need a per-site Vite workaround, and the documented component pattern works in every layout. The fix is one option in the layer that owns module resolution, with no new API or configuration.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Gr8S7DePcxFzSN3gkPVNcb