Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore: better sass dependency management #11986

Closed
wants to merge 1 commit into from

Conversation

joeworkman
Copy link
Member

Description

This is another attempt at #9542

I could not get sass:foundationSCSS to work with gulp-shopify-sass and eyeglass. The code is still in there but I removed the taks from being ran. Maybe we can figure it out one day.

The sassy-lists libraries are imported from node_modules now.

Normalize.css is still manually added into vendor/normalize. The reason that this needs to be there is that would need to be imported from within a mixin. Sass does not allow this yet. There for it needs to be made into its own mixin. A better way would be to simply have a separate import command for this. However, this would break existing implementations and we do not want to do that. The normalize.css does not change frequently at all. So this is not too big of a deal right now. Its definitely something that could be fixed in F7 though.

  • Closes

Types of changes

  • Documentation
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (anything that would change an existing functionality)
  • Maintenance (refactor, code cleaning, development tools...)

@joeworkman joeworkman requested a review from DanielRuf February 5, 2020 02:04
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 5, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@DanielRuf DanielRuf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a big breaking change regarding the changes. Also this will break the Sass version as users have to run npm i now. There is a good reason why the vendor folder is in the published packages.

I would close this PR and use the correct way and improve it in small steps without such changes.

@joeworkman
Copy link
Member Author

OK. There went quite a few hours of work... oh well. I will close the other one as well.

@joeworkman joeworkman closed this Feb 5, 2020
SASS_DOC_PATHS: [
'scss',
'node_modules/motion-ui/src',
'node_modules/foundation-docs/scss'
'node_modules/foundation-docs/scss',
'node_modules/sassy-lists/stylesheets'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for docs.

@@ -66,6 +56,7 @@ module.exports = {
],

DIST_FILES: [
'./_build/assets/scss/foundation.scss',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes not much sense, this is not a dist file.

// Creates a Sass file from the module/variable list and creates foundation.css and foundation.min.css
gulp.task('customizer:sass', gulp.series('customizer:loadConfig', 'customizer:prepareSassDeps', function() {
gulp.task('customizer:sass', gulp.series('customizer:loadConfig', function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing things to fix them is not the correct approach.

includePaths: [
'scss',
'node_modules/motion-ui/src'
]
}))
})))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Badly formatted and hard to read.

@@ -22,7 +22,7 @@ var NEXT_VERSION;
gulp.task('deploy', gulp.series('deploy:prompt', 'deploy:version', 'deploy:dist', 'deploy:plugins', 'deploy:settings', 'deploy:commit', 'deploy:templates'));

gulp.task('deploy:prep', gulp.series('deploy:prompt', 'deploy:version', 'deploy:dist', 'deploy:plugins', 'deploy:settings'));
gulp.task('deploy:dist', gulp.series('sass:foundation', 'javascript:foundation', 'deploy:dist:files', 'deploy:dist:bundles'));
gulp.task('deploy:dist', gulp.series('sass:foundationCSS', 'javascript:foundation', 'deploy:dist:files', 'deploy:dist:bundles'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming tasks will break implementations and docs.

@@ -1,45 +1,46 @@
'use strict';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling strict mode allows more broken JS.

gulp.task('sass:foundationSCSS', function() {
return gulp.src(['assets/foundation.scss'])
.pipe(gss(eyeglass()))
.pipe(rename('foundation.scss'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes it all unnecessary complicated.

@@ -159,5 +161,8 @@
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"dependencies": {
"normalize.css": "^8.0.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be there.

@import '../_vendor/sassy-lists/stylesheets/functions/remove';
@import '../_vendor/sassy-lists/stylesheets/functions/replace';
@import '../_vendor/sassy-lists/stylesheets/functions/to-list';
@import '../node_modules/sassy-lists/stylesheets/SassyLists';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will not work in the pure scss version.

}

// 1. Correct the inability to style clickable types in iOS and Safari.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally there should be still the comments.

Please use the original file, not the production file.

https://github.com/necolas/normalize.css/blob/8.0.1/normalize.css#L304

@DanielRuf DanielRuf deleted the feature/sass-dependency-mgmt branch March 28, 2020 22:30
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants