diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f65724c..7ff7719 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -28,7 +28,14 @@ jobs: - uses: subosito/flutter-action@v2 - - name: Build and Test + - name: Build and Test Core + working-directory: packages/lite_ref_core + run: | + flutter pub get + flutter analyze + flutter test --coverage + + - name: Build and Test Flutter working-directory: packages/lite_ref run: | flutter pub get @@ -40,5 +47,5 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: - files: ./coverage/lcov.info + files: ./packages/lite_ref/coverage/lcov.info flags: unittests diff --git a/packages/lite_ref/lib/lite_ref.dart b/packages/lite_ref/lib/lite_ref.dart index ae43963..d3715f2 100644 --- a/packages/lite_ref/lib/lite_ref.dart +++ b/packages/lite_ref/lib/lite_ref.dart @@ -2,7 +2,6 @@ library lite_ref; export 'package:basic_interfaces/basic_interfaces.dart'; -export 'src/async/async.dart'; +export 'package:lite_ref_core/lite_ref_core.dart' hide Ref; export 'src/ref.dart'; export 'src/scoped/scoped.dart'; -export 'src/sync/sync.dart'; diff --git a/packages/lite_ref/lib/src/ref.dart b/packages/lite_ref/lib/src/ref.dart index 6348bfc..0ae56fb 100644 --- a/packages/lite_ref/lib/src/ref.dart +++ b/packages/lite_ref/lib/src/ref.dart @@ -1,8 +1,7 @@ // ignore_for_file: lines_longer_than_80_chars -import 'package:lite_ref/src/async/async.dart'; import 'package:lite_ref/src/scoped/scoped.dart'; -import 'package:lite_ref/src/sync/sync.dart'; +import 'package:lite_ref_core/lite_ref_core.dart'; /// abstract class for creating refs. /// ```dart @@ -66,6 +65,8 @@ abstract class Ref { return ScopedRef(create, dispose: dispose, autoDispose: autoDispose); } + // coverage:ignore-start + // tested in lite_ref_core /// Creates a new [SingletonRef] which always return the same instance. static SingletonRef singleton(T Function() create) { return SingletonRef(create); @@ -89,4 +90,5 @@ abstract class Ref { ) { return AsyncTransientRef(create); } + // coverage:ignore-end } diff --git a/packages/lite_ref/pubspec.yaml b/packages/lite_ref/pubspec.yaml index 18dbd78..48f7b25 100644 --- a/packages/lite_ref/pubspec.yaml +++ b/packages/lite_ref/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: basic_interfaces: ^1.0.4 flutter: sdk: flutter + lite_ref_core: ^0.1.0 dev_dependencies: flutter_test: diff --git a/packages/lite_ref_core/.github/ISSUE_TEMPLATE/bug_report.md b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..50a4c7b --- /dev/null +++ b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,29 @@ +--- +name: Bug Report +about: Create a report to help us improve +title: "fix: " +labels: bug +--- + +**Description** + +A clear and concise description of what the bug is. + +**Steps To Reproduce** + +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected Behavior** + +A clear and concise description of what you expected to happen. + +**Screenshots** + +If applicable, add screenshots to help explain your problem. + +**Additional Context** + +Add any other context about the problem here. diff --git a/packages/lite_ref_core/.github/ISSUE_TEMPLATE/build.md b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/build.md new file mode 100644 index 0000000..0cf8e62 --- /dev/null +++ b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/build.md @@ -0,0 +1,14 @@ +--- +name: Build System +about: Changes that affect the build system or external dependencies +title: "build: " +labels: build +--- + +**Description** + +Describe what changes need to be done to the build system and why. + +**Requirements** + +- [ ] The build system is passing diff --git a/packages/lite_ref_core/.github/ISSUE_TEMPLATE/chore.md b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/chore.md new file mode 100644 index 0000000..498ebfd --- /dev/null +++ b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/chore.md @@ -0,0 +1,14 @@ +--- +name: Chore +about: Other changes that don't modify src or test files +title: "chore: " +labels: chore +--- + +**Description** + +Clearly describe what change is needed and why. If this changes code then please use another issue type. + +**Requirements** + +- [ ] No functional changes to the code diff --git a/packages/lite_ref_core/.github/ISSUE_TEMPLATE/ci.md b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/ci.md new file mode 100644 index 0000000..fa2dd9e --- /dev/null +++ b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/ci.md @@ -0,0 +1,14 @@ +--- +name: Continuous Integration +about: Changes to the CI configuration files and scripts +title: "ci: " +labels: ci +--- + +**Description** + +Describe what changes need to be done to the ci/cd system and why. + +**Requirements** + +- [ ] The ci system is passing diff --git a/packages/lite_ref_core/.github/ISSUE_TEMPLATE/config.yml b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..ec4bb38 --- /dev/null +++ b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false \ No newline at end of file diff --git a/packages/lite_ref_core/.github/ISSUE_TEMPLATE/documentation.md b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/documentation.md new file mode 100644 index 0000000..f494a4d --- /dev/null +++ b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/documentation.md @@ -0,0 +1,14 @@ +--- +name: Documentation +about: Improve the documentation so all collaborators have a common understanding +title: "docs: " +labels: documentation +--- + +**Description** + +Clearly describe what documentation you are looking to add or improve. + +**Requirements** + +- [ ] Requirements go here diff --git a/packages/lite_ref_core/.github/ISSUE_TEMPLATE/feature_request.md b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..ddd2fcc --- /dev/null +++ b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,18 @@ +--- +name: Feature Request +about: A new feature to be added to the project +title: "feat: " +labels: feature +--- + +**Description** + +Clearly describe what you are looking to add. The more context the better. + +**Requirements** + +- [ ] Checklist of requirements to be fulfilled + +**Additional Context** + +Add any other context or screenshots about the feature request go here. diff --git a/packages/lite_ref_core/.github/ISSUE_TEMPLATE/performance.md b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/performance.md new file mode 100644 index 0000000..699b8d4 --- /dev/null +++ b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/performance.md @@ -0,0 +1,14 @@ +--- +name: Performance Update +about: A code change that improves performance +title: "perf: " +labels: performance +--- + +**Description** + +Clearly describe what code needs to be changed and what the performance impact is going to be. Bonus point's if you can tie this directly to user experience. + +**Requirements** + +- [ ] There is no drop in test coverage. diff --git a/packages/lite_ref_core/.github/ISSUE_TEMPLATE/refactor.md b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/refactor.md new file mode 100644 index 0000000..1626c57 --- /dev/null +++ b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/refactor.md @@ -0,0 +1,14 @@ +--- +name: Refactor +about: A code change that neither fixes a bug nor adds a feature +title: "refactor: " +labels: refactor +--- + +**Description** + +Clearly describe what needs to be refactored and why. Please provide links to related issues (bugs or upcoming features) in order to help prioritize. + +**Requirements** + +- [ ] There is no drop in test coverage. diff --git a/packages/lite_ref_core/.github/ISSUE_TEMPLATE/revert.md b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/revert.md new file mode 100644 index 0000000..9d121dc --- /dev/null +++ b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/revert.md @@ -0,0 +1,16 @@ +--- +name: Revert Commit +about: Reverts a previous commit +title: "revert: " +labels: revert +--- + +**Description** + +Provide a link to a PR/Commit that you are looking to revert and why. + +**Requirements** + +- [ ] Change has been reverted +- [ ] No change in test coverage has happened +- [ ] A new ticket is created for any follow on work that needs to happen diff --git a/packages/lite_ref_core/.github/ISSUE_TEMPLATE/style.md b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/style.md new file mode 100644 index 0000000..02244a7 --- /dev/null +++ b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/style.md @@ -0,0 +1,14 @@ +--- +name: Style Changes +about: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc) +title: "style: " +labels: style +--- + +**Description** + +Clearly describe what you are looking to change and why. + +**Requirements** + +- [ ] There is no drop in test coverage. diff --git a/packages/lite_ref_core/.github/ISSUE_TEMPLATE/test.md b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/test.md new file mode 100644 index 0000000..431a7ea --- /dev/null +++ b/packages/lite_ref_core/.github/ISSUE_TEMPLATE/test.md @@ -0,0 +1,14 @@ +--- +name: Test +about: Adding missing tests or correcting existing tests +title: "test: " +labels: test +--- + +**Description** + +List out the tests that need to be added or changed. Please also include any information as to why this was not covered in the past. + +**Requirements** + +- [ ] There is no drop in test coverage. diff --git a/packages/lite_ref_core/.github/PULL_REQUEST_TEMPLATE.md b/packages/lite_ref_core/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..1169936 --- /dev/null +++ b/packages/lite_ref_core/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,27 @@ + + +## Status + +**READY/IN DEVELOPMENT/HOLD** + +## Description + + + +## Type of Change + + + +- [ ] โœจ New feature (non-breaking change which adds functionality) +- [ ] ๐Ÿ› ๏ธ Bug fix (non-breaking change which fixes an issue) +- [ ] โŒ Breaking change (fix or feature that would cause existing functionality to change) +- [ ] ๐Ÿงน Code refactor +- [ ] โœ… Build configuration change +- [ ] ๐Ÿ“ Documentation +- [ ] ๐Ÿ—‘๏ธ Chore diff --git a/packages/lite_ref_core/.github/cspell.json b/packages/lite_ref_core/.github/cspell.json new file mode 100644 index 0000000..7544b2f --- /dev/null +++ b/packages/lite_ref_core/.github/cspell.json @@ -0,0 +1,21 @@ +{ + "version": "0.2", + "$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json", + "dictionaries": ["vgv_allowed", "vgv_forbidden"], + "dictionaryDefinitions": [ + { + "name": "vgv_allowed", + "path": "https://raw.githubusercontent.com/verygoodopensource/very_good_dictionaries/main/allowed.txt", + "description": "Allowed VGV Spellings" + }, + { + "name": "vgv_forbidden", + "path": "https://raw.githubusercontent.com/verygoodopensource/very_good_dictionaries/main/forbidden.txt", + "description": "Forbidden VGV Spellings" + } + ], + "useGitignore": true, + "words": [ + "lite_ref_core" + ] +} diff --git a/packages/lite_ref_core/.github/dependabot.yaml b/packages/lite_ref_core/.github/dependabot.yaml new file mode 100644 index 0000000..63b035c --- /dev/null +++ b/packages/lite_ref_core/.github/dependabot.yaml @@ -0,0 +1,11 @@ +version: 2 +enable-beta-ecosystems: true +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/" + schedule: + interval: "daily" diff --git a/packages/lite_ref_core/.github/workflows/main.yaml b/packages/lite_ref_core/.github/workflows/main.yaml new file mode 100644 index 0000000..c7146c3 --- /dev/null +++ b/packages/lite_ref_core/.github/workflows/main.yaml @@ -0,0 +1,27 @@ +name: ci + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + semantic_pull_request: + uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/semantic_pull_request.yml@v1 + + spell-check: + uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/spell_check.yml@v1 + with: + includes: "**/*.md" + modified_files_only: false + + build: + uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1 + diff --git a/packages/lite_ref_core/.gitignore b/packages/lite_ref_core/.gitignore new file mode 100644 index 0000000..63962f1 --- /dev/null +++ b/packages/lite_ref_core/.gitignore @@ -0,0 +1,8 @@ +# See https://www.dartlang.org/guides/libraries/private-files + +# Files and directories created by pub +.dart_tool/ +.packages +build/ +pubspec.lock +coverage/ diff --git a/packages/lite_ref_core/CHANGELOG.md b/packages/lite_ref_core/CHANGELOG.md new file mode 100644 index 0000000..0747847 --- /dev/null +++ b/packages/lite_ref_core/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.1.0 + +- Initial release diff --git a/packages/lite_ref_core/LICENSE b/packages/lite_ref_core/LICENSE new file mode 100644 index 0000000..62492ab --- /dev/null +++ b/packages/lite_ref_core/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Remi Rousselet + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/lite_ref_core/README.md b/packages/lite_ref_core/README.md new file mode 100644 index 0000000..27a34d9 --- /dev/null +++ b/packages/lite_ref_core/README.md @@ -0,0 +1,62 @@ +# Lite Ref Core + +[![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link] +[![Powered by Mason](https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge)](https://github.com/felangel/mason) +[![License: MIT][license_badge]][license_link] + +A Very Good Project created by Very Good CLI. + +## Installation ๐Ÿ’ป + +**โ— In order to start using Lite Ref Core you must have the [Dart SDK][dart_install_link] installed on your machine.** + +Install via `dart pub add`: + +```sh +dart pub add lite_ref_core +``` + +--- + +## Continuous Integration ๐Ÿค– + +Lite Ref Core comes with a built-in [GitHub Actions workflow][github_actions_link] powered by [Very Good Workflows][very_good_workflows_link] but you can also add your preferred CI/CD solution. + +Out of the box, on each pull request and push, the CI `formats`, `lints`, and `tests` the code. This ensures the code remains consistent and behaves correctly as you add functionality or make changes. The project uses [Very Good Analysis][very_good_analysis_link] for a strict set of analysis options used by our team. Code coverage is enforced using the [Very Good Workflows][very_good_coverage_link]. + +--- + +## Running Tests ๐Ÿงช + +To run all unit tests: + +```sh +dart pub global activate coverage 1.2.0 +dart test --coverage=coverage +dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info +``` + +To view the generated coverage report you can use [lcov](https://github.com/linux-test-project/lcov). + +```sh +# Generate Coverage Report +genhtml coverage/lcov.info -o coverage/ + +# Open Coverage Report +open coverage/index.html +``` + +[dart_install_link]: https://dart.dev/get-dart +[github_actions_link]: https://docs.github.com/en/actions/learn-github-actions +[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg +[license_link]: https://opensource.org/licenses/MIT +[logo_black]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_black.png#gh-light-mode-only +[logo_white]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_white.png#gh-dark-mode-only +[mason_link]: https://github.com/felangel/mason +[very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg +[very_good_analysis_link]: https://pub.dev/packages/very_good_analysis +[very_good_coverage_link]: https://github.com/marketplace/actions/very-good-coverage +[very_good_ventures_link]: https://verygood.ventures +[very_good_ventures_link_light]: https://verygood.ventures#gh-light-mode-only +[very_good_ventures_link_dark]: https://verygood.ventures#gh-dark-mode-only +[very_good_workflows_link]: https://github.com/VeryGoodOpenSource/very_good_workflows diff --git a/packages/lite_ref_core/analysis_options.yaml b/packages/lite_ref_core/analysis_options.yaml new file mode 100644 index 0000000..799268d --- /dev/null +++ b/packages/lite_ref_core/analysis_options.yaml @@ -0,0 +1 @@ +include: package:very_good_analysis/analysis_options.5.1.0.yaml diff --git a/packages/lite_ref_core/lib/lite_ref_core.dart b/packages/lite_ref_core/lib/lite_ref_core.dart new file mode 100644 index 0000000..2527561 --- /dev/null +++ b/packages/lite_ref_core/lib/lite_ref_core.dart @@ -0,0 +1,7 @@ +/// A lightweight dependency injection package for dart and flutter with +/// support for overriding for testing. +library; + +export 'src/async/async.dart'; +export 'src/lite_ref_core.dart'; +export 'src/sync/sync.dart'; diff --git a/packages/lite_ref/lib/src/async/async.dart b/packages/lite_ref_core/lib/src/async/async.dart similarity index 62% rename from packages/lite_ref/lib/src/async/async.dart rename to packages/lite_ref_core/lib/src/async/async.dart index 81a0b55..46325f9 100644 --- a/packages/lite_ref/lib/src/async/async.dart +++ b/packages/lite_ref_core/lib/src/async/async.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:flutter/foundation.dart'; +import 'package:meta/meta.dart'; part 'singleton.dart'; part 'transient.dart'; diff --git a/packages/lite_ref/lib/src/async/singleton.dart b/packages/lite_ref_core/lib/src/async/singleton.dart similarity index 100% rename from packages/lite_ref/lib/src/async/singleton.dart rename to packages/lite_ref_core/lib/src/async/singleton.dart diff --git a/packages/lite_ref/lib/src/async/transient.dart b/packages/lite_ref_core/lib/src/async/transient.dart similarity index 100% rename from packages/lite_ref/lib/src/async/transient.dart rename to packages/lite_ref_core/lib/src/async/transient.dart diff --git a/packages/lite_ref_core/lib/src/lite_ref_core.dart b/packages/lite_ref_core/lib/src/lite_ref_core.dart new file mode 100644 index 0000000..9141240 --- /dev/null +++ b/packages/lite_ref_core/lib/src/lite_ref_core.dart @@ -0,0 +1,35 @@ +// ignore_for_file: lines_longer_than_80_chars + +import 'package:lite_ref_core/src/async/async.dart'; +import 'package:lite_ref_core/src/sync/sync.dart'; + +/// abstract class for creating refs. +/// ```dart +/// final singleton = Ref.singleton(() => Database()); +/// final transient = Ref.transient(() => APIClient()); +/// ``` +abstract class Ref { + /// Creates a new [SingletonRef] which always return the same instance. + static SingletonRef singleton(T Function() create) { + return SingletonRef(create); + } + + /// Creates a new [TransientRef] which always return a new instance. + static TransientRef transient(T Function() create) { + return TransientRef(create); + } + + /// Creates a new [AsyncSingletonRef] which always return the same instance. + static AsyncSingletonRef asyncSingleton( + Future Function() create, + ) { + return AsyncSingletonRef(create); + } + + /// Creates a new [AsyncTransientRef] which always return a new instance. + static AsyncTransientRef asyncTransient( + Future Function() create, + ) { + return AsyncTransientRef(create); + } +} diff --git a/packages/lite_ref/lib/src/sync/singleton.dart b/packages/lite_ref_core/lib/src/sync/singleton.dart similarity index 100% rename from packages/lite_ref/lib/src/sync/singleton.dart rename to packages/lite_ref_core/lib/src/sync/singleton.dart diff --git a/packages/lite_ref/lib/src/sync/sync.dart b/packages/lite_ref_core/lib/src/sync/sync.dart similarity index 52% rename from packages/lite_ref/lib/src/sync/sync.dart rename to packages/lite_ref_core/lib/src/sync/sync.dart index d08055f..7e3f901 100644 --- a/packages/lite_ref/lib/src/sync/sync.dart +++ b/packages/lite_ref_core/lib/src/sync/sync.dart @@ -1,4 +1,4 @@ -import 'package:flutter/foundation.dart'; +import 'package:meta/meta.dart'; part 'singleton.dart'; part 'transient.dart'; diff --git a/packages/lite_ref/lib/src/sync/transient.dart b/packages/lite_ref_core/lib/src/sync/transient.dart similarity index 100% rename from packages/lite_ref/lib/src/sync/transient.dart rename to packages/lite_ref_core/lib/src/sync/transient.dart diff --git a/packages/lite_ref_core/pubspec.yaml b/packages/lite_ref_core/pubspec.yaml new file mode 100644 index 0000000..4cb9ea3 --- /dev/null +++ b/packages/lite_ref_core/pubspec.yaml @@ -0,0 +1,14 @@ +name: lite_ref_core +description: A lightweight dependency injection package for dart and flutter with support for overriding for testing. +version: 0.1.0 +repository: https://github.com/jinyus/lite_ref + +environment: + sdk: "^3.0.0" + +dependencies: + meta: ^1.0.0 + +dev_dependencies: + test: ^1.25.2 + very_good_analysis: ^5.1.0 diff --git a/packages/lite_ref/test/src/async/singleton_test.dart b/packages/lite_ref_core/test/src/async/singleton_test.dart similarity index 97% rename from packages/lite_ref/test/src/async/singleton_test.dart rename to packages/lite_ref_core/test/src/async/singleton_test.dart index 77bbbf7..af33a30 100644 --- a/packages/lite_ref/test/src/async/singleton_test.dart +++ b/packages/lite_ref_core/test/src/async/singleton_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter_test/flutter_test.dart'; -import 'package:lite_ref/lite_ref.dart'; +import 'package:lite_ref_core/lite_ref_core.dart'; +import 'package:test/test.dart'; import '../common.dart'; diff --git a/packages/lite_ref/test/src/async/transient_test.dart b/packages/lite_ref_core/test/src/async/transient_test.dart similarity index 92% rename from packages/lite_ref/test/src/async/transient_test.dart rename to packages/lite_ref_core/test/src/async/transient_test.dart index cd46044..846330f 100644 --- a/packages/lite_ref/test/src/async/transient_test.dart +++ b/packages/lite_ref_core/test/src/async/transient_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter_test/flutter_test.dart'; -import 'package:lite_ref/lite_ref.dart'; +import 'package:lite_ref_core/lite_ref_core.dart'; +import 'package:test/test.dart'; import '../common.dart'; diff --git a/packages/lite_ref/test/src/common.dart b/packages/lite_ref_core/test/src/common.dart similarity index 100% rename from packages/lite_ref/test/src/common.dart rename to packages/lite_ref_core/test/src/common.dart diff --git a/packages/lite_ref/test/src/sync/singleton_test.dart b/packages/lite_ref_core/test/src/sync/singleton_test.dart similarity index 95% rename from packages/lite_ref/test/src/sync/singleton_test.dart rename to packages/lite_ref_core/test/src/sync/singleton_test.dart index 1375b6b..e3655c1 100644 --- a/packages/lite_ref/test/src/sync/singleton_test.dart +++ b/packages/lite_ref_core/test/src/sync/singleton_test.dart @@ -1,5 +1,5 @@ -import 'package:flutter_test/flutter_test.dart'; -import 'package:lite_ref/lite_ref.dart'; +import 'package:lite_ref_core/lite_ref_core.dart'; +import 'package:test/test.dart'; import '../common.dart'; diff --git a/packages/lite_ref/test/src/sync/transient_test.dart b/packages/lite_ref_core/test/src/sync/transient_test.dart similarity index 90% rename from packages/lite_ref/test/src/sync/transient_test.dart rename to packages/lite_ref_core/test/src/sync/transient_test.dart index 5de0ca5..c43161a 100644 --- a/packages/lite_ref/test/src/sync/transient_test.dart +++ b/packages/lite_ref_core/test/src/sync/transient_test.dart @@ -1,7 +1,7 @@ // ignore_for_file: prefer_const_constructors, cascade_invocations -import 'package:flutter_test/flutter_test.dart'; -import 'package:lite_ref/lite_ref.dart'; +import 'package:lite_ref_core/lite_ref_core.dart'; +import 'package:test/test.dart'; import '../common.dart'; diff --git a/run.sh b/run.sh old mode 100644 new mode 100755 index eb882e4..8212138 --- a/run.sh +++ b/run.sh @@ -12,14 +12,15 @@ test_target() { if [ "$1" == "core" ]; then echo "testing core" - cd packages/lite_ref && + cd packages/lite_ref_core && flutter test --coverage --timeout 5s - elif [ "$1" == "beacon" ]; then - echo "testing beacon" - cd packages/lite_ref_beacon && + elif [ "$1" == "flutter" ]; then + echo "testing flutter" + cd packages/lite_ref && flutter test --coverage --timeout 5s elif [ "$1" == "all" ]; then - test_target "core" + test_target "core" && + test_target "flutter" else echo -e "unknown test \"$1\" \nValid tests are: core, all" fi @@ -29,11 +30,11 @@ publish_target() { cp README.md packages/lite_ref/README.md && if [ "$1" == "core" ]; then echo "publishing core" - cd packages/lite_ref && + cd packages/lite_ref_core && dart pub publish - elif [ "$1" == "beacon" ]; then - echo "publishing beacon" - cd packages/lite_ref_beacon && + elif [ "$1" == "flutter" ]; then + echo "publishing flutter" + cd packages/lite_ref && dart pub publish else echo -e "unknown package \"$1\" \nValid packages are: core, flutter, lint"