Skip to content

Commit 0d878e2

Browse files
chore: add license and contributing md to main
1 parent 0c73cec commit 0d878e2

File tree

3 files changed

+161
-144
lines changed

3 files changed

+161
-144
lines changed

CONTRIBUTING.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Contributing to ConnectorKit
2+
3+
Thank you for your interest in contributing! This document provides guidelines for contributing to the project.
4+
5+
## Getting Started
6+
7+
1. **Fork the repository**
8+
2. **Clone your fork**
9+
10+
```bash
11+
git clone https://github.com/your-username/connectorkit.git
12+
cd connectorkit
13+
```
14+
15+
3. **Install dependencies**
16+
17+
```bash
18+
pnpm install
19+
```
20+
21+
4. **Create a branch**
22+
```bash
23+
git checkout -b feature/your-feature-name
24+
```
25+
26+
## Project Structure
27+
28+
- `packages/connector/` - Core wallet connector with React hooks and headless client
29+
- `packages/debugger/` - Development debug panel with transaction analysis
30+
- `examples/next-js/` - Example Next.js application with shadcn/ui
31+
32+
## Development Workflow
33+
34+
### Running the Example
35+
36+
```bash
37+
cd examples/next-js
38+
pnpm dev
39+
```
40+
41+
### Code Style
42+
43+
- Use TypeScript for all new code
44+
- Follow the existing code style (Prettier + ESLint)
45+
- Use functional and declarative patterns; avoid classes
46+
- Prefer named exports for components
47+
48+
### Testing
49+
50+
- Add tests for new functionality
51+
- Ensure all tests pass: `pnpm test`
52+
- Uses Vitest for testing
53+
54+
### Before Submitting
55+
56+
```bash
57+
pnpm lint # Lint code
58+
pnpm type-check # Type check
59+
pnpm build # Build all packages
60+
pnpm test # Run tests
61+
```
62+
63+
## Pull Request Guidelines
64+
65+
1. **Clear Description** - Explain what changes you made and why
66+
2. **Link Issues** - Reference any related issues
67+
3. **Small PRs** - Keep changes focused and atomic
68+
4. **Tests** - Include tests for new functionality
69+
5. **Documentation** - Update README/docs if needed
70+
71+
## Wallet Standard Guidelines
72+
73+
When working with wallet integration:
74+
75+
- Follow [Wallet Standard](https://github.com/wallet-standard/wallet-standard) best practices
76+
- Ensure compatibility with all compliant wallets
77+
- Test with multiple wallets (Phantom, Solflare, Backpack, etc.)
78+
- Test on devnet before mainnet
79+
80+
## Bug Reports
81+
82+
Include:
83+
84+
- Clear description of the issue
85+
- Steps to reproduce
86+
- Expected vs actual behavior
87+
- Environment details (Node.js version, browser, wallet)
88+
- Relevant error messages
89+
90+
## Feature Requests
91+
92+
- Check existing issues first
93+
- Provide clear use case and requirements
94+
- Consider Wallet Standard compatibility
95+
- Think about impact on both React and headless usage
96+
97+
## License
98+
99+
By contributing, you agree that your contributions will be licensed under the MIT License.
100+
101+
## Questions
102+
103+
- Open an issue for questions
104+
- Check existing documentation in package READMEs
105+
- Review [Wallet Standard specification](https://github.com/wallet-standard/wallet-standard)

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Solana Foundation
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/connector/CONTRIBUTING.md

Lines changed: 35 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -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

161129
Include:
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

Comments
 (0)