fluvie_validate

Static validation for Fluvie composition code. It resolves a snippet against package:fluvie and reports the compiler diagnostics plus the fluvie_lints rules. It analyzes only: it never compiles the code to an executable or runs it, so validating an untrusted snippet is safe.

pub package license: MIT

Usage

import 'dart:io';

import 'package:fluvie_validate/fluvie_validate.dart';

Future<void> main() async {
  final analyzer = FluvieCodeAnalyzer(projectRoot: Directory.current);

  final diagnostics = await analyzer.analyze('''
import 'package:fluvie/fluvie.dart';

Video build() => Video(scenes: const []);
''');

  if (diagnostics.isEmpty) {
    stderr.writeln('No problems.');
  } else {
    for (final diagnostic in diagnostics) {
      stderr.writeln(diagnostic);
    }
  }
}

projectRoot is any directory whose package resolution can see package:fluvie (the workspace root works). This package backs the validate path in fluvie_server and the Fluvie Playground.

Libraries

fluvie_validate
Statically validate Fluvie composition code without executing it.