Skip to content

Commit

Permalink
feat: base sveltekit
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanaden committed Sep 19, 2024
1 parent aec66ff commit 7a400bc
Show file tree
Hide file tree
Showing 33 changed files with 894 additions and 448 deletions.
46 changes: 23 additions & 23 deletions examples/react-next/package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"name": "@solana-wallets-solid/react-next",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"react": "^18",
"react-dom": "^18",
"next": "14.2.12",
"@nanostores/react": "^0.7.3",
"@solana-wallets-solid/react": "workspace:*",
"@solana-wallets-solid/unified": "workspace:*"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18"
}
"name": "@solana-wallets-solid/react-next",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"react": "^18",
"react-dom": "^18",
"next": "14.2.12",
"@nanostores/react": "^0.7.3",
"@solana-wallets-solid/react": "workspace:*",
"@solana-wallets-solid/unified": "workspace:*"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18"
}
}
5 changes: 4 additions & 1 deletion examples/react-next/src/app/page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@
padding: 0 20px;
border: none;
border: 1px solid transparent;
transition: background 0.2s, color 0.2s, border-color 0.2s;
transition:
background 0.2s,
color 0.2s,
border-color 0.2s;
cursor: pointer;
display: flex;
align-items: center;
Expand Down
8 changes: 1 addition & 7 deletions examples/react-vite/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{
"cSpell.words": [
"lightningcss",
"packagejson",
"tailwindcss",
"tilg",
"wireit"
]
"cSpell.words": ["lightningcss", "packagejson", "tailwindcss", "tilg", "wireit"]
}
70 changes: 35 additions & 35 deletions examples/react-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
{
"name": "@solana-wallets-solid/react-vite",
"version": "0.0.0",
"type": "module",
"scripts": {
"typecheck": "tsc",
"build": "vite build",
"dev": "vite --host",
"preview": "vite preview"
},
"dependencies": {
"@nanostores/react": "^0.7.3",
"@solana-wallets-solid/react": "workspace:*",
"@solana-wallets-solid/unified": "workspace:*",
"@solana/spl-token": "^0.4.8",
"@solana/web3.js": "^1.95.3",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.26.2",
"vite-plugin-node-polyfills": "^0.22.0"
},
"devDependencies": {
"@types/node": "20.16.5",
"@types/react": "18.3.7",
"@types/react-dom": "18.3.0",
"@vitejs/plugin-react-swc": "3.7.0",
"autoprefixer": "10.4.20",
"is-ci": "3.0.1",
"lightningcss": "1.27.0",
"postcss": "8.4.47",
"sort-package-json": "2.10.1",
"tailwindcss": "3.4.12",
"typescript": "5.6.2",
"vite": "5.4.6",
"vite-tsconfig-paths": "5.0.1"
}
"name": "@solana-wallets-solid/react-vite",
"version": "0.0.0",
"type": "module",
"scripts": {
"typecheck": "tsc",
"build": "vite build",
"dev": "vite --host",
"preview": "vite preview"
},
"dependencies": {
"@nanostores/react": "^0.7.3",
"@solana-wallets-solid/react": "workspace:*",
"@solana-wallets-solid/unified": "workspace:*",
"@solana/spl-token": "^0.4.8",
"@solana/web3.js": "^1.95.3",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.26.2",
"vite-plugin-node-polyfills": "^0.22.0"
},
"devDependencies": {
"@types/node": "20.16.5",
"@types/react": "18.3.7",
"@types/react-dom": "18.3.0",
"@vitejs/plugin-react-swc": "3.7.0",
"autoprefixer": "10.4.20",
"is-ci": "3.0.1",
"lightningcss": "1.27.0",
"postcss": "8.4.47",
"sort-package-json": "2.10.1",
"tailwindcss": "3.4.12",
"typescript": "5.6.2",
"vite": "5.4.6",
"vite-tsconfig-paths": "5.0.1"
}
}
2 changes: 1 addition & 1 deletion examples/react-vite/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export default {
tailwindcss: {},
autoprefixer: {},
},
};
}
17 changes: 7 additions & 10 deletions examples/react-vite/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { Fragment } from "react";
import { Outlet, ScrollRestoration } from "react-router-dom";
import {
UnifiedWalletButtonProps,
UnifiedWalletProviderProps,
} from "@solana-wallets-solid/unified";
import { WalletProvider } from "@solana-wallets-solid/react";
import { Fragment } from "react"
import { Outlet, ScrollRestoration } from "react-router-dom"
import { UnifiedWalletButtonProps, UnifiedWalletProviderProps } from "@solana-wallets-solid/unified"
import { WalletProvider } from "@solana-wallets-solid/react"

declare global {
namespace JSX {
Expand All @@ -13,14 +10,14 @@ declare global {
React.HTMLAttributes<HTMLElement>,
HTMLElement
> &
UnifiedWalletProviderProps;
UnifiedWalletProviderProps
}
interface IntrinsicElements {
"unified-wallet-modal-button": React.DetailedHTMLProps<
React.HTMLAttributes<HTMLElement>,
HTMLElement
> &
UnifiedWalletButtonProps;
UnifiedWalletButtonProps
}
}
}
Expand Down Expand Up @@ -56,5 +53,5 @@ export default function App() {
</Fragment>
</WalletProvider>
</Fragment>
);
)
}
4 changes: 2 additions & 2 deletions examples/react-vite/src/global.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import "@/styles/tailwind.css";
import "@solana-wallets-solid/unified/index.css";
import "@/styles/tailwind.css"
import "@solana-wallets-solid/unified/index.css"
42 changes: 21 additions & 21 deletions examples/react-vite/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import routes from "@/routes";
import App from "@/App";
import "@/global";
import { loadCustomElements } from "@solana-wallets-solid/unified";
import { StrictMode } from "react"
import { createRoot } from "react-dom/client"
import { createBrowserRouter, RouterProvider } from "react-router-dom"
import routes from "@/routes"
import App from "@/App"
import "@/global"
import { loadCustomElements } from "@solana-wallets-solid/unified"

loadCustomElements();
const container = document.getElementById("root") as HTMLElement;
loadCustomElements()
const container = document.getElementById("root") as HTMLElement

const root = createRoot(container);
const root = createRoot(container)

const router = createBrowserRouter([
{
path: "/",
element: <App />,
children: routes,
errorElement: <div>error</div>,
},
]);
{
path: "/",
element: <App />,
children: routes,
errorElement: <div>error</div>,
},
])

root.render(
<StrictMode>
<RouterProvider router={router} fallbackElement={<div>loading...</div>} />
</StrictMode>,
);
<StrictMode>
<RouterProvider router={router} fallbackElement={<div>loading...</div>} />
</StrictMode>,
)
2 changes: 1 addition & 1 deletion examples/react-vite/src/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default function Notfound() {
return <div>404</div>;
return <div>404</div>
}
12 changes: 6 additions & 6 deletions examples/react-vite/src/routes.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { lazy, Suspense } from "react";
import { type RouteObject } from "react-router-dom";
import { lazy, Suspense } from "react"
import { type RouteObject } from "react-router-dom"

const Index = lazy(() => import("@/pages/index"));
const Notfound = lazy(() => import("@/pages/404"));
const Index = lazy(() => import("@/pages/index"))
const Notfound = lazy(() => import("@/pages/404"))

export const routes: Array<RouteObject> = [
{
Expand All @@ -21,6 +21,6 @@ export const routes: Array<RouteObject> = [
</Suspense>
),
},
];
]

export default routes;
export default routes
2 changes: 1 addition & 1 deletion examples/react-vite/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export default {
extend: {},
},
plugins: [],
};
}
64 changes: 32 additions & 32 deletions examples/start-tailwind/package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"name": "@solana-wallets-solid/start-tailwind",
"type": "module",
"private": true,
"scripts": {
"dev": "vinxi dev",
"build": "vinxi build",
"start": "vinxi start",
"typecheck": "tsc --noEmit -p tsconfig.typecheck.json",
"deploy": "vinxi build && wrangler pages deploy dist"
},
"dependencies": {
"@nanostores/solid": "^0.4.2",
"@solana-wallets-solid/solid": "workspace:*",
"@solana-wallets-solid/unified": "workspace:*",
"@solana/spl-token": "^0.4.8",
"@solana/web3.js": "^1.95.3",
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.6",
"nanostores": "^0.11.3",
"solid-js": "^1.8.18",
"vinxi": "^0.4.1",
"vite-plugin-node-polyfills": "^0.22.0"
},
"engines": {
"node": ">=18"
},
"devDependencies": {
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"wrangler": "^3.70.0"
}
"name": "@solana-wallets-solid/start-tailwind",
"type": "module",
"private": true,
"scripts": {
"dev": "vinxi dev",
"build": "vinxi build",
"start": "vinxi start",
"typecheck": "tsc --noEmit -p tsconfig.typecheck.json",
"deploy": "vinxi build && wrangler pages deploy dist"
},
"dependencies": {
"@nanostores/solid": "^0.4.2",
"@solana-wallets-solid/solid": "workspace:*",
"@solana-wallets-solid/unified": "workspace:*",
"@solana/spl-token": "^0.4.8",
"@solana/web3.js": "^1.95.3",
"@solidjs/router": "^0.14.1",
"@solidjs/start": "^1.0.6",
"nanostores": "^0.11.3",
"solid-js": "^1.8.18",
"vinxi": "^0.4.1",
"vite-plugin-node-polyfills": "^0.22.0"
},
"engines": {
"node": ">=18"
},
"devDependencies": {
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"wrangler": "^3.70.0"
}
}
40 changes: 18 additions & 22 deletions examples/start-tailwind/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",
"allowJs": true,
"noEmit": true,
"strict": true,
"types": [
"vinxi/types/client"
],
"isolatedModules": true,
"paths": {
"~/*": [
"./src/*"
]
},
"skipLibCheck": true
}
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",
"allowJs": true,
"noEmit": true,
"strict": true,
"types": ["vinxi/types/client"],
"isolatedModules": true,
"paths": {
"~/*": ["./src/*"]
},
"skipLibCheck": true
}
}
Loading

0 comments on commit 7a400bc

Please sign in to comment.