diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ca7c5b..e825398 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [1.2.1](https://github.com/atom-ide-community/atom-ide-javascript/compare/v1.2.0...v1.2.1) (2020-07-25) + + +### Bug Fixes + +* add catch for promise ([42af986](https://github.com/atom-ide-community/atom-ide-javascript/commit/42af986e989cb01f1a87c8fe518d5cbe6c13c3a1)) +* bug in installation of the deps ([4b86dd9](https://github.com/atom-ide-community/atom-ide-javascript/commit/4b86dd9b410019e737bea012956faf1323de792d)) + # [1.2.0](https://github.com/atom-ide-community/atom-ide-javascript/compare/v1.1.0...v1.2.0) (2020-07-25) diff --git a/dist/index-613b31ed.js b/dist/index-27f59b67.js similarity index 99% rename from dist/index-613b31ed.js rename to dist/index-27f59b67.js index 2abd80f..c49383e 100644 --- a/dist/index-613b31ed.js +++ b/dist/index-27f59b67.js @@ -1,2 +1,2 @@ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("atom")),r=e(require("assert")),s=e(require("fs")),i=e(require("util")),n=e(require("path"));function o(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var a,l=(a=n)&&"object"==typeof a&&"default"in a?a.default:a;let c=!1;var p={promptUser:async function(e,t){const r=l.join(atom.getConfigDirPath(),"package-deps-state.json");let s=atom.config.get("atom-package-deps.ignored")||[];if(await I.fs.exists(r)){const e=JSON.parse(await I.fs.readFile(r,"utf8"));atom.config.set("atom-package-deps.ignored",s=e.ignored),await I.fs.unlink(r)}return s.includes(e)?"No":(atom.packages.isPackageDisabled("notifications"),new Promise((function(r){const i=atom.notifications.addInfo(e+" needs to install dependencies",{dismissable:!0,icon:"cloud-download",detail:t.map(e=>e.name).join(", "),description:`Install dependenc${1===t.length?"y":"ies"}?`,buttons:[{text:"Yes",onDidClick:()=>{r("Yes"),i.dismiss()}},{text:"No Thanks",onDidClick:()=>{r("No"),i.dismiss()}},{text:"Never",onDidClick:()=>{s=atom.config.get("atom-package-deps.ignored")||[],s.push(e),atom.config.set("atom-package-deps.ignored",s),c||(c=!0,atom.notifications.addInfo("How to reset package-deps memory",{dismissable:!0,description:"To modify the list of ignored files invoke 'Application: Open Your Config' and change the 'atom-package-deps' section"})),r("Never"),i.dismiss()}}]});i.onDidDismiss(()=>r("No"))})))}},E=t;class h{constructor(e,t){this.name=e,this.dependencies=t;const r=atom.notifications.addInfo(`Installing ${e} dependencies`,{detail:"Installing "+t.map(e=>e.name).join(", "),dismissable:!0}),s=document.createElement("progress");this.dispose=function(){r.dismiss()},this.advance=function(){s.value+=1},s.max=t.length,s.style.width="100%";try{let e=atom.views.getView(r);null!=e&&null!=e.element&&(e=e.element);const t=e.querySelector(".detail-content")||e.querySelector(".content");t&&t.appendChild(s)}catch(e){}}complete(e){if(this.dispose(),!e.size)return void atom.notifications.addSuccess(`Installed ${this.name} dependencies`,{detail:"Installed "+this.dependencies.map(e=>e.name).join(", ")});const t=[];e.forEach((e,r)=>{t.push(" • "+r)}),atom.notifications.addWarning(`Failed to install ${this.name} dependencies`,{detail:"These packages were not installed, check your console\nfor more info.\n"+t.join("\n"),dismissable:!0})}}const u=new Set(["✓","done"]),f=/(?:Installing|Moving) (.*?) to .* (.*)/;function d(e,t){const r=new Map;return Promise.all(e.map((function(e){return(s=atom.packages.getApmPath(),i=["install",e.url||e.name,"--production","--color","false"],new Promise((function(e){const t={stdout:[],stderr:[]};new E.BufferedProcess({command:s,args:i,stdout(e){t.stdout.push(e)},stderr(e){t.stderr.push(e)},exit(){e({stdout:t.stdout.join(""),stderr:t.stderr.join("")})},autoStart:!1}).start()}))).then((function(r){let s=f.test(r.stdout);if(s){const e=f.exec(r.stdout);s=e&&u.has(e[2])}if(t(e.name,!!s),!s){const t=new Error("Error installing dependency: "+e.name);throw t.stack=r.stderr,t}})).catch((function(t){r.set(e.name,t)}));var s,i}))).then((function(){return r}))}var m={performInstall:async function(e,t){const r=new h(e,t),s=await d(t,(function(){r.advance()}));return r.complete(s),Promise.all(t.map(e=>s.has(e.name)?null:atom.packages.activatePackage(e.name)))}},I=o((function(e,t){function o(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var a=o(r),l=o(s),c=o(i),E=o(n);function h(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var u=h((function(e,t){e.exports=function(e){for(var t=0;t{if(!Buffer.isBuffer(e))throw new TypeError("Expected a Buffer, got "+typeof e);return 239===e[0]&&187===e[1]&&191===e[2]&&u(e)?e.slice(3):e},d=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(h((function(e){var t=s(l),r=s(f);function s(e){return e&&e.__esModule?e:{default:e}}const i={},n=["Stats","_toUnixTimestamp","watch","watchFile","unwatchFile"];Object.keys(t.default).forEach((function(e){const r=t.default[e];"function"!=typeof r||e.includes("Sync")||e.includes("Stream")||n.includes(e)?i[e]=r:i[e]=(0,c.promisify)(r)})),i.exists=function(e){return new Promise((function(r){t.default.access(e,t.default.R_OK,(function(e){r(null===e)}))}))},i.readFile=function(e,s){return new Promise((function(i,n){t.default.readFile(e,(function(e,t){if(e)return void n(e);let o=(0,r.default)(t);s&&(o=o.toString(s)),i(o)}))}))},e.exports=i}))),I={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16},$="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>{}:()=>{},R=h((function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r}=I,s=(t=e.exports={}).re=[],i=t.src=[],n=t.t={};let o=0;const a=(e,t,r)=>{const a=o++;n[e]=a,i[a]=t,s[a]=new RegExp(t,r?"g":void 0)};a("NUMERICIDENTIFIER","0|[1-9]\\d*"),a("NUMERICIDENTIFIERLOOSE","[0-9]+"),a("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),a("MAINVERSION",`(${i[n.NUMERICIDENTIFIER]})\\.(${i[n.NUMERICIDENTIFIER]})\\.(${i[n.NUMERICIDENTIFIER]})`),a("MAINVERSIONLOOSE",`(${i[n.NUMERICIDENTIFIERLOOSE]})\\.(${i[n.NUMERICIDENTIFIERLOOSE]})\\.(${i[n.NUMERICIDENTIFIERLOOSE]})`),a("PRERELEASEIDENTIFIER",`(?:${i[n.NUMERICIDENTIFIER]}|${i[n.NONNUMERICIDENTIFIER]})`),a("PRERELEASEIDENTIFIERLOOSE",`(?:${i[n.NUMERICIDENTIFIERLOOSE]}|${i[n.NONNUMERICIDENTIFIER]})`),a("PRERELEASE",`(?:-(${i[n.PRERELEASEIDENTIFIER]}(?:\\.${i[n.PRERELEASEIDENTIFIER]})*))`),a("PRERELEASELOOSE",`(?:-?(${i[n.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[n.PRERELEASEIDENTIFIERLOOSE]})*))`),a("BUILDIDENTIFIER","[0-9A-Za-z-]+"),a("BUILD",`(?:\\+(${i[n.BUILDIDENTIFIER]}(?:\\.${i[n.BUILDIDENTIFIER]})*))`),a("FULLPLAIN",`v?${i[n.MAINVERSION]}${i[n.PRERELEASE]}?${i[n.BUILD]}?`),a("FULL",`^${i[n.FULLPLAIN]}$`),a("LOOSEPLAIN",`[v=\\s]*${i[n.MAINVERSIONLOOSE]}${i[n.PRERELEASELOOSE]}?${i[n.BUILD]}?`),a("LOOSE",`^${i[n.LOOSEPLAIN]}$`),a("GTLT","((?:<|>)?=?)"),a("XRANGEIDENTIFIERLOOSE",i[n.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*"),a("XRANGEIDENTIFIER",i[n.NUMERICIDENTIFIER]+"|x|X|\\*"),a("XRANGEPLAIN",`[v=\\s]*(${i[n.XRANGEIDENTIFIER]})(?:\\.(${i[n.XRANGEIDENTIFIER]})(?:\\.(${i[n.XRANGEIDENTIFIER]})(?:${i[n.PRERELEASE]})?${i[n.BUILD]}?)?)?`),a("XRANGEPLAINLOOSE",`[v=\\s]*(${i[n.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[n.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[n.XRANGEIDENTIFIERLOOSE]})(?:${i[n.PRERELEASELOOSE]})?${i[n.BUILD]}?)?)?`),a("XRANGE",`^${i[n.GTLT]}\\s*${i[n.XRANGEPLAIN]}$`),a("XRANGELOOSE",`^${i[n.GTLT]}\\s*${i[n.XRANGEPLAINLOOSE]}$`),a("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),a("COERCERTL",i[n.COERCE],!0),a("LONETILDE","(?:~>?)"),a("TILDETRIM",`(\\s*)${i[n.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",a("TILDE",`^${i[n.LONETILDE]}${i[n.XRANGEPLAIN]}$`),a("TILDELOOSE",`^${i[n.LONETILDE]}${i[n.XRANGEPLAINLOOSE]}$`),a("LONECARET","(?:\\^)"),a("CARETTRIM",`(\\s*)${i[n.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",a("CARET",`^${i[n.LONECARET]}${i[n.XRANGEPLAIN]}$`),a("CARETLOOSE",`^${i[n.LONECARET]}${i[n.XRANGEPLAINLOOSE]}$`),a("COMPARATORLOOSE",`^${i[n.GTLT]}\\s*(${i[n.LOOSEPLAIN]})$|^$`),a("COMPARATOR",`^${i[n.GTLT]}\\s*(${i[n.FULLPLAIN]})$|^$`),a("COMPARATORTRIM",`(\\s*)${i[n.GTLT]}\\s*(${i[n.LOOSEPLAIN]}|${i[n.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",a("HYPHENRANGE",`^\\s*(${i[n.XRANGEPLAIN]})\\s+-\\s+(${i[n.XRANGEPLAIN]})\\s*$`),a("HYPHENRANGELOOSE",`^\\s*(${i[n.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[n.XRANGEPLAINLOOSE]})\\s*$`),a("STAR","(<|>)?=?\\s*\\*"),a("GTE0","^\\s*>=\\s*0.0.0\\s*$"),a("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}));const N=/^[0-9]+$/,O=(e,t)=>{const r=N.test(e),s=N.test(t);return r&&s&&(e=+e,t=+t),e===t?0:r&&!s?-1:s&&!r?1:eO(t,e)};const{MAX_LENGTH:T,MAX_SAFE_INTEGER:A}=I,{re:v,t:g}=R,{compareIdentifiers:w}=L;class P{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof P){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>T)throw new TypeError(`version is longer than ${T} characters`);this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?v[g.LOOSE]:v[g.FULL]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>A||this.major<0)throw new TypeError("Invalid major version");if(this.minor>A||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>A||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this}}var S=P,y=(e,t,r)=>new S(e,r).compare(new S(t,r)),D=(e,t,r,s)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return((e,t,r)=>0===y(e,t,r))(e,r,s);case"!=":return((e,t,r)=>0!==y(e,t,r))(e,r,s);case">":return((e,t,r)=>y(e,t,r)>0)(e,r,s);case">=":return((e,t,r)=>y(e,t,r)>=0)(e,r,s);case"<":return((e,t,r)=>y(e,t,r)<0)(e,r,s);case"<=":return((e,t,r)=>y(e,t,r)<=0)(e,r,s);default:throw new TypeError("Invalid operator: "+t)}};const C=Symbol("SemVer ANY");class M{static get ANY(){return C}constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof M){if(e.loose===!!t.loose)return e;e=e.value}this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===C?this.value="":this.value=this.operator+this.semver.version,$("comp",this)}parse(e){const t=this.options.loose?F[G.COMPARATORLOOSE]:F[G.COMPARATOR],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new S(r[2],this.options.loose):this.semver=C}toString(){return this.value}test(e){if($("Comparator.test",e,this.options.loose),this.semver===C||e===C)return!0;if("string"==typeof e)try{e=new S(e,this.options)}catch(e){return!1}return D(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof M))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new _(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new _(this.value,t).test(e.semver);const r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),s=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,n=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),o=D(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),a=D(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||s||i&&n||o||a}}var j=M;const{re:F,t:G}=R;class b{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof b)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new b(e.raw,t);if(e instanceof j)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=this.options.loose;e=e.trim();const r=t?k[X.HYPHENRANGELOOSE]:k[X.HYPHENRANGE];e=(e=e.replace(r,te(this.options.includePrerelease))).replace(k[X.COMPARATORTRIM],U),$("comparator trim",e,k[X.COMPARATORTRIM]),e=(e=(e=e.replace(k[X.TILDETRIM],x)).replace(k[X.CARETTRIM],B)).split(/\s+/).join(" ");const s=t?k[X.COMPARATORLOOSE]:k[X.COMPARATOR];return e.split(" ").map(e=>H(e,this.options)).join(" ").split(/\s+/).map(e=>ee(e,this.options)).filter(this.options.loose?e=>!!e.match(s):()=>!0).map(e=>new j(e,this.options))}intersects(e,t){if(!(e instanceof b))throw new TypeError("a Range is required");return this.set.some(r=>q(r,t)&&e.set.some(e=>q(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new S(e,this.options)}catch(e){return!1}for(let t=0;t{let r=!0;const s=e.slice();let i=s.pop();for(;r&&s.length;)r=s.every(e=>i.intersects(e,t)),i=s.pop();return r},H=(e,t)=>(e=Z(e,t),e=Y(e,t),e=K(e,t),e=Q(e)),V=e=>!e||"x"===e.toLowerCase()||"*"===e,Y=(e,t)=>e.trim().split(/\s+/).map(e=>z(e,t)).join(" "),z=(e,t)=>{const r=t.loose?k[X.TILDELOOSE]:k[X.TILDE];return e.replace(r,(e,t,r,s,i)=>{let n;return n=V(t)?"":V(r)?`>=${t}.0.0 <${+t+1}.0.0-0`:V(s)?`>=${t}.${r}.0 <${t}.${+r+1}.0-0`:i?`>=${t}.${r}.${s}-${i} <${t}.${+r+1}.0-0`:`>=${t}.${r}.${s} <${t}.${+r+1}.0-0`,n})},Z=(e,t)=>e.trim().split(/\s+/).map(e=>J(e,t)).join(" "),J=(e,t)=>{const r=t.loose?k[X.CARETLOOSE]:k[X.CARET],s=t.includePrerelease?"-0":"";return e.replace(r,(e,t,r,i,n)=>{let o;return o=V(t)?"":V(r)?`>=${t}.0.0${s} <${+t+1}.0.0-0`:V(i)?"0"===t?`>=${t}.${r}.0${s} <${t}.${+r+1}.0-0`:`>=${t}.${r}.0${s} <${+t+1}.0.0-0`:n?"0"===t?"0"===r?`>=${t}.${r}.${i}-${n} <${t}.${r}.${+i+1}-0`:`>=${t}.${r}.${i}-${n} <${t}.${+r+1}.0-0`:`>=${t}.${r}.${i}-${n} <${+t+1}.0.0-0`:"0"===t?"0"===r?`>=${t}.${r}.${i}${s} <${t}.${r}.${+i+1}-0`:`>=${t}.${r}.${i}${s} <${t}.${+r+1}.0-0`:`>=${t}.${r}.${i} <${+t+1}.0.0-0`,o})},K=(e,t)=>e.split(/\s+/).map(e=>W(e,t)).join(" "),W=(e,t)=>{e=e.trim();const r=t.loose?k[X.XRANGELOOSE]:k[X.XRANGE];return e.replace(r,(e,r,s,i,n,o)=>{const a=V(s),l=a||V(i),c=l||V(n),p=c;return"="===r&&p&&(r=""),o=t.includePrerelease?"-0":"",a?e=">"===r||"<"===r?"<0.0.0-0":"*":r&&p?(l&&(i=0),n=0,">"===r?(r=">=",l?(s=+s+1,i=0,n=0):(i=+i+1,n=0)):"<="===r&&(r="<",l?s=+s+1:i=+i+1),"<"===r&&(o="-0"),e=`${r+s}.${i}.${n}${o}`):l?e=`>=${s}.0.0${o} <${+s+1}.0.0-0`:c&&(e=`>=${s}.${i}.0${o} <${s}.${+i+1}.0-0`),e})},Q=(e,t)=>e.trim().replace(k[X.STAR],""),ee=(e,t)=>e.trim().replace(k[t.includePrerelease?X.GTE0PRE:X.GTE0],""),te=e=>(t,r,s,i,n,o,a,l,c,p,E,h,u)=>`${r=V(s)?"":V(i)?`>=${s}.0.0${e?"-0":""}`:V(n)?`>=${s}.${i}.0${e?"-0":""}`:o?">="+r:`>=${r}${e?"-0":""}`} ${l=V(c)?"":V(p)?`<${+c+1}.0.0-0`:V(E)?`<${c}.${+p+1}.0-0`:h?`<=${c}.${p}.${E}-${h}`:e?`<${c}.${p}.${+E+1}-0`:"<="+l}`.trim(),re=(e,t,r)=>{for(let r=0;r0){const s=e[r].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0};const se=/(.*?):.*/,ie=/(.*?)#.*/;void 0===window.__steelbrain_package_deps&&(window.__steelbrain_package_deps=new Set),t.fs=d,t.installDependencies=async function(e,t=!0){a(e,"[Package-Deps] Package name is required");const r=await async function(e){const t=atom.packages.getLoadedPackage(e),r=t&&t.metadata["package-deps"];return Array.isArray(r)?(await Promise.all(r.map((async function(e){let t=null,r=e,s=null;const i=se.exec(e),n=ie.exec(e);if(i?[,r,s]=i:n?[,r,t]=n:r=e,__steelbrain_package_deps.has(r))return null;const o=atom.packages.resolvePackagePath(r);if(o){if(!s)return null;const e=JSON.parse(await d.readFile(E.join(o,"package.json")));if(null!=e&&null!=e.version&&((e,t,r)=>{try{t=new _(t,r)}catch(e){return!1}return t.test(e)})(e.version,">="+s))return null}return __steelbrain_package_deps.add(r),{name:r,url:t}})))).filter(Boolean):[]}(e);if(r.length){if(t){let t="Yes";if(await Promise.resolve().then((function(){return p})).then(async({promptUser:s})=>{t=await s(e,r)}),"Yes"!==t)return}await Promise.resolve().then((function(){return m})).then(async({performInstall:t})=>t(e,r))}}})),$=o((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.install=I.installDependencies})),R=Object.freeze(Object.assign(Object.create(null),$,{default:$,__moduleExports:$}));exports.index=R; -//# sourceMappingURL=index-613b31ed.js.map +//# sourceMappingURL=index-27f59b67.js.map diff --git a/dist/index-27f59b67.js.map b/dist/index-27f59b67.js.map new file mode 100644 index 0000000..86c8053 --- /dev/null +++ b/dist/index-27f59b67.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-27f59b67.js","sources":["../node_modules/atom-package-deps/lib/prompt-afef23e0.js","../node_modules/atom-package-deps/lib/install-03586186.js","../node_modules/atom-package-deps/lib/index-6660c169.js"],"sourcesContent":["\"use strict\";require(\"assert\");var e=require(\"./index-6660c169.js\");require(\"fs\"),require(\"util\");var i,t=(i=require(\"path\"))&&\"object\"==typeof i&&\"default\"in i?i.default:i;let o=!1;exports.promptUser=async function(i,s){const a=t.join(atom.getConfigDirPath(),\"package-deps-state.json\");let n=atom.config.get(\"atom-package-deps.ignored\")||[];if(await e.fs.exists(a)){const i=JSON.parse(await e.fs.readFile(a,\"utf8\"));atom.config.set(\"atom-package-deps.ignored\",n=i.ignored),await e.fs.unlink(a)}return n.includes(i)?\"No\":(atom.packages.isPackageDisabled(\"notifications\"),new Promise((function(e){const t=atom.notifications.addInfo(i+\" needs to install dependencies\",{dismissable:!0,icon:\"cloud-download\",detail:s.map(e=>e.name).join(\", \"),description:`Install dependenc${1===s.length?\"y\":\"ies\"}?`,buttons:[{text:\"Yes\",onDidClick:()=>{e(\"Yes\"),t.dismiss()}},{text:\"No Thanks\",onDidClick:()=>{e(\"No\"),t.dismiss()}},{text:\"Never\",onDidClick:()=>{n=atom.config.get(\"atom-package-deps.ignored\")||[],n.push(i),atom.config.set(\"atom-package-deps.ignored\",n),o||(o=!0,atom.notifications.addInfo(\"How to reset package-deps memory\",{dismissable:!0,description:\"To modify the list of ignored files invoke 'Application: Open Your Config' and change the 'atom-package-deps' section\"})),e(\"Never\"),t.dismiss()}}]});t.onDidDismiss(()=>e(\"No\"))})))};\n//# sourceMappingURL=prompt-afef23e0.js.map\n","\"use strict\";var e=require(\"atom\");class t{constructor(e,t){this.name=e,this.dependencies=t;const n=atom.notifications.addInfo(`Installing ${e} dependencies`,{detail:\"Installing \"+t.map(e=>e.name).join(\", \"),dismissable:!0}),s=document.createElement(\"progress\");this.dispose=function(){n.dismiss()},this.advance=function(){s.value+=1},s.max=t.length,s.style.width=\"100%\";try{let e=atom.views.getView(n);null!=e&&null!=e.element&&(e=e.element);const t=e.querySelector(\".detail-content\")||e.querySelector(\".content\");t&&t.appendChild(s)}catch(e){}}complete(e){if(this.dispose(),!e.size)return void atom.notifications.addSuccess(`Installed ${this.name} dependencies`,{detail:\"Installed \"+this.dependencies.map(e=>e.name).join(\", \")});const t=[];e.forEach((e,n)=>{t.push(\" • \"+n)}),atom.notifications.addWarning(`Failed to install ${this.name} dependencies`,{detail:\"These packages were not installed, check your console\\nfor more info.\\n\"+t.join(\"\\n\"),dismissable:!0})}}const n=new Set([\"✓\",\"done\"]),s=/(?:Installing|Moving) (.*?) to .* (.*)/;function a(t,a){const o=new Map;return Promise.all(t.map((function(t){return(i=atom.packages.getApmPath(),c=[\"install\",t.url||t.name,\"--production\",\"--color\",\"false\"],new Promise((function(t){const n={stdout:[],stderr:[]};new e.BufferedProcess({command:i,args:c,stdout(e){n.stdout.push(e)},stderr(e){n.stderr.push(e)},exit(){t({stdout:n.stdout.join(\"\"),stderr:n.stderr.join(\"\")})},autoStart:!1}).start()}))).then((function(e){let o=s.test(e.stdout);if(o){const t=s.exec(e.stdout);o=t&&n.has(t[2])}if(a(t.name,!!o),!o){const n=new Error(\"Error installing dependency: \"+t.name);throw n.stack=e.stderr,n}})).catch((function(e){o.set(t.name,e)}));var i,c}))).then((function(){return o}))}exports.performInstall=async function(e,n){const s=new t(e,n),o=await a(n,(function(){s.advance()}));return s.complete(o),Promise.all(n.map(e=>o.has(e.name)?null:atom.packages.activatePackage(e.name)))};\n//# sourceMappingURL=install-03586186.js.map\n","\"use strict\";function e(e){return e&&\"object\"==typeof e&&\"default\"in e?e.default:e}var r=e(require(\"assert\")),t=e(require(\"fs\")),s=e(require(\"util\")),i=e(require(\"path\"));function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,\"default\")?e.default:e}function n(e,r,t){return e(t={path:r,exports:{},require:function(e,r){return function(){throw new Error(\"Dynamic requires are not currently supported by @rollup/plugin-commonjs\")}(null==r&&t.path)}},t.exports),t.exports}var a=n((function(e,r){e.exports=function(e){for(var r=0;r{if(!Buffer.isBuffer(e))throw new TypeError(\"Expected a Buffer, got \"+typeof e);return 239===e[0]&&187===e[1]&&191===e[2]&&a(e)?e.slice(3):e},l=o(n((function(e){var r=o(t),i=o(E);function o(e){return e&&e.__esModule?e:{default:e}}const n={},a=[\"Stats\",\"_toUnixTimestamp\",\"watch\",\"watchFile\",\"unwatchFile\"];Object.keys(r.default).forEach((function(e){const t=r.default[e];\"function\"!=typeof t||e.includes(\"Sync\")||e.includes(\"Stream\")||a.includes(e)?n[e]=t:n[e]=(0,s.promisify)(t)})),n.exists=function(e){return new Promise((function(t){r.default.access(e,r.default.R_OK,(function(e){t(null===e)}))}))},n.readFile=function(e,t){return new Promise((function(s,o){r.default.readFile(e,(function(e,r){if(e)return void o(e);let n=(0,i.default)(r);t&&(n=n.toString(t)),s(n)}))}))},e.exports=n})));var p={SEMVER_SPEC_VERSION:\"2.0.0\",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16};var c=\"object\"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\\bsemver\\b/i.test(process.env.NODE_DEBUG)?(...e)=>{}:()=>{},h=n((function(e,r){const{MAX_SAFE_COMPONENT_LENGTH:t}=p,s=(r=e.exports={}).re=[],i=r.src=[],o=r.t={};let n=0;const a=(e,r,t)=>{const a=n++;c(a,r),o[e]=a,i[a]=r,s[a]=new RegExp(r,t?\"g\":void 0)};a(\"NUMERICIDENTIFIER\",\"0|[1-9]\\\\d*\"),a(\"NUMERICIDENTIFIERLOOSE\",\"[0-9]+\"),a(\"NONNUMERICIDENTIFIER\",\"\\\\d*[a-zA-Z-][a-zA-Z0-9-]*\"),a(\"MAINVERSION\",`(${i[o.NUMERICIDENTIFIER]})\\\\.(${i[o.NUMERICIDENTIFIER]})\\\\.(${i[o.NUMERICIDENTIFIER]})`),a(\"MAINVERSIONLOOSE\",`(${i[o.NUMERICIDENTIFIERLOOSE]})\\\\.(${i[o.NUMERICIDENTIFIERLOOSE]})\\\\.(${i[o.NUMERICIDENTIFIERLOOSE]})`),a(\"PRERELEASEIDENTIFIER\",`(?:${i[o.NUMERICIDENTIFIER]}|${i[o.NONNUMERICIDENTIFIER]})`),a(\"PRERELEASEIDENTIFIERLOOSE\",`(?:${i[o.NUMERICIDENTIFIERLOOSE]}|${i[o.NONNUMERICIDENTIFIER]})`),a(\"PRERELEASE\",`(?:-(${i[o.PRERELEASEIDENTIFIER]}(?:\\\\.${i[o.PRERELEASEIDENTIFIER]})*))`),a(\"PRERELEASELOOSE\",`(?:-?(${i[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\\\.${i[o.PRERELEASEIDENTIFIERLOOSE]})*))`),a(\"BUILDIDENTIFIER\",\"[0-9A-Za-z-]+\"),a(\"BUILD\",`(?:\\\\+(${i[o.BUILDIDENTIFIER]}(?:\\\\.${i[o.BUILDIDENTIFIER]})*))`),a(\"FULLPLAIN\",`v?${i[o.MAINVERSION]}${i[o.PRERELEASE]}?${i[o.BUILD]}?`),a(\"FULL\",`^${i[o.FULLPLAIN]}$`),a(\"LOOSEPLAIN\",`[v=\\\\s]*${i[o.MAINVERSIONLOOSE]}${i[o.PRERELEASELOOSE]}?${i[o.BUILD]}?`),a(\"LOOSE\",`^${i[o.LOOSEPLAIN]}$`),a(\"GTLT\",\"((?:<|>)?=?)\"),a(\"XRANGEIDENTIFIERLOOSE\",i[o.NUMERICIDENTIFIERLOOSE]+\"|x|X|\\\\*\"),a(\"XRANGEIDENTIFIER\",i[o.NUMERICIDENTIFIER]+\"|x|X|\\\\*\"),a(\"XRANGEPLAIN\",`[v=\\\\s]*(${i[o.XRANGEIDENTIFIER]})(?:\\\\.(${i[o.XRANGEIDENTIFIER]})(?:\\\\.(${i[o.XRANGEIDENTIFIER]})(?:${i[o.PRERELEASE]})?${i[o.BUILD]}?)?)?`),a(\"XRANGEPLAINLOOSE\",`[v=\\\\s]*(${i[o.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${i[o.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${i[o.XRANGEIDENTIFIERLOOSE]})(?:${i[o.PRERELEASELOOSE]})?${i[o.BUILD]}?)?)?`),a(\"XRANGE\",`^${i[o.GTLT]}\\\\s*${i[o.XRANGEPLAIN]}$`),a(\"XRANGELOOSE\",`^${i[o.GTLT]}\\\\s*${i[o.XRANGEPLAINLOOSE]}$`),a(\"COERCE\",`(^|[^\\\\d])(\\\\d{1,${t}})(?:\\\\.(\\\\d{1,${t}}))?(?:\\\\.(\\\\d{1,${t}}))?(?:$|[^\\\\d])`),a(\"COERCERTL\",i[o.COERCE],!0),a(\"LONETILDE\",\"(?:~>?)\"),a(\"TILDETRIM\",`(\\\\s*)${i[o.LONETILDE]}\\\\s+`,!0),r.tildeTrimReplace=\"$1~\",a(\"TILDE\",`^${i[o.LONETILDE]}${i[o.XRANGEPLAIN]}$`),a(\"TILDELOOSE\",`^${i[o.LONETILDE]}${i[o.XRANGEPLAINLOOSE]}$`),a(\"LONECARET\",\"(?:\\\\^)\"),a(\"CARETTRIM\",`(\\\\s*)${i[o.LONECARET]}\\\\s+`,!0),r.caretTrimReplace=\"$1^\",a(\"CARET\",`^${i[o.LONECARET]}${i[o.XRANGEPLAIN]}$`),a(\"CARETLOOSE\",`^${i[o.LONECARET]}${i[o.XRANGEPLAINLOOSE]}$`),a(\"COMPARATORLOOSE\",`^${i[o.GTLT]}\\\\s*(${i[o.LOOSEPLAIN]})$|^$`),a(\"COMPARATOR\",`^${i[o.GTLT]}\\\\s*(${i[o.FULLPLAIN]})$|^$`),a(\"COMPARATORTRIM\",`(\\\\s*)${i[o.GTLT]}\\\\s*(${i[o.LOOSEPLAIN]}|${i[o.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace=\"$1$2$3\",a(\"HYPHENRANGE\",`^\\\\s*(${i[o.XRANGEPLAIN]})\\\\s+-\\\\s+(${i[o.XRANGEPLAIN]})\\\\s*$`),a(\"HYPHENRANGELOOSE\",`^\\\\s*(${i[o.XRANGEPLAINLOOSE]})\\\\s+-\\\\s+(${i[o.XRANGEPLAINLOOSE]})\\\\s*$`),a(\"STAR\",\"(<|>)?=?\\\\s*\\\\*\"),a(\"GTE0\",\"^\\\\s*>=\\\\s*0.0.0\\\\s*$\"),a(\"GTE0PRE\",\"^\\\\s*>=\\\\s*0.0.0-0\\\\s*$\")}));const u=/^[0-9]+$/,$=(e,r)=>{const t=u.test(e),s=u.test(r);return t&&s&&(e=+e,r=+r),e===r?0:t&&!s?-1:s&&!t?1:e$(r,e)};const{MAX_LENGTH:R,MAX_SAFE_INTEGER:f}=p,{re:N,t:m}=h,{compareIdentifiers:O}=I;class L{constructor(e,r){if(r&&\"object\"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof L){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(\"string\"!=typeof e)throw new TypeError(\"Invalid Version: \"+e);if(e.length>R)throw new TypeError(`version is longer than ${R} characters`);c(\"SemVer\",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const t=e.trim().match(r.loose?N[m.LOOSE]:N[m.FULL]);if(!t)throw new TypeError(\"Invalid Version: \"+e);if(this.raw=e,this.major=+t[1],this.minor=+t[2],this.patch=+t[3],this.major>f||this.major<0)throw new TypeError(\"Invalid major version\");if(this.minor>f||this.minor<0)throw new TypeError(\"Invalid minor version\");if(this.patch>f||this.patch<0)throw new TypeError(\"Invalid patch version\");t[4]?this.prerelease=t[4].split(\".\").map(e=>{if(/^[0-9]+$/.test(e)){const r=+e;if(r>=0&&r=0;)\"number\"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}r&&(this.prerelease[0]===r?isNaN(this.prerelease[1])&&(this.prerelease=[r,0]):this.prerelease=[r,0]);break;default:throw new Error(\"invalid increment argument: \"+e)}return this.format(),this.raw=this.version,this}}var T=L;var A=(e,r,t)=>new T(e,t).compare(new T(r,t));var v=(e,r,t)=>0===A(e,r,t);var d=(e,r,t)=>0!==A(e,r,t);var S=(e,r,t)=>A(e,r,t)>0;var P=(e,r,t)=>A(e,r,t)>=0;var w=(e,r,t)=>A(e,r,t)<0;var g=(e,r,t)=>A(e,r,t)<=0;var D=(e,r,t,s)=>{switch(r){case\"===\":return\"object\"==typeof e&&(e=e.version),\"object\"==typeof t&&(t=t.version),e===t;case\"!==\":return\"object\"==typeof e&&(e=e.version),\"object\"==typeof t&&(t=t.version),e!==t;case\"\":case\"=\":case\"==\":return v(e,t,s);case\"!=\":return d(e,t,s);case\">\":return S(e,t,s);case\">=\":return P(e,t,s);case\"<\":return w(e,t,s);case\"<=\":return g(e,t,s);default:throw new TypeError(\"Invalid operator: \"+r)}};const y=Symbol(\"SemVer ANY\");class G{static get ANY(){return y}constructor(e,r){if(r&&\"object\"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof G){if(e.loose===!!r.loose)return e;e=e.value}c(\"comparator\",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===y?this.value=\"\":this.value=this.operator+this.semver.version,c(\"comp\",this)}parse(e){const r=this.options.loose?C[F.COMPARATORLOOSE]:C[F.COMPARATOR],t=e.match(r);if(!t)throw new TypeError(\"Invalid comparator: \"+e);this.operator=void 0!==t[1]?t[1]:\"\",\"=\"===this.operator&&(this.operator=\"\"),t[2]?this.semver=new T(t[2],this.options.loose):this.semver=y}toString(){return this.value}test(e){if(c(\"Comparator.test\",e,this.options.loose),this.semver===y||e===y)return!0;if(\"string\"==typeof e)try{e=new T(e,this.options)}catch(e){return!1}return D(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof G))throw new TypeError(\"a Comparator is required\");if(r&&\"object\"==typeof r||(r={loose:!!r,includePrerelease:!1}),\"\"===this.operator)return\"\"===this.value||new j(e.value,r).test(this.value);if(\"\"===e.operator)return\"\"===e.value||new j(this.value,r).test(e.semver);const t=!(\">=\"!==this.operator&&\">\"!==this.operator||\">=\"!==e.operator&&\">\"!==e.operator),s=!(\"<=\"!==this.operator&&\"<\"!==this.operator||\"<=\"!==e.operator&&\"<\"!==e.operator),i=this.semver.version===e.semver.version,o=!(\">=\"!==this.operator&&\"<=\"!==this.operator||\">=\"!==e.operator&&\"<=\"!==e.operator),n=D(this.semver,\"<\",e.semver,r)&&(\">=\"===this.operator||\">\"===this.operator)&&(\"<=\"===e.operator||\"<\"===e.operator),a=D(this.semver,\">\",e.semver,r)&&(\"<=\"===this.operator||\"<\"===this.operator)&&(\">=\"===e.operator||\">\"===e.operator);return t||s||i&&o||n||a}}var M=G;const{re:C,t:F}=h;class _{constructor(e,r){if(r&&\"object\"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof _)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new _(e.raw,r);if(e instanceof M)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e,this.set=e.split(/\\s*\\|\\|\\s*/).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(\"Invalid SemVer Range: \"+e);this.format()}format(){return this.range=this.set.map(e=>e.join(\" \").trim()).join(\"||\").trim(),this.range}toString(){return this.range}parseRange(e){const r=this.options.loose;e=e.trim();const t=r?X[b.HYPHENRANGELOOSE]:X[b.HYPHENRANGE];e=e.replace(t,ee(this.options.includePrerelease)),c(\"hyphen replace\",e),e=e.replace(X[b.COMPARATORTRIM],U),c(\"comparator trim\",e,X[b.COMPARATORTRIM]),e=(e=(e=e.replace(X[b.TILDETRIM],k)).replace(X[b.CARETTRIM],x)).split(/\\s+/).join(\" \");const s=r?X[b.COMPARATORLOOSE]:X[b.COMPARATOR];return e.split(\" \").map(e=>H(e,this.options)).join(\" \").split(/\\s+/).map(e=>W(e,this.options)).filter(this.options.loose?e=>!!e.match(s):()=>!0).map(e=>new M(e,this.options))}intersects(e,r){if(!(e instanceof _))throw new TypeError(\"a Range is required\");return this.set.some(t=>B(t,r)&&e.set.some(e=>B(e,r)&&t.every(t=>e.every(e=>t.intersects(e,r)))))}test(e){if(!e)return!1;if(\"string\"==typeof e)try{e=new T(e,this.options)}catch(e){return!1}for(let r=0;r{let t=!0;const s=e.slice();let i=s.pop();for(;t&&s.length;)t=s.every(e=>i.intersects(e,r)),i=s.pop();return t},H=(e,r)=>(c(\"comp\",e,r),e=z(e,r),c(\"caret\",e),e=q(e,r),c(\"tildes\",e),e=J(e,r),c(\"xrange\",e),e=Q(e,r),c(\"stars\",e),e),V=e=>!e||\"x\"===e.toLowerCase()||\"*\"===e,q=(e,r)=>e.trim().split(/\\s+/).map(e=>Y(e,r)).join(\" \"),Y=(e,r)=>{const t=r.loose?X[b.TILDELOOSE]:X[b.TILDE];return e.replace(t,(r,t,s,i,o)=>{let n;return c(\"tilde\",e,r,t,s,i,o),V(t)?n=\"\":V(s)?n=`>=${t}.0.0 <${+t+1}.0.0-0`:V(i)?n=`>=${t}.${s}.0 <${t}.${+s+1}.0-0`:o?(c(\"replaceTilde pr\",o),n=`>=${t}.${s}.${i}-${o} <${t}.${+s+1}.0-0`):n=`>=${t}.${s}.${i} <${t}.${+s+1}.0-0`,c(\"tilde return\",n),n})},z=(e,r)=>e.trim().split(/\\s+/).map(e=>Z(e,r)).join(\" \"),Z=(e,r)=>{c(\"caret\",e,r);const t=r.loose?X[b.CARETLOOSE]:X[b.CARET],s=r.includePrerelease?\"-0\":\"\";return e.replace(t,(r,t,i,o,n)=>{let a;return c(\"caret\",e,r,t,i,o,n),V(t)?a=\"\":V(i)?a=`>=${t}.0.0${s} <${+t+1}.0.0-0`:V(o)?a=\"0\"===t?`>=${t}.${i}.0${s} <${t}.${+i+1}.0-0`:`>=${t}.${i}.0${s} <${+t+1}.0.0-0`:n?(c(\"replaceCaret pr\",n),a=\"0\"===t?\"0\"===i?`>=${t}.${i}.${o}-${n} <${t}.${i}.${+o+1}-0`:`>=${t}.${i}.${o}-${n} <${t}.${+i+1}.0-0`:`>=${t}.${i}.${o}-${n} <${+t+1}.0.0-0`):(c(\"no pr\"),a=\"0\"===t?\"0\"===i?`>=${t}.${i}.${o}${s} <${t}.${i}.${+o+1}-0`:`>=${t}.${i}.${o}${s} <${t}.${+i+1}.0-0`:`>=${t}.${i}.${o} <${+t+1}.0.0-0`),c(\"caret return\",a),a})},J=(e,r)=>(c(\"replaceXRanges\",e,r),e.split(/\\s+/).map(e=>K(e,r)).join(\" \")),K=(e,r)=>{e=e.trim();const t=r.loose?X[b.XRANGELOOSE]:X[b.XRANGE];return e.replace(t,(t,s,i,o,n,a)=>{c(\"xRange\",e,t,s,i,o,n,a);const E=V(i),l=E||V(o),p=l||V(n),h=p;return\"=\"===s&&h&&(s=\"\"),a=r.includePrerelease?\"-0\":\"\",E?t=\">\"===s||\"<\"===s?\"<0.0.0-0\":\"*\":s&&h?(l&&(o=0),n=0,\">\"===s?(s=\">=\",l?(i=+i+1,o=0,n=0):(o=+o+1,n=0)):\"<=\"===s&&(s=\"<\",l?i=+i+1:o=+o+1),\"<\"===s&&(a=\"-0\"),t=`${s+i}.${o}.${n}${a}`):l?t=`>=${i}.0.0${a} <${+i+1}.0.0-0`:p&&(t=`>=${i}.${o}.0${a} <${i}.${+o+1}.0-0`),c(\"xRange return\",t),t})},Q=(e,r)=>(c(\"replaceStars\",e,r),e.trim().replace(X[b.STAR],\"\")),W=(e,r)=>(c(\"replaceGTE0\",e,r),e.trim().replace(X[r.includePrerelease?b.GTE0PRE:b.GTE0],\"\")),ee=e=>(r,t,s,i,o,n,a,E,l,p,c,h,u)=>`${t=V(s)?\"\":V(i)?`>=${s}.0.0${e?\"-0\":\"\"}`:V(o)?`>=${s}.${i}.0${e?\"-0\":\"\"}`:n?\">=\"+t:`>=${t}${e?\"-0\":\"\"}`} ${E=V(l)?\"\":V(p)?`<${+l+1}.0.0-0`:V(c)?`<${l}.${+p+1}.0-0`:h?`<=${l}.${p}.${c}-${h}`:e?`<${l}.${p}.${+c+1}-0`:\"<=\"+E}`.trim(),re=(e,r,t)=>{for(let t=0;t0){const s=e[t].semver;if(s.major===r.major&&s.minor===r.minor&&s.patch===r.patch)return!0}return!1}return!0};var te=(e,r,t)=>{try{r=new j(r,t)}catch(e){return!1}return r.test(e)};const se=/(.*?):.*/,ie=/(.*?)#.*/;void 0===window.__steelbrain_package_deps&&(window.__steelbrain_package_deps=new Set),exports.fs=l,exports.installDependencies=async function(e,t=!0){r(e,\"[Package-Deps] Package name is required\");const s=await async function(e){const r=atom.packages.getLoadedPackage(e),t=r&&r.metadata[\"package-deps\"];return Array.isArray(t)?(await Promise.all(t.map((async function(e){let r=null,t=e,s=null;const o=se.exec(e),n=ie.exec(e);if(o?[,t,s]=o:n?[,t,r]=n:t=e,__steelbrain_package_deps.has(t))return null;const a=atom.packages.resolvePackagePath(t);if(a){if(!s)return null;const e=JSON.parse(await l.readFile(i.join(a,\"package.json\")));if(null!=e&&null!=e.version&&te(e.version,\">=\"+s))return null}return __steelbrain_package_deps.add(t),{name:t,url:r}})))).filter(Boolean):[]}(e);if(s.length){if(t){let r=\"Yes\";if(await Promise.resolve().then((function(){return require(\"./prompt-afef23e0.js\")})).then(async({promptUser:t})=>{r=await t(e,s)}),\"Yes\"!==r)return}await Promise.resolve().then((function(){return require(\"./install-03586186.js\")})).then(async({performInstall:r})=>r(e,s))}};\n//# sourceMappingURL=index-6660c169.js.map\n"],"names":["shownStorageInfo","async","packageName","dependencies","oldConfigPath","Path","join","atom","getConfigDirPath","ignoredPackages","config","get","fs","exists","oldConfig","JSON","parse","readFile","set","ignored","unlink","includes","packages","isPackageDisabled","Promise","resolve","notification","notifications","addInfo","dismissable","icon","detail","map","e","name","description","length","buttons","text","onDidClick","dismiss","push","onDidDismiss","View","constructor","item","progress","document","createElement","dispose","advance","value","max","style","width","notificationView","views","getView","element","notificationContent","querySelector","appendChild","_","complete","errors","size","addSuccess","this","forEach","error","addWarning","module","bytes","i","E"],"mappings":"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"} \ No newline at end of file diff --git a/dist/index-613b31ed.js.map b/dist/index-613b31ed.js.map deleted file mode 100644 index a9daba3..0000000 --- a/dist/index-613b31ed.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index-613b31ed.js","sources":["../node_modules/.pnpm/atom-package-deps@6.0.0/node_modules/atom-package-deps/lib/prompt-afef23e0.js","../node_modules/.pnpm/atom-package-deps@6.0.0/node_modules/atom-package-deps/lib/install-03586186.js","../node_modules/.pnpm/atom-package-deps@6.0.0/node_modules/atom-package-deps/lib/index-6660c169.js"],"sourcesContent":["\"use strict\";require(\"assert\");var e=require(\"./index-6660c169.js\");require(\"fs\"),require(\"util\");var i,t=(i=require(\"path\"))&&\"object\"==typeof i&&\"default\"in i?i.default:i;let o=!1;exports.promptUser=async function(i,s){const a=t.join(atom.getConfigDirPath(),\"package-deps-state.json\");let n=atom.config.get(\"atom-package-deps.ignored\")||[];if(await e.fs.exists(a)){const i=JSON.parse(await e.fs.readFile(a,\"utf8\"));atom.config.set(\"atom-package-deps.ignored\",n=i.ignored),await e.fs.unlink(a)}return n.includes(i)?\"No\":(atom.packages.isPackageDisabled(\"notifications\"),new Promise((function(e){const t=atom.notifications.addInfo(i+\" needs to install dependencies\",{dismissable:!0,icon:\"cloud-download\",detail:s.map(e=>e.name).join(\", \"),description:`Install dependenc${1===s.length?\"y\":\"ies\"}?`,buttons:[{text:\"Yes\",onDidClick:()=>{e(\"Yes\"),t.dismiss()}},{text:\"No Thanks\",onDidClick:()=>{e(\"No\"),t.dismiss()}},{text:\"Never\",onDidClick:()=>{n=atom.config.get(\"atom-package-deps.ignored\")||[],n.push(i),atom.config.set(\"atom-package-deps.ignored\",n),o||(o=!0,atom.notifications.addInfo(\"How to reset package-deps memory\",{dismissable:!0,description:\"To modify the list of ignored files invoke 'Application: Open Your Config' and change the 'atom-package-deps' section\"})),e(\"Never\"),t.dismiss()}}]});t.onDidDismiss(()=>e(\"No\"))})))};\n//# sourceMappingURL=prompt-afef23e0.js.map\n","\"use strict\";var e=require(\"atom\");class t{constructor(e,t){this.name=e,this.dependencies=t;const n=atom.notifications.addInfo(`Installing ${e} dependencies`,{detail:\"Installing \"+t.map(e=>e.name).join(\", \"),dismissable:!0}),s=document.createElement(\"progress\");this.dispose=function(){n.dismiss()},this.advance=function(){s.value+=1},s.max=t.length,s.style.width=\"100%\";try{let e=atom.views.getView(n);null!=e&&null!=e.element&&(e=e.element);const t=e.querySelector(\".detail-content\")||e.querySelector(\".content\");t&&t.appendChild(s)}catch(e){}}complete(e){if(this.dispose(),!e.size)return void atom.notifications.addSuccess(`Installed ${this.name} dependencies`,{detail:\"Installed \"+this.dependencies.map(e=>e.name).join(\", \")});const t=[];e.forEach((e,n)=>{t.push(\" • \"+n)}),atom.notifications.addWarning(`Failed to install ${this.name} dependencies`,{detail:\"These packages were not installed, check your console\\nfor more info.\\n\"+t.join(\"\\n\"),dismissable:!0})}}const n=new Set([\"✓\",\"done\"]),s=/(?:Installing|Moving) (.*?) to .* (.*)/;function a(t,a){const o=new Map;return Promise.all(t.map((function(t){return(i=atom.packages.getApmPath(),c=[\"install\",t.url||t.name,\"--production\",\"--color\",\"false\"],new Promise((function(t){const n={stdout:[],stderr:[]};new e.BufferedProcess({command:i,args:c,stdout(e){n.stdout.push(e)},stderr(e){n.stderr.push(e)},exit(){t({stdout:n.stdout.join(\"\"),stderr:n.stderr.join(\"\")})},autoStart:!1}).start()}))).then((function(e){let o=s.test(e.stdout);if(o){const t=s.exec(e.stdout);o=t&&n.has(t[2])}if(a(t.name,!!o),!o){const n=new Error(\"Error installing dependency: \"+t.name);throw n.stack=e.stderr,n}})).catch((function(e){o.set(t.name,e)}));var i,c}))).then((function(){return o}))}exports.performInstall=async function(e,n){const s=new t(e,n),o=await a(n,(function(){s.advance()}));return s.complete(o),Promise.all(n.map(e=>o.has(e.name)?null:atom.packages.activatePackage(e.name)))};\n//# sourceMappingURL=install-03586186.js.map\n","\"use strict\";function e(e){return e&&\"object\"==typeof e&&\"default\"in e?e.default:e}var r=e(require(\"assert\")),t=e(require(\"fs\")),s=e(require(\"util\")),i=e(require(\"path\"));function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,\"default\")?e.default:e}function n(e,r,t){return e(t={path:r,exports:{},require:function(e,r){return function(){throw new Error(\"Dynamic requires are not currently supported by @rollup/plugin-commonjs\")}(null==r&&t.path)}},t.exports),t.exports}var a=n((function(e,r){e.exports=function(e){for(var r=0;r{if(!Buffer.isBuffer(e))throw new TypeError(\"Expected a Buffer, got \"+typeof e);return 239===e[0]&&187===e[1]&&191===e[2]&&a(e)?e.slice(3):e},l=o(n((function(e){var r=o(t),i=o(E);function o(e){return e&&e.__esModule?e:{default:e}}const n={},a=[\"Stats\",\"_toUnixTimestamp\",\"watch\",\"watchFile\",\"unwatchFile\"];Object.keys(r.default).forEach((function(e){const t=r.default[e];\"function\"!=typeof t||e.includes(\"Sync\")||e.includes(\"Stream\")||a.includes(e)?n[e]=t:n[e]=(0,s.promisify)(t)})),n.exists=function(e){return new Promise((function(t){r.default.access(e,r.default.R_OK,(function(e){t(null===e)}))}))},n.readFile=function(e,t){return new Promise((function(s,o){r.default.readFile(e,(function(e,r){if(e)return void o(e);let n=(0,i.default)(r);t&&(n=n.toString(t)),s(n)}))}))},e.exports=n})));var p={SEMVER_SPEC_VERSION:\"2.0.0\",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16};var c=\"object\"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\\bsemver\\b/i.test(process.env.NODE_DEBUG)?(...e)=>{}:()=>{},h=n((function(e,r){const{MAX_SAFE_COMPONENT_LENGTH:t}=p,s=(r=e.exports={}).re=[],i=r.src=[],o=r.t={};let n=0;const a=(e,r,t)=>{const a=n++;c(a,r),o[e]=a,i[a]=r,s[a]=new RegExp(r,t?\"g\":void 0)};a(\"NUMERICIDENTIFIER\",\"0|[1-9]\\\\d*\"),a(\"NUMERICIDENTIFIERLOOSE\",\"[0-9]+\"),a(\"NONNUMERICIDENTIFIER\",\"\\\\d*[a-zA-Z-][a-zA-Z0-9-]*\"),a(\"MAINVERSION\",`(${i[o.NUMERICIDENTIFIER]})\\\\.(${i[o.NUMERICIDENTIFIER]})\\\\.(${i[o.NUMERICIDENTIFIER]})`),a(\"MAINVERSIONLOOSE\",`(${i[o.NUMERICIDENTIFIERLOOSE]})\\\\.(${i[o.NUMERICIDENTIFIERLOOSE]})\\\\.(${i[o.NUMERICIDENTIFIERLOOSE]})`),a(\"PRERELEASEIDENTIFIER\",`(?:${i[o.NUMERICIDENTIFIER]}|${i[o.NONNUMERICIDENTIFIER]})`),a(\"PRERELEASEIDENTIFIERLOOSE\",`(?:${i[o.NUMERICIDENTIFIERLOOSE]}|${i[o.NONNUMERICIDENTIFIER]})`),a(\"PRERELEASE\",`(?:-(${i[o.PRERELEASEIDENTIFIER]}(?:\\\\.${i[o.PRERELEASEIDENTIFIER]})*))`),a(\"PRERELEASELOOSE\",`(?:-?(${i[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\\\.${i[o.PRERELEASEIDENTIFIERLOOSE]})*))`),a(\"BUILDIDENTIFIER\",\"[0-9A-Za-z-]+\"),a(\"BUILD\",`(?:\\\\+(${i[o.BUILDIDENTIFIER]}(?:\\\\.${i[o.BUILDIDENTIFIER]})*))`),a(\"FULLPLAIN\",`v?${i[o.MAINVERSION]}${i[o.PRERELEASE]}?${i[o.BUILD]}?`),a(\"FULL\",`^${i[o.FULLPLAIN]}$`),a(\"LOOSEPLAIN\",`[v=\\\\s]*${i[o.MAINVERSIONLOOSE]}${i[o.PRERELEASELOOSE]}?${i[o.BUILD]}?`),a(\"LOOSE\",`^${i[o.LOOSEPLAIN]}$`),a(\"GTLT\",\"((?:<|>)?=?)\"),a(\"XRANGEIDENTIFIERLOOSE\",i[o.NUMERICIDENTIFIERLOOSE]+\"|x|X|\\\\*\"),a(\"XRANGEIDENTIFIER\",i[o.NUMERICIDENTIFIER]+\"|x|X|\\\\*\"),a(\"XRANGEPLAIN\",`[v=\\\\s]*(${i[o.XRANGEIDENTIFIER]})(?:\\\\.(${i[o.XRANGEIDENTIFIER]})(?:\\\\.(${i[o.XRANGEIDENTIFIER]})(?:${i[o.PRERELEASE]})?${i[o.BUILD]}?)?)?`),a(\"XRANGEPLAINLOOSE\",`[v=\\\\s]*(${i[o.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${i[o.XRANGEIDENTIFIERLOOSE]})(?:\\\\.(${i[o.XRANGEIDENTIFIERLOOSE]})(?:${i[o.PRERELEASELOOSE]})?${i[o.BUILD]}?)?)?`),a(\"XRANGE\",`^${i[o.GTLT]}\\\\s*${i[o.XRANGEPLAIN]}$`),a(\"XRANGELOOSE\",`^${i[o.GTLT]}\\\\s*${i[o.XRANGEPLAINLOOSE]}$`),a(\"COERCE\",`(^|[^\\\\d])(\\\\d{1,${t}})(?:\\\\.(\\\\d{1,${t}}))?(?:\\\\.(\\\\d{1,${t}}))?(?:$|[^\\\\d])`),a(\"COERCERTL\",i[o.COERCE],!0),a(\"LONETILDE\",\"(?:~>?)\"),a(\"TILDETRIM\",`(\\\\s*)${i[o.LONETILDE]}\\\\s+`,!0),r.tildeTrimReplace=\"$1~\",a(\"TILDE\",`^${i[o.LONETILDE]}${i[o.XRANGEPLAIN]}$`),a(\"TILDELOOSE\",`^${i[o.LONETILDE]}${i[o.XRANGEPLAINLOOSE]}$`),a(\"LONECARET\",\"(?:\\\\^)\"),a(\"CARETTRIM\",`(\\\\s*)${i[o.LONECARET]}\\\\s+`,!0),r.caretTrimReplace=\"$1^\",a(\"CARET\",`^${i[o.LONECARET]}${i[o.XRANGEPLAIN]}$`),a(\"CARETLOOSE\",`^${i[o.LONECARET]}${i[o.XRANGEPLAINLOOSE]}$`),a(\"COMPARATORLOOSE\",`^${i[o.GTLT]}\\\\s*(${i[o.LOOSEPLAIN]})$|^$`),a(\"COMPARATOR\",`^${i[o.GTLT]}\\\\s*(${i[o.FULLPLAIN]})$|^$`),a(\"COMPARATORTRIM\",`(\\\\s*)${i[o.GTLT]}\\\\s*(${i[o.LOOSEPLAIN]}|${i[o.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace=\"$1$2$3\",a(\"HYPHENRANGE\",`^\\\\s*(${i[o.XRANGEPLAIN]})\\\\s+-\\\\s+(${i[o.XRANGEPLAIN]})\\\\s*$`),a(\"HYPHENRANGELOOSE\",`^\\\\s*(${i[o.XRANGEPLAINLOOSE]})\\\\s+-\\\\s+(${i[o.XRANGEPLAINLOOSE]})\\\\s*$`),a(\"STAR\",\"(<|>)?=?\\\\s*\\\\*\"),a(\"GTE0\",\"^\\\\s*>=\\\\s*0.0.0\\\\s*$\"),a(\"GTE0PRE\",\"^\\\\s*>=\\\\s*0.0.0-0\\\\s*$\")}));const u=/^[0-9]+$/,$=(e,r)=>{const t=u.test(e),s=u.test(r);return t&&s&&(e=+e,r=+r),e===r?0:t&&!s?-1:s&&!t?1:e$(r,e)};const{MAX_LENGTH:R,MAX_SAFE_INTEGER:f}=p,{re:N,t:m}=h,{compareIdentifiers:O}=I;class L{constructor(e,r){if(r&&\"object\"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof L){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(\"string\"!=typeof e)throw new TypeError(\"Invalid Version: \"+e);if(e.length>R)throw new TypeError(`version is longer than ${R} characters`);c(\"SemVer\",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const t=e.trim().match(r.loose?N[m.LOOSE]:N[m.FULL]);if(!t)throw new TypeError(\"Invalid Version: \"+e);if(this.raw=e,this.major=+t[1],this.minor=+t[2],this.patch=+t[3],this.major>f||this.major<0)throw new TypeError(\"Invalid major version\");if(this.minor>f||this.minor<0)throw new TypeError(\"Invalid minor version\");if(this.patch>f||this.patch<0)throw new TypeError(\"Invalid patch version\");t[4]?this.prerelease=t[4].split(\".\").map(e=>{if(/^[0-9]+$/.test(e)){const r=+e;if(r>=0&&r=0;)\"number\"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}r&&(this.prerelease[0]===r?isNaN(this.prerelease[1])&&(this.prerelease=[r,0]):this.prerelease=[r,0]);break;default:throw new Error(\"invalid increment argument: \"+e)}return this.format(),this.raw=this.version,this}}var T=L;var A=(e,r,t)=>new T(e,t).compare(new T(r,t));var v=(e,r,t)=>0===A(e,r,t);var d=(e,r,t)=>0!==A(e,r,t);var S=(e,r,t)=>A(e,r,t)>0;var P=(e,r,t)=>A(e,r,t)>=0;var w=(e,r,t)=>A(e,r,t)<0;var g=(e,r,t)=>A(e,r,t)<=0;var D=(e,r,t,s)=>{switch(r){case\"===\":return\"object\"==typeof e&&(e=e.version),\"object\"==typeof t&&(t=t.version),e===t;case\"!==\":return\"object\"==typeof e&&(e=e.version),\"object\"==typeof t&&(t=t.version),e!==t;case\"\":case\"=\":case\"==\":return v(e,t,s);case\"!=\":return d(e,t,s);case\">\":return S(e,t,s);case\">=\":return P(e,t,s);case\"<\":return w(e,t,s);case\"<=\":return g(e,t,s);default:throw new TypeError(\"Invalid operator: \"+r)}};const y=Symbol(\"SemVer ANY\");class G{static get ANY(){return y}constructor(e,r){if(r&&\"object\"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof G){if(e.loose===!!r.loose)return e;e=e.value}c(\"comparator\",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===y?this.value=\"\":this.value=this.operator+this.semver.version,c(\"comp\",this)}parse(e){const r=this.options.loose?C[F.COMPARATORLOOSE]:C[F.COMPARATOR],t=e.match(r);if(!t)throw new TypeError(\"Invalid comparator: \"+e);this.operator=void 0!==t[1]?t[1]:\"\",\"=\"===this.operator&&(this.operator=\"\"),t[2]?this.semver=new T(t[2],this.options.loose):this.semver=y}toString(){return this.value}test(e){if(c(\"Comparator.test\",e,this.options.loose),this.semver===y||e===y)return!0;if(\"string\"==typeof e)try{e=new T(e,this.options)}catch(e){return!1}return D(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof G))throw new TypeError(\"a Comparator is required\");if(r&&\"object\"==typeof r||(r={loose:!!r,includePrerelease:!1}),\"\"===this.operator)return\"\"===this.value||new j(e.value,r).test(this.value);if(\"\"===e.operator)return\"\"===e.value||new j(this.value,r).test(e.semver);const t=!(\">=\"!==this.operator&&\">\"!==this.operator||\">=\"!==e.operator&&\">\"!==e.operator),s=!(\"<=\"!==this.operator&&\"<\"!==this.operator||\"<=\"!==e.operator&&\"<\"!==e.operator),i=this.semver.version===e.semver.version,o=!(\">=\"!==this.operator&&\"<=\"!==this.operator||\">=\"!==e.operator&&\"<=\"!==e.operator),n=D(this.semver,\"<\",e.semver,r)&&(\">=\"===this.operator||\">\"===this.operator)&&(\"<=\"===e.operator||\"<\"===e.operator),a=D(this.semver,\">\",e.semver,r)&&(\"<=\"===this.operator||\"<\"===this.operator)&&(\">=\"===e.operator||\">\"===e.operator);return t||s||i&&o||n||a}}var M=G;const{re:C,t:F}=h;class _{constructor(e,r){if(r&&\"object\"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof _)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new _(e.raw,r);if(e instanceof M)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e,this.set=e.split(/\\s*\\|\\|\\s*/).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(\"Invalid SemVer Range: \"+e);this.format()}format(){return this.range=this.set.map(e=>e.join(\" \").trim()).join(\"||\").trim(),this.range}toString(){return this.range}parseRange(e){const r=this.options.loose;e=e.trim();const t=r?X[b.HYPHENRANGELOOSE]:X[b.HYPHENRANGE];e=e.replace(t,ee(this.options.includePrerelease)),c(\"hyphen replace\",e),e=e.replace(X[b.COMPARATORTRIM],U),c(\"comparator trim\",e,X[b.COMPARATORTRIM]),e=(e=(e=e.replace(X[b.TILDETRIM],k)).replace(X[b.CARETTRIM],x)).split(/\\s+/).join(\" \");const s=r?X[b.COMPARATORLOOSE]:X[b.COMPARATOR];return e.split(\" \").map(e=>H(e,this.options)).join(\" \").split(/\\s+/).map(e=>W(e,this.options)).filter(this.options.loose?e=>!!e.match(s):()=>!0).map(e=>new M(e,this.options))}intersects(e,r){if(!(e instanceof _))throw new TypeError(\"a Range is required\");return this.set.some(t=>B(t,r)&&e.set.some(e=>B(e,r)&&t.every(t=>e.every(e=>t.intersects(e,r)))))}test(e){if(!e)return!1;if(\"string\"==typeof e)try{e=new T(e,this.options)}catch(e){return!1}for(let r=0;r{let t=!0;const s=e.slice();let i=s.pop();for(;t&&s.length;)t=s.every(e=>i.intersects(e,r)),i=s.pop();return t},H=(e,r)=>(c(\"comp\",e,r),e=z(e,r),c(\"caret\",e),e=q(e,r),c(\"tildes\",e),e=J(e,r),c(\"xrange\",e),e=Q(e,r),c(\"stars\",e),e),V=e=>!e||\"x\"===e.toLowerCase()||\"*\"===e,q=(e,r)=>e.trim().split(/\\s+/).map(e=>Y(e,r)).join(\" \"),Y=(e,r)=>{const t=r.loose?X[b.TILDELOOSE]:X[b.TILDE];return e.replace(t,(r,t,s,i,o)=>{let n;return c(\"tilde\",e,r,t,s,i,o),V(t)?n=\"\":V(s)?n=`>=${t}.0.0 <${+t+1}.0.0-0`:V(i)?n=`>=${t}.${s}.0 <${t}.${+s+1}.0-0`:o?(c(\"replaceTilde pr\",o),n=`>=${t}.${s}.${i}-${o} <${t}.${+s+1}.0-0`):n=`>=${t}.${s}.${i} <${t}.${+s+1}.0-0`,c(\"tilde return\",n),n})},z=(e,r)=>e.trim().split(/\\s+/).map(e=>Z(e,r)).join(\" \"),Z=(e,r)=>{c(\"caret\",e,r);const t=r.loose?X[b.CARETLOOSE]:X[b.CARET],s=r.includePrerelease?\"-0\":\"\";return e.replace(t,(r,t,i,o,n)=>{let a;return c(\"caret\",e,r,t,i,o,n),V(t)?a=\"\":V(i)?a=`>=${t}.0.0${s} <${+t+1}.0.0-0`:V(o)?a=\"0\"===t?`>=${t}.${i}.0${s} <${t}.${+i+1}.0-0`:`>=${t}.${i}.0${s} <${+t+1}.0.0-0`:n?(c(\"replaceCaret pr\",n),a=\"0\"===t?\"0\"===i?`>=${t}.${i}.${o}-${n} <${t}.${i}.${+o+1}-0`:`>=${t}.${i}.${o}-${n} <${t}.${+i+1}.0-0`:`>=${t}.${i}.${o}-${n} <${+t+1}.0.0-0`):(c(\"no pr\"),a=\"0\"===t?\"0\"===i?`>=${t}.${i}.${o}${s} <${t}.${i}.${+o+1}-0`:`>=${t}.${i}.${o}${s} <${t}.${+i+1}.0-0`:`>=${t}.${i}.${o} <${+t+1}.0.0-0`),c(\"caret return\",a),a})},J=(e,r)=>(c(\"replaceXRanges\",e,r),e.split(/\\s+/).map(e=>K(e,r)).join(\" \")),K=(e,r)=>{e=e.trim();const t=r.loose?X[b.XRANGELOOSE]:X[b.XRANGE];return e.replace(t,(t,s,i,o,n,a)=>{c(\"xRange\",e,t,s,i,o,n,a);const E=V(i),l=E||V(o),p=l||V(n),h=p;return\"=\"===s&&h&&(s=\"\"),a=r.includePrerelease?\"-0\":\"\",E?t=\">\"===s||\"<\"===s?\"<0.0.0-0\":\"*\":s&&h?(l&&(o=0),n=0,\">\"===s?(s=\">=\",l?(i=+i+1,o=0,n=0):(o=+o+1,n=0)):\"<=\"===s&&(s=\"<\",l?i=+i+1:o=+o+1),\"<\"===s&&(a=\"-0\"),t=`${s+i}.${o}.${n}${a}`):l?t=`>=${i}.0.0${a} <${+i+1}.0.0-0`:p&&(t=`>=${i}.${o}.0${a} <${i}.${+o+1}.0-0`),c(\"xRange return\",t),t})},Q=(e,r)=>(c(\"replaceStars\",e,r),e.trim().replace(X[b.STAR],\"\")),W=(e,r)=>(c(\"replaceGTE0\",e,r),e.trim().replace(X[r.includePrerelease?b.GTE0PRE:b.GTE0],\"\")),ee=e=>(r,t,s,i,o,n,a,E,l,p,c,h,u)=>`${t=V(s)?\"\":V(i)?`>=${s}.0.0${e?\"-0\":\"\"}`:V(o)?`>=${s}.${i}.0${e?\"-0\":\"\"}`:n?\">=\"+t:`>=${t}${e?\"-0\":\"\"}`} ${E=V(l)?\"\":V(p)?`<${+l+1}.0.0-0`:V(c)?`<${l}.${+p+1}.0-0`:h?`<=${l}.${p}.${c}-${h}`:e?`<${l}.${p}.${+c+1}-0`:\"<=\"+E}`.trim(),re=(e,r,t)=>{for(let t=0;t0){const s=e[t].semver;if(s.major===r.major&&s.minor===r.minor&&s.patch===r.patch)return!0}return!1}return!0};var te=(e,r,t)=>{try{r=new j(r,t)}catch(e){return!1}return r.test(e)};const se=/(.*?):.*/,ie=/(.*?)#.*/;void 0===window.__steelbrain_package_deps&&(window.__steelbrain_package_deps=new Set),exports.fs=l,exports.installDependencies=async function(e,t=!0){r(e,\"[Package-Deps] Package name is required\");const s=await async function(e){const r=atom.packages.getLoadedPackage(e),t=r&&r.metadata[\"package-deps\"];return Array.isArray(t)?(await Promise.all(t.map((async function(e){let r=null,t=e,s=null;const o=se.exec(e),n=ie.exec(e);if(o?[,t,s]=o:n?[,t,r]=n:t=e,__steelbrain_package_deps.has(t))return null;const a=atom.packages.resolvePackagePath(t);if(a){if(!s)return null;const e=JSON.parse(await l.readFile(i.join(a,\"package.json\")));if(null!=e&&null!=e.version&&te(e.version,\">=\"+s))return null}return __steelbrain_package_deps.add(t),{name:t,url:r}})))).filter(Boolean):[]}(e);if(s.length){if(t){let r=\"Yes\";if(await Promise.resolve().then((function(){return require(\"./prompt-afef23e0.js\")})).then(async({promptUser:t})=>{r=await t(e,s)}),\"Yes\"!==r)return}await Promise.resolve().then((function(){return require(\"./install-03586186.js\")})).then(async({performInstall:r})=>r(e,s))}};\n//# sourceMappingURL=index-6660c169.js.map\n"],"names":["shownStorageInfo","async","packageName","dependencies","oldConfigPath","Path","join","atom","getConfigDirPath","ignoredPackages","config","get","fs","exists","oldConfig","JSON","parse","readFile","set","ignored","unlink","includes","packages","isPackageDisabled","Promise","resolve","notification","notifications","addInfo","dismissable","icon","detail","map","e","name","description","length","buttons","text","onDidClick","dismiss","push","onDidDismiss","View","constructor","item","progress","document","createElement","dispose","advance","value","max","style","width","notificationView","views","getView","element","notificationContent","querySelector","appendChild","_","complete","errors","size","addSuccess","this","forEach","error","addWarning","module","bytes","i","E"],"mappings":"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"} \ No newline at end of file diff --git a/dist/main.js b/dist/main.js index f2af3f6..ac80fcd 100644 --- a/dist/main.js +++ b/dist/main.js @@ -1,2 +1,2 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("atom");(e=t)&&"object"==typeof e&&"default"in e&&e.default;let a;exports.activate=function(e){a=new t.CompositeDisposable,async function(){const e=["atom-ide-base","atom-typescript","linter-eslint","autocomplete-paths","javascript-drag-import"];e.some(e=>!atom.packages.isPackageLoaded(e))&&await Promise.resolve().then((function(){return require("./index-613b31ed.js")})).then((function(e){return e.index})).then(t=>{t.install("atom-ide-javascript-js",!1),e.filter(e=>!atom.packages.isPackageLoaded(e)).forEach(e=>{atom.notifications.addInfo(`Enabling package ${e} that is needed for atom-ide-javascript`),atom.packages.enablePackage(e)})})}().then(()=>{atom.config.set("atom-typescript.allowJS",!0),atom.config.set("atom-typescript.checkAllFilesOnSave",!1),atom.commands.dispatch(atom.workspace.getElement(),"typescript:activate")})},exports.config={},exports.deactivate=function(){a&&a.dispose(),a=null},exports.provideYourService=function(){}; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("atom");(e=t)&&"object"==typeof e&&"default"in e&&e.default;let a;exports.activate=function(e){a=new t.CompositeDisposable,async function(){const e=["atom-ide-base","atom-typescript","linter-eslint","autocomplete-paths","javascript-drag-import"];e.some(e=>!atom.packages.isPackageLoaded(e))&&await Promise.resolve().then((function(){return require("./index-27f59b67.js")})).then((function(e){return e.index})).then(t=>{t.install("atom-ide-javascript",!1),e.filter(e=>!atom.packages.isPackageLoaded(e)).forEach(e=>{atom.notifications.addInfo(`Enabling package ${e} that is needed for atom-ide-javascript`),atom.packages.enablePackage(e)})})}().then(()=>{atom.config.set("atom-typescript.allowJS",!0),atom.config.set("atom-typescript.checkAllFilesOnSave",!1),atom.commands.dispatch(atom.workspace.getElement(),"typescript:activate")}).catch(e=>{atom.notifications.addError("atom-ide-javascript failed in installing its dependencies.")})},exports.config={},exports.deactivate=function(){a&&a.dispose(),a=null},exports.provideYourService=function(){}; //# sourceMappingURL=main.js.map diff --git a/dist/main.js.map b/dist/main.js.map index 1d4aa0d..4bb9742 100644 --- a/dist/main.js.map +++ b/dist/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","sources":["../src/main.js","../src/typescript.js"],"sourcesContent":["import { CompositeDisposable } from \"atom\";\r\nimport {setupTypeScript} from \"./typescript.js\";\r\n\r\nlet subscriptions;\r\n\r\n/**\r\n * called by Atom when activating an extension\r\n * @param {any} state the current state of atom\r\n */\r\nexport function activate(state) {\r\n // Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable\r\n subscriptions = new CompositeDisposable();\r\n\r\n package_deps().then(() => {\r\n setupTypeScript()\r\n });\r\n}\r\n\r\n/**\r\n * install Atom package dependencies if not already loaded\r\n */\r\nasync function package_deps() {\r\n // Add entries from package-deps here manually\r\n // (to prevent loading atom-package-deps and package.json when the deps are already loaded)\r\n const deps = [\r\n \"atom-ide-base\",\r\n \"atom-typescript\",\r\n \"linter-eslint\",\r\n \"autocomplete-paths\",\r\n \"javascript-drag-import\"\r\n ];\r\n if (deps.some((p) => !atom.packages.isPackageLoaded(p))) {\r\n await import(\"atom-package-deps\").then((atom_package_deps) => {\r\n // install if not installed\r\n atom_package_deps.install(\"atom-ide-javascript-js\", false);\r\n // enable if disabled\r\n deps.filter((p) => !atom.packages.isPackageLoaded(p)).forEach(p => {\r\n atom.notifications.addInfo(`Enabling package ${p} that is needed for atom-ide-javascript`)\r\n atom.packages.enablePackage(p)\r\n })\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * called by Atom when deactivating an extension\r\n */\r\nexport function deactivate() {\r\n if (subscriptions) {\r\n subscriptions.dispose();\r\n }\r\n subscriptions = null;\r\n}\r\n\r\n/**\r\n * called by IDE extensions to retrieve the service for registration\r\n * @return the current instance\r\n */\r\nexport function provideYourService() {}\r\n\r\nexport const config = {\r\n // doSomething: {\r\n // title: \"title\",\r\n // description: \"config description\",\r\n // type: \"boolean\", // 'number', 'string'\r\n // default: true,\r\n // },\r\n};\r\n","// This configures atom-typescript\r\nexport function setupTypeScript() {\r\n // use atom-typescript for javascript\r\n atom.config.set(\"atom-typescript.allowJS\", true)\r\n // disable check files which slows down Atom\r\n atom.config.set(\"atom-typescript.checkAllFilesOnSave\", false)\r\n // activate atom-typescript\r\n atom.commands.dispatch(atom.workspace.getElement(), \"typescript:activate\")\r\n}\r\n"],"names":["subscriptions","state","CompositeDisposable","async","deps","some","p","atom","packages","isPackageLoaded","Promise","then","atom_package_deps","install","filter","forEach","notifications","addInfo","enablePackage","package_deps","config","set","commands","dispatch","workspace","getElement","dispose"],"mappings":"gJAGA,IAAIA,mBAMG,SAAkBC,GAEvBD,EAAgB,IAAIE,sBAUtBC,uBAGQC,EAAQ,CACZ,gBACA,kBACA,gBACA,qBACA,0BAEEA,EAAKC,KAAMC,IAAOC,KAAKC,SAASC,gBAAgBH,WAC5CI,kDAAO,8DAAqBC,KAAMC,IAEtCA,EAAkBC,QAAQ,0BAA0B,GAEpDT,EAAKU,OAAQR,IAAOC,KAAKC,SAASC,gBAAgBH,IAAIS,QAAQT,IAC5DC,KAAKS,cAAcC,QAAS,oBAAmBX,4CAC/CC,KAAKC,SAASU,cAAcZ,OAzBlCa,GAAeR,KAAK,KCVpBJ,KAAKa,OAAOC,IAAI,2BAA2B,GAE3Cd,KAAKa,OAAOC,IAAI,uCAAuC,GAEvDd,KAAKe,SAASC,SAAShB,KAAKiB,UAAUC,aAAc,yCDqDhC,sBAbf,WACDzB,GACFA,EAAc0B,UAEhB1B,EAAgB,iCAOX"} \ No newline at end of file +{"version":3,"file":"main.js","sources":["../src/main.js","../src/typescript.js"],"sourcesContent":["import { CompositeDisposable } from \"atom\";\nimport {setupTypeScript} from \"./typescript.js\";\n\nlet subscriptions;\n\n/**\n * called by Atom when activating an extension\n * @param {any} state the current state of atom\n */\nexport function activate(state) {\n // Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable\n subscriptions = new CompositeDisposable();\n\n package_deps().then(() => {\n setupTypeScript()\n }).catch((e) => {\n atom.notifications.addError(\"atom-ide-javascript failed in installing its dependencies.\")\n })\n}\n\n/**\n * install Atom package dependencies if not already loaded\n */\nasync function package_deps() {\n // Add entries from package-deps here manually\n // (to prevent loading atom-package-deps and package.json when the deps are already loaded)\n const deps = [\n \"atom-ide-base\",\n \"atom-typescript\",\n \"linter-eslint\",\n \"autocomplete-paths\",\n \"javascript-drag-import\"\n ];\n if (deps.some((p) => !atom.packages.isPackageLoaded(p))) {\n await import(\"atom-package-deps\").then((atom_package_deps) => {\n // install if not installed\n atom_package_deps.install(\"atom-ide-javascript\", false);\n // enable if disabled\n deps.filter((p) => !atom.packages.isPackageLoaded(p)).forEach(p => {\n atom.notifications.addInfo(`Enabling package ${p} that is needed for atom-ide-javascript`)\n atom.packages.enablePackage(p)\n })\n });\n }\n}\n\n/**\n * called by Atom when deactivating an extension\n */\nexport function deactivate() {\n if (subscriptions) {\n subscriptions.dispose();\n }\n subscriptions = null;\n}\n\n/**\n * called by IDE extensions to retrieve the service for registration\n * @return the current instance\n */\nexport function provideYourService() {}\n\nexport const config = {\n // doSomething: {\n // title: \"title\",\n // description: \"config description\",\n // type: \"boolean\", // 'number', 'string'\n // default: true,\n // },\n};\n","// This configures atom-typescript\nexport function setupTypeScript() {\n // use atom-typescript for javascript\n atom.config.set(\"atom-typescript.allowJS\", true)\n // disable check files which slows down Atom\n atom.config.set(\"atom-typescript.checkAllFilesOnSave\", false)\n // activate atom-typescript\n atom.commands.dispatch(atom.workspace.getElement(), \"typescript:activate\")\n}\n"],"names":["subscriptions","state","CompositeDisposable","async","deps","some","p","atom","packages","isPackageLoaded","Promise","then","atom_package_deps","install","filter","forEach","notifications","addInfo","enablePackage","package_deps","config","set","commands","dispatch","workspace","getElement","catch","e","addError","dispose"],"mappings":"gJAGA,IAAIA,mBAMG,SAAkBC,GAEvBD,EAAgB,IAAIE,sBAYtBC,uBAGQC,EAAQ,CACZ,gBACA,kBACA,gBACA,qBACA,0BAEEA,EAAKC,KAAMC,IAAOC,KAAKC,SAASC,gBAAgBH,WAC5CI,kDAAO,8DAAqBC,KAAMC,IAEtCA,EAAkBC,QAAQ,uBAAuB,GAEjDT,EAAKU,OAAQR,IAAOC,KAAKC,SAASC,gBAAgBH,IAAIS,QAAQT,IAC5DC,KAAKS,cAAcC,QAAS,oBAAmBX,4CAC/CC,KAAKC,SAASU,cAAcZ,OA3BlCa,GAAeR,KAAK,KCVpBJ,KAAKa,OAAOC,IAAI,2BAA2B,GAE3Cd,KAAKa,OAAOC,IAAI,uCAAuC,GAEvDd,KAAKe,SAASC,SAAShB,KAAKiB,UAAUC,aAAc,yBDQjDC,MAAOC,IACRpB,KAAKS,cAAcY,SAAS,gFA8CV,sBAbf,WACD5B,GACFA,EAAc6B,UAEhB7B,EAAgB,iCAOX"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 66a3579..95416d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "atom-ide-javascript", - "version": "1.2.0", + "version": "1.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 27d0067..acbf484 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-ide-javascript", "main": "dist/main.js", - "version": "1.2.0", + "version": "1.2.1", "author": "Amin Yahyaabadi", "description": " ", "keywords": [