Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/workflows/code-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: melos bootstrap

- name: Run Unit Tests
run: melos test
run: melos exec --fail-fast --ignore="*_web" --concurrency=1 -- flutter test

platform_tests:
name: Platform Tests
Expand Down Expand Up @@ -78,14 +78,26 @@ jobs:
restore-keys: |
${{ runner.os }}-pub-

- name: Install Melos
- name: Install Melos (Unix)
if: runner.os != 'Windows'
run: |
flutter pub global activate melos
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH

- name: Bootstrap Workspace
- name: Install Melos (Windows)
if: runner.os == 'Windows'
run: flutter pub global activate melos
shell: pwsh

- name: Bootstrap Workspace (Unix)
if: runner.os != 'Windows'
run: melos bootstrap

- name: Bootstrap Workspace (Windows)
if: runner.os == 'Windows'
run: flutter pub global run melos bootstrap
shell: pwsh

- name: Run Platform Tests
run: flutter test
working-directory: packages/local_storage_cache
78 changes: 42 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: Release
on:
push:
tags:
- 'v*'
- 'v*.*.*'

permissions:
contents: write

jobs:
create_release:
create-release:
name: Create Release
runs-on: ubuntu-latest

Expand All @@ -19,51 +19,57 @@ jobs:
with:
fetch-depth: 0

- name: Get Tag Name
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Set Up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true

- name: Get Previous Tag
id: prev_tag
- name: Install Melos
run: |
PREV_TAG=$(git describe --tags --abbrev=0 ${{ steps.tag.outputs.tag }}^ 2>/dev/null || echo "")
echo "prev_tag=${PREV_TAG}" >> $GITHUB_OUTPUT
flutter pub global activate melos
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH

- name: Bootstrap Workspace
run: melos bootstrap

- name: Run Tests
run: melos test

- name: Run Analysis
run: melos analyze

- name: Generate Changelog
id: changelog
run: |
if [ -z "${{ steps.prev_tag.outputs.prev_tag }}" ]; then
CHANGELOG=$(git log --pretty=format:"- %s (%h)" ${{ steps.tag.outputs.tag }})
# Get previous tag
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")

if [ -z "$PREV_TAG" ]; then
# First release, get all commits
COMMITS=$(git log --pretty=format:"- %s (%h)" --no-merges)
else
CHANGELOG=$(git log --pretty=format:"- %s (%h)" ${{ steps.prev_tag.outputs.prev_tag }}..${{ steps.tag.outputs.tag }})
# Get commits since previous tag
COMMITS=$(git log ${PREV_TAG}..HEAD --pretty=format:"- %s (%h)" --no-merges)
fi
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

# Save to file for multiline output
echo "$COMMITS" > changelog.txt

# Set output
echo "previous_tag=$PREV_TAG" >> $GITHUB_OUTPUT

- name: Create Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: Release ${{ steps.tag.outputs.tag }}
body: |
## Changes in ${{ steps.tag.outputs.tag }}

${{ steps.changelog.outputs.changelog }}

## Installation

Add this to your package's `pubspec.yaml` file:

```yaml
dependencies:
local_storage_cache: ${{ steps.tag.outputs.tag }}
```

## Full Changelog

See [CHANGELOG.md](https://github.com/protheeuz/local-storage-cache/blob/${{ steps.tag.outputs.tag }}/packages/local_storage_cache/CHANGELOG.md) for detailed changes.
body_path: changelog.txt
draft: false
prerelease: ${{ contains(steps.tag.outputs.tag, '-') }}
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Notify Success
run: |
echo "✅ Release ${{ github.ref_name }} created successfully!"
echo "📦 View release at: https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ build/
.flutter-plugins-dependencies

.kiro/
AGENTS.md
AGENTS.md
.github/RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ class MemoryCache {
/// Maps frequency count to set of keys with that frequency.
final Map<int, Set<String>> _frequencyMap = {};

/// Minimum frequency for LFU.
int _minFrequency = 0;

/// Gets a value from cache.
T? get<T>(String key) {
final entry = _cache[key];
Expand Down Expand Up @@ -97,7 +94,6 @@ class MemoryCache {
// Update LFU frequency map (new entries start at frequency 0)
if (evictionPolicy == EvictionPolicy.lfu) {
_frequencyMap.putIfAbsent(0, () => {}).add(key);
_minFrequency = 0;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ class QueryOptimizer {
if (schema == null) return [];

final missingIndexes = <String>[];
final normalizedSql = sql.toUpperCase();

// Check WHERE clause
final whereMatch =
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ melos:

test:
description: Run tests in all packages
run: melos exec --fail-fast -- flutter test
run: melos exec --fail-fast --ignore="*_web" --concurrency=1 -- flutter test

test:coverage:
description: Run tests with coverage in all packages
run: melos exec --fail-fast -- flutter test --coverage
run: melos exec --fail-fast --ignore="*_web" --concurrency=1 -- flutter test --coverage

clean:
description: Clean all packages
Expand Down
Loading