import_converter 1.0.0+1
import_converter: ^1.0.0+1 copied to clipboard
A CLI program to convert package imports to path imports in Dart projects.
Import Converter #
A Dart command-line tool for converting package imports to path imports and vice versa in a Dart project.
Features #
- Automatically scans all
.dartfiles within the project and converts package imports to path imports. - Supports reverting path imports back to package imports.
- Excludes processing files in the
testfolder. - Retrieves the project name from the
pubspec.yamlfile.
Installation #
Activate the import_converter package globally:
dart pub global activate import_converter
Running #
- Convert package imports to path imports:
import_converter --path /path/to/your/dart/project
- Convert path imports back to package imports:
import_converter --path /path/to/your/dart/project --revert
Command Line Options #
--pathor-p: The path to the directory containing your Dart project.--revertor-r: Revert path imports back to package imports. By default, the program converts package imports to path imports.
Limitations #
- This tool assumes a standard Dart project structure with a
libfolder containing the source code and apubspec.yamlfile. - It does not currently support custom import prefixes or aliasing.