Skip to content

Commit

Permalink
Merge branch 'release/1.10.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Igloczek committed Oct 27, 2020
2 parents c9dea33 + 7b30bbf commit 57fbc2d
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 6 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ Check `config/themes.json.sample` to get samples.
Check `config/watcher.json.sample` to get samples.
- `usePolling` - set this to `true` to successfully watch files over a network (i.e. Docker or Vagrant) or when your watcher dosen't work well. Warning, enabling this option may lead to high CPU utilization! [chokidar docs](https://github.com/paulmillr/chokidar#performance)

## `sass-compiler.json` structure
You can choose Sass compiler between the default, but [already deprecated](https://github.com/sass/node-sass/issues/2952), `node-sass` or a newer and faster `dart-sass`.

Since the Dart Sass does not have the same set of features as Node Sass, for now we will keep the older version as default.

## Optional configurations for 3rd party plugins
You will find sample config files for theses plugins in `vendor/snowdog/frontools/config` directory.
* Create [browserSync](https://www.browsersync.io/) configuration
Expand Down
1 change: 1 addition & 0 deletions config/sass-compiler.json.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"node-sass"
12 changes: 9 additions & 3 deletions helpers/scss.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { src } from 'gulp'
import path from 'path'
import gulpIf from 'gulp-if'
import sass from 'gulp-sass'
import dartSass from 'sass'
import gulpSass from 'gulp-sass'
import rename from 'gulp-rename'
import multiDest from 'gulp-multi-dest'
import logger from 'gulp-logger'
Expand All @@ -16,7 +17,6 @@ import configLoader from '../helpers/config-loader'
import sassError from './sass-error'
import { env, themes, tempPath, projectPath, browserSyncInstances } from '../helpers/config'


export default function(name, file) {
const theme = themes[name]
const srcBase = path.join(tempPath, theme.dest)
Expand All @@ -28,6 +28,12 @@ export default function(name, file) {
const postcssConfig = []
const disableSuffix = theme.disableSuffix || false
const browserslist = configLoader('browserslist.json')
const sassCompiler = configLoader('sass-compiler.json', false)

// Set Sass compiler to Dart Sass
if (sassCompiler === 'dart-sass') {
gulpSass.compiler = dartSass
}

if (theme.postcss) {
theme.postcss.forEach(el => {
Expand Down Expand Up @@ -65,7 +71,7 @@ export default function(name, file) {
)
)
.pipe(gulpIf(!disableMaps, sourcemaps.init()))
.pipe(sass({ includePaths: includePaths }).on('error', sassError(env.ci || false)))
.pipe(gulpSass({ includePaths: includePaths }).on('error', sassError(env.ci || false)))
.pipe(gulpIf(production, postcss([cssnano()])))
.pipe(gulpIf(postcssConfig.length, postcss(postcssConfig || [])))
.pipe(gulpIf(production && !disableSuffix, rename({ suffix: '.min' })))
Expand Down
10 changes: 9 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "magento2-frontools",
"version": "1.9.0",
"version": "1.10.0",
"author": {
"name": "Bartek Igielski",
"email": "[email protected]"
Expand Down Expand Up @@ -48,6 +48,7 @@
"minimist": "^1.2.5",
"postcss-reporter": "^6.0.1",
"run-sequence": "^2.2.1",
"sass": "^1.27.0",
"stylelint": "^11.1.1",
"stylelint-config-standard": "^19.0.0"
},
Expand All @@ -72,6 +73,6 @@
"test": "eslint *.js helpers/*.js tasks/*.js"
},
"engines": {
"node": ">=12.13.0 <13.0.0"
"node": ">=12.13.0 <13.0.0 || >=14.14.0 <15.0.0"
}
}
29 changes: 29 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1867,6 +1867,21 @@ chardet@^0.7.0:
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e"
integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==

"chokidar@>=2.0.0 <4.0.0":
version "3.4.3"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b"
integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==
dependencies:
anymatch "~3.1.1"
braces "~3.0.2"
glob-parent "~5.1.0"
is-binary-path "~2.1.0"
is-glob "~4.0.1"
normalize-path "~3.0.0"
readdirp "~3.5.0"
optionalDependencies:
fsevents "~2.1.2"

chokidar@^2.0.0:
version "2.1.8"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917"
Expand Down Expand Up @@ -7241,6 +7256,13 @@ readdirp@~3.4.0:
dependencies:
picomatch "^2.2.1"

readdirp@~3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e"
integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==
dependencies:
picomatch "^2.2.1"

readline2@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35"
Expand Down Expand Up @@ -7736,6 +7758,13 @@ sass-lint@^1.12.0:
path-is-absolute "^1.0.0"
util "^0.10.3"

sass@^1.27.0:
version "1.27.0"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.27.0.tgz#0657ff674206b95ec20dc638a93e179c78f6ada2"
integrity sha512-0gcrER56OkzotK/GGwgg4fPrKuiFlPNitO7eUJ18Bs+/NBlofJfMxmxqpqJxjae9vu0Wq8TZzrSyxZal00WDig==
dependencies:
chokidar ">=2.0.0 <4.0.0"

sax@~1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
Expand Down

0 comments on commit 57fbc2d

Please sign in to comment.