@visulima/cerebro 1.1.21 → 1.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## @visulima/cerebro [1.1.23](https://github.com/visulima/visulima/compare/@visulima/cerebro@1.1.22...@visulima/cerebro@1.1.23) (2024-10-05)
2
+
3
+ ### Bug Fixes
4
+
5
+ * updated dev dependencies, updated packem to v1.0.7, fixed naming of some lint config files ([c071a9c](https://github.com/visulima/visulima/commit/c071a9c8e129014a962ff654a16f302ca18a5c67))
6
+
7
+
8
+ ### Dependencies
9
+
10
+ * **@visulima/boxen:** upgraded to 1.0.20
11
+ * **@visulima/colorize:** upgraded to 1.4.11
12
+ * **@visulima/find-cache-dir:** upgraded to 1.0.13
13
+ * **@visulima/pail:** upgraded to 2.1.10
14
+ * **@visulima/path:** upgraded to 1.1.0
15
+
16
+ ## @visulima/cerebro [1.1.22](https://github.com/visulima/visulima/compare/@visulima/cerebro@1.1.21...@visulima/cerebro@1.1.22) (2024-09-29)
17
+
18
+
19
+ ### Dependencies
20
+
21
+ * **@visulima/find-cache-dir:** upgraded to 1.0.12
22
+
1
23
  ## @visulima/cerebro [1.1.21](https://github.com/visulima/visulima/compare/@visulima/cerebro@1.1.20...@visulima/cerebro@1.1.21) (2024-09-24)
2
24
 
3
25
  ### Bug Fixes
package/LICENSE.md CHANGED
@@ -23,14 +23,11 @@ SOFTWARE.
23
23
  <!-- DEPENDENCIES -->
24
24
 
25
25
  # Licenses of bundled dependencies
26
-
27
26
  The published @visulima/cerebro artifact additionally contains code with the following licenses:
28
27
  MIT
29
28
 
30
29
  # Bundled dependencies:
31
-
32
30
  ## @visulima/path
33
-
34
31
  License: MIT
35
32
  By: Daniel Bannert
36
33
  Repository: git+https://github.com/visulima/visulima.git
@@ -104,6 +101,8 @@ Repository: git+https://github.com/visulima/visulima.git
104
101
  > OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
105
102
  > USE OR OTHER DEALINGS IN THE SOFTWARE.
106
103
  >
104
+ >
105
+ >
107
106
  > # Licenses of bundled dependencies
108
107
  >
109
108
  > The published @visulima/path artifact additionally contains code with the following licenses:
@@ -128,10 +127,9 @@ Repository: git+https://github.com/visulima/visulima.git
128
127
  > >
129
128
  > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
130
129
 
131
- ---
130
+ ---------------------------------------
132
131
 
133
132
  ## camelcase
134
-
135
133
  License: MIT
136
134
  By: Sindre Sorhus
137
135
  Repository: sindresorhus/camelcase
@@ -146,7 +144,7 @@ Repository: sindresorhus/camelcase
146
144
  >
147
145
  > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
148
146
 
149
- <!-- DEPENDENCIES -->
147
+ <!-- /DEPENDENCIES -->
150
148
 
151
149
  <!-- TYPE_DEPENDENCIES -->
152
- <!-- TYPE_DEPENDENCIES -->
150
+ <!-- /TYPE_DEPENDENCIES -->
@@ -1 +1 @@
1
- "use strict";var j=Object.defineProperty;var f=(e,n)=>j(e,"name",{value:n,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("node:fs"),O=require("@visulima/find-cache-dir"),S=require("node:https");var k=Object.defineProperty,P=f((e,n)=>k(e,"name",{value:n,configurable:!0}),"o$2");const A=P((e,n)=>{const r=e.split(".").map(Number),t=n.split(".").map(Number);for(const[o,s]of r.entries()){if(s>t[o])return!0;if(s<t[o])return!1}return!1},"semverGt");var x=Object.defineProperty,v=f((e,n)=>x(e,"name",{value:n,configurable:!0}),"u$1"),N=Object.defineProperty,_=v((e,n)=>N(e,"name",{value:n,configurable:!0}),"t");const C=/^[A-Z]:\//i,l=_((e="")=>e&&e.replaceAll("\\","/").replace(C,n=>n.toUpperCase()),"normalizeWindowsPath");var U=Object.defineProperty,c=v((e,n)=>U(e,"name",{value:n,configurable:!0}),"r");const D=/^[/\\]{2}/,E=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,b=/^[A-Z]:$/i,m=/^\/([A-Z]:)?$/i,L=/.(\.[^./]+)$/,Z=c(()=>typeof process<"u"&&typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd");/^win/i.test(globalThis.process?.platform);const y=c((e,n)=>{let r="",t=0,o=-1,s=0,a=null;for(let i=0;i<=e.length;++i){if(i<e.length)a=e[i];else{if(a==="/")break;a="/"}if(a==="/"){if(!(o===i-1||s===1))if(s===2){if(r.length<2||t!==2||!r.endsWith(".")||r.at(-2)!=="."){if(r.length>2){const u=r.lastIndexOf("/");u===-1?(r="",t=0):(r=r.slice(0,u),t=r.length-1-r.lastIndexOf("/")),o=i,s=0;continue}else if(r.length>0){r="",t=0,o=i,s=0;continue}}n&&(r+=r.length>0?"/..":"..",t=2)}else r.length>0?r+=`/${e.slice(o+1,i)}`:r=e.slice(o+1,i),t=i-o-1;o=i,s=0}else a==="."&&s!==-1?++s:s=-1}return r},"normalizeString"),d=c(e=>E.test(e),"isAbsolute"),z=c(function(e){if(e.length===0)return".";e=l(e);const n=D.exec(e),r=d(e),t=e.at(-1)==="/";return e=y(e,!r),e.length===0?r?"/":t?"./":".":(t&&(e+="/"),b.test(e)&&(e+="/"),n?r?`//${e}`:`//./${e}`:r&&!d(e)?`/${e}`:e)},"normalize"),T=c(function(...e){if(e.length===0)return".";let n;for(const r of e)r&&r.length>0&&(n===void 0?n=r:n+=`/${r}`);return n===void 0?".":z(n.replaceAll(/\/{2,}/g,"/"))},"join"),g=c(function(...e){e=e.map(t=>l(t));let n="",r=!1;for(let t=e.length-1;t>=-1&&!r;t--){const o=t>=0?e[t]:Z();!o||o.length===0||(n=`${o}/${n}`,r=d(o))}return n=y(n,!r),r&&!d(n)?`/${n}`:n.length>0?n:"."},"resolve");c(function(e){return l(e)},"toNamespacedPath");const q=c(function(e){return L.exec(l(e))?.[1]??""},"extname");c(function(e,n){const r=g(e).replace(m,"$1").split("/"),t=g(n).replace(m,"$1").split("/");if(t[0][1]===":"&&r[0][1]===":"&&r[0]!==t[0])return t.join("/");const o=[...r];for(const s of o){if(t[0]!==s)break;r.shift(),t.shift()}return[...r.map(()=>".."),...t].join("/")},"relative");const $=c(e=>{const n=l(e).replace(/\/$/,"").split("/").slice(0,-1);return n.length===1&&b.test(n[0])&&(n[0]+="/"),n.join("/")||(d(e)?"/":".")},"dirname");c(function(e){const n=[e.root,e.dir,e.base??e.name+e.ext].filter(Boolean);return l(e.root?g(...n):n.join("/"))},"format");const F=c((e,n)=>{const r=l(e).split("/").pop();return n&&r.endsWith(n)?r.slice(0,-n.length):r},"basename");c(function(e){let n=l(e).split("/").shift();n===""?n="/":n+="/";const r=F(e),t=q(r);return{base:r,dir:$(e),ext:t,name:r.slice(0,r.length-t.length),root:n}},"parse");var I=Object.defineProperty,h=f((e,n)=>I(e,"name",{value:n,configurable:!0}),"r");const J="last-update-check.json",w=h(e=>{const n=O.findCacheDirSync(e);if(n===void 0)throw new Error("Could not find cache directory");return T(n,J)},"getConfigFile"),M=h(e=>{const n=w(e);try{if(!p.existsSync(n))return;const{lastUpdateCheck:r}=JSON.parse(p.readFileSync(n,"utf8"));return r}catch{return}},"getLastUpdate"),W=h(e=>{const n=w(e),r=$(n);p.existsSync(r)||p.mkdirSync(r,{recursive:!0}),p.writeFileSync(n,JSON.stringify({lastUpdateCheck:Date.now()}))},"saveLastUpdate");var V=Object.defineProperty,B=f((e,n)=>V(e,"name",{value:n,configurable:!0}),"g");const G=B(async(e,n,r)=>{const t=r.replace("__NAME__",e);return await new Promise((o,s)=>{S.get(t,a=>{let i="";a.on("data",u=>i+=u),a.on("end",()=>{try{const u=JSON.parse(i)[n];u||s(new Error("Error getting version")),o(u)}catch{s(new Error("Could not parse version response"))}})}).on("error",a=>s(a))})},"getDistributionVersion");var R=Object.defineProperty,H=f((e,n)=>R(e,"name",{value:n,configurable:!0}),"i");const K=H(async({alwaysRun:e,debug:n,distTag:r="latest",pkg:t,registryUrl:o="https://registry.npmjs.org/-/package/__NAME__/dist-tags",updateCheckInterval:s=1e3*60*60*24})=>{const a=M(t.name);if(e||!a||a<Date.now()-s){const i=await G(t.name,r,o);if(W(t.name),A(i,t.version))return i;n&&console.error(`Latest version (${i}) not newer than current version (${t.version})`)}else n&&console.error(`Too recent to check for a new update. simpleUpdateNotifier() interval set to ${s}ms but only ${Date.now()-a}ms since last check.`);return null},"hasNewVersion");exports.default=K;
1
+ "use strict";var j=Object.defineProperty;var f=(e,n)=>j(e,"name",{value:n,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("node:fs"),O=require("@visulima/find-cache-dir"),S=require("node:https");var k=Object.defineProperty,P=f((e,n)=>k(e,"name",{value:n,configurable:!0}),"o$2");const A=P((e,n)=>{const r=e.split(".").map(Number),t=n.split(".").map(Number);for(const[o,s]of r.entries()){if(s>t[o])return!0;if(s<t[o])return!1}return!1},"semverGt");var x=Object.defineProperty,v=f((e,n)=>x(e,"name",{value:n,configurable:!0}),"u$1"),N=Object.defineProperty,_=v((e,n)=>N(e,"name",{value:n,configurable:!0}),"t");const C=/^[A-Z]:\//i,l=_((e="")=>e&&e.replaceAll("\\","/").replace(C,n=>n.toUpperCase()),"normalizeWindowsPath");var U=Object.defineProperty,c=v((e,n)=>U(e,"name",{value:n,configurable:!0}),"r");const D=/^[/\\]{2}/,E=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,b=/^[A-Z]:$/i,m=/^\/([A-Z]:)?$/i,L=/.(\.[^./]+)$/,Z=c(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd");/^win/i.test(globalThis.process?.platform);const $=c((e,n)=>{let r="",t=0,o=-1,s=0,a=null;for(let i=0;i<=e.length;++i){if(i<e.length)a=e[i];else{if(a==="/")break;a="/"}if(a==="/"){if(!(o===i-1||s===1))if(s===2){if(r.length<2||t!==2||!r.endsWith(".")||r.at(-2)!=="."){if(r.length>2){const u=r.lastIndexOf("/");u===-1?(r="",t=0):(r=r.slice(0,u),t=r.length-1-r.lastIndexOf("/")),o=i,s=0;continue}else if(r.length>0){r="",t=0,o=i,s=0;continue}}n&&(r+=r.length>0?"/..":"..",t=2)}else r.length>0?r+=`/${e.slice(o+1,i)}`:r=e.slice(o+1,i),t=i-o-1;o=i,s=0}else a==="."&&s!==-1?++s:s=-1}return r},"normalizeString"),d=c(e=>E.test(e),"isAbsolute"),z=c(function(e){if(e.length===0)return".";e=l(e);const n=D.exec(e),r=d(e),t=e.at(-1)==="/";return e=$(e,!r),e.length===0?r?"/":t?"./":".":(t&&(e+="/"),b.test(e)&&(e+="/"),n?r?`//${e}`:`//./${e}`:r&&!d(e)?`/${e}`:e)},"normalize"),T=c(function(...e){if(e.length===0)return".";let n;for(const r of e)r&&r.length>0&&(n===void 0?n=r:n+=`/${r}`);return n===void 0?".":z(n.replaceAll(/\/{2,}/g,"/"))},"join"),g=c(function(...e){e=e.map(t=>l(t));let n="",r=!1;for(let t=e.length-1;t>=-1&&!r;t--){const o=t>=0?e[t]:Z();!o||o.length===0||(n=`${o}/${n}`,r=d(o))}return n=$(n,!r),r&&!d(n)?`/${n}`:n.length>0?n:"."},"resolve");c(function(e){return l(e)},"toNamespacedPath");const q=c(function(e){return L.exec(l(e))?.[1]??""},"extname");c(function(e,n){const r=g(e).replace(m,"$1").split("/"),t=g(n).replace(m,"$1").split("/");if(t[0][1]===":"&&r[0][1]===":"&&r[0]!==t[0])return t.join("/");const o=[...r];for(const s of o){if(t[0]!==s)break;r.shift(),t.shift()}return[...r.map(()=>".."),...t].join("/")},"relative");const y=c(e=>{const n=l(e).replace(/\/$/,"").split("/").slice(0,-1);return n.length===1&&b.test(n[0])&&(n[0]+="/"),n.join("/")||(d(e)?"/":".")},"dirname");c(function(e){const n=[e.root,e.dir,e.base??e.name+e.ext].filter(Boolean);return l(e.root?g(...n):n.join("/"))},"format");const F=c((e,n)=>{const r=l(e).split("/").pop();return n&&r.endsWith(n)?r.slice(0,-n.length):r},"basename");c(function(e){let n=l(e).split("/").shift();n===""?n="/":n+="/";const r=F(e),t=q(r);return{base:r,dir:y(e),ext:t,name:r.slice(0,r.length-t.length),root:n}},"parse");var I=Object.defineProperty,h=f((e,n)=>I(e,"name",{value:n,configurable:!0}),"r");const J="last-update-check.json",w=h(e=>{const n=O.findCacheDirSync(e);if(n===void 0)throw new Error("Could not find cache directory");return T(n,J)},"getConfigFile"),M=h(e=>{const n=w(e);try{if(!p.existsSync(n))return;const{lastUpdateCheck:r}=JSON.parse(p.readFileSync(n,"utf8"));return r}catch{return}},"getLastUpdate"),W=h(e=>{const n=w(e),r=y(n);p.existsSync(r)||p.mkdirSync(r,{recursive:!0}),p.writeFileSync(n,JSON.stringify({lastUpdateCheck:Date.now()}))},"saveLastUpdate");var V=Object.defineProperty,B=f((e,n)=>V(e,"name",{value:n,configurable:!0}),"g");const G=B(async(e,n,r)=>{const t=r.replace("__NAME__",e);return await new Promise((o,s)=>{S.get(t,a=>{let i="";a.on("data",u=>i+=u),a.on("end",()=>{try{const u=JSON.parse(i)[n];u||s(new Error("Error getting version")),o(u)}catch{s(new Error("Could not parse version response"))}})}).on("error",a=>s(a))})},"getDistributionVersion");var R=Object.defineProperty,H=f((e,n)=>R(e,"name",{value:n,configurable:!0}),"i");const K=H(async({alwaysRun:e,debug:n,distTag:r="latest",pkg:t,registryUrl:o="https://registry.npmjs.org/-/package/__NAME__/dist-tags",updateCheckInterval:s=1e3*60*60*24})=>{const a=M(t.name);if(e||!a||a<Date.now()-s){const i=await G(t.name,r,o);if(W(t.name),A(i,t.version))return i;n&&console.error(`Latest version (${i}) not newer than current version (${t.version})`)}else n&&console.error(`Too recent to check for a new update. simpleUpdateNotifier() interval set to ${s}ms but only ${Date.now()-a}ms since last check.`);return null},"hasNewVersion");exports.default=K;
@@ -1 +1 @@
1
- var j=Object.defineProperty;var u=(e,n)=>j(e,"name",{value:n,configurable:!0});import{existsSync as h,readFileSync as O,mkdirSync as k,writeFileSync as A}from"node:fs";import{findCacheDirSync as P}from"@visulima/find-cache-dir";import{get as x}from"node:https";var N=Object.defineProperty,S=u((e,n)=>N(e,"name",{value:n,configurable:!0}),"o$2");const U=S((e,n)=>{const r=e.split(".").map(Number),t=n.split(".").map(Number);for(const[o,s]of r.entries()){if(s>t[o])return!0;if(s<t[o])return!1}return!1},"semverGt");var C=Object.defineProperty,v=u((e,n)=>C(e,"name",{value:n,configurable:!0}),"u$1"),_=Object.defineProperty,E=v((e,n)=>_(e,"name",{value:n,configurable:!0}),"t");const D=/^[A-Z]:\//i,l=E((e="")=>e&&e.replaceAll("\\","/").replace(D,n=>n.toUpperCase()),"normalizeWindowsPath");var L=Object.defineProperty,c=v((e,n)=>L(e,"name",{value:n,configurable:!0}),"r");const Z=/^[/\\]{2}/,z=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,$=/^[A-Z]:$/i,m=/^\/([A-Z]:)?$/i,F=/.(\.[^./]+)$/,I=c(()=>typeof process<"u"&&typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd");/^win/i.test(globalThis.process?.platform);const b=c((e,n)=>{let r="",t=0,o=-1,s=0,a=null;for(let i=0;i<=e.length;++i){if(i<e.length)a=e[i];else{if(a==="/")break;a="/"}if(a==="/"){if(!(o===i-1||s===1))if(s===2){if(r.length<2||t!==2||!r.endsWith(".")||r.at(-2)!=="."){if(r.length>2){const f=r.lastIndexOf("/");f===-1?(r="",t=0):(r=r.slice(0,f),t=r.length-1-r.lastIndexOf("/")),o=i,s=0;continue}else if(r.length>0){r="",t=0,o=i,s=0;continue}}n&&(r+=r.length>0?"/..":"..",t=2)}else r.length>0?r+=`/${e.slice(o+1,i)}`:r=e.slice(o+1,i),t=i-o-1;o=i,s=0}else a==="."&&s!==-1?++s:s=-1}return r},"normalizeString"),p=c(e=>z.test(e),"isAbsolute"),J=c(function(e){if(e.length===0)return".";e=l(e);const n=Z.exec(e),r=p(e),t=e.at(-1)==="/";return e=b(e,!r),e.length===0?r?"/":t?"./":".":(t&&(e+="/"),$.test(e)&&(e+="/"),n?r?`//${e}`:`//./${e}`:r&&!p(e)?`/${e}`:e)},"normalize"),T=c(function(...e){if(e.length===0)return".";let n;for(const r of e)r&&r.length>0&&(n===void 0?n=r:n+=`/${r}`);return n===void 0?".":J(n.replaceAll(/\/{2,}/g,"/"))},"join"),g=c(function(...e){e=e.map(t=>l(t));let n="",r=!1;for(let t=e.length-1;t>=-1&&!r;t--){const o=t>=0?e[t]:I();!o||o.length===0||(n=`${o}/${n}`,r=p(o))}return n=b(n,!r),r&&!p(n)?`/${n}`:n.length>0?n:"."},"resolve");c(function(e){return l(e)},"toNamespacedPath");const W=c(function(e){return F.exec(l(e))?.[1]??""},"extname");c(function(e,n){const r=g(e).replace(m,"$1").split("/"),t=g(n).replace(m,"$1").split("/");if(t[0][1]===":"&&r[0][1]===":"&&r[0]!==t[0])return t.join("/");const o=[...r];for(const s of o){if(t[0]!==s)break;r.shift(),t.shift()}return[...r.map(()=>".."),...t].join("/")},"relative");const y=c(e=>{const n=l(e).replace(/\/$/,"").split("/").slice(0,-1);return n.length===1&&$.test(n[0])&&(n[0]+="/"),n.join("/")||(p(e)?"/":".")},"dirname");c(function(e){const n=[e.root,e.dir,e.base??e.name+e.ext].filter(Boolean);return l(e.root?g(...n):n.join("/"))},"format");const M=c((e,n)=>{const r=l(e).split("/").pop();return n&&r.endsWith(n)?r.slice(0,-n.length):r},"basename");c(function(e){let n=l(e).split("/").shift();n===""?n="/":n+="/";const r=M(e),t=W(r);return{base:r,dir:y(e),ext:t,name:r.slice(0,r.length-t.length),root:n}},"parse");var V=Object.defineProperty,d=u((e,n)=>V(e,"name",{value:n,configurable:!0}),"r");const B="last-update-check.json",w=d(e=>{const n=P(e);if(n===void 0)throw new Error("Could not find cache directory");return T(n,B)},"getConfigFile"),G=d(e=>{const n=w(e);try{if(!h(n))return;const{lastUpdateCheck:r}=JSON.parse(O(n,"utf8"));return r}catch{return}},"getLastUpdate"),R=d(e=>{const n=w(e),r=y(n);h(r)||k(r,{recursive:!0}),A(n,JSON.stringify({lastUpdateCheck:Date.now()}))},"saveLastUpdate");var q=Object.defineProperty,H=u((e,n)=>q(e,"name",{value:n,configurable:!0}),"g");const K=H(async(e,n,r)=>{const t=r.replace("__NAME__",e);return await new Promise((o,s)=>{x(t,a=>{let i="";a.on("data",f=>i+=f),a.on("end",()=>{try{const f=JSON.parse(i)[n];f||s(new Error("Error getting version")),o(f)}catch{s(new Error("Could not parse version response"))}})}).on("error",a=>s(a))})},"getDistributionVersion");var Q=Object.defineProperty,X=u((e,n)=>Q(e,"name",{value:n,configurable:!0}),"i");const te=X(async({alwaysRun:e,debug:n,distTag:r="latest",pkg:t,registryUrl:o="https://registry.npmjs.org/-/package/__NAME__/dist-tags",updateCheckInterval:s=1e3*60*60*24})=>{const a=G(t.name);if(e||!a||a<Date.now()-s){const i=await K(t.name,r,o);if(R(t.name),U(i,t.version))return i;n&&console.error(`Latest version (${i}) not newer than current version (${t.version})`)}else n&&console.error(`Too recent to check for a new update. simpleUpdateNotifier() interval set to ${s}ms but only ${Date.now()-a}ms since last check.`);return null},"hasNewVersion");export{te as default};
1
+ var j=Object.defineProperty;var u=(e,n)=>j(e,"name",{value:n,configurable:!0});import{existsSync as h,readFileSync as O,mkdirSync as k,writeFileSync as A}from"node:fs";import{findCacheDirSync as P}from"@visulima/find-cache-dir";import{get as x}from"node:https";var N=Object.defineProperty,S=u((e,n)=>N(e,"name",{value:n,configurable:!0}),"o$2");const U=S((e,n)=>{const r=e.split(".").map(Number),t=n.split(".").map(Number);for(const[o,s]of r.entries()){if(s>t[o])return!0;if(s<t[o])return!1}return!1},"semverGt");var C=Object.defineProperty,v=u((e,n)=>C(e,"name",{value:n,configurable:!0}),"u$1"),_=Object.defineProperty,E=v((e,n)=>_(e,"name",{value:n,configurable:!0}),"t");const D=/^[A-Z]:\//i,l=E((e="")=>e&&e.replaceAll("\\","/").replace(D,n=>n.toUpperCase()),"normalizeWindowsPath");var L=Object.defineProperty,c=v((e,n)=>L(e,"name",{value:n,configurable:!0}),"r");const Z=/^[/\\]{2}/,z=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,$=/^[A-Z]:$/i,m=/^\/([A-Z]:)?$/i,F=/.(\.[^./]+)$/,I=c(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd");/^win/i.test(globalThis.process?.platform);const b=c((e,n)=>{let r="",t=0,o=-1,s=0,a=null;for(let i=0;i<=e.length;++i){if(i<e.length)a=e[i];else{if(a==="/")break;a="/"}if(a==="/"){if(!(o===i-1||s===1))if(s===2){if(r.length<2||t!==2||!r.endsWith(".")||r.at(-2)!=="."){if(r.length>2){const f=r.lastIndexOf("/");f===-1?(r="",t=0):(r=r.slice(0,f),t=r.length-1-r.lastIndexOf("/")),o=i,s=0;continue}else if(r.length>0){r="",t=0,o=i,s=0;continue}}n&&(r+=r.length>0?"/..":"..",t=2)}else r.length>0?r+=`/${e.slice(o+1,i)}`:r=e.slice(o+1,i),t=i-o-1;o=i,s=0}else a==="."&&s!==-1?++s:s=-1}return r},"normalizeString"),p=c(e=>z.test(e),"isAbsolute"),J=c(function(e){if(e.length===0)return".";e=l(e);const n=Z.exec(e),r=p(e),t=e.at(-1)==="/";return e=b(e,!r),e.length===0?r?"/":t?"./":".":(t&&(e+="/"),$.test(e)&&(e+="/"),n?r?`//${e}`:`//./${e}`:r&&!p(e)?`/${e}`:e)},"normalize"),T=c(function(...e){if(e.length===0)return".";let n;for(const r of e)r&&r.length>0&&(n===void 0?n=r:n+=`/${r}`);return n===void 0?".":J(n.replaceAll(/\/{2,}/g,"/"))},"join"),g=c(function(...e){e=e.map(t=>l(t));let n="",r=!1;for(let t=e.length-1;t>=-1&&!r;t--){const o=t>=0?e[t]:I();!o||o.length===0||(n=`${o}/${n}`,r=p(o))}return n=b(n,!r),r&&!p(n)?`/${n}`:n.length>0?n:"."},"resolve");c(function(e){return l(e)},"toNamespacedPath");const W=c(function(e){return F.exec(l(e))?.[1]??""},"extname");c(function(e,n){const r=g(e).replace(m,"$1").split("/"),t=g(n).replace(m,"$1").split("/");if(t[0][1]===":"&&r[0][1]===":"&&r[0]!==t[0])return t.join("/");const o=[...r];for(const s of o){if(t[0]!==s)break;r.shift(),t.shift()}return[...r.map(()=>".."),...t].join("/")},"relative");const y=c(e=>{const n=l(e).replace(/\/$/,"").split("/").slice(0,-1);return n.length===1&&$.test(n[0])&&(n[0]+="/"),n.join("/")||(p(e)?"/":".")},"dirname");c(function(e){const n=[e.root,e.dir,e.base??e.name+e.ext].filter(Boolean);return l(e.root?g(...n):n.join("/"))},"format");const M=c((e,n)=>{const r=l(e).split("/").pop();return n&&r.endsWith(n)?r.slice(0,-n.length):r},"basename");c(function(e){let n=l(e).split("/").shift();n===""?n="/":n+="/";const r=M(e),t=W(r);return{base:r,dir:y(e),ext:t,name:r.slice(0,r.length-t.length),root:n}},"parse");var V=Object.defineProperty,d=u((e,n)=>V(e,"name",{value:n,configurable:!0}),"r");const B="last-update-check.json",w=d(e=>{const n=P(e);if(n===void 0)throw new Error("Could not find cache directory");return T(n,B)},"getConfigFile"),G=d(e=>{const n=w(e);try{if(!h(n))return;const{lastUpdateCheck:r}=JSON.parse(O(n,"utf8"));return r}catch{return}},"getLastUpdate"),R=d(e=>{const n=w(e),r=y(n);h(r)||k(r,{recursive:!0}),A(n,JSON.stringify({lastUpdateCheck:Date.now()}))},"saveLastUpdate");var q=Object.defineProperty,H=u((e,n)=>q(e,"name",{value:n,configurable:!0}),"g");const K=H(async(e,n,r)=>{const t=r.replace("__NAME__",e);return await new Promise((o,s)=>{x(t,a=>{let i="";a.on("data",f=>i+=f),a.on("end",()=>{try{const f=JSON.parse(i)[n];f||s(new Error("Error getting version")),o(f)}catch{s(new Error("Could not parse version response"))}})}).on("error",a=>s(a))})},"getDistributionVersion");var Q=Object.defineProperty,X=u((e,n)=>Q(e,"name",{value:n,configurable:!0}),"i");const te=X(async({alwaysRun:e,debug:n,distTag:r="latest",pkg:t,registryUrl:o="https://registry.npmjs.org/-/package/__NAME__/dist-tags",updateCheckInterval:s=1e3*60*60*24})=>{const a=G(t.name);if(e||!a||a<Date.now()-s){const i=await K(t.name,r,o);if(R(t.name),U(i,t.version))return i;n&&console.error(`Latest version (${i}) not newer than current version (${t.version})`)}else n&&console.error(`Too recent to check for a new update. simpleUpdateNotifier() interval set to ${s}ms but only ${Date.now()-a}ms since last check.`);return null},"hasNewVersion");export{te as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/cerebro",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "description": "A delightful toolkit for building Node-powered CLIs.",
5
5
  "keywords": [
6
6
  "command",
@@ -86,10 +86,10 @@
86
86
  "LICENSE.md"
87
87
  ],
88
88
  "dependencies": {
89
- "@visulima/boxen": "1.0.19",
90
- "@visulima/colorize": "1.4.10",
91
- "@visulima/find-cache-dir": "1.0.11",
92
- "@visulima/pail": "2.1.9",
89
+ "@visulima/boxen": "1.0.20",
90
+ "@visulima/colorize": "1.4.11",
91
+ "@visulima/find-cache-dir": "1.0.13",
92
+ "@visulima/pail": "2.1.10",
93
93
  "cli-table3": "^0.6.5",
94
94
  "command-line-args": "^6.0.0",
95
95
  "fastest-levenshtein": "^1.0.16"
@@ -100,7 +100,7 @@
100
100
  "@anolilab/semantic-release-pnpm": "^1.1.3",
101
101
  "@anolilab/semantic-release-preset": "^9.0.0",
102
102
  "@arethetypeswrong/cli": "^0.16.4",
103
- "@babel/core": "^7.25.2",
103
+ "@babel/core": "^7.25.7",
104
104
  "@eslint-types/deprecation": "^2.0.0",
105
105
  "@eslint-types/import": "^2.29.1",
106
106
  "@eslint-types/jsdoc": "^48.2.2",
@@ -111,9 +111,9 @@
111
111
  "@types/command-line-args": "^5.2.3",
112
112
  "@types/node": "18.19.15",
113
113
  "@visulima/nextra-theme-docs": "4.0.26",
114
- "@visulima/packem": "1.0.1",
115
- "@visulima/path": "1.0.9",
116
- "@vitest/coverage-v8": "^2.1.1",
114
+ "@visulima/packem": "1.0.7",
115
+ "@visulima/path": "1.1.0",
116
+ "@vitest/coverage-v8": "^2.1.2",
117
117
  "camelcase": "8.0.0",
118
118
  "conventional-changelog-conventionalcommits": "8.0.0",
119
119
  "cross-env": "^7.0.3",
@@ -127,9 +127,8 @@
127
127
  "prettier": "^3.3.3",
128
128
  "rimraf": "5.0.9",
129
129
  "semantic-release": "24.0.0",
130
- "strip-ansi": "^7.1.0",
131
130
  "typescript": "5.4.5",
132
- "vitest": "^2.1.1"
131
+ "vitest": "^2.1.2"
133
132
  },
134
133
  "engines": {
135
134
  "node": ">=18.* <=22.*"