From 6972183dfa8bd69b63804c0bfde6ab1a528717a7 Mon Sep 17 00:00:00 2001 From: oppahansi Date: Fri, 22 Dec 2023 16:15:59 +0100 Subject: [PATCH] chore: move all files to src folder --- CHANGELOG.md | 4 ++++ bin/better_imports.dart | 8 ++++---- lib/{ => src}/arg_parser.dart | 2 +- lib/{ => src}/cfg.dart | 6 +++--- lib/{ => src}/constants.dart | 0 lib/{ => src}/file_collector.dart | 4 ++-- lib/{ => src}/file_extension.dart | 0 lib/{ => src}/import_sorter.dart | 8 ++++---- lib/{ => src}/log.dart | 0 lib/{ => src}/sort_cmd.dart | 10 +++++----- pubspec.yaml | 2 +- test/cfg_test.dart | 6 +++--- test/file_collector_test.dart | 6 +++--- test/sorter_test.dart | 8 ++++---- 14 files changed, 34 insertions(+), 30 deletions(-) rename lib/{ => src}/arg_parser.dart (96%) rename lib/{ => src}/cfg.dart (98%) rename lib/{ => src}/constants.dart (100%) rename lib/{ => src}/file_collector.dart (96%) rename lib/{ => src}/file_extension.dart (100%) rename lib/{ => src}/import_sorter.dart (98%) rename lib/{ => src}/log.dart (100%) rename lib/{ => src}/sort_cmd.dart (87%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a3a218..4792558 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.3 + +- Moved all files in src folder to hide them from importing. + ## 1.0.2 - Dropped all barrel files to not export anything. diff --git a/bin/better_imports.dart b/bin/better_imports.dart index 13320d2..8b897c5 100644 --- a/bin/better_imports.dart +++ b/bin/better_imports.dart @@ -7,10 +7,10 @@ import "package:intl/intl.dart"; import "package:logging/logging.dart"; // Project Imports -import "package:better_imports/arg_parser.dart"; -import "package:better_imports/constants.dart"; -import "package:better_imports/log.dart"; -import "package:better_imports/sort_cmd.dart"; +import "package:better_imports/src/arg_parser.dart"; +import "package:better_imports/src/constants.dart"; +import "package:better_imports/src/log.dart"; +import "package:better_imports/src/sort_cmd.dart"; void main(List args) { _setupLogging(); diff --git a/lib/arg_parser.dart b/lib/src/arg_parser.dart similarity index 96% rename from lib/arg_parser.dart rename to lib/src/arg_parser.dart index 3cbc60d..aa930d2 100644 --- a/lib/arg_parser.dart +++ b/lib/src/arg_parser.dart @@ -2,7 +2,7 @@ import 'package:args/args.dart'; // Project Imports -import 'package:better_imports/constants.dart'; +import 'package:better_imports/src/constants.dart'; final argParser = ArgParser() ..addFlag( diff --git a/lib/cfg.dart b/lib/src/cfg.dart similarity index 98% rename from lib/cfg.dart rename to lib/src/cfg.dart index 16800c8..2b387bf 100644 --- a/lib/cfg.dart +++ b/lib/src/cfg.dart @@ -6,9 +6,9 @@ import 'package:args/args.dart'; import 'package:yaml/yaml.dart'; // Project Imports -import 'package:better_imports/constants.dart'; -import 'package:better_imports/file_extension.dart'; -import 'package:better_imports/log.dart'; +import 'package:better_imports/src/constants.dart'; +import 'package:better_imports/src/file_extension.dart'; +import 'package:better_imports/src/log.dart'; var logging = false; diff --git a/lib/constants.dart b/lib/src/constants.dart similarity index 100% rename from lib/constants.dart rename to lib/src/constants.dart diff --git a/lib/file_collector.dart b/lib/src/file_collector.dart similarity index 96% rename from lib/file_collector.dart rename to lib/src/file_collector.dart index 0c087b0..68fe0e2 100644 --- a/lib/file_collector.dart +++ b/lib/src/file_collector.dart @@ -2,8 +2,8 @@ import 'dart:io'; // Project Imports -import 'package:better_imports/cfg.dart'; -import 'package:better_imports/log.dart'; +import 'package:better_imports/src/cfg.dart'; +import 'package:better_imports/src/log.dart'; class Collector { final Cfg cfg; diff --git a/lib/file_extension.dart b/lib/src/file_extension.dart similarity index 100% rename from lib/file_extension.dart rename to lib/src/file_extension.dart diff --git a/lib/import_sorter.dart b/lib/src/import_sorter.dart similarity index 98% rename from lib/import_sorter.dart rename to lib/src/import_sorter.dart index 96929bb..e182ea6 100644 --- a/lib/import_sorter.dart +++ b/lib/src/import_sorter.dart @@ -8,10 +8,10 @@ import 'package:analyzer/dart/ast/token.dart'; import 'package:dart_style/dart_style.dart'; // Project Imports -import 'package:better_imports/cfg.dart'; -import 'package:better_imports/constants.dart'; -import 'package:better_imports/file_collector.dart'; -import 'package:better_imports/log.dart'; +import 'package:better_imports/src/cfg.dart'; +import 'package:better_imports/src/constants.dart'; +import 'package:better_imports/src/file_collector.dart'; +import 'package:better_imports/src/log.dart'; enum ImportType { dart, diff --git a/lib/log.dart b/lib/src/log.dart similarity index 100% rename from lib/log.dart rename to lib/src/log.dart diff --git a/lib/sort_cmd.dart b/lib/src/sort_cmd.dart similarity index 87% rename from lib/sort_cmd.dart rename to lib/src/sort_cmd.dart index 8d682d6..173c33b 100644 --- a/lib/sort_cmd.dart +++ b/lib/src/sort_cmd.dart @@ -3,11 +3,11 @@ import 'package:args/args.dart'; import 'package:tint/tint.dart'; // Project Imports -import 'package:better_imports/cfg.dart'; -import 'package:better_imports/file_collector.dart'; -import 'package:better_imports/file_extension.dart'; -import 'package:better_imports/import_sorter.dart'; -import 'package:better_imports/log.dart'; +import 'package:better_imports/src/cfg.dart'; +import 'package:better_imports/src/file_collector.dart'; +import 'package:better_imports/src/file_extension.dart'; +import 'package:better_imports/src/import_sorter.dart'; +import 'package:better_imports/src/log.dart'; class SortCmd { final ArgResults argResults; diff --git a/pubspec.yaml b/pubspec.yaml index 929c331..0ec5230 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: better_imports description: A better imports sorter for your .dart files. -version: 1.0.2 +version: 1.0.3 repository: https://github.com/oppahansi/better_imports executables: diff --git a/test/cfg_test.dart b/test/cfg_test.dart index 3afd25d..dd1cb98 100644 --- a/test/cfg_test.dart +++ b/test/cfg_test.dart @@ -5,9 +5,9 @@ import 'dart:io'; import 'package:test/test.dart'; // Project Imports -import 'package:better_imports/arg_parser.dart'; -import 'package:better_imports/cfg.dart'; -import 'package:better_imports/file_extension.dart'; +import 'package:better_imports/src/arg_parser.dart'; +import 'package:better_imports/src/cfg.dart'; +import 'package:better_imports/src/file_extension.dart'; void main() { group("Cfg Tests.", () { diff --git a/test/file_collector_test.dart b/test/file_collector_test.dart index da881ef..5277879 100644 --- a/test/file_collector_test.dart +++ b/test/file_collector_test.dart @@ -2,9 +2,9 @@ import 'package:test/test.dart'; // Project Imports -import 'package:better_imports/arg_parser.dart'; -import 'package:better_imports/cfg.dart'; -import 'package:better_imports/file_collector.dart'; +import 'package:better_imports/src/arg_parser.dart'; +import 'package:better_imports/src/cfg.dart'; +import 'package:better_imports/src/file_collector.dart'; void main() { group("Collector Tests. Test amount of collected files.", () { diff --git a/test/sorter_test.dart b/test/sorter_test.dart index 762a0b4..17be3ba 100644 --- a/test/sorter_test.dart +++ b/test/sorter_test.dart @@ -6,10 +6,10 @@ import 'package:dart_style/dart_style.dart'; import 'package:test/test.dart'; // Project Imports -import 'package:better_imports/arg_parser.dart'; -import 'package:better_imports/cfg.dart'; -import 'package:better_imports/file_collector.dart'; -import 'package:better_imports/import_sorter.dart'; +import 'package:better_imports/src/arg_parser.dart'; +import 'package:better_imports/src/cfg.dart'; +import 'package:better_imports/src/file_collector.dart'; +import 'package:better_imports/src/import_sorter.dart'; // Relative Project Imports import '../res/sorter_fixtures.dart';