Skip to content

Commit 2a547ab

Browse files
Merge pull request #57 from nventive/dev/lebo/pub-dev-score
chore: CLI improvements for pub.dev score
2 parents c2c92bc + 4bab1e5 commit 2a547ab

5 files changed

Lines changed: 37 additions & 7 deletions

File tree

CONTRIBUTING.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,21 @@ information on using pull requests.
8383
## Community Guidelines
8484

8585
This project follows [Google's Open Source Community
86-
Guidelines](https://opensource.google.com/conduct/).
86+
Guidelines](https://opensource.google.com/conduct/).
87+
88+
## pub.dev score
89+
90+
When making changes to the CLI, it's important to ensure that the resulting package is scored with the highest pub.dev score. The pub.dev score is a rating system that evaluates the quality of the package by evaluating common metrics (more info [here](https://pub.dev/help/scoring)). Before submitting your changes, please follow the following steps:
91+
92+
1. Open a terminal / command prompt window and navigate to the project directory.
93+
2. Navigate to the `src/cli` directory.
94+
3. Run the `build_runner` to ensure the creation of required generated code, for example:
95+
```
96+
$ dart run build_runner build --delete-conflicting-outputs
97+
```
98+
4. Activate the `pana` tool by running `dart pub global activate pana`
99+
5. Run the `pana` tool by executing the `pana` command and save its output to a markdown file, for example:
100+
```
101+
$ pana > ~/temp/pana-analysis.md
102+
```
103+
6. Open the markdown file and observe the scores for each category, make sure that each (except the first one) has a perfect score (for example 20/20). If not, resolve any issues before submitting a pull request. The first category will resolve itself before being shipped to pub.dev (as it depends on automated tasks in the CI)

src/cli/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4-
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55

66
Prefix your items with `(Template)` if the change is about the template and not the resulting application.
77

8+
## 0.24.2
9+
- General improvements, including sample documentation (see `src/cli/example/README.md`).
10+
811
## 0.24.1
912
- Add `getFromStream` to have ViewModel properties that automatically update based on `Stream` sources.
1013

src/cli/bin/flutter_application_generator.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import 'dart:io';
33
import 'package:flutter_application_generator/src/command_runner.dart';
44

55
Future<void> main(List<String> arguments) async {
6-
await _flushThenExit(await FlutterApplicationGeneratorCommandRunner().run(arguments));
6+
await _flushThenExit(
7+
await FlutterApplicationGeneratorCommandRunner().run(arguments));
78
}
89

910
/// Flushes the stdout and stderr streams, then exits the program with the given

src/cli/example/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Dad Jokes app example
2+
3+
The `flutter_application_generator` source code includes a complete working example in the `src/app/` folder. It's a simple joke browser app that uses the Reddit API to display jokes posted to the `r/dadjokes` subreddit and allows you to manage favorites (add / remove). It also includes an authentication example.
4+
5+
Before running the example, it's neccessary to run the `build_runner` package in order to create the required generated files. Using your terminal of choice, navigate to the `src/app/` folder and run the following:
6+
7+
```bash
8+
dart run build_runner build --delete-conflicting-outputs
9+
```

src/cli/pubspec.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ dependencies:
1010
args: ^2.4.2
1111
path: ^1.9.0
1212
cli_completion: ^0.5.0
13-
mason_logger: ^0.2.12
14-
pub_updater: ^0.4.0
15-
archive: ^3.6.0
13+
mason_logger: ^0.3.2
14+
pub_updater: ^0.5.0
15+
archive: ^4.0.2
1616
http: ^1.2.1
1717

1818
dev_dependencies:
1919
build_runner: ^2.4.8
2020
build_verify: ^3.1.0
2121
build_version: ^2.1.1
22-
lints: ^3.0.0
22+
lints: ^5.1.1
2323
test: ^1.24.0
2424

2525
executables:

0 commit comments

Comments
 (0)