Skip to content

docs: fix the README's stale version line, code links and License link - #455

Merged
saeedjamshaid merged 4 commits into
devfrom
saeedjamshaid/readme-links
Oct 27, 2026
Merged

saeedjamshaid merged 4 commits into
devfrom
saeedjamshaid/readme-links

Conversation

@saeedjamshaid

@saeedjamshaid saeedjamshaid commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Follows up the oclif readme note in #453. Tracked in apimatic-io issue 2315.

The problem

The README, which npm shows on the package page, still carries 1.3.1:

  • The usage block shows apimatic --version printing @apimatic/cli/1.3.1.
  • The 13 "See code" links point at blob/v1.3.1/, the 1.x source of each command.
  • The License badge links blob/master/package.json, which is a 404: master holds the old Python CLI.

pnpm readme couldn't repair it. Since #453 it writes blob/v0.0.0-semantically-released/ links, and on the CRLF README it adds a second usage block and a second commands block instead of replacing them.

What changes

  • LF README. README.md is stored with LF endings, and a new .gitattributes keeps it LF on every checkout. The first commit is that conversion alone, so the Files tab shows the whole README as changed; the other commits have the real changes.
  • Links. oclif.repositoryPrefix in package.json makes pnpm readme link each command's source on dev, where every command exists. prepack now runs oclif readme too, so the README packed for npm links the release's own tag, which semantic-release pushes before it publishes. The plugin-autocomplete and plugin-help links still point at those plugins' own repositories.
  • Usage block. The version line and the <!-- usage --> markers go, so pnpm readme no longer rewrites the block.
  • License badge. It links blob/main/LICENSE.
  • The commands section is regenerated, which re-wraps two lines of the plugin generate description.

A docs: change makes no release, so npm shows this README from the next release.

Checked

  • README.md has no 1.3.1, no apimatic-cli/blob/v and no blob/master. All 13 linked files exist on dev, and LICENSE on main.
  • pnpm build && pnpm readme leaves the README unchanged, with one commands block and no usage block.
  • npm version 2.1.0 --no-git-tag-version && npm pack packs a README whose 13 links point at blob/v2.1.0/ and which otherwise matches the committed one; 2.1.0-beta.1 gives blob/v2.1.0-beta.1/. At the placeholder version, pnpm pack leaves the README unchanged.
  • With the platform faked as Linux and CI set, as in the release job, oclif manifest && oclif readme writes the committed README byte for byte.
  • A fresh clone checks the README out with LF under core.autocrlf true, false and input.

Open PRs that edit the README

Regenerating the README

Run pnpm readme after pnpm build, with colour on and COLUMNS unset; .ai/instructions.md now says so. Our command examples carry colour codes, so oclif leaves them as written. With colour off, every example gains a $ prefix. pnpm build also deletes any oclif.manifest.json, whose examples oclif readme would otherwise use.

🤖 Generated with Claude Code

saeedjamshaid and others added 2 commits October 26, 2026 16:55
oclif readme can't find its usage and commands blocks in a CRLF file, so it
added a second copy of each instead of replacing them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n line

oclif.repositoryPrefix makes `pnpm readme` link each command's source on main;
its default, blob/v<version>, now gives v0.0.0-semantically-released. The usage
block is no longer generated, so it loses the stale version line, and the
License badge now links LICENSE on main instead of a 404 on master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@mrafnadeem-apimatic mrafnadeem-apimatic 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.

The CRLF diagnosis and fix check out: after pnpm build && pnpm readme the README stays byte-identical, a core.autocrlf=true clone gets LF, all 13 linked files and LICENSE exist on main, and the merge notes for #438 and #445 hold. Two changes:

1. Link code by version. See the inline suggestion on repositoryPrefix; it also needs the prepack change, and the description's "Links" bullet would then name dev and the release tag instead of main.

2. Keep the regeneration rule in the repo. "Run pnpm readme with colour on" lives only in this description. With colour off, oclif prefixes all 28 example lines with $ : picocolors is always on under win32 unless NO_COLOR is set, but off on macOS/Linux without a TTY. With COLUMNS=80, 229 lines re-wrap. Suggested addition to the Common Commands block in .ai/instructions.md:

 # Format
 pnpm format            # Prettier write on src/**/*.{js,ts}
 
+# README
+pnpm readme            # after pnpm build; needs colour on (FORCE_COLOR=1 without a TTY, NO_COLOR unset) and COLUMNS unset
+
 # Test (all)

Comment thread package.json Outdated
saeedjamshaid and others added 2 commits October 27, 2026 17:42
…nce packed

The committed README links dev, where every command exists. prepack now
regenerates the README, so the one npm shows links the tag semantic-release
pushes before it publishes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@saeedjamshaid
saeedjamshaid merged commit dc3235a into dev Oct 27, 2026
12 checks passed
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