Skip to content
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

chore: siwe to siwx migration #3194

Merged
merged 44 commits into from
Nov 18, 2024
Merged

chore: siwe to siwx migration #3194

merged 44 commits into from
Nov 18, 2024

Conversation

zoruka
Copy link
Contributor

@zoruka zoruka commented Nov 4, 2024

Description

  • Replace the whole SIWE logic inside AppKit package with SIWX;
  • Let all SIWX code present in AppKit inside SIWXUtil object centralizing the logic spread around the code;
  • Correction into default implementation of SIWX LocalStorage to validate getting sessions.

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-1408
For GH issues: closes #...

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copy link

linear bot commented Nov 4, 2024

Copy link

changeset-bot bot commented Nov 4, 2024

🦋 Changeset detected

Latest commit: b11becf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@reown/appkit-adapter-solana Minor
@reown/appkit-scaffold-ui Minor
@apps/laboratory Minor
@reown/appkit Minor
@reown/appkit-core Minor
@reown/appkit-siwe Minor
@reown/appkit-siwx Minor
@apps/demo Minor
@apps/gallery Minor
@reown/appkit-adapter-ethers Minor
@reown/appkit-adapter-ethers5 Minor
@reown/appkit-adapter-polkadot Minor
@reown/appkit-adapter-wagmi Minor
@reown/appkit-utils Minor
@reown/appkit-cdn Minor
@reown/appkit-common Minor
@reown/appkit-experimental Minor
@reown/appkit-polyfills Minor
@reown/appkit-ui Minor
@reown/appkit-wallet Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Nov 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
appkit-gallery ✅ Ready (Inspect) Visit Preview Nov 18, 2024 4:20pm
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 18, 2024 4:20pm
appkit-vue-solana ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 18, 2024 4:20pm
appkit-wagmi-cdn-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 18, 2024 4:20pm
vue-wagmi-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 18, 2024 4:20pm
web3modal-gallery ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 18, 2024 4:20pm

Copy link
Contributor

github-actions bot commented Nov 4, 2024

Coverage Report for Coverage

Status Category Percentage Covered / Total
🔵 Lines 325.48999999999995% 4466 / 22920
🔵 Statements 325.48999999999995% 4466 / 22920
🔵 Functions 363.95000000000005% 376 / 1417
🔵 Branches 465.4899999999999% 706 / 1681
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/src/client.ts 46.37% 69.28% 69.42% 46.37% 189-190, 233-234, 237-238, 253-256, 259-262, 265-266, 295-306, 309-318, 413, 417, 424, 462-465, 471-478, 481, 569-581, 596-599, 606-607, 615-616, 631-632, 635-636, 639-640, 643-644, 653-663, 669-676, 693-696, 705-734, 736-769, 771-775, 777-795, 797-802, 804-812, 814-823, 825-845, 847-854, 856-867, 869-882, 884-887, 889-892, 894-897, 899-902, 904-911, 916-976, 979-992, 1000-1001, 1009-1120, 1126-1129, 1133-1163, 1172-1187, 1191-1193, 1197-1212, 1217-1227, 1230-1302, 1305-1319, 1322-1334, 1346, 1363, 1378-1379, 1392-1398, 1400-1411, 1413-1420, 1442-1458, 1463-1465, 1473-1477, 1492, 1506, 1508-1509, 1514-1526, 1537, 1539-1540, 1546-1557, 1564-1565, 1575, 1577, 1658, 1669-1681
packages/appkit/src/universal-adapter/client.ts 34.05% 100% 15.78% 34.05% 29-38, 47-48, 51-56, 59-92, 101-104, 107-111, 114-117, 120-123, 126-129, 132-133, 136-137, 140-141, 144-145, 148-149, 152-159, 174-179
packages/core/exports/index.ts 100% 100% 100% 100%
packages/core/src/controllers/AccountController.ts 44.02% 83.33% 40% 44.02% 61-62, 68-75, 78-99, 102-103, 106-107, 110-113, 158-159, 170-171, 174-175, 178-181, 184-187, 190-194, 204-210, 213-219, 222-228, 231-260
packages/core/src/controllers/ConnectionController.ts 43.82% 66.66% 28% 43.82% 86-90, 104-134, 152-154, 157-173, 176-177, 180-181, 184-185, 188-189, 192-193, 196-197, 200-201, 204-205, 208-209, 212-213, 230-231, 234-236, 239-240, 243-244, 247-248, 256-262, 267-268
packages/core/src/utils/SIWXUtil.ts 5.55% 100% 0% 5.55% 17-18, 20-52, 54-118, 120-132, 134-143, 145-157, 159-246, 248-254
packages/core/src/utils/TypeUtil.ts 100% 100% 100% 100%
packages/scaffold-ui/src/modal/w3m-modal/index.ts 0% 0% 0% 0% 1-195
packages/scaffold-ui/src/partials/w3m-header/index.ts 0% 0% 0% 0% 1-315
packages/scaffold-ui/src/views/w3m-connecting-wc-view/index.ts 0% 0% 0% 0% 1-212
packages/scaffold-ui/src/views/w3m-email-verify-otp-view/index.ts 0% 0% 0% 0% 1-51
packages/scaffold-ui/src/views/w3m-siwx-sign-message-view/index.ts 0% 0% 0% 0% 1-77
packages/siwx/src/core/SIWXConfig.ts 23.68% 100% 0% 23.68% 17-20, 23-24, 27-33, 36-44, 47-48, 51-52, 55-61
packages/siwx/src/core/SIWXStorage.ts 100% 100% 100% 100%
packages/siwx/src/storages/LocalStorage.ts 77.55% 62.5% 85.71% 77.55% 13-18, 35-36, 40-41, 60-61
Generated in workflow #7386 for commit 7ed50aa by the Vitest Coverage Report Action

Copy link
Contributor Author

@zoruka zoruka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've let some comments why changing the tests as this concerns me and we might check if these changes makes sense

cc @tomiir

@@ -53,5 +56,5 @@ test('it should switch networks and sign siwe', async () => {
test('it should switch to Solana and validate chain title', async () => {
const chainName = 'Solana'
await modalPage.switchNetwork(chainName)
await modalValidator.expectSwitchChainView(chainName.toLocaleLowerCase())
await modalValidator.expectSwitchedNetworkOnNetworksView(chainName)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, if the expected behavior is to keep switch chain view open after the chain is switched, this test was wrong.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how was it passing before?

Copy link
Contributor

@magiziz magiziz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

Copy link
Contributor

github-actions bot commented Nov 18, 2024

Warnings
⚠️ Changes were made to one or more package.json(s), but not to pnpm-lock.yaml

Generated by 🚫 dangerJS against 7ed50aa

@elix1er
Copy link

elix1er commented Nov 19, 2024

wen release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants