Raise the declared minimums in pubspec.yaml to what our deps already require: Flutter >=3.35.0 / Dart >=3.9.0 (was 3.19.0 / 3.5.0). alchemist 0.12 needs Flutter 3.32; Dart 3.9 first ships in Flutter 3.35, so 3.35 is the binding floor. Pin the exact build toolchain in .fvmrc (Flutter 3.44.1). Moving to the Dart 3.9 language level switches `dart format` to the new "tall" style and enables two new lints. This commit is the resulting mechanical churn, isolated from any behaviour change: - whole-tree `dart format` reformat (tall style) - `dart fix` for unnecessary_underscores + use_null_aware_elements No runtime behaviour change; `make test` green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
53 lines
1.7 KiB
Dart
53 lines
1.7 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:yaml/yaml.dart';
|
|
|
|
/// A parsed third-party extension manifest.
|
|
///
|
|
/// Built-in extensions don't need a manifest file — they compile in as
|
|
/// Dart subclasses of [ClideExtension]. Third-party extensions ship a
|
|
/// `manifest.yaml` under `~/.clide/extensions/<id>/` alongside their
|
|
/// Lua entrypoint; this class parses and validates that file.
|
|
class ExtensionManifest {
|
|
const ExtensionManifest({
|
|
required this.id,
|
|
required this.title,
|
|
required this.version,
|
|
required this.dependsOn,
|
|
required this.entry,
|
|
required this.schemaVersion,
|
|
});
|
|
|
|
final String id;
|
|
final String title;
|
|
final String version;
|
|
final List<String> dependsOn;
|
|
final String entry; // relative path to lua entrypoint
|
|
final int schemaVersion;
|
|
|
|
factory ExtensionManifest.fromYamlString(String text) {
|
|
final doc = loadYaml(text);
|
|
if (doc is! Map) {
|
|
throw const FormatException('manifest root is not a map');
|
|
}
|
|
final id = doc['id'];
|
|
if (id is! String || id.isEmpty) {
|
|
throw const FormatException('manifest missing `id`');
|
|
}
|
|
final title = (doc['title'] as String?) ?? id;
|
|
final version = (doc['version'] as String?) ?? '0.0.0';
|
|
final entry = (doc['entry'] as String?) ?? 'extension.lua';
|
|
final schemaVersion = (doc['schema_version'] as int?) ?? 1;
|
|
final depsYaml = doc['depends_on'];
|
|
final deps = <String>[];
|
|
if (depsYaml is YamlList) {
|
|
for (final d in depsYaml) {
|
|
if (d is String) deps.add(d);
|
|
}
|
|
}
|
|
return ExtensionManifest(id: id, title: title, version: version, dependsOn: deps, entry: entry, schemaVersion: schemaVersion);
|
|
}
|
|
|
|
static Future<ExtensionManifest> fromFile(File f) async => ExtensionManifest.fromYamlString(await f.readAsString());
|
|
}
|