Skip to content

Commit

Permalink
Updating and pruning JS requirements, tweaking JS build process
Browse files Browse the repository at this point in the history
  • Loading branch information
BjarniRunar committed Aug 16, 2019
1 parent 852fb64 commit 0b04614
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 101 deletions.
12 changes: 5 additions & 7 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ module.exports = function(grunt) {
separator: ';'
},
src: [
'shared-data/default-theme/js/libraries.js',
'bower_components/jquery/dist/jquery.js',
'bower_components/underscore/underscore.js',
'bower_components/jquery/dist/jquery.min.js',
'bower_components/underscore/underscore-min.js',
'bower_components/jquery-timer/jquery.timer.js',
'bower_components/autosize/dist/autosize.js',
'bower_components/mousetrap/mousetrap.js',
Expand All @@ -23,15 +22,14 @@ module.exports = function(grunt) {
'bower_components/jquery.ui/ui/jquery.ui.droppable.js',
'bower_components/jquery.ui/ui/jquery.ui.sortable.js',
'bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.js',
'bower_components/qtip2/jquery.qtip.js',
'bower_components/qtip2/basic/jquery.qtip.min.js',
'bower_components/jquery-slugify/dist/slugify.js',
'bower_components/typeahead.js/dist/typeahead.jquery.js',
'bower_components/bootstrap/js/dropdown.js',
'bower_components/bootstrap/js/modal.js',
'bower_components/listjs/dist/list.js',
'bower_components/favico.js/favico.js',
'bower_components/select2/select2.js',
'bower_components/moxie/bin/js/moxie.js',
'bower_components/select2/select2.min.js',
'bower_components/moxie/bin/js/moxie.min.js',
'bower_components/plupload/js/plupload.min.js',
'bower_components/dompurify/dist/purify.min.js'
],
Expand Down
29 changes: 20 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,29 @@ bower_components:

js: bower_components
# Warning: Horrible hack to extract rules from Gruntfile.js
rm -f shared-data/default-theme/js/libraries.min.js
cat `cat Gruntfile.js \
@rm -f shared-data/default-theme/js/libraries.min.js
@rm -f shared-data/default-theme/js/mailpile-min.js.tmp*
@cat Gruntfile.js \
|sed -e '1,/concat:/d ' \
|sed -e '1,/src:/d' -e '/dest:/,$$d' \
|grep / \
|sed -e "s/[',]/ /g"` \
>> shared-data/default-theme/js/mailpile-min.js.tmp
uglify -s shared-data/default-theme/js/mailpile-min.js.tmp \
-o shared-data/default-theme/js/libraries.min.js
#@cp -va shared-data/default-theme/js/mailpile-min.js.tmp \
# shared-data/default-theme/js/libraries.min.js
@rm -f shared-data/default-theme/js/mailpile-min.js.tmp
|sed -e "s/[',]/ /g" \
|xargs sed -e '$$a;' \
>> shared-data/default-theme/js/mailpile-min.js.tmp
@uglify -s shared-data/default-theme/js/mailpile-min.js.tmp \
-o shared-data/default-theme/js/mailpile-min.js.tmp2
@sed -e "s/@MP_JSBUILD_INFO@/`./scripts/gitwhere.sh`/" \
< shared-data/default-theme/js/libraries.js \
> shared-data/default-theme/js/libraries.min.js
@echo '/* Sources...' \
>> shared-data/default-theme/js/libraries.min.js
@bower --offline --no-color list \
>> shared-data/default-theme/js/libraries.min.js
@echo '*/' \
>> shared-data/default-theme/js/libraries.min.js
@cat shared-data/default-theme/js/mailpile-min.js.tmp2 \
>> shared-data/default-theme/js/libraries.min.js
@rm -f shared-data/default-theme/js/mailpile-min.js.tmp*

less: less-compiler bower_components
@make -s -f scripts/less-compiler.mk
Expand Down
11 changes: 4 additions & 7 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,23 @@
"dependencies": {
"underscore": ">=1.7.0",
"bootstrap": "~3.3.0",
"d3": "~3.4.3",
"favico.js": "~0.3.5",
"html5shiv": "~3.7.0",
"jquery": "~2.1.0",
"jquery": "~2.1",
"autosize": "~3.0.14",
"jquery-confirm": "~2.1.1",
"jquery-slugify": "~1.0.3",
"jquery-timer": "*",
"jquery.ui": "~1.10.4",
"jquery.ui": "~1.10",
"less-elements-old": "~1.0",
"listjs": "~1.1.0",
"mousetrap": "~1.6.0",
"moxie": "~1.3.4",
"plupload": "~2.1.2",
"purl": "~2.3.1",
"qtip2": "~2.1.1",
"rebar": "~0.3.2",
"select2": "3.4.7",
"select2": "3.5.4",
"typeahead.js": "~0.10.5",
"jqueryui-touch-punch": "*",
"dompurify": "~0.8.5"
"dompurify": "~1.0.11"
}
}
75 changes: 0 additions & 75 deletions indie.json

This file was deleted.

2 changes: 2 additions & 0 deletions scripts/gitwhere.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
echo $(git status --porcelain -b |head -1 |cut -f1 -d.)@$(git rev-parse HEAD|cut -b1-12) |cut -f 2 -d" "
7 changes: 4 additions & 3 deletions shared-data/default-theme/js/libraries.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Mailpile libraries.js 0.4.1
* https://github.com/pagekite/mailpile
* Mailpile and other contributors; Licensed AGPL3
console.log("Mailpile 3rd-party JS library bundle, built at: @MP_JSBUILD_INFO@");
/*
* All code is Copyright the respective upstream projects. The license for
* this combined bundle is the same as for Mailpile itself, AGPLv3.
*/

0 comments on commit 0b04614

Please sign in to comment.