Skip to content

Commit 7907fd4

Browse files
committed
build: structural configurations
1 parent 00959bc commit 7907fd4

File tree

7 files changed

+72
-33
lines changed

7 files changed

+72
-33
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# building, and deploying using Github Actions.
33
name: Flutter CI
44

5-
# Controls when the action will run.
5+
# Controls when the action will run.
66
on:
77
# Triggers the workflow on push or pull request events but only for the main branch
88
push:
9-
branches: [ master ]
9+
branches: [master]
1010
pull_request:
1111

1212
# Allows you to run this workflow manually from the Actions tab
@@ -31,19 +31,14 @@ jobs:
3131
- uses: subosito/flutter-action@v1
3232
with:
3333
channel: 'stable'
34-
3534
# Get flutter dependencies.
3635
- run: flutter pub get
37-
3836
# Check for any formatting issues in the code.
3937
- run: flutter format --set-exit-if-changed lib/ test/ example/
40-
4138
# Statically analyze the Dart code for any errors.
4239
- run: flutter analyze --no-current-package lib/ test/ example/
43-
4440
# Run widget tests for our flutter project.
4541
- run: flutter test --no-pub --coverage
46-
4742
- name: Upload coverage to Codecov
4843
uses: codecov/codecov-action@v1
4944
with:

.rultor.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ release:
2121
# repository.
2222
script: |-
2323
sed -i "s/^\(version:\).*/\1 $tag/" pubspec.yaml
24-
sed -i "/\[Unreleased\]/a\\\n## [$tag] - $(date '+%F')" CHANGELOG.md
24+
sed -i "/\[[Uu]nreleased\]/a\\\n## [$tag] - $(date '+%F')" CHANGELOG.md
2525
mkdir -p ~/.pub-cache
2626
mv ../credentials.json ~/.pub-cache/credentials.json
27+
flutter clean
28+
flutter pub get
2729
flutter pub publish -f
2830
git commit -am "version $tag"
2931
git checkout master

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
<!-- @todo #1 Describe initial release. -->
11-
## [0.1.0]
11+
12+
## [0.0.1]

README.md

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,51 @@
1-
## json_cache
1+
# json_cache
22

33
<center>
44
<img width="406" hight="192" alt="json cache logo" src="https://user-images.githubusercontent.com/24878574/119276278-56ef4a80-bbf0-11eb-8701-53a94f24f75b.png" align="middle">
55
</center>
66

7-
[![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)
8-
[![DevOps By Rultor.com](https://www.rultor.com/b/dartoos-dev/json_cache)](https://www.rultor.com/p/dartoos-dev/json_cache)
7+
[![EO principles respected
8+
here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)
9+
[![DevOps By
10+
Rultor.com](https://www.rultor.com/b/dartoos-dev/json_cache)](https://www.rultor.com/p/dartoos-dev/json_cache)
911

1012
[![pub](https://img.shields.io/pub/v/json_cache)](https://pub.dev/packages/json_cache)
1113
[![license](https://img.shields.io/badge/license-mit-green.svg)](https://github.com/dartoos-dev/json_cache/blob/master/LICENSE)
12-
[![style: lint](https://img.shields.io/badge/style-lint-4BC0F5.svg)](https://pub.dev/packages/lint)
1314
[![PDD status](https://www.0pdd.com/svg?name=dartoos-dev/json_cache)](https://www.0pdd.com/p?name=dartoos-dev/json_cache)
15+
1416
[![build](https://github.com/dartoos-dev/json_cache/actions/workflows/build.yml/badge.svg)](https://github.com/dartoos-dev/json_cache/actions/)
15-
[![codecov](https://codecov.io/gh/dartoos-dev/json_cache/branch/master/graph/badge.svg?token=7T5VNQIIMZ)](https://codecov.io/gh/dartoos-dev/json_cache)
16-
[![Hits-of-Code](https://hitsofcode.com/github/dartoos-dev/json_cache)](https://hitsofcode.com/github/dartoos-dev/json_cache/view)
17+
[![codecov](https://codecov.io/gh/dartoos-dev/json_cache/branch/master/graph/badge.svg?token=W6spF0S796)](https://codecov.io/gh/dartoos-dev/json_cache)
18+
[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/rafamizes/json_cache)](https://www.codefactor.io/repository/github/rafamizes/json_cache)
19+
[![style: lint](https://img.shields.io/badge/style-lint-4BC0F5.svg)](https://pub.dev/packages/lint)
20+
[![Hits-of-Code](https://hitsofcode.com/github/dartoos-dev/json_cache?branch=master)](https://hitsofcode.com/github/dartoos-dev/json_cache/view?branch=master)
21+
22+
## Contents
23+
24+
- [Overview](#overview)
25+
- [Getting Started](#getting-started)
26+
- [Demo application](#demo-application)
27+
- [References](#references)
28+
29+
## Overview
1730

1831
**Json Cache** is an object-oriented package to serve as a layer on top of local
19-
storage packages - packages that persist data locally on the user's device
20-
-, unifying them as an elegant cache API.
32+
storage packages, unifying them as an elegant caching API.
2133

22-
In addition, this package gives the programmer great flexibility; it provides a
23-
set of classes that can be selected and combined in various ways to address
24-
specific caching requirements.
34+
In addition, this package gives developers great flexibility by providing a set
35+
of classes that can be selected and combined in various ways to meet specific
36+
requirements.
2537

2638
**Why Json?**
2739

2840
- Because most of the local storage packages available for Flutter applications
2941
use json as the data format.
3042
- There is an one-to-one relationship between the Dart's built-in type
31-
```Map<String, dynamic>``` and json, which makes json encoding/decoding a
43+
`Map<String, dynamic>` and json, which makes json encoding/decoding a
3244
trivial task.
3345

3446
## Getting Started
3547

36-
```JsonCache``` - the core interface of this package - represents the concept of
48+
`JsonCache` is the core interface of this package and represents the concept of
3749
cached data. It is defined as:
3850

3951
```dart
@@ -53,9 +65,9 @@ abstract class JsonCache {
5365
}
5466
```
5567

56-
It's reasonable to consider each cache entry (pair of key/data) as a group of
57-
related data. Thus, it is expected to cache user data in groups, in which a key
58-
represents the name of a single group of data. Example:
68+
It is reasonable to consider each cache entry (a key/data pair) as a group of
69+
related data. Thus, it is expected to cache user data into groups where a key
70+
represents the name of a single data group. For example:
5971

6072
```dart
6173
'profile': {'name': 'John Doe', 'email': '[email protected]', 'accountType': 'premium'};
@@ -66,3 +78,21 @@ Above the _'profile'_ key is associated with the group of profile related data;
6678
_'preferences'_, with preferences data.
6779

6880
<!-- @todo #10 Some implementation is needed to add more examples -->
81+
82+
## Demo application
83+
84+
The demo application provides a fully working example, focused on demonstrating
85+
the caching API in action. You can take the code in this demo and experiment
86+
with it.
87+
88+
To run the demo application:
89+
90+
```shell
91+
git clone https://github.com/dartoos-dev/json_cache.git
92+
cd json_cache/example/
93+
flutter run -d chrome
94+
```
95+
96+
This should launch the demo application on Chrome in debug mode.
97+
98+
## References

analysis_options.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
include: package:lint/analysis_options_package.yaml
2+
analyzer:
3+
strong-mode:
4+
# A value of false ensures that the type inference engine never implicitly casts
5+
# from dynamic to a more specific type.
6+
implicit-casts: false
7+
# A value of false ensures that the type inference engine never chooses the
8+
# dynamic type when it can’t determine a static type.
9+
implicit-dynamic: false
210
linter:
311
rules:
4-
# Always await.
5-
unawaited_futures: true
612
# Make constructors the first thing in every class
713
sort_constructors_first: true
814
# Good packages document everything
915
public_member_api_docs: true
16+
always_declare_return_types: true
17+
cancel_subscriptions: true
18+
close_sinks: true
19+
only_throw_errors: true
20+
package_api_docs: true

pubspec.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.6.1"
10+
version: "2.7.0"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
@@ -28,7 +28,7 @@ packages:
2828
name: charcode
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "1.2.0"
31+
version: "1.3.1"
3232
clock:
3333
dependency: transitive
3434
description:
@@ -80,7 +80,7 @@ packages:
8080
name: meta
8181
url: "https://pub.dartlang.org"
8282
source: hosted
83-
version: "1.3.0"
83+
version: "1.7.0"
8484
path:
8585
dependency: transitive
8686
description:
@@ -134,7 +134,7 @@ packages:
134134
name: test_api
135135
url: "https://pub.dartlang.org"
136136
source: hosted
137-
version: "0.3.0"
137+
version: "0.4.1"
138138
typed_data:
139139
dependency: transitive
140140
description:

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: json_cache
2-
description: A set of object-oriented classes for local caching of user data in json; a highly combinable layer on top of local storage packages, unifying them as an elegant cache API.
3-
version: 0.1.0
2+
description: An object-oriented package for caching user data locally in json; a combinable layer on top of local storage packages that unifies them as an elegant caching API.
3+
version: 0.0.1
44
homepage: https://dartoos.dev
55
repository: https://github.com/dartoos-dev/json_cache
66

0 commit comments

Comments
 (0)