Skip to content

Commit 4a3428a

Browse files
authored
Merge pull request #53 from macalinao/igm/linter-updates
Upgrade more dependencies, speed up linting
2 parents ad1421c + d0e677b commit 4a3428a

File tree

23 files changed

+1586
-171
lines changed

23 files changed

+1586
-171
lines changed

.changeset/fast-swans-tap.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@macalinao/wallet-adapter-compat": patch
3+
"@macalinao/react-quarry": patch
4+
"example-dapp": patch
5+
"@macalinao/grill": patch
6+
---
7+
8+
Update dependencies, speed up linting

CLAUDE.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
Grill is a modern Solana development kit monorepo that provides React components and utilities for building Solana applications with automatic account batching and caching. It's built on top of gill-react and integrates with @solana/kit.
7+
Grill is a modern Solana development kit monorepo that provides React components and utilities for building Solana applications with automatic account batching and caching. It's built on top of @gillsdk/react and integrates with @solana/kit.
88

99
## Technology Stack
1010

1111
- **Package Manager**: Bun (v1.2.19)
1212
- **Build System**: Turbo for monorepo orchestration
1313
- **Framework**: React 19 with TypeScript
14-
- **Solana**: @solana/kit, gill, gill-react
14+
- **Solana**: @solana/kit, gill, @gillsdk/react
1515
- **State Management**: @tanstack/react-query for caching
1616
- **Routing**: @tanstack/react-router (in example-dapp)
1717
- **Styling**: Tailwind CSS v4 with shadcn/ui components
@@ -58,6 +58,7 @@ bun run lint:fix # Fix linting and formatting issues
5858
### Monorepo Structure
5959

6060
The project uses Bun workspaces with packages in two directories:
61+
6162
- `packages/*` - Core library packages
6263
- `apps/*` - Example applications
6364

@@ -80,9 +81,10 @@ The project uses Bun workspaces with packages in two directories:
8081
### Provider Hierarchy
8182

8283
When using Grill, providers must be set up in this order:
84+
8385
```tsx
8486
QueryClientProvider
85-
SolanaProvider (gill-react)
87+
SolanaProvider (@gillsdk/react)
8688
ConnectionProvider (@solana/wallet-adapter-react)
8789
WalletProvider (@solana/wallet-adapter-react)
8890
WalletModalProvider
@@ -92,6 +94,7 @@ QueryClientProvider
9294
### Account Batching Architecture
9395

9496
The core innovation is automatic batching of concurrent account requests:
97+
9598
- Multiple `useAccount` calls in different components are automatically batched
9699
- Uses DataLoader pattern to coalesce requests within a tick
97100
- Single RPC call instead of multiple, improving performance
@@ -100,12 +103,14 @@ The core innovation is automatic batching of concurrent account requests:
100103
### Kit Wallet Integration
101104

102105
Provides two contexts:
106+
103107
1. Account batching context (GrillProvider)
104108
2. Wallet context for TransactionSendingSigner (WalletProvider from grill)
105109

106110
## Code Style Guidelines
107111

108112
### TypeScript
113+
109114
- Use specific types, avoid `any`
110115
- Prefer interfaces over type aliases for objects
111116
- Use `import type` for type-only imports (enforced by Biome)
@@ -114,17 +119,21 @@ Provides two contexts:
114119
- Follow default Prettier settings
115120

116121
### After Making Code Changes
122+
117123
**Always run these commands to ensure code quality:**
124+
118125
1. `bun run build` - Check for TypeScript errors
119126
2. `bun run lint:fix` - Fix linting and formatting issues
120127

121128
### React Components
129+
122130
- Small, focused components
123131
- Use function components with hooks
124132
- Props interfaces should be explicitly defined
125133
- File structure: `components/category/component-name/index.tsx`
126134

127135
### Biome/ESLint Configuration
136+
128137
- No floating promises (must be handled)
129138
- Use const assertions where applicable
130139
- No non-null assertions are allowed
@@ -135,20 +144,23 @@ Provides two contexts:
135144
## Example App (example-dapp)
136145

137146
The example-dapp demonstrates:
147+
138148
- TanStack Router for routing
139149
- shadcn/ui component integration
140150
- Wallet connection with Solana wallet adapter
141151
- Layout system with navigation and sidebar
142152
- Dark mode support
143153

144154
Routes:
155+
145156
- `/` - Home page
146157
- `/dashboard` - Simple dashboard
147158
- `/examples/*` - Examples section with sidebar navigation
148159

149160
## Turborepo Configuration
150161

151162
Tasks are defined in turbo.json:
163+
152164
- `build`: Depends on upstream builds, outputs to `./dist/**`
153165
- `lint`: Depends on upstream builds
154166
- `test`: Depends on build, no caching
@@ -157,6 +169,7 @@ Tasks are defined in turbo.json:
157169
## Working with Providers
158170

159171
When creating new features that need account data:
172+
160173
1. Ensure component is wrapped in GrillProvider
161174
2. Use `useAccount` hook for fetching account data
162175
3. Account requests are automatically batched
@@ -165,13 +178,15 @@ When creating new features that need account data:
165178
## Vendor Documentation
166179

167180
The repository includes vendor documentation at `/docs/vendor/`:
181+
168182
- `gill.md` - Complete documentation for the gill library (Solana client library)
169183
- Includes transaction builders, token operations, and program clients
170184
- Used as the foundation for Solana operations in Grill
171185

172186
## CI/CD
173187

174188
GitHub Actions workflow runs on push/PR to main:
189+
175190
- Installs dependencies with frozen lockfile
176191
- Builds all packages
177192
- Runs linting (biome + eslint)
@@ -188,6 +203,7 @@ GitHub Actions workflow runs on push/PR to main:
188203
## Package Structure Guidelines
189204

190205
When creating new packages:
206+
191207
- Use TypeScript directly with `tsc` for building (no tsup/rollup/etc)
192208
- Follow the same structure as existing packages
193209
- Scripts should be: `build`, `build:watch`, `clean`, `typecheck`
@@ -197,8 +213,9 @@ When creating new packages:
197213
## Solana PDA Guidelines
198214

199215
When working with PDAs (Program Derived Addresses) in React code:
216+
200217
- **ALWAYS use PDA hooks** from the pdas directory (e.g., `useMergePoolPda`, `useMinerPda`)
201218
- **NEVER compute PDAs manually** in React components or providers
202219
- **NEVER use async PDA functions** like `findMergePoolPda()` directly in React code
203220
- PDA hooks are synchronous and properly memoized for React
204-
- This ensures consistent PDA computation and proper React lifecycle management
221+
- This ensures consistent PDA computation and proper React lifecycle management

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ A comprehensive toolkit for building Solana applications with React, featuring a
88

99
### [@macalinao/grill](./packages/grill)
1010

11-
React provider for Solana account management with automatic batching and caching, built on top of gill-react.
11+
React provider for Solana account management with automatic batching and caching, built on top of @gillsdk/react.
1212

1313
```bash
14-
bun add @macalinao/grill gill-react gill
14+
bun add @macalinao/grill @gillsdk/react gill
1515
```
1616

1717
### [@macalinao/solana-batch-accounts-loader](./packages/solana-batch-accounts-loader)
@@ -44,7 +44,7 @@ bun add @macalinao/dataloader-es
4444
import { GrillProvider } from "@macalinao/grill";
4545
import { WalletAdapterCompatProvider } from "@macalinao/wallet-adapter-compat";
4646
import { createSolanaClient } from "gill";
47-
import { SolanaProvider } from "gill-react";
47+
import { SolanaProvider } from "@gillsdk/react";
4848
import {
4949
ConnectionProvider,
5050
WalletProvider,

apps/example-dapp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function WalletInfo() {
113113
### Making RPC Calls
114114

115115
```typescript
116-
import { useSolanaClient } from "gill-react";
116+
import { useSolanaClient } from "@gillsdk/react";
117117

118118
function SlotDisplay() {
119119
const { rpc } = useSolanaClient();

apps/example-dapp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"class-variance-authority": "^0.7.1",
4848
"clsx": "^2.1.1",
4949
"gill": "catalog:",
50-
"gill-react": "catalog:",
50+
"@gillsdk/react": "catalog:",
5151
"lucide-react": "^0.542.0",
5252
"react": "catalog:",
5353
"react-dom": "catalog:",

apps/example-dapp/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type * as React from "react";
2+
import { SolanaProvider } from "@gillsdk/react";
23
import { GrillProvider, getSolscanExplorerLink } from "@macalinao/grill";
34
import { WalletAdapterCompatProvider } from "@macalinao/wallet-adapter-compat";
45
import {
@@ -14,11 +15,10 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
1415
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
1516
import { createRouter, RouterProvider } from "@tanstack/react-router";
1617
import { createSolanaClient, getPublicSolanaRpcUrl } from "gill";
17-
import { SolanaProvider } from "gill-react";
1818
import { useMemo } from "react";
1919
import { Toaster } from "sonner";
20-
import { ThemeProvider } from "./components/theme-provider";
21-
import { routeTree } from "./routeTree.gen";
20+
import { ThemeProvider } from "./components/theme-provider.js";
21+
import { routeTree } from "./routeTree.gen.js";
2222

2323
// Create the router instance
2424
const router = createRouter({ routeTree });

apps/example-dapp/src/components/SimpleDashboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type * as React from "react";
2+
import { useSolanaClient } from "@gillsdk/react";
23
import { useAccount, useKitWallet } from "@macalinao/grill";
34
import { WalletMultiButton } from "@solana/wallet-adapter-react-ui";
4-
import { useSolanaClient } from "gill-react";
55
import { useState } from "react";
66
import { toast } from "sonner";
77
import { Button } from "@/components/ui/button";

apps/example-dapp/src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { StrictMode } from "react";
33
import { createRoot } from "react-dom/client";
44
import "./index.css";
5-
import { App } from "./App";
5+
import { App } from "./App.js";
66

77
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
88
createRoot(document.getElementById("root")!).render(

apps/example-dapp/src/routes/examples/token-balances.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { useATABalance } from "@macalinao/grill";
2-
import { formatTokenAmount } from "@macalinao/token-utils";
1+
import { formatTokenAmount, useATABalance } from "@macalinao/grill";
32
import { address } from "@solana/kit";
43
import { useWallet } from "@solana/wallet-adapter-react";
54
import { createFileRoute } from "@tanstack/react-router";

biome.json renamed to biome.jsonc

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
"defaultBranch": "master"
88
},
99
"files": {
10-
"ignoreUnknown": false
10+
"ignoreUnknown": false,
11+
"includes": [
12+
"**",
13+
"!**/bun.lock",
14+
"!apps/example-dapp/src/routeTree.gen.ts"
15+
]
1116
},
1217
"formatter": {
1318
"enabled": true,
@@ -18,12 +23,7 @@
1823
"lineEnding": "lf",
1924
"lineWidth": 80,
2025
"attributePosition": "auto",
21-
"bracketSpacing": true,
22-
"includes": [
23-
"**",
24-
"!**/bun.lock",
25-
"!apps/example-dapp/src/routeTree.gen.ts"
26-
]
26+
"bracketSpacing": true
2727
},
2828
"linter": {
2929
"enabled": true,
@@ -34,7 +34,8 @@
3434
"recommended": true,
3535
"nursery": {
3636
"useConsistentTypeDefinitions": "error",
37-
"noFloatingPromises": "error"
37+
"noFloatingPromises": "error",
38+
"noUnnecessaryConditions": "error"
3839
},
3940
"complexity": {
4041
"useSimplifiedLogicExpression": "error"
@@ -72,13 +73,22 @@
7273
},
7374
"correctness": {
7475
"noUnusedVariables": "warn",
75-
"noUnusedImports": "error"
76+
"noUnusedImports": "error",
77+
"noUndeclaredDependencies": "error",
78+
"useImportExtensions": {
79+
"level": "error",
80+
"options": {
81+
"forceJsExtensions": true
82+
}
83+
}
7684
}
77-
}
85+
},
86+
"includes": ["**", "!**/bun.lock"]
7887
},
7988
"assist": {
8089
"actions": {
8190
"source": {
91+
// Organizes imports and splits out type imports into a separate line
8292
"organizeImports": {
8393
"level": "on",
8494
"options": {
@@ -90,13 +100,13 @@
90100
},
91101
"javascript": {
92102
"formatter": {
93-
"quoteStyle": "double",
94103
"jsxQuoteStyle": "double",
95104
"quoteProperties": "asNeeded",
96105
"trailingCommas": "all",
97106
"semicolons": "always",
98107
"arrowParentheses": "always",
99108
"bracketSameLine": false,
109+
"attributePosition": "auto",
100110
"bracketSpacing": true
101111
}
102112
},

0 commit comments

Comments
 (0)