add signals package
This commit is contained in:
@@ -6,5 +6,11 @@ A collection of Flutter packages maintained by @rodydavis.
|
|||||||
|
|
||||||
| Package | Description | Version | Pub |
|
| Package | Description | Version | Pub |
|
||||||
| :--- | :--- | :--- | :--- |
|
| :--- | :--- | :--- | :--- |
|
||||||
| [flutter_sms](./packages/flutter_sms) | Flutter Plugin for sending SMS and MMS on Android and iOS. | 3.0.0 | [](https://pub.dev/packages/flutter_sms) |
|
| [flutter_sms](./packages/flutter_sms) | A Flutter plugin to send SMS and MMS on iOS and Android. | [] | [](https://pub.dev/packages/flutter_sms) |
|
||||||
| [flutter_vibrate](./packages/flutter_vibrate) | A Haptic Feedback and Vibration plugin. | 1.4.0 | [](https://pub.dev/packages/flutter_vibrate) |
|
| [flutter_vibrate](./packages/flutter_vibrate) | A Haptic Feedback and Vibration plugin. | [] | [](https://pub.dev/packages/flutter_vibrate) |
|
||||||
|
| [preact_signals](./packages/signals/packages/preact_signals) | Dart port of Preact.js Signals | [] | [](https://pub.dev/packages/preact_signals) |
|
||||||
|
| [signals](./packages/signals/packages/signals) | Reactivity made simple. Do more by doing less. Supports Flutter and any Dart project including HTML/JS, CLI, Shelf Server, VM and more. | [] | [](https://pub.dev/packages/signals) |
|
||||||
|
| [signals_core](./packages/signals/packages/signals_core) | The signals library exposes four core functions which are the building blocks to model any business logic you can think of. | [] | [](https://pub.dev/packages/signals_core) |
|
||||||
|
| [signals_flutter](./packages/signals/packages/signals_flutter) | The signals library exposes four core functions which are the building blocks to model any business logic you can think of. | [] | [](https://pub.dev/packages/signals_flutter) |
|
||||||
|
| [signals_hooks](./packages/signals/packages/signals_hooks) | flutter_hooks bindings for signals | [] | [](https://pub.dev/packages/signals_hooks) |
|
||||||
|
| [signals_lint](./packages/signals/packages/signals_lint) | linter and developer tool for signals | [] | [](https://pub.dev/packages/signals_lint) |
|
||||||
|
|||||||
+1
-1
Submodule packages/signals updated: ad01646b69...3f05f49836
@@ -0,0 +1,82 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
void main() async {
|
||||||
|
final rootDir = Directory.current;
|
||||||
|
final packagesDir = Directory('${rootDir.path}/packages');
|
||||||
|
final readmeFile = File('${rootDir.path}/README.md');
|
||||||
|
|
||||||
|
if (!packagesDir.existsSync()) {
|
||||||
|
print('Error: packages directory not found at ${packagesDir.path}');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final packages = <_Package>[];
|
||||||
|
|
||||||
|
await for (final entity in packagesDir.list(recursive: true)) {
|
||||||
|
if (entity is File && entity.path.endsWith('pubspec.yaml')) {
|
||||||
|
// Skip if likely in a build or hidden folder (simple heuristic)
|
||||||
|
if (entity.path.contains('/.') || entity.path.contains('/build/')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
final pubspecContent = await entity.readAsString();
|
||||||
|
final name = _getValue(pubspecContent, 'name');
|
||||||
|
final description = _getValue(pubspecContent, 'description');
|
||||||
|
final version = _getValue(pubspecContent, 'version');
|
||||||
|
final publishTo = _getValue(pubspecContent, 'publish_to');
|
||||||
|
|
||||||
|
if (name != null && version != null && publishTo != 'none') {
|
||||||
|
// Calculate relative path from root
|
||||||
|
final relativePath = entity.parent.path.replaceFirst(rootDir.path, '.');
|
||||||
|
|
||||||
|
packages.add(_Package(
|
||||||
|
name: name,
|
||||||
|
description: description ?? '',
|
||||||
|
path: relativePath,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
packages.sort((a, b) => a.name.compareTo(b.name));
|
||||||
|
|
||||||
|
final sb = StringBuffer();
|
||||||
|
sb.writeln('# packages.dart');
|
||||||
|
sb.writeln();
|
||||||
|
sb.writeln('A collection of Flutter packages maintained by @rodydavis.');
|
||||||
|
sb.writeln();
|
||||||
|
sb.writeln('## Packages');
|
||||||
|
sb.writeln();
|
||||||
|
sb.writeln('| Package | Description | Version | Pub |');
|
||||||
|
sb.writeln('| :--- | :--- | :--- | :--- |');
|
||||||
|
|
||||||
|
for (final pkg in packages) {
|
||||||
|
sb.writeln(
|
||||||
|
'| [${pkg.name}](${pkg.path}) | ${pkg.description} | [] | [](https://pub.dev/packages/${pkg.name}) |');
|
||||||
|
}
|
||||||
|
|
||||||
|
await readmeFile.writeAsString(sb.toString());
|
||||||
|
print('README.md updated with ${packages.length} packages.');
|
||||||
|
}
|
||||||
|
|
||||||
|
String? _getValue(String content, String key) {
|
||||||
|
final regex = RegExp('^$key:\\s*(.*)\$', multiLine: true);
|
||||||
|
final match = regex.firstMatch(content);
|
||||||
|
var value = match?.group(1)?.trim();
|
||||||
|
if (value != null) {
|
||||||
|
if (value.startsWith("'") && value.endsWith("'")) {
|
||||||
|
value = value.substring(1, value.length - 1);
|
||||||
|
} else if (value.startsWith('"') && value.endsWith('"')) {
|
||||||
|
value = value.substring(1, value.length - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
class _Package {
|
||||||
|
final String name;
|
||||||
|
final String description;
|
||||||
|
final String path;
|
||||||
|
|
||||||
|
_Package({required this.name, required this.description, required this.path});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user