Skip to content

Commit

Permalink
fix: solve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tilucasoli committed Jun 17, 2024
1 parent a3aa143 commit 6eb96c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
15 changes: 4 additions & 11 deletions packages/melos/lib/src/package.dart
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,14 @@ class PackageFilters {
String? diff,
bool? includeDependencies,
bool? includeDependents,
List<Glob>? category,
List<Glob>? categories,
}) {
return PackageFilters._(
dependsOn: dependsOn ?? this.dependsOn,
dirExists: dirExists ?? this.dirExists,
fileExists: fileExists ?? this.fileExists,
ignore: ignore ?? this.ignore,
categories: categories ?? this.categories,
includePrivatePackages:
includePrivatePackages ?? this.includePrivatePackages,
noDependsOn: noDependsOn ?? this.noDependsOn,
Expand All @@ -412,7 +413,6 @@ class PackageFilters {
diff: diff ?? this.diff,
includeDependencies: includeDependencies ?? this.includeDependencies,
includeDependents: includeDependents ?? this.includeDependents,
categories: category ?? categories,
);
}

Expand Down Expand Up @@ -640,7 +640,7 @@ The packages that caused the problem are:
.applyFileExists(filters.fileExists)
.filterPrivatePackages(include: filters.includePrivatePackages)
.applyScope(filters.scope)
.applyCategory(filters.categories)
.applyCategories(filters.categories)
.applyDependsOn(filters.dependsOn)
.applyNoDependsOn(filters.noDependsOn)
.filterNullSafe(nullSafe: filters.nullSafe)
Expand Down Expand Up @@ -786,7 +786,7 @@ extension IterablePackageExt on Iterable<Package> {
}).toList();
}

Iterable<Package> applyCategory(List<Glob> appliedCategories) {
Iterable<Package> applyCategories(List<Glob> appliedCategories) {
if (appliedCategories.isEmpty) return this;

return where((package) {
Expand Down Expand Up @@ -1187,10 +1187,3 @@ class Plugin {
Map<Object?, Object?>? get platforms =>
_plugin['platforms'] as Map<Object?, Object?>?;
}

class PackageCategory {
PackageCategory(this.name, this.packages);

final String name;
final List<Glob> packages;
}
4 changes: 1 addition & 3 deletions packages/melos/lib/src/workspace_configs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,7 @@ class MelosWorkspaceConfig {
categories: categories.map(
(key, value) => MapEntry(
key,
value.map((v) {
return Glob(v);
}).toList(),
value.map(Glob.new).toList(),
),
),
packages: packages
Expand Down
4 changes: 2 additions & 2 deletions packages/melos/test/package_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void main() {
createPackage('package3', ['ab', 'cd']),
];

final result1 = sut.applyCategory(
final result1 = sut.applyCategories(
[Glob('ab')],
);

Expand All @@ -277,7 +277,7 @@ void main() {
],
);

final result2 = sut.applyCategory(
final result2 = sut.applyCategories(
[Glob('*b*')],
);

Expand Down

0 comments on commit 6eb96c7

Please sign in to comment.