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

Commit 08f7e06

Browse files
committed
[TASK] Use npm/yarn for JS libarys instead of bower
1 parent 7f3762c commit 08f7e06

11 files changed

+149
-84
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
bower_components/
21
node_modules/
32
build/

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ cache:
1616
yarn: true
1717
directories:
1818
- node_modules
19-
- bower_components
2019

2120
script: grunt
2221

Gruntfile.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = function (grunt) {
33

44
grunt.loadTasks("tasks");
55

6-
grunt.registerTask("default", ["bower-install-simple", "lint", "copy", "sass:dist", "postcss", "requirejs:default", "inlinedata", "cachebreaker", "inline", "htmlmin", "clean:release"]);
6+
grunt.registerTask("default", ["lint", "copy", "sass:dist", "postcss", "requirejs:default", "inlinedata", "cachebreaker", "inline", "htmlmin", "clean:release"]);
77
grunt.registerTask("lint", ["sasslint", "eslint"]);
8-
grunt.registerTask("serve", ["bower-install-simple", "lint", "copy", "sass:dev", "postcss", "requirejs:dev", "inlinedata", "htmlmin", "browserSync", "watch"]);
8+
grunt.registerTask("serve", ["lint", "copy", "sass:dev", "postcss", "requirejs:dev", "inlinedata", "htmlmin", "browserSync", "watch"]);
99
};

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- Icon font with only needed icons
1212
- Upgrade to grunt v1.x (Tested with Node.js 4 LTS,6 LTS,7 Linux,OSX,W**)
1313
- Inline some css and js
14-
- Bower update all components
14+
- Remove bower in favour of npm/yarn
1515
- Load only german locale from 101 languages from moment.js
1616
- Right click open layermenu
1717
- Remove ruby dependency
@@ -33,7 +33,6 @@ https://regensburg.freifunk.net/netz/karte/
3333
# Dependencies
3434

3535
- yarn
36-
- bower
3736
- grunt-cli
3837

3938
# Installing dependencies

app.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
require.config({
44
baseUrl: "lib",
55
paths: {
6-
"leaflet": "../bower_components/leaflet/dist/leaflet",
7-
"leaflet.label": "../bower_components/Leaflet.label/dist/leaflet.label",
8-
"chroma-js": "../bower_components/chroma-js/chroma.min",
9-
"moment": "../bower_components/moment",
10-
"tablesort": "../bower_components/tablesort/src/tablesort",
11-
"d3": "../bower_components/d3/d3.min",
12-
"virtual-dom": "../bower_components/virtual-dom/dist/virtual-dom",
13-
"rbush": "../bower_components/rbush/rbush",
6+
"leaflet": "../node_modules/leaflet/dist/leaflet",
7+
"leaflet.label": "../node_modules/leaflet-label/dist/leaflet.label",
8+
"chroma-js": "../node_modules/chroma-js/chroma.min",
9+
"moment": "../node_modules/moment",
10+
"tablesort": "../node_modules/tablesort/src/tablesort",
11+
"d3": "../node_modules/d3/d3.min",
12+
"virtual-dom": "../node_modules/virtual-dom/dist/virtual-dom",
13+
"rbush": "../node_modules/rbush/rbush",
1414
"helper": "utils/helper"
1515
},
1616
shim: {

bower.json

-29
This file was deleted.

package.json

+13-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"eslint": "^3.13.1",
1717
"eslint-config-defaults": "^9.0.0",
1818
"grunt": "^1.0.1",
19-
"grunt-bower-install-simple": "^1.2.3",
2019
"grunt-browser-sync": "^2.2.0",
2120
"grunt-cache-breaker": "^2.0.1",
2221
"grunt-check-dependencies": "^1.0.0",
@@ -39,5 +38,18 @@
3938
"es6": true,
4039
"node": true
4140
}
41+
},
42+
"dependencies": {
43+
"almond": "^0.3.3",
44+
"chroma-js": "^1.2.1",
45+
"d3": "3.5",
46+
"leaflet": "https://github.com/davojta/Leaflet.git#v0.7.7.1",
47+
"leaflet-label": "^0.2.1-0",
48+
"moment": "^2.17.1",
49+
"promise-polyfill": "^6.0.2",
50+
"rbush": "1.4.3",
51+
"requirejs": "^2.3.2",
52+
"tablesort": "4.0.1",
53+
"virtual-dom": "^2.1.1"
4254
}
4355
}

scss/_leaflet.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../bower_components/leaflet/dist/leaflet.css
1+
../node_modules/leaflet/dist/leaflet.css

tasks/build.js

+4-18
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = function (grunt) {
22
"use strict";
33

44
grunt.config.merge({
5-
bowerdir: "bower_components",
5+
nodedir: "node_modules",
66
copy: {
77
html: {
88
src: ["*.html"],
@@ -13,7 +13,7 @@ module.exports = function (grunt) {
1313
vendorjs: {
1414
src: ["promise-polyfill/promise.js"],
1515
expand: true,
16-
cwd: "bower_components/",
16+
cwd: "<%=nodedir%>/",
1717
dest: "build/vendor/"
1818
},
1919
config: {
@@ -99,24 +99,11 @@ module.exports = function (grunt) {
9999
ext: ".html"
100100
}
101101
},
102-
"bower-install-simple": {
103-
options: {
104-
directory: "<%=bowerdir%>",
105-
color: true,
106-
interactive: false,
107-
production: true
108-
},
109-
"prod": {
110-
options: {
111-
production: true
112-
}
113-
}
114-
},
115102
requirejs: {
116103
default: {
117104
options: {
118105
baseUrl: "lib",
119-
name: "../bower_components/almond/almond",
106+
name: "../<%=nodedir%>/almond/almond",
120107
mainConfigFile: "app.js",
121108
include: "../app",
122109
out: "build/app.js",
@@ -126,7 +113,7 @@ module.exports = function (grunt) {
126113
dev: {
127114
options: {
128115
baseUrl: "lib",
129-
name: "../bower_components/almond/almond",
116+
name: "../<%=nodedir%>/almond/almond",
130117
mainConfigFile: "app.js",
131118
include: "../app",
132119
optimize: "none",
@@ -148,7 +135,6 @@ module.exports = function (grunt) {
148135
}
149136
});
150137

151-
grunt.loadNpmTasks("grunt-bower-install-simple");
152138
grunt.loadNpmTasks("grunt-contrib-copy");
153139
grunt.loadNpmTasks("grunt-contrib-requirejs");
154140
grunt.loadNpmTasks("grunt-sass");

tasks/linting.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@ module.exports = function (grunt) {
55
checkDependencies: {
66
options: {
77
install: true
8-
},
9-
bower: {
10-
options: {
11-
packageManager: "bower"
12-
}
13-
},
14-
npm: {}
8+
}
159
},
1610
sasslint: {
1711
options: {

0 commit comments

Comments
 (0)