Fix PostCSS auto-discovery, dotenv fences, workspace clobbering, and scaffold skip#12
Merged
Merged
Conversation
init.sh unconditionally overwrote pnpm-workspace.yaml, wiping out any allowBuilds/minimumReleaseAgeExclude a repo already had configured. Warn and skip instead, matching the existing package.json handling.
Previously, if docs/ or docs.config.ts already existed (e.g. a repo adopting this framework after already having hand-written docs), init skipped scaffolding entirely with no path forward but manual setup. `trickfire-docs init --force` now scaffolds anyway, merging the starter docs/ into what's there; init.sh points to it in its warning.
- Set vite.css.postcss explicitly so Vite's file-based PostCSS auto-discovery doesn't climb the filesystem and pick up whatever postcss.config.* the consuming repo happens to have at its root (e.g. for its own Tailwind/shadcn setup) - this framework's own styles never need one. - Alias the ```env code fence language to Shiki's bundled "dotenv" grammar, which it doesn't recognize under that name by default and was silently falling back to plain text. - Add a JSON-serializable `advanced.starlight` / `advanced.vite` field to docs.config.ts, deep-merged into the generated config, so consumers needing one more Starlight/Vite option don't have to fork or patch this package.
|
🎉 This PR is included in version 1.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
Fixes of random selection of bugs.
astro.config.mjsdidn't setvite.css.postcss, so Vite's file-based PostCSS discovery climbed the filesystem and could pick up apostcss.config.*from the consuming repo's root (common for repos using Tailwind/shadcn). Now hardcoded to{ plugins: [] }.envcode fences: Shiki bundles adotenvgrammar but doesn't recognize theenvtag people actually write in docs, silently falling back to plain text. Added alangAliasso ```env fences highlight.advanced.starlight/advanced.vitefield todocs.config.ts, deep-merged into the generated config, so a consumer needing one more Starlight/Vite option doesn't have to fork/patch this package. (Values must be JSON-serializable - functions/plugin instances can't cross into the generated config file, which is a real limitation but was out of scope to solve here.)init.shclobberingpnpm-workspace.yaml: it unconditionally overwrote the file viacat >, wiping any existingallowBuilds/minimumReleaseAgeExclude. Now warns and skips if the file already exists, matching the existingpackage.jsonhandling.docs/ordocs.config.tsalready existed,init.shskipped scaffolding with no path forward. Added a--forceflag totrickfire-docs initthat scaffolds anyway (merging into what's there), andinit.sh's warning now points to it.