Skip to content

Commit 6c3b100

Browse files
committed
feat: Release v1.2.0 - Major feature update with caching, background sync, and integrations
BREAKING CHANGE: This release introduces major new features and requires dependency updates. Major Features Added: - ✨ Smart caching system with intelligent invalidation (CacheManager, CacheStrategy, InvalidationEngine) - ✨ Background sync guarantees with task scheduling (BackgroundSync, TaskScheduler) - ✨ Resource-aware sync (battery monitoring, network quality detection, ResourceManager) - ✨ Axios interceptor support (AxiosInterceptor) - ✨ New React hooks: useOfflineQuery, useOfflineMutation, useBackgroundSync, useCache, useSmartCache, useResourceAwareSync, useSyncMetrics - ✨ Pre-built UI components (OfflineProvider, OfflineStatusBar, QueuedActionsBadge, SyncProgress) - ✨ Library integrations (React Query, Redux, Zustand adapters) - ✨ Metrics and monitoring (MetricsCollector, SyncMetrics) - ✨ CLI setup tool (sync-vault-init) Infrastructure & Developer Experience: - ✅ CI/CD pipeline with GitHub Actions - ✅ Comprehensive test suite with coverage reporting - ✅ Complete documentation (API reference, migration guide, performance benchmarks, error handling) - ✅ Example application (todo-app) - ✅ GitHub templates (issue templates, PR template, community guidelines) - ✅ Contributing guidelines and code of conduct Core Improvements: - 🔄 Enhanced event-based reactive updates (no polling) - 🔄 Improved error handling and retry logic - 🔄 Better TypeScript types and IDE support - 🔄 Native module improvements for iOS/Android
1 parent 1737192 commit 6c3b100

74 files changed

Lines changed: 10046 additions & 1094 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Description
10+
A clear and concise description of what the bug is.
11+
12+
## Steps to Reproduce
13+
1. Go to '...'
14+
2. Click on '...'
15+
3. Scroll down to '...'
16+
4. See error
17+
18+
## Expected Behavior
19+
A clear and concise description of what you expected to happen.
20+
21+
## Actual Behavior
22+
A clear and concise description of what actually happened.
23+
24+
## Code Example
25+
```typescript
26+
// Minimal code example that reproduces the issue
27+
```
28+
29+
## Environment
30+
- **Package Version:** [e.g., 1.1.0]
31+
- **React Native Version:** [e.g., 0.72.0]
32+
- **Node Version:** [e.g., 20.0.0]
33+
- **Platform:** [e.g., iOS, Android, Both]
34+
- **Device/Simulator:** [e.g., iPhone 14, Android Emulator]
35+
36+
## Error Messages/Logs
37+
```
38+
Paste any error messages or logs here
39+
```
40+
41+
## Additional Context
42+
Add any other context about the problem here.
43+
44+
## Possible Solution
45+
If you have suggestions on how to fix this, please share them here.
46+
47+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Feature Description
10+
A clear and concise description of what you want to happen.
11+
12+
## Problem Statement
13+
What problem does this feature solve? What pain point does it address?
14+
15+
## Proposed Solution
16+
Describe how you envision this feature working.
17+
18+
## Alternative Solutions
19+
Describe any alternative solutions or features you've considered.
20+
21+
## Use Cases
22+
Provide concrete examples of when this feature would be useful:
23+
24+
1. **Use Case 1:** Description
25+
2. **Use Case 2:** Description
26+
27+
## Code Example (if applicable)
28+
```typescript
29+
// How you would like to use this feature
30+
```
31+
32+
## Additional Context
33+
Add any other context, screenshots, or examples about the feature request here.
34+
35+
## Implementation Notes (optional)
36+
If you have thoughts on how this could be implemented, please share.
37+

.github/ISSUE_TEMPLATE/question.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Question
3+
about: Ask a question about usage or implementation
4+
title: '[QUESTION] '
5+
labels: question
6+
assignees: ''
7+
---
8+
9+
## Question
10+
What would you like to know?
11+
12+
## Context
13+
What are you trying to accomplish? What have you tried so far?
14+
15+
## Code Example (if applicable)
16+
```typescript
17+
// Relevant code snippet
18+
```
19+
20+
## Environment
21+
- **Package Version:** [e.g., 1.1.0]
22+
- **React Native Version:** [e.g., 0.72.0]
23+
- **Node Version:** [e.g., 20.0.0]
24+
25+
## Additional Context
26+
Add any other context or screenshots about your question here.
27+
28+

.github/USED_BY.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Used By
2+
3+
Companies and projects using react-native-sync-vault.
4+
5+
## Add Your Company
6+
7+
If you're using react-native-sync-vault, we'd love to feature you here! Please open a pull request adding your company/project.
8+
9+
## Companies & Projects
10+
11+
_Add your company here!_
12+
13+
<!--
14+
## Example Format
15+
16+
### [Company Name](https://company-website.com)
17+
> Brief description of how you're using react-native-sync-vault
18+
19+
### [Project Name](https://project-url.com)
20+
> Brief description of the project
21+
-->
22+
23+
## Show Your Support
24+
25+
If you're using react-native-sync-vault, consider:
26+
27+
- ⭐ Starring the repository
28+
- 📝 Adding your company to this list
29+
- 🐛 Reporting bugs
30+
- 💡 Suggesting features
31+
- 📖 Improving documentation
32+
- 🔧 Contributing code
33+
34+
Thank you for using react-native-sync-vault! 🎉
35+
36+

.github/pull_request_template.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## Description
2+
Please include a summary of the changes and the related issue.
3+
4+
Fixes # (issue)
5+
6+
## Type of Change
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+
## Changes Made
15+
-
16+
-
17+
-
18+
19+
## Testing
20+
- [ ] I have added tests that prove my fix is effective or that my feature works
21+
- [ ] New and existing unit tests pass locally with my changes
22+
- [ ] I have tested on iOS (if applicable)
23+
- [ ] I have tested on Android (if applicable)
24+
25+
## Checklist
26+
- [ ] My code follows the style guidelines of this project
27+
- [ ] I have performed a self-review of my own code
28+
- [ ] I have commented my code, particularly in hard-to-understand areas
29+
- [ ] I have made corresponding changes to the documentation
30+
- [ ] My changes generate no new warnings
31+
- [ ] I have added tests that prove my fix is effective or that my feature works
32+
- [ ] New and existing unit tests pass locally with my changes
33+
- [ ] Any dependent changes have been merged and published
34+
35+
## Screenshots (if applicable)
36+
Add screenshots to help explain your changes.
37+
38+
## Additional Notes
39+
Add any other context about the pull request here.
40+

.github/workflows/ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master, develop]
6+
pull_request:
7+
branches: [main, master, develop]
8+
9+
jobs:
10+
test:
11+
name: Test & Lint
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [18.x, 20.x]
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Run linter
32+
run: npm run lint
33+
34+
- name: Run tests with coverage
35+
run: npm run test:coverage
36+
37+
- name: Upload coverage to Codecov
38+
if: matrix.node-version == '20.x'
39+
uses: codecov/codecov-action@v3
40+
with:
41+
file: ./coverage/lcov.info
42+
fail_ci_if_error: false
43+
token: ${{ secrets.CODECOV_TOKEN }}
44+
45+
- name: Check TypeScript compilation
46+
run: npm run build
47+
48+
build:
49+
name: Build
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v4
55+
56+
- name: Setup Node.js
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: '20.x'
60+
cache: 'npm'
61+
62+
- name: Install dependencies
63+
run: npm ci
64+
65+
- name: Build TypeScript
66+
run: npm run build
67+
68+
- name: Verify build output
69+
run: |
70+
test -d lib || (echo "Build output 'lib' directory not found" && exit 1)
71+
test -f lib/index.js || (echo "Build output 'lib/index.js' not found" && exit 1)
72+
test -f lib/index.d.ts || (echo "Build output 'lib/index.d.ts' not found" && exit 1)
73+

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ dist/
3838
*.temp
3939

4040

41+
42+
43+

CHANGELOG.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
- CI/CD pipeline with GitHub Actions
12+
- Comprehensive documentation (API stability, breaking changes, migration guide)
13+
- Contributing guidelines and code of conduct
14+
- Issue templates for bug reports, feature requests, and questions
15+
- Pull request template
16+
17+
### Changed
18+
- Improved error handling documentation
19+
- Enhanced test coverage infrastructure
20+
21+
## [1.1.0] - 2024-XX-XX
22+
23+
### Added
24+
- ✨ Automatic API interception - intercepts `fetch()` calls automatically
25+
- ✨ URL filtering for selective interception
26+
- Support for custom API call handlers (axios, custom fetch wrappers)
27+
28+
### Fixed
29+
- 🐛 Fixed dependency array issue in `useOfflineQueue` hook
30+
- 📝 Enhanced debug logging for troubleshooting
31+
32+
### Changed
33+
- Improved error messages for better debugging
34+
- Enhanced TypeScript types for better IDE support
35+
36+
## [1.0.0] - 2024-XX-XX
37+
38+
### Added
39+
- Initial release with manual queuing support
40+
- Native network monitoring (iOS/Android)
41+
- Progressive sync engine
42+
- Conflict resolution strategies
43+
- React hooks for easy integration
44+
- Performance tracking
45+
- Debug tools (DebugScreen, QueueLogger)
46+
47+
### Features
48+
- Offline request queue with SQLite persistence
49+
- Automatic sync when network is restored
50+
- Retry logic with exponential backoff
51+
- Failed request tracking
52+
- Queue status monitoring
53+
- Custom conflict resolution
54+
55+
---
56+
57+
## Types of Changes
58+
59+
- **Added** for new features
60+
- **Changed** for changes in existing functionality
61+
- **Deprecated** for soon-to-be removed features
62+
- **Removed** for now removed features
63+
- **Fixed** for any bug fixes
64+
- **Security** for vulnerability fixes
65+
66+

CODE_OF_CONDUCT.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
### Examples of Behavior that Contributes to a Positive Environment
10+
11+
- Using welcoming and inclusive language
12+
- Being respectful of differing viewpoints and experiences
13+
- Gracefully accepting constructive criticism
14+
- Focusing on what is best for the community
15+
- Showing empathy towards other community members
16+
17+
### Examples of Unacceptable Behavior
18+
19+
- The use of sexualized language or imagery
20+
- Trolling, insulting/derogatory comments, and personal or political attacks
21+
- Public or private harassment
22+
- Publishing others' private information without permission
23+
- Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Enforcement Responsibilities
26+
27+
Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
## Scope
30+
31+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces.
32+
33+
## Reporting
34+
35+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainers. All complaints will be reviewed and investigated promptly and fairly.
36+
37+
## Enforcement Guidelines
38+
39+
Project maintainers will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
40+
41+
1. **Correction**: A private, written warning
42+
2. **Warning**: A warning with consequences for continued behavior
43+
3. **Temporary Ban**: A temporary ban from any sort of interaction
44+
4. **Permanent Ban**: A permanent ban from any sort of interaction
45+
46+
## Attribution
47+
48+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
49+

0 commit comments

Comments
 (0)