Skip to content

Fix PostCSS auto-discovery, dotenv fences, workspace clobbering, and scaffold skip#12

Merged
matejstastny merged 3 commits into
mainfrom
fix/init-and-astro-config-bugs
Jul 17, 2026
Merged

Fix PostCSS auto-discovery, dotenv fences, workspace clobbering, and scaffold skip#12
matejstastny merged 3 commits into
mainfrom
fix/init-and-astro-config-bugs

Conversation

@matejstastny

@matejstastny matejstastny commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

Fixes of random selection of bugs.

  • PostCSS/Vite auto-discovery: the generated astro.config.mjs didn't set vite.css.postcss, so Vite's file-based PostCSS discovery climbed the filesystem and could pick up a postcss.config.* from the consuming repo's root (common for repos using Tailwind/shadcn). Now hardcoded to { plugins: [] }.
  • env code fences: Shiki bundles a dotenv grammar but doesn't recognize the env tag people actually write in docs, silently falling back to plain text. Added a langAlias so ```env fences highlight.
  • Advanced escape hatch: added an optional advanced.starlight / advanced.vite field to docs.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.sh clobbering pnpm-workspace.yaml: it unconditionally overwrote the file via cat >, wiping any existing allowBuilds/minimumReleaseAgeExclude. Now warns and skips if the file already exists, matching the existing package.json handling.
  • All-or-nothing scaffold skip: if docs/ or docs.config.ts already existed, init.sh skipped scaffolding with no path forward. Added a --force flag to trickfire-docs init that scaffolds anyway (merging into what's there), and init.sh's warning now points to it.

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.
@matejstastny matejstastny self-assigned this Jul 17, 2026
@matejstastny matejstastny added bug Something isn't working enhancement New feature or request labels Jul 17, 2026
@matejstastny
matejstastny merged commit 96c2b9c into main Jul 17, 2026
2 checks passed
@matejstastny
matejstastny deleted the fix/init-and-astro-config-bugs branch July 17, 2026 00:36
@trickfirebot

trickfirebot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant