-
Notifications
You must be signed in to change notification settings - Fork 16
feat: some llms.txt improvements #382
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Pull Request Overview
This PR improves LLM text generation functionality by fixing text formatting issues and standardizing metadata naming conventions.
- Fixed multi-line paragraph text joining by replacing line breaks with spaces
- Changed
llm_description
to camelCasellmDescription
throughout the codebase - Added trimming for
llmDescription
values to remove trailing whitespace
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/utils/unist.mjs | Fixed line break handling in text transformation to prevent words from being joined without spaces |
src/utils/parser/index.mjs | Removed llm_description normalization as it's now camelCase |
src/utils/parser/tests/index.test.mjs | Updated test expectations to use camelCase llmDescription |
src/metadata.mjs | Changed property name from llm_description to llmDescription |
src/linter/rules/missing-metadata.mjs | Updated regex constant name to match camelCase convention |
src/linter/rules/tests/missing-metadata.test.mjs | Updated test cases and comments to use camelCase naming |
src/linter/constants.mjs | Renamed regex constant and updated error message to use camelCase |
src/generators/llms-txt/utils/buildApiDocLink.mjs | Changed to use llmDescription and added .trim() call |
src/generators/llms-txt/utils/tests/buildApiDocLink.test.mjs | Updated test cases to use camelCase property name |
src/tests/metadata.test.mjs | Updated test assertion to use camelCase property name |
Comments suppressed due to low confidence (3)
src/linter/constants.mjs:5
- The constant name
llmDescription_REGEX
doesn't follow consistent naming conventions. It should beLLM_DESCRIPTION_REGEX
to match the existingINTRODUCED_IN_REGEX
pattern.
export const llmDescription_REGEX = /<!--\s?llmDescription:.*-->/;
src/linter/rules/missing-metadata.mjs:9
- The import name
llmDescription_REGEX
should beLLM_DESCRIPTION_REGEX
to maintain consistency with the existing constant naming pattern.
llmDescription_REGEX,
src/linter/rules/missing-metadata.mjs:34
- The reference
llmDescription_REGEX
should beLLM_DESCRIPTION_REGEX
to match the corrected constant name.
regex: llmDescription_REGEX,
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #382 +/- ##
==========================================
+ Coverage 70.80% 74.28% +3.47%
==========================================
Files 127 118 -9
Lines 11620 11047 -573
Branches 694 697 +3
==========================================
- Hits 8228 8206 -22
+ Misses 3389 2838 -551
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This reverts commit 5d65c8a.
@nodejs/web-infra reviews please |
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.
LGMT !!!
Description
Some improvements that I found while working on landing nodejs/node#59264.
Validation
npx doc-kit generate -t llms-txt -i doc/api/*.md -o out/
Related Issues
Check List
node --run test
and all tests passed.node --run format
&node --run lint
.