From e258d894fcfd08dde36283091bd728043a108c55 Mon Sep 17 00:00:00 2001 From: Daniel Bannert Date: Mon, 20 Jul 2015 00:12:58 +0200 Subject: [PATCH 1/8] remove jit-grunt --- package.json | 4 ++-- tasks/sass_import.js | 16 ---------------- 2 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 tasks/sass_import.js diff --git a/package.json b/package.json index 9d358ad..c7182b5 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,8 @@ "grunt-newer": "^1.1.1", "grunt-sass-import": "^0.1.0", "grunt-scss-lint": "^0.3.6", - "jit-grunt": "^0.9.1", - "load-grunt-config": "^0.17.1", + "load-grunt-config": "^0.17.2", + "load-grunt-tasks": "^3.2.0", "sass-true": "^2.0.2", "time-grunt": "^1.2.1" }, diff --git a/tasks/sass_import.js b/tasks/sass_import.js deleted file mode 100644 index 9f28771..0000000 --- a/tasks/sass_import.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; -//sass_import config - -module.exports = { - dev: { - options: { - basePath: '' - }, - files: { - 'tests/specs/include.scss': [ - 'src/scss/utils/*', - 'tests/specs/scss/*' - ] - } - }, -}; From 5242e964516129426327ea4185d85d0518764fde Mon Sep 17 00:00:00 2001 From: anolilab Date: Mon, 20 Jul 2015 17:27:24 +0200 Subject: [PATCH 2/8] fix twitter link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4405fcb..3a2992b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # sass-config-manager -[![Author](http://img.shields.io/badge/author-@@anolilab-blue.svg?style=flat-square)](https://twitter.com/@anolilab) +[![Author](http://img.shields.io/badge/author-@anolilab-blue.svg?style=flat-square)](https://twitter.com/anolilab) [![devDependency Status](https://david-dm.org/growcss/sass-config-manager/dev-status.svg?style=flat-square)](https://david-dm.org/growcss/sass-config-manager#info=devDependencies) [![npm](https://img.shields.io/npm/v/growcss-sass-config-manager.svg?style=flat-square)](https://www.npmjs.com/package/growcss-sass-config-manager) [![Bower](https://img.shields.io/bower/v/sass-config-manager.svg?style=flat-square)](https://github.com/growcss/sass-config-manager) From 68e7cd89d07cedc6faaa5b98ba061b9f8843a2c4 Mon Sep 17 00:00:00 2001 From: Daniel Bannert Date: Wed, 22 Jul 2015 21:32:17 +0200 Subject: [PATCH 3/8] Added UTF-8 to all files, update some docs --- src/scss/config-manager.scss | 6 ++++++ src/scss/functions/_config-get.scss | 2 ++ src/scss/functions/_config-has.scss | 2 ++ src/scss/functions/_config-set.scss | 2 ++ src/scss/functions/_functions.scss | 4 ++++ src/scss/helpers/_helpers.scss | 4 ++++ src/scss/helpers/_list.scss | 2 ++ src/scss/helpers/_map.scss | 2 ++ src/scss/helpers/_str.scss | 2 ++ src/scss/utils/_mixins.scss | 1 + src/scss/utils/_variables.scss | 1 + 11 files changed, 28 insertions(+) diff --git a/src/scss/config-manager.scss b/src/scss/config-manager.scss index ce4c84b..2055e89 100644 --- a/src/scss/config-manager.scss +++ b/src/scss/config-manager.scss @@ -1,4 +1,10 @@ +@charset "UTF-8"; +// sass-config-manager by Anolilab +// http://growcss.com +// Licensed under MIT Open Source +// // Here are all the functions, helpers, mixins and variables. +// - - - - - - - - - - - - - - - - - - - - - - - - - @import "utils/variables"; @import "helpers/helpers"; diff --git a/src/scss/functions/_config-get.scss b/src/scss/functions/_config-get.scss index 96b884e..5b32a94 100644 --- a/src/scss/functions/_config-get.scss +++ b/src/scss/functions/_config-get.scss @@ -1,3 +1,5 @@ +@charset "UTF-8"; + // Gets a value to/from a configuration path // // @function config-get diff --git a/src/scss/functions/_config-has.scss b/src/scss/functions/_config-has.scss index 5bec3a7..a33e7fd 100644 --- a/src/scss/functions/_config-has.scss +++ b/src/scss/functions/_config-has.scss @@ -1,3 +1,5 @@ +@charset "UTF-8"; + // Returns whether a configuration path exists // // @function config-has diff --git a/src/scss/functions/_config-set.scss b/src/scss/functions/_config-set.scss index f16d385..08ee11e 100644 --- a/src/scss/functions/_config-set.scss +++ b/src/scss/functions/_config-set.scss @@ -1,3 +1,5 @@ +@charset "UTF-8"; + // Sets a value to/from a configuration path // // @function config diff --git a/src/scss/functions/_functions.scss b/src/scss/functions/_functions.scss index 5c8c656..3f94e91 100644 --- a/src/scss/functions/_functions.scss +++ b/src/scss/functions/_functions.scss @@ -1,3 +1,7 @@ +@charset "UTF-8"; + +// Here are all the functions. +// - - - - - - - - - - - - - - - - - - - - - - - - - @import "config-set"; @import "config-get"; @import "config-has"; diff --git a/src/scss/helpers/_helpers.scss b/src/scss/helpers/_helpers.scss index 392ac9d..cb5561a 100644 --- a/src/scss/helpers/_helpers.scss +++ b/src/scss/helpers/_helpers.scss @@ -1,3 +1,7 @@ +@charset "UTF-8"; + +// Here are all the helpers. +// - - - - - - - - - - - - - - - - - - - - - - - - - @import "list"; @import "str"; @import "map"; diff --git a/src/scss/helpers/_list.scss b/src/scss/helpers/_list.scss index 63696b0..8716264 100644 --- a/src/scss/helpers/_list.scss +++ b/src/scss/helpers/_list.scss @@ -1,3 +1,5 @@ +@charset "UTF-8"; + // Return list-map from `$list` and ensure input list-map is list-of-lists // // @function list-map-check diff --git a/src/scss/helpers/_map.scss b/src/scss/helpers/_map.scss index c24a748..fc5a090 100644 --- a/src/scss/helpers/_map.scss +++ b/src/scss/helpers/_map.scss @@ -1,3 +1,5 @@ +@charset "UTF-8"; + // Sets a value to a Map by the map path // // @function config-map-set diff --git a/src/scss/helpers/_str.scss b/src/scss/helpers/_str.scss index f584981..a1a7d2c 100644 --- a/src/scss/helpers/_str.scss +++ b/src/scss/helpers/_str.scss @@ -1,3 +1,5 @@ +@charset "UTF-8"; + // Joins list elements with a string // // @function str-join diff --git a/src/scss/utils/_mixins.scss b/src/scss/utils/_mixins.scss index 42f64c3..507c7d4 100644 --- a/src/scss/utils/_mixins.scss +++ b/src/scss/utils/_mixins.scss @@ -1,3 +1,4 @@ +@charset "UTF-8"; // Sass Mixins // - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/scss/utils/_variables.scss b/src/scss/utils/_variables.scss index edab3c3..ea94667 100644 --- a/src/scss/utils/_variables.scss +++ b/src/scss/utils/_variables.scss @@ -1,3 +1,4 @@ +@charset "UTF-8"; // Sass Variables // - - - - - - - - - - - - - - - - - - - - - - - - - From 5d4da6bb2d7fb02b3ce49531c5416efb52f9b9b7 Mon Sep 17 00:00:00 2001 From: anolilab Date: Mon, 27 Jul 2015 15:21:55 +0200 Subject: [PATCH 4/8] Added UTF-8 charset to config, added config-reset --- src/scss/config-manager.scss | 1 + src/scss/functions/_config-reset.scss | 25 +++++++++++++++++++++++++ src/scss/functions/_functions.scss | 1 + src/scss/utils/_mixins.scss | 15 ++++++++++++++- src/scss/utils/_variables.scss | 1 + tests/specs/scss/functions.scss | 17 ++++++++++++++--- 6 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 src/scss/functions/_config-reset.scss diff --git a/src/scss/config-manager.scss b/src/scss/config-manager.scss index 2055e89..a995867 100644 --- a/src/scss/config-manager.scss +++ b/src/scss/config-manager.scss @@ -1,4 +1,5 @@ @charset "UTF-8"; + // sass-config-manager by Anolilab // http://growcss.com // Licensed under MIT Open Source diff --git a/src/scss/functions/_config-reset.scss b/src/scss/functions/_config-reset.scss new file mode 100644 index 0000000..4c08544 --- /dev/null +++ b/src/scss/functions/_config-reset.scss @@ -0,0 +1,25 @@ +@charset "UTF-8"; + +// Remove settings +// +// @function config-reset +// +// @param $settings {string} Configuration path +// @param $default {bool} Whether the configuration is default +// +// @return {bool} True if the configuration path is removed. +@function config-reset($settings, $default: false) { + @if length($settings) == 1 { + $settings: nth($settings, 1); + } + + @each $setting in $settings { + @if ($default) { + $config-default: map-remove($config-default, $setting) !global; + } @else { + $config-attr: map-remove($config-attr, $setting) !global; + } + } + + @return true; +} diff --git a/src/scss/functions/_functions.scss b/src/scss/functions/_functions.scss index 3f94e91..8ab1b7b 100644 --- a/src/scss/functions/_functions.scss +++ b/src/scss/functions/_functions.scss @@ -5,3 +5,4 @@ @import "config-set"; @import "config-get"; @import "config-has"; +@import "config-reset"; diff --git a/src/scss/utils/_mixins.scss b/src/scss/utils/_mixins.scss index 507c7d4..a688a1b 100644 --- a/src/scss/utils/_mixins.scss +++ b/src/scss/utils/_mixins.scss @@ -1,4 +1,5 @@ @charset "UTF-8"; + // Sass Mixins // - - - - - - - - - - - - - - - - - - - - - - - - - @@ -6,9 +7,21 @@ // // @mixin config-set // -// @param $key {string} The configuration key +// @param $key {string} The configuration key // @param $value {*|null} The value to set // @param $default {bool} Whether the configuration is default @mixin config-set($key, $value, $default: false) { $config: config-set($key, $value, $default); } + +// Remove settings +// +// @mixin config-reset +// +// @param $settings {string} Configuration path +// @param $default {bool} Whether the configuration is default +// +// @return {bool} True if the configuration path is removed. +@mixin config-reset($settings, $default:false) { + $config-reset: config-reset($settings); +} diff --git a/src/scss/utils/_variables.scss b/src/scss/utils/_variables.scss index ea94667..7b4e77e 100644 --- a/src/scss/utils/_variables.scss +++ b/src/scss/utils/_variables.scss @@ -1,4 +1,5 @@ @charset "UTF-8"; + // Sass Variables // - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/specs/scss/functions.scss b/tests/specs/scss/functions.scss index efae279..33aa2d4 100644 --- a/tests/specs/scss/functions.scss +++ b/tests/specs/scss/functions.scss @@ -74,8 +74,6 @@ $expect: ("bar": "foo", "color": #000); @include assert-equal($get, $expect, "Returns test map."); - - $config-attr: (); } // Testing get functions @@ -96,6 +94,19 @@ $get: config-has("test-not-found"); $expect: false; - @include assert-equal($get, $expect, "Returns true."); + @include assert-equal($get, $expect, "Returns false."); + } + + // Testing set functions + @include test("config-reset [function] Remove config map.") { + @include config-set("remove.bar", "foo"); + @include config-set("remove.color", #fff); + + @include config-reset("remove"); + + $expect: null; + $get: config-get("remove"); + + @include assert-equal($get, $expect, "Check if config map is removed."); } } From 77925567c4196b6182738d58f3994bfd78048602 Mon Sep 17 00:00:00 2001 From: anolilab Date: Mon, 27 Jul 2015 15:29:20 +0200 Subject: [PATCH 5/8] fix grunt --- Gruntfile.js | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 843de82..9b0781f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -7,39 +7,13 @@ module.exports = function(grunt) { // measures the time each task takes require('time-grunt')(grunt); - require('jit-grunt')(grunt, { - scsslint: 'grunt-scss-lint', - mochacli: 'grunt-mocha-cli' - }); - // load grunt config require('load-grunt-config')(grunt, { // path to task.js files, defaults to grunt dir - configPath: [ - path.join(process.cwd(), 'tasks'), - ], - - // There are certain scenarios where you might have a base config for your team, - // and you want to be able to override some of the config based on your personal setup. - //overridePath: [], + configPath: path.join(process.cwd(), 'tasks'), // auto grunt.initConfig init: true, - - // data passed into config. Can use with <%= test %> - //data: {}, - - // can optionally pass options to load-grunt-tasks. - // If you set to false, it will disable auto loading tasks. - jitGrunt: { - customTasksDir: 'tasks' - }, - - //can post process config object before it gets passed to grunt - //postProcess: function() {}, - - //allows to manipulate the config object before it gets merged with the data object - //preMerge: function() {} }); }; From 1fa84d8982dfb07d92e28684d2ba7808b1677db7 Mon Sep 17 00:00:00 2001 From: anolilab Date: Mon, 27 Jul 2015 15:31:06 +0200 Subject: [PATCH 6/8] change on package.json --- package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c7182b5..1ad066f 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,6 @@ "node": ">= 0.10.0" }, "devDependencies": { - "bower": "~1.4.1", - "grunt": "^0.4.5", "grunt-bump": "^0.3.1", "grunt-cli": "^0.1.13", "grunt-contrib-watch": "^0.6.1", @@ -41,7 +39,8 @@ "time-grunt": "^1.2.1" }, "peerDependencies": { - "grunt": ">=0.4.5" + "grunt": "^0.4.5", + "bower": "~1.4.1" }, "keywords": [ "grunt", From 946ae90d93f8df9faf47dfcc14089523cc01ead3 Mon Sep 17 00:00:00 2001 From: anolilab Date: Mon, 27 Jul 2015 15:33:01 +0200 Subject: [PATCH 7/8] remove preD... --- package.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 1ad066f..63c0ceb 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,8 @@ "node": ">= 0.10.0" }, "devDependencies": { + "bower": "~1.4.1", + "grunt": "^0.4.5", "grunt-bump": "^0.3.1", "grunt-cli": "^0.1.13", "grunt-contrib-watch": "^0.6.1", @@ -38,10 +40,6 @@ "sass-true": "^2.0.2", "time-grunt": "^1.2.1" }, - "peerDependencies": { - "grunt": "^0.4.5", - "bower": "~1.4.1" - }, "keywords": [ "grunt", "bower", From b3c1ff6b08f64e119e29d153190817022a4fa2e8 Mon Sep 17 00:00:00 2001 From: anolilab Date: Mon, 27 Jul 2015 15:36:50 +0200 Subject: [PATCH 8/8] Release v2.0.7 --- bower.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 79d744f..051c96a 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "growcss-sass-config-manager", - "version": "2.0.6", + "version": "2.0.7", "homepage": "http://growcss.com/", "authors": [ "Daniel Bannert " diff --git a/package.json b/package.json index 63c0ceb..8556a43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "growcss-sass-config-manager", - "version": "2.0.6", + "version": "2.0.7", "description": "A dot-syntax configuration (Map) library for Sass (mixin / function).", "author": { "name": "Daniel Bannert",