From 6cacd4edbac22338bf8889020e30344acce21bd6 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Thu, 28 Jul 2016 21:41:17 -0500 Subject: [PATCH 01/31] chore(build): start cleaning up build Move grunt-clean to Makefile target. #1569 --- .gitignore | 2 -- .gitmodules | 3 --- Gruntfile.js | 1 - Makefile | 6 ++++++ lib/grunt/configs/clean.js | 21 --------------------- lib/grunt/configs/index.js | 1 - lib/grunt/tasks/dev.js | 2 +- package.json | 6 ++---- 8 files changed, 9 insertions(+), 33 deletions(-) delete mode 100644 .gitmodules create mode 100644 Makefile delete mode 100644 lib/grunt/configs/clean.js diff --git a/.gitignore b/.gitignore index c1fd285df..e9dc0d418 100644 --- a/.gitignore +++ b/.gitignore @@ -35,8 +35,6 @@ node_modules/ bin/ -build/ - src npm-debug.log diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 15a5c2b6f..000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "server"] - path = server - url = git://github.com/Widen/fine-uploader-server.git diff --git a/Gruntfile.js b/Gruntfile.js index 8422b16ab..fc78d66e5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -38,7 +38,6 @@ module.exports = function(grunt) { grunt.initConfig({ pkg: pkg, paths: paths, - clean: configs.clean(paths), compress: configs.compress(paths), concat: configs.concat(paths), copy: configs.copy(paths), diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..6537b62cd --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +BUILD_OUTPUT_DIR = _build +DIST_OUTPUT_DIR = _dist + +clean: + rm -rf $(BUILD_OUTPUT_DIR) + rm -rf $(DIST_OUTPUT_DIR) diff --git a/lib/grunt/configs/clean.js b/lib/grunt/configs/clean.js deleted file mode 100644 index adcfc9418..000000000 --- a/lib/grunt/configs/clean.js +++ /dev/null @@ -1,21 +0,0 @@ -/* jshint node:true */ -/* globals module */ -var path = require("path"); - -module.exports = function(paths) { - "use strict"; - return { - build: { - files: { src: paths.build } - }, - - dist: { - files: { src: paths.dist } - }, - - test: { - files: { src: path.join(paths.test, "_temp*") } - - } - }; -}; diff --git a/lib/grunt/configs/index.js b/lib/grunt/configs/index.js index 881500a9f..0f5628417 100644 --- a/lib/grunt/configs/index.js +++ b/lib/grunt/configs/index.js @@ -1,7 +1,6 @@ /* jshint node: true */ module.exports = { banner: require("./banner"), - clean: require("./clean"), compress: require("./compress"), concat: require("./concat"), copy: require("./copy"), diff --git a/lib/grunt/tasks/dev.js b/lib/grunt/tasks/dev.js index 0f0f09683..9d20c10ef 100644 --- a/lib/grunt/tasks/dev.js +++ b/lib/grunt/tasks/dev.js @@ -2,6 +2,6 @@ module.exports = function(grunt) { "use strict"; - grunt.registerTask("dev", "Prepare code for testing", ["clean", "build", "copy:test"]); + grunt.registerTask("dev", "Prepare code for testing", ["build", "copy:test"]); }; diff --git a/package.json b/package.json index 235ad8679..d6d5b2dda 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,6 @@ "grunt-aws-s3": "^0.10.0", "grunt-banner": "0.2.0", "grunt-cli": "1.2.0", - "grunt-contrib-clean": "0.4.1", "grunt-contrib-compress": "0.5.2", "grunt-contrib-concat": "0.3.0", "grunt-contrib-copy": "0.4.1", @@ -81,12 +80,11 @@ }, "scripts": { "build": "grunt package", - "devbuild": "grunt dev", + "devbuild": "make clean; grunt dev", "lint": "grunt jshint:tests; grunt jshint:source; grunt jscs:tests; grunt jscs:src", "setup-dev": "(cd test/dev/handlers; curl -sS https://getcomposer.org/installer | php; php composer.phar install)", "start-local-dev": "(. test/dev/handlers/s3keys.sh; php -S 0.0.0.0:9090 -t . -c test/dev/handlers/php.ini)", - "start-c9-dev": "php -S $IP:$PORT -t . -c test/dev/handlers/php.ini", - "test": "if test \"$TRAVIS\" = \"true\" ; then grunt travis ; else grunt test:firefox ; fi", + "test": "if test \"$TRAVIS\" = \"true\" ; then make clean ; grunt travis ; else grunt test:firefox ; fi", "update-dev": "(cd test/dev/handlers; php composer.phar update)" }, "engines" : { From 5b4766df76e440163ec619ad6c0067a9821f37f5 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Thu, 28 Jul 2016 21:42:27 -0500 Subject: [PATCH 02/31] chore(travis.yml): remove ci branch limits #1569 --- .travis.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 12d092782..fd029ad1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,11 +23,3 @@ env: before_script: - "sh -e /etc/init.d/xvfb start" - -branches: - only: - - master - - develop - - /^feature.*$/ - - /^.*fix.*$/ - - /^release.*$/ From 4ab97284de320f0c369d21e14ae7af69d6ffebbf Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Thu, 28 Jul 2016 22:32:56 -0500 Subject: [PATCH 03/31] chore(build): move jscs linting to makefile #1569 --- .jscsrc | 17 +++++++++--- .travis.yml | 1 - Gruntfile.js | 1 - Makefile | 7 +++++ client/js/azure/uploader.basic.js | 2 +- client/js/azure/util.js | 3 +-- client/js/image-support/megapix-image.js | 14 +++++----- .../upload.handler.controller.js | 2 +- lib/grunt/configs/index.js | 1 - lib/grunt/configs/jscs.js | 16 ----------- lib/grunt/tasks/build.js | 2 -- package.json | 6 ++--- test/unit/azure/simple-file-uploads.js | 13 +++++---- test/unit/s3/chunked-uploads.js | 4 +-- test/unit/s3/serverless-uploads.js | 4 --- test/unit/s3/simple-file-uploads.js | 27 +++++++++---------- 16 files changed, 53 insertions(+), 67 deletions(-) delete mode 100644 lib/grunt/configs/jscs.js diff --git a/.jscsrc b/.jscsrc index f069d92f6..9fc2b5512 100644 --- a/.jscsrc +++ b/.jscsrc @@ -1,10 +1,19 @@ { + "excludeFiles": ["client/js/third-party/**/*.js"], "preset": "airbnb", - + "disallowKeywordsOnNewLine": false, + "disallowMultipleVarDecl": false, "disallowSpaceAfterObjectKeys": true, - + "disallowSpacesInCallExpression": false, + "maximumLineLength": false, "validateIndentation": 4, "validateQuoteMarks": "\"", - + "requirePaddingNewLinesAfterBlocks": false, + "requirePaddingNewLinesBeforeLineComments": false, + "requireSpaceAfterComma": false, + "requireSpacesInAnonymousFunctionExpression": false, + "requireSpaceBeforeBlockStatements": false, + "requireSpacesInsideObjectBrackets": false, + "requireTrailingComma": false, "safeContextKeyword": ["self", "handler", "thisSignatureRequester", "controller"] -} \ No newline at end of file +} diff --git a/.travis.yml b/.travis.yml index fd029ad1f..7d83f7fd9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,6 @@ node_js: env: global: - - LOGS_DIR=/tmp/fineuploader-build/logs - DISPLAY=:99.0 - secure: |- AZ/GEWzykeSzxh+4r14eKq2dMQnZyEvx99zFnTSp30Ke9QqJP3UQvMdwHzuV diff --git a/Gruntfile.js b/Gruntfile.js index fc78d66e5..e64e83b6e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -43,7 +43,6 @@ module.exports = function(grunt) { copy: configs.copy(paths), cssmin: configs.cssmin(paths), jshint: configs.jshint(paths), - jscs: configs.jscs(paths), nodestatic: configs["static"](paths), aws_s3: configs.s3(paths.dist, paths.build, pkg.version), shell: configs.shell(paths), diff --git a/Makefile b/Makefile index 6537b62cd..f9c633b8e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,13 @@ +NPM_BIN = $(shell npm bin) + BUILD_OUTPUT_DIR = _build DIST_OUTPUT_DIR = _dist +SOURCE_DIR = client +UNIT_TEST_DIR = test/unit clean: rm -rf $(BUILD_OUTPUT_DIR) rm -rf $(DIST_OUTPUT_DIR) + +jscs: + $(NPM_BIN)/jscs $(SOURCE_DIR)/js/**/*.js $(UNIT_TEST_DIR)/**/*.js diff --git a/client/js/azure/uploader.basic.js b/client/js/azure/uploader.basic.js index c7262a31c..5af7db26f 100644 --- a/client/js/azure/uploader.basic.js +++ b/client/js/azure/uploader.basic.js @@ -52,7 +52,7 @@ this._uploadSuccessParamsStore = this._createStore(this._options.uploadSuccess.params); this._uploadSuccessEndpointStore = this._createStore(this._options.uploadSuccess.endpoint); - // This will hold callbacks for failed uploadSuccess requests that will be invoked on retry. + // This will hold callbacks for failed uploadSuccess requests that will be invoked on retry. // Indexed by file ID. this._failedSuccessRequestCallbacks = {}; diff --git a/client/js/azure/util.js b/client/js/azure/util.js index a81bca6ab..f349aad0a 100644 --- a/client/js/azure/util.js +++ b/client/js/azure/util.js @@ -12,8 +12,7 @@ qq.azure.util = qq.azure.util || (function() { * @returns {Boolean} Test result. */ _paramNameMatchesAzureParameter: function(name) { - switch (name) - { + switch (name) { case "Cache-Control": case "Content-Disposition": case "Content-Encoding": diff --git a/client/js/image-support/megapix-image.js b/client/js/image-support/megapix-image.js index dc77a7ad6..4cdfef596 100644 --- a/client/js/image-support/megapix-image.js +++ b/client/js/image-support/megapix-image.js @@ -82,7 +82,7 @@ promise.success( canvas.toDataURL(mime, options.quality || 0.8) ); - }) + }); return promise; } @@ -98,7 +98,7 @@ return { newHeight: Math.round(Math.sqrt(maxPixels * (spec.origHeight / spec.origWidth))), newWidth: Math.round(Math.sqrt(maxPixels * (spec.origWidth / spec.origHeight))) - } + }; } } @@ -127,7 +127,7 @@ resize: options.resize, targetHeight: height, targetWidth: width - }) + }); } if (!qq.supportedFeatures.unlimitedScaledImageSize) { @@ -184,7 +184,7 @@ } ctx.restore(); tmpCanvas = tmpCtx = null; - }()) + }()); } else { ctx.drawImage(img, 0, 0, width, height); @@ -231,7 +231,7 @@ promise.success(); }, promise.failure - ) + ); return promise; } @@ -351,7 +351,7 @@ opt; if (this.imageLoadListeners) { - this.imageLoadListeners.push(function() { self.render(target, options) }); + this.imageLoadListeners.push(function() { self.render(target, options); }); return; } @@ -385,7 +385,7 @@ target.src = dataUri; oldTargetSrc === target.src && target.onload(); }); - }()) + }()); } else if (tagName === "canvas") { renderImageToCanvas(this.srcImage, this.blob, target, opt, doSquash); } diff --git a/client/js/upload-handler/upload.handler.controller.js b/client/js/upload-handler/upload.handler.controller.js index c71dc0107..affa91184 100644 --- a/client/js/upload-handler/upload.handler.controller.js +++ b/client/js/upload-handler/upload.handler.controller.js @@ -236,7 +236,7 @@ qq.UploadHandlerController = function(o, namespace) { ) .done(function() { handler.clearXhr(id, chunkIdx); - }) ; + }); } } }, diff --git a/lib/grunt/configs/index.js b/lib/grunt/configs/index.js index 0f5628417..1f72dc4dd 100644 --- a/lib/grunt/configs/index.js +++ b/lib/grunt/configs/index.js @@ -6,7 +6,6 @@ module.exports = { copy: require("./copy"), cssmin: require("./cssmin"), jshint: require("./jshint"), - jscs: require("./jscs"), s3: require("./s3"), shell: require("./shell"), static: require("./static"), diff --git a/lib/grunt/configs/jscs.js b/lib/grunt/configs/jscs.js deleted file mode 100644 index 145d63181..000000000 --- a/lib/grunt/configs/jscs.js +++ /dev/null @@ -1,16 +0,0 @@ -/* jshint node: true */ -module.exports = function(paths) { - "use strict"; - - return { - src: [paths.src + "/js/**/*.js", - "./*.js", - "./lib/**/*.js", - "!" + paths.src + "/js/third-party/**/*.js" - ], - tests: [], - options: { - config: ".jscsrc" - } - }; -}; diff --git a/lib/grunt/tasks/build.js b/lib/grunt/tasks/build.js index 4d4ff54ef..efcd13da8 100644 --- a/lib/grunt/tasks/build.js +++ b/lib/grunt/tasks/build.js @@ -8,8 +8,6 @@ module.exports = function(grunt) { [ "jshint:source", "jshint:tests", - "jscs:src", - "jscs:tests", "concat", "minify", "usebanner:allhead", diff --git a/package.json b/package.json index d6d5b2dda..bb86dbd90 100644 --- a/package.json +++ b/package.json @@ -54,13 +54,13 @@ "grunt-contrib-jshint": "0.7.1", "grunt-contrib-uglify": "0.2.2", "grunt-contrib-watch": "0.4.4", - "grunt-jscs": "^0.7.1", "grunt-karma": "0.6.2", "grunt-nodestatic": "0.1.2", "grunt-open": "0.2.2", "grunt-shell": "0.3.1", "grunt-strip-code": "0.1.2", "grunt-version": "0.2.2", + "jscs": "3.0.7", "karma": "0.10.10", "karma-firefox-launcher": "0.1.2", "karma-ievms": "0.0.4", @@ -81,10 +81,10 @@ "scripts": { "build": "grunt package", "devbuild": "make clean; grunt dev", - "lint": "grunt jshint:tests; grunt jshint:source; grunt jscs:tests; grunt jscs:src", + "lint": "grunt jshint:tests; grunt jshint:source; make jscs", "setup-dev": "(cd test/dev/handlers; curl -sS https://getcomposer.org/installer | php; php composer.phar install)", "start-local-dev": "(. test/dev/handlers/s3keys.sh; php -S 0.0.0.0:9090 -t . -c test/dev/handlers/php.ini)", - "test": "if test \"$TRAVIS\" = \"true\" ; then make clean ; grunt travis ; else grunt test:firefox ; fi", + "test": "if test \"$TRAVIS\" = \"true\" ; then make clean ; make jscs ; grunt travis ; else grunt test:firefox ; fi", "update-dev": "(cd test/dev/handlers; php composer.phar update)" }, "engines" : { diff --git a/test/unit/azure/simple-file-uploads.js b/test/unit/azure/simple-file-uploads.js index 936bed99c..172a6cd01 100644 --- a/test/unit/azure/simple-file-uploads.js +++ b/test/unit/azure/simple-file-uploads.js @@ -96,7 +96,6 @@ if (qqtest.canDownloadFileAsBlob) { blobUri = testEndpoint + "/" + blobName, purlSignatureUrl = purl(signatureRequest.url); - assert.equal(blobName, uploader.getUuid(0)); assert.equal(purlSignatureUrl.param("bloburi"), blobUri); }, "test"); @@ -404,17 +403,17 @@ if (qqtest.canDownloadFileAsBlob) { }); }); - + it("test if azure specific header keys and their values remain as-is", function(done) { var uploader = new qq.azure.FineUploaderBasic({ request: {endpoint: testEndpoint}, signature: {endpoint: testSignatureEndoint} } ); - + var params = { - "foo1": "bar", - "Content-Encoding": "1rawvalue==" , + foo1: "bar", + "Content-Encoding": "1rawvalue==", "Content-Disposition": "2rawvalue==", "Content-MD5": "3rawvalue==", "Cache-Control": "4rawvalue==", @@ -423,7 +422,7 @@ if (qqtest.canDownloadFileAsBlob) { "x-ms-blob-content-md5": function() { return "7rawvalue=="; }, "x-ms-blob-cache-control": "8rawvalue==" }; - + uploader.setParams(params); startTypicalTest(uploader, function(signatureRequest) { @@ -434,7 +433,7 @@ if (qqtest.canDownloadFileAsBlob) { uploadRequest.respond(201, null, ""); assert.equal(uploadRequest.requestHeaders["x-ms-meta-foo1"], "bar"); - + assert.equal(uploadRequest.requestHeaders["Content-Encoding"], params["Content-Encoding"]); assert.equal(uploadRequest.requestHeaders["Content-Disposition"], params["Content-Disposition"]); assert.equal(uploadRequest.requestHeaders["Content-MD5"], params["Content-MD5"]); diff --git a/test/unit/s3/chunked-uploads.js b/test/unit/s3/chunked-uploads.js index ad83a2d05..5826c26c1 100644 --- a/test/unit/s3/chunked-uploads.js +++ b/test/unit/s3/chunked-uploads.js @@ -227,7 +227,7 @@ if (qqtest.canDownloadFileAsBlob) { assert.equal(uploader.getUploads()[0].status, qq.status.UPLOAD_SUCCESSFUL); done(); - },100); + }, 100); }, 100); }); @@ -541,7 +541,6 @@ if (qqtest.canDownloadFileAsBlob) { uploader.retry(0); assert.equal(uploader.getUploads()[0].status, qq.status.UPLOADING); - // successful initiate signature request assert.equal(fileTestHelper.getRequests().length, 4); initiateSignatureRequest = fileTestHelper.getRequests()[3]; @@ -680,7 +679,6 @@ if (qqtest.canDownloadFileAsBlob) { uploader.retry(0); assert.equal(uploader.getUploads()[0].status, qq.status.UPLOADING); - // successful signature request for multipart complete assert.equal(fileTestHelper.getRequests().length, 21); uploadCompleteSignatureRequest = fileTestHelper.getRequests()[20]; diff --git a/test/unit/s3/serverless-uploads.js b/test/unit/s3/serverless-uploads.js index ea01174a2..ccbe488e9 100644 --- a/test/unit/s3/serverless-uploads.js +++ b/test/unit/s3/serverless-uploads.js @@ -51,7 +51,6 @@ describe("S3 serverless upload tests", function() { assert.equal(requestParams.acl, "private"); assert.ok(requestParams.file); - assert.equal(requestParams["x-amz-algorithm"], "AWS4-HMAC-SHA256"); assert.ok(new RegExp(testAccessKey + "\\/\\d{8}\\/us-east-1\\/s3\\/aws4_request").test(requestParams["x-amz-credential"])); assert.ok(requestParams["x-amz-date"]); @@ -102,7 +101,6 @@ describe("S3 serverless upload tests", function() { assert.equal(requestParams.acl, "private"); assert.ok(requestParams.file); - assert.ok(requestParams.signature); assert.ok(requestParams.policy); }); @@ -178,7 +176,6 @@ describe("S3 serverless upload tests", function() { assert.equal(requestParams.acl, "private"); assert.ok(requestParams.file); - assert.ok(requestParams.signature); assert.ok(requestParams.policy); }); @@ -232,7 +229,6 @@ describe("S3 serverless upload tests", function() { assert.equal(requestParams.acl, "private"); assert.ok(requestParams.file); - assert.ok(requestParams.signature); assert.ok(requestParams.policy); }, 10); diff --git a/test/unit/s3/simple-file-uploads.js b/test/unit/s3/simple-file-uploads.js index 7df25732b..1d207b19c 100644 --- a/test/unit/s3/simple-file-uploads.js +++ b/test/unit/s3/simple-file-uploads.js @@ -295,7 +295,7 @@ if (qqtest.canDownloadFileAsBlob) { it("respects the objectProperties.key option w/ a value of 'filename'", function(done) { var uploader = new qq.s3.FineUploaderBasic({ - request:typicalRequestOption, + request: typicalRequestOption, signature: v2SignatureOption, objectProperties: { key: "filename" @@ -322,7 +322,7 @@ if (qqtest.canDownloadFileAsBlob) { it("respects the objectProperties.key option w/ a custom key generation function", function(done) { var customKeyPrefix = "testcustomkey_", uploader = new qq.s3.FineUploaderBasic({ - request:typicalRequestOption, + request: typicalRequestOption, signature: v2SignatureOption, objectProperties: { key: function(id) { @@ -352,7 +352,7 @@ if (qqtest.canDownloadFileAsBlob) { function runTest(keyFunc, done) { var uploader = new qq.s3.FineUploaderBasic({ - request:typicalRequestOption, + request: typicalRequestOption, signature: v2SignatureOption, objectProperties: { key: keyFunc @@ -393,11 +393,10 @@ if (qqtest.canDownloadFileAsBlob) { }); }); - describe("respects the objectProperties.key option w/ a custom key generation function that returns a failed promise (no reason)", function() { function runTest(keyFunc, done) { var uploader = new qq.s3.FineUploaderBasic({ - request:typicalRequestOption, + request: typicalRequestOption, signature: v2SignatureOption, objectProperties: { key: keyFunc @@ -434,7 +433,7 @@ if (qqtest.canDownloadFileAsBlob) { describe("respects the objectProperties.key option w/ a custom key generation function that returns a failed promise (w/ reason)", function() { function runTest(keyFunc, done) { var uploader = new qq.s3.FineUploaderBasic({ - request:typicalRequestOption, + request: typicalRequestOption, signature: v2SignatureOption, objectProperties: { key: keyFunc @@ -475,7 +474,7 @@ if (qqtest.canDownloadFileAsBlob) { it("respects the objectProperties.acl option w/ a custom value set via option", function(done) { var uploader = new qq.s3.FineUploaderBasic({ - request:typicalRequestOption, + request: typicalRequestOption, signature: v2SignatureOption, objectProperties: { acl: "public-read" @@ -498,7 +497,7 @@ if (qqtest.canDownloadFileAsBlob) { it("respects the objectProperties.acl option w/ a custom value set via API", function(done) { var uploader = new qq.s3.FineUploaderBasic({ - request:typicalRequestOption, + request: typicalRequestOption, signature: v2SignatureOption, objectProperties: { acl: "public-read" @@ -523,7 +522,7 @@ if (qqtest.canDownloadFileAsBlob) { it("respects the objectProperties.reducedRedundancy option w/ a value of true", function(done) { var uploader = new qq.s3.FineUploaderBasic({ - request:typicalRequestOption, + request: typicalRequestOption, signature: v2SignatureOption, objectProperties: { reducedRedundancy: true @@ -546,7 +545,7 @@ if (qqtest.canDownloadFileAsBlob) { it("respects the objectProperties.serverSideEncryption option w/ a value of true", function(done) { var uploader = new qq.s3.FineUploaderBasic({ - request:typicalRequestOption, + request: typicalRequestOption, signature: v2SignatureOption, objectProperties: { serverSideEncryption: true @@ -571,7 +570,7 @@ if (qqtest.canDownloadFileAsBlob) { var customHeader = {"test-header-name": "test-header-value"}, customSignatureOptions = qq.extend({}, v2SignatureOption), uploader = new qq.s3.FineUploaderBasic({ - request:typicalRequestOption, + request: typicalRequestOption, signature: qq.extend(customSignatureOptions, {customHeaders: customHeader}) } ); @@ -588,7 +587,7 @@ if (qqtest.canDownloadFileAsBlob) { uploadSuccessParams = {"test-param-name": "test-param-value"}, uploadSuccessHeaders = {"test-header-name": "test-header-value"}, uploader = new qq.s3.FineUploaderBasic({ - request:typicalRequestOption, + request: typicalRequestOption, signature: v2SignatureOption, uploadSuccess: { endpoint: "foo/bar", @@ -632,7 +631,7 @@ if (qqtest.canDownloadFileAsBlob) { it("Declares an upload as a failure if uploadSuccess response indicates a problem with the file. Also tests uploadSuccessRequest endpoint option.", function(done) { var uploadSuccessUrl = "/upload/success", uploader = new qq.s3.FineUploaderBasic({ - request:typicalRequestOption, + request: typicalRequestOption, signature: v2SignatureOption, uploadSuccess: { endpoint: uploadSuccessUrl @@ -658,7 +657,7 @@ if (qqtest.canDownloadFileAsBlob) { it("Allows upload success to be sent as something other than a POST.", function(done) { var uploadSuccessUrl = "/upload/success", uploader = new qq.s3.FineUploaderBasic({ - request:typicalRequestOption, + request: typicalRequestOption, signature: v2SignatureOption, uploadSuccess: { endpoint: uploadSuccessUrl, From 86241fdcc44b5289311da81dcdcb928b613a3039 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Thu, 28 Jul 2016 22:43:29 -0500 Subject: [PATCH 04/31] chore(build): move jscs linting to makefile #1569 --- .jscsrc | 1 + Makefile | 3 +-- client/js/uploader.basic.api.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.jscsrc b/.jscsrc index 9fc2b5512..65d22060d 100644 --- a/.jscsrc +++ b/.jscsrc @@ -8,6 +8,7 @@ "maximumLineLength": false, "validateIndentation": 4, "validateQuoteMarks": "\"", + "requireDollarBeforejQueryAssignment": false, "requirePaddingNewLinesAfterBlocks": false, "requirePaddingNewLinesBeforeLineComments": false, "requireSpaceAfterComma": false, diff --git a/Makefile b/Makefile index f9c633b8e..44288fdea 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,10 @@ NPM_BIN = $(shell npm bin) BUILD_OUTPUT_DIR = _build DIST_OUTPUT_DIR = _dist SOURCE_DIR = client -UNIT_TEST_DIR = test/unit clean: rm -rf $(BUILD_OUTPUT_DIR) rm -rf $(DIST_OUTPUT_DIR) jscs: - $(NPM_BIN)/jscs $(SOURCE_DIR)/js/**/*.js $(UNIT_TEST_DIR)/**/*.js + $(NPM_BIN)/jscs $(SOURCE_DIR)/js/* diff --git a/client/js/uploader.basic.api.js b/client/js/uploader.basic.api.js index 534ee1005..b2b6086b4 100644 --- a/client/js/uploader.basic.api.js +++ b/client/js/uploader.basic.api.js @@ -230,7 +230,7 @@ return this._uploadData.retrieve({id: id}).name; }, - // Parent ID for a specific file, or null if this is the parent, or if it has no parent. + // Parent ID for a specific file, or null if this is the parent, or if it has no parent. getParentId: function(id) { var uploadDataEntry = this.getUploads({id: id}), parentId = null; From c1533d16c746746f44e51225fab0b6bad02538bb Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Thu, 28 Jul 2016 23:04:23 -0500 Subject: [PATCH 05/31] chore(build): move jshint linting to makefile #1569 --- .jshintignore | 2 +- .jshintrc | 2 +- Gruntfile.js | 1 - Makefile | 5 ++++- lib/grunt/configs/index.js | 1 - lib/grunt/configs/jshint.js | 12 ------------ lib/grunt/configs/watch.js | 2 +- lib/grunt/tasks/build.js | 2 -- package.json | 6 +++--- 9 files changed, 10 insertions(+), 23 deletions(-) delete mode 100644 lib/grunt/configs/jshint.js diff --git a/.jshintignore b/.jshintignore index a74aee2af..d073457e2 100644 --- a/.jshintignore +++ b/.jshintignore @@ -1 +1 @@ -client/js/third-party/*.js +client/js/third-party/* diff --git a/.jshintrc b/.jshintrc index 37646d82a..934eb8d9e 100644 --- a/.jshintrc +++ b/.jshintrc @@ -31,7 +31,7 @@ "eqeqeq" : true, // Require triple equals i.e. `===`. "forin" : true, // Tolerate `for in` loops without `hasOwnPrototype`. "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` - "latedef" : true, // Prohibit variable use before definition. + "latedef" : false, // Prohibit variable use before definition. "newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`. "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`. "noempty" : true, // Prohibit use of empty blocks. diff --git a/Gruntfile.js b/Gruntfile.js index e64e83b6e..29128fd28 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -42,7 +42,6 @@ module.exports = function(grunt) { concat: configs.concat(paths), copy: configs.copy(paths), cssmin: configs.cssmin(paths), - jshint: configs.jshint(paths), nodestatic: configs["static"](paths), aws_s3: configs.s3(paths.dist, paths.build, pkg.version), shell: configs.shell(paths), diff --git a/Makefile b/Makefile index 44288fdea..7c2a3355f 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,13 @@ NPM_BIN = $(shell npm bin) BUILD_OUTPUT_DIR = _build DIST_OUTPUT_DIR = _dist SOURCE_DIR = client +TEST_DIR = test +UNIT_TEST_DIR = $(TEST_DIR)/unit clean: rm -rf $(BUILD_OUTPUT_DIR) rm -rf $(DIST_OUTPUT_DIR) -jscs: +lint: $(NPM_BIN)/jscs $(SOURCE_DIR)/js/* + $(NPM_BIN)/jshint $(SOURCE_DIR)/js/* $(UNIT_TEST_DIR)/* $(TEST_DIR)/static/local/* diff --git a/lib/grunt/configs/index.js b/lib/grunt/configs/index.js index 1f72dc4dd..fd18f5ef1 100644 --- a/lib/grunt/configs/index.js +++ b/lib/grunt/configs/index.js @@ -5,7 +5,6 @@ module.exports = { concat: require("./concat"), copy: require("./copy"), cssmin: require("./cssmin"), - jshint: require("./jshint"), s3: require("./s3"), shell: require("./shell"), static: require("./static"), diff --git a/lib/grunt/configs/jshint.js b/lib/grunt/configs/jshint.js deleted file mode 100644 index 2764e75d7..000000000 --- a/lib/grunt/configs/jshint.js +++ /dev/null @@ -1,12 +0,0 @@ -/* jshint node: true */ -module.exports = function(paths) { - "use strict"; - return { - source: ["" + paths.src + "/js/**/*.js"], - tests: ["" + paths.test + "/unit/**/*.js", "" + paths.test + "/static/local/*.js"], - options: { - jshintrc: true, - ignores: ["" + paths.src + "/js/third-party/**/*.js"] - } - }; -}; diff --git a/lib/grunt/configs/watch.js b/lib/grunt/configs/watch.js index cc0b091e8..b4df3e8db 100644 --- a/lib/grunt/configs/watch.js +++ b/lib/grunt/configs/watch.js @@ -12,7 +12,7 @@ module.exports = function(paths) { }, test: { files: ["" + paths.test + "/unit/*.js", "" + paths.test + "/unit/s3/*.js"], - tasks: ["jshint:tests", "tests:local"] + tasks: ["tests:local"] }, images: { files: ["" + paths.src + "/*.gif", "" + paths.src + "/placeholders/*.png"], diff --git a/lib/grunt/tasks/build.js b/lib/grunt/tasks/build.js index efcd13da8..dc0f3f859 100644 --- a/lib/grunt/tasks/build.js +++ b/lib/grunt/tasks/build.js @@ -6,8 +6,6 @@ module.exports = function(grunt) { "build", "Build from latest source", [ - "jshint:source", - "jshint:tests", "concat", "minify", "usebanner:allhead", diff --git a/package.json b/package.json index bb86dbd90..e8d1258de 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,6 @@ "grunt-contrib-concat": "0.3.0", "grunt-contrib-copy": "0.4.1", "grunt-contrib-cssmin": "0.6.1", - "grunt-contrib-jshint": "0.7.1", "grunt-contrib-uglify": "0.2.2", "grunt-contrib-watch": "0.4.4", "grunt-karma": "0.6.2", @@ -61,6 +60,7 @@ "grunt-strip-code": "0.1.2", "grunt-version": "0.2.2", "jscs": "3.0.7", + "jshint": "2.9.2", "karma": "0.10.10", "karma-firefox-launcher": "0.1.2", "karma-ievms": "0.0.4", @@ -81,10 +81,10 @@ "scripts": { "build": "grunt package", "devbuild": "make clean; grunt dev", - "lint": "grunt jshint:tests; grunt jshint:source; make jscs", + "lint": "make lint", "setup-dev": "(cd test/dev/handlers; curl -sS https://getcomposer.org/installer | php; php composer.phar install)", "start-local-dev": "(. test/dev/handlers/s3keys.sh; php -S 0.0.0.0:9090 -t . -c test/dev/handlers/php.ini)", - "test": "if test \"$TRAVIS\" = \"true\" ; then make clean ; make jscs ; grunt travis ; else grunt test:firefox ; fi", + "test": "make lint ; if test \"$TRAVIS\" = \"true\" ; then make clean ; grunt travis ; else grunt test:firefox ; fi", "update-dev": "(cd test/dev/handlers; php composer.phar update)" }, "engines" : { From e174c39b1fb9baf4775df3104f1685f282cf8686 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Mon, 1 Aug 2016 00:19:03 -0500 Subject: [PATCH 06/31] chore(build): concat, minify, and source maps for all artifacts This includes a dnd artifacts + "core" artifacts as well. #1605 #1607 #1569 --- Makefile | 351 ++++++++++++++++++++++++++++++++++++++++++-- client/js/export.js | 15 ++ package.json | 2 +- 3 files changed, 357 insertions(+), 11 deletions(-) create mode 100644 client/js/export.js diff --git a/Makefile b/Makefile index 7c2a3355f..112ea9535 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,346 @@ -NPM_BIN = $(shell npm bin) +NPM-BIN = $(shell npm bin) -BUILD_OUTPUT_DIR = _build -DIST_OUTPUT_DIR = _dist -SOURCE_DIR = client -TEST_DIR = test -UNIT_TEST_DIR = $(TEST_DIR)/unit +BUILD-OUT-DIR = _build +DIST-OUT-DIR = _dist +SRC-DIR = client +JS-SRC-DIR = $(SRC-DIR)/js +JS-3RDPARTY-SRC-DIR = $(SRC-DIR)/js +TEST-DIR = test +UNIT-TEST-DIR = $(TEST-DIR)/unit + +EXPORT-FILE = $(JS-SRC-DIR)/export.js + +CRYPTOJS-FILES = \ + $(JS-3RDPARTY-SRC-DIR)/crypto-js/core.js \ + $(JS-3RDPARTY-SRC-DIR)/crypto-js/enc-base64.js \ + $(JS-3RDPARTY-SRC-DIR)/crypto-js/hmac.js \ + $(JS-3RDPARTY-SRC-DIR)/crypto-js/sha1.js \ + $(JS-3RDPARTY-SRC-DIR)/crypto-js/sha256.js \ + $(JS-3RDPARTY-SRC-DIR)/crypto-js/lib-typedarrays.js + +JQUERY-FILES = \ + $(JS-SRC-DIR)/jquery-plugin.js + +DND-FILES-ONLY = \ + $(JS-SRC-DIR)/dnd.js + +DND-FILES = \ + $(JS-SRC-DIR)/util.js \ + $(EXPORT-FILE) \ + $(JS-SRC-DIR)/version.js \ + $(JS-SRC-DIR)/features.js \ + $(JS-SRC-DIR)/promise.js \ + $(JS-SRC-DIR)/dnd.js + +DND-JQUERY-FILES = \ + $(JQUERY-FILES) \ + $(DND-FILES) + +CORE-FILES = \ + $(JS-SRC-DIR)/util.js \ + $(EXPORT-FILE) \ + $(JS-SRC-DIR)/error/error.js \ + $(JS-SRC-DIR)/version.js \ + $(JS-SRC-DIR)/features.js \ + $(JS-SRC-DIR)/promise.js \ + $(JS-SRC-DIR)/blob-proxy.js \ + $(JS-SRC-DIR)/button.js \ + $(JS-SRC-DIR)/upload-data.js \ + $(JS-SRC-DIR)/uploader.basic.api.js \ + $(JS-SRC-DIR)/uploader.basic.js \ + $(JS-SRC-DIR)/ajax.requester.js \ + $(JS-SRC-DIR)/upload-handler/upload.handler.js \ + $(JS-SRC-DIR)/upload-handler/upload.handler.controller.js \ + $(JS-SRC-DIR)/upload-handler/form.upload.handler.js \ + $(JS-SRC-DIR)/upload-handler/xhr.upload.handler.js \ + $(JS-SRC-DIR)/deletefile.ajax.requester.js \ + $(JS-SRC-DIR)/image-support/megapix-image.js \ + $(JS-SRC-DIR)/image-support/image.js \ + $(JS-SRC-DIR)/image-support/exif.js \ + $(JS-SRC-DIR)/identify.js \ + $(JS-SRC-DIR)/identify.js \ + $(JS-SRC-DIR)/image-support/validation.image.js \ + $(JS-SRC-DIR)/session.js \ + $(JS-SRC-DIR)/session.ajax.requester.js \ + $(JS-SRC-DIR)/image-support/scaler.js \ + $(JS-SRC-DIR)/third-party/ExifRestorer.js \ + $(JS-SRC-DIR)/total-progress.js \ + $(JS-SRC-DIR)/paste.js \ + $(JS-SRC-DIR)/form-support.js \ + +UI-FILES = \ + $(DND-FILES-ONLY) \ + $(JS-SRC-DIR)/uploader.api.js \ + $(JS-SRC-DIR)/uploader.js \ + $(JS-SRC-DIR)/templating.js \ + $(JS-SRC-DIR)/ui.handler.events.js \ + $(JS-SRC-DIR)/ui.handler.click.filebuttons.js \ + $(JS-SRC-DIR)/ui.handler.click.filename.js \ + $(JS-SRC-DIR)/ui.handler.focusin.filenameinput.js \ + $(JS-SRC-DIR)/ui.handler.focus.filenameinput.js \ + $(JS-SRC-DIR)/ui.handler.edit.filename.js + +TRADITIONAL-FILES-ONLY = \ + $(JS-SRC-DIR)/traditional/traditional.form.upload.handler.js \ + $(JS-SRC-DIR)/traditional/traditional.xhr.upload.handler.js \ + $(JS-SRC-DIR)/traditional/all-chunks-done.ajax.requester.js \ + +TRADITIONAL-FILES = \ + $(CORE-FILES) \ + $(TRADITIONAL-FILES-ONLY) + +TRADITIONAL-JQUERY-FILES = \ + $(JQUERY-FILES) \ + $(TRADITIONAL-FILES) + +TRADITIONAL-UI-FILES = \ + $(CORE-FILES) \ + $(TRADITIONAL-FILES-ONLY) \ + $(UI-FILES) + +TRADITIONAL-UI-JQUERY-FILES = \ + $(JQUERY-FILES) \ + $(TRADITIONAL-UI-FILES) + +S3-FILES-ONLY = \ + $(JS-SRC-DIR)/s3/util.js \ + $(JS-SRC-DIR)/non-traditional-common/uploader.basic.api.js \ + $(JS-SRC-DIR)/s3/uploader.basic.js \ + $(JS-SRC-DIR)/s3/request-signer.js \ + $(JS-SRC-DIR)/uploadsuccess.ajax.requester.js \ + $(JS-SRC-DIR)/s3/multipart.initiate.ajax.requester.js \ + $(JS-SRC-DIR)/s3/multipart.complete.ajax.requester.js \ + $(JS-SRC-DIR)/s3/multipart.abort.ajax.requester.js \ + $(JS-SRC-DIR)/s3/s3.xhr.upload.handler.js \ + $(JS-SRC-DIR)/s3/s3.form.upload.handler.js + +S3-FILES = \ + $(CORE-FILES) \ + $(S3-FILES-ONLY) + +S3-JQUERY-FILES = \ + $(JQUERY-FILES) \ + $(S3-FILES) + +S3-UI-FILES-ONLY = \ + $(JS-SRC-DIR)/s3/uploader.js + +S3-UI-FILES = \ + $(CORE-FILES) \ + $(S3-FILES-ONLY) \ + $(UI-FILES) \ + $(S3-UI-FILES-ONLY) \ + +S3-UI-JQUERY-FILES = \ + $(JQUERY-FILES) \ + $(S3-UI-FILES) + +AZURE-FILES-ONLY = \ + $(JS-SRC-DIR)/azure/util.js \ + $(JS-SRC-DIR)/non-traditional-common/uploader.basic.api.js \ + $(JS-SRC-DIR)/azure/uploader.basic.js \ + $(JS-SRC-DIR)/azure/azure.xhr.upload.handler.js \ + $(JS-SRC-DIR)/azure/get-sas.js \ + $(JS-SRC-DIR)/uploadsuccess.ajax.requester.js \ + $(JS-SRC-DIR)/azure/rest/delete-blob.js \ + $(JS-SRC-DIR)/azure/rest/put-blob.js \ + $(JS-SRC-DIR)/azure/rest/put-block.js \ + $(JS-SRC-DIR)/azure/rest/put-block-list.js + +AZURE-FILES = \ + $(CORE-FILES) \ + $(AZURE-FILES-ONLY) + +AZURE-JQUERY-FILES = \ + $(JQUERY-FILES) \ + $(AZURE-FILES) + +AZURE-UI-FILES-ONLY = \ + $(JS-SRC-DIR)/azure/uploader.js + +AZURE-UI-FILES = \ + $(CORE-FILES) \ + $(AZURE-FILES-ONLY) \ + $(UI-FILES) \ + $(AZURE-UI-FILES-ONLY) + +AZURE-UI-JQUERY-FILES = \ + $(JQUERY-FILES) \ + $(AZURE-UI-FILES) + +ALL-CORE-FILES = \ + $(CORE-FILES) \ + $(TRADITIONAL-FILES-ONLY) \ + $(S3-FILES-ONLY) \ + $(AZURE-FILES-ONLY) + +ALL-CORE-JQUERY-FILES = \ + $(JQUERY-FILES) \ + $(ALL-CORE-FILES) + +ALL-FILES = \ + $(CORE-FILES) \ + $(TRADITIONAL-FILES-ONLY) \ + $(UI-FILES) \ + $(S3-FILES-ONLY) \ + $(S3-UI-FILES-ONLY) \ + $(AZURE-FILES-ONLY) \ + $(AZURE-UI-FILES-ONLY) + +ALL-JQUERY-FILES = \ + $(JQUERY-FILES) \ + $(ALL-FILES) clean: - rm -rf $(BUILD_OUTPUT_DIR) - rm -rf $(DIST_OUTPUT_DIR) + rm -rf $(BUILD-OUT-DIR) + rm -rf $(DIST-OUT-DIR) lint: - $(NPM_BIN)/jscs $(SOURCE_DIR)/js/* - $(NPM_BIN)/jshint $(SOURCE_DIR)/js/* $(UNIT_TEST_DIR)/* $(TEST_DIR)/static/local/* + $(NPM-BIN)/jscs $(JS-SRC-DIR)/* + $(NPM-BIN)/jshint $(JS-SRC-DIR)/* $(UNIT-TEST-DIR)/* $(TEST-DIR)/static/local/* + +build-dnd-standalone: + $(NPM-BIN)/uglifyjs $(DND-FILES) -o $(BUILD-OUT-DIR)/dnd.js -b -e window:global --source-map $(BUILD-OUT-DIR)/dnd.js.map -p relative + +build-dnd-standalone-min: + $(NPM-BIN)/uglifyjs $(DND-FILES) -o $(BUILD-OUT-DIR)/dnd.min.js -e window:global --source-map $(BUILD-OUT-DIR)/dnd.min.js.map -p relative + +build-dnd-standalone-jquery: + $(NPM-BIN)/uglifyjs $(DND-JQUERY-FILES) -o $(BUILD-OUT-DIR)/dnd.jquery.js -b -e window:global --source-map $(BUILD-OUT-DIR)/dnd.jquery.js.map -p relative + +build-dnd-standalone-jquery-min: + $(NPM-BIN)/uglifyjs $(DND-JQUERY-FILES) -o $(BUILD-OUT-DIR)/dnd.jquery.js -e window:global --source-map $(BUILD-OUT-DIR)/dnd.jquery.js.map -p relative + +build-core-traditional: + $(NPM-BIN)/uglifyjs $(TRADITIONAL-FILES) -o $(BUILD-OUT-DIR)/core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/core.fine-uploader.js.map -p relative + +build-core-traditional-min: + $(NPM-BIN)/uglifyjs $(TRADITIONAL-FILES) -o $(BUILD-OUT-DIR)/core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/core.fine-uploader.min.js.map -p relative + +build-core-traditional-jquery: + $(NPM-BIN)/uglifyjs $(TRADITIONAL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/core.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/core.jquery.fine-uploader.js.map -p relative + +build-core-traditional-jquery-min: + $(NPM-BIN)/uglifyjs $(TRADITIONAL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/core.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/core.jquery.fine-uploader.min.js.map -p relative + +build-ui-traditional: + $(NPM-BIN)/uglifyjs $(TRADITIONAL-UI-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/fine-uploader.js.map -p relative + +build-ui-traditional-min: + $(NPM-BIN)/uglifyjs $(TRADITIONAL-UI-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/fine-uploader.min.js.map -p relative + +build-ui-traditional-jquery: + $(NPM-BIN)/uglifyjs $(TRADITIONAL-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.jquery.js -b -e window:global --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.js.map -p relative + +build-ui-traditional-jquery-min: + $(NPM-BIN)/uglifyjs $(TRADITIONAL-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.jquery.min.js -e window:global --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.min.js.map -p relative + +build-core-s3: + $(NPM-BIN)/uglifyjs $(S3-FILES) -o $(BUILD-OUT-DIR)/s3.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.core.fine-uploader.js.map -p relative + +build-core-s3-min: + $(NPM-BIN)/uglifyjs $(S3-FILES) -o $(BUILD-OUT-DIR)/s3.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.core.fine-uploader.min.js.map -p relative + +build-core-s3-jquery: + $(NPM-BIN)/uglifyjs $(S3-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.js.map -p relative + +build-core-s3-jquery-min: + $(NPM-BIN)/uglifyjs $(S3-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.min.js.map -p relative + +build-ui-s3: + $(NPM-BIN)/uglifyjs $(S3-UI-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.js.map -p relative + +build-ui-s3-min: + $(NPM-BIN)/uglifyjs $(S3-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.min.js.map -p relative + +build-ui-s3-jquery: + $(NPM-BIN)/uglifyjs $(S3-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.js.map -p relative + +build-ui-s3-jquery-min: + $(NPM-BIN)/uglifyjs $(S3-UI-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.min.js.map -p relative + +build-core-azure: + $(NPM-BIN)/uglifyjs $(AZURE-FILES) -o $(BUILD-OUT-DIR)/azure.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.core.fine-uploader.js.map -p relative + +build-core-azure-min: + $(NPM-BIN)/uglifyjs $(AZURE-FILES) -o $(BUILD-OUT-DIR)/azure.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.core.fine-uploader.min.js.map -p relative + +build-core-azure-jquery: + $(NPM-BIN)/uglifyjs $(AZURE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.js.map -p relative + +build-core-azure-jquery-min: + $(NPM-BIN)/uglifyjs $(AZURE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.min.js.map -p relative + +build-ui-azure: + $(NPM-BIN)/uglifyjs $(AZURE-UI-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.js.map -p relative + +build-ui-azure-min: + $(NPM-BIN)/uglifyjs $(AZURE-UI-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.min.js.map -p relative + +build-ui-azure-jquery: + $(NPM-BIN)/uglifyjs $(AZURE-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.js.map -p relative + +build-ui-azure-jquery-min: + $(NPM-BIN)/uglifyjs $(AZURE-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.min.js.map -p relative + +build-all-core: + $(NPM-BIN)/uglifyjs $(ALL-CORE-FILES) -o $(BUILD-OUT-DIR)/all.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.core.fine-uploader.js.map -p relative + +build-all-core-min: + $(NPM-BIN)/uglifyjs $(ALL-CORE-FILES) -o $(BUILD-OUT-DIR)/all.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.core.fine-uploader.min.js.map -p relative + +build-all-core-jquery: + $(NPM-BIN)/uglifyjs $(ALL-CORE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.js.map -p relative + +build-all-core-jquery-min: + $(NPM-BIN)/uglifyjs $(ALL-CORE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.min.js.map -p relative + +build-all-ui: + $(NPM-BIN)/uglifyjs $(ALL-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.js.map -p relative + +build-all-ui-min: + $(NPM-BIN)/uglifyjs $(ALL-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.min.js.map -p relative + +build-all-ui-jquery: + $(NPM-BIN)/uglifyjs $(ALL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.fine-uploader.js.map -p relative + +build-all-ui-jquery-min: + $(NPM-BIN)/uglifyjs $(ALL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.fine-uploader.min.js.map -p relative + +build: \ + build-dnd-standalone \ + build-dnd-standalone-min \ + build-dnd-standalone-jquery \ + build-dnd-standalone-jquery-min \ + build-core-traditional \ + build-core-traditional-min \ + build-core-traditional-jquery \ + build-core-traditional-jquery-min \ + build-ui-traditional \ + build-ui-traditional-min \ + build-ui-traditional-jquery \ + build-ui-traditional-jquery-min \ + build-core-s3 \ + build-core-s3-min \ + build-core-s3-jquery \ + build-core-s3-jquery-min \ + build-ui-s3 \ + build-ui-s3-min \ + build-ui-s3-jquery \ + build-ui-s3-jquery-min \ + build-core-azure \ + build-core-azure-min \ + build-core-azure-jquery \ + build-core-azure-jquery-min \ + build-ui-azure \ + build-ui-azure-min \ + build-ui-azure-jquery \ + build-ui-azure-jquery-min \ + build-all-core \ + build-all-core-min \ + build-all-core-jquery \ + build-all-core-jquery-min \ + build-all-ui \ + build-all-ui-min \ + build-all-ui-jquery \ + build-all-ui-jquery-min diff --git a/client/js/export.js b/client/js/export.js new file mode 100644 index 000000000..597b033f6 --- /dev/null +++ b/client/js/export.js @@ -0,0 +1,15 @@ +/* globals define, module, global, qq */ +(function() { + "use strict"; + if (typeof define === "function" && define.amd) { + define(function() { + return qq; + }); + } + else if (typeof module !== "undefined" && module.exports) { + module.exports = qq; + } + else { + global.qq = qq; + } +}()); diff --git a/package.json b/package.json index e8d1258de..23f321f41 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,6 @@ "grunt-contrib-concat": "0.3.0", "grunt-contrib-copy": "0.4.1", "grunt-contrib-cssmin": "0.6.1", - "grunt-contrib-uglify": "0.2.2", "grunt-contrib-watch": "0.4.4", "grunt-karma": "0.6.2", "grunt-nodestatic": "0.1.2", @@ -75,6 +74,7 @@ "semver": "2.0.x", "string.prototype.endswith": "0.2.0", "time-grunt": "^1.0.0", + "uglify-js": "2.7.0", "underscore": "1.5.2", "uuid": "1.4.1" }, From d034eed10d79be5f03a39608a005bc4a9105b568 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Mon, 1 Aug 2016 00:39:13 -0500 Subject: [PATCH 07/31] fix(build): travis tests fail w/out grunt uglify Not yet ready to remove grunt. I need to migrate the karma stuff over first. #1605 #1607 #1569 --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 23f321f41..6816bd15d 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "grunt-contrib-concat": "0.3.0", "grunt-contrib-copy": "0.4.1", "grunt-contrib-cssmin": "0.6.1", + "grunt-contrib-uglify": "0.2.2", "grunt-contrib-watch": "0.4.4", "grunt-karma": "0.6.2", "grunt-nodestatic": "0.1.2", From c63725a8c585fd59e70b17a6c38de43b846ecf93 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Wed, 3 Aug 2016 00:04:02 -0500 Subject: [PATCH 08/31] chore(build): move test runner logic into Makefile #1569 --- .gitignore | 2 +- Makefile | 24 +++++++++++++- config/karma.conf.js | 33 +++++++++++++++++++ lib/browsers.coffee | 55 -------------------------------- lib/karma/karma-local.conf.js | 15 --------- lib/karma/karma-travis.conf.js | 19 ----------- lib/karma/karma.conf.js | 21 ------------ package.json | 3 +- test/unit/iframe.xss.response.js | 7 ++-- 9 files changed, 61 insertions(+), 118 deletions(-) create mode 100644 config/karma.conf.js delete mode 100644 lib/browsers.coffee delete mode 100644 lib/karma/karma-local.conf.js delete mode 100644 lib/karma/karma-travis.conf.js delete mode 100644 lib/karma/karma.conf.js diff --git a/.gitignore b/.gitignore index e9dc0d418..2590c891c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,7 @@ master hardcopy* selenium.log* -pid.txt +test-server.PID fine-uploader/ test/upload/* diff --git a/Makefile b/Makefile index 112ea9535..2dfeeae75 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ BUILD-OUT-DIR = _build DIST-OUT-DIR = _dist SRC-DIR = client JS-SRC-DIR = $(SRC-DIR)/js -JS-3RDPARTY-SRC-DIR = $(SRC-DIR)/js +JS-3RDPARTY-SRC-DIR = $(JS-SRC-DIR)/third-party TEST-DIR = test UNIT-TEST-DIR = $(TEST-DIR)/unit @@ -103,6 +103,7 @@ TRADITIONAL-UI-JQUERY-FILES = \ $(TRADITIONAL-UI-FILES) S3-FILES-ONLY = \ + $(CRYPTOJS-FILES) \ $(JS-SRC-DIR)/s3/util.js \ $(JS-SRC-DIR)/non-traditional-common/uploader.basic.api.js \ $(JS-SRC-DIR)/s3/uploader.basic.js \ @@ -344,3 +345,24 @@ build: \ build-all-ui-min \ build-all-ui-jquery \ build-all-ui-jquery-min + +start-test-resources-server: test-resources-server.PID + +start-root-server: root-server.PID + +test-resources-server.PID: + $(NPM-BIN)/static test/unit/resources -H '{"Access-Control-Allow-Origin": "*"}' -p 3000 & echo $$! > $@ + +root-server.PID: + $(NPM-BIN)/static . -p 3001 & echo $$! > $@ + +stop-test-resources-server: test-resources-server.PID + kill `cat $<` && rm $< + +stop-root-server: root-server.PID + kill `cat $<` && rm $< + +test: start-test-resources-server start-root-server build-all-ui + $(NPM-BIN)/karma start config/karma.conf.js + make stop-test-resources-server + make stop-root-server diff --git a/config/karma.conf.js b/config/karma.conf.js new file mode 100644 index 000000000..b21608509 --- /dev/null +++ b/config/karma.conf.js @@ -0,0 +1,33 @@ +/* jshint node: true */ +var path = require("path"); + +module.exports = function(config, options) { + "use strict"; + + return config.set({ + browsers: ["Firefox"], + captureTimeout: 60000, + files: [ + path.resolve("_build/all.fine-uploader.js"), + path.resolve("test/static/third-party/assert/assert.js"), + path.resolve("test/static/third-party/jquery/jquery.js"), + path.resolve("test/static/third-party/jquery.simulate/jquery.simulate.js"), + path.resolve("test/static/third-party/purl/purl.js"), + path.resolve("test/static/third-party/sinon/sinon.js"), + path.resolve("test/static/third-party/sinon/event.js"), + path.resolve("test/static/third-party/sinon/fake_xml_http_request.js"), + path.resolve("test/static/local/formdata.js"), + path.resolve("test/static/local/karma-runner.js"), + path.resolve("test/static/local/blob-maker.js"), + path.resolve("test/static/third-party/q/q-1.0.1.js"), + path.resolve("node_modules/pica/dist/pica.js"), + path.resolve("test/static/local/helpme.js"), + path.resolve("test/unit/**/*.js") + ], + logLevel: config.LOG_INFO, + logColors: true, + frameworks: ["mocha"], + reporters: ["spec"], + singleRun: true + }); +}; diff --git a/lib/browsers.coffee b/lib/browsers.coffee deleted file mode 100644 index f1cc86ea1..000000000 --- a/lib/browsers.coffee +++ /dev/null @@ -1,55 +0,0 @@ -# Browsers, for testing - -browsers = - [ - browserName: "chrome" - platform: "Linux" - version: "28" - , - browserName: "firefox" - platform: "Linux" - version: "26" - , - browserName: "android" - platform: "Linux" - version: "4.0" - , - browserName: "safari" - platform: "OS X 10.8" - version: "6" - , - browserName: "safari" - platform: "OS X 10.6" - version: "5" - , - browserName: "iphone" - platform: "OS X 10.8" - version: "6" - , -# browserName: "iphone" -# platform: "OS X 10.9" -# version: "7" -# , - browserName: "internet explorer" - platform: "Windows 8.1" - version: "11" - , - browserName: "internet explorer" - platform: "Windows 8" - version: "10" - , - browserName: "internet explorer" - platform: "Windows 7" - version: "9" - , - browserName: "internet explorer" - platform: "Windows 7" - version: "8" - , - browserName: "internet explorer" - platform: "Windows XP" - version: "7" - ] - -if (exports) - exports.modules = browsers diff --git a/lib/karma/karma-local.conf.js b/lib/karma/karma-local.conf.js deleted file mode 100644 index a72104f8c..000000000 --- a/lib/karma/karma-local.conf.js +++ /dev/null @@ -1,15 +0,0 @@ -/* jshint node: true */ -var sharedConfig = require("./karma.conf"); - -module.exports = function(config, options) { - "use strict"; - if (options == null) { - options = {}; - } - sharedConfig(config); - return config.set({ - testName: "[local] FineUploader: tests", - logFile: "fineuploader.log", - autoWatch: true - }); -}; diff --git a/lib/karma/karma-travis.conf.js b/lib/karma/karma-travis.conf.js deleted file mode 100644 index de3f6355b..000000000 --- a/lib/karma/karma-travis.conf.js +++ /dev/null @@ -1,19 +0,0 @@ -/* jshint node: true */ -var sharedConfig = require("./karma.conf"); - -module.exports = function(config, options) { - "use strict"; - - if (options == null) { - options = {}; - } - sharedConfig(config); - return config.set({ - testName: "[travis] Fine Uploader tests", - logFile: "fineuploader-travis.log", - singleRun: true, - autoWatch: false, - transports: ["xhr-polling"], - browsers: ["Firefox"] - }); -}; diff --git a/lib/karma/karma.conf.js b/lib/karma/karma.conf.js deleted file mode 100644 index 99ffc1331..000000000 --- a/lib/karma/karma.conf.js +++ /dev/null @@ -1,21 +0,0 @@ -/* jshint node: true */ -var modules = require("../modules"), - allBrowsers = require("../browsers"); - -module.exports = function(config, options) { - "use strict"; - - if (options == null) { - options = {}; - } - return config.set({ - files: modules.mergeModules(true, "karmaModules", "fuSrcBuild", "fuIframeXssResponse", "testHelperModules", "fuUnit"), - basePath: "../..", - logLevel: config.LOG_INFO, - logColors: true, - frameworks: ["mocha"], - reporters: ["spec"], - captureTimeout: 60000, - colors: true - }); -}; diff --git a/package.json b/package.json index 6816bd15d..8237faf73 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "karma-opera-launcher": "0.1.0", "karma-safari-launcher": "0.1.1", "karma-spec-reporter": "0.0.13", + "node-static": "0.7.8 ", "npm": "^2.1.17", "optimist": "0.6.0", "pica": "latest", @@ -85,7 +86,7 @@ "lint": "make lint", "setup-dev": "(cd test/dev/handlers; curl -sS https://getcomposer.org/installer | php; php composer.phar install)", "start-local-dev": "(. test/dev/handlers/s3keys.sh; php -S 0.0.0.0:9090 -t . -c test/dev/handlers/php.ini)", - "test": "make lint ; if test \"$TRAVIS\" = \"true\" ; then make clean ; grunt travis ; else grunt test:firefox ; fi", + "test": "make test", "update-dev": "(cd test/dev/handlers; php composer.phar update)" }, "engines" : { diff --git a/test/unit/iframe.xss.response.js b/test/unit/iframe.xss.response.js index 82bb7d1cc..ad81c50a4 100644 --- a/test/unit/iframe.xss.response.js +++ b/test/unit/iframe.xss.response.js @@ -3,11 +3,8 @@ if (window.postMessage) { describe("iframe.xss.response", function () { "use strict"; - var iframe, doc; - var script = ""; - if (window.mochaResults) { - script = ""; - } + var iframe, doc, + script = ""; beforeEach(function () { iframe = document.createElement("iframe"); From df7611471ceb8dcb55ddab6f04c626175b205d55 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Wed, 3 Aug 2016 00:15:49 -0500 Subject: [PATCH 09/31] fix(build): create _build dir before building #1569 --- .gitignore | 3 ++- Makefile | 76 ++++++++++++++++++++++++++++-------------------------- 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index 2590c891c..11982d1ef 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,8 @@ master hardcopy* selenium.log* -test-server.PID +root-server.PID +test-resources-server.PID fine-uploader/ test/upload/* diff --git a/Makefile b/Makefile index 2dfeeae75..5dc8e309c 100644 --- a/Makefile +++ b/Makefile @@ -200,112 +200,116 @@ lint: $(NPM-BIN)/jscs $(JS-SRC-DIR)/* $(NPM-BIN)/jshint $(JS-SRC-DIR)/* $(UNIT-TEST-DIR)/* $(TEST-DIR)/static/local/* -build-dnd-standalone: +_build: + mkdir $@ + + +build-dnd-standalone: _build $(NPM-BIN)/uglifyjs $(DND-FILES) -o $(BUILD-OUT-DIR)/dnd.js -b -e window:global --source-map $(BUILD-OUT-DIR)/dnd.js.map -p relative -build-dnd-standalone-min: +build-dnd-standalone-min: _build $(NPM-BIN)/uglifyjs $(DND-FILES) -o $(BUILD-OUT-DIR)/dnd.min.js -e window:global --source-map $(BUILD-OUT-DIR)/dnd.min.js.map -p relative -build-dnd-standalone-jquery: +build-dnd-standalone-jquery: _build $(NPM-BIN)/uglifyjs $(DND-JQUERY-FILES) -o $(BUILD-OUT-DIR)/dnd.jquery.js -b -e window:global --source-map $(BUILD-OUT-DIR)/dnd.jquery.js.map -p relative -build-dnd-standalone-jquery-min: +build-dnd-standalone-jquery-min: _build $(NPM-BIN)/uglifyjs $(DND-JQUERY-FILES) -o $(BUILD-OUT-DIR)/dnd.jquery.js -e window:global --source-map $(BUILD-OUT-DIR)/dnd.jquery.js.map -p relative -build-core-traditional: +build-core-traditional: _build $(NPM-BIN)/uglifyjs $(TRADITIONAL-FILES) -o $(BUILD-OUT-DIR)/core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/core.fine-uploader.js.map -p relative -build-core-traditional-min: +build-core-traditional-min: _build $(NPM-BIN)/uglifyjs $(TRADITIONAL-FILES) -o $(BUILD-OUT-DIR)/core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/core.fine-uploader.min.js.map -p relative -build-core-traditional-jquery: +build-core-traditional-jquery: _build $(NPM-BIN)/uglifyjs $(TRADITIONAL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/core.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/core.jquery.fine-uploader.js.map -p relative -build-core-traditional-jquery-min: +build-core-traditional-jquery-min: _build $(NPM-BIN)/uglifyjs $(TRADITIONAL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/core.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/core.jquery.fine-uploader.min.js.map -p relative -build-ui-traditional: +build-ui-traditional: _build $(NPM-BIN)/uglifyjs $(TRADITIONAL-UI-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/fine-uploader.js.map -p relative -build-ui-traditional-min: +build-ui-traditional-min: _build $(NPM-BIN)/uglifyjs $(TRADITIONAL-UI-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/fine-uploader.min.js.map -p relative -build-ui-traditional-jquery: +build-ui-traditional-jquery: _build $(NPM-BIN)/uglifyjs $(TRADITIONAL-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.jquery.js -b -e window:global --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.js.map -p relative -build-ui-traditional-jquery-min: +build-ui-traditional-jquery-min: _build $(NPM-BIN)/uglifyjs $(TRADITIONAL-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.jquery.min.js -e window:global --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.min.js.map -p relative -build-core-s3: +build-core-s3: _build $(NPM-BIN)/uglifyjs $(S3-FILES) -o $(BUILD-OUT-DIR)/s3.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.core.fine-uploader.js.map -p relative -build-core-s3-min: +build-core-s3-min: _build $(NPM-BIN)/uglifyjs $(S3-FILES) -o $(BUILD-OUT-DIR)/s3.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.core.fine-uploader.min.js.map -p relative -build-core-s3-jquery: +build-core-s3-jquery: _build $(NPM-BIN)/uglifyjs $(S3-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.js.map -p relative -build-core-s3-jquery-min: +build-core-s3-jquery-min: _build $(NPM-BIN)/uglifyjs $(S3-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.min.js.map -p relative -build-ui-s3: +build-ui-s3: _build $(NPM-BIN)/uglifyjs $(S3-UI-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.js.map -p relative -build-ui-s3-min: +build-ui-s3-min: _build $(NPM-BIN)/uglifyjs $(S3-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.min.js.map -p relative -build-ui-s3-jquery: +build-ui-s3-jquery: _build $(NPM-BIN)/uglifyjs $(S3-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.js.map -p relative -build-ui-s3-jquery-min: +build-ui-s3-jquery-min: _build $(NPM-BIN)/uglifyjs $(S3-UI-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.min.js.map -p relative -build-core-azure: +build-core-azure: _build $(NPM-BIN)/uglifyjs $(AZURE-FILES) -o $(BUILD-OUT-DIR)/azure.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.core.fine-uploader.js.map -p relative -build-core-azure-min: +build-core-azure-min: _build $(NPM-BIN)/uglifyjs $(AZURE-FILES) -o $(BUILD-OUT-DIR)/azure.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.core.fine-uploader.min.js.map -p relative -build-core-azure-jquery: +build-core-azure-jquery: _build $(NPM-BIN)/uglifyjs $(AZURE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.js.map -p relative -build-core-azure-jquery-min: +build-core-azure-jquery-min: _build $(NPM-BIN)/uglifyjs $(AZURE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.min.js.map -p relative -build-ui-azure: +build-ui-azure: _build $(NPM-BIN)/uglifyjs $(AZURE-UI-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.js.map -p relative -build-ui-azure-min: +build-ui-azure-min: _build $(NPM-BIN)/uglifyjs $(AZURE-UI-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.min.js.map -p relative -build-ui-azure-jquery: +build-ui-azure-jquery: _build $(NPM-BIN)/uglifyjs $(AZURE-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.js.map -p relative -build-ui-azure-jquery-min: +build-ui-azure-jquery-min: _build $(NPM-BIN)/uglifyjs $(AZURE-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.min.js.map -p relative -build-all-core: +build-all-core: _build $(NPM-BIN)/uglifyjs $(ALL-CORE-FILES) -o $(BUILD-OUT-DIR)/all.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.core.fine-uploader.js.map -p relative -build-all-core-min: +build-all-core-min: _build $(NPM-BIN)/uglifyjs $(ALL-CORE-FILES) -o $(BUILD-OUT-DIR)/all.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.core.fine-uploader.min.js.map -p relative -build-all-core-jquery: +build-all-core-jquery: _build $(NPM-BIN)/uglifyjs $(ALL-CORE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.js.map -p relative -build-all-core-jquery-min: +build-all-core-jquery-min: _build $(NPM-BIN)/uglifyjs $(ALL-CORE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.min.js.map -p relative -build-all-ui: +build-all-ui: _build $(NPM-BIN)/uglifyjs $(ALL-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.js.map -p relative -build-all-ui-min: +build-all-ui-min: _build $(NPM-BIN)/uglifyjs $(ALL-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.min.js.map -p relative -build-all-ui-jquery: +build-all-ui-jquery: _build $(NPM-BIN)/uglifyjs $(ALL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.fine-uploader.js.map -p relative -build-all-ui-jquery-min: +build-all-ui-jquery-min: _build $(NPM-BIN)/uglifyjs $(ALL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.fine-uploader.min.js.map -p relative build: \ From 4d797bdb6973d2268f590ef6095a5dc61afe82c7 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Wed, 3 Aug 2016 00:18:48 -0500 Subject: [PATCH 10/31] chore(build): lint before test #1569 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8237faf73..120301c08 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "lint": "make lint", "setup-dev": "(cd test/dev/handlers; curl -sS https://getcomposer.org/installer | php; php composer.phar install)", "start-local-dev": "(. test/dev/handlers/s3keys.sh; php -S 0.0.0.0:9090 -t . -c test/dev/handlers/php.ini)", - "test": "make test", + "test": "make lint && make test", "update-dev": "(cd test/dev/handlers; php composer.phar update)" }, "engines" : { From 20f904c4ff774db33ec665ac980d59d884599eae Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Wed, 3 Aug 2016 00:24:45 -0500 Subject: [PATCH 11/31] chore(build): cleanup test-related Grunt deps #1569 --- Gruntfile.js | 17 ++----- lib/grunt/configs/static.js | 15 ------ lib/grunt/configs/watch.js | 22 -------- lib/grunt/tasks/server.js | 6 --- lib/grunt/tasks/test.js | 90 --------------------------------- lib/grunt/tasks/tests.js | 31 ------------ lib/grunt/utils.coffee | 41 --------------- lib/travis/travis_print_logs.sh | 11 ---- package.json | 6 --- 9 files changed, 3 insertions(+), 236 deletions(-) delete mode 100644 lib/grunt/configs/static.js delete mode 100644 lib/grunt/configs/watch.js delete mode 100644 lib/grunt/tasks/server.js delete mode 100644 lib/grunt/tasks/test.js delete mode 100644 lib/grunt/tasks/tests.js delete mode 100644 lib/grunt/utils.coffee delete mode 100755 lib/travis/travis_print_logs.sh diff --git a/Gruntfile.js b/Gruntfile.js index 29128fd28..7938fae99 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -11,13 +11,11 @@ module.exports = function(grunt) { require("time-grunt")(grunt); - var allBrowsers, async, browsers, configs, fineUploaderModules, fs, name, path, paths, pkg, spawn, tasks, utils, uuid; + var async, configs, fs, name, path, paths, pkg, tasks, utils, uuid; fs = require("fs"); uuid = require("uuid"); async = require("async"); - path = require("path"); - spawn = require("child_process").spawn; utils = require("./lib/grunt/utils"); configs = require("./lib/grunt/configs"); tasks = "./lib/grunt/tasks"; @@ -29,12 +27,8 @@ module.exports = function(grunt) { build: "./_build", src: "./client", html: "./client/html/templates", - docs: "./docs", - test: "./test" + docs: "./docs" }; - allBrowsers = require("./lib/browsers"); - browsers = allBrowsers.browsers; - fineUploaderModules = require("./lib/modules"); grunt.initConfig({ pkg: pkg, paths: paths, @@ -42,18 +36,13 @@ module.exports = function(grunt) { concat: configs.concat(paths), copy: configs.copy(paths), cssmin: configs.cssmin(paths), - nodestatic: configs["static"](paths), aws_s3: configs.s3(paths.dist, paths.build, pkg.version), shell: configs.shell(paths), strip_code: configs.stripcode(paths), uglify: configs.uglify(paths), usebanner: configs.banner(paths), version: configs.version(pkg), - watch: configs.watch(paths), - tests: { - local: "./lib/karma/karma-local.conf.js", - travis: "./lib/karma/karma-travis.conf.js" - } + watch: configs.watch(paths) }); for (name in pkg.devDependencies) { diff --git a/lib/grunt/configs/static.js b/lib/grunt/configs/static.js deleted file mode 100644 index 33a50e542..000000000 --- a/lib/grunt/configs/static.js +++ /dev/null @@ -1,15 +0,0 @@ -/* jshint node: true */ -module.exports = function(paths) { - "use strict"; - return { - server: { - options: { - port: 3000, - base: paths.test + "/unit/resources", - headers: { - "Access-Control-Allow-Origin": "*" - } - } - } - }; -}; diff --git a/lib/grunt/configs/watch.js b/lib/grunt/configs/watch.js deleted file mode 100644 index b4df3e8db..000000000 --- a/lib/grunt/configs/watch.js +++ /dev/null @@ -1,22 +0,0 @@ -/* jshint node: true */ -module.exports = function(paths) { - "use strict"; - return { - options: { - interrupt: true, - debounceDelay: 250 - }, - js: { - files: ["" + paths.src + "/js/*.js", "" + paths.src + "/js/s3/*.js"], - tasks: ["dev", "tests:local"] - }, - test: { - files: ["" + paths.test + "/unit/*.js", "" + paths.test + "/unit/s3/*.js"], - tasks: ["tests:local"] - }, - images: { - files: ["" + paths.src + "/*.gif", "" + paths.src + "/placeholders/*.png"], - tasks: ["copy:images"] - } - }; -}; diff --git a/lib/grunt/tasks/server.js b/lib/grunt/tasks/server.js deleted file mode 100644 index 9cffc3faa..000000000 --- a/lib/grunt/tasks/server.js +++ /dev/null @@ -1,6 +0,0 @@ -/* jshint node: true */ -module.exports = function(grunt) { - "use strict"; - - grunt.registerTask("server", ["nodestatic"]); -}; diff --git a/lib/grunt/tasks/test.js b/lib/grunt/tasks/test.js deleted file mode 100644 index 67eff6579..000000000 --- a/lib/grunt/tasks/test.js +++ /dev/null @@ -1,90 +0,0 @@ -/* jshint node: true */ -// To run this task: -// % grunt test: -// -// Where is either: -// * 'travis', 'server', 'headless', 'ie', 'ios', or 'all' -// * a comma-delimited list of browsers. -// -// Example: -// % grunt test:server -// % grunt test:firefox -// % grunt test:firefox --no-single-run -// % grunt test:Firefox,Chrome,Opera,Safari -// % grunt test:ie -// % grunt test:Firefox,Chrome,Opera,Safari --autoWatch=true --singleRun=true -// etc... - -module.exports = function(grunt) { - "use strict"; - - grunt.registerTask("test", "Run unit tests. Allows: 'travis', 'server', 'headless', 'ie', and 'all'. Can also take browser names: 'Firefox', 'Chrome', 'Safari', etc.. Comma-delimited.", function(testType) { - var setDefaultOption, taskList; - taskList = ["server"]; - setDefaultOption = function(name, def) { - if (grunt.option(name) == null) { - return grunt.option(name, def); - } - }; - switch (testType) { - case "travis": - (function() { - setDefaultOption("singleRun", true); - setDefaultOption("autoWatch", true); - return taskList.push("tests:travis"); - })(); - break; - case "server": - (function() { - setDefaultOption("singleRun", false); - setDefaultOption("autoWatch", false); - grunt.option("browsers", []); - return taskList.push("tests:local"); - })(); - break; - case "firefox": - (function() { - setDefaultOption("singleRun", true); - setDefaultOption("autoWatch", true); - taskList.push("tests:local"); - return grunt.option("browsers", ["Firefox"]); - })(); - break; - case "ios": - (function() { - setDefaultOption("singleRun", true); - setDefaultOption("autoWatch", true); - grunt.option("browsers", ["iOS"]); - return taskList.push("tests:local"); - })(); - break; - case "all": - (function() { - setDefaultOption("singleRun", true); - setDefaultOption("autoWatch", true); - grunt.option("browsers", ["Firefox", "Chrome", "Safari", "Opera", "IE7 - WinXP", "IE8 - WinXP", "IE9 - Win7", "IE10 - Win7", "IE11 - Win7"]); - return taskList.push("tests:local"); - })(); - break; - default: - (function() { - var tests; - if ((testType != null)) { - setDefaultOption("singleRun", true); - setDefaultOption("autoWatch", true); - if (tests.indexOf(testType, ",") >= 0) { - tests = testType.split(","); - grunt.option("browsers", tests); - } else { - grunt.option("browsers", [testType]); - } - } else { - grunt.option("browsers") || ["Chrome"]; - } - return taskList.push("tests:local"); - })(); - } - return grunt.task.run(taskList); - }); - -}; diff --git a/lib/grunt/tasks/tests.js b/lib/grunt/tasks/tests.js deleted file mode 100644 index b18e70e71..000000000 --- a/lib/grunt/tasks/tests.js +++ /dev/null @@ -1,31 +0,0 @@ -/* jshint node: true */ -var spawn = require("child_process").spawn; - -module.exports = function(grunt) { - "use strict"; - - grunt.registerMultiTask("tests", "** Use ` grunt-test` instead **", function() { - return startKarma.call(this, this.data, this.async()); - }); - - function startKarma(config, done) { - var args, autoWatch, browsers, p, port, reporters, singleRun; - browsers = grunt.option("browsers"); - reporters = grunt.option("reporters"); - port = grunt.option("port"); - autoWatch = grunt.option("autoWatch"); - singleRun = grunt.option("singleRun"); - args = ["node_modules/karma/bin/karma", "start", config, singleRun ? "--single-run" : "", autoWatch ? "--auto-watch" : "", reporters ? "--reporters=" + reporters : "", browsers ? "--browsers=" + browsers : "", port ? "--port=" + port : ""]; - console.log(args); - p = spawn("node", args); - p.stdout.pipe(process.stdout); - p.stderr.pipe(process.stderr); - return p.on("exit", function(code) { - if (code !== 0) { - grunt.fail.warn("Karma test(s) failed. Exit code: " + code); - } - return done(); - }); - } - -}; diff --git a/lib/grunt/utils.coffee b/lib/grunt/utils.coffee deleted file mode 100644 index 2af46faf1..000000000 --- a/lib/grunt/utils.coffee +++ /dev/null @@ -1,41 +0,0 @@ -spawn = require('child_process').spawn -path = require 'path' -glob = require 'glob' -grunt = require 'grunt' -_ = grunt.util._ -modules = require '../modules' - -module.exports = - - startKarma: (config, done) -> - browsers = grunt.option 'browsers' - reporters = grunt.option 'reporters' - port = grunt.option 'port' - autoWatch = grunt.option 'autoWatch' - singleRun = grunt.option 'singleRun' - args = ['node_modules/karma/bin/karma', 'start', config, - if singleRun then '--single-run' else '', - if autoWatch then '--auto-watch' else '', - if reporters then '--reporters=' + reporters else '', - if browsers then '--browsers=' + browsers else '', - if port then '--port=' + port else '' - ] - console.log(args) - p = spawn 'node', args - p.stdout.pipe process.stdout - p.stderr.pipe process.stderr - p.on 'exit', (code) -> - if code != 0 - grunt.fail.warn "Karma test(s) failed. Exit code: " + code - done() - - concat: (formulae) -> - src = '' - _.map(formulae, (f) -> - files = glob.sync(f) - _.map(files, (file) -> - src = grunt.file.read file - src - ).join(grunt.util.linefeed) - ).join(grunt.util.linefeed) - diff --git a/lib/travis/travis_print_logs.sh b/lib/travis/travis_print_logs.sh deleted file mode 100755 index ec612ca17..000000000 --- a/lib/travis/travis_print_logs.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -LOG_FILES=$LOGS_DIR/* - -for FILE in $LOG_FILES; do - echo -e "\n\n\n" - echo "================================================================================" - echo " $FILE" - echo "================================================================================" - cat $FILE -done diff --git a/package.json b/package.json index 120301c08..664f8ef8e 100644 --- a/package.json +++ b/package.json @@ -52,9 +52,6 @@ "grunt-contrib-copy": "0.4.1", "grunt-contrib-cssmin": "0.6.1", "grunt-contrib-uglify": "0.2.2", - "grunt-contrib-watch": "0.4.4", - "grunt-karma": "0.6.2", - "grunt-nodestatic": "0.1.2", "grunt-open": "0.2.2", "grunt-shell": "0.3.1", "grunt-strip-code": "0.1.2", @@ -63,10 +60,7 @@ "jshint": "2.9.2", "karma": "0.10.10", "karma-firefox-launcher": "0.1.2", - "karma-ievms": "0.0.4", "karma-mocha": "0.1.0", - "karma-opera-launcher": "0.1.0", - "karma-safari-launcher": "0.1.1", "karma-spec-reporter": "0.0.13", "node-static": "0.7.8 ", "npm": "^2.1.17", From 053d4d53cd02b3faf100007103567cc074e02c5f Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sat, 6 Aug 2016 14:28:10 -0500 Subject: [PATCH 12/31] chore(build): cp non-js to _build Also created .editorconfig & renamed css files in client dir to match their output name. #1569 --- Makefile | 4 +++- .../{fineuploader-gallery.css => fine-uploader-gallery.css} | 0 client/{fineuploader-new.css => fine-uploader-new.css} | 0 client/{fineuploader.css => fine-uploader.css} | 0 test/dev/index.html | 6 +++--- 5 files changed, 6 insertions(+), 4 deletions(-) rename client/{fineuploader-gallery.css => fine-uploader-gallery.css} (100%) rename client/{fineuploader-new.css => fine-uploader-new.css} (100%) rename client/{fineuploader.css => fine-uploader.css} (100%) diff --git a/Makefile b/Makefile index 5dc8e309c..7363985ed 100644 --- a/Makefile +++ b/Makefile @@ -202,7 +202,9 @@ lint: _build: mkdir $@ - + cp -pR $(SRC-DIR)/placeholders $@ + cp $(SRC-DIR)/*.css $@ + cp $(SRC-DIR)/*.gif $@ build-dnd-standalone: _build $(NPM-BIN)/uglifyjs $(DND-FILES) -o $(BUILD-OUT-DIR)/dnd.js -b -e window:global --source-map $(BUILD-OUT-DIR)/dnd.js.map -p relative diff --git a/client/fineuploader-gallery.css b/client/fine-uploader-gallery.css similarity index 100% rename from client/fineuploader-gallery.css rename to client/fine-uploader-gallery.css diff --git a/client/fineuploader-new.css b/client/fine-uploader-new.css similarity index 100% rename from client/fineuploader-new.css rename to client/fine-uploader-new.css diff --git a/client/fineuploader.css b/client/fine-uploader.css similarity index 100% rename from client/fineuploader.css rename to client/fine-uploader.css diff --git a/test/dev/index.html b/test/dev/index.html index 4a828e73e..3d3c7ca16 100644 --- a/test/dev/index.html +++ b/test/dev/index.html @@ -202,9 +202,9 @@ Fine Uploader Development - - - + + + From 2fb7515978f75dfb1434786f45b1f7e6635d9038 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sat, 6 Aug 2016 14:48:33 -0500 Subject: [PATCH 13/31] chore(build): minify css in build target #1569 --- Makefile | 7 ++++++- package.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7363985ed..0648a7928 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +.PHONY: clean _build + NPM-BIN = $(shell npm bin) BUILD-OUT-DIR = _build @@ -201,10 +203,13 @@ lint: $(NPM-BIN)/jshint $(JS-SRC-DIR)/* $(UNIT-TEST-DIR)/* $(TEST-DIR)/static/local/* _build: - mkdir $@ + mkdir -p $@ cp -pR $(SRC-DIR)/placeholders $@ cp $(SRC-DIR)/*.css $@ cp $(SRC-DIR)/*.gif $@ + $(NPM-BIN)/cleancss --source-map $@/fine-uploader.css -o $@/fine-uploader.min.css + $(NPM-BIN)/cleancss --source-map $@/fine-uploader-gallery.css -o $@/fine-uploader-gallery.min.css + $(NPM-BIN)/cleancss --source-map $@/fine-uploader-new.css -o $@/fine-uploader-new.min.css build-dnd-standalone: _build $(NPM-BIN)/uglifyjs $(DND-FILES) -o $(BUILD-OUT-DIR)/dnd.js -b -e window:global --source-map $(BUILD-OUT-DIR)/dnd.js.map -p relative diff --git a/package.json b/package.json index 664f8ef8e..abc80ac29 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ }, "devDependencies": { "async": "0.2.9", + "clean-css": "3.4.19", "fs-sync": "1.0.2", "glob": "3.2.6", "grunt": "^0.4.5", @@ -50,7 +51,6 @@ "grunt-contrib-compress": "0.5.2", "grunt-contrib-concat": "0.3.0", "grunt-contrib-copy": "0.4.1", - "grunt-contrib-cssmin": "0.6.1", "grunt-contrib-uglify": "0.2.2", "grunt-open": "0.2.2", "grunt-shell": "0.3.1", From 9c1071274582c7351881d67618c9402cfc100c3f Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sat, 6 Aug 2016 15:30:12 -0500 Subject: [PATCH 14/31] chore(build): create zip files for download #1569 --- Makefile | 14 ++++++++++++++ package.json | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0648a7928..f732b677a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ .PHONY: clean _build +VERSION=`node -pe "require('./package.json').version"` + NPM-BIN = $(shell npm bin) BUILD-OUT-DIR = _build @@ -205,6 +207,7 @@ lint: _build: mkdir -p $@ cp -pR $(SRC-DIR)/placeholders $@ + cp -pR $(SRC-DIR)/html/templates $@ cp $(SRC-DIR)/*.css $@ cp $(SRC-DIR)/*.gif $@ $(NPM-BIN)/cleancss --source-map $@/fine-uploader.css -o $@/fine-uploader.min.css @@ -377,3 +380,14 @@ test: start-test-resources-server start-root-server build-all-ui $(NPM-BIN)/karma start config/karma.conf.js make stop-test-resources-server make stop-root-server + +zip: zip-traditional zip-s3 zip-azure + +zip-traditional: + (cd $(BUILD-OUT-DIR) ; zip fine-uploader.zip placeholders/* templates/* *.gif fine-uploader*.* core.fine-uploader*.*) + +zip-s3: + (cd $(BUILD-OUT-DIR) ; zip s3.fine-uploader.zip placeholders/* templates/* *.gif fine-uploader*.css* s3*.*) + +zip-azure: + (cd $(BUILD-OUT-DIR) ; zip azure.fine-uploader.zip placeholders/* templates/* *.gif fine-uploader*.css* azure*.*) diff --git a/package.json b/package.json index abc80ac29..365932afd 100644 --- a/package.json +++ b/package.json @@ -75,8 +75,8 @@ "uuid": "1.4.1" }, "scripts": { - "build": "grunt package", - "devbuild": "make clean; grunt dev", + "build": "make lint; make build", + "devbuild": "make clean; make build-all-ui", "lint": "make lint", "setup-dev": "(cd test/dev/handlers; curl -sS https://getcomposer.org/installer | php; php composer.phar install)", "start-local-dev": "(. test/dev/handlers/s3keys.sh; php -S 0.0.0.0:9090 -t . -c test/dev/handlers/php.ini)", From e24fe2adef7304263a59cd9ef767f7b864e530a6 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sat, 6 Aug 2016 19:14:57 -0500 Subject: [PATCH 15/31] chore(build): JS header comment #1569 --- Makefile | 72 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index f732b677a..1a881a8d1 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,8 @@ UNIT-TEST-DIR = $(TEST-DIR)/unit EXPORT-FILE = $(JS-SRC-DIR)/export.js +PREAMBLE = "// Fine Uploader $(VERSION) - (c) 2013-present Widen Enterprises, Inc. MIT licensed. http://fineuploader.com" + CRYPTOJS-FILES = \ $(JS-3RDPARTY-SRC-DIR)/crypto-js/core.js \ $(JS-3RDPARTY-SRC-DIR)/crypto-js/enc-base64.js \ @@ -215,112 +217,112 @@ _build: $(NPM-BIN)/cleancss --source-map $@/fine-uploader-new.css -o $@/fine-uploader-new.min.css build-dnd-standalone: _build - $(NPM-BIN)/uglifyjs $(DND-FILES) -o $(BUILD-OUT-DIR)/dnd.js -b -e window:global --source-map $(BUILD-OUT-DIR)/dnd.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(DND-FILES) -o $(BUILD-OUT-DIR)/dnd.js -b -e window:global --source-map $(BUILD-OUT-DIR)/dnd.js.map -p relative build-dnd-standalone-min: _build - $(NPM-BIN)/uglifyjs $(DND-FILES) -o $(BUILD-OUT-DIR)/dnd.min.js -e window:global --source-map $(BUILD-OUT-DIR)/dnd.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(DND-FILES) -o $(BUILD-OUT-DIR)/dnd.min.js -e window:global --source-map $(BUILD-OUT-DIR)/dnd.min.js.map -p relative build-dnd-standalone-jquery: _build - $(NPM-BIN)/uglifyjs $(DND-JQUERY-FILES) -o $(BUILD-OUT-DIR)/dnd.jquery.js -b -e window:global --source-map $(BUILD-OUT-DIR)/dnd.jquery.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(DND-JQUERY-FILES) -o $(BUILD-OUT-DIR)/dnd.jquery.js -b -e window:global --source-map $(BUILD-OUT-DIR)/dnd.jquery.js.map -p relative build-dnd-standalone-jquery-min: _build - $(NPM-BIN)/uglifyjs $(DND-JQUERY-FILES) -o $(BUILD-OUT-DIR)/dnd.jquery.js -e window:global --source-map $(BUILD-OUT-DIR)/dnd.jquery.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(DND-JQUERY-FILES) -o $(BUILD-OUT-DIR)/dnd.jquery.js -e window:global --source-map $(BUILD-OUT-DIR)/dnd.jquery.js.map -p relative build-core-traditional: _build - $(NPM-BIN)/uglifyjs $(TRADITIONAL-FILES) -o $(BUILD-OUT-DIR)/core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/core.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-FILES) -o $(BUILD-OUT-DIR)/core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/core.fine-uploader.js.map -p relative build-core-traditional-min: _build - $(NPM-BIN)/uglifyjs $(TRADITIONAL-FILES) -o $(BUILD-OUT-DIR)/core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/core.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-FILES) -o $(BUILD-OUT-DIR)/core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/core.fine-uploader.min.js.map -p relative build-core-traditional-jquery: _build - $(NPM-BIN)/uglifyjs $(TRADITIONAL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/core.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/core.jquery.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/core.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/core.jquery.fine-uploader.js.map -p relative build-core-traditional-jquery-min: _build - $(NPM-BIN)/uglifyjs $(TRADITIONAL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/core.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/core.jquery.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/core.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/core.jquery.fine-uploader.min.js.map -p relative build-ui-traditional: _build - $(NPM-BIN)/uglifyjs $(TRADITIONAL-UI-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-UI-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/fine-uploader.js.map -p relative build-ui-traditional-min: _build - $(NPM-BIN)/uglifyjs $(TRADITIONAL-UI-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-UI-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/fine-uploader.min.js.map -p relative build-ui-traditional-jquery: _build - $(NPM-BIN)/uglifyjs $(TRADITIONAL-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.jquery.js -b -e window:global --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.jquery.js -b -e window:global --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.js.map -p relative build-ui-traditional-jquery-min: _build - $(NPM-BIN)/uglifyjs $(TRADITIONAL-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.jquery.min.js -e window:global --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.jquery.min.js -e window:global --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.min.js.map -p relative build-core-s3: _build - $(NPM-BIN)/uglifyjs $(S3-FILES) -o $(BUILD-OUT-DIR)/s3.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.core.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-FILES) -o $(BUILD-OUT-DIR)/s3.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.core.fine-uploader.js.map -p relative build-core-s3-min: _build - $(NPM-BIN)/uglifyjs $(S3-FILES) -o $(BUILD-OUT-DIR)/s3.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.core.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-FILES) -o $(BUILD-OUT-DIR)/s3.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.core.fine-uploader.min.js.map -p relative build-core-s3-jquery: _build - $(NPM-BIN)/uglifyjs $(S3-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.js.map -p relative build-core-s3-jquery-min: _build - $(NPM-BIN)/uglifyjs $(S3-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.min.js.map -p relative build-ui-s3: _build - $(NPM-BIN)/uglifyjs $(S3-UI-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-UI-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.js.map -p relative build-ui-s3-min: _build - $(NPM-BIN)/uglifyjs $(S3-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.min.js.map -p relative build-ui-s3-jquery: _build - $(NPM-BIN)/uglifyjs $(S3-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.js.map -p relative build-ui-s3-jquery-min: _build - $(NPM-BIN)/uglifyjs $(S3-UI-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-UI-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.min.js.map -p relative build-core-azure: _build - $(NPM-BIN)/uglifyjs $(AZURE-FILES) -o $(BUILD-OUT-DIR)/azure.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.core.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-FILES) -o $(BUILD-OUT-DIR)/azure.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.core.fine-uploader.js.map -p relative build-core-azure-min: _build - $(NPM-BIN)/uglifyjs $(AZURE-FILES) -o $(BUILD-OUT-DIR)/azure.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.core.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-FILES) -o $(BUILD-OUT-DIR)/azure.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.core.fine-uploader.min.js.map -p relative build-core-azure-jquery: _build - $(NPM-BIN)/uglifyjs $(AZURE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.js.map -p relative build-core-azure-jquery-min: _build - $(NPM-BIN)/uglifyjs $(AZURE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.min.js.map -p relative build-ui-azure: _build - $(NPM-BIN)/uglifyjs $(AZURE-UI-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-UI-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.js.map -p relative build-ui-azure-min: _build - $(NPM-BIN)/uglifyjs $(AZURE-UI-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-UI-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.min.js.map -p relative build-ui-azure-jquery: _build - $(NPM-BIN)/uglifyjs $(AZURE-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.js.map -p relative build-ui-azure-jquery-min: _build - $(NPM-BIN)/uglifyjs $(AZURE-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.min.js.map -p relative build-all-core: _build - $(NPM-BIN)/uglifyjs $(ALL-CORE-FILES) -o $(BUILD-OUT-DIR)/all.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.core.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-CORE-FILES) -o $(BUILD-OUT-DIR)/all.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.core.fine-uploader.js.map -p relative build-all-core-min: _build $(NPM-BIN)/uglifyjs $(ALL-CORE-FILES) -o $(BUILD-OUT-DIR)/all.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.core.fine-uploader.min.js.map -p relative build-all-core-jquery: _build - $(NPM-BIN)/uglifyjs $(ALL-CORE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-CORE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.js.map -p relative build-all-core-jquery-min: _build - $(NPM-BIN)/uglifyjs $(ALL-CORE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-CORE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.min.js.map -p relative build-all-ui: _build - $(NPM-BIN)/uglifyjs $(ALL-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.js.map -p relative build-all-ui-min: _build - $(NPM-BIN)/uglifyjs $(ALL-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.min.js.map -p relative build-all-ui-jquery: _build - $(NPM-BIN)/uglifyjs $(ALL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.fine-uploader.js.map -p relative build-all-ui-jquery-min: _build - $(NPM-BIN)/uglifyjs $(ALL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.fine-uploader.min.js.map -p relative build: \ build-dnd-standalone \ From 7f3f2a2063e4a1393d8ebb507b40fe37f72807a9 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sat, 6 Aug 2016 23:55:54 -0500 Subject: [PATCH 16/31] chore(build): prepare for publish to npm #1569 --- Makefile | 104 ++++++++++++++---- {lib => client}/commonJs/all.js | 0 {lib => client}/commonJs/azure.js | 0 {lib => client}/commonJs/jquery/azure.js | 0 {lib => client}/commonJs/jquery/s3.js | 0 .../commonJs/jquery/traditional.js | 0 {lib => client}/commonJs/s3.js | 0 {lib => client}/commonJs/traditional.js | 0 8 files changed, 84 insertions(+), 20 deletions(-) rename {lib => client}/commonJs/all.js (100%) rename {lib => client}/commonJs/azure.js (100%) rename {lib => client}/commonJs/jquery/azure.js (100%) rename {lib => client}/commonJs/jquery/s3.js (100%) rename {lib => client}/commonJs/jquery/traditional.js (100%) rename {lib => client}/commonJs/s3.js (100%) rename {lib => client}/commonJs/traditional.js (100%) diff --git a/Makefile b/Makefile index 1a881a8d1..082c183d4 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,12 @@ -.PHONY: clean _build +.PHONY: clean _build publish -VERSION=`node -pe "require('./package.json').version"` +VERSION=$(shell node -pe "require('./package.json').version") +DIST-OUT-DIR = _dist +PUB-DIR = $(DIST-OUT-DIR)/$(VERSION) NPM-BIN = $(shell npm bin) BUILD-OUT-DIR = _build -DIST-OUT-DIR = _dist SRC-DIR = client JS-SRC-DIR = $(SRC-DIR)/js JS-3RDPARTY-SRC-DIR = $(JS-SRC-DIR)/third-party @@ -229,16 +230,16 @@ build-dnd-standalone-jquery-min: _build $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(DND-JQUERY-FILES) -o $(BUILD-OUT-DIR)/dnd.jquery.js -e window:global --source-map $(BUILD-OUT-DIR)/dnd.jquery.js.map -p relative build-core-traditional: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-FILES) -o $(BUILD-OUT-DIR)/core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/core.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.core.js -b -e window:global --source-map $(BUILD-OUT-DIR)/fine-uploader.core.js.map -p relative build-core-traditional-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-FILES) -o $(BUILD-OUT-DIR)/core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/core.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/fine-uploader.core.min.js.map -p relative build-core-traditional-jquery: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/core.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/core.jquery.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/jquery.fine-uploader.core.js -b -e window:global --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.core.js.map -p relative build-core-traditional-jquery-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/core.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/core.jquery.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/jquery.fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.core.min.js.map -p relative build-ui-traditional: _build $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-UI-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/fine-uploader.js.map -p relative @@ -253,16 +254,16 @@ build-ui-traditional-jquery-min: _build $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.jquery.min.js -e window:global --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.min.js.map -p relative build-core-s3: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-FILES) -o $(BUILD-OUT-DIR)/s3.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.core.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.core.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.core.js.map -p relative build-core-s3-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-FILES) -o $(BUILD-OUT-DIR)/s3.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.core.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.core.min.js.map -p relative build-core-s3-jquery: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.core.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.core.js.map -p relative build-core-s3-jquery-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.core.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.core.min.js.map -p relative build-ui-s3: _build $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-UI-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.js.map -p relative @@ -277,16 +278,16 @@ build-ui-s3-jquery-min: _build $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-UI-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.min.js.map -p relative build-core-azure: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-FILES) -o $(BUILD-OUT-DIR)/azure.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.core.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.core.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.core.js.map -p relative build-core-azure-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-FILES) -o $(BUILD-OUT-DIR)/azure.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.core.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.core.min.js.map -p relative build-core-azure-jquery: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.core.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.core.js.map -p relative build-core-azure-jquery-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.core.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.core.min.js.map -p relative build-ui-azure: _build $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-UI-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.js.map -p relative @@ -301,16 +302,16 @@ build-ui-azure-jquery-min: _build $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.min.js.map -p relative build-all-core: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-CORE-FILES) -o $(BUILD-OUT-DIR)/all.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.core.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-CORE-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.core.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.core.js.map -p relative build-all-core-min: _build - $(NPM-BIN)/uglifyjs $(ALL-CORE-FILES) -o $(BUILD-OUT-DIR)/all.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.core.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs $(ALL-CORE-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.core.min.js.map -p relative build-all-core-jquery: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-CORE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-CORE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.fine-uploader.core.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.fine-uploader.core.js.map -p relative build-all-core-jquery-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-CORE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.core.fine-uploader.min.js.map -p relative + $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-CORE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.fine-uploader.core.min.js.map -p relative build-all-ui: _build $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.js.map -p relative @@ -386,10 +387,73 @@ test: start-test-resources-server start-root-server build-all-ui zip: zip-traditional zip-s3 zip-azure zip-traditional: - (cd $(BUILD-OUT-DIR) ; zip fine-uploader.zip placeholders/* templates/* *.gif fine-uploader*.* core.fine-uploader*.*) + (cd $(BUILD-OUT-DIR) ; zip fine-uploader.zip placeholders/* templates/* *.gif fine-uploader*.* fine-uploader.core*.*) zip-s3: (cd $(BUILD-OUT-DIR) ; zip s3.fine-uploader.zip placeholders/* templates/* *.gif fine-uploader*.css* s3*.*) zip-azure: (cd $(BUILD-OUT-DIR) ; zip azure.fine-uploader.zip placeholders/* templates/* *.gif fine-uploader*.css* azure*.*) + +zip-all: + (cd $(BUILD-OUT-DIR) ; zip all.fine-uploader.zip placeholders/* templates/* *.gif fine-uploader*.css* all*.*) + +setup-dist: + mkdir -p $(PUB-DIR) + cp LICENSE README.md package.json $(PUB-DIR) + cp -pR $(SRC-DIR)/commonjs/ $(PUB-DIR)/lib/ + +copy-build-to-dist: + mkdir -p $(PUB-DIR)/$(PUB-SUBDIR) + cp -pR $(BUILD-OUT-DIR)/placeholders $(BUILD-OUT-DIR)/templates $(PUB-DIR)/$(PUB-SUBDIR) + cp $(BUILD-OUT-DIR)/*.gif $(PUB-DIR)/$(PUB-SUBDIR) + cp $(BUILD-OUT-DIR)/$(PUB-SUBDIR).core.min* $(BUILD-OUT-DIR)/$(PUB-SUBDIR).core.js* $(PUB-DIR)/$(PUB-SUBDIR)/ + cp $(BUILD-OUT-DIR)/$(PUB-SUBDIR).min* $(BUILD-OUT-DIR)/$(PUB-SUBDIR).js* $(PUB-DIR)/$(PUB-SUBDIR) + cp $(BUILD-OUT-DIR)/fine-uploader*.css* $(PUB-DIR)/$(PUB-SUBDIR) + + +copy-traditional-dist: PUB-SUBDIR=fine-uploader +copy-traditional-dist: copy-build-to-dist + cp $(JS-SRC-DIR)/iframe.xss.response.js $(PUB-DIR)/fine-uploader + +copy-traditional-jquery-dist: PUB-SUBDIR=jquery.fine-uploader +copy-traditional-jquery-dist: copy-build-to-dist + cp $(JS-SRC-DIR)/iframe.xss.response.js $(PUB-DIR)/jquery.fine-uploader + +copy-s3-dist: PUB-SUBDIR=s3.fine-uploader +copy-s3-dist: copy-build-to-dist + +copy-s3-jquery-dist: PUB-SUBDIR=s3.jquery.fine-uploader +copy-s3-jquery-dist: copy-build-to-dist + +copy-azure-dist: PUB-SUBDIR=azure.fine-uploader +copy-azure-dist: copy-build-to-dist + +copy-azure-jquery-dist: PUB-SUBDIR=azure.jquery.fine-uploader +copy-azure-jquery-dist: copy-build-to-dist + +copy-all-dist: PUB-SUBDIR=all.fine-uploader +copy-all-dist: copy-build-to-dist + +copy-all-jquery-dist: PUB-SUBDIR=all.jquery.fine-uploader +copy-all-jquery-dist: copy-build-to-dist + +tag-release: + git tag $(VERSION) + git push origin $(VERSION) + +push-to-npm: + (cd $(PUB-DIR) ; npm publish) + +publish: \ + setup-dist \ + copy-traditional-dist \ + copy-traditional-jquery-dist \ + copy-s3-dist \ + copy-s3-jquery-dist \ + copy-azure-dist \ + copy-azure-jquery-dist \ + copy-all-dist \ + copy-all-jquery-dist \ +# tag-release \ +# push-to-npm diff --git a/lib/commonJs/all.js b/client/commonJs/all.js similarity index 100% rename from lib/commonJs/all.js rename to client/commonJs/all.js diff --git a/lib/commonJs/azure.js b/client/commonJs/azure.js similarity index 100% rename from lib/commonJs/azure.js rename to client/commonJs/azure.js diff --git a/lib/commonJs/jquery/azure.js b/client/commonJs/jquery/azure.js similarity index 100% rename from lib/commonJs/jquery/azure.js rename to client/commonJs/jquery/azure.js diff --git a/lib/commonJs/jquery/s3.js b/client/commonJs/jquery/s3.js similarity index 100% rename from lib/commonJs/jquery/s3.js rename to client/commonJs/jquery/s3.js diff --git a/lib/commonJs/jquery/traditional.js b/client/commonJs/jquery/traditional.js similarity index 100% rename from lib/commonJs/jquery/traditional.js rename to client/commonJs/jquery/traditional.js diff --git a/lib/commonJs/s3.js b/client/commonJs/s3.js similarity index 100% rename from lib/commonJs/s3.js rename to client/commonJs/s3.js diff --git a/lib/commonJs/traditional.js b/client/commonJs/traditional.js similarity index 100% rename from lib/commonJs/traditional.js rename to client/commonJs/traditional.js From c9f3e6edee28daadd3d42417c278df71d7e745f5 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sat, 6 Aug 2016 23:58:25 -0500 Subject: [PATCH 17/31] chore(build): run build with more recent version of node #1569 --- .travis.yml | 2 +- package.json | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7d83f7fd9..a2a159426 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ sudo: false language: node_js node_js: -- '0.10.33' +- '5.0.0' env: global: diff --git a/package.json b/package.json index 365932afd..3bc6339fa 100644 --- a/package.json +++ b/package.json @@ -82,8 +82,5 @@ "start-local-dev": "(. test/dev/handlers/s3keys.sh; php -S 0.0.0.0:9090 -t . -c test/dev/handlers/php.ini)", "test": "make lint && make test", "update-dev": "(cd test/dev/handlers; php composer.phar update)" - }, - "engines" : { - "node" : "0.10.33" } } From bd0686889b0ad27eb824215444ec6f9f61b69b84 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sun, 7 Aug 2016 00:12:55 -0500 Subject: [PATCH 18/31] chore(build): goodbye grunt #1569 --- Gruntfile.js | 56 ----- Makefile | 32 +-- lib/grunt/configs/banner.js | 20 -- lib/grunt/configs/bower.js | 18 -- lib/grunt/configs/compress.js | 91 -------- lib/grunt/configs/concat.js | 81 ------- lib/grunt/configs/copy.js | 371 ------------------------------ lib/grunt/configs/cssmin.js | 17 -- lib/grunt/configs/index.js | 15 -- lib/grunt/configs/s3.js | 36 --- lib/grunt/configs/shell.js | 15 -- lib/grunt/configs/stripcode.js | 14 -- lib/grunt/configs/uglify.js | 42 ---- lib/grunt/configs/version.js | 44 ---- lib/grunt/index.js | 8 - lib/grunt/tasks/build.js | 16 -- lib/grunt/tasks/build_stripped.js | 17 -- lib/grunt/tasks/default.js | 11 - lib/grunt/tasks/dev.js | 7 - lib/grunt/tasks/index.js | 3 - lib/grunt/tasks/minify.js | 18 -- lib/grunt/tasks/package.js | 20 -- lib/grunt/tasks/release.js | 123 ---------- lib/grunt/tasks/travis.js | 14 -- lib/modules.js | 308 ------------------------- package.json | 34 +-- 26 files changed, 22 insertions(+), 1409 deletions(-) delete mode 100644 Gruntfile.js delete mode 100644 lib/grunt/configs/banner.js delete mode 100644 lib/grunt/configs/bower.js delete mode 100644 lib/grunt/configs/compress.js delete mode 100644 lib/grunt/configs/concat.js delete mode 100644 lib/grunt/configs/copy.js delete mode 100644 lib/grunt/configs/cssmin.js delete mode 100644 lib/grunt/configs/index.js delete mode 100644 lib/grunt/configs/s3.js delete mode 100644 lib/grunt/configs/shell.js delete mode 100644 lib/grunt/configs/stripcode.js delete mode 100644 lib/grunt/configs/uglify.js delete mode 100644 lib/grunt/configs/version.js delete mode 100644 lib/grunt/index.js delete mode 100644 lib/grunt/tasks/build.js delete mode 100644 lib/grunt/tasks/build_stripped.js delete mode 100644 lib/grunt/tasks/default.js delete mode 100644 lib/grunt/tasks/dev.js delete mode 100644 lib/grunt/tasks/index.js delete mode 100644 lib/grunt/tasks/minify.js delete mode 100644 lib/grunt/tasks/package.js delete mode 100644 lib/grunt/tasks/release.js delete mode 100644 lib/grunt/tasks/travis.js delete mode 100644 lib/modules.js diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index 7938fae99..000000000 --- a/Gruntfile.js +++ /dev/null @@ -1,56 +0,0 @@ -/* jshint node: true */ -// jscs:disable requireCamelCaseOrUpperCaseIdentifiers -/* - Fine Uploader - ------------- - - Gruntfile - */ -module.exports = function(grunt) { - "use strict"; - - require("time-grunt")(grunt); - - var async, configs, fs, name, path, paths, pkg, tasks, utils, uuid; - - fs = require("fs"); - uuid = require("uuid"); - async = require("async"); - utils = require("./lib/grunt/utils"); - configs = require("./lib/grunt/configs"); - tasks = "./lib/grunt/tasks"; - path = require("path"); - pkg = require("./package.json"); - paths = { - commonJs: "./lib/commonJs", - dist: path.join("./_dist", pkg.version), - build: "./_build", - src: "./client", - html: "./client/html/templates", - docs: "./docs" - }; - grunt.initConfig({ - pkg: pkg, - paths: paths, - compress: configs.compress(paths), - concat: configs.concat(paths), - copy: configs.copy(paths), - cssmin: configs.cssmin(paths), - aws_s3: configs.s3(paths.dist, paths.build, pkg.version), - shell: configs.shell(paths), - strip_code: configs.stripcode(paths), - uglify: configs.uglify(paths), - usebanner: configs.banner(paths), - version: configs.version(pkg), - watch: configs.watch(paths) - }); - - for (name in pkg.devDependencies) { - if (name.substring(0, 6) === "grunt-") { - grunt.loadNpmTasks(name); - } - } - - grunt.loadTasks(tasks); - -}; diff --git a/Makefile b/Makefile index 082c183d4..66b225e6d 100644 --- a/Makefile +++ b/Makefile @@ -412,31 +412,31 @@ copy-build-to-dist: cp $(BUILD-OUT-DIR)/fine-uploader*.css* $(PUB-DIR)/$(PUB-SUBDIR) -copy-traditional-dist: PUB-SUBDIR=fine-uploader -copy-traditional-dist: copy-build-to-dist +copy-traditional-dist: + make copy-build-to-dist PUB-SUBDIR=fine-uploader cp $(JS-SRC-DIR)/iframe.xss.response.js $(PUB-DIR)/fine-uploader -copy-traditional-jquery-dist: PUB-SUBDIR=jquery.fine-uploader -copy-traditional-jquery-dist: copy-build-to-dist +copy-traditional-jquery-dist: + make copy-build-to-dist PUB-SUBDIR=jquery.fine-uploader cp $(JS-SRC-DIR)/iframe.xss.response.js $(PUB-DIR)/jquery.fine-uploader -copy-s3-dist: PUB-SUBDIR=s3.fine-uploader -copy-s3-dist: copy-build-to-dist +copy-s3-dist: + make copy-build-to-dist PUB-SUBDIR=s3.fine-uploader -copy-s3-jquery-dist: PUB-SUBDIR=s3.jquery.fine-uploader -copy-s3-jquery-dist: copy-build-to-dist +copy-s3-jquery-dist: + make copy-build-to-dist PUB-SUBDIR=s3.jquery.fine-uploader -copy-azure-dist: PUB-SUBDIR=azure.fine-uploader -copy-azure-dist: copy-build-to-dist +copy-azure-dist: + make copy-build-to-dist PUB-SUBDIR=azure.fine-uploader -copy-azure-jquery-dist: PUB-SUBDIR=azure.jquery.fine-uploader -copy-azure-jquery-dist: copy-build-to-dist +copy-azure-jquery-dist: + make copy-build-to-dist PUB-SUBDIR=azure.jquery.fine-uploader -copy-all-dist: PUB-SUBDIR=all.fine-uploader -copy-all-dist: copy-build-to-dist +copy-all-dist: + make copy-build-to-dist PUB-SUBDIR=all.fine-uploader -copy-all-jquery-dist: PUB-SUBDIR=all.jquery.fine-uploader -copy-all-jquery-dist: copy-build-to-dist +copy-all-jquery-dist: + make copy-build-to-dist PUB-SUBDIR=all.jquery.fine-uploader tag-release: git tag $(VERSION) diff --git a/lib/grunt/configs/banner.js b/lib/grunt/configs/banner.js deleted file mode 100644 index cf697ea26..000000000 --- a/lib/grunt/configs/banner.js +++ /dev/null @@ -1,20 +0,0 @@ -/* jshint node: true */ -module.exports = function(paths) { - "use strict"; - return { - allhead: { - src: ["" + paths.build + "/*.{js,css}"], - options: { - position: "top", - banner: "/*!\n* <%= pkg.title %>\n*\n* Copyright 2013-present, <%= pkg.author %>\n*\n* Version: <%= pkg.version %>\n*\n* Homepage: http://fineuploader.com\n*\n* Repository: <%= pkg.repository.url %>\n*\n* Licensed only under the MIT license (http://fineuploader.com/licensing).\n*/ \n\n" - } - }, - allfoot: { - src: ["" + paths.build + "/*.{js,css}"], - options: { - position: "bottom", - banner: "/*! <%= grunt.template.today('yyyy-mm-dd') %> */\n" - } - } - }; -}; diff --git a/lib/grunt/configs/bower.js b/lib/grunt/configs/bower.js deleted file mode 100644 index 25a60c533..000000000 --- a/lib/grunt/configs/bower.js +++ /dev/null @@ -1,18 +0,0 @@ -/* jshint node:true */ -/* globals module */ -var path = require("path"); - -module.exports = function(paths) { - "use strict"; - return { - test: { - options: { - targetDir: path.join(paths.test, "_vendor"), - install: true, - cleanTargetDir: true, - cleanBowerDir: true, - layout: "byComponent" - } - } - }; -}; diff --git a/lib/grunt/configs/compress.js b/lib/grunt/configs/compress.js deleted file mode 100644 index 1739b89b1..000000000 --- a/lib/grunt/configs/compress.js +++ /dev/null @@ -1,91 +0,0 @@ -/* jshint node: true */ -module.exports = function(paths) { - "use strict"; - - return { - all: { - options: { - archive: "" + paths.dist + "/all.<%= pkg.name %>-<%= pkg.version %>.zip" - }, - files: [ - { - expand: true, - cwd: paths.dist, - src: "./all.<%= pkg.name %>/**/*" - } - ] - }, - jquery: { - options: { - archive: "" + paths.dist + "/jquery.<%= pkg.name %>-<%= pkg.version %>.zip" - }, - files: [ - { - expand: true, - cwd: paths.dist, - src: "./jquery.<%= pkg.name %>/**/*" - } - ] - }, - jqueryS3: { - options: { - archive: "" + paths.dist + "/s3.jquery.<%= pkg.name %>-<%= pkg.version %>.zip" - }, - files: [ - { - expand: true, - cwd: paths.dist, - src: "./s3.jquery.<%= pkg.name %>/**/*" - } - ] - }, - jqueryAzure: { - options: { - archive: "" + paths.dist + "/azure.jquery.<%= pkg.name %>-<%= pkg.version %>.zip" - }, - files: [ - { - expand: true, - cwd: paths.dist, - src: "./azure.jquery.<%= pkg.name %>/**/*" - } - ] - }, - core: { - options: { - archive: "" + paths.dist + "/<%= pkg.name %>-<%= pkg.version %>.zip" - }, - files: [ - { - expand: true, - cwd: paths.dist, - src: "./<%= pkg.name %>/**/*" - } - ] - }, - coreS3: { - options: { - archive: "" + paths.dist + "/s3.<%= pkg.name %>-<%= pkg.version %>.zip" - }, - files: [ - { - expand: true, - cwd: paths.dist, - src: "./s3.<%= pkg.name %>/**/*" - } - ] - }, - coreAzure: { - options: { - archive: "" + paths.dist + "/azure.<%= pkg.name %>-<%= pkg.version %>.zip" - }, - files: [ - { - expand: true, - cwd: paths.dist, - src: "./azure.<%= pkg.name %>/**/*" - } - ] - } - }; -}; diff --git a/lib/grunt/configs/concat.js b/lib/grunt/configs/concat.js deleted file mode 100644 index f1caf661e..000000000 --- a/lib/grunt/configs/concat.js +++ /dev/null @@ -1,81 +0,0 @@ -/* jshint node: true */ -var path = require("path"), - fineUploaderModules = require("../../modules"); - -module.exports = function(paths) { - "use strict"; - - var jsBanner = ( - "(function(global) {\n" - ), - - jsFooter = ( - "if (typeof define === 'function' && define.amd) {\n" + - " define(function() {\n" + - " return qq;\n" + - " });\n" + - "}\n" + - "else if (typeof module !== 'undefined' && module.exports) {\n" + - " module.exports = qq;\n" + - "}\n" + - "else {\n" + - " global.qq = qq;\n" + - "}\n" + - "}(window));\n" - ), - - jsOptions = { - banner: jsBanner, - footer: jsFooter - } - - return { - core: { - options: jsOptions, - src: fineUploaderModules.mergeModules(true, "fuTraditional"), - dest: "" + paths.build + "/<%= pkg.name %>.js" - }, - coreS3: { - options: jsOptions, - src: fineUploaderModules.mergeModules(true, "fuS3"), - dest: "" + paths.build + "/s3.<%= pkg.name %>.js" - }, - coreAzure: { - options: jsOptions, - src: fineUploaderModules.mergeModules(true, "fuAzure"), - dest: "" + paths.build + "/azure.<%= pkg.name %>.js" - }, - jquery: { - options: jsOptions, - src: fineUploaderModules.mergeModules(true, "fuTraditionalJquery"), - dest: "" + paths.build + "/jquery.<%= pkg.name %>.js" - }, - jqueryS3: { - options: jsOptions, - src: fineUploaderModules.mergeModules(true, "fuS3Jquery"), - dest: "" + paths.build + "/s3.jquery.<%= pkg.name %>.js" - }, - jqueryAzure: { - options: jsOptions, - src: fineUploaderModules.mergeModules(true, "fuAzureJquery"), - dest: "" + paths.build + "/azure.jquery.<%= pkg.name %>.js" - }, - all: { - options: jsOptions, - src: fineUploaderModules.mergeModules(true, "fuAll"), - dest: paths.build + "/all.<%= pkg.name %>.js" - }, - css: { - src: fineUploaderModules.mergeModules(true, "fuCss"), - dest: "" + paths.build + "/<%= pkg.name %>-new.css" - }, - cssGallery: { - src: fineUploaderModules.mergeModules(true, "fuCssGallery"), - dest: "" + paths.build + "/<%= pkg.name %>-gallery.css" - }, - cssLegacy: { - src: fineUploaderModules.mergeModules(true, "fuCssLegacy"), - dest: "" + paths.build + "/<%= pkg.name %>.css" - } - }; -}; diff --git a/lib/grunt/configs/copy.js b/lib/grunt/configs/copy.js deleted file mode 100644 index 4915aafd3..000000000 --- a/lib/grunt/configs/copy.js +++ /dev/null @@ -1,371 +0,0 @@ -/* jshint node: true */ -module.exports = function(paths) { - "use strict"; - return { - dist: { - files: [ - { - expand: true, - cwd: paths.build, - src: ["*.js", "!all.*", "!s3.*", "!azure.*", "!*.min.js", "!jquery*", "!*iframe*"], - dest: "" + paths.dist + "/<%= pkg.name %>/", - ext: ".js" - }, { - expand: true, - cwd: paths.build, - src: ["all.*", "!s3.*.js", "!*.min.js", "!s3.jquery*", "!azure.jquery*", "!*iframe*"], - dest: "" + paths.dist + "/all.<%= pkg.name %>/", - ext: ".<%= pkg.name %>.js" - }, { - expand: true, - cwd: paths.build, - src: ["!all.*", "s3.*.js", "!*.min.js", "!s3.jquery*", "!azure.jquery*", "!*iframe*"], - dest: "" + paths.dist + "/s3.<%= pkg.name %>/", - ext: ".<%= pkg.name %>.js" - }, { - expand: true, - cwd: paths.build, - src: ["!all.*", "azure.*.js", "!*.min.js", "!azure.jquery*", "!s3.jquery*", "!*iframe*"], - dest: "" + paths.dist + "/azure.<%= pkg.name %>/", - ext: ".<%= pkg.name %>.js" - }, { - expand: true, - cwd: paths.build, - src: ["*.min.js", "!all.*", "!s3.*", "!azure.*", "!jquery*"], - dest: "" + paths.dist + "/<%= pkg.name %>/", - ext: ".min.js" - }, { - expand: true, - cwd: paths.build, - src: ["all.*.min.js"], - dest: "" + paths.dist + "/all.<%= pkg.name %>/", - ext: ".<%= pkg.name %>.min.js" - }, { - expand: true, - cwd: paths.build, - src: ["s3.*.min.js", "!s3.jquery*"], - dest: "" + paths.dist + "/s3.<%= pkg.name %>/", - ext: ".<%= pkg.name %>.min.js" - }, { - expand: true, - cwd: paths.build, - src: ["azure.*.min.js", "!azure.jquery*"], - dest: "" + paths.dist + "/azure.<%= pkg.name %>/", - ext: ".<%= pkg.name %>.min.js" - }, { - expand: true, - cwd: paths.build, - src: ["jquery*js", "!s3.*", "!azure.*", "!*.min.js"], - dest: "" + paths.dist + "/jquery.<%= pkg.name %>/", - ext: ".<%= pkg.name %>.js" - }, { - expand: true, - cwd: paths.build, - src: ["s3.jquery*js", "!*.min.js"], - dest: "" + paths.dist + "/s3.jquery.<%= pkg.name %>/", - ext: ".jquery.<%= pkg.name %>.js" - }, { - expand: true, - cwd: paths.build, - src: ["azure.jquery*js", "!*.min.js"], - dest: "" + paths.dist + "/azure.jquery.<%= pkg.name %>/", - ext: ".jquery.<%= pkg.name %>.js" - }, { - expand: true, - cwd: paths.build, - src: ["jquery*min.js"], - dest: "" + paths.dist + "/jquery.<%= pkg.name %>/", - ext: ".<%= pkg.name %>.min.js" - }, { - expand: true, - cwd: paths.build, - src: ["s3.jquery*min.js"], - dest: "" + paths.dist + "/s3.jquery.<%= pkg.name %>/", - ext: ".jquery.<%= pkg.name %>.min.js" - }, { - expand: true, - cwd: paths.build, - src: ["azure.jquery*min.js"], - dest: "" + paths.dist + "/azure.jquery.<%= pkg.name %>/", - ext: ".jquery.<%= pkg.name %>.min.js" - }, { - expand: true, - cwd: "./" + paths.src + "/js/", - src: ["iframe.xss.response.js"], - dest: "" + paths.dist + "/<%= pkg.name %>/", - ext: ".xss.response.js" - }, { - expand: true, - cwd: "./" + paths.src + "/js/", - src: ["iframe.xss.response.js"], - dest: "" + paths.dist + "/all.<%= pkg.name %>/", - ext: ".xss.response.js" - }, { - expand: true, - cwd: "./" + paths.src + "/js/", - src: ["iframe.xss.response.js"], - dest: "" + paths.dist + "/all.<%= pkg.name %>/", - ext: ".xss.response.js" - }, { - expand: true, - cwd: "./" + paths.src + "/js/", - src: ["iframe.xss.response.js"], - dest: "" + paths.dist + "/s3.<%= pkg.name %>/", - ext: ".xss.response.js" - }, { - expand: true, - cwd: "./" + paths.src + "/js/", - src: ["iframe.xss.response.js"], - dest: "" + paths.dist + "/jquery.<%= pkg.name %>/", - ext: ".xss.response.js" - }, { - expand: true, - cwd: "./" + paths.src + "/js/", - src: ["iframe.xss.response.js"], - dest: "" + paths.dist + "/s3.jquery.<%= pkg.name %>/", - ext: ".xss.response.js" - }, { - expand: true, - cwd: paths.src, - src: ["*.gif", "placeholders/*.png"], - dest: "" + paths.dist + "/<%= pkg.name %>/" - }, { - expand: true, - cwd: paths.src, - src: ["*.gif", "placeholders/*.png"], - dest: "" + paths.dist + "/all.<%= pkg.name %>/" - }, { - expand: true, - cwd: paths.src, - src: ["*.gif", "placeholders/*.png"], - dest: "" + paths.dist + "/all.<%= pkg.name %>/" - }, { - expand: true, - cwd: paths.src, - src: ["*.gif", "placeholders/*.png"], - dest: "" + paths.dist + "/s3.<%= pkg.name %>/" - }, { - expand: true, - cwd: paths.src, - src: ["*.gif", "placeholders/*.png"], - dest: "" + paths.dist + "/azure.<%= pkg.name %>/" - }, { - expand: true, - cwd: paths.src, - src: ["*.gif", "placeholders/*.png"], - dest: "" + paths.dist + "/jquery.<%= pkg.name %>/" - }, { - expand: true, - cwd: paths.src, - src: ["*.gif", "placeholders/*.png"], - dest: "" + paths.dist + "/s3.jquery.<%= pkg.name %>/" - }, { - expand: true, - cwd: paths.src, - src: ["*.gif", "placeholders/*.png"], - dest: "" + paths.dist + "/azure.jquery.<%= pkg.name %>/" - }, { - expand: true, - cwd: "./", - src: ["LICENSE"], - dest: "" + paths.dist + "/<%= pkg.name %>/" - }, { - expand: true, - cwd: "./", - src: ["LICENSE"], - dest: "" + paths.dist + "/all.<%= pkg.name %>/" - }, { - expand: true, - cwd: "./", - src: ["LICENSE"], - dest: "" + paths.dist + "/s3.<%= pkg.name %>/" - }, { - expand: true, - cwd: "./", - src: ["LICENSE"], - dest: "" + paths.dist + "/azure.<%= pkg.name %>/" - }, { - expand: true, - cwd: "./", - src: ["LICENSE"], - dest: "" + paths.dist + "/jquery.<%= pkg.name %>/" - }, { - expand: true, - cwd: "./", - src: ["LICENSE"], - dest: "" + paths.dist + "/s3.jquery.<%= pkg.name %>/" - }, { - expand: true, - cwd: "./", - src: ["LICENSE"], - dest: "" + paths.dist + "/azure.jquery.<%= pkg.name %>/" - }, { - expand: true, - cwd: paths.build, - src: ["*.min.css"], - dest: "" + paths.dist + "/<%= pkg.name %>", - ext: ".min.css" - }, { - expand: true, - cwd: paths.build, - src: ["*.min.css"], - dest: "" + paths.dist + "/all.<%= pkg.name %>", - ext: ".min.css" - }, { - expand: true, - cwd: paths.build, - src: ["*.min.css"], - dest: "" + paths.dist + "/s3.<%= pkg.name %>", - ext: ".min.css" - }, { - expand: true, - cwd: paths.build, - src: ["*.min.css"], - dest: "" + paths.dist + "/azure.<%= pkg.name %>", - ext: ".min.css" - }, { - expand: true, - cwd: paths.build, - src: ["*.css", "!*.min.css"], - dest: "" + paths.dist + "/<%= pkg.name %>", - ext: ".css" - }, { - expand: true, - cwd: paths.build, - src: ["*.css", "!*.min.css"], - dest: "" + paths.dist + "/all.<%= pkg.name %>", - ext: ".css" - }, { - expand: true, - cwd: paths.build, - src: ["*.css", "!*.min.css"], - dest: "" + paths.dist + "/s3.<%= pkg.name %>", - ext: ".css" - }, { - expand: true, - cwd: paths.build, - src: ["*.css", "!*.min.css"], - dest: "" + paths.dist + "/azure.<%= pkg.name %>", - ext: ".css" - }, { - expand: true, - cwd: paths.build, - src: ["*.min.css"], - dest: "" + paths.dist + "/jquery.<%= pkg.name %>", - ext: ".min.css" - }, { - expand: true, - cwd: paths.build, - src: ["*.min.css"], - dest: "" + paths.dist + "/s3.jquery.<%= pkg.name %>", - ext: ".min.css" - }, { - expand: true, - cwd: paths.build, - src: ["*.min.css"], - dest: "" + paths.dist + "/azure.jquery.<%= pkg.name %>", - ext: ".min.css" - }, { - expand: true, - cwd: paths.build, - src: ["*.css", "!*.min.css"], - dest: "" + paths.dist + "/jquery.<%= pkg.name %>", - ext: ".css" - }, { - expand: true, - cwd: paths.build, - src: ["*.css", "!*.min.css"], - dest: "" + paths.dist + "/s3.jquery.<%= pkg.name %>", - ext: ".css" - }, { - expand: true, - cwd: paths.build, - src: ["*.css", "!*.min.css"], - dest: "" + paths.dist + "/azure.jquery.<%= pkg.name %>", - ext: ".css" - }, { - expand: true, - cwd: paths.html, - src: ["*.html"], - dest: "" + paths.dist + "/<%= pkg.name %>/templates/" - }, { - expand: true, - cwd: paths.html, - src: ["*.html"], - dest: "" + paths.dist + "/all.<%= pkg.name %>/templates/" - }, { - expand: true, - cwd: paths.html, - src: ["*.html"], - dest: "" + paths.dist + "/s3.<%= pkg.name %>/templates/" - }, { - expand: true, - cwd: paths.html, - src: ["*.html"], - dest: "" + paths.dist + "/azure.<%= pkg.name %>/templates/" - }, { - expand: true, - cwd: paths.html, - src: ["*.html"], - dest: "" + paths.dist + "/jquery.<%= pkg.name %>/templates/" - }, { - expand: true, - cwd: paths.html, - src: ["*.html"], - dest: "" + paths.dist + "/s3.jquery.<%= pkg.name %>/templates/" - }, { - expand: true, - cwd: paths.html, - src: ["*.html"], - dest: "" + paths.dist + "/azure.jquery.<%= pkg.name %>/templates/" - } - ] - }, - build: { - files: [ - { - expand: true, - cwd: "" + paths.src + "/js/", - src: ["iframe.xss.response.js"], - dest: paths.build - }, { - expand: true, - cwd: paths.src, - src: ["*.gif", "placeholders/*.png"], - dest: paths.build - }, { - expand: true, - cwd: paths.html, - src: ["*.html"], - dest: paths.build - } - ] - }, - test: { - expand: true, - flatten: true, - src: ["" + paths.build + "/*"], - dest: "" + paths.test + "/_temp" - }, - images: { - files: [ - { - expand: true, - cwd: paths.src, - src: ["*.gif", "placeholders/*.png"], - dest: paths.build - } - ] - }, - templates: { - files: [ - { - expand: true, - cwd: paths.src + "/html", - src: ["*.html"], - dest: paths.build - } - ] - } - }; -}; diff --git a/lib/grunt/configs/cssmin.js b/lib/grunt/configs/cssmin.js deleted file mode 100644 index 1db6ba9e6..000000000 --- a/lib/grunt/configs/cssmin.js +++ /dev/null @@ -1,17 +0,0 @@ -/* jshint node: true */ -module.exports = function(paths) { - "use strict"; - return { - options: { - banner: "/*! <%= pkg.name %> <%= grunt.template.today('yyyy-mm-dd') %> */\n", - report: "min" - }, - all: { - expand: true, - cwd: paths.build, - src: ["*.css", "!*.min.css"], - dest: paths.build, - ext: ".min.css" - } - }; -}; diff --git a/lib/grunt/configs/index.js b/lib/grunt/configs/index.js deleted file mode 100644 index fd18f5ef1..000000000 --- a/lib/grunt/configs/index.js +++ /dev/null @@ -1,15 +0,0 @@ -/* jshint node: true */ -module.exports = { - banner: require("./banner"), - compress: require("./compress"), - concat: require("./concat"), - copy: require("./copy"), - cssmin: require("./cssmin"), - s3: require("./s3"), - shell: require("./shell"), - static: require("./static"), - stripcode: require("./stripcode"), - uglify: require("./uglify"), - version: require("./version"), - watch: require("./watch") -}; diff --git a/lib/grunt/configs/s3.js b/lib/grunt/configs/s3.js deleted file mode 100644 index 85e48b16a..000000000 --- a/lib/grunt/configs/s3.js +++ /dev/null @@ -1,36 +0,0 @@ -var path = require("path"); - -/* jshint node: true */ -module.exports = function(distPath, buildPath, version) { - "use strict"; - - return { - options: { - sslEnabled: false, - bucket: "releases.fineuploader.com", - access: "public-read", - uploadConcurrency: 10, - params: { - CacheControl: "max-age=630720000, public", - Expires: new Date(Date.now() + 63072000000) - } - }, - clean: { - files: [ - {dest: "develop/" + version, action: "delete"} - ] - }, - develop: { - files: [ - { action: "upload", expand: true, cwd: distPath, src: ["**/*"], dest: "develop/" + version + "/" } - ] - }, - release: { - files: [ - { action: "upload", expand: true, cwd: distPath, src: ["**/*"], dest: version + "/"} - ] - } - - }; - -}; diff --git a/lib/grunt/configs/shell.js b/lib/grunt/configs/shell.js deleted file mode 100644 index 00e3decd5..000000000 --- a/lib/grunt/configs/shell.js +++ /dev/null @@ -1,15 +0,0 @@ -/* jshint node: true */ -module.exports = function(paths) { - "use strict"; - return { - // jscs:disable requireCamelCaseOrUpperCaseIdentifiers - version_dist_templates: { - command: "find " + paths.dist + "/ -type f -name '*.html' | xargs sed -i '' 's/{VERSION}/<%= pkg.version %>/'", - options: { - cwd: __dirname, - stderr: true, - stdout: true - } - } - }; -}; diff --git a/lib/grunt/configs/stripcode.js b/lib/grunt/configs/stripcode.js deleted file mode 100644 index 5f4a7462c..000000000 --- a/lib/grunt/configs/stripcode.js +++ /dev/null @@ -1,14 +0,0 @@ -/* jshint node: true */ -module.exports = function(paths) { - "use strict"; - return { - options: { - // jscs:disable requireCamelCaseOrUpperCaseIdentifiers - start_comment: "", - end_comment: "" - }, - build: { - src: "" + paths.build + "/**/*.js" - } - }; -}; diff --git a/lib/grunt/configs/uglify.js b/lib/grunt/configs/uglify.js deleted file mode 100644 index 41850ec67..000000000 --- a/lib/grunt/configs/uglify.js +++ /dev/null @@ -1,42 +0,0 @@ -/* jshint node: true */ -module.exports = function(paths) { - "use strict"; - return { - options: { - mangle: true, - compress: { - warnings: false - }, - report: "min", - preserveComments: "some" - }, - core: { - src: ["<%= concat.core.dest %>"], - dest: "" + paths.build + "/<%= pkg.name %>.min.js" - }, - jquery: { - src: ["<%= concat.jquery.dest %>"], - dest: "" + paths.build + "/jquery.<%= pkg.name %>.min.js" - }, - coreAzure: { - src: ["<%= concat.coreAzure.dest %>"], - dest: "" + paths.build + "/azure.<%= pkg.name %>.min.js" - }, - jqueryAzure: { - src: ["<%= concat.jqueryAzure.dest %>"], - dest: "" + paths.build + "/azure.jquery.<%= pkg.name %>.min.js" - }, - coreS3: { - src: ["<%= concat.coreS3.dest %>"], - dest: "" + paths.build + "/s3.<%= pkg.name %>.min.js" - }, - jqueryS3: { - src: ["<%= concat.jqueryS3.dest %>"], - dest: "" + paths.build + "/s3.jquery.<%= pkg.name %>.min.js" - }, - all: { - src: ["<%= concat.all.dest %>"], - dest: "" + paths.build + "/all.<%= pkg.name %>.min.js" - } - }; -}; diff --git a/lib/grunt/configs/version.js b/lib/grunt/configs/version.js deleted file mode 100644 index 25e66cf56..000000000 --- a/lib/grunt/configs/version.js +++ /dev/null @@ -1,44 +0,0 @@ -/* jshint node: true */ -var fineUploaderModules = require("../../modules"); - -module.exports = function(pkg) { - "use strict"; - return { - options: { - pkg: pkg, - // jscs:disable validateQuoteMarks - // jshint quotmark:false - prefix: '[^\\-][Vv]ersion[\'"]?\\s*[:=]\\s*[\'"]?' - }, - major: { - options: { - release: "major" - }, - src: fineUploaderModules.modules.versioned - }, - minor: { - options: { - release: "minor" - }, - src: fineUploaderModules.modules.versioned - }, - hotfix: { - options: { - release: "patch" - }, - src: fineUploaderModules.modules.versioned - }, - build: { - options: { - release: "build" - }, - src: fineUploaderModules.modules.versioned - }, - release: { - options: { - release: pkg.version.replace(/-\d+$/, "") - }, - src: fineUploaderModules.modules.versioned - } - }; -}; diff --git a/lib/grunt/index.js b/lib/grunt/index.js deleted file mode 100644 index 3a381b9a4..000000000 --- a/lib/grunt/index.js +++ /dev/null @@ -1,8 +0,0 @@ -/* jshint node: true */ -var configs = require("./configs"), - tasks = require("./tasks"); - -module.exports = { - configs: configs, - tasks: tasks -}; diff --git a/lib/grunt/tasks/build.js b/lib/grunt/tasks/build.js deleted file mode 100644 index dc0f3f859..000000000 --- a/lib/grunt/tasks/build.js +++ /dev/null @@ -1,16 +0,0 @@ -/* jshint node: true */ -module.exports = function(grunt) { - "use strict"; - - grunt.registerTask( - "build", - "Build from latest source", - [ - "concat", - "minify", - "usebanner:allhead", - "usebanner:allfoot", - "copy:images" - ]); - -}; diff --git a/lib/grunt/tasks/build_stripped.js b/lib/grunt/tasks/build_stripped.js deleted file mode 100644 index 5c11f1ced..000000000 --- a/lib/grunt/tasks/build_stripped.js +++ /dev/null @@ -1,17 +0,0 @@ -/* jshint node: true */ -module.exports = function(grunt) { - "use strict"; - - grunt.registerTask( - "build_stripped", - "Build from latest source w/ test artifacts stripped out", - [ - "concat", - "strip_code:build", - "minify", - "usebanner:allhead", - "usebanner:allfoot", - "copy:images" - ]); - -}; diff --git a/lib/grunt/tasks/default.js b/lib/grunt/tasks/default.js deleted file mode 100644 index 743547787..000000000 --- a/lib/grunt/tasks/default.js +++ /dev/null @@ -1,11 +0,0 @@ -/* jshint node: true */ -module.exports = function(grunt) { - "use strict"; - - grunt.registerTask( - "default", - "Default task: clean, lint, build, & test", - ["package"] - ); - -}; diff --git a/lib/grunt/tasks/dev.js b/lib/grunt/tasks/dev.js deleted file mode 100644 index 9d20c10ef..000000000 --- a/lib/grunt/tasks/dev.js +++ /dev/null @@ -1,7 +0,0 @@ -/* jshint node: true */ -module.exports = function(grunt) { - "use strict"; - - grunt.registerTask("dev", "Prepare code for testing", ["build", "copy:test"]); - -}; diff --git a/lib/grunt/tasks/index.js b/lib/grunt/tasks/index.js deleted file mode 100644 index 1f4bceaaa..000000000 --- a/lib/grunt/tasks/index.js +++ /dev/null @@ -1,3 +0,0 @@ -/* jshint node: true */ -module.exports = { -}; diff --git a/lib/grunt/tasks/minify.js b/lib/grunt/tasks/minify.js deleted file mode 100644 index 0165d0ca3..000000000 --- a/lib/grunt/tasks/minify.js +++ /dev/null @@ -1,18 +0,0 @@ -/* jshint node: true */ -module.exports = function(grunt) { - "use strict"; - - grunt.registerTask( - "minify", - "Minify the source javascript and css", - [ - "cssmin:all", - "uglify:core", - "uglify:jquery", - "uglify:coreS3", - "uglify:jqueryS3", - "uglify:jqueryAzure", - "uglify:coreAzure", - "uglify:all" - ]); -}; diff --git a/lib/grunt/tasks/package.js b/lib/grunt/tasks/package.js deleted file mode 100644 index 90d332e46..000000000 --- a/lib/grunt/tasks/package.js +++ /dev/null @@ -1,20 +0,0 @@ -/* jshint node: true */ -module.exports = function(grunt) { - "use strict"; - - grunt.registerTask( - "package", - "Build a zipped distribution-worthy version", - [ - "build_stripped", - "copy:dist", - "shell:version_dist_templates", - "compress:all", - "compress:jquery", - "compress:jqueryS3", - "compress:jqueryAzure", - "compress:core", - "compress:coreS3", - "compress:coreAzure" - ]); -}; diff --git a/lib/grunt/tasks/release.js b/lib/grunt/tasks/release.js deleted file mode 100644 index 62d9aec4b..000000000 --- a/lib/grunt/tasks/release.js +++ /dev/null @@ -1,123 +0,0 @@ -/* jshint node: true */ -require("string.prototype.endswith"); -var path = require("path"), - npm = require("npm"), - fs = require("fs"), - fsSync = require("fs-sync"), - - makeCommonJsLibDir = function(paths) { - // copy all files from all.fine-uploader dir into lib - fsSync.copy(path.join(paths.dist, "all.fine-uploader"), path.join(paths.dist, "lib")); - - // delete all the JS files & .min.css files - var libFiles = fs.readdirSync(path.join(paths.dist, "lib")), - index - for (index in libFiles) { - if (path.extname(libFiles[index]) === ".js") { - fsSync.remove(path.join(paths.dist, "lib", libFiles[index])); - } - else if (libFiles[index].endsWith(".min.css")) { - fsSync.remove(path.join(paths.dist, "lib", libFiles[index])); - } - } - - // remove redundancies in css filenames - fs.renameSync(path.join(paths.dist, "lib/fine-uploader.css"), path.join(paths.dist, "lib/legacy.css")) - fs.renameSync(path.join(paths.dist, "lib/fine-uploader-gallery.css"), path.join(paths.dist, "lib/gallery.css")) - fs.renameSync(path.join(paths.dist, "lib/fine-uploader-new.css"), path.join(paths.dist, "lib/rows.css")) - - // copy over the CommonJS index files - fsSync.copy(path.join(paths.commonJs), path.join(paths.dist, "lib")); - } - -module.exports = function(grunt) { - "use strict"; - - grunt.registerTask("release", [ - "clean", - "package", - "prepare-npm", - //"publish-npm", - "aws_s3:release" - ]); - - grunt.registerTask("release-develop", [ - "aws_s3:clean", - "clean", - "package", - "prepare-npm", - "aws_s3:develop" - ]); - - grunt.registerTask("prepublish", [ - "clean", - "package", - "prepare-npm" - ]); - - grunt.registerTask("release-travis", function() { - if (process.env.TRAVIS_PULL_REQUEST === "false") { - if (process.env.TRAVIS_BRANCH === "master") { - grunt.task.run("release"); - } - else if (process.env.TRAVIS_BRANCH === "develop") { - grunt.task.run("release-develop"); - } - } - }); - - grunt.registerTask("prepare-npm", function() { - // copy package.json into ./_dist - // npm publish from that directory - var paths = grunt.config.get("paths"), - pkgJsonCopy = JSON.parse(JSON.stringify(grunt.config.get("pkg"))), - readme = fs.readFileSync("README.md"), - license = fs.readFileSync("LICENSE"), - npmIgnore = "*.zip"; - - ["devDependencies", "scripts", "directories"].forEach(function(k) { - delete pkgJsonCopy[k]; - }); - - makeCommonJsLibDir(paths); - - fs.writeFileSync(path.join(paths.dist, "package.json"), JSON.stringify(pkgJsonCopy, null, 2)); - fs.writeFileSync(path.join(paths.dist, ".npmignore"), npmIgnore); - fs.writeFileSync(path.join(paths.dist, "README.md"), readme); - fs.writeFileSync(path.join(paths.dist, "LICENSE"), license); - - }); - - grunt.registerTask("publish-npm", function() { - var paths = grunt.config.get("paths"), - pkg = grunt.config.get("pkg"), - done = this.async(); - - npm.load({}, function(err) { - if (err) { - console.log(err); - return done(err); - } - npm.registry.adduser(process.env.NPM_USERNAME, process.env.NPM_PASSWORD, process.env.NPM_EMAIL, function(err) { - if (err) { - console.log(err); - return done(err); - } - - npm.config.set("email", process.env.NPM_EMAIL, "user"); - npm.commands.publish([paths.dist], function(err) { - if (err) { - console.log(err); - return done(err); - } - console.log(paths.dist + " v" + pkg.verison + " Published to registry"); - return done(); - - }); - - }); - - }); - }); - -}; diff --git a/lib/grunt/tasks/travis.js b/lib/grunt/tasks/travis.js deleted file mode 100644 index df7beca2f..000000000 --- a/lib/grunt/tasks/travis.js +++ /dev/null @@ -1,14 +0,0 @@ -/* jshint node: true */ -module.exports = function(grunt) { - "use strict"; - - grunt.registerTask( - "travis", - "Test with Travis CI", - [ - "dev", - "test:travis", - "release-travis" - ]); - -}; diff --git a/lib/modules.js b/lib/modules.js deleted file mode 100644 index 31a617d88..000000000 --- a/lib/modules.js +++ /dev/null @@ -1,308 +0,0 @@ -// Fine Uploader's modules -// -// shamelessly inspired by: -// https://github.com/angular/angular.js/blob/master/angularFiles.js -/* jshint node: true */ -var //dependencies - _ = require("underscore"), - - fineUploaderModules = { - // Pre-defined forumlae - fuTraditional: [ - "@fuSrcCore", - "@fuSrcUi", - "@fuSrcTraditional", - "@fuSrcModules", - "@fuUiModules" - ], - fuS3: [ - "@fuSrcCore", - "@fuSrcUi", - "@fuSrcS3", - "@fuSrcS3Ui", - "@fuSrcModules", - "@fuUiModules", - "@cryptoJs" - ], - fuAzure: [ - "@fuSrcCore", - "@fuSrcUi", - "@fuSrcAzure", - "@fuSrcAzureUi", - "@fuSrcModules", - "@fuUiModules" - ], - fuTraditionalJquery: [ - "@fuTraditional", - "@fuSrcJquery", - "@fuSrcJqueryDnd" - ], - fuS3Jquery: [ - "@fuS3", - "@fuSrcS3Jquery", - "@fuSrcJqueryDnd" - ], - fuAzureJquery: [ - "@fuAzure", - "@fuSrcAzureJquery", - "@fuSrcJqueryDnd" - ], - fuAll: [ - "@fuTraditional", - "@fuSrcS3", - "@fuSrcS3Ui", - "@fuSrcAzure", - "@fuSrcAzureUi", - "@cryptoJs" - ], - - // Groups - fuSrcModules: [ - "@fuPasteModule", - "@fuDndModule", - "@fuDeleteFileModule", - "@fuImagePreviewModule", - "@fuImageValidationModule", - "@fuSessionModule", - "@fuFormSupportModule", - "@fuScaling", - "@fuTotalProgress" - ], - - fuUiModules: [ - "@fuUiEvents", - "@fuEditFilenameModule" - ], - - // Source - fuSrcCore: [ - "client/js/util.js", - "client/js/error/error.js", - "client/js/version.js", - "client/js/features.js", - "client/js/promise.js", - "client/js/blob-proxy.js", - "client/js/button.js", - "client/js/upload-data.js", - "client/js/uploader.basic.api.js", - "client/js/uploader.basic.js", - "client/js/ajax.requester.js", - "client/js/upload-handler/upload.handler.js", - "client/js/upload-handler/upload.handler.controller.js", - "client/js/upload-handler/form.upload.handler.js", - "client/js/upload-handler/xhr.upload.handler.js", - "client/js/window.receive.message.js" //TODO Remove this - it is only applicable to traditional endpoints at this time - ], - fuSrcUi: [ - "client/js/uploader.api.js", - "client/js/uploader.js", - "client/js/templating.js" - ], - fuSrcTraditional: [ - "client/js/traditional/traditional.form.upload.handler.js", - "client/js/traditional/traditional.xhr.upload.handler.js", - "client/js/traditional/all-chunks-done.ajax.requester.js" - ], - fuSrcJquery: [ - "client/js/jquery-plugin.js" - ], - fuSrcS3: [ - "client/js/s3/util.js", - "client/js/non-traditional-common/*.js", - "client/js/s3/uploader.basic.js", - "client/js/s3/request-signer.js", - "client/js/uploadsuccess.ajax.requester.js", - "client/js/s3/multipart.initiate.ajax.requester.js", - "client/js/s3/multipart.complete.ajax.requester.js", - "client/js/s3/multipart.abort.ajax.requester.js", - "client/js/s3/s3.xhr.upload.handler.js", - "client/js/s3/s3.form.upload.handler.js" - ], - fuSrcS3Ui: [ - "client/js/s3/uploader.js" - ], - fuSrcS3Jquery: [ - "@fuSrcJquery", - "client/js/s3/jquery-plugin.js" - ], - fuSrcAzure: [ - "client/js/azure/util.js", - "client/js/non-traditional-common/*.js", - "client/js/azure/uploader.basic.js", - "client/js/azure/azure.xhr.upload.handler.js", - "client/js/azure/get-sas.js", - "client/js/uploadsuccess.ajax.requester.js", - "client/js/azure/rest/*.js" - ], - fuSrcAzureWithFormSupport: [ - "client/js/traditional/handler.form.js", - "@fuSrcAzure" - ], - fuSrcAzureUi: [ - "client/js/azure/uploader.js" - ], - fuSrcAzureJquery: [ - "@fuSrcJquery", - "client/js/azure/jquery-plugin.js" - ], - cryptoJs: [ - "client/js/third-party/crypto-js/core.js", - "client/js/third-party/crypto-js/enc-base64.js", - "client/js/third-party/crypto-js/hmac.js", - "client/js/third-party/crypto-js/sha1.js", - "client/js/third-party/crypto-js/sha256.js", - "client/js/third-party/crypto-js/lib-typedarrays.js" - ], - fuImagePreviewModule: [ - "client/js/image-support/megapix-image.js", - "client/js/image-support/image.js", - "client/js/image-support/exif.js", - "client/js/identify.js" - ], - fuImageValidationModule: [ - "client/js/identify.js", - "client/js/image-support/validation.image.js" - ], - fuPasteModule: [ - "client/js/paste.js" - ], - fuDndModule: [ - "client/js/dnd.js" - ], - fuSrcJqueryDnd: [ - "client/js/jquery-dnd.js" - ], - fuDeleteFileModule: [ - "client/js/deletefile.ajax.requester.js" - ], - fuUiEvents: [ - "client/js/ui.handler.events.js", - "client/js/ui.handler.click.filebuttons.js" - ], - fuEditFilenameModule: [ - "client/js/ui.handler.click.filename.js", - "client/js/ui.handler.focusin.filenameinput.js", - "client/js/ui.handler.focus.filenameinput.js", - "client/js/ui.handler.edit.filename.js" - ], - fuSessionModule: [ - "client/js/session.js", - "client/js/session.ajax.requester.js" - ], - fuFormSupportModule: [ - "client/js/form-support.js" - ], - fuScaling: [ - "client/js/image-support/scaler.js", - "client/js/third-party/ExifRestorer.js" - ], - fuTotalProgress: [ - "client/js/total-progress.js" - ], - fuIframeXssResponse: [ - "client/js/iframe.xss.response.js" - ], - fuExtra: [ - "@fuImages", - "@fuCss", - "@fuCssGallery", - "@fuCssLegacy", - "@fuDocs", - "@fuTemplates" - ], - fuTemplates: [ - "client/html/templates/default.html", - "client/html/templates/gallery.html", - "client/html/templates/simple-thumbnails.html" - ], - fuImages: [ - "client/continue.gif", - "client/edit.gif", - "client/loading.gif", - "client/pause.gif", - "client/processing.gif", - "client/retry.gif", - "client/trash.gif" - ], - fuPlaceholders: [ - "client/placeholders/not_available-generic.png", - "client/placeholders/waiting-generic.png" - ], - fuCss: [ - "client/fineuploader-new.css" - ], - fuCssGallery: [ - "client/fineuploader-gallery.css" - ], - fuCssLegacy: [ - "client/fineuploader.css" - ], - fuDocs: [ - "README.md", - "LICENSE" - ], - versioned: [ - "package.json", - "client/js/version.js" - ], - fuUnit: [ - "test/static/local/helpme.js", - "test/unit/**/*.js" - ], - karmaModules: [ - "test/static/third-party/assert/assert.js", - "test/static/third-party/jquery/jquery.js", - "test/static/third-party/jquery.simulate/jquery.simulate.js", - "test/static/third-party/json2/json2.js", - "test/static/third-party/purl/purl.js", - "test/static/third-party/sinon/sinon.js", - "test/static/third-party/sinon/event.js", - "test/static/third-party/sinon/fake_xml_http_request.js", - "test/static/local/formdata.js" - ], - testHelperModules: [ - "test/static/local/karma-runner.js", - "test/static/local/blob-maker.js", - "test/static/third-party/q/q-1.0.1.js", - "node_modules/pica/dist/pica.js" - ], - fuSrcBuild: [ - "_build/all!(@(*.min.js|*.gif|*.css))" - ] - }; - -if (exports) { - (function() { - "use strict"; - var mergeModules = function() { - var files = [], - quiet = false, - start = 0, - args = Array.prototype.slice.call(arguments, start); - if (typeof args[0] === "boolean") { - quiet = true; - start = 1; - } - - Array.prototype.slice.call(arguments, start).forEach(function(filegroup) { - fineUploaderModules[filegroup].forEach(function(file) { - // replace @ref - var match = file.match(/^\@(.*)/); - if (match) { - //if (!quiet) { console.log("Adding module to build: @" + match[1]); } - files = files.concat(mergeModules(quiet, match[1])); - //files = files.concat(fineUploaderModules[match[1]]); - } else { - //if (!quiet) { console.log(" Adding file to build: " + file); } - files.push(file); - } - }); - }); - - return _.unique(files); - }; - - exports.modules = fineUploaderModules; - exports.mergeModules = mergeModules; - }()); -} diff --git a/package.json b/package.json index 3bc6339fa..66032820e 100644 --- a/package.json +++ b/package.json @@ -40,39 +40,17 @@ "url": "https://github.com/FineUploader/fine-uploader/issues" }, "devDependencies": { - "async": "0.2.9", "clean-css": "3.4.19", - "fs-sync": "1.0.2", - "glob": "3.2.6", - "grunt": "^0.4.5", - "grunt-aws-s3": "^0.10.0", - "grunt-banner": "0.2.0", - "grunt-cli": "1.2.0", - "grunt-contrib-compress": "0.5.2", - "grunt-contrib-concat": "0.3.0", - "grunt-contrib-copy": "0.4.1", - "grunt-contrib-uglify": "0.2.2", - "grunt-open": "0.2.2", - "grunt-shell": "0.3.1", - "grunt-strip-code": "0.1.2", - "grunt-version": "0.2.2", "jscs": "3.0.7", "jshint": "2.9.2", - "karma": "0.10.10", - "karma-firefox-launcher": "0.1.2", - "karma-mocha": "0.1.0", - "karma-spec-reporter": "0.0.13", + "karma": "1.1.2", + "karma-firefox-launcher": "1.0.0", + "karma-mocha": "1.1.1", + "karma-spec-reporter": "0.0.26", + "mocha": "3.0.1", "node-static": "0.7.8 ", - "npm": "^2.1.17", - "optimist": "0.6.0", "pica": "latest", - "request": "2.21.0", - "semver": "2.0.x", - "string.prototype.endswith": "0.2.0", - "time-grunt": "^1.0.0", - "uglify-js": "2.7.0", - "underscore": "1.5.2", - "uuid": "1.4.1" + "uglify-js": "2.7.0" }, "scripts": { "build": "make lint; make build", From 1bb313539ee96bbfe3584aea0b1d183fb00241dc Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sun, 7 Aug 2016 00:22:23 -0500 Subject: [PATCH 19/31] chore(build): cleanup package.json #1569 --- CREDITS.txt => ATTRIBUTION.txt | 0 Makefile | 13 +++++++++++-- package.json | 8 ++------ 3 files changed, 13 insertions(+), 8 deletions(-) rename CREDITS.txt => ATTRIBUTION.txt (100%) diff --git a/CREDITS.txt b/ATTRIBUTION.txt similarity index 100% rename from CREDITS.txt rename to ATTRIBUTION.txt diff --git a/Makefile b/Makefile index 66b225e6d..629ce9bdb 100644 --- a/Makefile +++ b/Makefile @@ -455,5 +455,14 @@ publish: \ copy-azure-jquery-dist \ copy-all-dist \ copy-all-jquery-dist \ -# tag-release \ -# push-to-npm + tag-release \ + push-to-npm + +setup-dev: + (cd test/dev/handlers; curl -sS https://getcomposer.org/installer | php; php composer.phar install) + +start-local-dev: + (. test/dev/handlers/s3keys.sh; php -S 0.0.0.0:9090 -t . -c test/dev/handlers/php.ini) + +update-dev: + (cd test/dev/handlers; php composer.phar update) diff --git a/package.json b/package.json index 66032820e..2246c2c22 100644 --- a/package.json +++ b/package.json @@ -53,12 +53,8 @@ "uglify-js": "2.7.0" }, "scripts": { - "build": "make lint; make build", - "devbuild": "make clean; make build-all-ui", + "build": "make clean; make build-all-ui", "lint": "make lint", - "setup-dev": "(cd test/dev/handlers; curl -sS https://getcomposer.org/installer | php; php composer.phar install)", - "start-local-dev": "(. test/dev/handlers/s3keys.sh; php -S 0.0.0.0:9090 -t . -c test/dev/handlers/php.ini)", - "test": "make lint && make test", - "update-dev": "(cd test/dev/handlers; php composer.phar update)" + "test": "make lint && make test" } } From 7cd196e77e6c26be46226375bc525782990692e8 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sun, 7 Aug 2016 00:24:40 -0500 Subject: [PATCH 20/31] chore(package.json): add contributors [skip ci] --- package.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package.json b/package.json index 2246c2c22..96d0276c2 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,12 @@ "url": "git://github.com/FineUploader/fine-uploader.git" }, "author": "Widen Enterprises, Inc.", + "contributors": [ + { + "name": "Ray Nicholus", + "url": "http://raynicholus.com" + } + ], "license": "MIT", "bugs": { "url": "https://github.com/FineUploader/fine-uploader/issues" From 370bfcafb3efd364f2848a4b985845bc8709d0cc Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sun, 7 Aug 2016 00:47:54 -0500 Subject: [PATCH 21/31] chore(Makefile): easy version rev #1569 --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 629ce9bdb..6987a25bb 100644 --- a/Makefile +++ b/Makefile @@ -466,3 +466,7 @@ start-local-dev: update-dev: (cd test/dev/handlers; php composer.phar update) + +rev-version: + sed -i "" -e 's/$(VERSION)/$(target)/g' client/js/version.js + sed -i "" -e 's/$(VERSION)/$(target)/g' package.json From 93f3787f0a42a9dba75e5a8427e0ee57f0a2d739 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sun, 7 Aug 2016 22:21:48 -0500 Subject: [PATCH 22/31] chore(Makefile): final cleanup Removed new jQuery builds, fixed JS compression #1569 --- Makefile | 101 +++++++++++++++---------------------------------------- 1 file changed, 28 insertions(+), 73 deletions(-) diff --git a/Makefile b/Makefile index 6987a25bb..5d18ba38d 100644 --- a/Makefile +++ b/Makefile @@ -217,151 +217,106 @@ _build: $(NPM-BIN)/cleancss --source-map $@/fine-uploader-gallery.css -o $@/fine-uploader-gallery.min.css $(NPM-BIN)/cleancss --source-map $@/fine-uploader-new.css -o $@/fine-uploader-new.min.css +uglify = $(NPM-BIN)/uglifyjs -b --preamble $(PREAMBLE) -e window:global -p relative +uglify-min = $(NPM-BIN)/uglifyjs -c -m --preamble $(PREAMBLE) -e window:global -p relative + build-dnd-standalone: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(DND-FILES) -o $(BUILD-OUT-DIR)/dnd.js -b -e window:global --source-map $(BUILD-OUT-DIR)/dnd.js.map -p relative + $(uglify) $(DND-FILES) -o $(BUILD-OUT-DIR)/dnd.js --source-map $(BUILD-OUT-DIR)/dnd.js.map build-dnd-standalone-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(DND-FILES) -o $(BUILD-OUT-DIR)/dnd.min.js -e window:global --source-map $(BUILD-OUT-DIR)/dnd.min.js.map -p relative - -build-dnd-standalone-jquery: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(DND-JQUERY-FILES) -o $(BUILD-OUT-DIR)/dnd.jquery.js -b -e window:global --source-map $(BUILD-OUT-DIR)/dnd.jquery.js.map -p relative - -build-dnd-standalone-jquery-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(DND-JQUERY-FILES) -o $(BUILD-OUT-DIR)/dnd.jquery.js -e window:global --source-map $(BUILD-OUT-DIR)/dnd.jquery.js.map -p relative + $(uglify-min) $(DND-FILES) -o $(BUILD-OUT-DIR)/dnd.min.js --source-map $(BUILD-OUT-DIR)/dnd.min.js.map build-core-traditional: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.core.js -b -e window:global --source-map $(BUILD-OUT-DIR)/fine-uploader.core.js.map -p relative + $(uglify) $(TRADITIONAL-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.core.js --source-map $(BUILD-OUT-DIR)/fine-uploader.core.js.map build-core-traditional-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/fine-uploader.core.min.js.map -p relative - -build-core-traditional-jquery: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/jquery.fine-uploader.core.js -b -e window:global --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.core.js.map -p relative - -build-core-traditional-jquery-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/jquery.fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.core.min.js.map -p relative + $(uglify-min) $(TRADITIONAL-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.core.min.js --source-map $(BUILD-OUT-DIR)/fine-uploader.core.min.js.map build-ui-traditional: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-UI-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/fine-uploader.js.map -p relative + $(uglify) $(TRADITIONAL-UI-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.js --source-map $(BUILD-OUT-DIR)/fine-uploader.js.map build-ui-traditional-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-UI-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/fine-uploader.min.js.map -p relative + $(uglify-min) $(TRADITIONAL-UI-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.min.js --source-map $(BUILD-OUT-DIR)/fine-uploader.min.js.map build-ui-traditional-jquery: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.jquery.js -b -e window:global --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.js.map -p relative + $(uglify) $(TRADITIONAL-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.jquery.js --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.js.map build-ui-traditional-jquery-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(TRADITIONAL-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.jquery.min.js -e window:global --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.min.js.map -p relative + $(uglify-min) $(TRADITIONAL-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/fine-uploader.jquery.min.js --source-map $(BUILD-OUT-DIR)/jquery.fine-uploader.min.js.map build-core-s3: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.core.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.core.js.map -p relative + $(uglify) $(S3-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.core.js --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.core.js.map build-core-s3-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.core.min.js.map -p relative - -build-core-s3-jquery: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.core.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.core.js.map -p relative - -build-core-s3-jquery-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.core.min.js.map -p relative + $(uglify-min) $(S3-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.core.min.js --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.core.min.js.map build-ui-s3: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-UI-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.js.map -p relative + $(uglify) $(S3-UI-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.js --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.js.map build-ui-s3-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.min.js.map -p relative + $(uglify-min) $(S3-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.min.js --source-map $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.min.js.map build-ui-s3-jquery: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.js.map -p relative + $(uglify) $(S3-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.js --source-map $(BUILD-OUT-DIR)/s3.jquery.fine-uploader.js.map build-ui-s3-jquery-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(S3-UI-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.min.js.map -p relative + $(uglify-min) $(S3-UI-FILES) -o $(BUILD-OUT-DIR)/s3.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/s3.fine-uploader.min.js.map build-core-azure: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.core.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.core.js.map -p relative + $(uglify) $(AZURE-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.core.js --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.core.js.map build-core-azure-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.core.min.js.map -p relative - -build-core-azure-jquery: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.core.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.core.js.map -p relative - -build-core-azure-jquery-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.core.min.js.map -p relative + $(uglify-min) $(AZURE-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.core.min.js.map build-ui-azure: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-UI-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.js.map -p relative + $(uglify) $(AZURE-UI-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.js --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.js.map build-ui-azure-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-UI-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.min.js.map -p relative + $(uglify-min) $(AZURE-UI-FILES) -o $(BUILD-OUT-DIR)/azure.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.fine-uploader.min.js.map build-ui-azure-jquery: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.js.map -p relative + $(uglify) $(AZURE-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.js --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.js.map build-ui-azure-jquery-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(AZURE-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.min.js.map -p relative + $(uglify-min) $(AZURE-UI-JQUERY-FILES) -o $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/azure.jquery.fine-uploader.min.js.map build-all-core: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-CORE-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.core.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.core.js.map -p relative + $(uglify) $(ALL-CORE-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.core.js --source-map $(BUILD-OUT-DIR)/all.fine-uploader.core.js.map build-all-core-min: _build - $(NPM-BIN)/uglifyjs $(ALL-CORE-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.core.min.js.map -p relative - -build-all-core-jquery: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-CORE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.fine-uploader.core.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.fine-uploader.core.js.map -p relative - -build-all-core-jquery-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-CORE-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.fine-uploader.core.min.js.map -p relative + $(uglify-min) $(ALL-CORE-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.core.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.core.min.js.map build-all-ui: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.js.map -p relative + $(uglify) $(ALL-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.js --source-map $(BUILD-OUT-DIR)/all.fine-uploader.js.map build-all-ui-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.min.js.map -p relative - -build-all-ui-jquery: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.fine-uploader.js -b -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.fine-uploader.js.map -p relative - -build-all-ui-jquery-min: _build - $(NPM-BIN)/uglifyjs --preamble $(PREAMBLE) $(ALL-JQUERY-FILES) -o $(BUILD-OUT-DIR)/all.jquery.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.jquery.fine-uploader.min.js.map -p relative + $(uglify-min) $(ALL-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.min.js.map build: \ build-dnd-standalone \ build-dnd-standalone-min \ - build-dnd-standalone-jquery \ - build-dnd-standalone-jquery-min \ build-core-traditional \ build-core-traditional-min \ - build-core-traditional-jquery \ - build-core-traditional-jquery-min \ build-ui-traditional \ build-ui-traditional-min \ build-ui-traditional-jquery \ build-ui-traditional-jquery-min \ build-core-s3 \ build-core-s3-min \ - build-core-s3-jquery \ - build-core-s3-jquery-min \ build-ui-s3 \ build-ui-s3-min \ build-ui-s3-jquery \ build-ui-s3-jquery-min \ build-core-azure \ build-core-azure-min \ - build-core-azure-jquery \ - build-core-azure-jquery-min \ build-ui-azure \ build-ui-azure-min \ build-ui-azure-jquery \ build-ui-azure-jquery-min \ build-all-core \ build-all-core-min \ - build-all-core-jquery \ - build-all-core-jquery-min \ build-all-ui \ - build-all-ui-min \ - build-all-ui-jquery \ - build-all-ui-jquery-min + build-all-ui-min start-test-resources-server: test-resources-server.PID From 260a50ba2b45ceb9cc72fa707c3573aa0845add1 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sun, 7 Aug 2016 22:53:25 -0500 Subject: [PATCH 23/31] chore(Makefile): leave out core for jquery builds #1569 --- Makefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 5d18ba38d..449e26b05 100644 --- a/Makefile +++ b/Makefile @@ -362,7 +362,10 @@ copy-build-to-dist: mkdir -p $(PUB-DIR)/$(PUB-SUBDIR) cp -pR $(BUILD-OUT-DIR)/placeholders $(BUILD-OUT-DIR)/templates $(PUB-DIR)/$(PUB-SUBDIR) cp $(BUILD-OUT-DIR)/*.gif $(PUB-DIR)/$(PUB-SUBDIR) +ifneq (,$(findstring jquery,$(PUB-SUBDIR))) +else cp $(BUILD-OUT-DIR)/$(PUB-SUBDIR).core.min* $(BUILD-OUT-DIR)/$(PUB-SUBDIR).core.js* $(PUB-DIR)/$(PUB-SUBDIR)/ +endif cp $(BUILD-OUT-DIR)/$(PUB-SUBDIR).min* $(BUILD-OUT-DIR)/$(PUB-SUBDIR).js* $(PUB-DIR)/$(PUB-SUBDIR) cp $(BUILD-OUT-DIR)/fine-uploader*.css* $(PUB-DIR)/$(PUB-SUBDIR) @@ -390,9 +393,6 @@ copy-azure-jquery-dist: copy-all-dist: make copy-build-to-dist PUB-SUBDIR=all.fine-uploader -copy-all-jquery-dist: - make copy-build-to-dist PUB-SUBDIR=all.jquery.fine-uploader - tag-release: git tag $(VERSION) git push origin $(VERSION) @@ -409,7 +409,6 @@ publish: \ copy-azure-dist \ copy-azure-jquery-dist \ copy-all-dist \ - copy-all-jquery-dist \ tag-release \ push-to-npm From f0757fa386c71f58e6d90dc3a110ab48d01d3db0 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sun, 7 Aug 2016 23:04:18 -0500 Subject: [PATCH 24/31] chore(Makefile): include dnd in published artifacts too #1569 --- Makefile | 18 +++++++++++++----- client/commonJs/dnd.js | 3 +++ 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 client/commonJs/dnd.js diff --git a/Makefile b/Makefile index 449e26b05..d2a779396 100644 --- a/Makefile +++ b/Makefile @@ -211,6 +211,7 @@ _build: mkdir -p $@ cp -pR $(SRC-DIR)/placeholders $@ cp -pR $(SRC-DIR)/html/templates $@ + cp LICENSE $@ cp $(SRC-DIR)/*.css $@ cp $(SRC-DIR)/*.gif $@ $(NPM-BIN)/cleancss --source-map $@/fine-uploader.css -o $@/fine-uploader.min.css @@ -339,19 +340,22 @@ test: start-test-resources-server start-root-server build-all-ui make stop-test-resources-server make stop-root-server -zip: zip-traditional zip-s3 zip-azure +zip: zip-dnd zip-traditional zip-s3 zip-azure + +zip-dnd: + (cd $(BUILD-OUT-DIR) ; zip fine-uploader.dnd.zip LICENSE dnd*.*) zip-traditional: - (cd $(BUILD-OUT-DIR) ; zip fine-uploader.zip placeholders/* templates/* *.gif fine-uploader*.* fine-uploader.core*.*) + (cd $(BUILD-OUT-DIR) ; zip fine-uploader.zip LICENSE placeholders/* templates/* *.gif fine-uploader*.* fine-uploader.core*.*) zip-s3: - (cd $(BUILD-OUT-DIR) ; zip s3.fine-uploader.zip placeholders/* templates/* *.gif fine-uploader*.css* s3*.*) + (cd $(BUILD-OUT-DIR) ; zip s3.fine-uploader.zip LICENSE placeholders/* templates/* *.gif fine-uploader*.css* s3*.*) zip-azure: - (cd $(BUILD-OUT-DIR) ; zip azure.fine-uploader.zip placeholders/* templates/* *.gif fine-uploader*.css* azure*.*) + (cd $(BUILD-OUT-DIR) ; zip azure.fine-uploader.zip LICENSE placeholders/* templates/* *.gif fine-uploader*.css* azure*.*) zip-all: - (cd $(BUILD-OUT-DIR) ; zip all.fine-uploader.zip placeholders/* templates/* *.gif fine-uploader*.css* all*.*) + (cd $(BUILD-OUT-DIR) ; zip all.fine-uploader.zip LICENSE placeholders/* templates/* *.gif fine-uploader*.css* all*.*) setup-dist: mkdir -p $(PUB-DIR) @@ -369,6 +373,9 @@ endif cp $(BUILD-OUT-DIR)/$(PUB-SUBDIR).min* $(BUILD-OUT-DIR)/$(PUB-SUBDIR).js* $(PUB-DIR)/$(PUB-SUBDIR) cp $(BUILD-OUT-DIR)/fine-uploader*.css* $(PUB-DIR)/$(PUB-SUBDIR) +copy-dnd: + mkdir -p $(PUB-DIR)/dnd + cp $(BUILD-OUT-DIR)/dnd*.* $(PUB-DIR)/dnd copy-traditional-dist: make copy-build-to-dist PUB-SUBDIR=fine-uploader @@ -402,6 +409,7 @@ push-to-npm: publish: \ setup-dist \ + copy-dnd \ copy-traditional-dist \ copy-traditional-jquery-dist \ copy-s3-dist \ diff --git a/client/commonJs/dnd.js b/client/commonJs/dnd.js new file mode 100644 index 000000000..9bddfe7a0 --- /dev/null +++ b/client/commonJs/dnd.js @@ -0,0 +1,3 @@ +"use strict"; + +module.exports = require("../dnd/dnd"); From e55eb909015753c5869617ebd444cee52c7ec001 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sun, 7 Aug 2016 23:17:24 -0500 Subject: [PATCH 25/31] docs(README.md): update build/test instructions #1569 [skip ci] --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c7059e6d..c98aa4cc3 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,14 @@ There are absolutely no other required external dependencies. For more informati Fine Uploader and all other projects in this organization thrive thanks to donations by Widen (the project's sponsor) and support by developers in the community. If you'd like to help and keep this project strong and relevant, you have several options. + ### Contribute code The best way to contribute code is to open up a pull request that addresses one of the open [feature requests or bugs][issues]. In order to get started developing Fine Uploader, follow these steps to get the project up and running on your local development machine: 1. Download the project repository: `git clone https://github.com/FineUploader/fine-uploader.git`. 2. Install all project development dependencies: `npm install`. -3. To run the tests & linter: `$(npm bin)/grunt dev test:firefox` (you'll need Firefox installed locally). +3. To build, run the tests & linter: `npm test` (you'll need Firefox installed locally). 4. Please follow the [Angular.js commit guidelines][angular-commit]. 5. Please follow the [Git Flow][git-flow] branching strategy. From d1324a5ed396d119bff265555406551f071e52c8 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sun, 7 Aug 2016 23:19:03 -0500 Subject: [PATCH 26/31] chore(build): prepare for 5.11.0 release #1569 --- client/js/version.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/js/version.js b/client/js/version.js index 65285d399..4f59a3752 100644 --- a/client/js/version.js +++ b/client/js/version.js @@ -1,2 +1,2 @@ /*global qq */ -qq.version = "5.10.1"; +qq.version = "5.11.0"; diff --git a/package.json b/package.json index 96d0276c2..ac9784a4b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "fine-uploader", "title": "Fine Uploader", "main": "lib/traditional.js", - "version": "5.10.1", + "version": "5.11.0", "description": "Multiple file upload plugin with progress-bar, drag-and-drop, direct-to-S3 & Azure uploading, client-side image scaling, preview generation, form support, chunking, auto-resume, and tons of other features.", "keywords": [ "amazon", From 4a6a5020ac146651a3db9ab9911ead2a32347865 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sun, 7 Aug 2016 23:35:04 -0500 Subject: [PATCH 27/31] chore(build): more consistent name for dnd zip #1569 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d2a779396..53a73814b 100644 --- a/Makefile +++ b/Makefile @@ -343,7 +343,7 @@ test: start-test-resources-server start-root-server build-all-ui zip: zip-dnd zip-traditional zip-s3 zip-azure zip-dnd: - (cd $(BUILD-OUT-DIR) ; zip fine-uploader.dnd.zip LICENSE dnd*.*) + (cd $(BUILD-OUT-DIR) ; zip dnd.fine-uploader.zip LICENSE dnd*.*) zip-traditional: (cd $(BUILD-OUT-DIR) ; zip fine-uploader.zip LICENSE placeholders/* templates/* *.gif fine-uploader*.* fine-uploader.core*.*) From eda9119316af47bedd754b66e628aed3ae6cd113 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Sun, 7 Aug 2016 23:46:35 -0500 Subject: [PATCH 28/31] chore(build): don't need a standalone dnd zip #1569 --- Makefile | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 53a73814b..5c45201e7 100644 --- a/Makefile +++ b/Makefile @@ -340,22 +340,27 @@ test: start-test-resources-server start-root-server build-all-ui make stop-test-resources-server make stop-root-server -zip: zip-dnd zip-traditional zip-s3 zip-azure +zip: zip-traditional zip-s3 zip-azure zip-all -zip-dnd: - (cd $(BUILD-OUT-DIR) ; zip dnd.fine-uploader.zip LICENSE dnd*.*) +common-zip-files = \ + dnd*.* \ + LICENSE \ + placeholders/* \ + templates/* \ + *.gif \ + fine-uploader*.css* zip-traditional: - (cd $(BUILD-OUT-DIR) ; zip fine-uploader.zip LICENSE placeholders/* templates/* *.gif fine-uploader*.* fine-uploader.core*.*) + (cd $(BUILD-OUT-DIR) ; zip fine-uploader.zip $(common-zip-files) fine-uploader*.*) zip-s3: - (cd $(BUILD-OUT-DIR) ; zip s3.fine-uploader.zip LICENSE placeholders/* templates/* *.gif fine-uploader*.css* s3*.*) + (cd $(BUILD-OUT-DIR) ; zip s3.fine-uploader.zip $(common-zip-files) s3*.*) zip-azure: - (cd $(BUILD-OUT-DIR) ; zip azure.fine-uploader.zip LICENSE placeholders/* templates/* *.gif fine-uploader*.css* azure*.*) + (cd $(BUILD-OUT-DIR) ; zip azure.fine-uploader.zip $(common-zip-files) azure*.*) zip-all: - (cd $(BUILD-OUT-DIR) ; zip all.fine-uploader.zip LICENSE placeholders/* templates/* *.gif fine-uploader*.css* all*.*) + (cd $(BUILD-OUT-DIR) ; zip all.fine-uploader.zip $(common-zip-files) all*.*) setup-dist: mkdir -p $(PUB-DIR) @@ -408,6 +413,8 @@ push-to-npm: (cd $(PUB-DIR) ; npm publish) publish: \ + clean + build setup-dist \ copy-dnd \ copy-traditional-dist \ From 89a96d0d709da74c592c3410b25d07da1e2df552 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Mon, 8 Aug 2016 00:13:30 -0500 Subject: [PATCH 29/31] fix(build): source files missing from sourcemap #1569 --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5c45201e7..d8fde2145 100644 --- a/Makefile +++ b/Makefile @@ -218,8 +218,8 @@ _build: $(NPM-BIN)/cleancss --source-map $@/fine-uploader-gallery.css -o $@/fine-uploader-gallery.min.css $(NPM-BIN)/cleancss --source-map $@/fine-uploader-new.css -o $@/fine-uploader-new.min.css -uglify = $(NPM-BIN)/uglifyjs -b --preamble $(PREAMBLE) -e window:global -p relative -uglify-min = $(NPM-BIN)/uglifyjs -c -m --preamble $(PREAMBLE) -e window:global -p relative +uglify = $(NPM-BIN)/uglifyjs -b --preamble $(PREAMBLE) -e window:global -p relative --source-map-include-sources +uglify-min = $(NPM-BIN)/uglifyjs -c -m --preamble $(PREAMBLE) -e window:global -p relative --source-map-include-sources build-dnd-standalone: _build $(uglify) $(DND-FILES) -o $(BUILD-OUT-DIR)/dnd.js --source-map $(BUILD-OUT-DIR)/dnd.js.map @@ -291,7 +291,7 @@ build-all-ui: _build $(uglify) $(ALL-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.js --source-map $(BUILD-OUT-DIR)/all.fine-uploader.js.map build-all-ui-min: _build - $(uglify-min) $(ALL-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.min.js -e window:global --source-map $(BUILD-OUT-DIR)/all.fine-uploader.min.js.map + $(uglify-min) $(ALL-FILES) -o $(BUILD-OUT-DIR)/all.fine-uploader.min.js --source-map $(BUILD-OUT-DIR)/all.fine-uploader.min.js.map build: \ build-dnd-standalone \ From 6345c097cc1ed16e44b46766f4b98ddcc17c10f1 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Mon, 8 Aug 2016 00:25:24 -0500 Subject: [PATCH 30/31] docs(getting started): update quickstart w/ ui/core build refs #1569 --- docs/quickstart/01-getting-started.jmd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/quickstart/01-getting-started.jmd b/docs/quickstart/01-getting-started.jmd index 234b466c9..ee84296f5 100644 --- a/docs/quickstart/01-getting-started.jmd +++ b/docs/quickstart/01-getting-started.jmd @@ -31,6 +31,9 @@ who wish to heavily customize the uploader's user interface. To use Core Mode: var uploader = new qq.FineUploaderBasic({/* options go here .... */}); ``` +**Each endpoint handler has a "core" build artifact associated with it. For example, if +you only need core functionality for Fine Uploader S3, you should import "s3.fine-uploader.core.js".** + ##### [UI Mode](../modes/ui.html) Inherits everything from Core mode. UI mode also comes with a fully functional user interface which includes, but is not limited to: a default upload button, @@ -42,6 +45,8 @@ UI via CSS. To use UI Mode: ```javascript var uploader = new qq.FineUploader({/* options go here ... */}); ``` +**Each endpoint handler has a "ui" build artifact associated with it. For example, if +you only need core functionality for Fine Uploader S3, you should import "s3.fine-uploader.js".** {{ alert( """If you are using Fine Uploader UI, you MUST include a template in your document/markup. You can From e2bf728f5424b510748c82e459168db48d35ffb2 Mon Sep 17 00:00:00 2001 From: Ray Nicholus Date: Mon, 8 Aug 2016 00:26:30 -0500 Subject: [PATCH 31/31] docs(getting started): typo #1569 --- docs/quickstart/01-getting-started.jmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quickstart/01-getting-started.jmd b/docs/quickstart/01-getting-started.jmd index ee84296f5..48edae184 100644 --- a/docs/quickstart/01-getting-started.jmd +++ b/docs/quickstart/01-getting-started.jmd @@ -46,7 +46,7 @@ UI via CSS. To use UI Mode: var uploader = new qq.FineUploader({/* options go here ... */}); ``` **Each endpoint handler has a "ui" build artifact associated with it. For example, if -you only need core functionality for Fine Uploader S3, you should import "s3.fine-uploader.js".** +you need core _and_ UI functionality for Fine Uploader S3, you should import "s3.fine-uploader.js".** {{ alert( """If you are using Fine Uploader UI, you MUST include a template in your document/markup. You can