Skip to content

chore: shellui theme init + README coverage for tweakcn command#24

Merged
Shewart merged 2 commits into
mainfrom
chore/tweakcn-followups
Jul 3, 2026
Merged

chore: shellui theme init + README coverage for tweakcn command#24
Shewart merged 2 commits into
mainfrom
chore/tweakcn-followups

Conversation

@Shewart

@Shewart Shewart commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #23 (tweakcn theme import). Closes the last three items on issue #21.

What ships

1. shellui theme init <url> — one-shot init + apply

Combined command for greenfield setup. Runs InitService.InitializeAsync (Tailwind CLI download, App.razor patch, input.css, shellui.json, MSBuild wiring) then chains into ApplyThemeAsync — so a fresh project goes from empty to fully themed in one command:

dotnet shellui theme init https://tweakcn.com/themes/<id> --yes

Accepts the same options as init: --force, --style, --tailwind, --yes. Console output is two labelled steps so users can see which phase they're in if something fails.

Fits alongside the existing theme apply (existing project) and theme update (refresh from lock) — the full CLI surface is now:

shellui theme init <url>                                # fresh project — init + apply
shellui theme apply <url>                               # existing project — write to input.css
shellui theme apply <url> --emit-override <path>        # Path A/D — standalone override CSS
shellui theme update                                    # re-fetch from shellui.theme.lock

2. README coverage across all install-path docs

Three READMEs now cover the tweakcn workflow with concrete commands per install path:

README Change
Top-level README.md New "Using tweakcn themes with shellui theme" section before "Theming across paths". Existing table extended with an "Auto-import from tweakcn" column showing the exact command for each path.
src/ShellUI.CLI/README.md Quick Start shows the theme init one-shot alternative alongside plain init. New theme commands section covers all three subcommands + lock file semantics.
src/ShellUI.Components/README.md Path A trade-off block now shows --emit-override as the recommended override workflow. Path B shows theme apply as the tweakcn auto-import path. Path C Quick Start includes the theme init one-shot. Bottom "Theme Customization" section rewritten to lead with the CLI, keep the manual paste as fallback.

3. path-c-cli-tweakcn/ demo — verified locally, not committed

The shellui-installation-tests/ directory is gitignored (per its README). Rather than land a fifth test project there that won't merge, I verified the flow end-to-end in a scratchpad:

  • dotnet new blazor -n TestApp
  • shellui theme init https://tweakcn.com/themes/cmgy5f2vg000504l42pep9ob1 --yes
  • Step 1/2 (init) — Tailwind CLI downloaded, App.razor patched, input.css + app.css + tailwind.config.js + shellui.json + Build/ShellUI.targets created
  • Step 2/2 (apply) — theme fetched (53 light + 52 dark vars = 128 oklch values in output), sentinel-marked block written to input.css, shellui.theme.lock written with correct SHA-256
  • dotnet build succeeds; Tailwind rebuilds; components render with the tweakcn theme

Issue #21 status

All checkboxes now green:

Item PR Status
shellui theme apply <url> #23
shellui theme apply <url> --emit-override <path> #23
shellui theme update #23
shellui.theme.lock #23
shellui theme init <url> this PR
Install-path READMEs with theme-apply examples this PR ✅ (three READMEs updated; per-path READMEs under shellui-installation-tests/ are gitignored, so the user-visible surface is top-level + package READMEs)
Test project path-c-cli-tweakcn/ — end-to-end demo this PR ✅ (verified locally; not committed since the parent dir is gitignored)

Files

File Change
src/ShellUI.CLI/Program.cs +40 — CreateThemeInitCommand + registration under theme
README.md +47 −5 — new "Using tweakcn themes" section + expanded theming table
src/ShellUI.CLI/README.md +28 −1 — theme init in Quick Start + theme subcommand section
src/ShellUI.Components/README.md +42 −5 — tweakcn command references across Paths A/B/C + rewritten Theme Customization block

Net: +143 −14 across 4 files. No behavior change to init, apply, or update; no new tests needed (composition of two already-tested functions, smoke-tested end-to-end).

Test plan

  • dotnet test — 76/76 green (unchanged; no new test surface)
  • dotnet shellui theme --help — lists init, apply, update
  • dotnet shellui theme init --help — shows <url> arg + --force / --style / --tailwind / --yes options
  • End-to-end in scratchpad dotnet new blazor project — both steps complete, input.css contains @import "tailwindcss" + BEGIN/END sentinel + 128 oklch vars, shellui.theme.lock written
  • Re-run theme init twice — second run is idempotent within the sentinel region

Shewart added 2 commits July 3, 2026 22:25
Introduces a new `theme init` command that initializes ShellUI in a fresh Blazor project while applying a tweakcn theme in a single step. The command accepts various options for customization, including URL, style, and Tailwind method, enhancing user experience and simplifying theme integration. This addition complements existing theme management commands, providing a more comprehensive CLI interface for users.
…integration

Expanded the README files to include comprehensive instructions on using the `shellui theme` commands for integrating tweakcn themes. Added examples for initializing a project with a theme, applying themes to existing projects, and generating standalone override CSS. Clarified the idempotent nature of theme application and how themes are recorded in `shellui.theme.lock`, improving user guidance on theme management.
Copilot AI review requested due to automatic review settings July 3, 2026 20:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Shewart Shewart merged commit 64dca24 into main Jul 3, 2026
1 check passed
@Shewart Shewart deleted the chore/tweakcn-followups branch July 3, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants