@@ -38,90 +38,70 @@ packages/connector/
3838│ │ ├── transaction/ # Transaction signing
3939│ │ ├── cluster/ # Network/cluster management
4040│ │ ├── health/ # Health checks and diagnostics
41- │ │ └── adapters/ # Storage and wallet adapters
41+ │ │ ├── adapters/ # Storage and wallet adapters
42+ │ │ ├── kit-signers/ # @solana/kit transaction signers
43+ │ │ ├── kit-utils/ # @solana/kit utilities
44+ │ │ ├── errors/ # Error types and handling
45+ │ │ └── utils/ # Internal utilities
4246│ ├── hooks/ # React hooks
4347│ ├── components/ # React components (elements)
4448│ ├── ui/ # UI providers and error boundaries
4549│ ├── config/ # Configuration utilities
4650│ ├── types/ # TypeScript type definitions
47- │ └── utils/ # Utility functions
48- ├── __ tests__ / # Test utilities and fixtures
49- ├── examples/ # Example implementations
51+ │ ├── utils/ # Public utility functions
52+ │ └── __ tests__ / # Test utilities and fixtures
5053└── dist/ # Build output (gitignored)
5154```
5255
5356## Development Workflow
5457
58+ ### Running the Example App
59+
60+ ```bash
61+ # From repository root
62+ cd examples/next-js
63+ pnpm dev
64+ ```
65+
5566### Code Style
5667
5768- Use TypeScript for all new code
5869- Follow the existing code style (Prettier + ESLint)
59- - Use functional and declarative programming patterns; avoid classes
70+ - Use functional and declarative patterns; avoid classes
6071- Prefer named exports for components
6172- Use descriptive variable names with auxiliary verbs (e.g., ` isLoading ` , ` hasError ` )
62- - Write meaningful commit messages following [Conventional Commits](https://www.conventionalcommits.org/)
6373
6474### Testing
6575
66- - Add tests for new functionality
6776- Tests are co-located with source files (` .test.ts ` or ` .test.tsx ` )
68- - Ensure all tests pass: `pnpm test`
69- - Run tests in watch mode during development: `pnpm test:watch`
70- - Maintain or improve code coverage (target: 80%+)
71- - Use Vitest for testing
77+ - Run tests: ` pnpm test `
78+ - Watch mode: ` pnpm test:watch `
79+ - Uses Vitest
7280
7381### Before Submitting
7482
7583``` bash
76- # From the repository root
77- cd packages/connector
78-
79- # Format code
80- pnpm format
81-
82- # Lint code
83- pnpm lint
84-
85- # Type check
86- pnpm type-check
87-
88- # Build
89- pnpm build
90-
91- # Run tests
92- pnpm test
93-
94- # Check bundle size
95- pnpm size
96- ```
97-
98- ### Running Examples
99-
100- Test your changes with the example app:
101-
102- ``` bash
103- # From repository root
104- cd examples/next-js
105- pnpm dev
84+ # From packages/connector
85+ pnpm lint # Lint code
86+ pnpm type-check # Type check
87+ pnpm build # Build
88+ pnpm test # Run tests
10689```
10790
10891## Pull Request Guidelines
10992
110- 1 . ** Clear Description** : Explain what changes you made and why
111- 2 . ** Link Issues** : Reference any related issues (e.g., "Fixes #123 ")
112- 3 . ** Small PRs** : Keep changes focused and atomic - one feature or fix per PR
113- 4 . ** Tests** : Include tests for new functionality
114- 5 . ** Documentation** : Update README.md if needed
115- 6 . ** Type Safety** : Ensure TypeScript types are correct and exported properly
116- 7 . ** Bundle Size** : Be mindful of bundle size impact (check with ` pnpm size ` )
93+ 1 . ** Clear Description** - Explain what changes you made and why
94+ 2 . ** Link Issues** - Reference any related issues (e.g., "Fixes #123 ")
95+ 3 . ** Small PRs** - Keep changes focused - one feature or fix per PR
96+ 4 . ** Tests** - Include tests for new functionality
97+ 5 . ** Documentation** - Update README.md if needed
11798
11899### PR Checklist
119100
120101- [ ] Code follows the project's style guidelines
121102- [ ] Tests added/updated and passing
122103- [ ] TypeScript types are correct
123- - [ ] Documentation updated (README.md, code comments)
124- - [ ] Bundle size impact considered
104+ - [ ] Documentation updated if needed
125105- [ ] No breaking changes (or clearly documented if intentional)
126106
127107## Development Guidelines
@@ -141,112 +121,25 @@ pnpm dev
141121### Transaction Signing
142122
143123- Support both ` @solana/kit ` (modern) and ` @solana/web3.js ` (legacy) APIs
144- - Ensure proper error handling and user feedback
124+ - Ensure proper error handling
145125- Test transaction signing with real wallets on devnet
146126
147- ### Storage
148-
149- - Use enhanced storage adapters with validation
150- - Ensure SSR compatibility
151- - Handle storage errors gracefully (private browsing, quota exceeded)
152-
153- ### Performance
154-
155- - Minimize re-renders in React hooks
156- - Use proper memoization where needed
157- - Keep bundle size small (check with ` pnpm size ` )
158-
159127## Bug Reports
160128
161129Include:
162130
163131- Clear description of the issue
164132- Steps to reproduce
165133- Expected vs actual behavior
166- - Environment details:
167- - Node.js version
168- - Package version
169- - Browser/OS
170- - Wallet(s) tested
171- - Relevant logs or error messages
172- - Minimal reproduction if possible
134+ - Environment details (Node.js version, package version, browser, wallet)
135+ - Relevant error messages
173136
174137## Feature Requests
175138
176139- Check existing issues first
177140- Provide clear use case and requirements
178141- Consider Wallet Standard compatibility
179142- Think about impact on both React and headless usage
180- - Consider bundle size implications
181- - Think about backward compatibility
182-
183- ## Testing Guidelines
184-
185- ### Writing Tests
186-
187- - Co-locate test files with source files
188- - Use descriptive test names
189- - Test both success and error cases
190- - Mock external dependencies (wallets, storage, etc.)
191- - Use test fixtures for common data structures
192-
193- ### Test Structure
194-
195- ``` typescript
196- import { describe , it , expect } from ' vitest' ;
197- import { YourFunction } from ' ./your-file' ;
198-
199- describe (' YourFunction' , () => {
200- it (' should handle success case' , () => {
201- // Test implementation
202- });
203-
204- it (' should handle error case' , () => {
205- // Test implementation
206- });
207- });
208- ```
209-
210- ### React Hook Testing
211-
212- ``` typescript
213- import { renderHook } from ' @testing-library/react' ;
214- import { useYourHook } from ' ./use-your-hook' ;
215- import { createHookWrapper } from ' ../__tests__/utils/react-helpers' ;
216-
217- describe (' useYourHook' , () => {
218- it (' should return expected values' , () => {
219- const { result } = renderHook (() => useYourHook (), {
220- wrapper: createHookWrapper (),
221- });
222- expect (result .current ).toBeDefined ();
223- });
224- });
225- ```
226-
227- ## Documentation
228-
229- - Update README.md for user-facing changes
230- - Add JSDoc comments for public APIs
231- - Include code examples in documentation
232- - Keep examples in sync with actual usage
233-
234- ## Code Review Process
235-
236- 1 . All PRs require at least one approval
237- 2 . Address review comments promptly
238- 3 . Keep PRs up to date with main branch
239- 4 . Squash commits before merging (if requested)
240-
241- ## Wallet Standard Guidelines
242-
243- When working with wallet integration:
244-
245- - Follow Wallet Standard best practices
246- - Ensure compatibility with all compliant wallets
247- - Handle wallet detection and connection errors gracefully
248- - Support multi-account wallets properly
249- - Test on devnet before mainnet
250143
251144## License
252145
@@ -257,8 +150,6 @@ By contributing, you agree that your contributions will be licensed under the MI
257150- Open an issue for questions
258151- Check existing documentation in README.md
259152- Review [ Wallet Standard specification] ( https://github.com/wallet-standard/wallet-standard )
260- - Check examples in ` examples/next-js ` directory
261-
262- ## Thank You!
153+ - Check the [ Next.js example] ( ../../examples/next-js ) for usage patterns
263154
264- Your contributions help make ConnectorKit better for everyone. Thank you for taking the time to contribute !
155+ Thank you for contributing to ConnectorKit !
0 commit comments