Skip to content

Commit 4661171

Browse files
author
Ellet
committed
docs: Update CHANGELOG.md and regenerate_versions.dart comments
1 parent 58f131d commit 4661171

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
All notable changes to this project will be documented in this file.
44

55
## 9.2.9
6-
* Placeholder
6+
* Refactor the type of `Delta().toJson()` to be more clear type
77

88
## 9.2.8
99
* feat: Export Container node as QuillContainer

scripts/regenerate_versions.dart

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ import 'dart:io' show File;
44

55
import 'package:yaml_edit/yaml_edit.dart';
66

7-
// You must run this script in the root folder of the repo and not inside the scripts
8-
97
import '../version.dart';
108

9+
/// The list of the packages that which will be used to update the `CHANGELOG.md`
10+
/// and the `README.md`, always make `'./'` at the top
11+
///
12+
/// since we should not update the `CHANGELOG.md` of
13+
/// the `flutter_quill` since it used
14+
/// in all the packages
1115
final packages = [
1216
'./',
1317
'./dart_quill_delta',
@@ -17,25 +21,36 @@ final packages = [
1721
'./quill_pdf_converter',
1822
];
1923

24+
/// A script that should run in the root folder of the repo and not inside
25+
/// the scripts folder
26+
///
27+
/// it will update the versions and changelogs, the versions will be all the same
28+
/// from the `version.dart` and the changelogs will be use the same one from the
29+
/// root folder of `flutter_quill`
2030
Future<void> main(List<String> args) async {
21-
for (final element in packages) {
22-
await updatePubspecYamlFile('$element/pubspec.yaml');
23-
if (element != packages.first) {
24-
updateChangelogMD(element);
31+
for (final packagePath in packages) {
32+
await updatePubspecYamlFile('$packagePath/pubspec.yaml');
33+
if (packagePath != packages.first) {
34+
updateChangelogMD('$packagePath/CHANGELOG.md');
2535
}
2636
}
2737
}
2838

29-
Future<void> updatePubspecYamlFile(String path) async {
30-
final file = File(path);
39+
/// Read the `version` variable from `version.dart`
40+
/// and update the package version
41+
/// in `pubspec.yaml` from the [pubspecYamlPath]
42+
Future<void> updatePubspecYamlFile(String pubspecYamlPath) async {
43+
final file = File(pubspecYamlPath);
3144
final yaml = await file.readAsString();
3245
final yamlEditor = YamlEditor(yaml)..update(['version'], version);
3346
await file.writeAsString(yamlEditor.toString());
3447
print(yamlEditor.toString());
3548
}
3649

37-
Future<void> updateChangelogMD(String path) async {
50+
/// Copy the text from the root `CHANGELOG.md` and paste it to the one
51+
/// from the [changeLogPath]
52+
Future<void> updateChangelogMD(String changeLogPath) async {
3853
final changeLog = await File('./CHANGELOG.md').readAsString();
39-
final currentFile = File('$path/CHANGELOG.md');
54+
final currentFile = File(changeLogPath);
4055
await currentFile.writeAsString(changeLog);
4156
}

0 commit comments

Comments
 (0)