Skip to content

Commit 812acd6

Browse files
authored
Fix a bug generating superfluous import-only files (#179)
1 parent a1bad96 commit 812acd6

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 1.3.6
2+
3+
### Module Migrator
4+
5+
* Fix a bug that could result in unnecessary import-only files being generated
6+
when running `--forward=import-only` on a file with no dependencies.
7+
18
## 1.3.5
29

310
### Module Migrator

lib/src/migrators/module.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ class _ModuleMigrationVisitor extends MigrationVisitor {
299299
// import-only file is necessary.
300300
if (forwardsByUrl.isEmpty ||
301301
(forwardsByUrl.length == 1 &&
302-
forwardsByUrl[entrypoint]?.keys == {''})) {
302+
forwardsByUrl[entrypoint]?.keys?.join() == '')) {
303303
return null;
304304
}
305305

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sass_migrator
2-
version: 1.3.5
2+
version: 1.3.6
33
description: A tool for running migrations on Sass files
44
author: Jennifer Thakar <[email protected]>
55
homepage: https://github.com/sass/migrator
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<==> arguments
2+
--migrate-deps --forward=import-only
3+
4+
<==> README.md
5+
This text confirms that import-only files are only generated when they're
6+
necessary.
7+
8+
<==> input/entrypoint.scss
9+
$variable: green;
10+
11+
a {
12+
color: $variable;
13+
}
14+
15+
<==> log.txt
16+
Nothing to migrate!

0 commit comments

Comments
 (0)