Refactor react package to re-export from core#142
Draft
TaprootFreak wants to merge 1 commit intodevelopfrom
Draft
Refactor react package to re-export from core#142TaprootFreak wants to merge 1 commit intodevelopfrom
TaprootFreak wants to merge 1 commit intodevelopfrom
Conversation
Replace duplicated definitions, utils, and validations in the react package with thin re-exports from @dfx.swiss/core. This eliminates code duplication across the two packages and establishes core as the single source of truth for types and utilities. - Add missing Utils methods to core (createRules, formatIban, toBase64) - Replace 19 definition files with re-exports from core - Replace utils.ts and validations.ts with re-exports from core - Update kyc.hook to use buildKycUrl(apiUrl) instead of process.env - Update sell.hook and swap.hook to use function-style confirm URLs - Remove redundant ibantools/libphonenumber-js deps from react - Delete duplicate blocked-iban.json from react - No breaking changes to the public API
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.
Summary
@dfx.swiss/reactwith thin re-exports from@dfx.swiss/core@dfx.swiss/coreas single source of truth for all types, enums, utilities, and validation logicChanges
Core (
@dfx.swiss/core)Utilswith 3 methods previously only in react:createRules,formatIban,toBase64React (
@dfx.swiss/react)@dfx.swiss/coreas dependency, removedibantools/libphonenumber-js(now transitive via core)tsconfig.build.jsonutils.ts+validations.tswith re-exports from coreblocked-iban.jsonkyc.hook.ts:KycUrl(process.env) →buildKycUrl(defaultUrl)(framework-agnostic)sell.hook.ts/swap.hook.ts: string-replace URL pattern → function call (SellUrl.confirm(id))Breaking Changes
None. The public API surface of
@dfx.swiss/reactis identical.Test plan
@dfx.swiss/corebuilds successfully@dfx.swiss/reactbuilds successfullydist/index.d.tsexports are identical to before@dfx.swiss/services-reactbuilds against updated react package