Fixed #352 - Removed `process` from browserified version of filer

This commit is contained in:
Kieran Sedgwick 2015-05-31 11:18:20 -04:00
parent 1df35e1834
commit f338991ace
5 changed files with 1018 additions and 1361 deletions

2
dist/buffer.min.js vendored

File diff suppressed because one or more lines are too long

2316
dist/filer.js vendored

File diff suppressed because it is too large Load Diff

8
dist/filer.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/path.min.js vendored
View File

@ -1,2 +1,2 @@
/*! filer 0.0.41 2015-06-01 */
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Path=t()}}(function(){return function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);throw Error("Cannot find module '"+s+"'")}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;r.length>s;s++)i(r[s]);return i}({1:[function(t,e,n){function r(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function i(){for(var t="",e=!1,n=arguments.length-1;n>=-1&&!e;n--){var i=n>=0?arguments[n]:"/";"string"==typeof i&&i&&(t=i+"/"+t,e="/"===i.charAt(0))}return t=r(t.split("/").filter(function(t){return!!t}),!e).join("/"),(e?"/":"")+t||"."}function o(t){var e="/"===t.charAt(0);return"/"===t.substr(-1),t=r(t.split("/").filter(function(t){return!!t}),!e).join("/"),t||e||(t="."),(e?"/":"")+t}function s(){var t=Array.prototype.slice.call(arguments,0);return o(t.filter(function(t){return t&&"string"==typeof t}).join("/"))}function a(t,e){function r(t){for(var e=0;t.length>e&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),o=r(e.split("/")),s=Math.min(i.length,o.length),a=s,u=0;s>u;u++)if(i[u]!==o[u]){a=u;break}for(var c=[],u=a;i.length>u;u++)c.push("..");return c=c.concat(o.slice(a)),c.join("/")}function u(t){var e=v(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."}function c(t,e){var n=v(t)[2];return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),""===n?"/":n}function f(t){return v(t)[3]}function l(t){return"/"===t.charAt(0)?!0:!1}function h(t){return-1!==(""+t).indexOf("\0")?!0:!1}function p(t){return t.replace(/\/*$/,"/")}function d(t){return t=t.replace(/\/*$/,""),""===t?"/":t}var g=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,v=function(t){var e=g.exec(t);return[e[1]||"",e[2]||"",e[3]||"",e[4]||""]};e.exports={normalize:o,resolve:i,join:s,relative:a,sep:"/",delimiter:":",dirname:u,basename:c,extname:f,isAbsolute:l,isNull:h,addTrailing:p,removeTrailing:d}},{}]},{},[1])(1)});
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Path=t()}}(function(){return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);throw Error("Cannot find module '"+a+"'")}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;r.length>a;a++)i(r[a]);return i}({1:[function(t,e,n){function r(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function i(){for(var t="",e=!1,n=arguments.length-1;n>=-1&&!e;n--){var i=n>=0?arguments[n]:"/";"string"==typeof i&&i&&(t=i+"/"+t,e="/"===i.charAt(0))}return t=r(t.split("/").filter(function(t){return!!t}),!e).join("/"),(e?"/":"")+t||"."}function o(t){var e="/"===t.charAt(0);return"/"===t.substr(-1),t=r(t.split("/").filter(function(t){return!!t}),!e).join("/"),t||e||(t="."),(e?"/":"")+t}function a(){var t=Array.prototype.slice.call(arguments,0);return o(t.filter(function(t){return t&&"string"==typeof t}).join("/"))}function s(t,e){function r(t){for(var e=0;t.length>e&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),o=r(e.split("/")),a=Math.min(i.length,o.length),s=a,u=0;a>u;u++)if(i[u]!==o[u]){s=u;break}for(var c=[],u=s;i.length>u;u++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")}function u(t){var e=v(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."}function c(t,e){var n=v(t)[2];return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),""===n?"/":n}function f(t){return v(t)[3]}function l(t){return"/"===t.charAt(0)?!0:!1}function h(t){return-1!==(""+t).indexOf("\0")?!0:!1}function p(t){return t.replace(/\/*$/,"/")}function d(t){return t=t.replace(/\/*$/,""),""===t?"/":t}var g=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,v=function(t){var e=g.exec(t);return[e[1]||"",e[2]||"",e[3]||"",e[4]||""]};e.exports={normalize:o,resolve:i,join:a,relative:s,sep:"/",delimiter:":",dirname:u,basename:c,extname:f,isAbsolute:l,isNull:h,addTrailing:p,removeTrailing:d}},{}]},{},[1])(1)});

View File

@ -64,9 +64,18 @@ module.exports = function(grunt) {
dest: "./dist/filer.js",
options: {
browserifyOptions: {
commondir: false
commondir: false,
builtins: ["buffer", "path", "url", "punycode", "querystring"]
},
bundleOptions: {
insertGlobalVars: {
// This ensures that process won't be defined, since
// browserify will do so automatically if any globals
// are requested by us or detected by browserify.
process: function() {
return undefined;
}
},
standalone: 'Filer'
},
exclude: ["./node_modules/request/index.js"]
@ -77,16 +86,41 @@ module.exports = function(grunt) {
dest: "./dist/filer-perf.js",
options: {
browserifyOptions: {
commondir: false
commondir: false,
builtins: ["buffer", "path", "url", "punycode", "querystring"]
},
bundleOptions: {
insertGlobalVars: {
// This ensures that process won't be defined, since
// browserify will do so automatically if any globals
// are requested by us or detected by browserify.
process: function() {
return undefined;
}
},
standalone: 'Filer'
}
}
},
filerTest: {
src: "./tests/index.js",
dest: "./dist/filer-test.js"
dest: "./dist/filer-test.js",
options: {
browserifyOptions: {
commondir: false,
builtins: ["buffer", "path", "url", "punycode", "querystring"]
},
bundleOptions: {
insertGlobalVars: {
// This ensures that process won't be defined, since
// browserify will do so automatically if any globals
// are requested by us or detected by browserify.
process: function() {
return undefined;
}
}
}
}
},
// See tests/bugs/issue225.js
filerIssue225: {
@ -94,9 +128,18 @@ module.exports = function(grunt) {
dest: "./dist/filer-issue225.js",
options: {
browserifyOptions: {
commondir: false
commondir: false,
builtins: ["buffer", "path", "url", "punycode", "querystring"]
},
bundleOptions: {
insertGlobalVars: {
// This ensures that process won't be defined, since
// browserify will do so automatically if any globals
// are requested by us or detected by browserify.
process: function() {
return undefined;
}
},
standalone: 'Filer'
}
}