metro/live/live_registry library

Enums

LiveRegistration
The result of registering a live command or seeder in the app.
LiveWiring
The result of wiring a registry into the app provider.

Constants

liveCommandsImport → const String
The import that makes liveCommands available to the app provider.
liveCommandsRegistryPath → const String
Where apps register their live commands.
liveCommandsRegistryTemplate → const String
The contents of a new lib/bootstrap/live_commands.dart.
seedersImport → const String
The import that makes seeders available to the app provider.
seedersRegistryPath → const String
Where apps register their seeders.
seedersRegistryTemplate → const String
The contents of a new lib/bootstrap/seeders.dart.

Functions

addLiveCommandsToProvider(String source) → String?
Returns source with liveCommands: liveCommands added as the last argument of its first nylo.configure(...) call and liveCommandsImport added after the last import.
addSeedersToProvider(String source) → String?
Returns source with seeders: seeders added as the last argument of its first nylo.configure(...) call and seedersImport added after the last import.
hasRegistryMap(String file, {required String variable, required String type}) → bool
Whether file declares the Map<String, <type>> <variable> registry.
insertLiveCommandRegistration(String file, {required String fullName, required String className}) → String?
Adds '<fullName>': () => <className>(), to the liveCommands map in file.
insertRegistryEntry(String file, {required String variable, required String type, required String key, required String value}) → String?
Adds '<key>': <value>, to the Map<String, <type>> <variable> declared in file.
insertSeederRegistration(String file, {required String name, required String className}) → String?
Adds '<name>': <className>.new, to the seeders map in file.
registeredLiveCommands({String projectRoot = '.'}) → List<String>
The live command names lib/bootstrap/live_commands.dart registers in the project at projectRoot.
registeredSeeders({String projectRoot = '.'}) → List<String>
The seeder names lib/bootstrap/seeders.dart registers in the project at projectRoot.
registerLiveCommand({required String fullName, required String className, required String importPath}) → Future<LiveRegistration>
Registers the command class className (from importPath, relative to lib/) under fullName in lib/bootstrap/live_commands.dart, creating the file when it doesn't exist.
registerSeeder({required String name, required String className, required String importPath}) → Future<LiveRegistration>
Registers the seeder class className (from importPath, relative to lib/) under name in lib/bootstrap/seeders.dart, creating the file when it doesn't exist.
registryKeys(String file, {required String variable, required String type}) → List<String>
The keys of the Map<String, <type>> <variable> registry declared in file, skipping commented-out entries.
wireLiveCommands(File appProvider) → Future<LiveWiring>
Passes the app's live commands to Nylo in appProvider by adding liveCommandsImport and liveCommands: liveCommands to its nylo.configure(...) call.
wireSeeders(File appProvider) → Future<LiveWiring>
Passes the app's seeders to Nylo in appProvider by adding seedersImport and seeders: seeders to its nylo.configure(...) call.