Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Melos migration from 2.0.0 to 3.0.0 #33

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ app.*.map.json
# Secrets
app/lib/secrets/
!app/lib/secrets/app_secrets.skeleton.dart

# Omit committing pubspec_overrides.yaml
pubspec_overrides.yaml
# Omit committing pubspec.lock for library packages; see
# https://dart.dev/guides/libraries/private-files#pubspeclock.
pubspec.lock
pubspec.lock
# Omit committing coverage
coverage
.idea
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"conventionalCommits.scopes": [
"melos"
]
}
45 changes: 42 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,56 @@ especially public ones. To keep such data safe the template uses `app_secrets.da
want to run the app locally, you will need to create a new file `app_secrets.dart`
under [`lib/secrets`](app/lib/secrets). To help with setting up the secrets file, the template
inclued a skeleton secrets file.
#### Clear Build Cache

```bash
melos clean
```

#### Get Dependencies

```bash
melos run get
```

#### Run Code Generation
Instead of running

``melos run generate``

Just use below commands for code generation
```bash
melos bs
Or
melos bootstrap

```
#### Run Test Cases

To run test cases for a specific package
use following command


```bash
melos test:selective_unit_test
```
```
1) * [Default - Press Enter]
2) app
3) localisation
4) services
5) statemanagement_bloc
6) statemanagement_core
7) statemanagement_riverpod
8) themes
? Enter your choice
```
You will see the interface described above.
Pick the package for which you want to execute test cases.

To run all test cases run below command

```bash
melos run generate
melos test
```

#### Setup Hooks
Expand Down Expand Up @@ -458,4 +497,4 @@ upcoming [enhancements](https://github.com/NeoSOFT-Technologies/mobile-flutter/i
## Contributing to this Project

Contributions are welcome from anyone and everyone. We encourage you to review
the [Guiding principles for contributing](CONTRIBUTING.md)
the [Guiding principles for contributing](CONTRIBUTING.md)
1 change: 0 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ migrate_working_dir/
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols
Expand Down
45 changes: 38 additions & 7 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,26 @@ packages:
- statemanagement-riverpod
- themes

# Run command melos bs or melos bootstrap
command:
bootstrap:
hooks:
pre: echo `Running flutter pub get`
post: melos run generate

scripts:
clean-all:
run: melos run build-clean && melos run flutter-clean

flutter-clean:
exec: flutter clean
get:
run: melos exec flutter pub get

build-clean:
run: melos exec --scope="app,data,domain,database_floor,network_retrofit,themes" flutter pub run build_runner clean

generate:
run: melos exec --scope="app,data,domain,database_floor,network_retrofit,themes" -- flutter pub run build_runner build --delete-conflicting-outputs

get:
exec: flutter pub get

tidy:
run: melos run format && melos run dart-fix

Expand All @@ -39,6 +43,33 @@ scripts:

dart-fix:
exec: dart fix --apply

# Build apps for specific platform

# customize the target as per your need
build_web:
run: melos exec --scope="app" flutter build web --release --target=lib/entrypoints/main_prod.dart

# To generate the app bundle just replace flutter build apk --split-per-abi with appbundle
build_android:
run: melos exec --scope="app" flutter build apk --split-per-abi --obfuscate --split-debug-info=app/`$PWD` --flavor nps -t lib/entrypoints/main_prod.dart



# lib/entrypoints/main_qa.dart


# To run all test cases
test:
exec: flutter test --exclude-tags=golden
run: melos run test:selective_unit_test --no-select
description: Run all Flutter tests in this project.



# To run the test cases of specific package
test:selective_unit_test:
run: melos exec --dir-exists="test" --fail-fast -- flutter test --exclude-tags=golden --no-pub --coverage
description: "To run test cases of specific package"
packageFilters:
flutter: true
dirExists: "test"
7 changes: 7 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: flutter_template

environment:
sdk: ">=2.17.6 <3.0.0"
dev_dependencies:
melos: ^3.0.1