feat(encoders): add URL Encoder/Decoder with support for multiple enc…#4
Merged
Merged
Conversation
…oding modes Introduce a new `/converters/url-encoder` tool for URL encoding and decoding. - Added `URLEncoder.tsx` page, UI for encoding/decoding URLs, and form validation using `zod`. - Implemented `URLEncode` utility functions in `encoding.ts`: - `encode`: Encode text as URL (component/full modes). - `decode`: Decode URL-encoded strings. - `parseQuery`: Parse query strings into key-value pairs. - `buildQuery`: Serialize key-value pairs into query strings. - Updated `tools.ts` to add the URL Encoder/Decoder to the tools list. - Integrated route in `routeTree.gen.ts` for navigation and routing support. - Enhanced validation by adding URL-specific schemas to `validation-schemas.ts`. BREAKING CHANGE: Introduces a new error code (`ENCODE_FAILED`) in `errors.ts`, which might affect projects relying on existing enums.
✅ Deploy Preview for devkit-app ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
This pull request implements the new URL Encoder/Decoder tool as part of the enhanced encoding tools phase. The feature provides a comprehensive solution for encoding and decoding URLs, supporting both component and full URL encoding modes, and offers compatibility with over 80 character encodings. The implementation includes robust validation, user-friendly UI, and ergonomic API design, while following established architectural patterns and maintaining high code quality.
Key changes grouped by theme:
Feature Implementation & API:
URLEncodenamespace tosrc/lib/encoding.ts, providing asyncencodeanddecodefunctions for URL encoding/decoding, as well asparseQueryandbuildQueryutilities. Supports both component and full URL modes and 80+ character encodings, using native browser APIs for UTF-8 and iconv-lite for others. Includes comprehensive error handling and examples.docs/feature-1.1-url-encoder-implementation.md, outlining features, validation, UI, API, testing, performance, accessibility, and roadmap integration.Validation & Error Handling:
src/lib/validation-schemas.tsto addurlEncoderSchemafor form validation, including conditional validation logic for encode/decode modes and a newurlEncodedStringSchemato ensure proper percent-encoding. Exported theURLEncoderFormtype.ENCODE_FAILEDerror code toERROR_CODESinsrc/lib/errors.tsfor more precise error reporting during URL encoding failures.Tool Registration & UI Integration:
src/lib/tools.ts, including metadata, navigation route, icon (Linkfrom lucide-react), and descriptive tags for discoverability. [1] [2]These changes collectively deliver a robust, user-friendly, and extensible URL Encoder/Decoder tool, ready for testing and deployment.…oding modes
Introduce a new
/converters/url-encodertool for URL encoding and decoding.URLEncoder.tsxpage, UI for encoding/decoding URLs, and form validation usingzod.URLEncodeutility functions inencoding.ts:encode: Encode text as URL (component/full modes).decode: Decode URL-encoded strings.parseQuery: Parse query strings into key-value pairs.buildQuery: Serialize key-value pairs into query strings.tools.tsto add the URL Encoder/Decoder to the tools list.routeTree.gen.tsfor navigation and routing support.validation-schemas.ts.BREAKING CHANGE: Introduces a new error code (
ENCODE_FAILED) inerrors.ts, which might affect projects relying on existing enums.Description
Type of Change
Related Issue
Closes #
Changes Made
Testing
Manual Testing
Functional Testing
Accessibility Testing
Code Quality Checklist
anytypes)npm run build)Performance Checklist
Security Checklist
dangerouslySetInnerHTMLeval()orFunction()constructorDocumentation
Screenshots / Recordings
Before
After
Deployment Checklist
Reviewer Notes
Post-Merge Tasks
Self-Review Checklist (for PR author before requesting review):