Skip to content

Fix/auto readme#261

Merged
stephansama merged 2 commits into
mainfrom
fix/auto-readme
May 3, 2026
Merged

Fix/auto readme#261
stephansama merged 2 commits into
mainfrom
fix/auto-readme

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 3, 2026

🦋 Changeset detected

Latest commit: acfc3c3

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

This PR includes changesets to release 3 packages
Name Type
@stephansama/auto-readme Patch
create-stephansama-example Patch
@stephansama/eslint-config 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 3, 2026

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

Project Deployment Actions Updated (UTC)
packages Building Building Preview, Comment May 3, 2026 5:32pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f778de3c-85cc-467e-a649-606101313621

📥 Commits

Reviewing files that changed from the base of the PR and between a3b2e83 and acfc3c3.

📒 Files selected for processing (7)
  • .changeset/better-melons-win.md
  • README.md
  • core/auto-readme/README.md
  • core/auto-readme/src/plugin.ts
  • core/auto-readme/src/schema.ts
  • core/example/package.json
  • eslint.config.ts

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • README now includes an automatically generated workspace table displaying all packages with their version badges, download statistics, and descriptions.
  • Improvements

    • Enhanced default heading configuration behavior in the auto-readme tool for improved consistency.
  • Chores

    • Updated example package configuration to support public npm publishing.
    • Applied patch version updates to affected workspace packages.

Walkthrough

This PR introduces a refined default heading implementation for auto-readme by parsing schema defaults directly via Zod, updates the example package with publish configuration, suppresses related linting warnings, documents the workspace packages, and releases these changes via changeset.

Changes

Auto-readme Default Heading Implementation

Layer / File(s) Summary
Data Shape & Defaults
core/auto-readme/src/schema.ts
defaultTableHeadings now parses undefined instead of {}, allowing Zod schema to apply built-in defaults for ACTION, PKG, USAGE, WORKSPACE, and ZOD.
Core Plugin Simplification
core/auto-readme/src/plugin.ts
WORKSPACE zone handler removes redundant || [] fallback after defaultTableHeadings.WORKSPACE!, relying on schema defaults.
Documentation
core/auto-readme/README.md
Schema documentation updated to reflect the new default heading mapping for each action type.

Example Package Publication & Configuration

Layer / File(s) Summary
Package Configuration
core/example/package.json
Adds publishConfig.access: "public" to control npm publish access.
Lint Configuration
eslint.config.ts
New override disables package-json/no-redundant-publishConfig rule for core/example/package.json to suppress redundancy warning.
Release Notes & Workspace Docs
.changeset/better-melons-win.md, README.md
Changeset records patch version bumps for three packages with note on default heading updates; workspace package table added to root README with badges and descriptions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 The defaults now bloom from schema's design,
No empty braces, just undefined's fine!
Workspace shines bright in the README's glow,
And packages publish with flair—watch them grow! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Fix/auto readme' is vague and overly generic, using non-descriptive phrasing that doesn't convey meaningful information about the specific changes made. Replace with a more descriptive title that captures the main change, such as 'Update default heading implementation in auto-readme configuration'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description matches the repository's template and includes all required checklist items, though it lacks detail about the actual changes being made.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/auto-readme

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@stephansama stephansama merged commit d53e888 into main May 3, 2026
8 of 11 checks passed
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 updates the auto-readme default heading implementation, populates the workspace table in the main README, and adjusts publishing configurations for the example package. Feedback suggests refactoring the schema default initialization to avoid top-level Zod parsing and extracting duplicated heading selection logic into a helper function to improve maintainability.


// use undefined to generate default headings
// eslint-disable-next-line unicorn/no-useless-undefined
export const defaultTableHeadings = tableHeadingsSchema.parse(undefined);
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

While tableHeadingsSchema.parse(undefined) correctly triggers the schema's default value, it's generally cleaner to define the default object as a separate constant and export it directly. This avoids the need for Zod parsing at the top level and the associated ESLint suppression.

const DEFAULT_TABLE_HEADINGS = {
	ACTION: ["name", "required", "default", "description"],
	PKG: ["name", "version", "devDependency"],
	USAGE: [],
	WORKSPACE: ["name", "version", "downloads", "description"],
	ZOD: [],
} as const;

export const defaultTableHeadings = DEFAULT_TABLE_HEADINGS;

const tableHeadingsSchema = z
	.record(actionsSchema, headingsSchema.array().optional())
	.default(DEFAULT_TABLE_HEADINGS)
	.meta({ description: "Table heading action configuration" });

Comment on lines 100 to +102
(config.headings?.WORKSPACE?.length &&
config.headings?.WORKSPACE) ||
defaultTableHeadings.WORKSPACE! ||
[];
defaultTableHeadings.WORKSPACE!;
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

The logic for selecting headings is duplicated across different sections (ACTION, PKG, WORKSPACE). Consider refactoring this into a small helper function to improve maintainability and ensure consistency across all plugins.

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