[TASK] Use npm/yarn for JS libarys instead of bower

This commit is contained in:
Xaver Maierhofer 2017-01-16 17:39:17 +01:00
parent 7f3762cc61
commit 08f7e06a85
No known key found for this signature in database
GPG Key ID: 7FDCE23FD2EC9FE8
11 changed files with 149 additions and 84 deletions

1
.gitignore vendored
View File

@ -1,3 +1,2 @@
bower_components/
node_modules/
build/

View File

@ -16,7 +16,6 @@ cache:
yarn: true
directories:
- node_modules
- bower_components
script: grunt

View File

@ -3,7 +3,7 @@ module.exports = function (grunt) {
grunt.loadTasks("tasks");
grunt.registerTask("default", ["bower-install-simple", "lint", "copy", "sass:dist", "postcss", "requirejs:default", "inlinedata", "cachebreaker", "inline", "htmlmin", "clean:release"]);
grunt.registerTask("default", ["lint", "copy", "sass:dist", "postcss", "requirejs:default", "inlinedata", "cachebreaker", "inline", "htmlmin", "clean:release"]);
grunt.registerTask("lint", ["sasslint", "eslint"]);
grunt.registerTask("serve", ["bower-install-simple", "lint", "copy", "sass:dev", "postcss", "requirejs:dev", "inlinedata", "htmlmin", "browserSync", "watch"]);
grunt.registerTask("serve", ["lint", "copy", "sass:dev", "postcss", "requirejs:dev", "inlinedata", "htmlmin", "browserSync", "watch"]);
};

View File

@ -11,7 +11,7 @@
- Icon font with only needed icons
- Upgrade to grunt v1.x (Tested with Node.js 4 LTS,6 LTS,7 Linux,OSX,W**)
- Inline some css and js
- Bower update all components
- Remove bower in favour of npm/yarn
- Load only german locale from 101 languages from moment.js
- Right click open layermenu
- Remove ruby dependency
@ -33,7 +33,6 @@ https://regensburg.freifunk.net/netz/karte/
# Dependencies
- yarn
- bower
- grunt-cli
# Installing dependencies

16
app.js
View File

@ -3,14 +3,14 @@
require.config({
baseUrl: "lib",
paths: {
"leaflet": "../bower_components/leaflet/dist/leaflet",
"leaflet.label": "../bower_components/Leaflet.label/dist/leaflet.label",
"chroma-js": "../bower_components/chroma-js/chroma.min",
"moment": "../bower_components/moment",
"tablesort": "../bower_components/tablesort/src/tablesort",
"d3": "../bower_components/d3/d3.min",
"virtual-dom": "../bower_components/virtual-dom/dist/virtual-dom",
"rbush": "../bower_components/rbush/rbush",
"leaflet": "../node_modules/leaflet/dist/leaflet",
"leaflet.label": "../node_modules/leaflet-label/dist/leaflet.label",
"chroma-js": "../node_modules/chroma-js/chroma.min",
"moment": "../node_modules/moment",
"tablesort": "../node_modules/tablesort/src/tablesort",
"d3": "../node_modules/d3/d3.min",
"virtual-dom": "../node_modules/virtual-dom/dist/virtual-dom",
"rbush": "../node_modules/rbush/rbush",
"helper": "utils/helper"
},
shim: {

View File

@ -1,29 +0,0 @@
{
"name": "ffrgb-meshviewer",
"ignore": [
"node_modules",
"bower_components",
"**/.*",
"test",
"tests"
],
"dependencies": {
"Leaflet.label": "~0.2.1",
"chroma-js": "~1.1.1",
"leaflet": "https://github.com/davojta/Leaflet.git#v0.7.7.1",
"moment": "~2.17.1",
"requirejs": "~2.3.2",
"tablesort": "https://github.com/tristen/tablesort.git#v4.0.1",
"promise-polyfill": "^6.0.2",
"almond": "~0.3.3",
"d3": "~3.5.17",
"virtual-dom": "~2.1.1",
"rbush": "https://github.com/mourner/rbush.git#~1.4.3"
},
"authors": [
"Milan Pässler <me@petabyteboy.de>",
"Nils Schneider <nils@nilsschneider.net>"
],
"license": "AGPL3",
"private": true
}

View File

@ -16,7 +16,6 @@
"eslint": "^3.13.1",
"eslint-config-defaults": "^9.0.0",
"grunt": "^1.0.1",
"grunt-bower-install-simple": "^1.2.3",
"grunt-browser-sync": "^2.2.0",
"grunt-cache-breaker": "^2.0.1",
"grunt-check-dependencies": "^1.0.0",
@ -39,5 +38,18 @@
"es6": true,
"node": true
}
},
"dependencies": {
"almond": "^0.3.3",
"chroma-js": "^1.2.1",
"d3": "3.5",
"leaflet": "https://github.com/davojta/Leaflet.git#v0.7.7.1",
"leaflet-label": "^0.2.1-0",
"moment": "^2.17.1",
"promise-polyfill": "^6.0.2",
"rbush": "1.4.3",
"requirejs": "^2.3.2",
"tablesort": "4.0.1",
"virtual-dom": "^2.1.1"
}
}

View File

@ -1 +1 @@
../bower_components/leaflet/dist/leaflet.css
../node_modules/leaflet/dist/leaflet.css

View File

@ -2,7 +2,7 @@ module.exports = function (grunt) {
"use strict";
grunt.config.merge({
bowerdir: "bower_components",
nodedir: "node_modules",
copy: {
html: {
src: ["*.html"],
@ -13,7 +13,7 @@ module.exports = function (grunt) {
vendorjs: {
src: ["promise-polyfill/promise.js"],
expand: true,
cwd: "bower_components/",
cwd: "<%=nodedir%>/",
dest: "build/vendor/"
},
config: {
@ -99,24 +99,11 @@ module.exports = function (grunt) {
ext: ".html"
}
},
"bower-install-simple": {
options: {
directory: "<%=bowerdir%>",
color: true,
interactive: false,
production: true
},
"prod": {
options: {
production: true
}
}
},
requirejs: {
default: {
options: {
baseUrl: "lib",
name: "../bower_components/almond/almond",
name: "../<%=nodedir%>/almond/almond",
mainConfigFile: "app.js",
include: "../app",
out: "build/app.js",
@ -126,7 +113,7 @@ module.exports = function (grunt) {
dev: {
options: {
baseUrl: "lib",
name: "../bower_components/almond/almond",
name: "../<%=nodedir%>/almond/almond",
mainConfigFile: "app.js",
include: "../app",
optimize: "none",
@ -148,7 +135,6 @@ module.exports = function (grunt) {
}
});
grunt.loadNpmTasks("grunt-bower-install-simple");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-requirejs");
grunt.loadNpmTasks("grunt-sass");

View File

@ -5,14 +5,8 @@ module.exports = function (grunt) {
checkDependencies: {
options: {
install: true
},
bower: {
options: {
packageManager: "bower"
}
},
npm: {}
},
sasslint: {
options: {
configFile: ".sass-lint.yml"

133
yarn.lock
View File

@ -56,6 +56,10 @@ align-text@^0.1.1, align-text@^0.1.3:
longest "^1.0.1"
repeat-string "^1.5.2"
almond@^0.3.3:
version "0.3.3"
resolved "https://registry.yarnpkg.com/almond/-/almond-0.3.3.tgz#a0e7c95ac7624d6417b4494b1e68bff693168a20"
amdefine@>=0.0.4:
version "1.0.1"
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
@ -280,10 +284,6 @@ bower-config@^1.4.0:
osenv "^0.1.3"
untildify "^2.1.0"
bower@~1.7.9:
version "1.7.9"
resolved "https://registry.yarnpkg.com/bower/-/bower-1.7.9.tgz#b7296c2393e0d75edaa6ca39648132dd255812b0"
brace-expansion@^1.0.0:
version "1.1.6"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9"
@ -299,6 +299,10 @@ braces@^1.8.2:
preserve "^0.2.0"
repeat-element "^1.1.2"
browser-split@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/browser-split/-/browser-split-0.0.1.tgz#7b097574f8e3ead606fb4664e64adfdda2981a93"
browser-sync-client@2.4.4:
version "2.4.4"
resolved "https://registry.yarnpkg.com/browser-sync-client/-/browser-sync-client-2.4.4.tgz#e2a6c27f770e0ad0ffed76964dfb6a971fcf55eb"
@ -439,6 +443,10 @@ camelcase@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a"
camelize@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.0.tgz#164a5483e630fa4321e5af07020e531831b2609b"
caniuse-db@^1.0.30000604:
version "1.0.30000604"
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000604.tgz#bc139270a777564d19c0aadcd832b491d093bda5"
@ -454,7 +462,7 @@ center-align@^0.1.1:
align-text "^0.1.3"
lazy-cache "^1.0.3"
chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3, chalk@~1.1.1, chalk@~1.1.3:
chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3, chalk@~1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
dependencies:
@ -523,6 +531,10 @@ chokidar@1.6.1:
optionalDependencies:
fsevents "^1.0.0"
chroma-js@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/chroma-js/-/chroma-js-1.2.1.tgz#83d44f1aa5c7633e2de3d2c143b9089fc22ba987"
circular-json@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d"
@ -695,6 +707,10 @@ currently-unhandled@^0.4.1:
dependencies:
array-find-index "^1.0.1"
d3@3.5:
version "3.5.17"
resolved "https://registry.yarnpkg.com/d3/-/d3-3.5.17.tgz#bc46748004378b21a360c9fc7cf5231790762fb8"
d@^0.1.1, d@~0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309"
@ -800,6 +816,10 @@ doctrine@^1.2.2:
esutils "^2.0.2"
isarray "^1.0.0"
dom-walk@^0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018"
dot-case@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-2.1.0.tgz#4b43dd0d7403c34cb645424add397e80bfe85ca6"
@ -888,6 +908,14 @@ error-ex@^1.2.0:
dependencies:
is-arrayish "^0.2.1"
error@^4.3.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/error/-/error-4.4.0.tgz#bf69ff251fb4a279c19adccdaa6b61e90d9bf12a"
dependencies:
camelize "^1.0.0"
string-template "~0.2.0"
xtend "~4.0.0"
es5-ext@^0.10.7, es5-ext@^0.10.8, es5-ext@~0.10.11, es5-ext@~0.10.2, es5-ext@~0.10.7:
version "0.10.12"
resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.12.tgz#aa84641d4db76b62abba5e45fd805ecbab140047"
@ -1072,6 +1100,12 @@ etag@^1.7.0, etag@~1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/etag/-/etag-1.7.0.tgz#03d30b5f67dd6e632d2945d30d6652731a34d5d8"
ev-store@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/ev-store/-/ev-store-7.0.0.tgz#1ab0c7f82136505dd74b31d17701cb2be6d26558"
dependencies:
individual "^3.0.0"
event-emitter@~0.3.4:
version "0.3.4"
resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.4.tgz#8d63ddfb4cfe1fae3b32ca265c4c720222080bb5"
@ -1411,6 +1445,13 @@ global-prefix@^0.1.4:
is-windows "^0.2.0"
which "^1.2.12"
global@^4.3.0:
version "4.3.1"
resolved "https://registry.yarnpkg.com/global/-/global-4.3.1.tgz#5f757908c7cbabce54f386ae440e11e26b7916df"
dependencies:
min-document "^2.19.0"
process "~0.5.1"
globals@^9.14.0, globals@^9.2.0:
version "9.14.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034"
@ -1448,13 +1489,6 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.1.9:
version "1.0.1"
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
grunt-bower-install-simple@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/grunt-bower-install-simple/-/grunt-bower-install-simple-1.2.3.tgz#d84bdeed83f2a023c7dd78ac5843e517eab3fd57"
dependencies:
bower "~1.7.9"
chalk "~1.1.3"
grunt-browser-sync@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/grunt-browser-sync/-/grunt-browser-sync-2.2.0.tgz#a0e9c1fd1ccb5c454c25ec5170113ffff06a4772"
@ -1777,6 +1811,10 @@ indexof@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d"
individual@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/individual/-/individual-3.0.0.tgz#e7ca4f85f8957b018734f285750dc22ec2f9862d"
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
@ -1910,6 +1948,10 @@ is-number@^2.0.2, is-number@^2.1.0:
dependencies:
kind-of "^3.0.2"
is-object@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470"
is-path-cwd@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d"
@ -2071,6 +2113,14 @@ lcid@^1.0.0:
dependencies:
invert-kv "^1.0.0"
leaflet-label@^0.2.1-0:
version "0.2.1-0"
resolved "https://registry.yarnpkg.com/leaflet-label/-/leaflet-label-0.2.1-0.tgz#b91a678a4d78ac4c47cb230d3926254fd2a7e612"
"leaflet@https://github.com/davojta/Leaflet.git#v0.7.7.1":
version "0.7.7.1"
resolved "https://github.com/davojta/Leaflet.git#57c85cbf0f1e495bce4f1a11be26766b48c08cbc"
levn@^0.3.0, levn@~0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee"
@ -2319,6 +2369,12 @@ mimer@*:
version "0.2.1"
resolved "https://registry.yarnpkg.com/mimer/-/mimer-0.2.1.tgz#c63c5a17fe86423f5161a85d55c3ed5189baaffc"
min-document@^2.19.0:
version "2.19.0"
resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685"
dependencies:
dom-walk "^0.1.0"
"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@~3.0.0, minimatch@~3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774"
@ -2347,6 +2403,10 @@ mkdirp@0.3.0:
dependencies:
minimist "0.0.8"
moment@^2.17.1:
version "2.17.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.17.1.tgz#fed9506063f36b10f066c8b59a144d7faebe1d82"
mout@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/mout/-/mout-1.0.0.tgz#9bdf1d4af57d66d47cb353a6335a3281098e1501"
@ -2381,6 +2441,10 @@ negotiator@0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
next-tick@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-0.2.2.tgz#75da4a927ee5887e39065880065b7336413b310d"
no-case@^2.2.0:
version "2.3.1"
resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.1.tgz#7aeba1c73a52184265554b7dc03baf720df80081"
@ -2729,10 +2793,18 @@ process-nextick-args@~1.0.6:
version "1.0.7"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
process@~0.5.1:
version "0.5.2"
resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf"
progress@^1.1.8:
version "1.1.8"
resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be"
promise-polyfill@^6.0.2:
version "6.0.2"
resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-6.0.2.tgz#d9c86d3dc4dc2df9016e88946defd69b49b41162"
pseudomap@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
@ -2780,6 +2852,10 @@ raw-body@~2.1.5:
iconv-lite "0.4.13"
unpipe "1.0.0"
rbush@1.4.3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/rbush/-/rbush-1.4.3.tgz#7874e2d38911d2719ea27731d32445da5ec4394c"
rc@~1.1.6:
version "1.1.6"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.6.tgz#43651b76b6ae53b5c802f1151fa3fc3b059969c9"
@ -2948,7 +3024,7 @@ require-uncached@^1.0.2:
caller-path "^0.1.0"
resolve-from "^1.0.0"
requirejs@^2.1.0:
requirejs@^2.1.0, requirejs@^2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.2.tgz#0eaa870d4c7db3b15dd1322e6b65b0388fc4b2c6"
@ -3249,6 +3325,10 @@ stream-throttle@^0.1.3:
commander "^2.2.0"
limiter "^1.0.5"
string-template@~0.2.0:
version "0.2.1"
resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add"
string-width@^1.0.1, string-width@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
@ -3340,6 +3420,10 @@ table@^3.7.8:
slice-ansi "0.0.4"
string-width "^2.0.0"
tablesort@4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/tablesort/-/tablesort-4.0.1.tgz#faa528cfa715382e8e5a5ed4f2e84482f28245aa"
tar-pack@~3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.3.0.tgz#30931816418f55afc4d21775afdd6720cee45dae"
@ -3540,6 +3624,19 @@ verror@1.3.6:
dependencies:
extsprintf "1.0.2"
virtual-dom@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/virtual-dom/-/virtual-dom-2.1.1.tgz#80eda2d481b9ede0c049118cefcb4a05f21d1375"
dependencies:
browser-split "0.0.1"
error "^4.3.0"
ev-store "^7.0.0"
global "^4.3.0"
is-object "^1.0.1"
next-tick "^0.2.2"
x-is-array "0.1.0"
x-is-string "0.1.0"
vlq@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.1.tgz#14439d711891e682535467f8587c5630e4222a6c"
@ -3630,6 +3727,14 @@ wtf-8@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/wtf-8/-/wtf-8-1.0.0.tgz#392d8ba2d0f1c34d1ee2d630f15d0efb68e1048a"
x-is-array@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/x-is-array/-/x-is-array-0.1.0.tgz#de520171d47b3f416f5587d629b89d26b12dc29d"
x-is-string@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82"
xml-char-classes@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/xml-char-classes/-/xml-char-classes-1.0.0.tgz#64657848a20ffc5df583a42ad8a277b4512bbc4d"
@ -3638,7 +3743,7 @@ xmlhttprequest-ssl@1.5.3:
version "1.5.3"
resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz#185a888c04eca46c3e4070d99f7b49de3528992d"
xtend@^4.0.0:
xtend@^4.0.0, xtend@~4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"