Skip to content

Stephansama/ste 190 add badge action to auto readme for auto generating package#280

Merged
stephansama merged 15 commits into
mainfrom
stephansama/ste-190-add-badge-action-to-auto-readme-for-auto-generating-package
May 16, 2026
Merged

Stephansama/ste 190 add badge action to auto readme for auto generating package#280
stephansama merged 15 commits into
mainfrom
stephansama/ste-190-add-badge-action-to-auto-readme-for-auto-generating-package

Conversation

@stephansama
Copy link
Copy Markdown
Owner

Checklist

  • Latest changes from main have been merged
  • Conflicts have been resolved
  • The branch is pointing to main
  • Eslint hasn't reported any issues.
  • All unit tests pass

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 16, 2026

🦋 Changeset detected

Latest commit: b6f0a14

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 25 packages
Name Type
@stephansama/auto-readme Minor
@stephansama/catppuccin-jsonresume-theme Patch
@stephansama/prettier-plugin-handlebars Patch
@stephansama/svelte-social-share-links Patch
@stephansama/types-github-action-env Patch
@stephansama/find-makefile-targets Patch
@stephansama/astro-iconify-svgmap Patch
@stephansama/catppuccin-typedoc Patch
@stephansama/remark-asciinema Patch
@stephansama/typed-nocodb-api Patch
@stephansama/catppuccin-opml Patch
@stephansama/typed-templates Patch
@stephansama/alfred-kaomoji Patch
@stephansama/catppuccin-rss Patch
@stephansama/catppuccin-xsl Patch
@stephansama/ai-commit-msg Patch
@stephansama/eslint-config Patch
@stephansama/multipublish Patch
@stephansama/typed-events Patch
@stephansama/single-file Patch
@stephansama/github-env Patch
@stephansama/pnpm-hooks Patch
@stephansama/types-lhci Patch
@stephansama/typed-env Patch
create-stephansama-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
packages Ready Ready Preview, Comment May 16, 2026 5:41pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

Review Change Stack

Warning

Rate limit exceeded

@stephansama has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 32 minutes and 47 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 41c6ed32-4339-4f46-8039-f412257534a5

📥 Commits

Reviewing files that changed from the base of the PR and between 1b402e0 and b6f0a14.

📒 Files selected for processing (5)
  • .github/workflows/release.yml
  • core/auto-readme/src/icon.test.ts
  • core/auto-readme/src/pipeline.test.ts
  • core/auto-readme/src/plugin.test.ts
  • scripts/src/prepare-local.ts
📝 Walkthrough

Walkthrough

This pull request introduces badge generation support to @stephansama/auto-readme with catalog-aware version resolution, icon color extraction, and shield badge rendering. It updates workspace dependencies, refreshes README badges across the monorepo packages, configures typed-env for API snapshot generation, and adds new package documentation.

Changes

Badge Generation Feature

Layer / File(s) Summary
Badge schema and type definitions
core/auto-readme/src/schema.ts, core/auto-readme/__snapshots__/tsnapi/schema.snapshot.*
BADGE action added to actionsSchema enum; badgeDependencyTypeOptionsSchema and badgeTemplateSchema introduced for badge config; default table headings and registry template URL (npmx.dev) extended.
Icon slug and color extraction
core/auto-readme/src/icon.ts, core/auto-readme/src/color.ts, core/auto-readme/src/icon.test.ts
createSlugName() maps icon names to Simple Icons slugs with alternate name rewrites and normalization; getSimpleIconColor() retrieves hex values from simple-icons or hard-coded overrides; getContrastText() selects white or black text for A11y contrast. Tests cover slug mapping, color resolution, and unknown packages.
Catalog loading and version resolution
core/auto-readme/src/utilities.ts
loadCatalogs() reads YAML/JSON catalogs from monorepo root; resolveVersion() replaces catalog:-prefixed versions via loaded catalogs with fallback to defaults. Supports pnpm-workspace.yaml and root package.json catalog sources.
Data layer BADGE action support
core/auto-readme/src/data.ts
BADGE and PKG actions merged to shared code path that calls loadCatalogs() and returns loaded catalogs in action payload.
Plugin BADGE zone handler
core/auto-readme/src/plugin.ts
New BADGE zone handler parses --skip-templates flag, resolves dependency types, compiles Handlebars templates, generates shield badge URLs with icon colors and contrast helpers, converts markdown to mdast AST.
Plugin and pipeline test coverage
core/auto-readme/src/plugin.test.ts, core/auto-readme/src/pipeline.test.ts
Comprehensive tests for BADGE zone rendering, template compilation, and skipping; validates ACTION/PKG/WORKSPACE/ZOD zones; pipeline tests verify conditional plugin registration based on config flags and file existence.

Dependencies & Configuration

Layer / File(s) Summary
Workspace catalogs and package dependencies
core/auto-readme/package.json, pnpm-workspace.yaml
Adds colord, simple-icons, @manypkg/find-root, local-pkg to auto-readme. Pins workspace catalog entries for colord (2.9.3), simple-icons (16.19.0), and pnpm packages to exact versions.
typed-env API snapshot and export configuration
core/typed-env/package.json, core/typed-env/tsdown.config.ts, core/typed-env/__snapshots__/tsnapi/*
Enables tsnapi/rolldown ApiSnapshot plugin; changes attw to esm-only profile; simplifies exports to single ESM entry; generates snapshot declarations for createEnvironment with full type signatures.

Documentation & README Updates

Layer / File(s) Summary
Badge template configuration
.config/autoreadmerc.json
Adds badgeOptions.templates with Handlebars-templated shields for GitHub source, documentation, npm, socket.dev, JSR, and downloads.
Root README and auto-readme documentation
README.md, core/auto-readme/README.md
Updates root README with new badge block markers and tooling shields; extends auto-readme README with BADGE section and embedded Zod schema documentation showing new BADGE action and badgeOptions.
Package badge sections
core/*/README.md (20+ packages)
Refreshes badge sections in ai-commit-msg, alfred-kaomoji, astro-iconify-svgmap, catppuccin packages, eslint-config, find-makefile-targets, github-env, multipublish, pnpm-hooks, typed-env, svelte-social-share-links, typed-templates, typed-events, typed-nocodb-api, types packages with BADGE markers and updated version shields.
typed-env usage example and single-file badges
core/typed-env/README.md, core/single-file/README.md
Updates typed-env Usage import from dist path to package entry; adds version badges to single-file README.
New package documentation
core/prettier-plugin-handlebars/README.md, core/remark-asciinema/README.md
Adds complete READMEs for prettier-plugin-handlebars (with installation and configuration) and remark-asciinema (with embed modes and UNPKG player setup).
Example imports and miscellaneous updates
core/prettier-plugin-handlebars/example/index.js, core/remark-asciinema/example/index.js, core/typed-templates/src/map.ts, .config/.cspell.json
Switches example imports to CommonJS builds; fixes TypeScript typing for Handlebars.compile generic; adds spell-check entries for picospinner and smol.

Release Metadata

Layer / File(s) Summary
Release changeset entries
.changeset/hip-lemons-join.md
Specifies package bump versions (minor for auto-readme, patch for others) and release note describing badge implementation update.

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly Related PRs

  • stephansama/packages#261: Modifies core/auto-readme heading/table generation in plugin.ts and schema.ts (defaultTableHeadings, WORKSPACE zone), which overlap with this PR's schema and plugin updates.
  • stephansama/packages#272: Enables tsnapi snapshot generation for auto-readme public API snapshots; this PR updates those snapshots with new BADGE schema exports.
  • stephansama/packages#222: Switches npm-related README badge links to npmx.dev, directly aligned with this PR's updates to badge template registryUrl default and many README badge URLs.

🐰 Badges shine bright, catalogs align so right,
Auto-readme glows with icons in flight!
Shield by shield, the monorepo's delight,
Colors that contrast, versions that bite. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.88% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title references adding a badge action to auto-readme, which aligns with the substantial changes to badge generation and README updates across the codebase.
Description check ✅ Passed The PR description matches the provided template with all required checklist items completed, though it lacks specific details about the badge feature implementation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch stephansama/ste-190-add-badge-action-to-auto-readme-for-auto-generating-package

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new BADGE action to the auto-readme utility, enabling the automatic generation of dependency badges in README files. The implementation includes new modules for color contrast calculation, icon mapping using simple-icons, and support for resolving versions from workspace catalogs. Review feedback highlights several areas for improvement: addressing a potential crash in the badge zone logic due to strict comment parsing, removing a debug console.log, and fixing broken badge URLs by correctly escaping special characters for Shields.io. Suggestions were also provided to use more idiomatic TypeScript for icon lookups, implement safer JSON parsing for package files, and refine the markdown output formatting.

Comment thread core/auto-readme/src/plugin.ts Outdated
Comment thread core/auto-readme/src/data.ts Outdated
Comment thread core/auto-readme/src/icon.ts
Comment thread core/auto-readme/src/plugin.ts Outdated
Comment thread core/auto-readme/src/plugin.ts Outdated

const rootJsonPath = path.join(rootDir, "package.json");
const rootJsonFile = await fs.promises.readFile(rootJsonPath, "utf8");
const rootPackageJson = JSON.parse(rootJsonFile) as BunWorkspace;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

JSON.parse can throw an error if the package.json file is empty or malformed. Consider wrapping this in a try-catch block or using a safer parsing utility to prevent the tool from crashing.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

❌ Patch coverage is 61.97183% with 27 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
core/auto-readme/src/utilities.ts 0.00% 20 Missing ⚠️
core/auto-readme/src/color.ts 0.00% 5 Missing ⚠️
core/auto-readme/src/data.ts 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 16, 2026

Open in StackBlitz

@stephansama/ai-commit-msg

pnpm add https://pkg.pr.new/@stephansama/ai-commit-msg@280

@stephansama/alfred-kaomoji

pnpm add https://pkg.pr.new/@stephansama/alfred-kaomoji@280

@stephansama/astro-iconify-svgmap

pnpm add https://pkg.pr.new/@stephansama/astro-iconify-svgmap@280

@stephansama/auto-readme

pnpm add https://pkg.pr.new/@stephansama/auto-readme@280

@stephansama/catppuccin-jsonresume-theme

pnpm add https://pkg.pr.new/@stephansama/catppuccin-jsonresume-theme@280

@stephansama/catppuccin-opml

pnpm add https://pkg.pr.new/@stephansama/catppuccin-opml@280

@stephansama/catppuccin-rss

pnpm add https://pkg.pr.new/@stephansama/catppuccin-rss@280

@stephansama/catppuccin-typedoc

pnpm add https://pkg.pr.new/@stephansama/catppuccin-typedoc@280

@stephansama/catppuccin-xsl

pnpm add https://pkg.pr.new/@stephansama/catppuccin-xsl@280

@stephansama/eslint-config

pnpm add https://pkg.pr.new/@stephansama/eslint-config@280

create-stephansama-example

pnpm add https://pkg.pr.new/create-stephansama-example@280

@stephansama/find-makefile-targets

pnpm add https://pkg.pr.new/@stephansama/find-makefile-targets@280

@stephansama/github-env

pnpm add https://pkg.pr.new/@stephansama/github-env@280

@stephansama/multipublish

pnpm add https://pkg.pr.new/@stephansama/multipublish@280

@stephansama/pnpm-hooks

pnpm add https://pkg.pr.new/@stephansama/pnpm-hooks@280

@stephansama/prettier-plugin-handlebars

pnpm add https://pkg.pr.new/@stephansama/prettier-plugin-handlebars@280

@stephansama/remark-asciinema

pnpm add https://pkg.pr.new/@stephansama/remark-asciinema@280

@stephansama/single-file

pnpm add https://pkg.pr.new/@stephansama/single-file@280

@stephansama/svelte-social-share-links

pnpm add https://pkg.pr.new/@stephansama/svelte-social-share-links@280

@stephansama/typed-env

pnpm add https://pkg.pr.new/@stephansama/typed-env@280

@stephansama/typed-events

pnpm add https://pkg.pr.new/@stephansama/typed-events@280

@stephansama/typed-nocodb-api

pnpm add https://pkg.pr.new/@stephansama/typed-nocodb-api@280

@stephansama/typed-templates

pnpm add https://pkg.pr.new/@stephansama/typed-templates@280

@stephansama/types-github-action-env

pnpm add https://pkg.pr.new/@stephansama/types-github-action-env@280

@stephansama/types-lhci

pnpm add https://pkg.pr.new/@stephansama/types-lhci@280

commit: b6f0a14

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/auto-readme/src/data.ts`:
- Line 61: Remove the noisy stdout debug logging by deleting the
console.log(catalogs) call in data.ts (the code path that runs while loading
BADGE/PKG actions and handling the catalogs variable); instead, if you need
retained visibility for debugging, replace it with a proper logger at
debug/trace level (using the existing logger instance) or guard it behind a
verbose/debug flag so CLI output remains clean. Ensure no other direct console.*
calls remain in the action-loading logic.

In `@core/auto-readme/src/plugin.ts`:
- Around line 105-112: The badge URL breaks with special characters because
badgeKey only replaces the first underscore and the version (from
resolveVersion) and other segments are not URL-escaped; update the badge
construction so badgeKey uses replaceAll for both "-" and "_" (e.g., badgeKey =
key.replaceAll("-", "--").replaceAll("_", "__")) and then URL-encode all
interpolated segments when building imageUrl (encode the resolved version from
resolveVersion(...), badgeKey, slug, contrastText and color/labelColor) so
scoped package names, slashes and other special chars are safely escaped before
forming imageUrl.

In `@core/prettier-plugin-handlebars/README.md`:
- Around line 40-41: The README usage example imports the built artifact with a
relative path; update the import to use the package name instead (replace the
"../dist/index.mjs" import in the example with the published package import,
e.g., import prettierPluginHandlebars from "prettier-plugin-handlebars") so
consumers import from the package rather than a local build artifact.

In `@core/remark-asciinema/README.md`:
- Around line 58-61: The README usage example is importing the built artifact
via a relative path; update the import statement that currently reads import
asciinema from "../dist/index.mjs" to import asciinema from "remark-asciinema"
(i.e., the package name) so consumers import the published package rather than
an internal build artifact.
- Around line 74-77: Update the pinned asciinema-player version in the README
where it references asciinema-player@3.9.0 (the two UNPKG URLs for
asciinema-player.css and asciinema-player.min.js); replace the version with
`@3.15.1` or with the looser `@3` tag so the links become either
asciinema-player@3.15.1/... or asciinema-player@3/... to ensure the docs point
to the latest/minor-compatible release.

In `@core/types-github-action-env/README.md`:
- Around line 5-8: Remove the empty HTML BADGE comment block in README.md (the
"<!-- BADGE start -->" / "<!-- BADGE end -->" lines) to eliminate the
unnecessary blank lines in the header; if badges are needed later, replace this
empty block with the actual badge markdown instead of leaving an empty comment
block.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3f3f1296-b150-472d-9c93-b928bcbfe658

📥 Commits

Reviewing files that changed from the base of the PR and between f3ae4e2 and 4d32988.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (30)
  • .config/.cspell.json
  • .config/www/README.md
  • README.md
  • core/ai-commit-msg/README.md
  • core/astro-iconify-svgmap/README.md
  • core/auto-readme/README.md
  • core/auto-readme/__snapshots__/tsnapi/schema.snapshot.d.ts
  • core/auto-readme/__snapshots__/tsnapi/schema.snapshot.js
  • core/auto-readme/package.json
  • core/auto-readme/src/color.ts
  • core/auto-readme/src/data.ts
  • core/auto-readme/src/icon.ts
  • core/auto-readme/src/plugin.ts
  • core/auto-readme/src/schema.ts
  • core/auto-readme/src/utilities.ts
  • core/catppuccin-xsl/README.md
  • core/eslint-config/README.md
  • core/example/README.md
  • core/prettier-plugin-handlebars/README.md
  • core/remark-asciinema/README.md
  • core/single-file/README.md
  • core/svelte-social-share-links/README.md
  • core/typed-env/README.md
  • core/typed-events/README.md
  • core/typed-nocodb-api/README.md
  • core/typed-templates/README.md
  • core/typed-templates/src/map.ts
  • core/types-github-action-env/README.md
  • core/types-lhci/README.md
  • pnpm-workspace.yaml

Comment thread core/auto-readme/src/data.ts Outdated
Comment thread core/auto-readme/src/plugin.ts Outdated
Comment thread core/prettier-plugin-handlebars/README.md Outdated
Comment thread core/remark-asciinema/README.md Outdated
Comment on lines +74 to +77
**Note**: After integrating the Remark plugin, ensure you include the necessary asciinema JavaScript and CSS files to enable proper playback and styling. You can load them via [UNPKG](https://unpkg.com/):

- <https://unpkg.com/asciinema-player@3.9.0/dist/bundle/asciinema-player.css>
- <https://unpkg.com/asciinema-player@3.9.0/dist/bundle/asciinema-player.min.js>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial | 💤 Low value

🧩 Analysis chain

🌐 Web query:

What is the latest version of asciinema-player?

💡 Result:

The latest version of asciinema-player is v3.15.1, which was released on February 27, 2026 [1].

Citations:


Update asciinema-player version to the latest release.

The documentation pins asciinema-player to version 3.9.0, but the latest version is v3.15.1 (released February 27, 2026). Update the UNPKG URLs to use @3.15.1 or consider using @3 to automatically receive patch and minor updates:

  • https://unpkg.com/asciinema-player@3.15.1/dist/bundle/asciinema-player.css
  • https://unpkg.com/asciinema-player@3.15.1/dist/bundle/asciinema-player.min.js
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/remark-asciinema/README.md` around lines 74 - 77, Update the pinned
asciinema-player version in the README where it references
asciinema-player@3.9.0 (the two UNPKG URLs for asciinema-player.css and
asciinema-player.min.js); replace the version with `@3.15.1` or with the looser `@3`
tag so the links become either asciinema-player@3.15.1/... or
asciinema-player@3/... to ensure the docs point to the latest/minor-compatible
release.

Comment thread core/types-github-action-env/README.md
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

♻️ Duplicate comments (1)
core/prettier-plugin-handlebars/README.md (1)

23-23: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix heading-level jump to satisfy markdownlint.

##### skips levels after the H1 title and triggers MD001. Use ## (or ###) here.

Suggested fix
-##### Table of contents
+## Table of contents
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/prettier-plugin-handlebars/README.md` at line 23, The heading "#####
Table of contents" jumps levels after the H1 and triggers markdownlint MD001;
fix it by changing that heading to a lower-level heading (e.g., replace "#####
Table of contents" with "## Table of contents" or "### Table of contents") so it
follows the H1 properly, then save the README.md and re-run markdownlint to
confirm the warning is resolved.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.config/autoreadmerc.json:
- Line 8: The "url" template is producing double slashes because the placeholder
unscoped_name can include a leading slash; update the template so unscoped_name
is normalized before interpolation (strip any leading slashes or whitespace) to
avoid core//<package> paths. Locate the "url" entry and replace the raw
"{{unscoped_name}}" usage with a normalized variant (use the template engine's
trim/replace helper or a small pre-processing step that applies something like
removeLeadingSlashes/unscoped_name.replace(/^\/+/, '')), ensuring the final
string becomes
"https://github.com/stephansama/packages/tree/main/core/{{normalized_unscoped_name}}".

In `@core/ai-commit-msg/README.md`:
- Around line 5-22: Remove the duplicated legacy badge list so only the
generated badge block remains: keep the entire generated badges between the <!--
BADGE start --> and <!-- BADGE end --> markers and delete the older static badge
list that appears elsewhere in the README (the secondary badge list following
the generated block) to avoid rendering badges twice.

In `@core/astro-iconify-svgmap/README.md`:
- Line 7: Update the badge URL in README.md to remove the duplicated slash in
the repository path: replace the string "core//astro-iconify-svgmap" with
"core/astro-iconify-svgmap" in the Markdown badge link so the Source badge
points to the normalized GitHub path.

In `@core/auto-readme/README.md`:
- Line 7: The badge URL generation in the auto-readme template is creating a
double slash before the package name; fix the template logic (e.g., in the badge
template used by generateReadme / renderBadge or the template file that builds
the GitHub badge URL) so path segments are joined without introducing an extra
"/"—either trim any leading "/" from the package name variable (e.g.,
packageName) or use a safe join function when interpolating into the URL (ensure
the template that emits
"https://github.com/stephansama/packages/tree/main/core/{{packageName}}" never
results in "core//..."). Ensure the change is made in the central
template/function that generates badges so all README files regenerate
correctly.

In `@core/catppuccin-jsonresume-theme/README.md`:
- Line 7: The badge link in README.md contains a double slash in the repository
path ("core//catppuccin-jsonresume-theme"); update the markdown link target so
the path is normalized to a single slash ("core/catppuccin-jsonresume-theme") in
the badge URL (the line starting with [![source
code](https://img.shields.io/badge/Source...)]) to ensure the generated link is
correct.

In `@core/example/README.md`:
- Line 7: The README badge currently links to the wrong repository directory;
update the markdown link target in the badge line (the line that starts with
[![source code](...)](...) ) to point to the actual directory for this README
(change the URL from .../tree/main/core/create-stephansama-example to
.../tree/main/core/example), preserving the badge image URL and label text.

In `@core/typed-events/README.md`:
- Line 7: The README badge URL contains a malformed path with a double slash
("core//typed-events"); update the badge link in README.md by normalizing the
path to a single slash ("core/typed-events") so the href and image reference use
"https://github.com/stephansama/packages/tree/main/core/typed-events".

---

Duplicate comments:
In `@core/prettier-plugin-handlebars/README.md`:
- Line 23: The heading "##### Table of contents" jumps levels after the H1 and
triggers markdownlint MD001; fix it by changing that heading to a lower-level
heading (e.g., replace "##### Table of contents" with "## Table of contents" or
"### Table of contents") so it follows the H1 properly, then save the README.md
and re-run markdownlint to confirm the warning is resolved.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 17304010-a668-4edb-99e8-479e0f3d346a

📥 Commits

Reviewing files that changed from the base of the PR and between 4d32988 and b110e0b.

📒 Files selected for processing (33)
  • .config/autoreadmerc.json
  • README.md
  • core/ai-commit-msg/README.md
  • core/alfred-kaomoji/README.md
  • core/astro-iconify-svgmap/README.md
  • core/auto-readme/README.md
  • core/auto-readme/__snapshots__/tsnapi/schema.snapshot.d.ts
  • core/auto-readme/src/data.ts
  • core/auto-readme/src/icon.ts
  • core/auto-readme/src/plugin.ts
  • core/auto-readme/src/schema.ts
  • core/catppuccin-jsonresume-theme/README.md
  • core/catppuccin-opml/README.md
  • core/catppuccin-rss/README.md
  • core/catppuccin-typedoc/README.md
  • core/catppuccin-xsl/README.md
  • core/eslint-config/README.md
  • core/eslint-config/example/remark-usage-example-f53juete64xnd32naai-5.js
  • core/example/README.md
  • core/find-makefile-targets/README.md
  • core/github-env/README.md
  • core/multipublish/README.md
  • core/pnpm-hooks/README.md
  • core/prettier-plugin-handlebars/README.md
  • core/remark-asciinema/README.md
  • core/single-file/README.md
  • core/svelte-social-share-links/README.md
  • core/typed-env/README.md
  • core/typed-events/README.md
  • core/typed-nocodb-api/README.md
  • core/typed-templates/README.md
  • core/types-github-action-env/README.md
  • core/types-lhci/README.md

Comment thread .config/autoreadmerc.json
Comment thread core/ai-commit-msg/README.md
Comment thread core/astro-iconify-svgmap/README.md Outdated
Comment thread core/auto-readme/README.md Outdated
Comment thread core/catppuccin-jsonresume-theme/README.md Outdated
Comment thread core/example/README.md
Comment thread core/typed-events/README.md Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (2)
core/remark-asciinema/README.md (1)

76-77: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update pinned asciinema-player CDN version in docs.

These links are pinned to 3.9.0; this is likely stale and should be bumped (or switched to @3) to avoid documenting outdated assets.

What is the latest stable release of `asciinema-player`, and what are the recommended UNPKG URLs for its CSS and JS bundle?
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/remark-asciinema/README.md` around lines 76 - 77, Replace the pinned
asciinema-player@3.9.0 CDN links in README.md (the two lines containing
"asciinema-player@3.9.0/dist/bundle/asciinema-player.css" and
"asciinema-player@3.9.0/dist/bundle/asciinema-player.min.js") with either a
non-pinned major tag to stay current (use `@3`) or with the project's latest
stable release; the recommended UNPKG URL patterns are:
https://unpkg.com/asciinema-player@3/dist/bundle/asciinema-player.css and
https://unpkg.com/asciinema-player@3/dist/bundle/asciinema-player.min.js (or
replace `@3` with the explicit latest version string if you prefer a pinned
release).
core/auto-readme/src/plugin.ts (1)

131-142: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Escape badge URL path/query parts before interpolation.

Line 135 builds Shields URL parts from raw values. Scoped names (@scope/pkg) and special characters in resolved versions can break the badge URL and render invalid badges. This is the same root issue previously raised and is still present.

Suggested fix
 				const contrastText = getContrastText(color);
-				const linkUrl = `https://npmx.dev/package/${key}`;
-				const badgeKey = key
-					.replaceAll("-", "--")
-					.replaceAll("_", "__");
-				const imageUrl = `https://img.shields.io/badge/${badgeKey}-${resolveVersion(
+				const linkUrl = `https://npmx.dev/package/${encodeURIComponent(key)}`;
+				const escapeBadgePart = (value: string) =>
+					encodeURIComponent(value)
+						.replaceAll("-", "--")
+						.replaceAll("_", "__");
+				const badgeKey = escapeBadgePart(key);
+				const badgeVersion = escapeBadgePart(
+					resolveVersion(
 					{
 						catalogs: first?.catalogs,
 						name: key,
 						version,
 					},
-				)}-${color}.svg?logo=${slug}&logoColor=${contrastText}&labelColor=${color}`;
+					),
+				);
+				const imageUrl = `https://img.shields.io/badge/${badgeKey}-${badgeVersion}-${encodeURIComponent(color)}.svg?logo=${encodeURIComponent(slug)}&logoColor=${encodeURIComponent(contrastText)}&labelColor=${encodeURIComponent(color)}`;
 				packageBadges.push(md`[![${key}](${imageUrl})](${linkUrl})`);
 			}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/auto-readme/src/plugin.ts` around lines 131 - 142, The Shields badge URL
is built from raw values and can break for scoped package names and special
characters; update the construction around badgeKey, imageUrl and linkUrl (where
packageBadges is pushed and resolveVersion is used) to URL-encode path and query
parts before interpolation: ensure you encode the package name/key (including
scoped names), the resolved version from resolveVersion, and any query values
like slug, contrastText and color using a safe encoder (e.g.,
encodeURIComponent) appropriate for path vs query segments, then build imageUrl
and linkUrl from those encoded pieces so badges render reliably.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/prettier-plugin-handlebars/README.md`:
- Line 23: The "Table of contents" heading currently uses an h5 marker ("#####
Table of contents") which can violate markdown heading-order lint rules; update
that heading to a higher-level marker such as "## Table of contents" (or "###
Table of contents") so the heading level is normalized and consistent with
surrounding headings in README.md.

In `@core/typed-env/package.json`:
- Around line 23-26: The package root currently only exports a JS entry
(exports: { ".": "./dist/index.mjs", ... }) but lacks an explicit TypeScript
declaration mapping; update package.json to add a top-level "types" field
pointing to the generated declaration (e.g., "./dist/index.d.ts") and ensure the
root exports (the "." key) conceptually aligns with that types entry so
consumers and TS resolvers can locate declarations produced by dts: true.

---

Duplicate comments:
In `@core/auto-readme/src/plugin.ts`:
- Around line 131-142: The Shields badge URL is built from raw values and can
break for scoped package names and special characters; update the construction
around badgeKey, imageUrl and linkUrl (where packageBadges is pushed and
resolveVersion is used) to URL-encode path and query parts before interpolation:
ensure you encode the package name/key (including scoped names), the resolved
version from resolveVersion, and any query values like slug, contrastText and
color using a safe encoder (e.g., encodeURIComponent) appropriate for path vs
query segments, then build imageUrl and linkUrl from those encoded pieces so
badges render reliably.

In `@core/remark-asciinema/README.md`:
- Around line 76-77: Replace the pinned asciinema-player@3.9.0 CDN links in
README.md (the two lines containing
"asciinema-player@3.9.0/dist/bundle/asciinema-player.css" and
"asciinema-player@3.9.0/dist/bundle/asciinema-player.min.js") with either a
non-pinned major tag to stay current (use `@3`) or with the project's latest
stable release; the recommended UNPKG URL patterns are:
https://unpkg.com/asciinema-player@3/dist/bundle/asciinema-player.css and
https://unpkg.com/asciinema-player@3/dist/bundle/asciinema-player.min.js (or
replace `@3` with the explicit latest version string if you prefer a pinned
release).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4304d19e-ce58-41ca-b432-9b123e7c6530

📥 Commits

Reviewing files that changed from the base of the PR and between b110e0b and 1b402e0.

📒 Files selected for processing (36)
  • .changeset/hip-lemons-join.md
  • core/ai-commit-msg/README.md
  • core/alfred-kaomoji/README.md
  • core/astro-iconify-svgmap/README.md
  • core/auto-readme/README.md
  • core/auto-readme/src/icon.test.ts
  • core/auto-readme/src/icon.ts
  • core/auto-readme/src/pipeline.test.ts
  • core/auto-readme/src/plugin.test.ts
  • core/auto-readme/src/plugin.ts
  • core/catppuccin-jsonresume-theme/README.md
  • core/catppuccin-opml/README.md
  • core/catppuccin-rss/README.md
  • core/catppuccin-typedoc/README.md
  • core/catppuccin-xsl/README.md
  • core/eslint-config/README.md
  • core/find-makefile-targets/README.md
  • core/github-env/README.md
  • core/multipublish/README.md
  • core/pnpm-hooks/README.md
  • core/prettier-plugin-handlebars/README.md
  • core/prettier-plugin-handlebars/example/index.js
  • core/remark-asciinema/README.md
  • core/remark-asciinema/example/index.js
  • core/single-file/README.md
  • core/svelte-social-share-links/README.md
  • core/typed-env/README.md
  • core/typed-env/__snapshots__/tsnapi/index.snapshot.d.ts
  • core/typed-env/__snapshots__/tsnapi/index.snapshot.js
  • core/typed-env/package.json
  • core/typed-env/tsdown.config.ts
  • core/typed-events/README.md
  • core/typed-nocodb-api/README.md
  • core/typed-templates/README.md
  • core/types-github-action-env/README.md
  • core/types-lhci/README.md

Comment thread core/prettier-plugin-handlebars/README.md
Comment on lines 23 to 26
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
".": "./dist/index.mjs",
"./package.json": "./package.json"
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify current manifest entrypoints and presence of declaration artifacts.
jq '{exports, types, main, module}' core/typed-env/package.json
fd -HI --glob 'index.d.ts' core/typed-env
fd -HI --glob 'index.d.mts' core/typed-env

Repository: stephansama/packages

Length of output: 252


🏁 Script executed:

#!/bin/bash
# Verify current manifest entrypoints and presence of declaration artifacts
cat core/typed-env/package.json | jq '.exports, .types, .main, .module'
echo "---"
echo "Looking for declaration files in core/typed-env/dist/:"
find core/typed-env/dist -name "*.d.ts" -o -name "*.d.mts" 2>/dev/null || echo "No dist directory or no .d.ts/.d.mts files found"
echo "---"
echo "Full package.json content:"
cat core/typed-env/package.json

Repository: stephansama/packages

Length of output: 1754


🏁 Script executed:

#!/bin/bash
# Check tsdown configuration
echo "=== Looking for tsdown config ==="
find core/typed-env -maxdepth 2 -name "tsdown*" -o -name "tsconfig*"

echo ""
echo "=== Checking for tsconfig.json in core/typed-env ==="
if [ -f core/typed-env/tsconfig.json ]; then
  cat core/typed-env/tsconfig.json
else
  echo "No tsconfig.json in core/typed-env"
fi

echo ""
echo "=== Checking parent tsconfig or root config ==="
if [ -f tsconfig.json ]; then
  jq '.compilerOptions.declaration, .compilerOptions.declarationMap, .compilerOptions.emitDeclarationOnly' tsconfig.json
fi

echo ""
echo "=== Checking for any TypeScript output settings ==="
cat core/typed-env/package.json | jq '.scripts'

Repository: stephansama/packages

Length of output: 713


🏁 Script executed:

#!/bin/bash
# Get tsdown and base tsconfig settings
echo "=== tsdown.config.ts ==="
cat core/typed-env/tsdown.config.ts

echo ""
echo "=== tsconfig.base.json ==="
cat tsconfig.base.json

Repository: stephansama/packages

Length of output: 918


Add explicit types field for better TypeScript compatibility.

While tsdown is configured to generate declarations (dts: true), the package.json lacks an explicit types mapping in the root exports. Modern TypeScript with moduleResolution: "Bundler" can often resolve this, but adding an explicit types entry improves compatibility across different resolver modes and consumer tooling.

Suggested adjustment
   "exports": {
-    ".": "./dist/index.mjs",
+    ".": {
+      "types": "./dist/index.d.ts",
+      "default": "./dist/index.mjs"
+    },
     "./package.json": "./package.json"
   },
+  "types": "./dist/index.d.ts",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
".": "./dist/index.mjs",
"./package.json": "./package.json"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.mjs"
},
"./package.json": "./package.json"
},
"types": "./dist/index.d.ts",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/typed-env/package.json` around lines 23 - 26, The package root currently
only exports a JS entry (exports: { ".": "./dist/index.mjs", ... }) but lacks an
explicit TypeScript declaration mapping; update package.json to add a top-level
"types" field pointing to the generated declaration (e.g., "./dist/index.d.ts")
and ensure the root exports (the "." key) conceptually aligns with that types
entry so consumers and TS resolvers can locate declarations produced by dts:
true.

@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcolord@​2.9.31001009980100

View full report

@stephansama stephansama merged commit fdf1800 into main May 16, 2026
13 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.

1 participant