Commit c6da235e authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

Merge remote-tracking branch 'origin/feature_stylelint'

parents db7ecf0d 31c39be2
......@@ -3,7 +3,7 @@
"description": "sgalinski command line interface",
"homepage": "https://www.sgalinski.de",
"license": ["SEE LICENSE IN LICENSE.md"],
"version": "2.1.2",
"version": "2.2.0",
"replace": {
"sgc-core": "self.version"
}
......
#!/bin/bash
if [ -z `which scss-lint` > /dev/null ]
then
if [ ! -z `which ruby` > /dev/null ]
then
echo -e "\033[0;34mInstall scss-lint\033[0m";
if [ $OSTYPE == "msys" ]
then
gem install scss_lint
else
gem install scss_lint
if [ $? -ne 0 ]
then
echo -e "\033[0;34mInstallation failed, trying to install with sudo\033[0m";
sudo gem install scss_lint
fi
fi
else
echo -e "\n\033[0;31mYou need to have ruby installed on your machine in order for scss-lint to work!\033[0m\n";
fi
else
echo -e "\033[0;32mscss-lint already installed ✓\033[0m\n"
fi
......@@ -74,6 +74,53 @@ function checkJsHint() {
fs.unlink(process.cwd() + '/../.jshintrc', error => console.log);
console.log(chalk.green('Removed .jshintrc ✓'));
}
checkStyleLint();
});
} else {
checkStyleLint();
}
});
}
function checkStyleLint() {
fs.exists(process.cwd() + '/../.stylelintrc', exists => {
if (!exists) {
console.log('');
inquirer.prompt([
{
type: 'confirm',
name: 'provideStyleLint',
message: 'Looks like you don\'t have a Stylelint configuration file, yet. Do you want to include the sgalinski default configuration?'
}
]).then(answers => {
if (answers.provideStyleLint) {
request('https://gitlab.sgalinski.de/snippets/29/raw').pipe(fs.createWriteStream(process.cwd() + '/../.stylelintrc'));
console.log(chalk.green('Add Stylelint configuration ✓'));
}
checkScssLint();
});
} else {
console.log(chalk.green('Stylelint configuration found ✓'));
checkScssLint();
}
});
}
function checkScssLint() {
fs.exists(process.cwd() + '/../.scss-lint.yml', exists => {
if (exists) {
console.log('');
inquirer.prompt([
{
type: 'confirm',
name: 'removeScssLint',
message: 'The SGC does not use scss-lint anymore. Do you want to remove your .scss-lint.yml file?'
}
]).then(answers => {
if (answers.removeScssLint) {
fs.unlink(process.cwd() + '/../.scss-lint.yml', error => console.log);
console.log(chalk.green('Removed .scss-lint.yml ✓'));
}
});
}
});
......
SGC_VERSION=2.1.1
SGC_VERSION=2.2.0
......@@ -11,7 +11,10 @@ let gulp = require('gulp'),
buffer = require('vinyl-buffer'),
merge = require('merge-stream'),
filterPattern = ['*', '!**/*.map.min.css'],
lazypipe = require('lazypipe');
lazypipe = require('lazypipe'),
reporter = require('postcss-reporter'),
stylelint = require('stylelint'),
scss = require("postcss-scss");
function processCss() {
let filter = plugins.filter(filterPattern, {restore: true}),
......@@ -105,13 +108,17 @@ gulp.task('css:abovethefold', function() {
gulp.task('css:qa', function() {
return gulp.src([settings.getPath() + '/' + config.directories.sass + '/**/*.scss', '!**/*scsslint_tmp*.scss'].concat(config.css.excludeFromQa))
.pipe(plugins.scssLint({
customReport: plugins.scssLintStylish,
maxBuffer: 3000 * 1024
}))
.on('error', function(error) {
plugins.util.log(error);
});
.pipe(plugins.postcss(
[
stylelint({
configBasedir: `${process.cwd()}/sgc-core/`
}),
reporter({ clearMessages: true })
],
{
syntax: scss
}
));
});
gulp.task('css', gulp.series(gulp.parallel('css:sprites', 'css:svg', 'css:qa'), processCss, 'css:abovethefold'));
......
......@@ -57,15 +57,11 @@ echo -e "\033[0;32mNode installed ✓\033[0m\n"
# install node deps
echo -e "\033[0;34mInstall dependencies\033[0m";
rm -rf ./node_modules
npm install yarn
npm install yarn@0.24.6
node_modules/yarn/bin/yarn install
echo -e "\033[0;32mDependencies installed ✓\033[0m\n"
echo -e "\033[0;34mInstall ruby dependencies\033[0m";
./core/installers/ruby.sh
echo -e "\033[0;32mDependencies installed ✓\033[0m\n"
# copy config file if no present yet
if [ ! -e ../.sgc-config.json ]
then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment