Skip to content
This repository was archived by the owner on Jul 11, 2024. It is now read-only.

Commit 54582f3

Browse files
committed
New build workflow
1 parent c450754 commit 54582f3

15 files changed

Lines changed: 952 additions & 830 deletions

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
bower_components
2-
node_modules
1+
/.idea
2+
/*.iml
3+
/.sass-cache
4+
/bower_components
5+
/node_modules
6+
/npm-debug.log

.jshintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"-W055": true // non standard constructor name
3+
}

.scss-lint.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
linters:
2+
ColorVariable:
3+
enabled: false
4+
5+
HexLength:
6+
enabled: false

Gruntfile.js

Lines changed: 137 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,85 @@
1+
'use strict';
2+
13
module.exports = function(grunt) {
4+
require('time-grunt')(grunt);
5+
require('jit-grunt')(grunt, {
6+
scsslint: 'grunt-scss-lint'
7+
});
8+
29
grunt.initConfig({
310
pkg: grunt.file.readJSON('package.json'),
411

5-
banner:
6-
'/*!\n'+
7-
' * jQCloud <%= pkg.version %>\n'+
8-
' * Copyright 2011 Luca Ongaro (http://www.lucaongaro.eu)\n'+
9-
' * Copyright 2013 Daniel White (http://www.developerdan.com)\n'+
10-
' * Copyright 2014<%= grunt.template.today("yyyy") %> Damien "Mistic" Sorel (http://www.strangeplanet.fr)\n'+
11-
' * Licensed under MIT (http://opensource.org/licenses/MIT)\n'+
12-
' */',
13-
14-
// copy src
12+
banner: '/*!\n' +
13+
' * jQCloud <%= pkg.version %>\n' +
14+
' * Copyright 2011 Luca Ongaro (http://www.lucaongaro.eu)\n' +
15+
' * Copyright 2013 Daniel White (http://www.developerdan.com)\n' +
16+
' * Copyright 2014-<%= grunt.template.today("yyyy") %> Damien "Mistic" Sorel (http://www.strangeplanet.fr)\n' +
17+
' * Licensed under MIT (http://opensource.org/licenses/MIT)\n' +
18+
' */',
19+
20+
// serve folder content
21+
connect: {
22+
dev: {
23+
options: {
24+
port: 9000,
25+
livereload: true
26+
}
27+
}
28+
},
29+
30+
// watchers
31+
watch: {
32+
options: {
33+
livereload: true
34+
},
35+
js: {
36+
files: ['src/*.js'],
37+
tasks: ['build_js']
38+
},
39+
css: {
40+
files: ['src/*.scss'],
41+
tasks: ['build_css']
42+
},
43+
example: {
44+
files: ['example/**', 'test/**'],
45+
tasks: []
46+
}
47+
},
48+
49+
// open example
50+
open: {
51+
dev: {
52+
path: 'http://localhost:<%= connect.dev.options.port%>/example/index.html'
53+
}
54+
},
55+
56+
// add UMD
57+
wrap: {
58+
js: {
59+
src: 'src/jqcloud.js',
60+
dest: 'dist/jqcloud.js',
61+
options: {
62+
separator: '',
63+
wrapper: function() {
64+
return grunt.file.read('src/.wrapper.js').replace(/\r\n/g, '\n').split(/@@js\n/);
65+
}
66+
}
67+
}
68+
},
69+
70+
// add banner
1571
concat: {
1672
options: {
1773
banner: '<%= banner %>\n',
18-
stripBanners: {
19-
block: true
20-
}
74+
stripBanners: false
2175
},
22-
src: {
23-
files: {
24-
'dist/jqcloud.css': [
25-
'src/jqcloud.css'
26-
],
27-
'dist/jqcloud.js': [
28-
'src/jqcloud.js'
29-
]
30-
}
76+
js: {
77+
src: 'dist/jqcloud.js',
78+
dest: 'dist/jqcloud.js'
79+
},
80+
css: {
81+
src: 'dist/jqcloud.css',
82+
dest: 'dist/jqcloud.css'
3183
}
3284
},
3385

@@ -37,11 +89,20 @@ module.exports = function(grunt) {
3789
banner: '<%= banner %>\n'
3890
},
3991
dist: {
40-
files: {
41-
'dist/jqcloud.min.js': [
42-
'dist/jqcloud.js'
43-
]
44-
}
92+
src: 'dist/jqcloud.js',
93+
dest: 'dist/jqcloud.min.js'
94+
}
95+
},
96+
97+
// parse scss
98+
sass: {
99+
options: {
100+
sourcemap: 'none',
101+
style: 'expanded'
102+
},
103+
dist: {
104+
src: 'src/jqcloud.scss',
105+
dest: 'dist/jqcloud.css'
45106
}
46107
},
47108

@@ -52,45 +113,71 @@ module.exports = function(grunt) {
52113
keepSpecialComments: 0
53114
},
54115
dist: {
55-
files: {
56-
'dist/jqcloud.min.css': [
57-
'dist/jqcloud.css'
58-
]
59-
}
116+
src: 'dist/jqcloud.css',
117+
dest: 'dist/jqcloud.min.css'
60118
}
61119
},
62120

63121
// jshint tests
64122
jshint: {
65123
lib: {
66-
files: {
67-
src: [
68-
'src/jqcloud.js'
69-
]
70-
}
124+
options: {
125+
jshintrc: '.jshintrc'
126+
},
127+
src: 'src/jqcloud.js'
128+
}
129+
},
130+
131+
// scss tests
132+
scsslint: {
133+
lib: {
134+
options: {
135+
config: '.scss-lint.yml'
136+
},
137+
src: 'src/jqcloud.scss'
71138
}
72139
},
73-
140+
74141
// qunit test suite
75142
qunit: {
76-
all: ['test/*.html']
143+
all: {
144+
options: {
145+
urls: ['test/index.html'],
146+
noGlobals: true
147+
}
148+
}
77149
}
78150
});
79151

80-
grunt.loadNpmTasks('grunt-contrib-uglify');
81-
grunt.loadNpmTasks('grunt-contrib-concat');
82-
grunt.loadNpmTasks('grunt-contrib-cssmin');
83-
grunt.loadNpmTasks('grunt-contrib-qunit');
84-
grunt.loadNpmTasks('grunt-contrib-jshint');
85152

86-
grunt.registerTask('default', [
87-
'concat',
88-
'uglify',
153+
grunt.registerTask('build_js', [
154+
'wrap',
155+
'concat:js',
156+
'uglify'
157+
]);
158+
159+
grunt.registerTask('build_css', [
160+
'sass',
161+
'concat:css',
89162
'cssmin'
90163
]);
91-
164+
165+
grunt.registerTask('default', [
166+
'build_js',
167+
'build_css'
168+
]);
169+
92170
grunt.registerTask('test', [
93-
'qunit',
94-
'jshint'
171+
'jshint',
172+
'scsslint',
173+
'default',
174+
'qunit'
175+
]);
176+
177+
grunt.registerTask('serve', [
178+
'default',
179+
'open',
180+
'connect',
181+
'watch'
95182
]);
96183
};

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ The MIT License (MIT)
22

33
Copyright (c) 2011 Luca Ongaro
44
Copyright (c) 2013 Daniel White
5-
Copyright (c) 2014 Damien Sorel
5+
Copyright (c) 2014-2016 Damien Sorel
66

77
Permission is hereby granted, free of charge, to any person obtaining
88
a copy of this software and associated documentation files (the

README.md

Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# jQCloud
22

3-
[![Bower version](https://badge.fury.io/bo/jqcloud2.svg)](http://badge.fury.io/bo/jqcloud2)
3+
[![Bower version](https://img.shields.io/bower/v/jqcloud2.svg?style=flat-square)](http://mistic100.github.io/jQCloud)
4+
[![NPM version](https://img.shields.io/npm/v/jqcloud2.svg?style=flat-square)](https://www.npmjs.com/package/jqcloud2)
45

56
## Beautiful word clouds with jQuery
67

@@ -12,60 +13,5 @@ Also available as [AngularJS directive](https://github.com/mistic100/angular-jqc
1213

1314
http://mistic100.github.io/jQCloud
1415

15-
## Changelog
16-
17-
2.0.0
18-
- Migrate to Grunt builder
19-
- New documentation
20-
- Big performances improvement (thanks to [saravanan4514](https://github.com/saravanan4514))
21-
- `delayedDraw` option replaced by `delay`
22-
- `center` now takes relative float values and not absolute integers
23-
- add `steps`, `autoResize`, `classPattern`, `colors` and `fontSize` options
24-
25-
1.0.5 Added the capability to update dynamically the cloud, as well as an example (thanks to [acjzz](https://github.com/acjzz))
26-
27-
1.0.4 Add option to remove overflowing words (thanks to [drewB](https://github.com/drewB))
28-
29-
1.0.3 Fix bug when providing a context to jQuery
30-
31-
1.0.2 Relative font sizes and easier to customize CSS (kudos to [daniel-toman](https://github.com/daniel-toman))
32-
33-
1.0.1 Option to turn off URL encoding for links (thanks to [bboughton](https://github.com/bboughton))
34-
35-
1.0.0 API redesign (warning: this is a major update, and background compatibility is not maintained)
36-
37-
0.2.10 Fix bug occurring when the container element has no id
38-
39-
0.2.9 Add dataAttributes option (thanks again to [cham](https://github.com/cham)) and fix bug when weights are all equal (thanks to [Grepsy](https://github.com/Grepsy))
40-
41-
0.2.8 Add possibility to specify custom classes for words with the custom_class attribute (thanks to [cham](https://github.com/cham))
42-
43-
0.2.7 Add possibility to draw rectangular-shaped clouds (an idea by [nithin2e](https://github.com/nithin2e))
44-
45-
0.2.6 Fix bug with handlers, add nofollow option (thanks to [strobotta](https://github.com/strobotta)) and word callbacks.
46-
47-
0.2.5 Add possibility to bind event handlers to words (thanks to [astintzing](https://github.com/astintzing))
48-
49-
0.2.4 Option randomClasses can be an array of classes among which a random class is selected for each word
50-
51-
0.2.3 Add option randomClasses, allowing for random CSS styling (inspired by issue about vertical words opened by [tttp](https://github.com/tttp))
52-
53-
0.2.2 CSS improvements (as suggested by [NomikOS](https://github.com/NomikOS))
54-
55-
0.2.1 Optimization and performance improvements (making 0.2.1 around 25% faster than 0.2.0)
56-
57-
0.2.0 Add configuration options, passed as the second argument of jQCloud (include ideas proposed by [mindscratch](https://github.com/mindscratch) and [aaaa0441](https://github.com/aaaa0441))
58-
59-
0.1.8 Fix bug in the algorithm causing sometimes unbalanced layouts (thanks to [isamochernov](https://github.com/isamochernov))
60-
61-
0.1.7 Remove duplicated `</span>` when word has an URL (thanks to [rbrancher](https://github.com/rbrancher))
62-
63-
0.1.6 JavaScript-friendly URL encode 'url' option; Typecast 'weight' option to float (thanks to [nudesign](https://github.com/nudesign))
64-
65-
0.1.5 Apply CSS style to a "jqcloud" class, automatically added (previously an id was used. Again, thanks to [seanahrens](https://github.com/seanahrens))
66-
67-
0.1.4 Fix bug with multiple clouds on the same page (kudos to [seanahrens](https://github.com/seanahrens))
68-
69-
0.1.3 Added possibility to pass a callback function and to specify a custom HTML title attribute for each word in the cloud
70-
71-
0.1.0 -> 0.1.2 I just started this tiny project, only minor improvements and optimization happened
16+
## License
17+
This library is available under the MIT license.

bower.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jqcloud2",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"homepage": "https://github.com/mistic100/jQCloud",
55
"description": "jQuery plugin for drawing neat word clouds that actually look like clouds",
66
"authors": [{
@@ -11,6 +11,7 @@
1111
"homepage": "http://www.developerdan.com"
1212
}, {
1313
"name": "Damien \"Mistic\" Sorel",
14+
"email": "contact@git.strangeplanet.fr",
1415
"homepage": "http://www.strangeplanet.fr"
1516
}],
1617
"main": [
@@ -36,6 +37,8 @@
3637
"node_modules",
3738
"bower_components",
3839
"test",
39-
"tests"
40+
"tests",
41+
"package.json",
42+
"Gruntfile.js"
4043
]
4144
}

dist/jqcloud.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)