[Libreoffice-commits] online.git: 7 commits - loleaflet/build loleaflet/Jakefile.js loleaflet/Makefile loleaflet/node_shrinkwrap loleaflet/npm-shrinkwrap.json loleaflet/package.json loleaflet/README
Pranav Kant
pranavk at collabora.co.uk
Thu Aug 11 10:35:56 UTC 2016
loleaflet/Jakefile.js | 9 ++++
loleaflet/Makefile | 8 ++--
loleaflet/README | 4 +-
loleaflet/build/build.js | 24 +++++++++++++
loleaflet/node_shrinkwrap/extend-1.3.0.tgz |binary
loleaflet/node_shrinkwrap/uglifyify-3.0.2.tgz |binary
loleaflet/npm-shrinkwrap.json | 48 +++++++++++++++++++++++++-
loleaflet/package.json | 7 +--
8 files changed, 88 insertions(+), 12 deletions(-)
New commits:
commit bedb54671457efe6167cdf4818eec360a57a5169
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Aug 11 15:53:31 2016 +0530
loleaflet: Update npm-shrinkwrap.json with updated module name
s/leaflet/loleaflet/ in 2b7bd99fcd314834d503920307213b8f5f24c5dc
diff --git a/loleaflet/npm-shrinkwrap.json b/loleaflet/npm-shrinkwrap.json
index 3c5dc6d..acf8664 100644
--- a/loleaflet/npm-shrinkwrap.json
+++ b/loleaflet/npm-shrinkwrap.json
@@ -1,5 +1,5 @@
{
- "name": "leaflet",
+ "name": "loleaflet",
"version": "0.8.0-dev",
"dependencies": {
"bootstrap": {
commit 65b83c040949ad1c6702dd74d6473b2e24083687
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Aug 11 15:50:00 2016 +0530
loleaflet: Minify our js bundle
diff --git a/loleaflet/build/build.js b/loleaflet/build/build.js
index 6531c41..7aa1ae2 100644
--- a/loleaflet/build/build.js
+++ b/loleaflet/build/build.js
@@ -98,7 +98,10 @@ function bytesToKB(bytes) {
function bundle(files, destFilename, debug) {
var bundler = browserify(files, {debug: debug});
- bundler.transform(browserifyCss);
+ bundler.transform(browserifyCss)
+ .transform({
+ global: true
+ }, 'uglifyify');
var bundleFs = fs.createWriteStream('dist/' + destFilename);
bundler.bundle().pipe(bundleFs);
diff --git a/loleaflet/package.json b/loleaflet/package.json
index 31130c1..09fdbfb 100644
--- a/loleaflet/package.json
+++ b/loleaflet/package.json
@@ -32,6 +32,7 @@
"shrinkpack": "^0.13.1",
"smartmenus": "1.0.0",
"uglify-js": "~2.4.16",
+ "uglifyify": "3.0.2",
"vex-js": "2.3.2",
"w2ui": "1.4.3"
},
commit 3cab3e0d3484f5db1b97de558099d19ee058c723
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Aug 11 15:55:06 2016 +0530
loleaflet: Add uglifyify for minifying js code
diff --git a/loleaflet/node_shrinkwrap/extend-1.3.0.tgz b/loleaflet/node_shrinkwrap/extend-1.3.0.tgz
new file mode 100644
index 0000000..1c4caf0
Binary files /dev/null and b/loleaflet/node_shrinkwrap/extend-1.3.0.tgz differ
diff --git a/loleaflet/node_shrinkwrap/uglifyify-3.0.2.tgz b/loleaflet/node_shrinkwrap/uglifyify-3.0.2.tgz
new file mode 100644
index 0000000..8da3df5
Binary files /dev/null and b/loleaflet/node_shrinkwrap/uglifyify-3.0.2.tgz differ
diff --git a/loleaflet/npm-shrinkwrap.json b/loleaflet/npm-shrinkwrap.json
index 1e76bca..3c5dc6d 100644
--- a/loleaflet/npm-shrinkwrap.json
+++ b/loleaflet/npm-shrinkwrap.json
@@ -2407,6 +2407,52 @@
}
}
},
+ "uglifyify": {
+ "version": "3.0.2",
+ "from": "uglifyify at latest",
+ "resolved": "./node_shrinkwrap/uglifyify-3.0.2.tgz",
+ "dependencies": {
+ "convert-source-map": {
+ "version": "1.1.3",
+ "from": "convert-source-map@>=1.1.0 <1.2.0",
+ "resolved": "./node_shrinkwrap/convert-source-map-1.1.3.tgz"
+ },
+ "extend": {
+ "version": "1.3.0",
+ "from": "extend@>=1.2.1 <2.0.0",
+ "resolved": "./node_shrinkwrap/extend-1.3.0.tgz"
+ },
+ "minimatch": {
+ "version": "2.0.10",
+ "from": "minimatch@>=2.0.7 <3.0.0",
+ "resolved": "./node_shrinkwrap/minimatch-2.0.10.tgz",
+ "dependencies": {
+ "brace-expansion": {
+ "version": "1.1.6",
+ "from": "brace-expansion@>=1.0.0 <2.0.0",
+ "resolved": "./node_shrinkwrap/brace-expansion-1.1.6.tgz",
+ "dependencies": {
+ "balanced-match": {
+ "version": "0.4.2",
+ "from": "balanced-match@>=0.4.1 <0.5.0",
+ "resolved": "./node_shrinkwrap/balanced-match-0.4.2.tgz"
+ },
+ "concat-map": {
+ "version": "0.0.1",
+ "from": "concat-map at 0.0.1",
+ "resolved": "./node_shrinkwrap/concat-map-0.0.1.tgz"
+ }
+ }
+ }
+ }
+ },
+ "through": {
+ "version": "2.3.8",
+ "from": "through@>=2.3.4 <2.4.0",
+ "resolved": "./node_shrinkwrap/through-2.3.8.tgz"
+ }
+ }
+ },
"vex-js": {
"version": "2.3.2",
"from": "vex-js at 2.3.2",
commit a08f05e938cb71e9c213a7b128684bd9c5ef437f
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Aug 11 14:52:29 2016 +0530
loleaflet: Port to new API based build process; remove older ones
diff --git a/loleaflet/Makefile b/loleaflet/Makefile
index be9c11a..d988a79 100644
--- a/loleaflet/Makefile
+++ b/loleaflet/Makefile
@@ -18,11 +18,11 @@ build:
rm -rf dist/plugins/draw-$(DRAW_VERSION) && mkdir -p dist/plugins/draw-$(DRAW_VERSION)
cd plugins/draw-$(DRAW_VERSION) && jake build && cp -ar dist ../../dist/plugins/draw-$(DRAW_VERSION)
if $(DEBUG); then \
- npm run bundle-debug; \
- npm run bundle-admin-debug; \
+ jake bundle[,true]; \
+ jake bundle[admin,true]; \
else \
- npm run bundle; \
- npm run bundle-admin; \
+ jake bundle; \
+ jake bundle[admin]; \
fi;
all: build
diff --git a/loleaflet/README b/loleaflet/README
index bc0e682..aa8e91c 100644
--- a/loleaflet/README
+++ b/loleaflet/README
@@ -7,9 +7,9 @@ This is the client part of LibreOffice On-Line. For the server part, see the
Build dependencies
------------------
-First you need to install 'jake', and 'browserify'. As root, do:
+First you need to install 'jake'. As root, do:
- npm install -g jake browserify
+ npm install -g jake
npm is provided by the nodejs package.
diff --git a/loleaflet/package.json b/loleaflet/package.json
index c3e2fe4..31130c1 100644
--- a/loleaflet/package.json
+++ b/loleaflet/package.json
@@ -46,11 +46,7 @@
"main": "main.js",
"style": "main.css",
"scripts": {
- "test": "jake test",
- "bundle": "browserify . > dist/bundle.js",
- "bundle-debug": "browserify -d . > dist/bundle.js",
- "bundle-admin": "browserify main-admin.js > dist/admin-bundle.js",
- "bundle-admin-debug": "browserify -d main-admin.js > dist/admin-bundle.js"
+ "test": "jake test"
},
"repository": {
"type": "git",
commit ebaecafdeb38928659116bc2b97db2e27bb414db
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Aug 11 14:46:55 2016 +0530
loleaflet: Add debug support to API based build process
diff --git a/loleaflet/Jakefile.js b/loleaflet/Jakefile.js
index 27ead5b..81a0093 100644
--- a/loleaflet/Jakefile.js
+++ b/loleaflet/Jakefile.js
@@ -47,11 +47,11 @@ task('build', {async: true}, function (compsBase32, buildName) {
});
desc('Browserify and bundle all js and css files');
-task('bundle', {async: true}, function (type) {
+task('bundle', {async: true}, function (type, debug) {
if (type === 'admin') {
- build.bundleAdmin();
+ build.bundleAdmin(debug);
} else {
- build.bundle();
+ build.bundle(debug);
}
});
diff --git a/loleaflet/build/build.js b/loleaflet/build/build.js
index 78ee1f6..6531c41 100644
--- a/loleaflet/build/build.js
+++ b/loleaflet/build/build.js
@@ -96,8 +96,8 @@ function bytesToKB(bytes) {
return (bytes / 1024).toFixed(2) + ' KB';
}
-function bundle(files, destFilename) {
- var bundler = browserify(files);
+function bundle(files, destFilename, debug) {
+ var bundler = browserify(files, {debug: debug});
bundler.transform(browserifyCss);
var bundleFs = fs.createWriteStream('dist/' + destFilename);
bundler.bundle().pipe(bundleFs);
@@ -107,12 +107,12 @@ function bundle(files, destFilename) {
});
};
-exports.bundle = function() {
- bundle(['main.js'], 'bundle.js');
+exports.bundle = function(debug) {
+ bundle(['main.js'], 'bundle.js', debug);
};
-exports.bundleAdmin = function() {
- bundle(['main-admin.js'], 'admin-bundle.js');
+exports.bundleAdmin = function(debug) {
+ bundle(['main-admin.js'], 'admin-bundle.js', debug);
};
exports.build = function (callback, version, compsBase32, buildName) {
commit 1156a9534f2e47e6dae1b2682aad634e7e25d596
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Aug 11 14:29:06 2016 +0530
loleaflet: build: Use API to bundle, instead of commands
This should give more fine-grained control as now we are sure
what version of browserify, or any other tool we are using to bundle
our assets. Installing browserify globally is also not required now.
This will also be helpful when we add more complicated transforms
and other tools to our build process, as otherwise it would keep
complicating our command used currently for the build process.
diff --git a/loleaflet/Jakefile.js b/loleaflet/Jakefile.js
index d1cb7ab..27ead5b 100644
--- a/loleaflet/Jakefile.js
+++ b/loleaflet/Jakefile.js
@@ -46,6 +46,15 @@ task('build', {async: true}, function (compsBase32, buildName) {
});
});
+desc('Browserify and bundle all js and css files');
+task('bundle', {async: true}, function (type) {
+ if (type === 'admin') {
+ build.bundleAdmin();
+ } else {
+ build.bundle();
+ }
+});
+
desc('Run PhantomJS tests');
task('test', ['lint', 'lintspec'], {async: true}, function () {
build.test(complete);
diff --git a/loleaflet/build/build.js b/loleaflet/build/build.js
index 30ed5e8..78ee1f6 100644
--- a/loleaflet/build/build.js
+++ b/loleaflet/build/build.js
@@ -1,6 +1,8 @@
var fs = require('fs'),
UglifyJS = require('uglify-js'),
zlib = require('zlib'),
+ browserify = require('browserify'),
+ browserifyCss = require('browserify-css');
deps = require('./deps.js').deps,
adminDeps = require('./adminDeps.js').adminDeps;
@@ -94,6 +96,25 @@ function bytesToKB(bytes) {
return (bytes / 1024).toFixed(2) + ' KB';
}
+function bundle(files, destFilename) {
+ var bundler = browserify(files);
+ bundler.transform(browserifyCss);
+ var bundleFs = fs.createWriteStream('dist/' + destFilename);
+ bundler.bundle().pipe(bundleFs);
+
+ bundleFs.on('finish', function() {
+ console.log('Finish writing to dist/' + destFilename);
+ });
+};
+
+exports.bundle = function() {
+ bundle(['main.js'], 'bundle.js');
+};
+
+exports.bundleAdmin = function() {
+ bundle(['main-admin.js'], 'admin-bundle.js');
+};
+
exports.build = function (callback, version, compsBase32, buildName) {
var files = getFiles(compsBase32);
commit e09da0d764d5405bdc6f6926b8116f81f92ee767
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Aug 11 13:46:11 2016 +0530
loleaflet: Superfluous colon
diff --git a/loleaflet/build/build.js b/loleaflet/build/build.js
index c4b541a..30ed5e8 100644
--- a/loleaflet/build/build.js
+++ b/loleaflet/build/build.js
@@ -92,7 +92,7 @@ function combineFiles(files) {
function bytesToKB(bytes) {
return (bytes / 1024).toFixed(2) + ' KB';
-};
+}
exports.build = function (callback, version, compsBase32, buildName) {
More information about the Libreoffice-commits
mailing list