-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
437 additions
and
215 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
test-results | ||
node_modules | ||
dist | ||
.turbo | ||
|
||
# Output | ||
.output | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
package-lock.json | ||
pnpm-lock.yaml | ||
yarn.lock | ||
.turbo |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ yarn add @kredeum/wagmi-svelte5 | |
## Quick Start | ||
|
||
```typescript | ||
import { createConfig } from '@kredeum/wagmi-svelte5'; | ||
import { createConfig } from "@kredeum/wagmi-svelte5"; | ||
|
||
// Configure your Web3 settings | ||
const config = createConfig({ | ||
|
@@ -38,7 +38,7 @@ const config = createConfig({ | |
|
||
```svelte | ||
<script> | ||
import { connect } from '@kredeum/wagmi-svelte5'; | ||
import { connect } from "@kredeum/wagmi-svelte5"; | ||
</script> | ||
<button on:click={connect}>Connect Wallet</button> | ||
|
@@ -75,4 +75,4 @@ MIT License - see the [LICENSE](LICENSE) file for details. | |
|
||
## Author | ||
|
||
zapaz.eth <[email protected]> (http://labs.kredeum.com/) | ||
zapaz.eth <[email protected]> (http://labs.kredeum.com/) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "@kredeum/wagmi-svelte5", | ||
"version": "0.1.5", | ||
"type": "module", | ||
"description": "Svelte5 Web3 library based on Wagmi", | ||
"keywords": [ | ||
"svelte", | ||
|
@@ -25,20 +26,28 @@ | |
"sideEffects": [ | ||
"**/*.css" | ||
], | ||
"type": "module", | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
"node": "^22", | ||
"pnpm": "^9" | ||
}, | ||
"scripts": { | ||
"all": "pnpm run setup && pnpm run format && pnpm run check && pnpm run build && pnpm run test && pnpm run dev", | ||
"clean": "rm -rf node_modules .pnpm-lock.yaml .svelte-kit dist", | ||
"setup": "pnpm run clean && pnpm install", | ||
"format": "prettier --write --list-different .", | ||
"check": "prettier --check . && eslint . && svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", | ||
"check": "prettier --check . && eslint . && pnpm run sync && svelte-check --tsconfig ./tsconfig.json", | ||
"build": "vite build", | ||
"test": "npm run test:unit && npm run test:e2e", | ||
"test": "pnpm run test:unit && pnpm run test:e2e", | ||
"dev": "vite dev", | ||
"preview": "vite preview", | ||
"test:unit": "vitest run", | ||
"test:e2e": "playwright test", | ||
"package": "NODE_ENV=prod svelte-kit sync && svelte-package && publint" | ||
"package": "pnpm run sync && svelte-package && publint", | ||
"sync": "NODE_ENV=prod svelte-kit sync", | ||
"prepublishOnly": "pnpm package", | ||
"check:watch": "pnpm run sync && svelte-check --tsconfig ./tsconfig.json --watch", | ||
"lint": "prettier --check . && eslint ." | ||
}, | ||
"dependencies": { | ||
"svelte": "^5.16.0" | ||
|
@@ -50,15 +59,15 @@ | |
"@playwright/test": "^1.49.1", | ||
"@sveltejs/adapter-auto": "^3.3.1", | ||
"@sveltejs/adapter-static": "^3.0.8", | ||
"@sveltejs/kit": "^2.15.0", | ||
"@sveltejs/kit": "^2.15.1", | ||
"@sveltejs/package": "^2.3.7", | ||
"@sveltejs/vite-plugin-svelte": "^4.0.4", | ||
"@types/node": "^22.10.2", | ||
"@wagmi/connectors": "^5.7.3", | ||
"@wagmi/core": "^2.16.3", | ||
"@walletconnect/ethereum-provider": "^2.17.3", | ||
"autoprefixer": "^10.4.20", | ||
"daisyui": "^4.12.22", | ||
"daisyui": "^4.12.23", | ||
"eslint": "^9.17.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-svelte": "^2.46.1", | ||
|
@@ -73,10 +82,11 @@ | |
"svelte-hero-icons": "^5.2.0", | ||
"svelte-hot-french-toast": "^1.0.0", | ||
"tailwindcss": "^3.4.17", | ||
"turbo": "^2.3.3", | ||
"typescript": "^5.7.2", | ||
"typescript-eslint": "^8.18.2", | ||
"viem": "^2.21.57", | ||
"vite": "^5.4.11", | ||
"vitest": "^2.1.8" | ||
} | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
// place files you want to import through the `$lib` alias in this folder. | ||
|
||
// Export components and functionality | ||
export * from "./wagmi"; | ||
|
||
// Export styles | ||
import "./styles/index.pcss"; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script lang="ts"> | ||
import { notification } from "@wagmi-svelte5"; | ||
</script> | ||
|
||
<div class="p-4"> | ||
<button class="btn btn-primary" onclick={() => notification.info("Notification!")}> | ||
Notif | ||
</button> | ||
</div> |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { expect, test } from "@playwright/test"; | ||
|
||
test.describe("Notification Page", () => { | ||
test.beforeEach(async ({ page }) => { | ||
// Navigate to the notification page before each test | ||
await page.goto("/notification"); | ||
}); | ||
|
||
test("should display notification when clicking the button", async ({ page }) => { | ||
// Find and click the notification button | ||
const notifButton = page.getByRole("button", { name: "Notif" }); | ||
await expect(notifButton).toBeVisible(); | ||
await notifButton.click(); | ||
|
||
// Wait for and verify the notification appears | ||
const notification = page.getByText("Notification!"); | ||
await expect(notification).toBeVisible(); | ||
|
||
// Verify the notification has the correct styles (info type) | ||
const notificationContainer = page.locator('[role="status"].notification-info'); | ||
await expect(notificationContainer).toBeVisible(); | ||
await expect(notificationContainer).toHaveClass(/top-0/); | ||
|
||
// Wait for notification to disappear (default timeout is 3000ms) | ||
await expect(notification).toBeHidden({ timeout: 5000 }); | ||
}); | ||
|
||
test("notification should have correct position", async ({ page }) => { | ||
// Click the notification button | ||
await page.getByRole("button", { name: "Notif" }).click(); | ||
|
||
// Get the notification container | ||
const notificationContainer = page.locator('[role="status"].notification-info'); | ||
|
||
// Verify it appears at the top-center (default position) | ||
await expect(notificationContainer).toHaveClass(/top-0/); | ||
}); | ||
|
||
test("should handle multiple notifications", async ({ page }) => { | ||
// Click the button multiple times | ||
const button = page.getByRole("button", { name: "Notif" }); | ||
await button.click(); | ||
await button.click(); | ||
await button.click(); | ||
|
||
// Verify multiple notifications are visible | ||
const notifications = page.locator('[role="status"].notification-info'); | ||
await expect(notifications).toHaveCount(3); | ||
|
||
// Wait for all notifications to disappear | ||
await expect(notifications).toHaveCount(0, { timeout: 5000 }); | ||
}); | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export const PUBLIC_CHAINS = 'anvil,baseSepolia' | ||
export const PUBLIC_POLLING_INTERVAL = '5000' | ||
export const PUBLIC_ALCHEMY_API_KEY = 'test-key' | ||
export const PUBLIC_WALLET_CONNECT_PROJECT_ID = 'test-project-id' | ||
export const PUBLIC_BURNER_WALLET_ONLY_LOCAL = 'true' | ||
export const PUBLIC_BURNER_WALLET_KEY = 'test-key' | ||
export const PUBLIC_CHAINS = "anvil,baseSepolia"; | ||
export const PUBLIC_POLLING_INTERVAL = "5000"; | ||
export const PUBLIC_ALCHEMY_API_KEY = "test-key"; | ||
export const PUBLIC_WALLET_CONNECT_PROJECT_ID = "test-project-id"; | ||
export const PUBLIC_BURNER_WALLET_ONLY_LOCAL = "true"; | ||
export const PUBLIC_BURNER_WALLET_KEY = "test-key"; |
Oops, something went wrong.