Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Remove LESS #303

Merged
merged 14 commits into from
Feb 5, 2016
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions .lesshintrc

This file was deleted.

16 changes: 0 additions & 16 deletions gulp/ComponentSamples.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,6 @@ gulp.task('ComponentSamples-moveJS', function() {
.pipe(gulp.dest(Config.paths.distSamples + '/Components'));
});

// Style Linting
// ----------------------------------------------------------------------------

gulp.task('ComponentSamples-styleHinting', function() {
if (!Config.buildSass) {
return gulp.src(Config.paths.componentsPath + '/**/*.less')
.pipe(Plugins.gulpif(Config.debugMode, Plugins.debug({
title: "Checking LESS Compile errors and linting"
})))
.pipe(Plugins.lesshint({
configPath: './.lesshintrc'
}))
.pipe(ErrorHandling.LESSHintErrors());
}
});

//
// Styles tasks
Expand Down Expand Up @@ -182,7 +167,6 @@ var ComponentSamplesTasks = [
'ComponentSamples-build',
'ComponentSamples-copyAssets',
'ComponentSamples-buildStyles',
'ComponentSamples-styleHinting',
'ComponentSamples-moveJS',
'ComponentSamples-copyIgnoredFiles'
];
Expand Down
12 changes: 0 additions & 12 deletions gulp/ConfigureEnvironment.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ var BuildConfig = require('./modules/BuildConfig');
var Plugins = require('./modules/Plugins');
var ErrorHandling = require('./modules/ErrorHandling');


gulp.task('ConfigureEnvironment-setLessMode', function() {
Config.buildSass = false;
BuildConfig.template = 'component-manifest-template.less';
BuildConfig.srcPath = Config.paths.srcLess;
BuildConfig.processorPlugin = Plugins.less;
BuildConfig.fileExtension = Config.lessExtension;
BuildConfig.compileErrorHandler = ErrorHandling.LESSCompileErrors;
BuildConfig.processorName = "less";
return;
});

gulp.task('ConfigureEnvironment-setSassMode', function() {
Config.buildSass = true;
BuildConfig.template = 'component-manifest-template.scss';
Expand Down
46 changes: 10 additions & 36 deletions gulp/FabricBuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,59 +15,33 @@ var Plugins = require('./modules/Plugins');

// Clean out the distribution folder.
gulp.task('Fabric-nuke', function () {
return Plugins.del.sync([Config.paths.distLess, Config.paths.distCSS, Config.paths.distSass]);
});

//
// Style Linting
// ---------------------------------------------------------------------------
gulp.task('Fabric-styleHinting', function() {
if (!Config.buildSass) {
return gulp.src(Config.paths.srcLess + '/Fabric.less')
.pipe(Plugins.gulpif(Config.debugMode, Plugins.debug({
title: "Checking LESS Compile errors and linting"
})))
.pipe(Plugins.lesshint({
configPath: './.lesshintrc'
}))
.pipe(ErrorHandling.LESSHintErrors());

}
return Plugins.del.sync([Config.paths.distCSS, Config.paths.distSass]);
});


//
// Copying Files Tasks
// ----------------------------------------------------------------------------

// Copy all LESS files to distribution folder.
gulp.task('Fabric-copyAssets', function () {
// Copy LESS files.
var moveLess = gulp.src([Config.paths.srcLess + '/**/*'])
.pipe(Plugins.plumber(ErrorHandling.onErrorInPipe))
.pipe(Plugins.changed(Config.paths.distLess))
.pipe(Plugins.gulpif(Config.debugMode, Plugins.debug({
title: "Moving LESS Assets over to Dist"
})))
.pipe(gulp.dest(Config.paths.distLess));

// Copy all Sass files to distribution folder.
gulp.task('Fabric-copyAssets', function () {
var moveSass = gulp.src([Config.paths.srcSass + '/**/*'])
.pipe(Plugins.plumber(ErrorHandling.onErrorInPipe))
.pipe(Plugins.changed(Config.paths.distSass))
.pipe(Plugins.gulpif(Config.debugMode, Plugins.debug({
title: "Moving SASS files over to Dist"
title: "Moving Sass files over to Dist"
})))
.pipe(gulp.dest(Config.paths.distSass));
return Plugins.mergeStream(moveLess, moveSass);
return moveSass;
});

//
// LESS tasks
// Sass tasks
// ----------------------------------------------------------------------------

// Build LESS files for core Fabric into LTR and RTL CSS files.
// Build Sass files for core Fabric into LTR and RTL CSS files.

gulp.task('Fabric-buildStyles', ['Fabric-styleHinting'], function () {
gulp.task('Fabric-buildStyles', function () {
var fabric = gulp.src(BuildConfig.srcPath + '/' + 'Fabric.' + BuildConfig.fileExtension)
.pipe(Plugins.plumber(ErrorHandling.onErrorInPipe))
.pipe(Plugins.gulpif(Config.debugMode, Plugins.debug({
Expand Down Expand Up @@ -117,7 +91,7 @@ gulp.task('Fabric-buildStyles', ['Fabric-styleHinting'], function () {
// Rolled up Build tasks
// ----------------------------------------------------------------------------

gulp.task('Fabric', ['Fabric-copyAssets', 'Fabric-styleHinting', 'Fabric-buildStyles']);
gulp.task('Fabric', ['Fabric-copyAssets', 'Fabric-buildStyles']);

//
// Fabric Messages
Expand All @@ -137,7 +111,7 @@ gulp.task('Fabric-updated', ['Fabric'], function () {

// Watch and build Fabric when sources change.
gulp.task('Fabric-watch', ['Fabric', 'Fabric-finished'], function () {
return gulp.watch(Config.paths.lessPath + '/**/*', Plugins.batch(function (events, done) {
return gulp.watch(Config.paths.sassPath + '/**/*', Plugins.batch(function (events, done) {
Plugins.runSequence('Fabric', 'Fabric-updated', done);
}));
});
4 changes: 2 additions & 2 deletions gulp/FabricComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ gulp.task('FabricComponents-moveJs', function () {
});

//
// LESS tasks
// Sass tasks
// ----------------------------------------------------------------------------

// Build Components LESS files
// Build Components Sass files
gulp.task('FabricComponents-buildAndCombineStyles', function () {
var stream = gulp.src(BuildConfig.srcPath + '/Fabric.Components.' + BuildConfig.fileExtension)
.pipe(Plugins.plumber())
Expand Down
72 changes: 0 additions & 72 deletions gulp/SassConversion.js

This file was deleted.

2 changes: 1 addition & 1 deletion gulp/modules/ComponentHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var ComponentSamplesHelper = function() {
* @param {string} destFolder Contains the path to the destination folder.
* @param {string} srcTemplate Contains the path to the source template to be applied.
* @param {string} componentName Name of the component.
* @param {string} deps LESS Dependencies to be added to the styles.
* @param {string} deps Sass Dependencies to be added to the styles.
* @param {function} cssPlugin The gulp plugin or function used for the specific css preprocessor
* @return {stream} returns a stream.
*/
Expand Down
6 changes: 1 addition & 5 deletions gulp/modules/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ var pkg = require('../../package.json');
*/
var Config = function() {
this.debugMode = false;
this.lessExtension = "less";
this.sassExtension = "scss";
this.buildSass = false;
this.copyRightMessage = "Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information.";
var distPath = 'dist';
var srcPath = 'src';
this.paths = {
distComponents: distPath + '/components',
distLess: distPath + '/less',
distSass: distPath + '/sass',
distCSS: distPath + '/css',
distSamples: distPath + '/samples',
Expand All @@ -25,7 +23,6 @@ var Config = function() {
srcSamples: srcPath + '/samples',
srcSass: srcPath + '/sass',
componentsPath : 'src/components',
srcLess: srcPath + '/less',
templatePath : srcPath + '/templates'
};
this.port = process.env.PORT || 2020;
Expand Down Expand Up @@ -57,8 +54,7 @@ var Config = function() {
{src: this.paths.distComponents, dest: "/content/components/"},
{src: this.paths.distCSS, dest: "/content/css/"},
{src: this.paths.distJS, dest: "/content/scripts/"},
{src: this.paths.distLess, dest: "/content/less/"},
{src: this.paths.distSass, dest: "/content/sass/"}
{src: this.paths.distSass, dest: "/content/sass/"}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpick, but mind the indentation--looks like a spaces/tabs diff issue

];
this.componentSamplesUpdate = "Components Samples updated successfully! Yay!";
this.componentSamplesFinished = ' Component Samples build was successful! Yay!';
Expand Down
51 changes: 1 addition & 50 deletions gulp/modules/ErrorHandling.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ var ErrorHandling = function() {
switch(error.plugin) {
case 'gulp-autoprefixer':
break;
case 'gulp-less':
break;
case 'gulp-sass':
break;
default:
Expand Down Expand Up @@ -186,54 +184,7 @@ var ErrorHandling = function() {
});
};
/**
* LESSHint error handler
* @param {object} file Data containing file information
* @param {function} cb Callback data with error or no arguments
*/
this.LESSHintErrors = function(file, cb) {
return map(function (file, cb) {

if (!file.lesshint.success) {
file.lesshint.results.forEach(function (err) {
if (err) {
var errorString = that.createLineErrorMessage(
gulputil.colors.yellow(err.severity) + ' ' + err.message,
err.file,
err.line,
err.source,
'NA',
''
);
if (err.severity == "warning") {
gulputil.log(errorString);
that.addWarning(errorString);
} else {
that.generatePluginError('lessHint', errorString);
}
}
});
}
return cb(null, file);
});
};
/**
* Less Compiler error handler
* @param {object} error An object containing the error data.
*/
this.LESSCompileErrors = function(error) {
var errorString = that.createLineErrorMessage(
error.filename,
error.line,
error.column,
'No Code',
error.message
);
that.generatePluginError('Less compiler', errorString);
console.log(error);
this.emit('end');
}
/**
* Less Compiler error handler
* Sass Compiler error handler
* @param {object} error An object containing the error data.
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above: even if we aren't adding SASS linting here, it's super important that we do add it shortly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding it back right now

this.SASSCompileErrors = function(error) {
Expand Down
Loading