Skip to content

Commit 101ba82

Browse files
committed
Build: replaced Bower by NPM + moved config out of minimized file + upgraded some UI dependencies.
1 parent 7a36b12 commit 101ba82

File tree

13 files changed

+82
-108
lines changed

13 files changed

+82
-108
lines changed

Gruntfile.js

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module.exports = function (grunt) {
22

33
function uiDependenciesList(){
4-
var pkg=grunt.file.readJSON('bower.json'),
4+
var pkg=grunt.file.readJSON('package.json'),
55
lst = [];
66
if(pkg){
77
var deps = pkg.dependencies;
88
for(var p in deps){
9-
lst.push(p+' '+deps[p]);
9+
lst.push(p+' '+deps[p].replace('^', ''));
1010
}
1111
}
1212
return lst.join(' + ');
@@ -24,7 +24,7 @@ module.exports = function (grunt) {
2424
' <%= pkg.copyright %> \n' +
2525
' <%= pkg.homepage %> \n*/\n',
2626

27-
bannerDependencies: '/*!\n <%= pkg.name %> <%= pkg.version %> dependencies: ' +
27+
bannerDependencies: '/*!\n <%= pkg.name %> <%= pkg.version %>\n\ndependencies: ' +
2828
uiDependenciesList()+'\n*/\n',
2929

3030
// *************************************************************************************
@@ -39,33 +39,33 @@ module.exports = function (grunt) {
3939
src: [
4040

4141
// D3.js
42-
'bower_components/d3/d3.js',
42+
'node_modules/d3/d3.js',
4343

4444
// PapaParse.js (CSV parser)
45-
'bower_components/papaparse/papaparse.js',
45+
'node_modules/papaparse/papaparse.js',
4646

4747
// jQuery
48-
'bower_components/jquery/dist/jquery.js',
49-
//'bower_components/jquery.csv.js',
48+
'node_modules/jquery/dist/jquery.js',
49+
//'node_modules/jquery.csv.js',
5050

5151
// Backbone & Underscore
52-
'bower_components/underscore/underscore.js',
53-
//'bower_components/underscore.string/lib/underscore.string.js',
54-
'bower_components/backbone/backbone.js',
55-
'bower_components/backbone.localStorage/backbone.localStorage.js',
52+
'node_modules/underscore/underscore.js',
53+
//'node_modules/underscore.string/lib/underscore.string.js',
54+
'node_modules/backbone/backbone.js',
55+
'node_modules/backbone.localStorage/backbone.localstorage.js',
5656

5757
// Twitter Bootstrap
58-
'bower_components/bootstrap/js/modal.js',
59-
'bower_components/bootstrap/js/dropdown.js',
60-
'bower_components/bootstrap/js/button.js',
61-
'bower_components/bootstrap/js/tooltip.js',
62-
'bower_components/bootstrap/js/popover.js',
63-
//'bower_components/bootstrap/js/carousel.js',
58+
'node_modules/bootstrap/js/modal.js',
59+
'node_modules/bootstrap/js/dropdown.js',
60+
'node_modules/bootstrap/js/button.js',
61+
'node_modules/bootstrap/js/tooltip.js',
62+
'node_modules/bootstrap/js/popover.js',
63+
//'node_modules/bootstrap/js/carousel.js',
6464

6565
// Widgets
66-
'bower_components/bootstrap-datepicker/js/bootstrap-datepicker.js',
67-
'bower_components/select2/select2.js',
68-
'bower_components/toastr/toastr.js'
66+
'node_modules/bootstrap-datepicker/js/bootstrap-datepicker.js',
67+
'node_modules/select2/dist/js/select2.js',
68+
'node_modules/toastr/toastr.js'
6969
],
7070
dest: '<%= pkg.target %>/dependencies.js'
7171
},
@@ -75,7 +75,7 @@ module.exports = function (grunt) {
7575
separator: ';\n'
7676
},
7777
src: [
78-
'config.js',
78+
//'config.js',
7979
'js/i18n/EN.js',
8080

8181
'js/dico/def.js',
@@ -132,19 +132,9 @@ module.exports = function (grunt) {
132132
expand: true,
133133
flatten: true,
134134
src: [
135-
'bower_components/bootstrap/dist/fonts/*'
135+
'node_modules/bootstrap/dist/fonts/*'
136136
],
137137
dest: '<%= pkg.target %>/fonts/bootstrap/'
138-
},
139-
{
140-
expand: true,
141-
flatten: true,
142-
src: [
143-
'bower_components/select2/select2-spinner.gif',
144-
'bower_components/select2/select2.png',
145-
'bower_components/select2/select2x2.png'
146-
],
147-
dest: '<%= pkg.target %>/css'
148138
}
149139
]
150140
}
@@ -158,7 +148,6 @@ module.exports = function (grunt) {
158148

159149
'Gruntfile.js',
160150
'package.json',
161-
'bower.json',
162151

163152
'js/dico/*.js',
164153
'js/i18n/EN.js',
@@ -264,6 +253,7 @@ module.exports = function (grunt) {
264253
grunt.loadNpmTasks('grunt-contrib-jshint');
265254
grunt.loadNpmTasks('grunt-contrib-uglify');
266255
grunt.loadNpmTasks('grunt-sass');
256+
//var sass = require('node-sass');
267257

268258
grunt.registerTask('header', 'Evolutility version', function(arg1) {
269259
var pkg=grunt.file.readJSON('package.json');

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ By default, Evolutility-UI-jQuery is configured use localStorage for storing dat
4444
```bash
4545
# To rebuild the project
4646
cd evolutility-ui-jquery
47-
bower install
47+
npm install
4848
grunt
4949
```
5050

@@ -371,7 +371,7 @@ The React alternative:
371371

372372
## Documentation
373373

374-
The (beginning of a) [documentation](http://evoluteur.github.io/evolutility-ui-jquery/doc/index.html) is in progress: [ui-models](http://evoluteur.github.io/evolutility-ui-jquery/doc/ui-model.html) and [views](http://evoluteur.github.io/evolutility-ui-jquery/doc/views.html).
374+
[Documentation](http://evoluteur.github.io/evolutility-ui-jquery/doc/index.html): [ui-models](http://evoluteur.github.io/evolutility-ui-jquery/doc/ui-model.html) and [views](http://evoluteur.github.io/evolutility-ui-jquery/doc/views.html).
375375

376376
## License
377377

bower.json

Lines changed: 0 additions & 32 deletions
This file was deleted.

config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// default config for Evolutility-UI-jQuery
22

3-
var Evol = Evol || {};
4-
5-
Evol.Config = {
3+
var EvoConfig = {
64

75
// --- using localStorage
86
localStorage: true,

demo/demo.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var ViewDescriptions = {
2626

2727
function createSampleDataIfEmpty(entityName){
2828
var M, MS;
29-
if(Evol.Config.localStorage){
29+
if(EvoConfig.localStorage){
3030
var lc = new Backbone.LocalStorage('evol-'+entityName);
3131
M = Backbone.Model.extend({
3232
localStorage: lc
@@ -37,11 +37,11 @@ function createSampleDataIfEmpty(entityName){
3737
});
3838
}else{
3939
M = Backbone.Model.extend({
40-
urlRoot: Evol.Config.url+entityName
40+
urlRoot: EvoConfig.url+entityName
4141
});
4242
Ms = Backbone.Collection.extend({
4343
model: M,
44-
url: Evol.Config.url+entityName/*,
44+
url: EvoConfig.url+entityName/*,
4545
sync : function(method, collection, options) {
4646
//options.dataType = "jsonp";
4747
return Backbone.sync(method, collection, options);

demo/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<link href="../dist/css/demo.css" rel="stylesheet" />
1414
<link href="../dist/css/evolutility-ui-jquery.min.css" rel="stylesheet" />
1515

16+
<script src="../config.js" type="text/javascript"></script>
1617
<script src="demo.js" type="text/javascript"></script>
1718
<script src="demo-data.min.js" type="text/javascript"></script>
1819
<script src="../models/contacts.js" type="text/javascript"></script>

demo/test.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<link href="../dist/css/demo.css" rel="stylesheet" />
1313
<link href="../dist/css/evolutility-ui-jquery.min.css" rel="stylesheet" />
1414

15+
<script src="../config.js" type="text/javascript"></script>
1516
<script src="../dist/dependencies.min.js" type="text/javascript"></script>
1617
<script src="demo.js" type="text/javascript"></script>
1718
<script src="../models/test.data.js" type="text/javascript"></script>

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<link href="dist/css/demo.css" rel="stylesheet" />
1515
<link href="dist/css/evolutility-ui-jquery.min.css" rel="stylesheet" />
1616

17+
<script src="config.js" type="text/javascript"></script>
1718
<script src="demo/demo.js" type="text/javascript"></script>
1819
<script src="demo/demo-data.min.js" type="text/javascript"></script>
1920
<script src="models/contacts.js" type="text/javascript"></script>

js/dico/app.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*
1010
*************************************************************************** */
1111

12+
EvoConfig = EvoConfig || {};
13+
1214
Evol.App = Backbone.View.extend({
1315

1416
//events: {
@@ -161,8 +163,8 @@ Evol.App = Backbone.View.extend({
161163
createEntity: function($v, uiModel, data, defaultView, options, cb){
162164
var that=this, url, M, Ms;
163165

164-
if(Evol.Config){
165-
if(Evol.Config.localStorage){
166+
if(EvoConfig){
167+
if(EvoConfig.localStorage){
166168
var lc = new Backbone.LocalStorage(this.prefix+(uiModel.table || uiModel.id));
167169
M = Backbone.Model.extend({
168170
localStorage: lc
@@ -172,7 +174,7 @@ Evol.App = Backbone.View.extend({
172174
localStorage: lc
173175
});
174176
}else{
175-
url = Evol.Config.url+uiModel.id;
177+
url = EvoConfig.url+uiModel.id;
176178
M = Backbone.Model.extend({
177179
urlRoot: url
178180
});

js/view-action/action-import.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ return Backbone.View.extend({
8181
// d3.csv.parse(csv);
8282

8383

84-
if(Evol.Config.localStorage){
84+
if(EvoConfig.localStorage){
8585
var lc = new Backbone.LocalStorage('evol-'+entityId);
8686
M = Backbone.Model.extend({
8787
localStorage: lc
@@ -92,11 +92,11 @@ return Backbone.View.extend({
9292
});
9393
}else{
9494
M = new Backbone.Model({
95-
urlRoot: Evol.Config.url+entityId
95+
urlRoot: EvoConfig.url+entityId
9696
});
9797
Ms = Backbone.Collection.extend({
9898
model: M,
99-
url: Evol.Config.url+entityId/*,
99+
url: EvoConfig.url+entityId/*,
100100
sync : function(method, collection, options) {
101101
//options.dataType = "jsonp";
102102
return Backbone.sync(method, collection, options);

0 commit comments

Comments
 (0)