-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document the Sass migrator #372
Conversation
end | ||
|
||
task :version => :checkout do | ||
add_version 'migrator', Dir.chdir(".sass-migrator") {latest_stable_tag} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Layout/SpaceInsideBlockBraces: Space missing inside {.
Layout/SpaceInsideBlockBraces: Space missing inside }.
end | ||
end | ||
|
||
task :version => :checkout do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
Dir.chdir(".sass-migrator") do | ||
sh %{git fetch} | ||
if ENV["SASS_MIGRATOR_REVISION"] | ||
sh %{git checkout #{ENV["SASS_MIGRATOR_REVISION"]}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiteralsInInterpolation: Prefer single-quoted strings inside interpolations.
namespace :migrator do | ||
# Check out the latest commit of the Sass migrator into the .sass-migrator directory. | ||
task :checkout do | ||
unless Dir.exists?(".sass-migrator") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/DeprecatedClassMethods: Dir.exists? is deprecated in favor of Dir.exist?.
@@ -67,6 +67,28 @@ namespace :sass do | |||
end | |||
end | |||
|
|||
namespace :migrator do | |||
# Check out the latest commit of the Sass migrator into the .sass-migrator directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [89/80]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
<%= partial 'code-snippets/example-module-migrator' %> | ||
|
||
#### `--remove-prefix` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to mention here that passing this option will also generate an import-only stylesheet that forwards the entrypoint with the prefixes still intact, and that this option is unnecessary when migrating downstream stylesheets whose dependencies have already been migrated following this pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
This migration converts stylesheets that use the old [`@import` rule][] to load | ||
dependencies so that they use the Sass module system via the [`@use` rule][] | ||
instead. It doesn't just naïvely change `@import`s to `@use`s—it updates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider splitting this up:
This migration updates stylesheets that load dependencies to use the Sass module system. Any usages of the old [@import
rule][] get converted to the [@use
rule][].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to keep this as-is, because I feel like the existing wording makes it clearer that you can run the migrator on stylesheets that mix @import
and @use
rules.
Closes #358