Repository navigation
feat: add Font Squirrel and Fontshare providers - #14
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@codex review |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
This PR adds Font Squirrel and Fontshare catalog providers with bounded archive inspection, license metadata, ranked matching, caching, and configurable enablement.
WalkthroughThis change adds Font Squirrel and Fontshare archive catalog providers. The providers fetch bounded catalogs, rank normalized family-name matches, resolve official archive downloads, and preserve source and license metadata. Cache identity and query normalization are provider-specific. Configuration, provider registration, CLI validation, help text, tests, and documentation now include both providers. WAF and HTTP responses return categorized errors. The package version is now Sequence Diagram(s)sequenceDiagram
participant Client
participant searchEvents
participant Fontshare
participant CatalogEndpoint
participant OfficialArchive
Client->>searchEvents: select fontshare provider
searchEvents->>Fontshare: search query and formats
Fontshare->>CatalogEndpoint: fetch bounded catalog
Fontshare->>Fontshare: match and rank catalog entries
Fontshare->>OfficialArchive: resolve archive URL
Fontshare-->>searchEvents: emit result metadata
searchEvents-->>Client: return search results
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/content/docs/reference/providers.mdx`:
- Around line 8-15: Update the provider defaults documented in the GetFonts and
Font Squirrel sections: mark GetFonts as enabled rather than disabled, and mark
Font Squirrel as disabled/opt-in rather than enabled. Keep the remaining
provider metadata unchanged and ensure both sections consistently describe the
runtime defaults.
In `@internal/provider/catalogs.go`:
- Around line 94-100: Update fetchArchiveCatalog to apply the same
safehttp.Constrain setup, private-network context handling, and HTTPS-only
redirect policy used by fetchDiscoveryContentWithType before issuing the
request. Replace the supplied client with the constrained client for client.Do,
preserving the existing request construction and error handling.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 99679c31-13f5-4547-a860-16379d02ff9e
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (16)
README.mddocs/content/docs/how-to/search-and-filter.mdxdocs/content/docs/reference/cli.mdxdocs/content/docs/reference/configuration.mdxdocs/content/docs/reference/providers.mdxe2e/cli_test.gointernal/app/app_test.gointernal/app/output.gointernal/app/search.gointernal/config/config.gointernal/config/config_test.gointernal/provider/catalogs.gointernal/provider/catalogs_test.gointernal/provider/discovery.gointernal/provider/discovery_test.gopackage.json
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 795c63d355
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
795c63d to
4581200
Compare
4581200 to
1f9ec30
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f9ec30ece
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
1f9ec30 to
8a9a3ed
Compare
|
@codex review |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a9a3ed0a3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
8a9a3ed to
1023896
Compare
|
@codex review |
|
@coderabbitai review |
|
1023896 to
17c49f5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1023896f2d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
17c49f5 to
4b4196c
Compare
|
@codex review |
|
@coderabbitai review |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b4196c310
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
4b4196c to
6e9f578
Compare
|
@codex review |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/cache/cache.go`:
- Around line 74-82: Update the cache-hit and done-handling paths in the cache
retrieval function to check ctx.Err() before forwarding results and before
returning normally, including empty cache hits and cases where done and
ctx.Done() are both ready. Preserve source errors when no cancellation exists,
return the context error after cancellation, and add a test covering a
pre-canceled context with a buffered cache hit.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 5335e1b2-02f3-481a-96a2-ed47c2f19848
📒 Files selected for processing (5)
internal/cache/cache.gointernal/cache/cache_test.gointernal/provider/catalogs.gointernal/provider/catalogs_test.gointernal/provider/discovery.go
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Search both structured catalogs and inspect official archives through the existing safety limits. Keep Font Squirrel opt-in when site protection blocks API clients and prepare v0.7.0.
6e9f578 to
93d44bb
Compare
what changed
testing
npm run verifyGreptile Summary
The PR adds structured Font Squirrel and Fontshare catalog providers, including bounded archive inspection, provider configuration, caching, metadata, tests, and documentation.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Sequence Diagram
sequenceDiagram participant CLI participant Cache as CachedProvider participant Catalog as Fontshare / Font Squirrel participant API as Catalog API participant Archive as Official ZIP CLI->>Cache: Search(query, formats) alt Cache hit Cache-->>CLI: Cached results else Cache miss Cache->>Catalog: Search(query, formats) Catalog->>API: Fetch bounded catalog API-->>Catalog: Family metadata Catalog->>Archive: Download closest matching archives Archive-->>Catalog: Bounded archive bytes Catalog-->>Cache: Valid requested font members Cache-->>CLI: Results Cache->>Cache: Persist completed result set endReviews (8): Last reviewed commit: "feat: add Font Squirrel and Fontshare pr..." | Re-trigger Greptile