Skip to content

Commit a04411d

Browse files
committed
Remove use of deprecated APIs.
Move to ES6. Other assorted clean up and formatting.
1 parent c20fc58 commit a04411d

File tree

7 files changed

+170
-124
lines changed

7 files changed

+170
-124
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ npm-debug.log
1010

1111
# grunt-bless files
1212
tmp
13+
lib
14+
tasks

.jshintrc

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@
99
"undef": true,
1010
"boss": true,
1111
"eqnull": true,
12-
"node": true
12+
"node": true,
13+
"smarttabs": true,
14+
"esnext": true
1315
}

.npmignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Node files
2+
node_modules
3+
npm-debug.log
4+
5+
# OSX Files
6+
.DS_Store
7+
8+
# Version control files
9+
*.orig
10+
11+
# grunt-bless files
12+
tmp
13+
src

Gruntfile.js

+53-5
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,49 @@ module.exports = function(grunt) {
1616
jshint: {
1717
all: [
1818
'Gruntfile.js',
19-
'tasks/*.js'
19+
'src/**/*.js'
2020
],
2121
options: {
2222
jshintrc: '.jshintrc'
2323
}
2424
},
2525

26+
babel: {
27+
options: {
28+
'modules': 'commonStrict',
29+
'whitelist': [
30+
'es6.modules',
31+
'es6.arrowFunctions',
32+
//'minification.deadCodeElimination',
33+
//'minification.constantFolding',
34+
'strict'
35+
],
36+
'optional': [
37+
'runtime'
38+
]
39+
},
40+
dist: {
41+
files: [
42+
{
43+
'cwd': 'src/lib/',
44+
'src': '**/*.js',
45+
'dest': 'lib/',
46+
'expand': true,
47+
'filter': 'isFile'
48+
}, {
49+
'cwd': 'src/tasks/',
50+
'src': '**/*.js',
51+
'dest': 'tasks/',
52+
'expand': true,
53+
'filter': 'isFile'
54+
}
55+
]
56+
}
57+
},
58+
2659
// Before generating any new files, remove any previously-created files.
2760
clean: {
28-
tests: ['tmp']
61+
tests: ['tmp', 'tasks', 'lib']
2962
},
3063

3164
// Configuration to be run (and then tested).
@@ -72,6 +105,18 @@ module.exports = function(grunt) {
72105
'test/input/above-limit.css': 'test/input/above-limit.css'
73106
}
74107
}
108+
},
109+
110+
// Configuration for unit tests
111+
mochaTest: {
112+
test: {
113+
options: {
114+
reporter: 'spec'
115+
},
116+
src: [
117+
'test/**/*.js'
118+
]
119+
}
75120
}
76121
});
77122

@@ -81,13 +126,16 @@ module.exports = function(grunt) {
81126
// These plugins provide necessary tasks.
82127
grunt.loadNpmTasks('grunt-contrib-jshint');
83128
grunt.loadNpmTasks('grunt-contrib-clean');
84-
grunt.loadNpmTasks('grunt-contrib-nodeunit');
129+
grunt.loadNpmTasks('grunt-mocha-test');
130+
grunt.loadNpmTasks('grunt-babel');
131+
132+
grunt.registerTask('build', ['babel']);
85133

86134
// Whenever the "test" task is run, first clean the "tmp" dir, then run this
87135
// plugin's task(s), then test the result.
88-
grunt.registerTask('test', ['clean', 'bless:default_options', 'bless:custom_options', 'bless:check']);
136+
grunt.registerTask('test', ['clean', 'build', 'mochaTest', 'bless:default_options', 'bless:custom_options', 'bless:check']);
89137

90138
// By default, lint and run all tests.
91-
grunt.registerTask('default', ['jshint', 'test']);
139+
grunt.registerTask('default', ['clean', 'jshint', 'build']);
92140

93141
};

README.md

+19-8
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,6 @@ Default value: `true`
9797
Enable or disable the use of `@import` in generated CSS files. This feature was
9898
added in bless.js 3.0.3.
9999

100-
#### options.cacheBuster ####
101-
102-
Type: `Boolean`
103-
Default value: `true`
104-
105-
Add or remove a cache-buster parameter from the generated CSS files.
106-
107100
#### options.logCount ####
108101

109102
Type: `Boolean | String`
@@ -118,6 +111,22 @@ Default value: `false`
118111

119112
Requires `logCount`. If set to `true,` the process will exit with an error if the selector limit is exceeded.
120113

114+
### Removed options ###
115+
116+
These options have been removed from `grunt-bless` and no longer function.
117+
118+
#### options.cacheBuster ####
119+
120+
Type: `Boolean`
121+
Default value: `true`
122+
Reason for removal:
123+
- Removed in bless 4.0.0.
124+
- Other plugins may provide better support.
125+
- [See this issue](https://github.com/BlessCSS/bless/issues/57)
126+
127+
Add or remove a cache-buster parameter from the generated CSS files.
128+
129+
121130
### Usage Examples ###
122131

123132
#### Default Options ####
@@ -188,7 +197,9 @@ Release History
188197
- Update to bless 4.0.0
189198
- **Next**
190199
- Clean up the NPM package, thanks @mimiflynn
191-
- other assorted clean up and formatting.
200+
- Remove use of deprecated APIs.
201+
- Move to ES6.
202+
- Other assorted clean up and formatting.
192203
- **0.2.0**
193204
- Updated documentation to note the newness of the not yet released to npm `imports` option, thanks @spoike
194205
- Added a banner option to avoid banners getting misplaced in the blessing process, thanks @jelmerdemaat

package.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,17 @@
3434
"test": "grunt test"
3535
},
3636
"dependencies": {
37+
"async": "^1.5.0",
3738
"bless": "~4.0.0-alpha",
38-
"chalk": "~0.5.1"
39+
"chalk": "~1.1.0"
3940
},
4041
"devDependencies": {
41-
"grunt-contrib-jshint": "~0.1.1",
42-
"grunt-contrib-clean": "~0.4.0",
43-
"grunt": "~0.4.1"
42+
"grunt": "~0.4.1",
43+
"grunt-babel": "^5.0.1",
44+
"grunt-contrib-clean": "~0.6.0",
45+
"grunt-contrib-jshint": "~0.11.0",
46+
"grunt-mocha-test": "^0.12.7",
47+
"mocha": "^2.3.4"
4448
},
4549
"peerDependencies": {
4650
"grunt": "~0.4.1"

0 commit comments

Comments
 (0)