Skip to content

Package readme title per package; safe update.sh self-replacement - #8

Merged
vfofanov merged 5 commits into
mainfrom
feat/readme-title-and-update-fix
Oct 5, 2026
Merged

vfofanov merged 5 commits into
mainfrom
feat/readme-title-and-update-fix

Conversation

@vfofanov

@vfofanov vfofanov commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Two changes for v0.2.1.

  • MSKit_PackageReadmeTitle (default auto = PackageId): the readme generated from MSKit_PackageReadmeFrom replaces the first level-1 heading the package keeps (ATX or setext, never one in a fence, nuget:skip or another package's nuget:only) with # <PackageId>, or adds it as the first line. Empty keeps the README's heading. Same generator pass, still pack-only and incremental (the title is in the stamp).
  • update.sh self-replacement: the script is one brace group parsed before it runs, and copies the new update.sh / update.ps1 last. A copy of another length (CRLF checkout, older release) no longer stops it halfway with kit.json stale. update.ps1 was not affected (PowerShell parses the whole file).

Upgrading from 0.2.0

The first --version 0.2.1 run still executes 0.2.0's script: it installs the files, then stops with a syntax error before writing kit.json. Run the same command again.

Tests
  • tests/package-readme.sh: 25 title checks — per-package ids, empty and custom override, no H1, fenced H1, setext H1, nuget:skip / nuget:only headings, README unchanged. 13 fail on 0.2.0's generator.
  • tests/update-self.sh: a longer LF copy, a CRLF copy (where sh runs one) and update.ps1. 0.2.0's update.sh: the longer copy exits 0 with kit.json stale, the CRLF copy fails at line 214.

- Each package readme opens with its own PackageId; an empty
  MSKit_PackageReadmeTitle keeps the README heading
- READMEs without an H1, with an H1 in a fence, a setext H1, and
  headings inside nuget:skip / nuget:only blocks
MSKit_PackageReadmeTitle (default auto = PackageId) replaces the first
level-1 heading the package keeps, or adds one; empty keeps the
README's own heading.
Covers a longer LF copy, a CRLF copy where sh runs one, and update.ps1
when pwsh is present.
- Parse the whole script as one brace group before running it
- Copy the new update.sh / update.ps1 as the last step
- Changelog: Added MSKit_PackageReadmeTitle, Fixed update.sh
@vfofanov
vfofanov marked this pull request as ready for review October 5, 2026 18:54
@vfofanov
vfofanov merged commit aac0fb2 into main Oct 5, 2026
2 checks passed
@vfofanov
vfofanov deleted the feat/readme-title-and-update-fix branch October 5, 2026 19:48
@vfofanov vfofanov mentioned this pull request Oct 5, 2026
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.

1 participant