-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
9,844 additions
and
12,149 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.{js, json}] | ||
indent_style = space | ||
indent_size = 2 |
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 |
---|---|---|
@@ -1 +1 @@ | ||
^4.0.0 | ||
>=6.9.1 <7.0.0 |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
language: node_js | ||
node_js: 4 | ||
node_js: 6 | ||
cache: | ||
directories: | ||
- test/node_modules | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "snowdog/frontools", | ||
"description": "Set of front-end tools for Magento 2, based on Gulp.js", | ||
"version": "0.11.4", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"type": "magento2-component" | ||
} |
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 |
---|---|---|
@@ -1,61 +1,18 @@ | ||
{ | ||
"backend": { | ||
"src" : "app/design/adminhtml/Magento/backend", | ||
"dest" : "pub/static/adminhtml/Magento/backend", | ||
"locale" : ["en_US"], | ||
"lang" : "less", | ||
"default": true, | ||
"area" : "adminhtml", | ||
"vendor" : "Magento", | ||
"name" : "backend", | ||
"files" : [ | ||
"css/styles-old", | ||
"css/styles" | ||
] | ||
}, | ||
"blank": { | ||
"src" : "app/design/frontend/Magento/blank", | ||
"dest" : "pub/static/frontend/Magento/blank", | ||
"locale" : ["en_US"], | ||
"lang" : "less", | ||
"default": true, | ||
"area" : "frontend", | ||
"vendor" : "Magento", | ||
"name" : "blank", | ||
"files" : [ | ||
"css/styles-m", | ||
"css/styles-l", | ||
"css/email", | ||
"css/email-inline" | ||
] | ||
}, | ||
"luma": { | ||
"src" : "app/design/frontend/Magento/luma", | ||
"dest" : "pub/static/frontend/Magento/luma", | ||
"locale" : ["en_US"], | ||
"lang" : "less", | ||
"default": true, | ||
"area" : "frontend", | ||
"vendor" : "Magento", | ||
"name" : "luma", | ||
"files" : [ | ||
"css/styles-m", | ||
"css/styles-l" | ||
] | ||
}, | ||
"sass-blank": { | ||
"src" : "vendor/snowdog/theme-blank-sass", | ||
"dest" : "pub/static/frontend/Snowdog/blank", | ||
"locale" : ["en_US", "pl_PL"], | ||
"locale" : ["en_US"], | ||
"lang" : "scss", | ||
"postcss": ["plugins.autoprefixer()"] | ||
}, | ||
"sass-custom": { | ||
"src" : "vendor/snowdog/theme-custom", | ||
"dest" : "pub/static/frontend/Snowdog/custom", | ||
"parent" : "sass-blank", | ||
"locale" : ["en_US", "pl_PL"], | ||
"lang" : "scss", | ||
"postcss": ["plugins.autoprefixer()"] | ||
"custom": { | ||
"src" : "vendor/snowdog/theme-custom", | ||
"dest" : "pub/static/frontend/Snowdog/custom", | ||
"parent" : "blank", | ||
"locale" : ["en_US", "pl_PL"], | ||
"localeOverwrites": true, | ||
"lang" : "scss", | ||
"postcss" : ["plugins.autoprefixer()"] | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
'use strict'; | ||
module.exports = function(plugins, config, name) { // eslint-disable-line func-names | ||
const theme = config.themes[name], | ||
themeSrc = config.projectPath + theme.src, | ||
themeDest = config.projectPath + 'var/view_preprocessed/frontools' + theme.dest.replace('pub/static', ''); | ||
|
||
// Clean destination dir before generating new symlinks | ||
plugins.fs.removeSync(themeDest); | ||
|
||
function createSymlink(srcPath, destPath) { | ||
try { | ||
plugins.fs.ensureFileSync(destPath); | ||
plugins.fs.unlinkSync(destPath); | ||
} | ||
finally { | ||
plugins.fs.symlinkSync(srcPath, destPath); | ||
} | ||
} | ||
|
||
// Create symlinks for themes without any per locale modifcations | ||
if (!theme.localeOverwrites) { | ||
// If theme have parent, create symlinks to all avaliabe files and then overwite only neccessary | ||
if (theme.parent) { | ||
const parentSrc = config.projectPath + config.themes[theme.parent].src; | ||
plugins.globby.sync([ | ||
parentSrc + '/**/*.' + theme.lang, | ||
'!/**/node_modules/**' | ||
]).forEach(srcPath => { | ||
createSymlink( | ||
srcPath, | ||
themeDest + srcPath.replace(parentSrc, '').replace('/web', '') | ||
); | ||
}); | ||
} | ||
|
||
// Create symlinks to all files in this theme. Will overwritte parent symlinks if exist. | ||
plugins.globby.sync([ | ||
themeSrc + '/**/*.' + theme.lang, | ||
'!/**/node_modules/**' | ||
]).forEach(srcPath => { | ||
createSymlink( | ||
srcPath, | ||
themeDest + srcPath.replace(themeSrc, '') | ||
); | ||
}); | ||
} | ||
// Create symlinks for themes with per locale modifcations | ||
else { | ||
// We have to handle every locale independly, b/c of possible overwrites | ||
theme.locale.forEach(locale => { | ||
// If theme have parent, create symlinks to all avaliabe files and then overwitte only neccessary | ||
if (theme.parent) { | ||
const parentSrc = config.projectPath + config.themes[theme.parent].src; | ||
plugins.globby.sync([ | ||
parentSrc + '/**/*.' + theme.lang, | ||
'!/**/i18n/**', | ||
'!/**/node_modules/**' | ||
]).forEach(srcPath => { | ||
createSymlink( | ||
srcPath, | ||
themeDest + '/' + locale + srcPath.replace(parentSrc, '').replace('/web', '') | ||
); | ||
}); | ||
} | ||
|
||
// Create symlinks to all files in this theme. Will overwritte parent symlinks if exist. | ||
plugins.globby.sync([ | ||
themeSrc + '/**/*.' + theme.lang, | ||
'!/**/i18n/**', | ||
'!/**/node_modules/**' | ||
]).forEach(srcPath => { | ||
createSymlink( | ||
srcPath, | ||
themeDest + '/' + locale + srcPath.replace(themeSrc, '') | ||
); | ||
}); | ||
|
||
// Overwritte parent/current theme symlinks with locale specific files | ||
plugins.globby.sync([ | ||
themeSrc + '/**/i18n/' + locale + '/**/*.' + theme.lang, | ||
'!/**/node_modules/**' | ||
]).forEach(srcPath => { | ||
createSymlink( | ||
srcPath, | ||
themeDest + '/' + locale + srcPath.replace(themeSrc, '').replace('/i18n/' + locale, '') | ||
); | ||
}); | ||
}); | ||
} | ||
}; |
Oops, something went wrong.