Repository navigation
Refactor/split publish api - #1492
Merged
greatest0fallt1me merged 6 commits intoNov 26, 2026
Merged
Conversation
…o fix-marketplace-aria-live
…o fix/rate-limit-per-api # Conflicts: # src/App.tsx # src/data/mockApis.ts # src/pages/ApiDetailPage.tsx # src/pages/RateLimitCard.test.tsx # src/pages/RateLimitCard.tsx # src/renderRoute.tsx # src/routeMatchers.ts
|
@Opulencechuks Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Thanks @Opulencechuks! Merged. 🎉 |
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.
Closes #1396
Summary
Splits the 1,465-line
src/pages/PublishApi.tsxinto focused, maintainable modules undersrc/pages/publish/with identical runtime behaviour, DOM structure, accessibility wiring, draft persistence, and payload shaping.Changes
src/pages/publish/model.ts: Pure types, constants (INITIAL_FORM,INITIAL_TOUCHED,CATEGORIES,DRAFT_STORAGE_KEY,ENDPOINTS_ERROR_ID,FIELD_ALIASES), validation helpers (validateForm,validateEndpoints,findDuplicateEndpointIds,fieldStatus), draft shape guard (isPublishFormDraft), server error mapping (normalizeFieldKey,toValidationErrors), and payload builder (toPublishPayload). No React imports.src/pages/publish/usePublishForm.ts: Encapsulates form state, touched tracking,useFormPersistence,useBeforeUnload, throttled description remaining-character announcements, focus management on endpoints-only errors, and idempotent submission viasubmitPublishApi.src/pages/publish/BasicsStep.tsx: Renders the API details fieldset (name, base URL, category, description, andpa-description-counter-livepolite region) with apricingSlotto preserve exact DOM and tab order.src/pages/publish/PricingStep.tsx: Renders the per-call USDC pricing input.src/pages/publish/EndpointEditor.tsx: ExportsOpenApiImportSection(importer toggle +OpenAPIImport) andEndpointEditor(endpoint list, duplicate flagging, removal, andpa-endpoints-erroraria-describedbywiring).src/pages/publish/ReviewSummary.tsx: ExportsReviewSummary(form footer, form-level error alert, submit button) andPublishSuccessView(post-submission confirmation screen).src/pages/publish/publish.css: Extracted stylesheet from the formerSTYLEStemplate string with identical selectors and rule order.src/pages/PublishApi.tsx: Reduced to a 136-line composition root preserving the default export for lazy loading insrc/App.tsxandsrc/renderRoute.tsx.src/pages/publish/model.test.ts: Unit test suite covering validation, duplicate endpoint detection, draft guard, server error alias mapping, andtoPublishPayload.docs/Architecture.md: Added module map forsrc/pages/publish/.Verification
bun test src/pages/publish/model.test.ts: 20 passed, 0 failed.tsc -p tsconfig.json --noEmitfiltered toPublishApiandsrc/pages/publish/: 0 TypeScript errors.id/aria-*attributes, draft key (callora:publish-api:draft), validation messages, and payload shape remain byte-identical.