Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
## 2.4.1

### Module Migrator

* Fix a bug where a duplicate namespace would be added to a reassignment of a
variable from another module when running on a partially migrated file.

## 2.4.0

### Module System Migration
### Module Migrator

* Better handling of late `@import` rules. Previously, these were treated
identically to nested imports, but now they can be hoisted to the top of the
Expand All @@ -24,7 +31,7 @@

## 2.3.3

### Module System Migration
### Module Migrator

* Fix some bugs in the conversion of private names that are referenced across
files to public names, especially when `--remove-prefix` and/or multiple
Expand Down
2 changes: 1 addition & 1 deletion lib/src/migrators/module.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ class _ModuleMigrationVisitor extends MigrationVisitor {
/// renaming or namespacing if necessary.
@override
void visitVariableDeclaration(VariableDeclaration node) {
if (builtInOnly) {
if (builtInOnly || node.namespace != null) {
super.visitVariableDeclaration(node);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sass_migrator
version: 2.4.0
version: 2.4.1
description: A tool for running migrations on Sass files
homepage: https://github.com/sass/migrator

Expand Down
32 changes: 32 additions & 0 deletions test/migrators/module/partial_migration/reassigned_variable.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<==> arguments
--migrate-deps

<==> input/entrypoint.scss
@use "library";
@import "imported";

library.$var1: blue;
$var2: gold;

a {
color: library.$var1;
background: $var2;
}

<==> input/_library.scss
$var1: red;

<==> input/_imported.scss
$var2: white;

<==> output/entrypoint.scss
@use "library";
@use "imported";

library.$var1: blue;
imported.$var2: gold;

a {
color: library.$var1;
background: imported.$var2;
}
Loading