diff --git a/CLAUDE.md b/CLAUDE.md
index ab9a3ef..a6dfc30 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -9,6 +9,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
- `melos exec -- flutter pub upgrade` - Upgrade all packages in the workspace
- `melos run update_nonstop_cli_version` - Update CLI version across packages
- `melos run update_nonstop_cli_bundles` - Update CLI bundles
+- `melos sync:readme` - Sync standardized README sections across all packages
### Just Commands (Alternative)
- `just upgrade_pub_packages` - Upgrade Flutter and Dart packages across workspace
@@ -25,7 +26,7 @@ This is a Flutter/Dart monorepo managed by Melos with the following structure:
### Core Organization
- **packages/**: Dart packages (libraries, utilities, CLI tools)
- **plugins/**: Flutter plugins (platform-specific functionality)
-- **tools/**: Maintenance scripts for CLI version and bundle updates
+- **tools/**: Maintenance scripts for CLI version, bundle updates, and README standardization
### Key Packages
- **nonstop_cli**: CLI tool with Mason bricks for project generation
@@ -65,6 +66,33 @@ This is a Flutter/Dart monorepo managed by Melos with the following structure:
- Includes doctor command for environment validation
- Template bundles are auto-updated via tools scripts
+## README Standardization (readme_sync)
+
+The repository uses an automated tool to maintain consistency across package READMEs.
+
+### How It Works
+- Common sections (headers, contributing, social links, etc.) are defined in centralized templates
+- READMEs use HTML comment markers to identify managed sections: `` and ``
+- Only content between markers is synced; package-specific content is preserved
+- Templates support variable substitution (package name, author, repo path, etc.)
+
+### Usage
+- **Sync all packages**: `melos sync:readme`
+- **Sync specific package**: `dart run tools/readme_sync/readme_sync.dart --package package_name`
+- **Preview changes**: `dart run tools/readme_sync/readme_sync.dart --dry-run`
+- **Validate markers**: `dart run tools/readme_sync/readme_sync.dart --validate`
+
+### Configuration Files
+- **templates/sections.yaml**: Centralized section templates
+- **config/packages.yaml**: Package-specific variables and section assignments
+- See `tools/readme_sync/README.md` for detailed documentation
+- See `tools/readme_sync/EXAMPLE_README.md` for marker placement examples
+
+### When to Use
+- After updating common content (contributing guidelines, social links, etc.)
+- When adding a new package to ensure consistent README structure
+- Before releases to ensure all READMEs are synchronized
+
## Important Notes
- This is a workspace managed by Melos - always run commands from the root
diff --git a/melos.yaml b/melos.yaml
index 8378323..e4822fc 100644
--- a/melos.yaml
+++ b/melos.yaml
@@ -53,3 +53,6 @@ scripts:
run: dart run tools/update_nonstop_cli_version.dart
update_nonstop_cli_bundles:
run: dart run tools/update_nonstop_cli_bundles.dart
+ sync:readme:
+ description: "Sync README sections across all packages"
+ run: dart run tools/readme_sync/readme_sync.dart
diff --git a/packages/connectivity_wrapper/README.md b/packages/connectivity_wrapper/README.md
index bff5899..511349e 100644
--- a/packages/connectivity_wrapper/README.md
+++ b/packages/connectivity_wrapper/README.md
@@ -1,3 +1,4 @@
+
@@ -311,34 +337,38 @@ A big thank you to all our contributors! š
---
+
## š Connect with NonStop
-
-
-**Stay connected and get the latest updates!**
-
-[](https://www.linkedin.com/company/nonstop-io)
-[](https://x.com/NonStopio)
-[](https://www.instagram.com/nonstopio_technologies/)
-[](https://www.youtube.com/@NonStopioTechnology)
-[](mailto:contact@nonstopio.com)
-
-
+
+
+
+
+
+
+
+
---
+
> ā Star us on [GitHub](https://github.com/nonstopio/flutter_forge) if this helped you!
+
+
## š License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
+
+
> š [Founded by Ajay Kumar](https://github.com/ProjectAJ14) š**
+
diff --git a/packages/dzod/README.md b/packages/dzod/README.md
index b93c114..0037e0c 100644
--- a/packages/dzod/README.md
+++ b/packages/dzod/README.md
@@ -1,3 +1,4 @@
+
@@ -9,6 +10,7 @@
Website
+
š Dzod
@@ -16,6 +18,7 @@
ā” Enterprise-grade Dart schema validation library
+
@@ -26,6 +29,7 @@
+
---
@@ -41,12 +45,29 @@ Dzod is an **enterprise-grade** Dart schema validation library heavily inspired
---
-## š Quick Start
+
+## Getting Started
+
+1. Open your project's `pubspec.yaml` file.
+2. Add the `dzod` package to your dependencies, replacing `[version]` with the latest version:
+ ```yaml
+ dependencies:
+ flutter:
+ sdk: flutter
+ dzod: ^[version]
+ ```
+3. Run `flutter pub get` to fetch the package.
+
-```bash
-# Add to your pubspec.yaml
-dart pub add dzod
+
+## Import the Package
+
+```dart
+import 'package:dzod/dzod.dart';
```
+
+
+## š Quick Start
### Example 1: Basic User Schema Validation
@@ -1048,34 +1069,50 @@ for (final entry in userSchema.shape.entries) {
---
-## š Connect with NonStop
+
+## Contributing
-
+We welcome contributions in various forms:
-**Stay connected and get the latest updates!**
+- Proposing new features or enhancements.
+- Reporting and fixing bugs.
+- Engaging in discussions to help make decisions.
+- Improving documentation, as it is essential.
+- Sending Pull Requests is greatly appreciated!
-[](https://www.linkedin.com/company/nonstop-io)
-[](https://x.com/NonStopio)
-[](https://www.instagram.com/nonstopio_technologies/)
-[](https://www.youtube.com/@NonStopioTechnology)
-[](mailto:contact@nonstopio.com)
+A big thank you to all our contributors! š
+
-
+
+## š Connect with NonStop
----
+
+
+
+
+
+
+
+
+
> ā Star us on [GitHub](https://github.com/nonstopio/flutter_forge) if this helped you!
+
+
## š License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
+
+
> š [Founded by Ajay Kumar](https://github.com/ProjectAJ14) š**
+
diff --git a/packages/html_rich_text/README.md b/packages/html_rich_text/README.md
index 9abe634..7191c3a 100644
--- a/packages/html_rich_text/README.md
+++ b/packages/html_rich_text/README.md
@@ -1,3 +1,4 @@
+
@@ -9,11 +10,14 @@
Website
+
# HTML Rich Text
+
[](https://github.com/nonstopio/flutter_forge/tree/main/packages/html_rich_text)
[](https://opensource.org/licenses/MIT)
+
A lightweight Flutter package for rendering HTML-styled text without heavy dependencies. Perfect for simple HTML text rendering with minimal overhead.
@@ -32,22 +36,27 @@ HTML Rich Text is an ultra-lightweight solution for parsing and displaying HTML-
- **O(n) Performance**: Single-pass parsing algorithm for optimal performance
- **Tree-Shaking Friendly**: Unused code is automatically removed during compilation
+
## Getting Started
-1. Add `html_rich_text` to your `pubspec.yaml`:
+1. Open your project's `pubspec.yaml` file.
+2. Add the `html_rich_text` package to your dependencies, replacing `[version]` with the latest version:
```yaml
dependencies:
flutter:
sdk: flutter
- html_rich_text: ^1.0.0
+ html_rich_text: ^[version]
```
-2. Run `flutter pub get` to fetch the package.
+3. Run `flutter pub get` to fetch the package.
+
+
## Import the Package
```dart
import 'package:html_rich_text/html_rich_text.dart';
```
+
## Usage
@@ -199,45 +208,50 @@ This package is designed for simple HTML text styling. It does not support:
For complex HTML rendering needs, consider using full-featured packages like `flutter_html`.
+
## Contributing
We welcome contributions in various forms:
-- Proposing new features or enhancements
-- Reporting and fixing bugs
-- Improving documentation
-- Sending Pull Requests
+- Proposing new features or enhancements.
+- Reporting and fixing bugs.
+- Engaging in discussions to help make decisions.
+- Improving documentation, as it is essential.
+- Sending Pull Requests is greatly appreciated!
----
+A big thank you to all our contributors! š
+
+
## š Connect with NonStop
-
-
-**Stay connected and get the latest updates!**
-
-[](https://www.linkedin.com/company/nonstop-io)
-[](https://x.com/NonStopio)
-[](https://www.instagram.com/nonstopio_technologies/)
-[](https://www.youtube.com/@NonStopioTechnology)
-[](mailto:contact@nonstopio.com)
-
-
-
----
+
+
+
+
+
+
+
+
+
> ā Star us on [GitHub](https://github.com/nonstopio/flutter_forge) if this helped you!
+
+
## š License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
+
+
> š [Founded by Ajay Kumar](https://github.com/ProjectAJ14) š**
+
diff --git a/packages/morse_tap/README.md b/packages/morse_tap/README.md
index 086bfa4..dd6fa5e 100644
--- a/packages/morse_tap/README.md
+++ b/packages/morse_tap/README.md
@@ -1,3 +1,4 @@
+
@@ -9,11 +10,14 @@
Website
+
# morse_tap
+
[](https://github.com/nonstopio/flutter_forge/tree/main/packages/morse_tap)
[](https://opensource.org/licenses/MIT)
+
A Flutter package that provides Morse code input functionality using intuitive gestures. Create interactive Morse code experiences with single taps for dots, double taps for dashes, and long presses for spaces.
@@ -21,13 +25,35 @@ A Flutter package that provides Morse code input functionality using intuitive g
## Features
-⨠**MorseTapDetector** - Widget that detects specific Morse code patterns using gestures
-šÆ **MorseTextInput** - Real-time gesture-to-text conversion widget
-š **String Extensions** - Convert any string to/from Morse code
-ā” **Fast Algorithm** - Efficient Morse code conversion with comprehensive character support
-šØ **Intuitive Gestures** - Single tap = dot, double tap = dash, long press = space
+⨠**MorseTapDetector** - Widget that detects specific Morse code patterns using gestures
+šÆ **MorseTextInput** - Real-time gesture-to-text conversion widget
+š **String Extensions** - Convert any string to/from Morse code
+ā” **Fast Algorithm** - Efficient Morse code conversion with comprehensive character support
+šØ **Intuitive Gestures** - Single tap = dot, double tap = dash, long press = space
š³ **Haptic Feedback** - Customizable tactile feedback for enhanced user experience
+
+## Getting Started
+
+1. Open your project's `pubspec.yaml` file.
+2. Add the `morse_tap` package to your dependencies, replacing `[version]` with the latest version:
+ ```yaml
+ dependencies:
+ flutter:
+ sdk: flutter
+ morse_tap: ^[version]
+ ```
+3. Run `flutter pub get` to fetch the package.
+
+
+
+## Import the Package
+
+```dart
+import 'package:morse_tap/morse_tap.dart';
+```
+
+
## Usage Examples
### 1. MorseTapDetector - Pattern Detection
@@ -221,6 +247,7 @@ MorseTapDetector(
)
```
+
## Contributing
We welcome contributions in various forms:
@@ -231,35 +258,39 @@ We welcome contributions in various forms:
- Improving documentation, as it is essential.
- Sending Pull Requests is greatly appreciated!
----
-
+A big thank you to all our contributors! š
+
-
-
-**Stay connected and get the latest updates!**
+
+## š Connect with NonStop
-[](https://www.linkedin.com/company/nonstop-io)
-[](https://x.com/NonStopio)
-[](https://www.instagram.com/nonstopio_technologies/)
-[](https://www.youtube.com/@NonStopioTechnology)
-[](mailto:contact@nonstopio.com)
-
-
-
----
+
+
+
+
+
+
+
+
+
- ā Star us on [GitHub](https://github.com/nonstopio/flutter_forge) if this helped you!
+> ā Star us on [GitHub](https://github.com/nonstopio/flutter_forge) if this helped you!
+
+
## š License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
+
+
- š [Founded by Ajay Kumar](https://github.com/ProjectAJ14) š**
+> š [Founded by Ajay Kumar](https://github.com/ProjectAJ14) š**
+
diff --git a/packages/ns_firebase_utils/README.md b/packages/ns_firebase_utils/README.md
index e87f842..4cf1f55 100644
--- a/packages/ns_firebase_utils/README.md
+++ b/packages/ns_firebase_utils/README.md
@@ -1,3 +1,4 @@
+
@@ -9,33 +10,38 @@
Website
+
# ns_firebase_utils
+
[](https://github.com/nonstopio/flutter_forge/tree/main/packages/ns_firebase_utils)
[](https://opensource.org/licenses/MIT)
+
š This package provides a comprehensive set of methods and extensions for Firebase, simplifying its integration into your Flutter projects while also adding valuable functionality.
+
## Getting Started
-1. Open your `pubspec.yaml` file.
-2. Add `ns_firebase_utils` as a dependency, replacing `[version]` with the latest release:
+1. Open your project's `pubspec.yaml` file.
+2. Add the `ns_firebase_utils` package to your dependencies, replacing `[version]` with the latest version:
+ ```yaml
+ dependencies:
+ flutter:
+ sdk: flutter
+ ns_firebase_utils: ^[version]
+ ```
+3. Run `flutter pub get` to fetch the package.
+
-```yaml
-dependencies:
- flutter:
- sdk: flutter
- ns_firebase_utils: ^[version]
-```
-
-3. Run `flutter pub get` or click the "Packages get" button in your IDE.
-
-## Importing the Package
+
+## Import the Package
```dart
import 'package:ns_firebase_utils/src.dart';
```
+
## What's Included
@@ -57,6 +63,7 @@ This package offers a single plugin that conveniently adds all necessary Firebas
Additionally, it provides a powerful set of methods to accelerate your development process.
+
## Contributing
We welcome contributions in various forms:
@@ -68,37 +75,38 @@ We welcome contributions in various forms:
- Sending Pull Requests is greatly appreciated!
A big thank you to all our contributors! š
+
----
-
+
## š Connect with NonStop
-
-
-**Stay connected and get the latest updates!**
-
-[](https://www.linkedin.com/company/nonstop-io)
-[](https://x.com/NonStopio)
-[](https://www.instagram.com/nonstopio_technologies/)
-[](https://www.youtube.com/@NonStopioTechnology)
-[](mailto:contact@nonstopio.com)
-
-
-
----
+
+
+
+
+
+
+
+
+
> ā Star us on [GitHub](https://github.com/nonstopio/flutter_forge) if this helped you!
+
+
## š License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
+
+
> š [Founded by Ajay Kumar](https://github.com/ProjectAJ14) š**
+
diff --git a/packages/ns_intl_phone_input/README.md b/packages/ns_intl_phone_input/README.md
index adfd2e1..1071002 100644
--- a/packages/ns_intl_phone_input/README.md
+++ b/packages/ns_intl_phone_input/README.md
@@ -1,24 +1,27 @@
-
+
+
+
+
+
+
NonStop
+
Digital Product Development Experts for Startups & Enterprises
+
+ About |
+ Website
+
+
+
# Flutter Phone Validation Package by Nonstop IO
+
-
-
+
+
+
The Flutter Phone Validation Package by Nonstop IO is a versatile and easy-to-use Flutter package designed to validate phone numbers from more than 200 countries. With this package, users can seamlessly integrate phone number validation into their Flutter applications, enhancing user experience and ensuring data integrity.
@@ -45,28 +48,27 @@ The Flutter Phone Validation Package by Nonstop IO is a versatile and easy-to-us
- **Support for area codes of country:** The package provides support for area codes within countries. Users can input phone numbers with area codes, and the package takes this into consideration during validation. This feature enhances the package's flexibility and applicability to regions where area codes are an integral part of phone numbers.
+
## Getting Started
-To use the Flutter Phone Validation Package in your project, follow these simple steps:
-
-1. Add the package to your `pubspec.yaml` file:
-
+1. Open your project's `pubspec.yaml` file.
+2. Add the `ns_intl_phone_input` package to your dependencies, replacing `[version]` with the latest version:
```yaml
dependencies:
- ns_intl_phone_input: ^1.0.0
+ flutter:
+ sdk: flutter
+ ns_intl_phone_input: ^[version]
```
+3. Run `flutter pub get` to fetch the package.
+
-2. Install the package by running:
+
+## Import the Package
- ```bash
- flutter pub get
- ```
-
-3. Import the package in your Dart file:
-
- ```dart
- import 'package:ns_intl_phone_input/ns_intl_phone_input.dart';
- ```
+```dart
+import 'package:ns_intl_phone_input/ns_intl_phone_input.dart';
+```
+
4. Implement the `NsIntlPhoneInput` widget in your UI, providing the necessary callbacks and customization options.
@@ -211,34 +213,50 @@ Thank you for choosing the Flutter Phone Validation Package by Nonstop IO. Happy
---
-## š Connect with NonStop
+
+## Contributing
-
+We welcome contributions in various forms:
-**Stay connected and get the latest updates!**
+- Proposing new features or enhancements.
+- Reporting and fixing bugs.
+- Engaging in discussions to help make decisions.
+- Improving documentation, as it is essential.
+- Sending Pull Requests is greatly appreciated!
-[](https://www.linkedin.com/company/nonstop-io)
-[](https://x.com/NonStopio)
-[](https://www.instagram.com/nonstopio_technologies/)
-[](https://www.youtube.com/@NonStopioTechnology)
-[](mailto:contact@nonstopio.com)
+A big thank you to all our contributors! š
+
-
-
----
+
+## š Connect with NonStop
+
+
+
+
+
+
+
+
+
+
> ā Star us on [GitHub](https://github.com/nonstopio/flutter_forge) if this helped you!
+
+
## š License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
+
+
> š [Founded by Rajan Metaliya](https://github.com/rajan-nonstopio) š**
+
diff --git a/packages/ns_utils/README.md b/packages/ns_utils/README.md
index 7bd3936..4892d53 100644
--- a/packages/ns_utils/README.md
+++ b/packages/ns_utils/README.md
@@ -1,3 +1,4 @@
+
@@ -9,35 +10,40 @@
Website
+
# ns_utils - Flutter Utility Library
+
[](https://github.com/nonstopio/flutter_forge/tree/main/packages/ns_utils)
[](https://opensource.org/licenses/MIT)
+
## Introduction
ns_utils is a powerful Flutter utility library that simplifies and enhances your Flutter app development experience. It provides a collection of methods and extensions to streamline your code, making it more readable and efficient. Whether you need responsive design, date and time handling, map operations, string manipulation, or widget customization, ns_utils has got you covered.
+
## Getting Started
1. Open your project's `pubspec.yaml` file.
-2. Add ns_utils as a dependency and replace `[version]` with the latest version:
-
-```yaml
-dependencies:
- flutter:
- sdk: flutter
- ns_utils: ^[version]
-```
-
+2. Add the `ns_utils` package to your dependencies, replacing `[version]` with the latest version:
+ ```yaml
+ dependencies:
+ flutter:
+ sdk: flutter
+ ns_utils: ^[version]
+ ```
3. Run `flutter pub get` to fetch the package.
+
+
## Import the Package
```dart
import 'package:ns_utils/src.dart';
```
+
## What's Inside
@@ -111,6 +117,7 @@ Customize widgets with ease:
- Utilize widgets like `Container` and `SizedBox` with simplified notation.
- Expect even more widget enhancements in future updates.
+
## Contributing
We welcome contributions in various forms:
@@ -122,37 +129,38 @@ We welcome contributions in various forms:
- Sending Pull Requests is greatly appreciated!
A big thank you to all our contributors! š
+
----
-
+
## š Connect with NonStop
-
-
-**Stay connected and get the latest updates!**
-
-[](https://www.linkedin.com/company/nonstop-io)
-[](https://x.com/NonStopio)
-[](https://www.instagram.com/nonstopio_technologies/)
-[](https://www.youtube.com/@NonStopioTechnology)
-[](mailto:contact@nonstopio.com)
-
-
-
----
+
+
+
+
+
+
+
+
+
> ā Star us on [GitHub](https://github.com/nonstopio/flutter_forge) if this helped you!
+
+
## š License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
+
+
> š [Founded by Ajay Kumar](https://github.com/ProjectAJ14) š**
+
diff --git a/packages/timer_button/README.md b/packages/timer_button/README.md
index 12c278b..319067e 100644
--- a/packages/timer_button/README.md
+++ b/packages/timer_button/README.md
@@ -1,3 +1,4 @@
+
@@ -9,11 +10,14 @@
Website
+
# Timer Button
+
[](https://github.com/nonstopio/flutter_forge/tree/main/packages/timer_button)
[](https://opensource.org/licenses/MIT)
+
A versatile Flutter package that provides a timer button widget, which becomes enabled after a
specified time delay.
@@ -24,6 +28,7 @@ specified time delay.
A customizable button widget capable of activation after a designated time interval.
+
## Getting Started
1. Open your project's `pubspec.yaml` file.
@@ -36,12 +41,15 @@ A customizable button widget capable of activation after a designated time inter
timer_button: ^[version]
```
3. Run `flutter pub get` to fetch the package.
+
+
## Import the Package
```dart
import 'package:timer_button/timer_button.dart';
```
+
## Usage
@@ -89,6 +97,9 @@ function:
),
```
+---
+
+
## Contributing
We welcome contributions in various forms:
@@ -100,37 +111,42 @@ We welcome contributions in various forms:
- Sending Pull Requests is greatly appreciated!
A big thank you to all our contributors! š
+
---
+
## š Connect with NonStop
-
-
-**Stay connected and get the latest updates!**
-
-[](https://www.linkedin.com/company/nonstop-io)
-[](https://x.com/NonStopio)
-[](https://www.instagram.com/nonstopio_technologies/)
-[](https://www.youtube.com/@NonStopioTechnology)
-[](mailto:contact@nonstopio.com)
-
-
+
+
+
+
+
+
+
+
---
+
> ā Star us on [GitHub](https://github.com/nonstopio/flutter_forge) if this helped you!
+
+
## š License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
+
+
> š [Founded by Ajay Kumar](https://github.com/ProjectAJ14) š**
+
diff --git a/plugins/contact_permission/README.md b/plugins/contact_permission/README.md
index 4770c4e..bd6a838 100644
--- a/plugins/contact_permission/README.md
+++ b/plugins/contact_permission/README.md
@@ -1,3 +1,4 @@
+
@@ -9,10 +10,14 @@
Website
+
# contact_permission
+
+
[](https://github.com/nonstopio/flutter_forge/tree/main/plugins/contact_permission)
[](https://opensource.org/licenses/MIT)
+
A plugin for Flutter that requests and verifies contact permissions.
@@ -32,23 +37,27 @@ A plugin for Flutter that requests and verifies contact permissions.
> on many devices.
>This predicament led to the development of this package.
-## Let's get started
+
+## Getting Started
-1. Go to `pubspec.yaml`
-2. add a contact_permission and replace `[version]` with the latest version:
- ```yaml
- dependencies:
- flutter:
- sdk: flutter
- contact_permission: ^[version]
- ```
-3. click the packages get button or *flutter pub get*
+1. Open your project's `pubspec.yaml` file.
+2. Add the `contact_permission` package to your dependencies, replacing `[version]` with the latest version:
+ ```yaml
+ dependencies:
+ flutter:
+ sdk: flutter
+ contact_permission: ^[version]
+ ```
+3. Run `flutter pub get` to fetch the package.
+
-## Import the package
+
+## Import the Package
```dart
import 'package:contact_permission/contact_permission.dart';
```
+
## Check if permission is granted or not
@@ -97,6 +106,7 @@ import 'package:contact_permission/contact_permission.dart';
+
## Contributing
We welcome contributions in various forms:
@@ -108,37 +118,38 @@ We welcome contributions in various forms:
- Sending Pull Requests is greatly appreciated!
A big thank you to all our contributors! š
+
----
-
+
## š Connect with NonStop
-
-
-**Stay connected and get the latest updates!**
-
-[](https://www.linkedin.com/company/nonstop-io)
-[](https://x.com/NonStopio)
-[](https://www.instagram.com/nonstopio_technologies/)
-[](https://www.youtube.com/@NonStopioTechnology)
-[](mailto:contact@nonstopio.com)
-
-
-
----
+
+
+
+
+
+
+
+
+
> ā Star us on [GitHub](https://github.com/nonstopio/flutter_forge) if this helped you!
+
+
## š License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
+
+
> š [Founded by Ajay Kumar](https://github.com/ProjectAJ14) š**
+
diff --git a/tools/readme_sync/EXAMPLE_README.md b/tools/readme_sync/EXAMPLE_README.md
new file mode 100644
index 0000000..4bb991a
--- /dev/null
+++ b/tools/readme_sync/EXAMPLE_README.md
@@ -0,0 +1,200 @@
+# Example README with Markers
+
+This is an example showing the correct placement of section markers in a package README.
+
+---
+
+
+
+
+
+
+
NonStop
+
Digital Product Development Experts for Startups & Enterprises
+
+ About |
+ Website
+
+
+
+
+# example_package
+
+
+[](https://github.com/nonstopio/flutter_forge/tree/main/packages/example_package)
+[](https://opensource.org/licenses/MIT)
+
+
+A brief description of what your package does. This content is NOT managed and can be customized per package.
+
+## Features
+
+- Feature 1
+- Feature 2
+- Feature 3
+
+**Note**: This section is package-specific and won't be touched by the sync tool.
+
+
+## Getting Started
+
+1. Open your project's `pubspec.yaml` file.
+2. Add the `example_package` package to your dependencies, replacing `[version]` with the latest version:
+ ```yaml
+ dependencies:
+ flutter:
+ sdk: flutter
+ example_package: ^[version]
+ ```
+3. Run `flutter pub get` to fetch the package.
+
+
+
+## Import the Package
+
+```dart
+import 'package:example_package/example_package.dart';
+```
+
+
+## Usage
+
+This section contains package-specific usage examples and is NOT managed by the sync tool.
+
+### Basic Example
+
+```dart
+// Your package-specific example code here
+void main() {
+ // Example usage
+}
+```
+
+### Advanced Example
+
+```dart
+// More complex examples
+class MyExample {
+ // Implementation
+}
+```
+
+## Configuration
+
+Any package-specific configuration details go here. This content is preserved.
+
+## API Reference
+
+Document your package's API here. This is package-specific content.
+
+## Troubleshooting
+
+Common issues and solutions specific to your package.
+
+---
+
+
+## Contributing
+
+We welcome contributions in various forms:
+
+- Proposing new features or enhancements.
+- Reporting and fixing bugs.
+- Engaging in discussions to help make decisions.
+- Improving documentation, as it is essential.
+- Sending Pull Requests is greatly appreciated!
+
+A big thank you to all our contributors! š
+
+
+---
+
+
+## š Connect with NonStop
+
+
+
+
+
+
+
+
+
+
+---
+
+
+
+
+> ā Star us on [GitHub](https://github.com/nonstopio/flutter_forge) if this helped you!
+
+
+
+
+
+## š License
+
+This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
+
+
+
+
+
+> š [Founded by Your Name](https://github.com/yourusername) š**
+
+
+
+
+---
+
+## Key Points About Markers
+
+### ā
Correct Usage
+
+1. **Exact syntax**: `` and ``
+2. **Case-sensitive**: Section IDs must match exactly
+3. **No extra spaces**: Markers must be exact
+4. **Paired properly**: Every BEGIN must have matching END
+5. **Full lines**: Markers should be on their own lines
+
+### ā Common Mistakes
+
+```markdown
+ ā Extra space after colon
+ ā Wrong capitalization
+ ā Missing space before -->
+ ā Missing space after
+Some content
+ ā Mismatched section IDs
+```
+
+### š Available Section IDs
+
+- `nonstop-header`
+- `badges`
+- `getting-started`
+- `import-package`
+- `contributing`
+- `connect`
+- `star-footer`
+- `license`
+- `founded-by`
+
+### šÆ Best Practices
+
+1. **Place markers around entire sections** including headings
+2. **Keep package-specific content outside markers**
+3. **Maintain blank lines** between sections for readability
+4. **Use horizontal rules (`---`)** to visually separate sections
+5. **Test with --dry-run** before applying changes
+6. **Validate with --validate** after adding markers
+
+### š Workflow
+
+1. Copy this example as a starting point
+2. Replace `example_package` with your package name
+3. Add your package-specific content in unmarked sections
+4. Run validation: `dart run tools/readme_sync/readme_sync.dart --validate --package your_package`
+5. Preview changes: `dart run tools/readme_sync/readme_sync.dart --dry-run --package your_package`
+6. Apply sync: `dart run tools/readme_sync/readme_sync.dart --package your_package`
diff --git a/tools/readme_sync/README.md b/tools/readme_sync/README.md
new file mode 100644
index 0000000..00a5fd1
--- /dev/null
+++ b/tools/readme_sync/README.md
@@ -0,0 +1,382 @@
+# README Sync Tool
+
+Automated tool to synchronize standardized sections across all package READMEs in the Flutter Forge monorepo.
+
+## Overview
+
+This tool manages common README sections (like headers, contributing guidelines, social links, etc.) from a centralized template, ensuring consistency across all packages while preserving package-specific content.
+
+### Key Features
+
+- **Centralized Templates**: All common sections defined in one place
+- **Variable Substitution**: Package-specific variables (name, author, etc.) automatically replaced
+- **Non-Destructive**: Only updates content between markers, preserves everything else
+- **Safe Operations**: Dry-run mode and automatic backups before modifications
+- **Flexible**: Packages can opt-in/out of specific sections
+
+### Statistics
+
+- **~35-40%** of README content is standardized boilerplate
+- **9 sections** managed centrally
+- **9 packages/plugins** currently configured
+
+## Architecture
+
+```
+tools/readme_sync/
+āāā readme_sync.dart # Main script
+āāā pubspec.yaml # Dependencies
+āāā templates/
+ā āāā sections.yaml # Section templates (centralized content)
+āāā config/
+ā āāā packages.yaml # Package configurations
+āāā README.md # This file
+```
+
+## How It Works
+
+### 1. Section Markers
+
+READMEs use HTML comments to mark managed sections:
+
+```markdown
+
+[This content will be managed by the sync tool]
+
+
+[Package-specific content here - never touched by the tool]
+
+
+[Another managed section]
+
+```
+
+### 2. Template System
+
+Templates are defined in `templates/sections.yaml`:
+
+```yaml
+sections:
+ contributing:
+ content: |
+ ## Contributing
+
+ We welcome contributions...
+ variables: []
+
+ badges:
+ content: |
+ []...
+ variables: [package_name, repo_path]
+```
+
+### 3. Package Configuration
+
+Each package is configured in `config/packages.yaml`:
+
+```yaml
+packages:
+ - name: timer_button
+ path: packages/timer_button
+ repo_path: packages/timer_button
+ import_path: timer_button
+ author_name: Ajay Kumar
+ github_username: ProjectAJ14
+ sections:
+ - nonstop-header
+ - badges
+ - getting-started
+ - import-package
+ - contributing
+ - connect
+ - star-footer
+ - license
+ - founded-by
+```
+
+## Usage
+
+### Prerequisites
+
+1. Ensure all READMEs have proper section markers
+2. Run from repository root or use Melos
+
+### Commands
+
+#### Sync All Packages
+
+```bash
+# Using Melos (recommended)
+melos sync:readme
+
+# Direct execution
+dart run tools/readme_sync/readme_sync.dart
+```
+
+#### Sync Specific Package
+
+```bash
+dart run tools/readme_sync/readme_sync.dart --package timer_button
+```
+
+#### Dry Run (Preview Changes)
+
+```bash
+dart run tools/readme_sync/readme_sync.dart --dry-run
+```
+
+#### Validate Markers
+
+```bash
+dart run tools/readme_sync/readme_sync.dart --validate
+```
+
+#### Verbose Output
+
+```bash
+dart run tools/readme_sync/readme_sync.dart --verbose
+```
+
+#### Get Help
+
+```bash
+dart run tools/readme_sync/readme_sync.dart --help
+```
+
+## Managed Sections
+
+| Section ID | Description | Variables |
+|------------|-------------|-----------|
+| `nonstop-header` | NonStop branding header | None |
+| `badges` | Build status and license badges | `package_name`, `repo_path` |
+| `getting-started` | Installation instructions | `package_name` |
+| `import-package` | Import statement | `package_name`, `import_path` |
+| `contributing` | Contribution guidelines | None |
+| `connect` | Social media links | None |
+| `star-footer` | GitHub star CTA | None |
+| `license` | MIT license info | None |
+| `founded-by` | Founder attribution | `author_name`, `github_username` |
+
+## Adding Markers to a New Package
+
+### Step 1: Add Package Configuration
+
+Edit `config/packages.yaml`:
+
+```yaml
+packages:
+ - name: my_new_package
+ path: packages/my_new_package
+ repo_path: packages/my_new_package
+ import_path: my_new_package
+ author_name: Your Name
+ github_username: yourusername
+ sections:
+ - nonstop-header
+ - badges
+ - getting-started
+ - import-package
+ - contributing
+ - connect
+ - star-footer
+ - license
+ - founded-by
+```
+
+### Step 2: Add Markers to README
+
+In your package's README.md, add markers around sections you want managed:
+
+```markdown
+
+
+ ... existing content ...
+
+
+
+# my_new_package
+
+
+[![Build Status]...]
+
+
+Your package description here...
+
+
+## Getting Started
+...
+
+
+
+## Import the Package
+...
+
+
+## Usage
+
+[Your package-specific content - never touched]
+
+
+## Contributing
+...
+
+
+
+## š Connect with NonStop
+...
+
+
+
+
+...
+
+
+
+## š License
+...
+
+
+
+
+...
+
+```
+
+### Step 3: Test
+
+```bash
+# Validate markers are correct
+dart run tools/readme_sync/readme_sync.dart --validate --package my_new_package
+
+# Preview changes
+dart run tools/readme_sync/readme_sync.dart --dry-run --package my_new_package
+
+# Apply changes
+dart run tools/readme_sync/readme_sync.dart --package my_new_package
+```
+
+## Updating Templates
+
+To update content across all packages:
+
+1. Edit `templates/sections.yaml`
+2. Modify the section content
+3. Run the sync tool
+4. All packages will automatically update
+
+**Example**: Update contributing guidelines
+
+```yaml
+# templates/sections.yaml
+sections:
+ contributing:
+ content: |
+ ## Contributing
+
+ Updated contribution guidelines here...
+```
+
+```bash
+melos sync:readme
+```
+
+All 9 packages now have the updated contributing section!
+
+## Safety Features
+
+### Automatic Backups
+
+The tool creates `.bak` files before modifying READMEs. These are automatically deleted after successful write.
+
+### Dry Run Mode
+
+Preview all changes without modifying files:
+
+```bash
+dart run tools/readme_sync/readme_sync.dart --dry-run
+```
+
+### Marker Validation
+
+Ensures all markers are properly paired (BEGIN/END):
+
+```bash
+dart run tools/readme_sync/readme_sync.dart --validate
+```
+
+### Content Preservation
+
+- Only content between markers is modified
+- Package-specific content is never touched
+- Maintains exact formatting and spacing outside markers
+
+## Troubleshooting
+
+### "Missing markers for: section-id"
+
+**Problem**: README doesn't have markers for a configured section.
+
+**Solution**: Add the markers manually:
+```markdown
+
+[existing content]
+
+```
+
+### "Package not found in configuration"
+
+**Problem**: Package not listed in `config/packages.yaml`.
+
+**Solution**: Add the package configuration (see "Adding Markers" above).
+
+### Changes not applying
+
+**Problem**: Content not updating after sync.
+
+**Solution**:
+1. Check markers are exact: `` (case-sensitive)
+2. Ensure no extra spaces in marker comments
+3. Run with `--verbose` to see what's happening
+4. Validate with `--validate` flag
+
+## Best Practices
+
+1. **Always dry-run first** when making template changes
+2. **Validate before syncing** to catch marker issues early
+3. **Commit template changes separately** from sync results
+4. **Test on one package first** before running on all packages
+5. **Keep package-specific content outside markers**
+
+## Integration with CI/CD
+
+You can add validation to your CI pipeline:
+
+```yaml
+# .github/workflows/validate-readmes.yml
+- name: Validate README markers
+ run: dart run tools/readme_sync/readme_sync.dart --validate
+```
+
+## Future Enhancements
+
+Potential improvements:
+
+- [ ] Auto-detect and suggest marker placement
+- [ ] Support for conditional sections
+- [ ] Multi-language README support
+- [ ] Section reordering capabilities
+- [ ] Git diff preview in dry-run mode
+- [ ] Integration with package version updates
+
+## Contributing
+
+To improve this tool:
+
+1. Edit the Dart script: `tools/readme_sync/readme_sync.dart`
+2. Update templates: `templates/sections.yaml`
+3. Test thoroughly with `--dry-run`
+4. Document changes in this README
+
+## License
+
+Part of the Flutter Forge monorepo - MIT License
diff --git a/tools/readme_sync/config/packages.yaml b/tools/readme_sync/config/packages.yaml
new file mode 100644
index 0000000..b643dce
--- /dev/null
+++ b/tools/readme_sync/config/packages.yaml
@@ -0,0 +1,157 @@
+# Package Configuration
+# This file defines all packages/plugins and their specific variables for README syncing.
+
+packages:
+ - name: connectivity_wrapper
+ path: packages/connectivity_wrapper
+ repo_path: packages/connectivity_wrapper
+ import_path: connectivity_wrapper
+ author_name: Ajay Kumar
+ github_username: ProjectAJ14
+ sections:
+ - nonstop-header
+ - badges
+ - getting-started
+ - import-package
+ - contributing
+ - connect
+ - star-footer
+ - license
+ - founded-by
+
+ - name: dzod
+ path: packages/dzod
+ repo_path: packages/dzod
+ import_path: dzod
+ author_name: Ajay Kumar
+ github_username: ProjectAJ14
+ sections:
+ - nonstop-header
+ - badges
+ - getting-started
+ - import-package
+ - contributing
+ - connect
+ - star-footer
+ - license
+ - founded-by
+
+ - name: timer_button
+ path: packages/timer_button
+ repo_path: packages/timer_button
+ import_path: timer_button
+ author_name: Ajay Kumar
+ github_username: ProjectAJ14
+ sections:
+ - nonstop-header
+ - badges
+ - getting-started
+ - import-package
+ - contributing
+ - connect
+ - star-footer
+ - license
+ - founded-by
+
+ - name: ns_intl_phone_input
+ path: packages/ns_intl_phone_input
+ repo_path: packages/ns_intl_phone_input
+ import_path: ns_intl_phone_input
+ author_name: Rajan Metaliya
+ github_username: rajan-nonstopio
+ sections:
+ - nonstop-header
+ - badges
+ - getting-started
+ - import-package
+ - contributing
+ - connect
+ - star-footer
+ - license
+ - founded-by
+
+ - name: html_rich_text
+ path: packages/html_rich_text
+ repo_path: packages/html_rich_text
+ import_path: html_rich_text
+ author_name: Ajay Kumar
+ github_username: ProjectAJ14
+ sections:
+ - nonstop-header
+ - badges
+ - getting-started
+ - import-package
+ - contributing
+ - connect
+ - star-footer
+ - license
+ - founded-by
+
+ - name: morse_tap
+ path: packages/morse_tap
+ repo_path: packages/morse_tap
+ import_path: morse_tap
+ author_name: Ajay Kumar
+ github_username: ProjectAJ14
+ sections:
+ - nonstop-header
+ - badges
+ - getting-started
+ - import-package
+ - contributing
+ - connect
+ - star-footer
+ - license
+ - founded-by
+
+ - name: ns_utils
+ path: packages/ns_utils
+ repo_path: packages/ns_utils
+ import_path: ns_utils/src
+ author_name: Ajay Kumar
+ github_username: ProjectAJ14
+ sections:
+ - nonstop-header
+ - badges
+ - getting-started
+ - import-package
+ - contributing
+ - connect
+ - star-footer
+ - license
+ - founded-by
+
+ - name: ns_firebase_utils
+ path: packages/ns_firebase_utils
+ repo_path: packages/ns_firebase_utils
+ import_path: ns_firebase_utils/src
+ author_name: Ajay Kumar
+ github_username: ProjectAJ14
+ sections:
+ - nonstop-header
+ - badges
+ - getting-started
+ - import-package
+ - contributing
+ - connect
+ - star-footer
+ - license
+ - founded-by
+
+plugins:
+ - name: contact_permission
+ path: plugins/contact_permission
+ repo_path: plugins/contact_permission
+ import_path: contact_permission
+ author_name: Ajay Kumar
+ github_username: ProjectAJ14
+ sections:
+ - nonstop-header
+ - badges
+ - getting-started
+ - import-package
+ - contributing
+ - connect
+ - star-footer
+ - license
+ - founded-by
diff --git a/tools/readme_sync/pubspec.yaml b/tools/readme_sync/pubspec.yaml
new file mode 100644
index 0000000..a4f4b4d
--- /dev/null
+++ b/tools/readme_sync/pubspec.yaml
@@ -0,0 +1,11 @@
+name: readme_sync
+description: Tool to synchronize standardized README sections across packages
+version: 1.0.0
+publish_to: none
+
+environment:
+ sdk: ^3.0.0
+
+dependencies:
+ yaml: ^3.1.0
+ path: ^1.8.0
diff --git a/tools/readme_sync/readme_sync.dart b/tools/readme_sync/readme_sync.dart
new file mode 100644
index 0000000..9d7f09e
--- /dev/null
+++ b/tools/readme_sync/readme_sync.dart
@@ -0,0 +1,449 @@
+#!/usr/bin/env dart
+
+import 'dart:io';
+import 'package:yaml/yaml.dart';
+import 'package:path/path.dart' as path;
+
+/// README Sync Tool
+///
+/// Synchronizes standardized sections across all package READMEs.
+/// Uses HTML comment markers to identify managed sections.
+
+void main(List
args) async {
+ final config = Config.fromArgs(args);
+
+ if (config.showHelp) {
+ printHelp();
+ exit(0);
+ }
+
+ final syncer = ReadmeSyncer(config);
+
+ try {
+ await syncer.run();
+ } catch (e, stackTrace) {
+ print('ā Error: $e');
+ if (config.verbose) {
+ print(stackTrace);
+ }
+ exit(1);
+ }
+}
+
+class Config {
+ final bool dryRun;
+ final bool verbose;
+ final bool validate;
+ final bool addMarkers;
+ final String? specificPackage;
+ final bool showHelp;
+ final String scriptDir;
+
+ Config({
+ required this.dryRun,
+ required this.verbose,
+ required this.validate,
+ required this.addMarkers,
+ required this.specificPackage,
+ required this.showHelp,
+ required this.scriptDir,
+ });
+
+ factory Config.fromArgs(List args) {
+ final scriptPath = Platform.script.toFilePath();
+ final scriptDir = path.dirname(scriptPath);
+
+ return Config(
+ dryRun: args.contains('--dry-run') || args.contains('-d'),
+ verbose: args.contains('--verbose') || args.contains('-v'),
+ validate: args.contains('--validate'),
+ addMarkers: args.contains('--add-markers'),
+ specificPackage: _extractPackageName(args),
+ showHelp: args.contains('--help') || args.contains('-h'),
+ scriptDir: scriptDir,
+ );
+ }
+
+ static String? _extractPackageName(List args) {
+ final packageIndex = args.indexOf('--package');
+ if (packageIndex != -1 && packageIndex + 1 < args.length) {
+ return args[packageIndex + 1];
+ }
+ return null;
+ }
+}
+
+class ReadmeSyncer {
+ final Config config;
+ late final Map sections;
+ late final List packages;
+ final String repoRoot;
+
+ ReadmeSyncer(this.config) : repoRoot = _findRepoRoot(config.scriptDir);
+
+ static String _findRepoRoot(String scriptDir) {
+ var current = Directory(scriptDir);
+ while (current.path != current.parent.path) {
+ if (Directory(path.join(current.path, '.git')).existsSync()) {
+ return current.path;
+ }
+ current = current.parent;
+ }
+ throw Exception('Could not find git repository root');
+ }
+
+ Future run() async {
+ print('š§ README Sync Tool');
+ print('ā' * 50);
+
+ // Load configurations
+ await _loadConfigurations();
+
+ // Filter packages if specific package requested
+ var packagesToProcess = packages;
+ if (config.specificPackage != null) {
+ packagesToProcess = packages
+ .where((p) => p.name == config.specificPackage)
+ .toList();
+
+ if (packagesToProcess.isEmpty) {
+ throw Exception('Package "${config.specificPackage}" not found in configuration');
+ }
+ }
+
+ print('š¦ Processing ${packagesToProcess.length} package(s)...\n');
+
+ if (config.validate) {
+ await _validatePackages(packagesToProcess);
+ return;
+ }
+
+ if (config.addMarkers) {
+ await _addMarkersToPackages(packagesToProcess);
+ return;
+ }
+
+ // Sync packages
+ var successCount = 0;
+ var errorCount = 0;
+
+ for (final package in packagesToProcess) {
+ try {
+ await _syncPackage(package);
+ successCount++;
+ } catch (e) {
+ print('ā Error processing ${package.name}: $e');
+ errorCount++;
+ }
+ }
+
+ print('\n' + 'ā' * 50);
+ if (config.dryRun) {
+ print('š Dry run completed (no files modified)');
+ } else {
+ print('ā
Sync completed');
+ }
+ print(' Successful: $successCount');
+ if (errorCount > 0) {
+ print(' Errors: $errorCount');
+ }
+ }
+
+ Future _loadConfigurations() async {
+ // Load section templates
+ final sectionsFile = File(path.join(config.scriptDir, 'templates', 'sections.yaml'));
+ if (!sectionsFile.existsSync()) {
+ throw Exception('Templates file not found: ${sectionsFile.path}');
+ }
+
+ final sectionsYaml = loadYaml(await sectionsFile.readAsString()) as YamlMap;
+ sections = {};
+
+ final sectionsMap = sectionsYaml['sections'] as YamlMap;
+ for (final entry in sectionsMap.entries) {
+ final id = entry.key as String;
+ final data = entry.value as YamlMap;
+ sections[id] = SectionTemplate(
+ id: id,
+ content: (data['content'] as String).trim(),
+ variables: (data['variables'] as YamlList?)?.map((e) => e as String).toList() ?? [],
+ );
+ }
+
+ // Load package configurations
+ final packagesFile = File(path.join(config.scriptDir, 'config', 'packages.yaml'));
+ if (!packagesFile.existsSync()) {
+ throw Exception('Packages config file not found: ${packagesFile.path}');
+ }
+
+ final packagesYaml = loadYaml(await packagesFile.readAsString()) as YamlMap;
+ packages = [];
+
+ // Load packages
+ if (packagesYaml.containsKey('packages')) {
+ final packagesList = packagesYaml['packages'] as YamlList;
+ for (final item in packagesList) {
+ packages.add(PackageConfig.fromYaml(item as YamlMap, repoRoot));
+ }
+ }
+
+ // Load plugins
+ if (packagesYaml.containsKey('plugins')) {
+ final pluginsList = packagesYaml['plugins'] as YamlList;
+ for (final item in pluginsList) {
+ packages.add(PackageConfig.fromYaml(item as YamlMap, repoRoot));
+ }
+ }
+
+ if (config.verbose) {
+ print('Loaded ${sections.length} section templates');
+ print('Loaded ${packages.length} package configurations');
+ }
+ }
+
+ Future _syncPackage(PackageConfig package) async {
+ final readmePath = path.join(package.fullPath, 'README.md');
+ final readmeFile = File(readmePath);
+
+ if (!readmeFile.existsSync()) {
+ throw Exception('README.md not found at $readmePath');
+ }
+
+ print('š ${package.name}');
+
+ var content = await readmeFile.readAsString();
+ var modified = false;
+
+ // Process each section
+ for (final sectionId in package.sections) {
+ final template = sections[sectionId];
+ if (template == null) {
+ print(' ā ļø Unknown section: $sectionId');
+ continue;
+ }
+
+ // Check if markers exist
+ if (!_hasMarkers(content, sectionId)) {
+ print(' ā ļø Missing markers for: $sectionId');
+ continue;
+ }
+
+ // Render template with variables
+ final renderedContent = _renderTemplate(template, package);
+
+ // Replace section content
+ final newContent = _replaceSectionContent(content, sectionId, renderedContent);
+
+ if (newContent != content) {
+ content = newContent;
+ modified = true;
+ if (config.verbose) {
+ print(' ā Updated: $sectionId');
+ }
+ }
+ }
+
+ if (modified) {
+ if (config.dryRun) {
+ print(' š Would update README (dry-run mode)');
+ } else {
+ // Create backup
+ final backupPath = '$readmePath.bak';
+ await readmeFile.copy(backupPath);
+
+ // Write new content
+ await readmeFile.writeAsString(content);
+ print(' ā
Updated README');
+
+ // Remove backup after successful write
+ await File(backupPath).delete();
+ }
+ } else {
+ print(' ā¹ļø No changes needed');
+ }
+ }
+
+ bool _hasMarkers(String content, String sectionId) {
+ final beginMarker = '';
+ final endMarker = '';
+ return content.contains(beginMarker) && content.contains(endMarker);
+ }
+
+ String _renderTemplate(SectionTemplate template, PackageConfig package) {
+ var content = template.content;
+
+ // Replace all variables
+ final variables = {
+ 'package_name': package.name,
+ 'repo_path': package.repoPath,
+ 'import_path': package.importPath,
+ 'author_name': package.authorName,
+ 'github_username': package.githubUsername,
+ };
+
+ for (final entry in variables.entries) {
+ content = content.replaceAll('{{${entry.key}}}', entry.value);
+ }
+
+ return content;
+ }
+
+ String _replaceSectionContent(String readme, String sectionId, String newContent) {
+ final beginMarker = '';
+ final endMarker = '';
+
+ final beginIndex = readme.indexOf(beginMarker);
+ final endIndex = readme.indexOf(endMarker);
+
+ if (beginIndex == -1 || endIndex == -1) {
+ return readme;
+ }
+
+ final before = readme.substring(0, beginIndex + beginMarker.length);
+ final after = readme.substring(endIndex);
+
+ return '$before\n$newContent\n$after';
+ }
+
+ Future _validatePackages(List packagesToProcess) async {
+ print('š Validating README markers...\n');
+
+ var totalIssues = 0;
+
+ for (final package in packagesToProcess) {
+ final readmePath = path.join(package.fullPath, 'README.md');
+ final readmeFile = File(readmePath);
+
+ if (!readmeFile.existsSync()) {
+ print('ā ${package.name}: README.md not found');
+ totalIssues++;
+ continue;
+ }
+
+ final content = await readmeFile.readAsString();
+ final issues = [];
+
+ for (final sectionId in package.sections) {
+ if (!_hasMarkers(content, sectionId)) {
+ issues.add('Missing markers for: $sectionId');
+ }
+ }
+
+ if (issues.isEmpty) {
+ print('ā
${package.name}: All markers present');
+ } else {
+ print('ā ļø ${package.name}:');
+ for (final issue in issues) {
+ print(' - $issue');
+ totalIssues++;
+ }
+ }
+ }
+
+ print('\n' + 'ā' * 50);
+ if (totalIssues == 0) {
+ print('ā
Validation passed: All markers are present');
+ } else {
+ print('ā ļø Validation found $totalIssues issue(s)');
+ print('Run with --add-markers to add missing markers');
+ }
+ }
+
+ Future _addMarkersToPackages(List packagesToProcess) async {
+ print('ā Adding markers to READMEs...\n');
+
+ for (final package in packagesToProcess) {
+ final readmePath = path.join(package.fullPath, 'README.md');
+ final readmeFile = File(readmePath);
+
+ if (!readmeFile.existsSync()) {
+ print('ā ${package.name}: README.md not found');
+ continue;
+ }
+
+ print('š ${package.name}');
+ print(' ā ļø Manual intervention required');
+ print(' Add markers like: and ');
+ print(' Sections needed: ${package.sections.join(", ")}');
+ }
+
+ print('\nā¹ļø Marker format:');
+ print(' ');
+ print(' [content to be managed]');
+ print(' ');
+ }
+}
+
+class SectionTemplate {
+ final String id;
+ final String content;
+ final List variables;
+
+ SectionTemplate({
+ required this.id,
+ required this.content,
+ required this.variables,
+ });
+}
+
+class PackageConfig {
+ final String name;
+ final String relativePath;
+ final String fullPath;
+ final String repoPath;
+ final String importPath;
+ final String authorName;
+ final String githubUsername;
+ final List sections;
+
+ PackageConfig({
+ required this.name,
+ required this.relativePath,
+ required this.fullPath,
+ required this.repoPath,
+ required this.importPath,
+ required this.authorName,
+ required this.githubUsername,
+ required this.sections,
+ });
+
+ factory PackageConfig.fromYaml(YamlMap yaml, String repoRoot) {
+ final relativePath = yaml['path'] as String;
+ return PackageConfig(
+ name: yaml['name'] as String,
+ relativePath: relativePath,
+ fullPath: path.join(repoRoot, relativePath),
+ repoPath: yaml['repo_path'] as String,
+ importPath: yaml['import_path'] as String,
+ authorName: yaml['author_name'] as String,
+ githubUsername: yaml['github_username'] as String,
+ sections: (yaml['sections'] as YamlList).map((e) => e as String).toList(),
+ );
+ }
+}
+
+void printHelp() {
+ print('''
+README Sync Tool - Standardize README sections across packages
+
+USAGE:
+ dart readme_sync.dart [OPTIONS]
+
+OPTIONS:
+ --dry-run, -d Preview changes without modifying files
+ --verbose, -v Show detailed output
+ --validate Check if all packages have proper markers
+ --add-markers Show instructions for adding markers
+ --package Sync only specific package
+ --help, -h Show this help message
+
+EXAMPLES:
+ dart readme_sync.dart # Sync all packages
+ dart readme_sync.dart --dry-run # Preview changes
+ dart readme_sync.dart --package timer_button # Sync one package
+ dart readme_sync.dart --validate # Validate markers
+ dart readme_sync.dart --verbose # Show detailed output
+
+For more information, see tools/readme_sync/README.md
+''');
+}
diff --git a/tools/readme_sync/templates/sections.yaml b/tools/readme_sync/templates/sections.yaml
new file mode 100644
index 0000000..c650e9b
--- /dev/null
+++ b/tools/readme_sync/templates/sections.yaml
@@ -0,0 +1,102 @@
+# README Section Templates
+# This file contains centralized templates for common sections across all package READMEs.
+# Variables are denoted with {{variable_name}} and will be replaced during sync.
+
+sections:
+ nonstop-header:
+ content: |
+
+
+
+
+
NonStop
+ Digital Product Development Experts for Startups & Enterprises
+
+ About |
+ Website
+
+
+ variables: []
+
+ badges:
+ content: |
+ [](https://github.com/nonstopio/flutter_forge/tree/main/{{repo_path}})
+ [](https://opensource.org/licenses/MIT)
+ variables: [package_name, repo_path]
+
+ getting-started:
+ content: |
+ ## Getting Started
+
+ 1. Open your project's `pubspec.yaml` file.
+ 2. Add the `{{package_name}}` package to your dependencies, replacing `[version]` with the latest version:
+ ```yaml
+ dependencies:
+ flutter:
+ sdk: flutter
+ {{package_name}}: ^[version]
+ ```
+ 3. Run `flutter pub get` to fetch the package.
+ variables: [package_name]
+
+ import-package:
+ content: |
+ ## Import the Package
+
+ ```dart
+ import 'package:{{package_name}}/{{import_path}}.dart';
+ ```
+ variables: [package_name, import_path]
+
+ contributing:
+ content: |
+ ## Contributing
+
+ We welcome contributions in various forms:
+
+ - Proposing new features or enhancements.
+ - Reporting and fixing bugs.
+ - Engaging in discussions to help make decisions.
+ - Improving documentation, as it is essential.
+ - Sending Pull Requests is greatly appreciated!
+
+ A big thank you to all our contributors! š
+ variables: []
+
+ connect:
+ content: |
+ ## š Connect with NonStop
+
+
+
+
+
+
+
+
+ variables: []
+
+ star-footer:
+ content: |
+
+
+ > ā Star us on [GitHub](https://github.com/nonstopio/flutter_forge) if this helped you!
+
+
+ variables: []
+
+ license:
+ content: |
+ ## š License
+
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
+ variables: []
+
+ founded-by:
+ content: |
+
+
+ > š [Founded by {{author_name}}](https://github.com/{{github_username}}) š**
+
+
+ variables: [author_name, github_username]
diff --git a/verify_readme_sync.sh b/verify_readme_sync.sh
new file mode 100755
index 0000000..18b2798
--- /dev/null
+++ b/verify_readme_sync.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+# Quick verification script for README standardization system
+
+set -e
+
+echo "š§ README Standardization System - Verification Script"
+echo "āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā"
+echo ""
+
+# Check dependencies
+echo "š¦ Step 1: Installing dependencies..."
+cd tools/readme_sync
+flutter pub get || dart pub get
+cd ../..
+echo "ā Dependencies installed"
+echo ""
+
+# Validate markers
+echo "š Step 2: Validating all README markers..."
+dart run tools/readme_sync/readme_sync.dart --validate
+echo ""
+
+# Show what would change (dry-run on single package)
+echo "š¬ Step 3: Testing dry-run on timer_button package..."
+echo "āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā"
+dart run tools/readme_sync/readme_sync.dart --dry-run --package timer_button
+echo ""
+
+# Offer to run full dry-run
+echo "āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā"
+echo ""
+echo "ā
Validation complete!"
+echo ""
+echo "š Next steps you can try:"
+echo " 1. Full dry-run: dart run tools/readme_sync/readme_sync.dart --dry-run"
+echo " 2. Sync one package: dart run tools/readme_sync/readme_sync.dart --package timer_button"
+echo " 3. Sync all: melos sync:readme"
+echo ""
+echo "š Documentation: tools/readme_sync/README.md"
+echo ""