Documentation Index
Fetch the complete documentation index at: https://docs.sorionlib.dev/llms.txt
Use this file to discover all available pages before exploring further.
Getting started
We welcome contributions to Sorionlib! This guide will help you get started.
Repository structure
sorionlib/
├── src/
│ ├── core/ # Core functionality
│ ├── api/ # API client
│ ├── discord/ # Discord tools
│ ├── database/ # Database helpers
│ ├── utils/ # Utility functions
│ └── index.ts # Main entry point
├── tests/
│ ├── unit/ # Unit tests
│ └── integration/ # Integration tests
├── docs/ # Documentation
├── examples/ # Example projects
├── package.json
├── tsconfig.json
└── README.md
Setting up locally
-
Fork the repository
Click the “Fork” button on GitHub.
-
Clone your fork
git clone https://github.com/YOUR_USERNAME/sorionlib.git
cd sorionlib
-
Install dependencies
-
Create a branch
git checkout -b feature/my-feature
-
Run the development server
Running tests
# Run all tests
npm test
# Run unit tests only
npm run test:unit
# Run integration tests
npm run test:integration
# Run tests with coverage
npm run test:coverage
Code style
We use ESLint and Prettier for code formatting. Run the linter before committing:
# Check for issues
npm run lint
# Auto-fix issues
npm run lint:fix
Style guidelines
- Use TypeScript for all new code
- Use
async/await instead of callbacks
- Use meaningful variable and function names
- Add JSDoc comments for public APIs
- Keep functions small and focused
- Write tests for new features
Example code style
/**
* Formats a date according to the specified pattern.
* @param date - The date to format.
* @param pattern - The format pattern (e.g., "YYYY-MM-DD").
* @returns The formatted date string.
*/
export function formatDate(date: Date, pattern: string): string {
// Implementation
}
Pull request guidelines
Before submitting
- Update tests - Add or update tests for your changes
- Update documentation - Document new features or changes
- Run the test suite - Ensure all tests pass
- Run the linter - Fix any style issues
PR checklist
Commit messages
Use clear, descriptive commit messages:
feat: add user authentication support
fix: resolve memory leak in event emitter
docs: update API client documentation
test: add tests for database helpers
refactor: simplify error handling logic
Prefixes:
feat: - New feature
fix: - Bug fix
docs: - Documentation changes
test: - Test changes
refactor: - Code refactoring
chore: - Maintenance tasks
Issue templates
Bug report
**Description**
A clear description of the bug.
**Steps to reproduce**
1. Step one
2. Step two
3. Step three
**Expected behavior**
What you expected to happen.
**Actual behavior**
What actually happened.
**Environment**
- Sorionlib version:
- Node.js version:
- Operating system:
**Additional context**
Any other relevant information.
Feature request
**Description**
A clear description of the feature.
**Use case**
Why this feature would be useful.
**Proposed solution**
How you think it should work.
**Alternatives considered**
Other approaches you've considered.
**Additional context**
Any other relevant information.
Code of conduct
- Be respectful and inclusive
- Provide constructive feedback
- Focus on the code, not the person
- Help others learn and grow
Getting help
- Discord - Join our Discord server for real-time help
- GitHub Issues - Report bugs or request features
- Discussions - Ask questions and share ideas
Thank you for contributing to Sorionlib!