-
-
Notifications
You must be signed in to change notification settings - Fork 1
Fix/auto readme #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/auto readme #261
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@stephansama/auto-readme": patch | ||
| "create-stephansama-example": patch | ||
| "@stephansama/eslint-config": patch | ||
| --- | ||
|
|
||
| updated auto readme default heading implementation |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,7 +67,10 @@ const templatesSchema = z.object({ | |
| }); | ||
|
|
||
| export const defaultTemplates = templatesSchema.parse({}); | ||
| export const defaultTableHeadings = tableHeadingsSchema.parse({}); | ||
|
|
||
| // use undefined to generate default headings | ||
| // eslint-disable-next-line unicorn/no-useless-undefined | ||
| export const defaultTableHeadings = tableHeadingsSchema.parse(undefined); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While 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" }); |
||
|
|
||
| const _configSchema = z.object({ | ||
| affectedRegexes: z.array(z.string().trim()), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,6 +52,7 @@ | |
| "node": ">=24" | ||
| }, | ||
| "publishConfig": { | ||
| "access": "public", | ||
| "provenance": true | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.