Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load members from load paths and node_modules using original URLs
Rather than loading the stylesheets in which these members were literally defined, load stylesheets that transitively import those stylesheets. Since we aren't migrating these files, the transitive imports will continue to work, and this avoids potentially importing from within a package's private filesystem structure.
- Loading branch information
Showing
6 changed files
with
100 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
test/migrators/module/loads_indirect_member_from_library_entrypoint.hrx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<==> arguments | ||
--migrate-deps | ||
|
||
<==> README | ||
We have to generate a new `@use` for the variable reference in `_other.scss`. We | ||
should generate one that uses the original dependency URL, rather than the | ||
direct URL to the file in which the name is defined, since that file structure | ||
is likely not to be part of the library's public API. | ||
|
||
<==> input/entrypoint.scss | ||
@import "~module/dependency"; | ||
@import "other"; | ||
|
||
<==> input/_other.scss | ||
a { | ||
color: $variable; | ||
} | ||
|
||
<==> input/node_modules/module/_dependency.scss | ||
@import "other"; | ||
|
||
<==> input/node_modules/module/_other.scss | ||
$variable: green; | ||
|
||
<==> output/entrypoint.scss | ||
@use "~module/dependency"; | ||
@use "other"; | ||
|
||
<==> output/_other.scss | ||
@use "~module/dependency"; | ||
a { | ||
color: dependency.$variable; | ||
} |