Skip to content
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

Merged
merged 3 commits into from
Oct 1, 2019
Merged

Document the Sass migrator #372

merged 3 commits into from
Oct 1, 2019

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Sep 25, 2019

Closes #358

end

task :version => :checkout do
add_version 'migrator', Dir.chdir(".sass-migrator") {latest_stable_tag}

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

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"]}}

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")

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.

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]

@nex3 nex3 temporarily deployed to sass-lang-pr-372 September 25, 2019 13:28 Inactive
Copy link
Member

@jelbourn jelbourn left a 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`
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Contributor

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][].

Copy link
Contributor Author

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.

@nex3 nex3 merged commit 2b88bfb into feature.use Oct 1, 2019
@nex3 nex3 deleted the migrator branch October 1, 2019 22:21
asaf400 pushed a commit to asaf400/ass-site that referenced this pull request Apr 18, 2024
asaf400 pushed a commit to asaf400/ass-site that referenced this pull request Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants