Skip to content

Commit

Permalink
wip: lesgo
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Sep 24, 2024
1 parent 25d682e commit cc5e3ac
Show file tree
Hide file tree
Showing 18 changed files with 2,024 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules/

# Compiler files
cache/
out/
Expand Down
25 changes: 8 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
# exp-0001

### Build
## Contracts

```shell
$ forge build
$ forge build # Build
$ forge test # Test
$ forge fmt # Format
$ forge snapshot # Gas Snapshots
```

### Test
## Examples

```shell
$ forge test
```

### Format

```shell
$ forge fmt
```

### Gas Snapshots

```shell
$ forge snapshot
```
$ pnpm dev # Run
```
49 changes: 49 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.2/schema.json",
"files": {
"ignore": [
"tsconfig.json",
"tsconfig.*.json"
]
},
"organizeImports": {
"enabled": true
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noBannedTypes": "off"
},
"performance": {
"noDelete": "off"
},
"style": {
"noNonNullAssertion": "off",
"useTemplate": "off"
},
"suspicious": {
"noAssignInExpressions": "off",
"noExplicitAny": "off"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"trailingCommas": "all",
"semicolons": "asNeeded"
}
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
}
4 changes: 2 additions & 2 deletions contracts/src/utils/WebAuthnP256.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ library WebAuthnP256 {
struct Metadata {
bytes authenticatorData;
string clientDataJSON;
uint256 challengeIndex;
uint256 typeIndex;
uint16 challengeIndex;
uint16 typeIndex;
bool userVerificationRequired;
}

Expand Down
24 changes: 24 additions & 0 deletions examples/webauthn/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
50 changes: 50 additions & 0 deletions examples/webauthn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default tseslint.config({
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
})
```

- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
- Optionally add `...tseslint.configs.stylisticTypeChecked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:

```js
// eslint.config.js
import react from 'eslint-plugin-react'

export default tseslint.config({
// Set the react version
settings: { react: { version: '18.3' } },
plugins: {
// Add the react plugin
react,
},
rules: {
// other rules...
// Enable its recommended rules
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
},
})
```
12 changes: 12 additions & 0 deletions examples/webauthn/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>WebAuthn Batch Delegation</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
23 changes: 23 additions & 0 deletions examples/webauthn/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "example-webauthn",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"ox": "0.0.0-canary-20240923043550",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"viem": "^2.21.14"
},
"devDependencies": {
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"globals": "^15.9.0",
"vite": "^5.4.1"
}
}
Loading

0 comments on commit cc5e3ac

Please sign in to comment.