locorda_init_generator 0.5.2 copy "locorda_init_generator: ^0.5.2" to clipboard
locorda_init_generator: ^0.5.2 copied to clipboard

Generates initLocorda — a zero-config init function that auto-wires the worker, RDF mapper, and storage backend from your pubspec dependencies.

locorda_init_generator #

pub package license

Code generator for Locorda convenience wrapper (initLocorda).

Purpose #

Generates lib/init_locorda.g.dart which provides a simplified initialization function that:

  • Auto-detects and configures workerSetup when worker_generated.g.dart exists
  • Auto-generates mapperInitializer when init_rdf_mapper.g.dart exists
  • Propagates all other Locorda.create parameters
  • Propagates custom parameters from initRdfMapper (excluding framework params)

Installation #

This package is automatically applied when you depend on locorda_dev:

dart pub add dev:locorda_dev dev:build_runner

Usage #

After running dart run build_runner build, use the generated function:

import 'package:your_app/init_locorda.g.dart';

final locorda = await initLocorda(
  config: myConfig,
  storage: myStorage,
  remotes: myRemotes,
);

The generator automatically handles:

  • Setting workerSetup: generatedWorkerSetup if worker_generated.g.dart exists
  • Setting jsScript: 'worker_generated.dart.js' appropriately
  • Generating mapperInitializer lambda if init_rdf_mapper.g.dart exists

Requirements #

  • Requires analyzer for code analysis
  • Compatible with Flutter stable and latest versions

Architecture #

This is a separate package (not part of locorda_builder) because:

  • Heavy analyzer dependency (~20MB)
  • Advanced code analysis features
  • Should not burden apps that don't use this feature
0
likes
150
points
196
downloads

Documentation

API reference

Publisher

verified publisherlocorda.dev

Weekly Downloads

Generates initLocorda — a zero-config init function that auto-wires the worker, RDF mapper, and storage backend from your pubspec dependencies.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#build #code-generation

License

MIT (license)

Dependencies

analyzer, build, dart_style, glob, locorda_core, locorda_rdf_core, locorda_rdf_terms_core, logging, path, pub_semver, source_gen

More

Packages that depend on locorda_init_generator