From d3b43de17fbf160643aa6a07d3d2c10b584c1e60 Mon Sep 17 00:00:00 2001 From: abose Date: Mon, 23 Aug 2021 21:10:15 +0530 Subject: [PATCH 1/2] Direct integration of webpack deps. https://github.com/aicore/phoenix/issues/40 --- .gitignore | 5 +---- src/thirdparty/preact-test-utils/preact-test-utils.js | 1 + src/thirdparty/preact/preact.js | 1 + src/thirdparty/semver.browser.js | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 src/thirdparty/preact-test-utils/preact-test-utils.js create mode 100644 src/thirdparty/preact/preact.js create mode 100644 src/thirdparty/semver.browser.js diff --git a/.gitignore b/.gitignore index 06d1e89a89..c7a006cf28 100644 --- a/.gitignore +++ b/.gitignore @@ -13,8 +13,7 @@ Thumbs.db /src/JSUtils/node/node_modules # ignore files copied from node_modules to src/thirdparty -/src/thirdparty/preact -/src/thirdparty/preact-test-utils +# https://github.com/aicore/phoenix/issues/10 # ignore compiled files /dist @@ -51,5 +50,3 @@ Thumbs.db # Files that can be automatically downloaded that we don't want to ship with our builds /src/extensibility/node/node_modules/request/tests/ -# Files build by scripts -/src/thirdparty/semver.browser.js diff --git a/src/thirdparty/preact-test-utils/preact-test-utils.js b/src/thirdparty/preact-test-utils/preact-test-utils.js new file mode 100644 index 0000000000..0587d60b0c --- /dev/null +++ b/src/thirdparty/preact-test-utils/preact-test-utils.js @@ -0,0 +1 @@ +define(function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=6)}([function(e,t,n){"use strict";(function(e){function o(){return null}function r(e){var t=e.nodeName,n=e.attributes;e.attributes={},t.defaultProps&&_(e.attributes,t.defaultProps),n&&_(e.attributes,n)}function i(e,t){var n,o,r;if(t){for(r in t)if(n=z.test(r))break;if(n){o=e.attributes={};for(r in t)t.hasOwnProperty(r)&&(o[z.test(r)?r.replace(/([A-Z0-9])/,"-$1").toLowerCase():r]=t[r])}}}function a(e,t,o){var r=t&&t._preactCompatRendered&&t._preactCompatRendered.base;r&&r.parentNode!==t&&(r=null),!r&&t&&(r=t.firstElementChild);for(var i=t.childNodes.length;i--;)t.childNodes[i]!==r&&t.removeChild(t.childNodes[i]);var a=n.i(A.c)(e,t,r);return t&&(t._preactCompatRendered=a&&(a._component||{base:a})),"function"==typeof o&&o(),a&&a._component||a}function u(e,t,o,r){var i=n.i(A.a)(Y,{context:e.context},t),u=a(i,o),c=u._component||u.base;return r&&r.call(c,u),c}function c(e){var t=e._preactCompatRendered&&e._preactCompatRendered.base;return!(!t||t.parentNode!==e)&&(n.i(A.c)(n.i(A.a)(o),e,t),!0)}function l(e){return v.bind(null,e)}function s(e,t){for(var n=t||0;n0;)o[r]=arguments[r+2];if(!y(e))return e;var i=e.attributes||e.props,a=n.i(A.a)(e.nodeName||e.type,i,e.children||i&&i.children),u=[a,t];return o&&o.length?u.push(o):t&&t.children&&u.push(t.children),h(A.d.apply(void 0,u))}function y(e){return e&&(e instanceof $||e.$$typeof===R)}function E(e,t){return t._refProxies[e]||(t._refProxies[e]=function(n){t&&t.refs&&(t.refs[e]=n,null===n&&(delete t._refProxies[e],t=null))})}function b(e){var t=e.nodeName,n=e.attributes;if(n&&"string"==typeof t){var o={};for(var r in n)o[r.toLowerCase()]=r;if(o.ondoubleclick&&(n.ondblclick=n[o.ondoubleclick],delete n[o.ondoubleclick]),o.onchange&&("textarea"===t||"input"===t.toLowerCase()&&!/^fil|che|rad/i.test(n.type))){var i=o.oninput||"oninput";n[i]||(n[i]=S([n[i],n[o.onchange]]),delete n[o.onchange])}}}function g(e){var t=e.attributes||(e.attributes={});te.enumerable="className"in t,t.className&&(t.class=t.className),Object.defineProperty(t,"className",te)}function _(e,t){for(var n=arguments,o=1,r=void 0;o=0&&"KeyboardEvent"===p&&(p="UIEvent");var h=u[p];if(!document.createEvent){n=r(document.createEventObject(),t);for(s in d)Object.defineProperty(n,s,{value:d[s]});return n}if(n=r(document.createEvent(p),t),"initKeyboardEvent"===h)if(void 0===n[h])h="initKeyEvent";else if(!("modifiersList"in t)){var m=[];t.metaKey&&m.push("Meta"),t.altKey&&m.push("Alt"),t.shiftKey&&m.push("Shift"),t.ctrlKey&&m.push("Control"),t.modifiersList=m.join(" ")}var y=c[h].map(function(e){return t[e]});n[h].apply(n,[e,t.bubbles,t.cancelable].concat(y));for(s in d)Object.defineProperty(n,s,{value:d[s]});return n},t.simulate=function(e,n,o){var r=t.generate(n,o);return document.createEvent?e.dispatchEvent(r):e.fireEvent("on"+n,r)}},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function r(e){if(s===setTimeout)return setTimeout(e,0);if((s===n||!s)&&setTimeout)return s=setTimeout,setTimeout(e,0);try{return s(e,0)}catch(t){try{return s.call(null,e,0)}catch(t){return s.call(this,e,0)}}}function i(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){h&&f&&(h=!1,f.length?v=f.concat(v):m=-1,v.length&&u())}function u(){if(!h){var e=r(a);h=!0;for(var t=v.length;t;){for(f=v,v=[];++m1)for(var n=1;n2;)K.push(arguments[a]);for(t&&null!=t.children&&(K.length||K.push(t.children),delete t.children);K.length;)if((r=K.pop())&&void 0!==r.pop)for(a=r.length;a--;)K.push(r[a]);else"boolean"==typeof r&&(r=null),(i="function"!=typeof e)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(i=!1)),i&&n?u[u.length-1]+=r:u===D?u=[r]:u.push(r),n=i;var c=new o;return c.nodeName=e,c.children=u,c.attributes=null==t?void 0:t,c.key=null==t?void 0:t.key,void 0!==I.vnode&&I.vnode(c),c}function i(e,t){for(var n in t)e[n]=t[n];return e}function a(e,t){return r(e.nodeName,i(i({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}function u(e){!e._dirty&&(e._dirty=!0)&&1==W.push(e)&&(I.debounceRendering||L)(c)}function c(){var e,t=W;for(W=[];e=t.pop();)e._dirty&&P(e)}function l(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&s(e,t.nodeName):n||e._componentConstructor===t.nodeName}function s(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function p(e){var t=i({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var o in n)void 0===t[o]&&(t[o]=n[o]);return t}function d(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.normalizedNodeName=e,n}function f(e){var t=e.parentNode;t&&t.removeChild(e)}function v(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||r)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var i in n)i in o||(e.style[i]="");for(var i in o)e.style[i]="number"==typeof o[i]&&!1===A.test(i)?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,m,a):e.removeEventListener(t,m,a),(e._listeners||(e._listeners={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e)h(e,t,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(t);else{var u=r&&t!==(t=t.replace(/^xlink\:?/,""));null==o||!1===o?u?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(u?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function h(e,t,n){try{e[t]=n}catch(e){}}function m(e){return this._listeners[e.type](I.event&&I.event(e)||e)}function y(){for(var e;e=j.pop();)I.afterMount&&I.afterMount(e),e.componentDidMount&&e.componentDidMount()}function E(e,t,n,o,r,i){R++||(V=null!=r&&void 0!==r.ownerSVGElement,B=null!=e&&!("__preactattr_"in e));var a=b(e,t,n,o,i);return r&&a.parentNode!==r&&r.appendChild(a),--R||(B=!1,i||y()),a}function b(e,t,n,o,r){var i=e,a=V;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),_(e,!0))),i.__preactattr_=!0,i;var u=t.nodeName;if("function"==typeof u)return U(e,t,n,o);if(V="svg"===u||"foreignObject"!==u&&V,u=String(u),(!e||!s(e,u))&&(i=d(u,V),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),_(e,!0)}var c=i.firstChild,l=i.__preactattr_,p=t.children;if(null==l){l=i.__preactattr_={};for(var f=i.attributes,v=f.length;v--;)l[f[v].name]=f[v].value}return!B&&p&&1===p.length&&"string"==typeof p[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=p[0]&&(c.nodeValue=p[0]):(p&&p.length||null!=c)&&g(i,p,n,o,B||null!=l.dangerouslySetInnerHTML),w(i,t.attributes,l),V=a,i}function g(e,t,n,o,r){var i,a,u,c,s,p=e.childNodes,d=[],v={},h=0,m=0,y=p.length,E=0,g=t?t.length:0;if(0!==y)for(var C=0;C2;)W.push(arguments[l]);for(n&&null!=n.children&&(W.length||W.push(n.children),delete n.children);W.length;)if((r=W.pop())&&void 0!==r.pop)for(l=r.length;l--;)W.push(r[l]);else"boolean"==typeof r&&(r=null),(i="function"!=typeof e)&&(null==r?r="":"number"==typeof r?r+="":"string"!=typeof r&&(i=!1)),i&&o?u[u.length-1]+=r:u===E?u=[r]:u.push(r),o=i;var a=new t;return a.nodeName=e,a.children=u,a.attributes=null==n?void 0:n,a.key=null==n?void 0:n.key,void 0!==P.vnode&&P.vnode(a),a}function o(e,t){for(var n in t)e[n]=t[n];return e}function r(e,t){return n(e.nodeName,o(o({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}function i(e){!e.__d&&(e.__d=!0)&&1==j.push(e)&&(P.debounceRendering||V)(l)}function l(){var e,t=j;for(j=[];e=t.pop();)e.__d&&U(e)}function u(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&a(e,t.nodeName):n||e._componentConstructor===t.nodeName}function a(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function c(e){var t=o({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function p(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.__n=e,n}function _(e){var t=e.parentNode;t&&t.removeChild(e)}function s(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||r)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var i in n)i in o||(e.style[i]="");for(var i in o)e.style[i]="number"==typeof o[i]&&!1===A.test(i)?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var l=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,d,l):e.removeEventListener(t,d,l),(e.__l||(e.__l={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e)f(e,t,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(t);else{var u=r&&t!==(t=t.replace(/^xlink\:?/,""));null==o||!1===o?u?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(u?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function f(e,t,n){try{e[t]=n}catch(e){}}function d(e){return this.__l[e.type](P.event&&P.event(e)||e)}function v(){for(var e;e=D.pop();)P.afterMount&&P.afterMount(e),e.componentDidMount&&e.componentDidMount()}function h(e,t,n,o,r,i){H++||(O=null!=r&&void 0!==r.ownerSVGElement,R=null!=e&&!("__preactattr_"in e));var l=m(e,t,n,o,i);return r&&l.parentNode!==r&&r.appendChild(l),--H||(R=!1,i||v()),l}function m(e,t,n,o,r){var i=e,l=O;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),y(e,!0))),i.__preactattr_=!0,i;var u=t.nodeName;if("function"==typeof u)return L(e,t,n,o);if(O="svg"===u||"foreignObject"!==u&&O,u+="",(!e||!a(e,u))&&(i=p(u,O),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),y(e,!0)}var c=i.firstChild,_=i.__preactattr_,s=t.children;if(null==_){_=i.__preactattr_={};for(var f=i.attributes,d=f.length;d--;)_[f[d].name]=f[d].value}return!R&&s&&1===s.length&&"string"==typeof s[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=s[0]&&(c.nodeValue=s[0]):(s&&s.length||null!=c)&&b(i,s,n,o,R||null!=_.dangerouslySetInnerHTML),x(i,t.attributes,_),O=l,i}function b(e,t,n,o,r){var i,l,a,c,p,s=e.childNodes,f=[],d={},v=0,h=0,b=s.length,g=0,x=t?t.length:0;if(0!==b)for(var C=0;C1)for(var t=1;tJ)return null;if(!(e?Q[vr]:Q[hr]).test(r))return null;try{return new s(r,e)}catch(r){return null}}function i(r,e){var t=n(r,e);return t?t.version:null}function o(r,e){var t=n(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null}function s(r,e){if(r instanceof s){if(r.loose===e)return r;r=r.version}else if("string"!=typeof r)throw new TypeError("Invalid Version: "+r);if(r.length>J)throw new TypeError("version is longer than "+J+" characters");if(!(this instanceof s))return new s(r,e);H("SemVer",r,e),this.loose=e;var t=r.trim().match(e?Q[vr]:Q[hr]);if(!t)throw new TypeError("Invalid Version: "+r);if(this.raw=r,this.major=+t[1],this.minor=+t[2],this.patch=+t[3],this.major>K||this.major<0)throw new TypeError("Invalid major version");if(this.minor>K||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>K||this.patch<0)throw new TypeError("Invalid patch version");t[4]?this.prerelease=t[4].split(".").map(function(r){if(/^[0-9]+$/.test(r)){var e=+r;if(e>=0&&ee?1:0}function p(r,e){return c(e,r)}function h(r,e){return new s(r,e).major}function l(r,e){return new s(r,e).minor}function f(r,e){return new s(r,e).patch}function v(r,e,t){return new s(r,t).compare(e)}function m(r,e){return v(r,e,!0)}function g(r,e,t){return v(e,r,t)}function w(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}function y(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}function d(r,e,t){return v(r,e,t)>0}function b(r,e,t){return v(r,e,t)<0}function j(r,e,t){return 0===v(r,e,t)}function E(r,e,t){return 0!==v(r,e,t)}function T(r,e,t){return v(r,e,t)>=0}function $(r,e,t){return v(r,e,t)<=0}function k(r,e,t,n){var i;switch(e){case"===":"object"==typeof r&&(r=r.version),"object"==typeof t&&(t=t.version),i=r===t;break;case"!==":"object"==typeof r&&(r=r.version),"object"==typeof t&&(t=t.version),i=r!==t;break;case"":case"=":case"==":i=j(r,t,n);break;case"!=":i=E(r,t,n);break;case">":i=d(r,t,n);break;case">=":i=T(r,t,n);break;case"<":i=b(r,t,n);break;case"<=":i=$(r,t,n);break;default:throw new TypeError("Invalid operator: "+e)}return i}function x(r,e){if(r instanceof x){if(r.loose===e)return r;r=r.value}if(!(this instanceof x))return new x(r,e);H("comparator",r,e),this.loose=e,this.parse(r),this.semver===zr?this.value="":this.value=this.operator+this.semver.version,H("comp",this)}function R(r,e){if(r instanceof R&&r.loose===e)return r;if(!(this instanceof R))return new R(r,e);if(this.loose=e,this.raw=r,this.set=r.split(/\s*\|\|\s*/).map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+r);this.format()}function S(r,e){return new R(r,e).set.map(function(r){return r.map(function(r){return r.value}).join(" ").trim().split(" ")})}function I(r,e){return H("comp",r),r=L(r,e),H("caret",r),r=V(r,e),H("tildes",r),r=N(r,e),H("xrange",r),r=C(r,e),H("stars",r),r}function A(r){return!r||"x"===r.toLowerCase()||"*"===r}function V(r,e){return r.trim().split(/\s+/).map(function(r){return _(r,e)}).join(" ")}function _(r,e){var t=e?Q[xr]:Q[kr];return r.replace(t,function(e,t,n,i,o){H("tilde",r,e,t,n,i,o);var s;return A(t)?s="":A(n)?s=">="+t+".0.0 <"+(+t+1)+".0.0":A(i)?s=">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0":o?(H("replaceTilde pr",o),"-"!==o.charAt(0)&&(o="-"+o),s=">="+t+"."+n+"."+i+o+" <"+t+"."+(+n+1)+".0"):s=">="+t+"."+n+"."+i+" <"+t+"."+(+n+1)+".0",H("tilde return",s),s})}function L(r,e){return r.trim().split(/\s+/).map(function(r){return M(r,e)}).join(" ")}function M(r,e){H("caret",r,e);var t=e?Q[Vr]:Q[Ar];return r.replace(t,function(e,t,n,i,o){H("caret",r,e,t,n,i,o);var s;return A(t)?s="":A(n)?s=">="+t+".0.0 <"+(+t+1)+".0.0":A(i)?s="0"===t?">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0":">="+t+"."+n+".0 <"+(+t+1)+".0.0":o?(H("replaceCaret pr",o),"-"!==o.charAt(0)&&(o="-"+o),s="0"===t?"0"===n?">="+t+"."+n+"."+i+o+" <"+t+"."+n+"."+(+i+1):">="+t+"."+n+"."+i+o+" <"+t+"."+(+n+1)+".0":">="+t+"."+n+"."+i+o+" <"+(+t+1)+".0.0"):(H("no pr"),s="0"===t?"0"===n?">="+t+"."+n+"."+i+" <"+t+"."+n+"."+(+i+1):">="+t+"."+n+"."+i+" <"+t+"."+(+n+1)+".0":">="+t+"."+n+"."+i+" <"+(+t+1)+".0.0"),H("caret return",s),s})}function N(r,e){return H("replaceXRanges",r,e),r.split(/\s+/).map(function(r){return O(r,e)}).join(" ")}function O(r,e){r=r.trim();var t=e?Q[jr]:Q[br];return r.replace(t,function(e,t,n,i,o,s){H("xRange",r,e,t,n,i,o,s);var a=A(n),u=a||A(i),c=u||A(o),p=c;return"="===t&&p&&(t=""),a?e=">"===t||"<"===t?"<0.0.0":"*":t&&p?(u&&(i=0),c&&(o=0),">"===t?(t=">=",u?(n=+n+1,i=0,o=0):c&&(i=+i+1,o=0)):"<="===t&&(t="<",u?n=+n+1:i=+i+1),e=t+n+"."+i+"."+o):u?e=">="+n+".0.0 <"+(+n+1)+".0.0":c&&(e=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0"),H("xRange return",e),e})}function C(r,e){return H("replaceStars",r,e),r.trim().replace(Q[Pr],"")}function P(r,e,t,n,i,o,s,a,u,c,p,h,l){return e=A(t)?"":A(n)?">="+t+".0.0":A(i)?">="+t+"."+n+".0":">="+e,a=A(u)?"":A(c)?"<"+(+u+1)+".0.0":A(p)?"<"+u+"."+(+c+1)+".0":h?"<="+u+"."+c+"."+p+"-"+h:"<="+a,(e+" "+a).trim()}function D(r,e){for(var t=0;t0){var n=r[t].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}function X(r,e,t){try{e=new R(e,t)}catch(r){return!1}return e.test(r)}function z(r,e,t){return r.filter(function(r){return X(r,e,t)}).sort(function(r,e){return g(r,e,t)})[0]||null}function G(r,e,t){return r.filter(function(r){return X(r,e,t)}).sort(function(r,e){return v(r,e,t)})[0]||null}function Z(r,e){try{return new R(r,e).range||"*"}catch(r){return null}}function q(r,e,t){return U(r,e,"<",t)}function B(r,e,t){return U(r,e,">",t)}function U(r,e,t,n){r=new s(r,n),e=new R(e,n);var i,o,a,u,c;switch(t){case">":i=d,o=$,a=b,u=">",c=">=";break;case"<":i=b,o=T,a=d,u="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(X(r,e,n))return!1;for(var p=0;p=0.0.0")),l=l||r,f=f||r,i(r.semver,l.semver,n)?l=r:a(r.semver,f.semver,n)&&(f=r)}),l.operator===u||l.operator===c)return!1;if((!f.operator||f.operator===u)&&o(r,f.semver))return!1;if(f.operator===c&&a(r,f.semver))return!1}return!0}function F(r,e){var t=n(r,e);return t&&t.prerelease.length?t.prerelease:null}e=r.exports=s;var H;H="object"==typeof t&&t.env&&t.env.NODE_DEBUG&&/\bsemver\b/i.test(t.env.NODE_DEBUG)?function(){var r=Array.prototype.slice.call(arguments,0);r.unshift("SEMVER"),console.log.apply(console,r)}:function(){},e.SEMVER_SPEC_VERSION="2.0.0";var J=256,K=Number.MAX_SAFE_INTEGER||9007199254740991,Q=e.re=[],W=e.src=[],Y=0,rr=Y++;W[rr]="0|[1-9]\\d*";var er=Y++;W[er]="[0-9]+";var tr=Y++;W[tr]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var nr=Y++;W[nr]="("+W[rr]+")\\.("+W[rr]+")\\.("+W[rr]+")";var ir=Y++;W[ir]="("+W[er]+")\\.("+W[er]+")\\.("+W[er]+")";var or=Y++;W[or]="(?:"+W[rr]+"|"+W[tr]+")";var sr=Y++;W[sr]="(?:"+W[er]+"|"+W[tr]+")";var ar=Y++;W[ar]="(?:-("+W[or]+"(?:\\."+W[or]+")*))";var ur=Y++;W[ur]="(?:-?("+W[sr]+"(?:\\."+W[sr]+")*))";var cr=Y++;W[cr]="[0-9A-Za-z-]+";var pr=Y++;W[pr]="(?:\\+("+W[cr]+"(?:\\."+W[cr]+")*))";var hr=Y++,lr="v?"+W[nr]+W[ar]+"?"+W[pr]+"?";W[hr]="^"+lr+"$";var fr="[v=\\s]*"+W[ir]+W[ur]+"?"+W[pr]+"?",vr=Y++;W[vr]="^"+fr+"$";var mr=Y++;W[mr]="((?:<|>)?=?)";var gr=Y++;W[gr]=W[er]+"|x|X|\\*";var wr=Y++;W[wr]=W[rr]+"|x|X|\\*";var yr=Y++;W[yr]="[v=\\s]*("+W[wr]+")(?:\\.("+W[wr]+")(?:\\.("+W[wr]+")(?:"+W[ar]+")?"+W[pr]+"?)?)?";var dr=Y++;W[dr]="[v=\\s]*("+W[gr]+")(?:\\.("+W[gr]+")(?:\\.("+W[gr]+")(?:"+W[ur]+")?"+W[pr]+"?)?)?";var br=Y++;W[br]="^"+W[mr]+"\\s*"+W[yr]+"$";var jr=Y++;W[jr]="^"+W[mr]+"\\s*"+W[dr]+"$";var Er=Y++;W[Er]="(?:~>?)";var Tr=Y++;W[Tr]="(\\s*)"+W[Er]+"\\s+",Q[Tr]=new RegExp(W[Tr],"g");var $r="$1~",kr=Y++;W[kr]="^"+W[Er]+W[yr]+"$";var xr=Y++;W[xr]="^"+W[Er]+W[dr]+"$";var Rr=Y++;W[Rr]="(?:\\^)";var Sr=Y++;W[Sr]="(\\s*)"+W[Rr]+"\\s+",Q[Sr]=new RegExp(W[Sr],"g");var Ir="$1^",Ar=Y++;W[Ar]="^"+W[Rr]+W[yr]+"$";var Vr=Y++;W[Vr]="^"+W[Rr]+W[dr]+"$";var _r=Y++;W[_r]="^"+W[mr]+"\\s*("+fr+")$|^$";var Lr=Y++;W[Lr]="^"+W[mr]+"\\s*("+lr+")$|^$";var Mr=Y++;W[Mr]="(\\s*)"+W[mr]+"\\s*("+fr+"|"+W[yr]+")",Q[Mr]=new RegExp(W[Mr],"g");var Nr="$1$2$3",Or=Y++;W[Or]="^\\s*("+W[yr]+")\\s+-\\s+("+W[yr]+")\\s*$";var Cr=Y++;W[Cr]="^\\s*("+W[dr]+")\\s+-\\s+("+W[dr]+")\\s*$";var Pr=Y++;W[Pr]="(<|>)?=?\\s*\\*";for(var Dr=0;Dr=0;)"number"==typeof this.prerelease[t]&&(this.prerelease[t]++,t=-2);-1===t&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+r)}return this.format(),this.raw=this.version,this},e.inc=a,e.diff=u,e.compareIdentifiers=c;var Xr=/^[0-9]+$/;e.rcompareIdentifiers=p,e.major=h,e.minor=l,e.patch=f,e.compare=v,e.compareLoose=m,e.rcompare=g,e.sort=w,e.rsort=y,e.gt=d,e.lt=b,e.eq=j,e.neq=E,e.gte=T,e.lte=$,e.cmp=k,e.Comparator=x;var zr={};x.prototype.parse=function(r){var e=this.loose?Q[_r]:Q[Lr],t=r.match(e);if(!t)throw new TypeError("Invalid comparator: "+r);this.operator=t[1],"="===this.operator&&(this.operator=""),t[2]?this.semver=new s(t[2],this.loose):this.semver=zr},x.prototype.toString=function(){return this.value},x.prototype.test=function(r){return H("Comparator.test",r,this.loose),this.semver===zr||("string"==typeof r&&(r=new s(r,this.loose)),k(r,this.operator,this.semver,this.loose))},e.Range=R,R.prototype.format=function(){return this.range=this.set.map(function(r){return r.join(" ").trim()}).join("||").trim(),this.range},R.prototype.toString=function(){return this.range},R.prototype.parseRange=function(r){var e=this.loose;r=r.trim(),H("range",r,e);var t=e?Q[Cr]:Q[Or];r=r.replace(t,P),H("hyphen replace",r),r=r.replace(Q[Mr],Nr),H("comparator trim",r,Q[Mr]),r=r.replace(Q[Tr],$r),r=r.replace(Q[Sr],Ir),r=r.split(/\s+/).join(" ");var n=e?Q[_r]:Q[Lr],i=r.split(" ").map(function(r){return I(r,e)}).join(" ").split(/\s+/);return this.loose&&(i=i.filter(function(r){return!!r.match(n)})),i=i.map(function(r){return new x(r,e)})},e.toComparators=S,R.prototype.test=function(r){if(!r)return!1;"string"==typeof r&&(r=new s(r,this.loose));for(var e=0;e Date: Mon, 23 Aug 2021 21:11:58 +0530 Subject: [PATCH 2/2] Removing webpack from build as it is unused. --- Gruntfile.js | 3 +- tasks/pack-web-dependencies.js | 60 ---------------------------------- 2 files changed, 1 insertion(+), 62 deletions(-) delete mode 100644 tasks/pack-web-dependencies.js diff --git a/Gruntfile.js b/Gruntfile.js index 8af36f2d1c..1203941852 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -336,8 +336,7 @@ module.exports = function (grunt) { grunt.registerTask('install', [ 'write-config:dev', 'less', - 'npm-install-source', - 'pack-web-dependencies' + 'npm-install-source' ]); // task: test diff --git a/tasks/pack-web-dependencies.js b/tasks/pack-web-dependencies.js deleted file mode 100644 index 1684e8ccb2..0000000000 --- a/tasks/pack-web-dependencies.js +++ /dev/null @@ -1,60 +0,0 @@ -/* eslint-env node */ -/*global module,require,process,console,__dirname */ - - -module.exports = function (grunt) { - - var _ = require("lodash"), - common = require("./lib/common")(grunt), - glob = require("glob"), - path = require("path"), - spawn = require("child_process").spawn; - - grunt.registerTask("pack-web-dependencies", "Runs webpack on stuff we need to use from browser", function () { - var done = this.async(); - var webpackPath = path.resolve( - __dirname, - "..", - "node_modules", - ".bin", - process.platform === "win32" ? "webpack.cmd" : "webpack" - ); - var webpackTasks = [ - [ - "./node_modules/semver/semver.js", - "./src/thirdparty/semver.browser.js", - "-p", - "--output-library-target=amd" - ], - [ - "./src/node_modules/preact/dist/preact.min.js", - "./src/thirdparty/preact/preact.js", - "-p", - "--output-library-target=amd" - ], - [ - "./src/node_modules/preact-test-utils/lib/index.js", - "./src/thirdparty/preact-test-utils/preact-test-utils.js", - "-p", - "--output-library-target=amd" - ] - ]; - var doneWithWebpackTask = _.after(webpackTasks.length, done); - webpackTasks.forEach(function (args) { - var wp = spawn(webpackPath, args, { - cwd: path.resolve(__dirname, "..") - }); - wp.stdout.on('data', function (data) { - console.log("webpack-stdout: " + data.toString()); - }); - wp.stderr.on('data', function (data) { - console.log("webpack-stderr: " + data.toString()); - }); - wp.on('close', function (code) { - console.log("webpack-exit code " + code.toString()); - return code === 0 ? doneWithWebpackTask() : done(false); - }); - }); - }); - -};