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

chore: update readme #16

Merged
merged 1 commit into from
Jul 6, 2023
Merged
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
101 changes: 68 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Nekoton Webview

[![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]
[![License: AGPLv3][license_badge]][license_link]
[![app](https://github.com/broxus/nekoton_webview/actions/workflows/main.yaml/badge.svg)](https://github.com/broxus/nekoton_webview/actions/workflows/main.yaml)

Flutter webview nekoton inpage provider bindings
Expand All @@ -11,65 +10,101 @@ Flutter webview nekoton inpage provider bindings

**❗ In order to start using Nekoton Webview you must have the [Flutter SDK][flutter_install_link] installed on your machine.**

Add `nekoton_webview` to your `pubspec.yaml`:
Add [nekoton_webview][pubdev_link] to your `pubspec.yaml`:

```yaml
dependencies:
nekoton_webview:
```

Install it:
## Melos magic πŸͺ„

```sh
flutter packages get
Using [melos](https://melos.invertase.dev/) makes it very easy to work with the project, so enjoy.

You can run any job interactively run running `melos run` and selecting needed case or directly (e.g. `melos run test`).

### Bootstrap 🏁

Melos takes care about dependencies of all packages, including managing of local-generated library version. So, just run:

```
melos bs
```

---
### Codegen 🦾

## Continuous Integration πŸ€–
This thing will run all code generators for all packages:

Nekoton Webview 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.
```
$ melos run codegen
```

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].
### Clean up 🧹

---
Just run commands below to clean all, including build directories and flutter projects.

## Running Tests πŸ§ͺ
```
melos clean
```

For first time users, install the [very_good_cli][very_good_cli_link]:
### Tests βœ”οΈ

```sh
dart pub global activate very_good_cli
You can run all tests at one by running this command.

```
melos run test
```

To run all unit tests:
### Code πŸ“Š

```sh
very_good test --coverage
You can run code analysis:

```
melos run analyze
```

To view the generated coverage report you can use [lcov](https://github.com/linux-test-project/lcov).
### Code format πŸ—ƒοΈ

```sh
# Generate Coverage Report
genhtml coverage/lcov.info -o coverage/
`melos run check-format` will check, `melos run format` will fix dart code formatting.

# Open Coverage Report
open coverage/index.html
```
melos run check-format
melos run format
```

### Prepare to commit 🀝🏻

`melos run check-all` will ckeck, analyze and run all tests.

```
melos run check-all
```

## Conventional Commits ❀️

[This magic](https://melos.invertase.dev/guides/automated-releases#versioning) will update version and build our library automatically using commit messages and tags. [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0) is a lightweight convention on top of commit messages.

## Version 🏷️

Package version control is done by melos. It runs by gh action 'Create version PR' ```melos version -a --yes```.

## Continuous Integration πŸ€–

Nekoton Webview 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].

## Github Secrets πŸ”‘

`BOT_ACCESS_TOKEN`: Personal access token (PAT) used to fetch the repository. We should use PAT and not default GITHUB_TOKEN because ["When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN, with the exception of workflow_dispatch and repository_dispatch, will not create a new workflow run"](https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow). We want to trigger a workflow from the workflow (to run tests), so we need to use PAT. This thing is used in `version` workflow.


[flutter_install_link]: https://docs.flutter.dev/get-started/install
[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
[license_badge]: https://img.shields.io/badge/license-AGPLv3-blue.svg
[license_link]: https://opensource.org/license/agpl-v3/
[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_cli_link]: https://pub.dev/packages/very_good_cli
[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
[pubdev_link]: https://pub.dev/packages/nekoton_webview
Loading