Skip to content

Commit 5cd8121

Browse files
authored
Feature/deps (#3)
v 2.1.0
1 parent 65fab5b commit 5cd8121

21 files changed

Lines changed: 2709 additions & 357 deletions
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Description
10+
11+
A clear description of the bug.
12+
13+
## Steps to Reproduce
14+
15+
1.
16+
2.
17+
3.
18+
19+
## Expected Behavior
20+
21+
What you expected to happen.
22+
23+
## Actual Behavior
24+
25+
What actually happened.
26+
27+
## Code Sample
28+
29+
```dart
30+
// Minimal code to reproduce the issue
31+
```
32+
33+
## Environment
34+
35+
- **pro_binary version**: [e.g., 2.1.0]
36+
- **Dart SDK version**: [e.g., 3.10.0]
37+
- **Platform**: [e.g., Windows/Linux/macOS/Web]
38+
39+
## Additional Context
40+
41+
Any other information about the problem.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Question or Discussion
4+
url: https://github.com/pro100andrey/pro_binary/discussions
5+
about: Ask questions or discuss ideas
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature or enhancement
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Feature Description
10+
11+
A clear description of the feature you'd like to see.
12+
13+
## Use Case
14+
15+
Describe the problem this feature would solve or the use case it addresses.
16+
17+
## Proposed Solution
18+
19+
How you envision this feature working.
20+
21+
## Example API (Optional)
22+
23+
```dart
24+
// Example of how the API might look
25+
```
26+
27+
## Alternatives Considered
28+
29+
What alternative solutions or features have you considered?
30+
31+
## Additional Context
32+
33+
Any other context, screenshots, or examples.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## Description
2+
3+
Brief description of the changes.
4+
5+
## Type of Change
6+
7+
- [ ] Bug fix (non-breaking change which fixes an issue)
8+
- [ ] New feature (non-breaking change which adds functionality)
9+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
10+
- [ ] Documentation update
11+
- [ ] Performance improvement
12+
- [ ] Code refactoring
13+
14+
## Checklist
15+
16+
- [ ] My code follows the style guidelines of this project
17+
- [ ] I have performed a self-review of my code
18+
- [ ] I have commented my code, particularly in hard-to-understand areas
19+
- [ ] I have made corresponding changes to the documentation
20+
- [ ] My changes generate no new warnings
21+
- [ ] I have added tests that prove my fix is effective or that my feature works
22+
- [ ] New and existing unit tests pass locally with my changes
23+
- [ ] I have updated the CHANGELOG.md
24+
25+
## Testing
26+
27+
Describe the tests you ran and how to reproduce them.
28+
29+
## Additional Notes
30+
31+
Any additional information or context.

.github/workflows/publish.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish to pub.dev
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Dart SDK
17+
uses: dart-lang/setup-dart@v1
18+
with:
19+
sdk: stable
20+
21+
- name: Install dependencies
22+
run: dart pub get
23+
24+
- name: Verify package
25+
run: dart pub publish --dry-run
26+
27+
- name: Publish package
28+
uses: k-paxian/dart-package-publisher@v1.6
29+
with:
30+
credentialJson: ${{ secrets.PUB_CREDENTIALS }}
31+
flutter: false
32+
skipTests: false

.github/workflows/test.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
runs-on: ${{ matrix.os }}
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, macos-latest, windows-latest]
18+
sdk: [stable, beta]
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Dart SDK
25+
uses: dart-lang/setup-dart@v1
26+
with:
27+
sdk: ${{ matrix.sdk }}
28+
29+
- name: Print Dart version
30+
run: dart --version
31+
32+
- name: Install dependencies
33+
run: dart pub get
34+
35+
- name: Verify formatting
36+
run: dart format --output=none --set-exit-if-changed .
37+
38+
- name: Analyze code
39+
run: dart analyze --fatal-infos
40+
41+
- name: Run tests
42+
run: dart test
43+
44+
- name: Run tests with coverage
45+
if: matrix.os == 'ubuntu-latest' && matrix.sdk == 'stable'
46+
run: |
47+
dart pub global activate coverage
48+
dart pub global run coverage:test_with_coverage
49+
50+
- name: Upload coverage to Codecov
51+
if: matrix.os == 'ubuntu-latest' && matrix.sdk == 'stable'
52+
uses: codecov/codecov-action@v4
53+
with:
54+
file: ./coverage/lcov.info
55+
fail_ci_if_error: false

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ doc/api/
2525

2626
.flutter-plugins
2727
.flutter-plugins-dependencies
28+
29+
# Coverage
30+
coverage/
31+
test/.test_coverage.dart
32+
*.lcov

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 2.1.0
2+
3+
- **feat**: Added detailed error messages with context (offset, available bytes)
4+
- **feat**: Added `toBytes()` method in `BinaryWriter` (returns buffer without reset)
5+
- **feat**: Added `reset()` method in `BinaryWriter` (resets without returning data)
6+
- **feat**: Added `allowMalformed` parameter to `readString` in `BinaryReader`
7+
- **improvement**: Increased performance of read/write operations
8+
- **improvement**: Optimized internal buffer management in `BinaryWriter`
9+
- **improvement**: Added validation for all boundary conditions
10+
- **test**: Added new tests for boundary checks and new methods
11+
- **docs**: Updated documentation with better examples and error handling
12+
113
## 2.0.0
214

315
- Update dependencies

CONTRIBUTING.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Contributing to pro_binary
2+
3+
Thank you for your interest in contributing! 🎉
4+
5+
## Getting Started
6+
7+
1. Fork the repository
8+
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/pro_binary.git`
9+
3. Create a branch: `git checkout -b feature/my-feature`
10+
4. Install dependencies: `dart pub get`
11+
12+
## Development
13+
14+
### Running Tests
15+
16+
```bash
17+
# Run all tests
18+
dart test
19+
20+
# Run specific test file
21+
dart test test/binary_reader_test.dart
22+
23+
# Run with coverage
24+
dart pub global activate coverage
25+
dart pub global run coverage:test_with_coverage
26+
```
27+
28+
### Code Style
29+
30+
```bash
31+
# Format code
32+
dart format .
33+
34+
# Analyze code
35+
dart analyze
36+
37+
# Fix common issues
38+
dart fix --apply
39+
```
40+
41+
### Before Submitting
42+
43+
- [ ] All tests pass (`dart test`)
44+
- [ ] Code is formatted (`dart format .`)
45+
- [ ] No analysis issues (`dart analyze`)
46+
- [ ] Added tests for new features
47+
- [ ] Updated CHANGELOG.md
48+
- [ ] Updated documentation if needed
49+
50+
## Pull Request Process
51+
52+
1. Update the README.md with details of changes if applicable
53+
2. Update the CHANGELOG.md with a note describing your changes
54+
3. Ensure all tests pass and code is properly formatted
55+
4. Submit a pull request with a clear description of changes
56+
57+
## Reporting Bugs
58+
59+
Use the [Bug Report template](.github/ISSUE_TEMPLATE/bug_report.md) and include:
60+
61+
- Clear description of the issue
62+
- Steps to reproduce
63+
- Expected vs actual behavior
64+
- Code sample
65+
- Environment details
66+
67+
## Suggesting Features
68+
69+
Use the [Feature Request template](.github/ISSUE_TEMPLATE/feature_request.md) and describe:
70+
71+
- The feature you'd like
72+
- Your use case
73+
- Proposed API (if applicable)
74+
- Alternative solutions considered
75+
76+
## Code of Conduct
77+
78+
- Be respectful and inclusive
79+
- Provide constructive feedback
80+
- Focus on what is best for the community
81+
82+
## Questions?
83+
84+
Feel free to open a [Discussion](https://github.com/pro100andrey/pro_binary/discussions) or reach out to maintainers.
85+
86+
Thank you for contributing! 🚀

0 commit comments

Comments
 (0)