Skip to content

Commit 11d3488

Browse files
feat: prepare for release
0 parents  commit 11d3488

17 files changed

+1599
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://dart.dev/guides/libraries/private-files
2+
# Created by `dart pub`
3+
.dart_tool/

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
## 1.0.0
4+
5+
- Initial version.

LICENSE

Whitespace-only changes.

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Microdiff
2+
3+
Microdiff is fast, zery dependency object and array comparison library. It is a Dart porting of [microdiff](https://github.com/AsyncBanana/microdiff).
4+
5+
## Features
6+
7+
- 🚀 Fast
8+
- 💙 Easy to use, you need to simply call the `diff` function
9+
10+
## Usage
11+
12+
```dart
13+
import 'package:microdiff/microdiff.dart';
14+
15+
void main() {
16+
final diff = diff([1, 2, 3], [1, 2, 4]);
17+
print(diff);
18+
}
19+
```
20+
21+
## Get started
22+
23+
Add this to your package's `pubspec.yaml` file:
24+
25+
```yaml
26+
dependencies:
27+
microdiff: ^1.0.0
28+
```
29+
30+
Or you can install it from the command line:
31+
32+
```bash
33+
dart pub add microdiff
34+
```
35+
36+
## License

analysis_options.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file configures the static analysis results for your project (errors,
2+
# warnings, and lints).
3+
#
4+
# This enables the 'recommended' set of lints from `package:lints`.
5+
# This set helps identify many issues that may lead to problems when running
6+
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
7+
# style and format.
8+
#
9+
# If you want a smaller set of lints you can change this to specify
10+
# 'package:lints/core.yaml'. These are just the most critical lints
11+
# (the recommended set includes the core lints).
12+
# The core lints are also what is used by pub.dev for scoring packages.
13+
14+
include: package:lints/recommended.yaml
15+
16+
# Uncomment the following section to specify additional rules.
17+
18+
# linter:
19+
# rules:
20+
# - camel_case_types
21+
22+
# analyzer:
23+
# exclude:
24+
# - path/to/excluded/files/**
25+
26+
# For more information about the core and recommended set of lints, see
27+
# https://dart.dev/go/core-lints
28+
29+
# For additional information about configuring this file, see
30+
# https://dart.dev/guides/language/analysis-options

benchmark/benchmark.dart

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Import BenchmarkBase class.
2+
import 'dart:convert';
3+
import 'dart:io';
4+
5+
import 'package:benchmark_harness/benchmark_harness.dart';
6+
import 'package:microdiff/microdiff.dart';
7+
8+
// Create a new benchmark by extending BenchmarkBase
9+
class MicrodiffBenchmark extends BenchmarkBase {
10+
MicrodiffBenchmark() : super('Microdiff');
11+
12+
Map<String, dynamic> original = {};
13+
Map<String, dynamic> changed = {};
14+
15+
static void main() {
16+
MicrodiffBenchmark().report();
17+
}
18+
19+
@override
20+
void run() {
21+
diff(original, changed);
22+
}
23+
24+
@override
25+
void setup() {
26+
File file = File('data/data.json');
27+
final json = file.readAsStringSync();
28+
original = jsonDecode(json);
29+
changed = jsonDecode(json);
30+
changed['exclude'] = ['./src/app/og/*.{tsx}'];
31+
changed['conditions']['extend']['light'] = '';
32+
}
33+
34+
@override
35+
void teardown() {}
36+
}
37+
38+
void main() {
39+
// Run TemplateBenchmark
40+
MicrodiffBenchmark.main();
41+
}

0 commit comments

Comments
 (0)