fix: navgraph auto-include, scaffold Callout API + publish-copy + version-const bump, release-workflow pre-push guard (0.1.1-alpha) - #21
Merged
Conversation
…output functionality for markdown files
…d folders, ensuring proper ordering of nodes
…d inclusion of markdown files
…lDocs, specifying changes in Directory.Build.props and InitCommand.cs
… package versions
…NavigationGraphBuilder, shelldocs init, and release workflow enhancements
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
First point-release after the dogfood smoke of
0.1.0-alpha. Three consumer-blocking fixes surfaced by the end-to-end install-and-scaffold test, plus release-workflow hardening so the "silently shipped a stale binary" class of failure can't recur.The fixes
1.
NavigationGraphBuilderauto-includes files/folders not inmeta.jsonSymptom:
shelldocs add component Buttonwrotecontent/docs/components/button.mdto disk, printed "created …" success, but/docs/components/button404'd and the page never appeared in the sidebar. Consumer had to hand-editmeta.jsonto unbrick the file they just scaffolded.Root cause:
src/ShellDocs.Core/NavigationGraphBuilder.cs:62-67—BuildFolderiteratedmeta.Pagesand returned only those resolved nodes. Any.mdfile or subfolder not referenced was silently dropped from the graph.Fix:
meta.jsonnow controls ordering of explicitly-listed items only; presence is driven by the file tree.BuildFoldertracks consumed slugs + folders while processing meta, then appends the leftovers alphabetically after the explicit ordering. Backward-compatible — consumers who list everything explicitly get their exact ordering verbatim before any auto-appended tail.4 new tests in
NavigationGraphBuilderTestscover: unreferenced.mdfile appended, unreferenced subfolder appended as section, alphabetical ordering of leftovers, explicit ordering preserved for meta-listed items.2.
shelldocs initscaffold uses the current<Callout>APISymptom:
content/docs/introduction.mdtemplate referenced aTextprop that doesn't exist on<Callout>. Firstdotnet runon a fresh scaffold rendered an empty callout — ugly first-impression.Fix: template updated to the current API —
<Callout Variant="info" Title="Live component">…body…</Callout>(non-self-closing, body renders asChildContent).3.
shelldocs initinserts Content Update itemgroup sodotnet publishcopies the markdownSymptom: CLI-scaffolded csproj had no
<Content Update="content/**/*.md" CopyToOutputDirectory="PreserveNewest" />.dotnet runworked (resolvesContentRootto source), butdotnet publishsilently omitted the markdown corpus — deployed sites had an emptyNavigationGraphand every/docs/*route 404'd.Fix: new
AddContentCopyIfMissing(csproj, changes)helper (mirrorsAddPackageIfMissing) inserts<Content Update="content/**/*.md;content/**/meta.json" CopyToOutputDirectory="PreserveNewest" />before</Project>. Idempotent — no-op if already present. Called fromScaffoldPackages, runs in both CREATE and ATTACH modes.4. CLI's hardcoded
ShellDocsVersionconst bumped to0.1.1-alphaSymptom (would have been):
shelldocs inithardcodes the package version it inserts as<PackageReference Include="ShellDocs.Components" Version="..." />. If we shipped0.1.1-alphaCLI still referencing0.1.0-alphapackages, every fresh scaffold would pull last version's packages — the new CLI's fixes would silently not reach consumers.Fix: const bumped alongside
Directory.Build.props.docs/RELEASING.mdstep 1 updated to call out this second bump explicitly so it doesn't drift again.Release-infrastructure harden
Release workflow pre-push existence check. New step queries
nuget.org/v3-flatcontainerfor each of the 6 package IDs at the tag's version before invokingdotnet nuget push. If any version already exists on nuget.org, the workflow fails loud with a "bumpDirectory.Build.propsand re-tag" message.--skip-duplicatestays in the push step (still useful for resuming a workflow re-run that partially completed), but the pre-check catches the "you forgot to bump the version number" case explicitly instead of silently no-op'ing.Docs
CHANGELOG.md—[0.1.1-alpha]entry documenting all four fixes + workflow hardendocs/RELEASING.md— step 1 amended: bumpInitCommand.ShellDocsVersionconst alongsideDirectory.Build.propsdocs/SHELLUI_DOGFOOD_FIXES.md— three entries moved from Open to Fixed with consistent branch attribution (first commit of this file to git — was previously working-tree-only across sessions)docs/SHELLUI_ICONS.md— first commit of the design proposal to git (same story as the dogfood file)Test plan
dotnet build shelldocs.slnx— clean, 0 warnings, 0 errorsdotnet test shelldocs.slnx— 143 / 143 passing (+4 newNavigationGraphBuildertests)bash scripts/pack-dry-run.sh— all six packages produce0.1.1-alphacleanlyshelldocs-branch-previewNuGet sourcedotnet tool install -g ShellDocs.CLI --version 0.1.1-alphafrom the branch feedshelldocs init MySmokeDocsin scratch dirShellDocs.Components 0.1.1-alpha+ShellDocs.Tokens 0.1.1-alpha+ Content Update itemgroup present +introduction.mduses new Callout APIshelldocs add component Button+shelldocs add guide getting-started→ files created, meta.json untouchedshelldocs dev --port 5100starts cleanlyGET /,GET /docs/introduction,GET /docs/components/button,GET /docs/guides/getting-started→ all 200 OK, sidebar auto-shows Introduction + Components section + Guides section — nometa.jsonedits required (the primary fix)0.1.0-alphaFiles touched
src/ShellDocs.Core/NavigationGraphBuilder.cs—BuildFolderauto-appends unreferenced files/folders;ResolveEntrysignature extended with consumed-slug/folder tracking setssrc/ShellDocs.CLI/Commands/InitCommand.cs—ShellDocsVersionconst bumped t