-
Notifications
You must be signed in to change notification settings - Fork 16
Refactor worker and introduce header support #24
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
Merged
Conversation
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
- Replaced itty-router with Hono for routing - Restructured project with new utility modules - Updated dependencies and configuration - Simplified route handling and middleware - Improved type safety and code organization
- Introduced header image routes and utilities - Renamed BANNER_BUCKET to HEADER_BUCKET in configuration - Created separate routes for header image upload and retrieval - Extracted common image handling logic into utility functions - Implemented similar pattern to avatar image handling
- Refactored ESLint configuration to use defineConfig for better clarity - Updated ESLint and related dependencies to the latest versions - Added lint script to package.json for easier linting - Improved code formatting and consistency across various files
- Changed route paths for header retrieval and upload from "/:name/header" to "/:name/h"
- Added uploadType parameter to getVerifiedAddress for better handling of upload types - Updated avatar and header routes to include specific uploadType values ("avatar" and "header") in the request payload
- Updated package.json to reflect new versions for various dependencies including Hono, Valibot, and Viem. - Added new scripts for type generation and type checking. - Enhanced tsconfig.json with additional compiler options for better type safety and module resolution. - Regenerated worker-configuration.d.ts with updated runtime types from workerd@1.20250310.0.
- Introduced a new media utility to manage unregistered and registered media files for avatars and headers. - Refactored existing avatar and header routes to utilize the new media utility for promoting unregistered media. - Added tests for media handling functions to ensure proper functionality and coverage. - Removed deprecated avatar and header utility functions to streamline the codebase.
- Introduced ENVIRONMENT variable to support different deployment environments (dev, staging, production). - Updated worker-configuration.d.ts to include the new ENVIRONMENT interface. - Modified wrangler.jsonc to define environment-specific variables for staging and production.
- Removed unnecessary import of sha256 from hono/utils/crypto. - Updated avatar and header routes to directly use sha256 from viem for hashing image bytes. - Adjusted the hash format in the request payload to remove the `0x` prefix.
- Implemented integration tests for avatar and header routes to ensure proper functionality. - Created test cases for GET and PUT requests, covering scenarios for registered and unregistered media. - Added helper functions for test data generation and mock setups to streamline testing process. - Updated existing test utilities to support new test cases and improve overall test coverage.
- Updated client middleware to safely parse WEB3_ENDPOINT_MAP, providing a default empty object if not defined. This change improves robustness against undefined environment variables.
- Added R2GetOrHead utility to handle both GET and HEAD requests for avatar and header routes. - Updated routes to return appropriate metadata for HEAD requests, including content type and length, while ensuring the body is empty. - Enhanced integration tests to verify HEAD request functionality and ensure proper handling of registered and unregistered media across different networks.
…ions - Added detailed installation and setup instructions using pnpm. - Included a new section for publishing the package. - Provided a note on configuring the WEB3_ENDPOINT_MAP as a secret value with JSON structure example.
- Upgraded cloudflare/wrangler-action from version 2.0.0 to v3 in the GitHub Actions deploy workflow to leverage new features and improvements.
LeonmanRolls
approved these changes
Apr 28, 2025
- Add Claude settings configuration - Update example vars with localhost chain - Add localhost chain configuration in utils - Add error handling utilities - Update chains configuration with localhost support - Enhance owner resolution logic - Update worker configuration types - Update avatar route implementation 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
- Remove debug console.log statements - Simplify HEAD request handling for unregistered headers - Maintain original functionality 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
- Return null body for HEAD requests using c.body(null) - Maintain headers while returning no content for HEAD requests 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
The test script was using 'vitest' which runs in watch mode and never exits. Changed to 'vitest run' to ensure tests complete and exit properly in CI. Added 'test:watch' script for local development with watch mode. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Created .test.vars with public RPC endpoints for tests - Updated vitest.config.ts to use .test.vars for environment variables - This ensures tests have required WEB3_ENDPOINT_MAP in CI environment 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This reverts commit 97ea1a1.
This reverts commit 2e7628a.
…on issue - Viem handles chainId differently for holesky during EIP-712 signature verification - While mainnet/goerli/sepolia don't add chainId when not explicitly provided, holesky does - This causes cross-chain signature verification to fail since test signatures use mainnet wallet - Added detailed comments explaining the exclusion 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Modified test workflow configuration - Updated avatar route integration tests 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Update avatar and header routes - Modify owner utility functions - Add new subname utility module 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Reorganize imports in avatar and header routes - Format subname utility code for consistency 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fix bugs in feat/hono
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.
No description provided.