feat: prefer package.json description over README-inferred#1107
Open
feat: prefer package.json description over README-inferred#1107
Conversation
commit: |
Generate machine-readable index of EffectionX packages using the llmstxt.org standard. The route: - Uses useWorkspaces() to enumerate all @effectionx/* packages - Extracts name and description from each package - Returns plain text with proper Content-Type header Also updates HTML link href and footer to point to /llms.txt instead of /assets/llms.txt (static file kept as fallback).
Update the package abstraction to read description from package.json and prefer it over README-inferred descriptions. This enables the llms.txt route to use concise, agent-friendly descriptions from npm packages. Changes: - Add description field to PackageJsonSchema (node.ts) - Add description field to PackageManifest interface (types.ts) - Update getDescription() in both node.ts and deno.ts to prefer manifest description, falling back to README when not present Works with thefrontside/effectionx#151 which adds description fields to all @effectionx/* packages.
ca6ba97 to
afef6cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
With thefrontside/effectionx#151 merged, all
@effectionx/*packages now have concisedescriptionfields in theirpackage.jsonfiles. These descriptions are written specifically for npm search and AI agent discovery.The current website reads descriptions from README files, parsing them through a rehype pipeline that extracts the first paragraph. This produces verbose, 200-character excerpts that aren't ideal for the
/llms.txtroute or package listings.Approach
Update the package abstraction to prefer
package.jsondescription over README-inferred description:Add
descriptionto schemas:PackageJsonSchemainwww/lib/package/node.tsPackageManifestinterface inwww/lib/package/types.tsUpdate
getManifest()to include description in returned manifestUpdate
getDescription()in bothnode.tsanddeno.tsto:This ensures the
/llms.txtroute generates concise, agent-friendly descriptions like:Instead of verbose paragraph excerpts.