chore: restructure shared and react to use /core package #838
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
Update all imports from
core
to import fromcore/legacy
and move some functionality from/shared
to/core
.In long term we will remove
wallets-shared
, a part of this PR is movingcore
-related functionality towallets-ocre
. And also this PR prefixed all the legacy core withlegacyThenSomething
to make sure we are flagging them and give a notice they are deprecated and will be removed in next major version.Aliasing
In those packages who imported types or functions from legacy code, you will see I'm aliasing the
legacySomething
tolegacySomething as something
, this is because I wanted to update only imports and not the usages. I believe this is more appropriate way to reduce the changes.core/legacy/package.json
module system other than
node16
andbundler
doesn't have support forpackage.json
'sexports
field. For backward-compatibility reasons we needed a workaround. I checked some repositories and all of them used the way thar I used in this PR. here is an example.How did you test this change?
It shouldn't have any side effect on user side. it can affect our building process. so make sure the project will be build correctly.
Related PRs
Checklist: