3 Commits

Author SHA1 Message Date
25ad52e68b test: add comprehensive WebFinger tests (17 tests)
Added complete test coverage for WebFinger JRD generation:

## Static Resources Tests (11 tests)
- Unknown resource returns null
- Basic JRD generation
- Subject defaults to resource when not provided
- Aliases support
- Properties support (URI-based names)
- Links support with rel, href, type
- Rel filtering (single and multiple)
- Link titles with language tags
- Complete JRD with all fields

## Protocol Support Tests
- HTTP/HTTPS resource URIs
- ActivityPub profile discovery (self rel, application/activity+json)
- OpenID Connect issuer discovery

## Edge Cases (4 tests)
- Resource with no links
- Empty aliases array omitted
- Empty properties object omitted
- All links filtered out by rel

Test suite now at 89 tests (up from 72), all passing.
Coverage includes RFC 7033 compliance, common use cases (Mastodon/ActivityPub,
OpenID), and edge cases.
2025-11-03 09:06:47 -07:00
2063d81e60 test: add comprehensive tests for security.txt and canary.txt
Added 38 new tests (16 + 22) covering all features of the new generators:

## security.txt Tests (16 tests)
- RFC 9116 field validation (Canonical, Contact, Expires)
- Automatic mailto: prefix handling for email contacts
- Auto-expiration calculation (1 year from generation)
- Multiple contact methods support
- Multiple encryption keys
- All optional fields: acknowledgments, preferredLanguages, policy, hiring
- Proper field ordering compliance

## canary.txt Tests (22 tests)
- Compact field: value format validation
- Frequency-based expiration (daily: 2d, weekly: 10d, monthly: 35d, quarterly: 100d, yearly: 380d)
- Statement filtering (only non-received statements appear)
- Default statements vs custom statements
- Function-based dynamic statements
- Blockchain proof formatting (Network:Address:TxHash)
- Personnel duress statement
- Verification field
- Previous canary references
- Contact with mailto: prefix
- Organization and frequency fields

Test suite now at 72 total tests (up from 34), all passing.
2025-11-03 08:19:38 -07:00
d25dde4627 feat: initial implementation of @astrojs/discovery integration
This commit introduces a comprehensive Astro integration that automatically
generates discovery files for websites:

Features:
- robots.txt with LLM bot support (Anthropic-AI, GPTBot, etc.)
- llms.txt for AI assistant context and instructions
- humans.txt for team credits and site information
- Automatic sitemap integration via @astrojs/sitemap

Technical Details:
- TypeScript implementation with full type safety
- Configurable HTTP caching headers
- Custom template support for all generated files
- Sensible defaults with extensive customization options
- Date-based versioning (2025.11.03)

Testing:
- 34 unit tests covering all generators
- Test coverage for robots.txt, llms.txt, and humans.txt
- Integration with Vitest

Documentation:
- Comprehensive README with examples
- API reference documentation
- Contributing guidelines
- Example configurations (minimal and full)
2025-11-03 07:36:39 -07:00