diff --git a/BUILD.md b/BUILD.md new file mode 100644 index 0000000..67bb460 --- /dev/null +++ b/BUILD.md @@ -0,0 +1,12 @@ +Note Taker Build Instructions + +./extension/third-party/psl.min.js is from https://github.com/wrangr/psl/blob/v1.1.31/dist/psl.min.js + +./psl-1.1.31/ is from https://github.com/wrangr/psl/releases/tag/v1.1.31 +(The package.json was slightly modified to disable the prebuild script. +This is because the prebuild script downloads the current version of the Public Suffix List and +adds it to the file, which is not wanted if the built file needs to be the same every time.) + +To Build: +In ./psl-1.1.31/, run `npm install` and `npm run build` +The built file is in ./psl-1.1.31/dist/psl.min.js diff --git a/extension/third-party/psl.min.js b/extension/third-party/psl.min.js index 2141dc2..2390644 100644 --- a/extension/third-party/psl.min.js +++ b/extension/third-party/psl.min.js @@ -1 +1 @@ -!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).psl=a()}}(function(){return function a(o,i,e){function n(m,t){if(!i[m]){if(!o[m]){var u="function"==typeof require&&require;if(!t&&u)return u(m,!0);if(s)return s(m,!0);var r=new Error("Cannot find module '"+m+"'");throw r.code="MODULE_NOT_FOUND",r}var p=i[m]={exports:{}};o[m][0].call(p.exports,function(a){var i=o[m][1][a];return n(i||a)},p,p.exports,a,o,i,e)}return i[m].exports}for(var s="function"==typeof require&&require,m=0;m255)return"DOMAIN_TOO_LONG";for(var i,n=o.split("."),s=0;s63)return"LABEL_TOO_LONG";if("-"===i.charAt(0))return"LABEL_STARTS_WITH_DASH";if("-"===i.charAt(i.length-1))return"LABEL_ENDS_WITH_DASH";if(!/^[a-z0-9\-]+$/.test(i))return"LABEL_INVALID_CHARS"}},i.parse=function(a){if("string"!=typeof a)throw new TypeError("Domain name must be a string.");var o=a.slice(0).toLowerCase();"."===o.charAt(o.length-1)&&(o=o.slice(0,o.length-1));var s=n.validate(o);if(s)return{input:a,error:{message:i.errorCodes[s],code:s}};var m={input:a,tld:null,sld:null,domain:null,subdomain:null,listed:!1},t=o.split(".");if("local"===t[t.length-1])return m;var u=function(){return/xn--/.test(o)?(m.domain&&(m.domain=e.toASCII(m.domain)),m.subdomain&&(m.subdomain=e.toASCII(m.subdomain)),m):m},r=n.findRule(o);if(!r)return t.length<2?m:(m.tld=t.pop(),m.sld=t.pop(),m.domain=[m.sld,m.tld].join("."),t.length&&(m.subdomain=t.pop()),u());m.listed=!0;var p=r.suffix.split("."),k=t.slice(0,t.length-p.length);return r.exception&&k.push(p.shift()),m.tld=p.join("."),k.length?(r.wildcard&&(p.unshift(k.pop()),m.tld=p.join(".")),k.length?(m.sld=k.pop(),m.domain=[m.sld,m.tld].join("."),k.length&&(m.subdomain=k.join(".")),u()):u()):u()},i.get=function(a){return a?i.parse(a).domain||null:null},i.isValid=function(a){var o=i.parse(a);return Boolean(o.domain&&o.listed)}},{"./data/rules.json":1,punycode:3}],3:[function(a,o,i){(function(a){!function(e){function n(a){throw new RangeError(S[a])}function s(a,o){for(var i=a.length,e=[];i--;)e[i]=o(a[i]);return e}function m(a,o){var i=a.split("@"),e="";return i.length>1&&(e=i[0]+"@",a=i[1]),e+s((a=a.replace(I,".")).split("."),o).join(".")}function t(a){for(var o,i,e=[],n=0,s=a.length;n=55296&&o<=56319&&n65535&&(o+=C((a-=65536)>>>10&1023|55296),a=56320|1023&a),o+=C(a)}).join("")}function r(a){return a-48<10?a-22:a-65<26?a-65:a-97<26?a-97:f}function p(a,o){return a+22+75*(a<26)-((0!=o)<<5)}function k(a,o,i){var e=0;for(a=i?D(a/x):a>>1,a+=D(a/o);a>T*w>>1;e+=f)a=D(a/T);return D(e+(T+1)*a/(a+z))}function c(a){var o,i,e,s,m,t,p,c,g,l,h=[],j=a.length,d=0,b=A,z=q;for((i=a.lastIndexOf(O))<0&&(i=0),e=0;e=128&&n("not-basic"),h.push(a.charCodeAt(e));for(s=i>0?i+1:0;s=j&&n("invalid-input"),((c=r(a.charCodeAt(s++)))>=f||c>D((y-d)/t))&&n("overflow"),d+=c*t,g=p<=z?v:p>=z+w?w:p-z,!(cD(y/(l=f-g))&&n("overflow"),t*=l;z=k(d-m,o=h.length+1,0==m),D(d/o)>y-b&&n("overflow"),b+=D(d/o),d%=o,h.splice(d++,0,b)}return u(h)}function g(a){var o,i,e,s,m,u,r,c,g,l,h,j,d,b,z,x=[];for(j=(a=t(a)).length,o=A,i=0,m=q,u=0;u=o&&hD((y-i)/(d=e+1))&&n("overflow"),i+=(r-o)*d,o=r,u=0;uy&&n("overflow"),h==o){for(c=i,g=f;l=g<=m?v:g>=m+w?w:g-m,!(c= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=f-v,D=Math.floor,C=String.fromCharCode;if(d={version:"1.4.1",ucs2:{decode:t,encode:u},decode:c,encode:g,toASCII:function(a){return m(a,function(a){return L.test(a)?"xn--"+g(a):a})},toUnicode:function(a){return m(a,function(a){return _.test(a)?c(a.slice(4).toLowerCase()):a})}},l&&h)if(o.exports==l)h.exports=d;else for(b in d)d.hasOwnProperty(b)&&(l[b]=d[b]);else e.punycode=d}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[2])(2)}); +!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).psl=a()}}(function(){return function s(m,t,u){function r(o,a){if(!t[o]){if(!m[o]){var i="function"==typeof require&&require;if(!a&&i)return i(o,!0);if(p)return p(o,!0);var e=new Error("Cannot find module '"+o+"'");throw e.code="MODULE_NOT_FOUND",e}var n=t[o]={exports:{}};m[o][0].call(n.exports,function(a){return r(m[o][1][a]||a)},n,n.exports,s,m,t,u)}return t[o].exports}for(var p="function"==typeof require&&require,a=0;a= 0x80 (not a basic code point)","invalid-input":"Invalid input"},c=b-y,x=Math.floor,q=String.fromCharCode;function A(a){throw new RangeError(k[a])}function g(a,o){for(var i=a.length,e=[];i--;)e[i]=o(a[i]);return e}function l(a,o){var i=a.split("@"),e="";return 1>>10&1023|55296),a=56320|1023&a),o+=q(a)}).join("")}function L(a,o){return a+22+75*(a<26)-((0!=o)<<5)}function I(a,o,i){var e=0;for(a=i?x(a/t):a>>1,a+=x(a/o);c*f>>1x((d-l)/m))&&A("overflow"),l+=u*m,!(u<(r=t<=j?y:j+f<=t?f:t-j));t+=b)m>x(d/(p=b-r))&&A("overflow"),m*=p;j=I(l-s,o=c.length+1,0==s),x(l/o)>d-h&&A("overflow"),h+=x(l/o),l%=o,c.splice(l++,0,h)}return _(c)}function j(a){var o,i,e,n,s,m,t,u,r,p,k,c,g,l,h,j=[];for(c=(a=O(a)).length,o=w,s=v,m=i=0;mx((d-i)/(g=e+1))&&A("overflow"),i+=(t-o)*g,o=t,m=0;md&&A("overflow"),k==o){for(u=i,r=b;!(u<(p=r<=s?y:s+f<=r?f:r-s));r+=b)h=u-p,l=b-p,j.push(q(L(p+h%l,0))),u=x(h/l);j.push(q(L(u,0))),s=I(i,g,e==n),i=0,++e}++i,++o}return j.join("")}if(n={version:"1.4.1",ucs2:{decode:O,encode:_},decode:h,encode:j,toASCII:function(a){return l(a,function(a){return r.test(a)?"xn--"+j(a):a})},toUnicode:function(a){return l(a,function(a){return u.test(a)?h(a.slice(4).toLowerCase()):a})}},o&&i)if(T.exports==o)i.exports=n;else for(s in n)n.hasOwnProperty(s)&&(o[s]=n[s]);else a.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[2])(2)}); diff --git a/index.js b/index.js deleted file mode 100644 index 7e96204..0000000 --- a/index.js +++ /dev/null @@ -1,4 +0,0 @@ -const fs = require("fs-extra"); - -fs.copy("./node_modules/mdi", "./extension/third-party/mdi"); -fs.copy("./node_modules/psl/dist/psl.min.js", "./extension/third-party/psl.min.js"); diff --git a/package.json b/package.json index 2bbd93c..e4e80bd 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,7 @@ }, "homepage": "https://github.com/Rayquaza01/note-taker#readme", "dependencies": { - "mdi": "^2.0.46", - "psl": "^1.1.20" + "psl": "^1.1.31" }, "devDependencies": { "eslint": "^5.7.0", diff --git a/scripts/i18n.py b/scripts/i18n.py old mode 100644 new mode 100755