tom_bridge_generator library
Tom Bridge Generator
Centralized D4rt bridge generator for all Tom Framework projects.
This package provides the BridgeGenerator class that analyzes Dart source files and generates corresponding BridgedClass registrations for use with the D4rt interpreter.
Usage
import 'package:tom_bridge_generator/tom_bridge_generator.dart';
final generator = BridgeGenerator(
workspacePath: '/path/to/project',
packageName: 'my_package',
sourceImport: 'my_package.dart',
);
final result = await generator.generateBridgesFromExports(
barrelFiles: ['lib/my_package.dart'],
outputPath: 'lib/src/d4rt_bridges/my_package_bridges.b.dart',
moduleName: 'All',
);
Classes
- AuxiliaryImport
- Information about an auxiliary import needed for types used in defaults/parameters that aren't directly exported from the barrel.
- BridgeGenerator
- Generates D4rt BridgedClass implementations from Dart source files.
- BridgeGeneratorResult
- Result of bridge generation.
- ClassInfo
- Parsed class information for bridge generation.
- ConstructorInfo
- Information about a constructor.
- EnumInfo
- Information about an enum for bridging.
- EnumMethodDetail
- RC-7: Detailed information about an enum instance method.
- ExportInfo
- Information about an export directive from a barrel file.
- ExtensionInfo
- Information about an extension declaration in the source code.
- ExternalTypeDependency
- Information about an external type dependency.
- ExternalTypeWarning
- Warning about external types used in class parameters. These types may need wrapper classes for proper bridge support.
- FunctionTypeInfo
- Information about a function type signature. Used to generate wrappers for function-type parameters.
- GenericExtractionSite
- A generic extraction site discovered during bridge code generation.
- GlobalFunctionInfo
- Information about a top-level function for bridging.
- GlobalVariableInfo
- Information about a top-level variable for bridging.
- MemberInfo
- Information about a class member for bridging.
- ParameterInfo
- Information about a method parameter.
- RecursiveBoundType
- Configuration for a type to use in recursive bound dispatch.
Functions
-
mapPrivateSdkLibrary(
String uri, {void warnCallback(String)?}) → String? - Maps private/internal Dart SDK libraries to their public equivalents.
-
normalizeLibraryIdentifier(
String uri) → String -
Normalizes a library identifier to its canonical
dart:URI where the SDK library is actually sourced from an embedder package. -
toPascalCase(
String input) → String - Converts a snake_case or lowercase string to PascalCase.