-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates wagmi/viem and related ecosystem
- Loading branch information
Showing
16 changed files
with
15,486 additions
and
9,119 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,15 +1,14 @@ | ||
/** @type {import('eslint').Linter.Config} */ | ||
module.exports = { | ||
extends: ['@remix-run/eslint-config', '@remix-run/eslint-config/node'], | ||
rules: { | ||
// Defensive programming - Ensure that objects dont result in false positives when used in conditionals | ||
'@typescript-eslint/strict-boolean-expressions': [ | ||
'error', | ||
{ | ||
allowNullableBoolean: true, | ||
allowNullableString: true, | ||
allowNullableNumber: true, | ||
}, | ||
], | ||
root: true, | ||
plugins: ['@typescript-eslint'], // Use the TypeScript plugin | ||
parser: '@typescript-eslint/parser', // Use the TypeScript parser for ESLint, | ||
parserOptions: { | ||
project: './tsconfig.json', // Set the TS-config file | ||
}, | ||
extends: [ | ||
'@remix-run/eslint-config', | ||
'@remix-run/eslint-config/node', | ||
// 'plugin:@typescript-eslint/recommended', // Use TypeScript recommended rules | ||
], | ||
} |
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,28 @@ | ||
/** | ||
* This is used in both `entry.server.ts` and `root.tsx` to ensure that | ||
* the environment variables are set and globally available before the app is | ||
* started. | ||
* | ||
* NOTE: Do *not* add any environment variables in here that you do not wish to | ||
* be included in the client. | ||
* @returns all public ENV variables | ||
*/ | ||
export function getEnv() { | ||
return { | ||
MODE: process.env.NODE_ENV, | ||
WALLETCONNECT_PROJECT_ID: process.env.WALLETCONNECT_PROJECT_ID, | ||
ALCHEMY_MAINNET_RPC_URL: process.env.ALCHEMY_MAINNET_RPC_URL, | ||
ALCHEMY_BASE_SEPOLIA_RPC_URL: process.env.ALCHEMY_BASE_SEPOLIA_RPC_URL, | ||
ALCHEMY_BASE_RPC_URL: process.env.ALCHEMY_BASE_RPC_URL | ||
} | ||
} | ||
|
||
type ENV = ReturnType<typeof getEnv> | ||
|
||
declare global { | ||
var ENV: ENV | ||
|
||
interface Window { | ||
ENV: ENV | ||
} | ||
} |
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,24 @@ | ||
import { createCookieSessionStorage } from '@remix-run/node' | ||
import process from 'process' | ||
|
||
// export async function loader() { | ||
// const sessionSecret = process.env.SESSION_SECRET | ||
// } | ||
|
||
// const sessionSecret = process.env.SESSION_SECRET | ||
// if (!sessionSecret) throw new Error('SESSION_SECRET is not set') | ||
|
||
export let sessionStorage = createCookieSessionStorage({ | ||
cookie: { | ||
name: '_session', // use any name you want here | ||
sameSite: 'lax', // this helps with CSRF | ||
path: '/', // remember to add this so the cookie will work in all routes | ||
httpOnly: true, // for security reasons, make this cookie http only | ||
secrets: ['s3cr3t'], // replace this with an actual secret | ||
secure: process.env.NODE_ENV === 'production', // enable this in prod only, | ||
maxAge: 60 * 60 * 24 * 30, // 30 days | ||
}, | ||
}) | ||
|
||
// you can also export the methods individually for your own usage | ||
export let { getSession, commitSession, destroySession } = sessionStorage |
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
Oops, something went wrong.