diff --git a/.github/actions/release/action.yml b/.github/actions/release/action.yml new file mode 100644 index 0000000..9e8c933 --- /dev/null +++ b/.github/actions/release/action.yml @@ -0,0 +1,66 @@ +name: release +description: Base package release action +inputs: + credentials: + description: 'Pub.dev credentials' + required: true + options: + description: 'Melos version options' + required: false +runs: + using: composite + steps: + - name: Setup Flutter SDK + uses: subosito/flutter-action@v2 + with: + flutter-version: 3.x + channel: 'stable' + cache: true + cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' + cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' + + - name: Configure git + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + shell: bash + + - name: Install dependencies + run: | + dart pub global activate melos + flutter pub get + melos bootstrap + shell: bash + + - name: Setup Pub Credentials + run: | + mkdir -p ~/.config + cd ~/.config + mkdir dart + echo "${{ inputs.credentials }}" | base64 --decode > ~/.config/dart/pub-credentials.json + shell: bash + + - name: Populate prerequisities + run: | + for dir in packages; do + cd "$dir" && for p in */; do + cp ../{.pubignore,LICENSE} "$p" + done && cd .. + done + shell: bash + + - name: Bump versions + run: | + melos version --yes --message="CI: sync release" --diff=$(git log --skip=1 -n 1 --pretty=format:"%H") ${{ inputs.options }} + shell: bash + + - name: Publish packages + run: melos publish --no-published --no-dry-run --yes + shell: bash + + - name: Update release info + run: | + git add . && git commit --amend --no-edit || true + git config pull.ff true + git pull --rebase && git push origin + shell: bash diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml new file mode 100644 index 0000000..94dd895 --- /dev/null +++ b/.github/actions/test/action.yml @@ -0,0 +1,24 @@ +name: test +description: Base unit test action +runs: + using: composite + steps: + - name: Setup Flutter SDK + uses: subosito/flutter-action@v2 + with: + flutter-version: 3.x + channel: 'stable' + cache: true + cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' + cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' + + - name: Install dependencies + run: | + dart pub global activate melos + flutter pub get + melos bootstrap + shell: bash + + - name: Execute tests + run: melos exec --diff=$(git log --skip=1 -n 1 --pretty=format:"%H") -- flutter test + shell: bash diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml new file mode 100644 index 0000000..048706a --- /dev/null +++ b/.github/workflows/prerelease.yml @@ -0,0 +1,35 @@ +name: CI Prerelease + +on: + push: + branches: + - development + +jobs: + unit-tests: + name: Run Tests + runs-on: ubuntu-latest + steps: + - name: Checkout repository ๐Ÿ›Ž๏ธ + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Run Tests ๐Ÿงช + uses: ./.github/actions/test + + release: + name: Release packages + runs-on: ubuntu-latest + needs: unit-tests + steps: + - name: Checkout repository ๐Ÿ›Ž๏ธ + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Initiate release ๐Ÿ“ฆ + uses: ./.github/actions/release + with: + credentials: ${{ secrets.PUB_CREDENTIALS }} + options: "--prerelease --preid=blizzard" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6381e01 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: CI Release + +on: + push: + branches: + - main + +jobs: + unit-tests: + name: Run Tests + runs-on: ubuntu-latest + steps: + - name: Checkout repository ๐Ÿ›Ž๏ธ + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Run Tests ๐Ÿงช + uses: ./.github/actions/test + + release: + name: Release packages + runs-on: ubuntu-latest + needs: unit-tests + steps: + - name: Checkout repository ๐Ÿ›Ž๏ธ + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Initiate release ๐Ÿ“ฆ + uses: ./.github/actions/release + with: + credentials: ${{ secrets.PUB_CREDENTIALS }} + options: "--graduate" \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..a5a7dce --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,17 @@ +name: CI Tests + +on: + pull_request: + +jobs: + unit-tests: + name: Run Tests + runs-on: ubuntu-latest + steps: + - name: Checkout repository ๐Ÿ›Ž๏ธ + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Run Tests ๐Ÿงช + uses: ./.github/actions/test \ No newline at end of file diff --git a/.gitignore b/.gitignore index 06aa2ad..c316672 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,7 @@ doc/api/ .flutter-plugins .flutter-plugins-dependencies + +packages/**/LICENSE +packages/**/.pubignore +packages/**/doc diff --git a/.husky/pre-commit b/.husky/pre-commit index f4d756c..3f80844 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,4 +2,5 @@ . "$(dirname -- "$0")/_/husky.sh" dart format . --fix -dart run lint_staged \ No newline at end of file +dart run lint_staged +git add . \ No newline at end of file diff --git a/.pubignore b/.pubignore index 8fcf9be..68905b2 100644 --- a/.pubignore +++ b/.pubignore @@ -5,3 +5,6 @@ test/ .gitignore analysis_options.yaml pub_login.sh +melos_flodash.iml +CHANGELOG.md +CONTRIBUTING.md \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a678849 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,220 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## 2023-10-15 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`flodash` - `v1.1.0-blizzard.6`](#flodash---v110-blizzard6) + +--- + +#### `flodash` - `v1.1.0-blizzard.6` + + - **FEAT**: added number clamp. + + +## 2023-10-15 + +### Changes + +--- + +Packages with breaking changes: + + - [`enhanced_cloud_firestore` - `v2.0.0-blizzard.2`](#enhanced_cloud_firestore---v200-blizzard2) + - [`flodash` - `v1.1.0-blizzard.5`](#flodash---v110-blizzard5) + +Packages with other changes: + + - There are no other changes in this release. + +--- + +#### `enhanced_cloud_firestore` - `v2.0.0-blizzard.2` + + - **REFACTOR**: changes added. + - **BREAKING** **FEAT**: bumped firestore dependency versions. + +#### `flodash` - `v1.1.0-blizzard.5` + + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **FIX**: removed flutter dependency from flodash. + - **FEAT**: added starts_with under the string manipulation. + - **FEAT**: added to_lower under the string manipulation. + - **FEAT**: added to_upper under the string manipulation. + - **FEAT**: array/compact generic support. + - **FEAT**: added generics. + - **BREAKING** **FEAT**: bumped firestore dependency versions. + + +## 2023-10-15 + +### Changes + +--- + +Packages with breaking changes: + + - [`enhanced_cloud_firestore` - `v2.0.0-blizzard.1`](#enhanced_cloud_firestore---v200-blizzard1) + - [`flodash` - `v1.1.0-blizzard.4`](#flodash---v110-blizzard4) + +Packages with other changes: + + - There are no other changes in this release. + +--- + +#### `enhanced_cloud_firestore` - `v2.0.0-blizzard.1` + + - **REFACTOR**: changes added. + - **BREAKING** **FEAT**: bumped firestore dependency versions. + +#### `flodash` - `v1.1.0-blizzard.4` + + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **FIX**: removed flutter dependency from flodash. + - **FEAT**: added starts_with under the string manipulation. + - **FEAT**: added to_lower under the string manipulation. + - **FEAT**: added to_upper under the string manipulation. + - **FEAT**: array/compact generic support. + - **FEAT**: added generics. + - **BREAKING** **FEAT**: bumped firestore dependency versions. + + +## 2023-10-15 + +### Changes + +--- + +Packages with breaking changes: + + - [`enhanced_cloud_firestore` - `v2.0.0-blizzard.0`](#enhanced_cloud_firestore---v200-blizzard0) + - [`flodash` - `v1.1.0-blizzard.3`](#flodash---v110-blizzard3) + +Packages with other changes: + + - There are no other changes in this release. + +--- + +#### `enhanced_cloud_firestore` - `v2.0.0-blizzard.0` + + - **REFACTOR**: changes added. + - **BREAKING** **FEAT**: bumped firestore dependency versions. + +#### `flodash` - `v1.1.0-blizzard.3` + + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **FEAT**: added starts_with under the string manipulation. + - **FEAT**: added to_lower under the string manipulation. + - **FEAT**: added to_upper under the string manipulation. + - **BREAKING** **FEAT**: bumped firestore dependency versions. + + +## 2023-06-25 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`flodash` - `v1.1.0-blizzard.2`](#flodash---v110-blizzard2) + +--- + +#### `flodash` - `v1.1.0-blizzard.2` + + - **FEAT**: array/compact generic support. + - **FEAT**: added generics. + + +## 2023-06-25 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`flodash` - `v1.1.0-blizzard.1`](#flodash---v110-blizzard1) + +--- + +#### `flodash` - `v1.1.0-blizzard.1` + + - **FEAT**: array/compact generic support. + - **FEAT**: added generics. + + +## 2023-06-25 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`flodash` - `v1.1.0-blizzard.0`](#flodash---v110-blizzard0) + +--- + +#### `flodash` - `v1.1.0-blizzard.0` + + - **FEAT**: added generics. + + +## 2023-06-26 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`flodash` - `v1.0.3`](#flodash---v103) + +--- + +#### `flodash` - `v1.0.3` + diff --git a/commitlint.yaml b/commitlint.yaml index d7d5af6..95cf728 100644 --- a/commitlint.yaml +++ b/commitlint.yaml @@ -17,9 +17,4 @@ rules: - Wip type-empty: - 1 - - never - scope-enum: - - 2 - - always - - - flodash - - enhanced-http \ No newline at end of file + - never \ No newline at end of file diff --git a/melos.yaml b/melos.yaml index 5ef67f2..8e22eef 100644 --- a/melos.yaml +++ b/melos.yaml @@ -5,4 +5,9 @@ packages: scripts: test: - exec: flutter test \ No newline at end of file + exec: flutter test + +command: + version: + hooks: + post: melos exec --no-published -- dart doc . \ No newline at end of file diff --git a/packages/enhanced_cloud_firestore/CHANGELOG.md b/packages/enhanced_cloud_firestore/CHANGELOG.md index 7928521..b6ea592 100644 --- a/packages/enhanced_cloud_firestore/CHANGELOG.md +++ b/packages/enhanced_cloud_firestore/CHANGELOG.md @@ -1,3 +1,24 @@ +## 2.0.0-blizzard.2 + +> Note: This release has breaking changes. + + - **REFACTOR**: changes added. + - **BREAKING** **FEAT**: bumped firestore dependency versions. + +## 2.0.0-blizzard.1 + +> Note: This release has breaking changes. + + - **REFACTOR**: changes added. + - **BREAKING** **FEAT**: bumped firestore dependency versions. + +## 2.0.0-blizzard.0 + +> Note: This release has breaking changes. + + - **REFACTOR**: changes added. + - **BREAKING** **FEAT**: bumped firestore dependency versions. + ## 1.0.1 * Initial release. diff --git a/packages/enhanced_cloud_firestore/example/pubspec.lock b/packages/enhanced_cloud_firestore/example/pubspec.lock index 82fd1e2..a5a3bba 100644 --- a/packages/enhanced_cloud_firestore/example/pubspec.lock +++ b/packages/enhanced_cloud_firestore/example/pubspec.lock @@ -1,6 +1,14 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: d84d98f1992976775f83083523a34c5d22fea191eec3abb2bd09537fb623c2e0 + url: "https://pub.dev" + source: hosted + version: "1.3.7" async: dependency: transitive description: @@ -37,57 +45,57 @@ packages: dependency: transitive description: name: cloud_firestore - sha256: "0786a5f607f016e3b3fca8857288cba77feb3731a80a1c639f1f270b52883561" + sha256: "1179ae4c69e2ea18179d844d70fc6ed2f082a2bbeb7fa62d35a2a24e2992bd4d" url: "https://pub.dev" source: hosted - version: "3.1.9" + version: "4.9.3" cloud_firestore_platform_interface: dependency: transitive description: name: cloud_firestore_platform_interface - sha256: "1d34efcd9b9f24e9100aef7d39e58639133e5deb8f8a83b6cc68eeebc597c46a" + sha256: acdcf0743bbdd0e6b342f3d2033e15d260a2c6f9434dd34b008b8f1c35e62b23 url: "https://pub.dev" source: hosted - version: "5.5.0" + version: "5.16.2" cloud_firestore_web: dependency: transitive description: name: cloud_firestore_web - sha256: "2e71a9c3ecda12561375fe5d4105654e47d73163bb0d5194e6b1aab61cef931d" + sha256: "321bb0732c8d782a49aede96805e59609e05cf98b6c34370faa04103f46a4a3a" url: "https://pub.dev" source: hosted - version: "2.6.9" + version: "3.7.2" collection: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.17.2" crypto: dependency: transitive description: name: crypto - sha256: cf75650c66c0316274e21d7c43d3dea246273af5955bd94e8184837cd577575c + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: "1989d917fbe8e6b39806207df5a3fdd3d816cbd090fac2ce26fb45e9a71476e5" + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.5" enhanced_cloud_firestore: dependency: "direct main" description: path: ".." relative: true source: path - version: "1.0.1" + version: "2.0.0-blizzard.2" fake_async: dependency: transitive description: @@ -100,34 +108,34 @@ packages: dependency: "direct main" description: name: faker - sha256: c6f95ed978d91379bed8bfde3da372d969fd6a77cd3c6c458768bd59a7fea408 + sha256: "746e59f91d8b06a389e74cf76e909a05ed69c12691768e2f93557fdf29200fd0" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.0" firebase_core: dependency: "direct main" description: name: firebase_core - sha256: "0232f60f41be892ec52f100b0c4a035d2ab523fa7f8adc8d183e01a75e42db1a" + sha256: "95580fa07c8ca3072a2bb1fecd792616a33f8683477d25b7d29d3a6a399e6ece" url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "2.17.0" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface - sha256: f9af376a733d91ab8ff1f2942479cb81bbb8a8bc67c2b6c51a9cae5a10f028a0 + sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 url: "https://pub.dev" source: hosted - version: "4.2.4" + version: "4.8.0" firebase_core_web: dependency: transitive description: name: firebase_core_web - sha256: "91abd7fdec09db644d8bdf4022fac43e639bf1a3b87d5810f8b9a14edc221f2d" + sha256: e8c408923cd3a25bd342c576a114f2126769cd1a57106a4edeaa67ea4a84e962 url: "https://pub.dev" source: hosted - version: "1.6.0" + version: "2.8.0" flutter: dependency: "direct main" description: flutter @@ -137,10 +145,10 @@ packages: dependency: "direct main" description: name: flutter_dotenv - sha256: d9283d92059a22e9834bc0a31336658ffba77089fb6f3cc36751f1fc7c6661a3 + sha256: "9357883bdd153ab78cbf9ffa07656e336b8bbb2b5a3ca596b0b27e119f7c7d77" url: "https://pub.dev" source: hosted - version: "5.0.2" + version: "5.1.0" flutter_lints: dependency: "direct dev" description: @@ -179,18 +187,18 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: @@ -211,10 +219,10 @@ packages: dependency: transitive description: name: plugin_platform_interface - sha256: "075f927ebbab4262ace8d0b283929ac5410c0ac4e7fc123c76429564facfb757" + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" sky_engine: dependency: transitive description: flutter @@ -224,10 +232,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: @@ -264,18 +272,18 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.0" typed_data: dependency: transitive description: name: typed_data - sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.2" vector_math: dependency: transitive description: @@ -284,6 +292,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" sdks: - dart: ">=3.0.0-0 <3.7.0" - flutter: ">=1.17.0" + dart: ">=3.1.0-185.0.dev <3.7.0" + flutter: ">=3.3.0" diff --git a/packages/enhanced_cloud_firestore/example/pubspec.yaml b/packages/enhanced_cloud_firestore/example/pubspec.yaml index 8b5c04f..1ff2076 100644 --- a/packages/enhanced_cloud_firestore/example/pubspec.yaml +++ b/packages/enhanced_cloud_firestore/example/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: cupertino_icons: ^1.0.2 flutter_dotenv: ^5.0.2 - firebase_core: ^1.12.0 + firebase_core: ^2.15.1 faker: ^2.0.0 enhanced_cloud_firestore: path: ../ diff --git a/packages/enhanced_cloud_firestore/example/windows/flutter/generated_plugin_registrant.cc b/packages/enhanced_cloud_firestore/example/windows/flutter/generated_plugin_registrant.cc index 8b6d468..1a82e7d 100644 --- a/packages/enhanced_cloud_firestore/example/windows/flutter/generated_plugin_registrant.cc +++ b/packages/enhanced_cloud_firestore/example/windows/flutter/generated_plugin_registrant.cc @@ -6,6 +6,9 @@ #include "generated_plugin_registrant.h" +#include void RegisterPlugins(flutter::PluginRegistry* registry) { + FirebaseCorePluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); } diff --git a/packages/enhanced_cloud_firestore/example/windows/flutter/generated_plugins.cmake b/packages/enhanced_cloud_firestore/example/windows/flutter/generated_plugins.cmake index b93c4c3..fa8a39b 100644 --- a/packages/enhanced_cloud_firestore/example/windows/flutter/generated_plugins.cmake +++ b/packages/enhanced_cloud_firestore/example/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + firebase_core ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/packages/enhanced_cloud_firestore/pubspec.lock b/packages/enhanced_cloud_firestore/pubspec.lock index 36f8906..bf09c5c 100644 --- a/packages/enhanced_cloud_firestore/pubspec.lock +++ b/packages/enhanced_cloud_firestore/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "2f428053492f92303e42c9afa8e3a78ad1886760e7b594e2b5a6b6ee47376360" + sha256: d84d98f1992976775f83083523a34c5d22fea191eec3abb2bd09537fb623c2e0 url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.3.7" async: dependency: transitive description: @@ -45,34 +45,34 @@ packages: dependency: "direct main" description: name: cloud_firestore - sha256: "9194bf1845ee073bea64ec94e72c9dcf5d15f755e96496d8ccfee9def38b666f" + sha256: "1179ae4c69e2ea18179d844d70fc6ed2f082a2bbeb7fa62d35a2a24e2992bd4d" url: "https://pub.dev" source: hosted - version: "3.5.1" + version: "4.9.3" cloud_firestore_platform_interface: dependency: transitive description: name: cloud_firestore_platform_interface - sha256: d023142c18c28b2610c23c196e829c96976569cc2aa2f8e45328ae8a64c428d1 + sha256: acdcf0743bbdd0e6b342f3d2033e15d260a2c6f9434dd34b008b8f1c35e62b23 url: "https://pub.dev" source: hosted - version: "5.7.7" + version: "5.16.2" cloud_firestore_web: dependency: transitive description: name: cloud_firestore_web - sha256: "3d7d4fa8c1dc5a1f7cb33985ae0ab9924d33d76d4959fe26aed84b7d282887e3" + sha256: "321bb0732c8d782a49aede96805e59609e05cf98b6c34370faa04103f46a4a3a" url: "https://pub.dev" source: hosted - version: "2.8.10" + version: "3.7.2" collection: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.17.2" fake_async: dependency: transitive description: @@ -85,10 +85,10 @@ packages: dependency: transitive description: name: firebase_core - sha256: "4f1d7c13a909e82ff026679c9b8493cdeb35a9c76bc46c42bf9e2240c9e57e80" + sha256: "95580fa07c8ca3072a2bb1fecd792616a33f8683477d25b7d29d3a6a399e6ece" url: "https://pub.dev" source: hosted - version: "1.24.0" + version: "2.17.0" firebase_core_platform_interface: dependency: transitive description: @@ -101,10 +101,10 @@ packages: dependency: transitive description: name: firebase_core_web - sha256: "839f1b48032a61962792cea1225fae030d4f27163867f181d6d2072dd40acbee" + sha256: e8c408923cd3a25bd342c576a114f2126769cd1a57106a4edeaa67ea4a84e962 url: "https://pub.dev" source: hosted - version: "1.7.3" + version: "2.8.0" flutter: dependency: "direct main" description: flutter @@ -132,18 +132,18 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: @@ -177,10 +177,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: @@ -217,10 +217,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.0" vector_math: dependency: transitive description: @@ -229,6 +229,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" sdks: - dart: ">=3.0.0-0 <3.7.0" + dart: ">=3.1.0-185.0.dev <3.7.0" flutter: ">=3.3.0" diff --git a/packages/enhanced_cloud_firestore/pubspec.yaml b/packages/enhanced_cloud_firestore/pubspec.yaml index 07ac0fa..48bf180 100644 --- a/packages/enhanced_cloud_firestore/pubspec.yaml +++ b/packages/enhanced_cloud_firestore/pubspec.yaml @@ -1,6 +1,6 @@ name: enhanced_cloud_firestore description: A wrapper around the cloud firestore dart package with support for filtering sorting, limiting, error handling, and success scenarios -version: 1.0.1 +version: 2.0.0-blizzard.2 repository: https://github.com/sliit-foss/enchanced_cloud_firestore environment: @@ -10,7 +10,7 @@ environment: dependencies: flutter: sdk: flutter - cloud_firestore: ^3.1.9 + cloud_firestore: ^4.0.0 dev_dependencies: flutter_test: diff --git a/packages/enhanced_http/example/pubspec.lock b/packages/enhanced_http/example/pubspec.lock index 0fac52b..6c413c5 100644 --- a/packages/enhanced_http/example/pubspec.lock +++ b/packages/enhanced_http/example/pubspec.lock @@ -53,10 +53,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.17.2" crypto: dependency: transitive description: @@ -133,22 +133,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: @@ -346,6 +338,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" win32: dependency: transitive description: @@ -363,5 +363,5 @@ packages: source: hosted version: "0.2.0+1" sdks: - dart: ">=3.0.0-0 <3.7.0" + dart: ">=3.1.0-185.0.dev <3.7.0" flutter: ">=3.3.0" diff --git a/packages/enhanced_http/pubspec.lock b/packages/enhanced_http/pubspec.lock index f7bb080..ccd2571 100644 --- a/packages/enhanced_http/pubspec.lock +++ b/packages/enhanced_http/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.17.2" fake_async: dependency: transitive description: @@ -75,30 +75,22 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" matcher: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: @@ -124,10 +116,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: @@ -164,10 +156,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.0" typed_data: dependency: transitive description: @@ -184,5 +176,13 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" sdks: - dart: ">=3.0.0-0 <3.7.0" + dart: ">=3.1.0-185.0.dev <3.7.0" diff --git a/packages/flodash/CHANGELOG.md b/packages/flodash/CHANGELOG.md index b373b58..ca5d708 100644 --- a/packages/flodash/CHANGELOG.md +++ b/packages/flodash/CHANGELOG.md @@ -1,3 +1,71 @@ +## 1.1.0-blizzard.6 + + - **FEAT**: added number clamp. + +## 1.1.0-blizzard.5 + +> Note: This release has breaking changes. + + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **FIX**: removed flutter dependency from flodash. + - **FEAT**: added starts_with under the string manipulation. + - **FEAT**: added to_lower under the string manipulation. + - **FEAT**: added to_upper under the string manipulation. + - **FEAT**: array/compact generic support. + - **FEAT**: added generics. + - **BREAKING** **FEAT**: bumped firestore dependency versions. + +## 1.1.0-blizzard.4 + +> Note: This release has breaking changes. + + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **FIX**: removed flutter dependency from flodash. + - **FEAT**: added starts_with under the string manipulation. + - **FEAT**: added to_lower under the string manipulation. + - **FEAT**: added to_upper under the string manipulation. + - **FEAT**: array/compact generic support. + - **FEAT**: added generics. + - **BREAKING** **FEAT**: bumped firestore dependency versions. + +## 1.1.0-blizzard.3 + +> Note: This release has breaking changes. + + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **REFACTOR**: changes added. + - **FEAT**: added starts_with under the string manipulation. + - **FEAT**: added to_lower under the string manipulation. + - **FEAT**: added to_upper under the string manipulation. + - **BREAKING** **FEAT**: bumped firestore dependency versions. + +## 1.1.0-blizzard.2 + + - **FEAT**: array/compact generic support. + - **FEAT**: added generics. + +## 1.1.0-blizzard.1 + + - **FEAT**: array/compact generic support. + - **FEAT**: added generics. + +## 1.1.0-blizzard.0 + + - **FEAT**: added generics. + +## 1.0.3 + ## 1.0.2 * Fixed issue in number - range return type diff --git a/packages/flodash/lib/_utils/_general.dart b/packages/flodash/lib/_utils/_general.dart new file mode 100644 index 0000000..c838024 --- /dev/null +++ b/packages/flodash/lib/_utils/_general.dart @@ -0,0 +1,3 @@ +listEquals(List a, List b) { + return a.toSet().difference(b.toSet()).isEmpty && a.length == b.length; +} diff --git a/packages/flodash/lib/modules/array/chunk.dart b/packages/flodash/lib/modules/array/chunk.dart index 1b4225f..fef68ab 100644 --- a/packages/flodash/lib/modules/array/chunk.dart +++ b/packages/flodash/lib/modules/array/chunk.dart @@ -1,9 +1,20 @@ -List chunk(List list, {int size = 1}) { - List chunks = []; +/// Creates an array of elements split into groups the length of size. If array can't be split evenly, the final chunk will be the remaining elements. +/// +/// Arguments +/// +/// - list (List): The array to process. +/// - [size=1] (int): The length of each chunk +/// +/// Returns +/// +/// - (List): Returns the new array of chunks. + +List> chunk(List list, {int size = 1}) { + List> chunks = []; for (int i = 0; i < list.length; i += size) { int end = i + size; if (end > list.length) end = list.length; - chunks.add(list.sublist(i, end)); + chunks.add(list.sublist(i, end).cast()); } return chunks; } diff --git a/packages/flodash/lib/modules/array/compact.dart b/packages/flodash/lib/modules/array/compact.dart index 76989b7..c5562ed 100644 --- a/packages/flodash/lib/modules/array/compact.dart +++ b/packages/flodash/lib/modules/array/compact.dart @@ -1,5 +1,15 @@ import '../lang/main.dart'; -List compact(List list) { +/// Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are falsey. +/// +/// Arguments +/// +/// - list (List): The array to compact. +/// +/// Returns +/// +/// - (List): Returns the new array of filtered values. + +List compact(List list) { return list.where((e) => !isFalsy(e)).toList(); } diff --git a/packages/flodash/lib/modules/array/difference.dart b/packages/flodash/lib/modules/array/difference.dart index fdb11dd..0c93886 100644 --- a/packages/flodash/lib/modules/array/difference.dart +++ b/packages/flodash/lib/modules/array/difference.dart @@ -1,7 +1,6 @@ -import 'package:flutter/foundation.dart'; - import 'flatten.dart'; +import '../../_utils/_general.dart'; import '../../_utils/_varargs.dart'; final difference = VarargsFunction((arguments) { @@ -17,7 +16,7 @@ final difference = VarargsFunction((arguments) { if (e is Map) { return subList .whereType() - .where((m) => mapEquals(e, m)) + .where((m) => e.toString() == m.toString()) .toList() .isEmpty; } diff --git a/packages/flodash/lib/modules/collection/find.dart b/packages/flodash/lib/modules/collection/find.dart index a2f71d6..b83a5fc 100644 --- a/packages/flodash/lib/modules/collection/find.dart +++ b/packages/flodash/lib/modules/collection/find.dart @@ -1,10 +1,16 @@ import '../../_utils/_array.dart'; -@Deprecated("Use inbuilt List.firstWhere() instead") -dynamic find(List list, dynamic iteratee) { +/// Iterates over elements of collection, returning the first element predicate returns truthy for. The predicate is invoked with the value of the current item. +/// Arguments +/// - list (List): The collection to inspect. +/// - [iteratee] (dynamic): The iteratee invoked per iteration. +/// +/// Returns +/// (T?): Returns the matched element, else null. +T? find(List list, dynamic iteratee) { try { return list.firstWhere((element) => evaluatePredicate(iteratee, element)); - } catch (e) { + } catch (_) { return null; } } diff --git a/packages/flodash/lib/modules/date/now.dart b/packages/flodash/lib/modules/date/now.dart index 2c4f1f6..781d7f0 100644 --- a/packages/flodash/lib/modules/date/now.dart +++ b/packages/flodash/lib/modules/date/now.dart @@ -1,2 +1,4 @@ @Deprecated("Use inbuilt DateTime.now().millisecondsSinceEpoch instead") + +/// Gets the timestamp of the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). int now() => DateTime.now().millisecondsSinceEpoch; diff --git a/packages/flodash/lib/modules/lang/is_equal.dart b/packages/flodash/lib/modules/lang/is_equal.dart index 7d186e6..b0ee9d3 100644 --- a/packages/flodash/lib/modules/lang/is_equal.dart +++ b/packages/flodash/lib/modules/lang/is_equal.dart @@ -1,7 +1,7 @@ -import 'package:flutter/foundation.dart'; +import '../../_utils/_general.dart'; bool isEqual(a, b) { if (a is List && b is List) return listEquals(a, b); - if (a is Map && b is Map) return mapEquals(a, b); + if (a is Map && b is Map) return a.toString() == b.toString(); return a == b; } diff --git a/packages/flodash/lib/modules/number/clamp.dart b/packages/flodash/lib/modules/number/clamp.dart new file mode 100644 index 0000000..1c93ff9 --- /dev/null +++ b/packages/flodash/lib/modules/number/clamp.dart @@ -0,0 +1,27 @@ +/// Clamps number within the inclusive lower and upper bounds. +/// +/// Arguments +/// +/// - number (num): The number to clamp. +/// - [lower] (num): The lower bound. +/// - upper (num): The upper bound. +/// +/// Returns +/// +/// - (num): Returns the clamped number. +dynamic clamp(num number, num? lower, [num? upper]) { + if (upper == null) { + upper = lower; + if (number > upper!) { + return upper; + } + return number; + } else { + if (number > upper) { + return upper; + } else if (number < lower!) { + return lower; + } + return number; + } +} diff --git a/packages/flodash/lib/modules/number/main.dart b/packages/flodash/lib/modules/number/main.dart index 5cac874..662c782 100644 --- a/packages/flodash/lib/modules/number/main.dart +++ b/packages/flodash/lib/modules/number/main.dart @@ -1 +1,2 @@ +export 'clamp.dart'; export 'random.dart'; diff --git a/packages/flodash/lib/modules/string/main.dart b/packages/flodash/lib/modules/string/main.dart index 0d0aa8a..c2a7cee 100644 --- a/packages/flodash/lib/modules/string/main.dart +++ b/packages/flodash/lib/modules/string/main.dart @@ -9,3 +9,8 @@ export 'replace.dart'; export 'upper_first.dart'; export 'unescape.dart'; export 'uppercase.dart'; +export 'trim_end.dart'; +export 'trim_start.dart'; +export 'starts_with.dart'; +export 'to_lower.dart'; +export 'to_upper.dart'; diff --git a/packages/flodash/lib/modules/string/starts_with.dart b/packages/flodash/lib/modules/string/starts_with.dart new file mode 100644 index 0000000..6db85a8 --- /dev/null +++ b/packages/flodash/lib/modules/string/starts_with.dart @@ -0,0 +1,17 @@ +/// Checks if string starts with the given target string. +/// +/// Arguments +/// +/// - string (String): The string to be checked. +/// - target (String): The target string that is expected to be at the beginning of the given string. +/// - position (int): Optional parameter specifying the starting position in the given string to begin the comparison. Defaults to 0 +/// +/// Returns +/// +/// - (Boolean): Returns true if the string starts with the target string at the specified position; otherwise, returns false + +@Deprecated( + 'The function startsWith() is deprecated. Use the built-in startsWith() method instead.') +bool startsWith(String string, String target, [int position = 0]) { + return string.startsWith(target, position); +} diff --git a/packages/flodash/lib/modules/string/to_lower.dart b/packages/flodash/lib/modules/string/to_lower.dart new file mode 100644 index 0000000..5440c94 --- /dev/null +++ b/packages/flodash/lib/modules/string/to_lower.dart @@ -0,0 +1,15 @@ +/// Converts a string, as a whole, to lowercase. +/// +/// Arguments +/// +/// - (string): The string to convert. +/// +/// Returns +/// +/// - (string): The lowercase string. + +@Deprecated( + 'The function toLower() is deprecated. Use the built-in toLowerCase() method instead.') +String toLower([String string = '']) { + return string.toLowerCase(); +} diff --git a/packages/flodash/lib/modules/string/to_upper.dart b/packages/flodash/lib/modules/string/to_upper.dart new file mode 100644 index 0000000..2400d36 --- /dev/null +++ b/packages/flodash/lib/modules/string/to_upper.dart @@ -0,0 +1,15 @@ +/// Converts a string, as a whole, to uppercase. +/// +/// Arguments +/// +/// - (string): The string to convert. +/// +/// Returns +/// +/// - (string): The uppercase string. + +@Deprecated( + 'The function toUpper() is deprecated. Use the built-in toUpperCase() method instead.') +String toUpper([String string = '']) { + return string.toUpperCase(); +} diff --git a/packages/flodash/lib/modules/string/trim_end.dart b/packages/flodash/lib/modules/string/trim_end.dart new file mode 100644 index 0000000..c472dec --- /dev/null +++ b/packages/flodash/lib/modules/string/trim_end.dart @@ -0,0 +1,9 @@ +///Removes trailing whitespace or specified characters from string. +String trimEnd(String str, [String chars = ' ']) { + if (str.isEmpty) return ''; + int end = str.length - 1; + while (end >= 0 && chars.contains(str[end])) { + end--; + } + return str.substring(0, end + 1); +} diff --git a/packages/flodash/lib/modules/string/trim_start.dart b/packages/flodash/lib/modules/string/trim_start.dart new file mode 100644 index 0000000..6ca2d2f --- /dev/null +++ b/packages/flodash/lib/modules/string/trim_start.dart @@ -0,0 +1,10 @@ +///Removes leading whitespace or specified characters from string. +String trimStart(String string, [String chars = ' ']) { + if (string.isEmpty) return string; + int startIndex = 0; + if (chars.isNotEmpty) { + while (startIndex < string.length && chars.contains(string[startIndex])) + startIndex++; + } + return string.substring(startIndex); +} diff --git a/packages/flodash/pubspec.lock b/packages/flodash/pubspec.lock index 11aaa1f..f5ea8a7 100644 --- a/packages/flodash/pubspec.lock +++ b/packages/flodash/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.17.2" fake_async: dependency: transitive description: @@ -50,7 +50,7 @@ packages: source: hosted version: "1.3.1" flutter: - dependency: "direct main" + dependency: transitive description: flutter source: sdk version: "0.0.0" @@ -59,30 +59,22 @@ packages: description: flutter source: sdk version: "0.0.0" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" matcher: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: @@ -108,10 +100,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: @@ -148,10 +140,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.0" vector_math: dependency: transitive description: @@ -160,6 +152,13 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" sdks: - dart: ">=3.0.0-0 <3.7.0" - flutter: ">=1.17.0" + dart: ">=3.1.0-185.0.dev <3.7.0" diff --git a/packages/flodash/pubspec.yaml b/packages/flodash/pubspec.yaml index cd151f3..05b1d44 100644 --- a/packages/flodash/pubspec.yaml +++ b/packages/flodash/pubspec.yaml @@ -1,15 +1,10 @@ name: flodash description: A dart implementation of the popular JavaScript library Lodash -version: 1.0.2 +version: 1.1.0-blizzard.6 repository: https://github.com/sliit-foss/flodash environment: sdk: ">=2.12.0 <3.7.0" - flutter: ">=1.17.0" - -dependencies: - flutter: - sdk: flutter dev_dependencies: flutter_test: diff --git a/packages/flodash/test/modules/array/chunk_test.dart b/packages/flodash/test/modules/array/chunk_test.dart index a1d6211..b5f66db 100644 --- a/packages/flodash/test/modules/array/chunk_test.dart +++ b/packages/flodash/test/modules/array/chunk_test.dart @@ -3,7 +3,7 @@ import 'package:flodash/flodash.dart' as flodash; import 'package:flutter_test/flutter_test.dart'; main() { - List li = ["a", "b", "c", "d"]; + List li = ["a", "b", "c", "d"]; test('even-split', () { expect( flodash.chunk(li, size: 2), diff --git a/packages/flodash/test/modules/number/clamp_test.dart b/packages/flodash/test/modules/number/clamp_test.dart new file mode 100644 index 0000000..4582882 --- /dev/null +++ b/packages/flodash/test/modules/number/clamp_test.dart @@ -0,0 +1,22 @@ +import 'package:flodash/flodash.dart' as flodash; + +import 'package:flutter_test/flutter_test.dart'; + +main() { + test('lower', () { + expect(flodash.clamp(-10, -5, 5), equals(-5)); + }); + test('upper', () { + expect(flodash.clamp(10, -5, 5), equals(5)); + }); + test('in range', () { + expect(flodash.clamp(3, -5, 5), equals(3)); + }); + test('2 arguments - upper', () { + expect(flodash.clamp(12, 6), equals(6)); + }); + test('2 arguments - in range', () { + expect(flodash.clamp(4, 6), equals(4)); + expect(flodash.clamp(-500, 5), equals(-500)); + }); +} diff --git a/packages/flodash/test/modules/string/starts_with_test.dart b/packages/flodash/test/modules/string/starts_with_test.dart new file mode 100644 index 0000000..cc794db --- /dev/null +++ b/packages/flodash/test/modules/string/starts_with_test.dart @@ -0,0 +1,26 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:flodash/flodash.dart' as flodash; + +void main() { + test('should return true if the string starts with the target', () { + String string = 'abc'; + String target = 'a'; + bool result = flodash.startsWith(string, target); + expect(result, true); + }); + test('should return false if the string does not start with the target', () { + String string = 'abc'; + String target = 'b'; + bool result = flodash.startsWith(string, target); + expect(result, false); + }); + test( + 'should return true if the string starts with the target at the specified position', + () { + String string = 'abc'; + String target = 'b'; + int position = 1; + bool result = flodash.startsWith(string, target, position); + expect(result, true); + }); +} diff --git a/packages/flodash/test/modules/string/to_lower_test.dart b/packages/flodash/test/modules/string/to_lower_test.dart new file mode 100644 index 0000000..a6e9aa7 --- /dev/null +++ b/packages/flodash/test/modules/string/to_lower_test.dart @@ -0,0 +1,33 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:flodash/flodash.dart' as flodash; + +void main() { + test('should convert the string to lower case', () { + String input = '--Foo-Bar--'; + String expected = '--foo-bar--'; + String result = flodash.toLower(input); + expect(result, expected); + }); + test( + 'should convert the string to lower case when it contains both lowercase and uppercase characters', + () { + String input = 'fooBar'; + String expected = 'foobar'; + String result = flodash.toLower(input); + expect(result, expected); + }); + test( + 'should convert the string to lower case while preserving special characters', + () { + String input = '__FOO_BAR__'; + String expected = '__foo_bar__'; + String result = flodash.toLower(input); + expect(result, expected); + }); + test('should return an empty string if no input is provided', () { + String input = ''; + String expected = ''; + String result = flodash.toLower(input); + expect(result, expected); + }); +} diff --git a/packages/flodash/test/modules/string/to_upper_test.dart b/packages/flodash/test/modules/string/to_upper_test.dart new file mode 100644 index 0000000..e5c833f --- /dev/null +++ b/packages/flodash/test/modules/string/to_upper_test.dart @@ -0,0 +1,33 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:flodash/flodash.dart' as flodash; + +void main() { + test('should convert the string to upper case', () { + String input = '--foo-bar--'; + String expected = '--FOO-BAR--'; + String result = flodash.toUpper(input); + expect(result, expected); + }); + test( + 'should convert the string to upper case when it contains both lowercase and uppercase characters', + () { + String input = 'fooBar'; + String expected = 'FOOBAR'; + String result = flodash.toUpper(input); + expect(result, expected); + }); + test( + 'should convert the string to upper case while preserving special characters', + () { + String input = '__foo_bar__'; + String expected = '__FOO_BAR__'; + String result = flodash.toUpper(input); + expect(result, expected); + }); + test('should return an empty string if no input is provided', () { + String input = ''; + String expected = ''; + String result = flodash.toUpper(input); + expect(result, expected); + }); +} diff --git a/packages/flodash/test/modules/string/trim_end_test.dart b/packages/flodash/test/modules/string/trim_end_test.dart new file mode 100644 index 0000000..f56c342 --- /dev/null +++ b/packages/flodash/test/modules/string/trim_end_test.dart @@ -0,0 +1,37 @@ +import 'package:flodash/flodash.dart' as flodash; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + test('trimEnd with trailing whitespace', () { + String result = flodash.trimEnd(' abc '); + expect(result, ' abc'); + }); + test('trimEnd with specified characters', () { + String result = flodash.trimEnd('-_-abc-_-', '_-'); + expect(result, '-_-abc'); + }); + test('trimEnd with empty string', () { + String result = flodash.trimEnd(''); + expect(result, ''); + }); + test('trimEnd with empty string and specified characters', () { + String result = flodash.trimEnd('', '_-'); + expect(result, ''); + }); + test('trimEnd with no whitespace or specified characters', () { + String result = flodash.trimEnd('abc'); + expect(result, 'abc'); + }); + test('trimEnd with only whitespace', () { + String result = flodash.trimEnd(' '); + expect(result, ''); + }); + test('trimEnd with only specified characters', () { + String result = flodash.trimEnd('---', '-'); + expect(result, ''); + }); + test('trimEnd with whitespace and specified characters', () { + String result = flodash.trimEnd('abc -_- ', '_- '); + expect(result, 'abc'); + }); +} diff --git a/packages/flodash/test/modules/string/trim_start_test.dart b/packages/flodash/test/modules/string/trim_start_test.dart new file mode 100644 index 0000000..62cf7f4 --- /dev/null +++ b/packages/flodash/test/modules/string/trim_start_test.dart @@ -0,0 +1,37 @@ +import 'package:flodash/flodash.dart' as flodash; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + test('trimStart with leading whitespace', () { + String result = flodash.trimStart(' abc '); + expect(result, 'abc '); + }); + test('trimStart with specified characters', () { + String result = flodash.trimStart('-_-abc-_-', '_-'); + expect(result, 'abc-_-'); + }); + test('trimStart with empty string', () { + String result = flodash.trimStart(''); + expect(result, ''); + }); + test('trimStart with empty string and specified characters', () { + String result = flodash.trimStart('', '_-'); + expect(result, ''); + }); + test('trimStart with no whitespace or specified characters', () { + String result = flodash.trimStart('abc'); + expect(result, 'abc'); + }); + test('trimStart with only whitespace', () { + String result = flodash.trimStart(' '); + expect(result, ''); + }); + test('trimStart with only specified characters', () { + String result = flodash.trimStart('---', '-'); + expect(result, ''); + }); + test('trimStart with whitespace and specified characters', () { + String result = flodash.trimStart(' -_-abc', '_- '); + expect(result, 'abc'); + }); +}