Add etymology extension - #31246
Add etymology extension#31246Chiarandini wants to merge 5 commits into
Conversation
- Recapture the search-list screenshot - Store screenshots - Version the cache key on parser changes - Use the root-system icon - Fix four defects the store screenshots exposed - Check branch and clean tree before publishing - Hoist the markdown, and return to main after just local - Guard the local-branch rebase, and document the split - Add the two-branch workflow to the justfile - Move the Etymonline excerpt off main - Add a justfile and install docs - Add definitions, and an Etymonline excerpt for local builds - Render the tree as a table, and quiet the attribution - Rework the detail pane - Implement the extension over Wiktionary - scaffold: Etymology Raycast extension layout
|
Congratulations on your new Raycast extension! 🚀 We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days. Once the PR is approved and merged, the extension will be available on our Store. |
|
| function key(term: string, lang: string): string { | ||
| return `v${PARSE_VERSION}:${lang}:${term.toLowerCase()}`; |
There was a problem hiding this comment.
key() lowercases a title even though fetchWithCaseFallback() relies on Wiktionary's case-sensitive titles. A lookup for another case variant can therefore return the first cached Entry, including its term and source link, for 30 days. Keep case in the identity key. The same collision exists in favorites.same(), so both places should use the same case-sensitive rule.
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/etymology/src/cache.ts
Line: 27-28
Comment:
`key()` lowercases a title even though `fetchWithCaseFallback()` relies on Wiktionary's case-sensitive titles. A lookup for another case variant can therefore return the first cached `Entry`, including its term and source link, for 30 days. Keep case in the identity key. The same collision exists in `favorites.same()`, so both places should use the same case-sensitive rule.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| # Run before committing. | ||
| check: types lint parsers | ||
|
|
||
| # Run this after any change to main if you want those additions on your machine. |
There was a problem hiding this comment.
This update deletes
scripts/check-store-ready.mjs and removes store-check, but package.json still exposes npm run check-store-ready. That command now exits with a missing-file error. Remove the package script too, or restore its file.
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/etymology/justfile
Line: 96
Comment:
This update deletes `scripts/check-store-ready.mjs` and removes `store-check`, but `package.json` still exposes `npm run check-store-ready`. That command now exits with a missing-file error. Remove the package script too, or restore its file.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.- Move working notes to .claude/ - Address the automated review
| }, | ||
| { | ||
| "name": "lookup-selection", | ||
| "title": "Look up Selection", |
There was a problem hiding this comment.
The
lookup-selection command uses Look up Selection. The repository requires titles in package.json to use title case. Change it to Look Up Selection.
Rule Used: What: Use title case for titles in package.json. Why: Title case improves readability and maintains consistent formatting standards for user-facing preference labels. Good: json { "title": "Tab width configuration", } Bad: ```json { "... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/etymology/package.json
Line: 26
Comment:
The `lookup-selection` command uses `Look up Selection`. The repository requires titles in `package.json` to use title case. Change it to `Look Up Selection`.
**Rule Used:** What: Use title case for titles in `package.json`. Why: Title case improves readability and maintains consistent formatting standards for user-facing preference labels. Good: ```json { "title": "Tab width configuration", } ``` Bad: ```json { "... ([source](https://app.greptile.com/raycast/-/custom-context?memory=a44fb089-4d03-4b60-a4ff-03431cdf0eb4))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Keeping Look up Selection here, because ray lint requires it. Changing it to Look Up Selection makes the linter fail:
26:15 warning Command's title has to be Title Cased. Expected "Look up Selection"
The current title lints clean. The other two findings in this round look like they were computed against an earlier commit — src/cache.ts already keys case-sensitively (v${PARSE_VERSION}:${lang}:${term}, no toLowerCase, and favorites.same() matches), and the check-store-ready script was removed from package.json in the same push that deleted the file.
There was a problem hiding this comment.
Thanks for the clarification. The linter output confirms that Look up Selection is the repository's expected title casing, so my finding on extensions/etymology/package.json is incorrect—please keep the current title. The cache and check-store-ready findings are also stale relative to the current commit and should be dismissed.
Description
Etymology traces where a word comes from, one ancestor at a time.
An entry opens with what the word means, then a table of its line of descent — each step marked as inherited, borrowed, a calque, or a component. Pressing enter on any ancestor opens it as its own entry, so you can walk from
computerback through Latincomputōto Proto-Indo-European*ḱe.Commands
Where the data comes from
English Wiktionary, via the public MediaWiki API. No account, no API key, no tracking. Results are cached for 30 days, and the extension reads ancestry two ways:
{{etymon|tree=1}}carry a machine-readable ancestor tree in the rendered page, assembled by Wiktionary from each ancestor's own entry. Around 46,000 English entries have one, and it reaches deeper than any single page states.{{inh}},{{bor}},{{der}},{{affix}}, and the rest).Definitions come out of the same request, so showing what a word means costs no extra call.
Attribution — Wiktionary content is CC BY-SA 4.0. Every entry shows the source and licence in the metadata pane with a link back to the page, and the copy actions carry the attribution line.
Etymonline is linked to via an optional action and never reproduced: it has no public API and its entries are proprietary.
Screencast
Six screenshots in
metadata/: the search list with its preview pane, and detail views forsarcasm(a deep Greek chain),cereal(borrowed and analysable asCere(s)+-al),computer(definitions, then the full chain with its side branches named), andquixotic.Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder