@baicie/ncu 0.1.31 → 0.2.0
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/README.md +16 -0
- package/dist/cjs/chunks/src.cjs +59 -59
- package/dist/cjs/chunks/src.cjs.map +1 -1
- package/dist/cjs/chunks/strip-ansi.cjs.map +1 -1
- package/dist/cjs/cli.cjs +1 -1
- package/dist/cjs/cli.cjs.map +1 -1
- package/dist/esm/chunks/src.mjs +59 -59
- package/dist/esm/chunks/src.mjs.map +1 -1
- package/dist/esm/chunks/strip-ansi.mjs.map +1 -1
- package/dist/esm/cli.mjs.map +1 -1
- package/dist/esm/index.d.mts +11 -0
- package/package.json +35 -33
package/dist/cjs/chunks/src.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let u=require(`path`);u=l(u);let d=require(`prompts-ncu`);d=l(d);let f=require(`spawn-please`);f=l(f);let p=require(`fs`);p=l(p);let m=require(`os`);m=l(m);let h=require(`cli-table3`);h=l(h);let g=require(`fs/promises`);g=l(g);let _=require(`hosted-git-info`);_=l(_);let v=require(`url`),y=require(`parse-github-url`);y=l(y);let b=require(`semver`);b=l(b);let x=require(`semver-utils`);x=l(x);let S=require(`util`);S=l(S);let C=require(`camelcase`);C=l(C);let w=require(`fast-memoize`);w=l(w);let T=require(`ini`);T=l(T);let E=require(`npm-registry-fetch`);E=l(E);let D=require(`untildify`);D=l(D);let O=require(`find-up`),k=require(`node:fs`);k=l(k);let A=require(`node:os`);A=l(A);let j=require(`node:path`);j=l(j);let M=require(`js-yaml`);M=l(M);let N=require(`jsonlines`);N=l(N);let ee=require(`node:stream/consumers`),te=require(`fast-glob`);te=l(te);let ne=require(`picomatch`);ne=l(ne);let re=require(`rc-config-loader`),ie=require(`dequal`),ae=require(`node:child_process`);ae=l(ae);let oe=require(`node:util`),se=require(`fp-and-or`),ce=require(`p-map`);ce=l(ce);let le=require(`progress`);le=l(le);let ue=require(`jsonc-parser`);var de=`0.1.31`,fe=`https://github.com/baicie/npm-check-updates`,pe={url:`https://github.com/raineorshine/npm-check-updates/issues`},me={name:`@baicie/ncu`,version:de,author:`Tomas Junnonen <tomas1@gmail.com>`,license:`Apache-2.0`,type:`module`,contributors:[`Raine Revere (https://github.com/raineorshine)`,`Imamuzzaki Abu Salam <imamuzzaki@gmail.com>`],description:`Find newer versions of dependencies than what your package.json allows`,keywords:[`dependencies`,`npm`,`package.json`,`update`,`upgrade`,`versions`],engines:{node:`>=20.0.0`,npm:`>=8.12.1`},main:`dist/cjs/index.cjs`,types:`dist/esm/index.mjs`,exports:{".":{types:`./dist/esm/index.d.mts`,module:`./dist/esm/index.mjs`,import:`./dist/esm/index.mjs`,require:`./dist/esm/index.cjs`}},scripts:{dev:`rolldown --watch -c`,build:`rimraf dist && npm run build:options && rolldown -m -c`,"build:options":`vite-node src/scripts/build-options.ts`,"build:analyze":`rimraf dist && npm run build:options && ANALYZER=true vite build`,lint:`cross-env FORCE_COLOR=1 npm-run-all --parallel --aggregate-output lint:*`,"lint:markdown":`markdownlint "**/*.md" --ignore "**/node_modules/**/*.md" --ignore build --config .markdownlint.cjs`,"lint:src":`eslint --cache`,"type-check":`tsc --noEmit --incremental`,prepublishOnly:`npm run build`,prettier:`prettier . --check`,"prettier:fix":`prettier . --write`,test:`npm run test:unit && npm run test:e2e`,"test:bun":`test/bun-install.sh && mocha test/bun`,"test:unit":`mocha test test/package-managers/*`,"test:e2e":`./test/e2e.sh`,ncu:`node dist/cjs/cli.cjs`,release:`tsx scripts/release.ts`,"ci-publish":`tsx scripts/publish.ts`,prepare:`simple-git-hooks`},"simple-git-hooks":{"pre-commit":`pnpm lint-staged`,"commit-msg":`node -e "import('@baicie/scripts').then(m => m.verifyCommit())"`},"lint-staged":{"*.{js,json}":[`prettier --write`],"*.ts?(x)":[`eslint --fix`,`prettier --parser=typescript --write`]},bin:{"npm-check-updates":`dist/cjs/cli.cjs`,ncu:`dist/cjs/cli.cjs`},repository:{type:`git`,url:`git+https://github.com/baicie/npm-check-updates.git`},homepage:fe,bugs:pe,overrides:{ip:`2.0.1`,jsonparse:`https://github.com/ARitz-Cracker/jsonparse/tree/patch-1`,"@yarnpkg/parsers":`2.6.0`},dependencies:{camelcase:`^9.0.0`,chalk:`^5.6.2`,"cli-table3":`^0.6.5`,commander:`^14.0.3`,dequal:`^2.0.3`,"fast-glob":`^3.3.3`,"fast-memoize":`^2.5.2`,"find-up":`8.0.0`,"fp-and-or":`^1.0.2`,"hosted-git-info":`^9.0.2`,ini:`^6.0.0`,"js-yaml":`^4.1.1`,"jsonc-parser":`^3.3.1`,jsonlines:`^0.1.1`,lodash:`^4.17.23`,"npm-registry-fetch":`^19.1.1`,"p-map":`^7.0.4`,"parse-github-url":`^1.0.3`,picomatch:`^4.0.3`,progress:`^2.0.3`,"prompts-ncu":`^3.0.2`,"rc-config-loader":`^4.1.4`,rfdc:`^1.4.1`,semver:`^7.7.4`,"semver-utils":`^1.1.4`,"spawn-please":`^3.0.0`,untildify:`^6.0.0`,"update-notifier":`^7.3.1`},devDependencies:{"@baicie/release":`^0.1.11`,"@baicie/scripts":`^0.1.2`,"@eslint/js":`^10.0.1`,"@trivago/prettier-plugin-sort-imports":`^6.0.2`,"@types/bun":`^1.3.11`,"@types/chai":`^5.2.3`,"@types/chai-as-promised":`^8.0.2`,"@types/chai-string":`^1.4.5`,"@types/cli-table":`^0.3.4`,"@types/hosted-git-info":`^3.0.5`,"@types/ini":`^4.1.1`,"@types/js-yaml":`^4.0.9`,"@types/jsonlines":`^0.1.5`,"@types/lodash":`^4.17.24`,"@types/mocha":`^10.0.10`,"@types/node":`^25.5.0`,"@types/npm-registry-fetch":`^8.0.9`,"@types/parse-github-url":`^1.0.3`,"@types/picomatch":`^4.0.2`,"@types/progress":`^2.0.7`,"@types/prompts":`^2.4.9`,"@types/semver":`^7.7.1`,"@types/semver-utils":`^1.1.3`,"@types/sinon":`^21.0.0`,"@types/update-notifier":`^6.0.8`,"@typescript-eslint/eslint-plugin":`^8.57.1`,"@typescript-eslint/parser":`^8.57.1`,chai:`^6.2.2`,"chai-as-promised":`^8.0.2`,"chai-string":`^1.6.0`,"cross-env":`^10.1.0`,eslint:`^10.1.0`,"eslint-config-prettier":`^10.1.8`,"eslint-config-raine":`^0.5.0`,"eslint-config-standard":`^17.1.0`,"eslint-plugin-import":`^2.32.0`,"eslint-plugin-jsdoc":`^62.8.0`,"eslint-plugin-n":`^17.24.0`,"eslint-plugin-promise":`^7.2.1`,"lint-staged":`^16.4.0`,"markdownlint-cli":`^0.48.0`,mocha:`^11.7.5`,"npm-run-all":`^4.1.5`,prettier:`^3.8.1`,rimraf:`^6.1.3`,rolldown:`1.0.0-rc.10`,"rolldown-plugin-dts":`^0.22.5`,"rollup-plugin-node-externals":`^8.1.2`,"rollup-plugin-visualizer":`^7.0.1`,should:`^13.2.3`,"simple-git-hooks":`^2.13.1`,sinon:`^21.0.3`,"source-map-support":`^0.5.21`,"strip-ansi":`^7.2.0`,"ts-node":`^10.9.2`,tsx:`^4.21.0`,typescript:`^5.9.3`,"typescript-eslint":`^8.57.1`,"typescript-json-schema":`^0.67.1`,verdaccio:`^6.3.2`,vite:`^8.0.1`,"vite-bundle-analyzer":`^1.3.6`,"vite-node":`^6.0.0`,"vite-plugin-dts":`^4.5.4`,yarn:`^1.22.22`},files:[`dist`,`!**/test/**`],mocha:{"check-leaks":!0,extension:[`test.ts`],require:[`source-map-support/register`,`ts-node/register`],timeout:6e4,"trace-deprecation":!0,"trace-warnings":!0,use_strict:!0},packageManager:`pnpm@10.32.1`,publishConfig:{access:`public`,registry:`https://registry.npmjs.org/`}};function P(e,t,n={}){let r=Array.isArray(e);return t||=(e=>({[e]:!0})),Object.entries(e||{}).forEach(([e,i],a)=>{let o=r?t(i,a,n):t(e,i,n);Object.entries(o||{}).forEach(e=>{n[e[0]]=e[1]})}),n}const he={blue:!0,bold:!0,cyan:!0,gray:!0,green:!0,magenta:!0,red:!0,yellow:!0},ge=P(he,e=>({[e]:e=>e.toString()}));let _e;const ve=async e=>{let{default:t,Chalk:n}=await import(`chalk`);_e=e===!0?new n({level:1}):e===null?ge:t},ye=()=>{if(!_e)throw Error(`Chalk has not been imported yet. Chalk is a dynamic import and requires that you await { chalkInit } from './lib/chalk'.`)},F=P(he,e=>{let t=t=>(ye(),_e[e].bold(t)),n=t=>(ye(),_e[e](t));return n.bold=t,{[e]:n}}),I=(e,t)=>P(e,(e,n)=>t(e,n)?{[e]:n}:null),be=e=>g.default.stat(e).then(()=>!0,()=>!1);async function xe(e,{pkgFile:t}={}){let n=require.resolve.paths(e)||[],r=t?[u.default.join(u.default.dirname(t),`node_modules`)]:[],i=[u.default.join(process.cwd(),`node_modules`)],a=[...r,...i,...n];for(let t of a){let n=u.default.join(t,e,`package.json`);if(await be(n))try{return JSON.parse(await g.default.readFile(n,`utf-8`))}catch{}}return null}async function Se(e,t,{pkgFile:n}={}){return t?t.version:(await xe(e,{pkgFile:n}))?.version??null}async function Ce(e,{pkgFile:t}={}){return(await xe(e,{pkgFile:t}))?.repository??null}async function we(e,t,{pkgFile:n}={}){let r=t?t.repository?t.repository:null:await Ce(e,{pkgFile:n});if(!r)return null;let i,a=``;if(typeof r==`string`){i=r;try{let e=new v.URL(i);if(e.protocol===`https:`||e.protocol===`http:`)return i}catch{}}else typeof r.url==`string`&&(i=r.url,typeof r.directory==`string`&&(a=r.directory));if(typeof i==`string`&&typeof a==`string`){let e=_.default.fromUrl(i)?.browse(a);return e===void 0?i:e.replace(/\/$/,``).replace(/\/tree\/HEAD$/,``)}return null}var L=o(((e,t)=>{t.exports=Array.isArray})),Te=o(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),R=o(((e,t)=>{var n=Te(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),Ee=o(((e,t)=>{t.exports=R().Symbol})),De=o(((e,t)=>{var n=Ee(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),Oe=o(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),ke=o(((e,t)=>{var n=Ee(),r=De(),i=Oe(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),Ae=o(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),je=o(((e,t)=>{var n=ke(),r=Ae(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),Me=o(((e,t)=>{var n=L(),r=je(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),Ne=o(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),Pe=o(((e,t)=>{var n=ke(),r=Ne(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),Fe=o(((e,t)=>{t.exports=R()[`__core-js_shared__`]})),Ie=o(((e,t)=>{var n=Fe(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),Le=o(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),Re=o(((e,t)=>{var n=Pe(),r=Ie(),i=Ne(),a=Le(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),ze=o(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),Be=o(((e,t)=>{var n=Re(),r=ze();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),Ve=o(((e,t)=>{t.exports=Be()(Object,`create`)})),He=o(((e,t)=>{var n=Ve();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),Ue=o(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.exports=n})),We=o(((e,t)=>{var n=Ve(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),Ge=o(((e,t)=>{var n=Ve(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),Ke=o(((e,t)=>{var n=Ve(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=n&&t===void 0?r:t,this}t.exports=i})),qe=o(((e,t)=>{var n=He(),r=Ue(),i=We(),a=Ge(),o=Ke();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Je=o(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),Ye=o(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),Xe=o(((e,t)=>{var n=Ye();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),Ze=o(((e,t)=>{var n=Xe(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),Qe=o(((e,t)=>{var n=Xe();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),$e=o(((e,t)=>{var n=Xe();function r(e){return n(this.__data__,e)>-1}t.exports=r})),et=o(((e,t)=>{var n=Xe();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),tt=o(((e,t)=>{var n=Je(),r=Ze(),i=Qe(),a=$e(),o=et();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),nt=o(((e,t)=>{t.exports=Be()(R(),`Map`)})),rt=o(((e,t)=>{var n=qe(),r=tt(),i=nt();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),it=o(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),at=o(((e,t)=>{var n=it();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),ot=o(((e,t)=>{var n=at();function r(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}t.exports=r})),st=o(((e,t)=>{var n=at();function r(e){return n(this,e).get(e)}t.exports=r})),ct=o(((e,t)=>{var n=at();function r(e){return n(this,e).has(e)}t.exports=r})),lt=o(((e,t)=>{var n=at();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),ut=o(((e,t)=>{var n=rt(),r=ot(),i=st(),a=ct(),o=lt();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),dt=o(((e,t)=>{var n=ut(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),ft=o(((e,t)=>{var n=dt(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),pt=o(((e,t)=>{var n=ft(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),mt=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),ht=o(((e,t)=>{var n=Ee(),r=mt(),i=L(),a=je(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),gt=o(((e,t)=>{var n=ht();function r(e){return e==null?``:n(e)}t.exports=r})),_t=o(((e,t)=>{var n=L(),r=Me(),i=pt(),a=gt();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),vt=o(((e,t)=>{var n=je(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),yt=o(((e,t)=>{var n=_t(),r=vt();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),bt=o(((e,t)=>{var n=yt();function r(e){return function(t){return e==null?void 0:n(e,t)}}t.exports=r}));function xt(e,t){return e?e.map(e=>({item:e,key:t(e)})).sort((e,t)=>e.key>t.key?1:e.key<t.key?-1:0).map(({item:e})=>e):[]}var St=l(bt(),1);const Ct=[`major`,`minor`,`patch`],wt=[`release`,`build`],Tt=[...Ct,...wt],Et={major:``,minor:`.`,patch:`.`,release:`-`,build:`+`},Dt=[`^`,`~`,`.*`,`.x`],Ot=RegExp(`^(${[`^`,`~`,`^*`,`*`,`x`,`x.x`,`x.x.x`].join(`|`).replace(/\^/g,`\\^`).replace(/\*/g,`\\*`)})$`),kt=/^npm:(.*)@(.*)/;function At(e){let[t]=x.default.parseRange(e);if(!t)throw Error(S.default.format(`semverutils.parseRange returned null when trying to parse "%s". This is probably a problem with the "semver-utils" dependency. Please report an issue at https://github.com/raineorshine/npm-check-updates/issues.`,e));return Tt.reduce((e,n)=>t[n]?e+1:e,0)}function z(e,t){return(t?Tt.slice(0,Tt.indexOf(t)+1):Tt).filter(n=>t&&Ct.includes(t)||e[n]).map(t=>Et[t]+(e[t]||`0`)).join(``)}function jt(e){let[t]=x.default.parseRange(e);return Tt.slice().reverse().find((0,St.default)(t))}function Mt(e,t){let[n]=x.default.parseRange(e);return z(n,t)}function Nt(e,t){return t===`^`||t===`~`?t+e:Mt(e,`major`)+t}function Pt(e){return Ot.test(e)}function Ft(e){return e===`*`||e===`x`}function It(e,t){if(e===t)return`none`;/^[~^]/.test(t)&&t[0]===e[0]&&(t=t.slice(1),e=e.slice(1));let n=t.split(`.`),r=e.split(`.`),i=n.findIndex((e,t)=>e!==r[t]);return i=i>=0?i:n.length,n[0]===`0`?`majorVersionZero`:i===0?`major`:i===1?`minor`:`patch`}function Lt(e,t,n){let r=P(e,(r,i,a)=>{let o=t[r],s=It(o,i),c=n.groupFunction?.(r,s,(0,x.parseRange)(o),(0,x.parseRange)(i),(0,x.parse)(e[r]))??s;return c===`none`?a:{...a,[c]:{...a[c],[r]:i}}}),i={patch:F.green(F.bold(`Patch`)+` Backwards-compatible bug fixes`),minor:F.cyan(F.bold(`Minor`)+` Backwards-compatible features`),major:F.red(F.bold(`Major`)+` Potentially breaking API changes`),majorVersionZero:F.magenta(F.bold(`Major version zero`)+` Anything may change`)};return Array.from(new Set([`patch`,`minor`,`major`,`majorVersionZero`,...Object.keys(r).sort()])).filter(e=>e in r).map(e=>({groupName:e,heading:e in i?i[e]:e,packages:r[e]}))}function Rt(e,t){let n=``;/^[~^]/.test(t)&&t[0]===e[0]&&(n=t[0],t=t.slice(1),e=e.slice(1));let r=t.split(`.`),i=e.split(`.`),a=r.findIndex((e,t)=>e!==i[t]);a=a>=0?a:r.length;let o=a===0||r[0]===`0`?`red`:a===1?`cyan`:`green`;try{let n=b.default.valid(e)?e:b.default.minVersion(e)?.version??null,r=b.default.valid(t)?t:b.default.minVersion(t)?.version??null;n&&r&&b.default.gt(n,r)&&(o=`yellow`)}catch{}let s=a>0&&a<r.length?`.`:``;return n+r.slice(0,a).join(`.`)+s+F[o](r.slice(a).join(`.`))}const zt=e=>{let t=b.default.prerelease(e);return t&&t.slice(0,-1).join(`.`)};function Bt(e,t){let n=zt(e),r=zt(t);return typeof n!=`string`||typeof r!=`string`||n===r}function Vt(e,t){return(b.default.valid(e)&&b.default.valid(t)?b.default.gt(e,t):e>t)?1:e===t?0:-1}function Ht(e,t,n){if(!b.default.validRange(t))return null;let r=b.default.minVersion(t);return[...e].sort(Vt).filter(e=>{let t=b.default.parse(e);return t&&(n===`major`||t.major===r?.major)&&(n===`major`||n===`minor`||t.minor===r?.minor)}).at(-1)||null}function Ut(e){return jt(e)===`release`}const Wt=e=>/^[vV]?\d+$/.test(e),Gt=e=>/^[vV]?\d+\.\d+$/.test(e),Kt=e=>e.replace(/^[vV]/,``),qt=e=>Wt(e)?e+`.0.0`:e,Jt=e=>Gt(e)?e+`.0`:e,Yt=e=>Jt(qt(Kt(e)));function Xt(e){return e&&(e[0]===`v`||e[1]===`v`)?`v`:``}const Zt=(e,t)=>`npm:${e}@${t}`,Qt=e=>{let t=e&&e.match&&e.match(kt);return t&&t.slice(1)},$t=e=>e&&!!e.match(kt),en=(e,t)=>{let n=Qt(e);return n?Zt(n[0],t):null},tn=e=>{if(!e)return!1;let t=null;try{t=(0,y.default)(e)}catch{}if(!t||!t.branch)return!1;let n=decodeURIComponent(t.branch).replace(/^semver:/,``);return!!b.default.validRange(n)},nn=e=>{if(!e)return null;let t=(0,y.default)(e);if(!t||!t.branch)return null;let n=decodeURIComponent(t.branch).replace(/^semver:/,``);return t&&t.branch&&b.default.validRange(n)?n:null};function rn(e,t,n={}){if(n.wildcard=n.wildcard||`^`,!t)return e;let[r]=x.default.parseRange(t);if(!r)return e;if(n.removeRange)return t;if(Pt(e))return e;let i=xt(x.default.parseRange(e).filter(e=>e.operator!==`||`&&e.operator!==`-`),e=>At(z(e))),[a]=i;function o(e){return(Ft(a[e])?a[e]:Ct.includes(e)&&a[e]||wt.includes(e)?r[e]:null)||null}let s=z(P(Tt,e=>({[e]:o(e)}))),c=Xt(a.semver)+s,l=Array.from(new Set(i.map(e=>e.operator))),u=l[0]||``,d=Dt.some(e=>s.includes(e)),f=l[0]===`<`||l[0]===`<=`,p=l[0]===`>`,m=l.length>1;return!d&&(f||m)?Nt(c,n.wildcard):(p?`>=`:u)+c}const an=(e,t)=>{let n=Xt(e),r=n?n+t:t;return r=Wt(e)?r.slice(0,r.length-4):r,r=Gt(e)?r.slice(0,r.length-2):r,r},on=(e,t)=>{let n=Yt(t),r=(0,y.default)(e);if(!r)return e;let i=decodeURIComponent(r.branch).replace(/^semver:/,``);return e.replace(i,rn(i,an(i,n)))},sn={silent:0,error:1,minimal:2,warn:3,info:4,verbose:5,silly:6},cn=e=>!e.startsWith(`file:`)&&!e.startsWith(`link:`)&&!e.startsWith(`workspace:`)&&!/^[^/:@]+\/\w+/.test(e);function B(e,t,n=null,r=`log`){!e.json&&e.loglevel!==`silent`&&(n==null||sn[e.loglevel??`warn`]>=sn[n])&&console[r](t)}function ln(e,t){e.loglevel!==`silent`&&console.log(JSON.stringify(t,null,2))}function un(e,t){console.log(Object.keys(e).map(t=>t+`@`+e[t]).join(t))}function V(e,t,n){B(e,Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}),n)}function dn(e){let t=new h.default({colAligns:[`left`,`right`,`right`,`right`,`left`,`left`],chars:{top:``,"top-mid":``,"top-left":``,"top-right":``,bottom:``,"bottom-mid":``,"bottom-left":``,"bottom-right":``,left:``,"left-mid":``,mid:``,"mid-mid":``,right:``,"right-mid":``,middle:``}});return t.push(...e),t.toString().split(`
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let u=require(`path`);u=l(u,1);let d=require(`prompts-ncu`);d=l(d,1);let f=require(`spawn-please`);f=l(f,1);let p=require(`fs`);p=l(p,1);let m=require(`os`);m=l(m,1);let h=require(`cli-table3`);h=l(h,1);let g=require(`fs/promises`);g=l(g,1);let _=require(`hosted-git-info`);_=l(_,1);let v=require(`url`),y=require(`parse-github-url`);y=l(y,1);let b=require(`semver`);b=l(b,1);let x=require(`semver-utils`);x=l(x,1);let S=require(`util`);S=l(S,1);let C=require(`camelcase`);C=l(C,1);let w=require(`fast-memoize`);w=l(w,1);let T=require(`ini`);T=l(T,1);let E=require(`npm-registry-fetch`);E=l(E,1);let D=require(`untildify`);D=l(D,1);let O=require(`find-up`),k=require(`node:fs`);k=l(k,1);let A=require(`node:os`);A=l(A,1);let j=require(`node:path`);j=l(j,1);let M=require(`js-yaml`);M=l(M,1);let N=require(`jsonlines`);N=l(N,1);let ee=require(`node:stream/consumers`),te=require(`fast-glob`);te=l(te,1);let ne=require(`picomatch`);ne=l(ne,1);let re=require(`rc-config-loader`),ie=require(`dequal`),ae=require(`node:child_process`);ae=l(ae,1);let oe=require(`node:util`),se=require(`fp-and-or`),ce=require(`progress`);ce=l(ce,1);let le=require(`p-map`);le=l(le,1);let ue=require(`jsonc-parser`);var de=`0.2.0`,fe=`https://github.com/baicie/npm-check-updates`,pe={url:`https://github.com/raineorshine/npm-check-updates/issues`},me={name:`@baicie/ncu`,version:de,author:`Tomas Junnonen <tomas1@gmail.com>`,license:`Apache-2.0`,type:`module`,contributors:[`Raine Revere (https://github.com/raineorshine)`,`Imamuzzaki Abu Salam <imamuzzaki@gmail.com>`],description:`Find newer versions of dependencies than what your package.json allows`,keywords:[`dependencies`,`npm`,`package.json`,`update`,`upgrade`,`versions`],engines:{node:`>=20.0.0`,npm:`>=8.12.1`},main:`dist/cjs/index.cjs`,types:`dist/esm/index.mjs`,exports:{".":{types:`./dist/esm/index.d.mts`,module:`./dist/esm/index.mjs`,import:`./dist/esm/index.mjs`,require:`./dist/esm/index.cjs`}},scripts:{dev:`rolldown --watch -c`,build:`rimraf dist && npm run build:options && rolldown -m -c`,"build:options":`vite-node src/scripts/build-options.ts`,"build:analyze":`rimraf dist && npm run build:options && ANALYZER=true vite build`,lint:`cross-env FORCE_COLOR=1 npm-run-all --parallel --aggregate-output lint:*`,"lint:markdown":`markdownlint "**/*.md" --ignore "**/node_modules/**/*.md" --ignore build --config .markdownlint.cjs`,"lint:src":`eslint --cache`,"lint:fix":`eslint --cache --fix`,"type-check":`tsc --noEmit --incremental`,prepublishOnly:`npm run build`,prettier:`prettier . --check`,"prettier:fix":`prettier . --write`,test:`npm run test:unit && npm run test:e2e`,"test:bun":`test/bun-install.sh && mocha test/bun`,"test:unit":`mocha test test/package-managers/*`,"test:e2e":`./test/e2e.sh`,ncu:`node dist/cjs/cli.cjs`,release:`tsx scripts/release.ts`,"ci-publish":`tsx scripts/publish.ts`,postinstall:`simple-git-hooks`},"simple-git-hooks":{"pre-commit":`pnpm lint-staged`,"commit-msg":`node -e "import('@baicie/scripts').then(m => m.verifyCommit())"`},"lint-staged":{"*.{js,json}":[`prettier --write`],"*.ts?(x)":[`eslint --fix`,`prettier --parser=typescript --write`]},bin:{"npm-check-updates":`dist/cjs/cli.cjs`,ncu:`dist/cjs/cli.cjs`},repository:{type:`git`,url:`git+https://github.com/baicie/npm-check-updates.git`},homepage:fe,bugs:pe,overrides:{ip:`2.0.1`,jsonparse:`https://github.com/ARitz-Cracker/jsonparse/tree/patch-1`,"@yarnpkg/parsers":`2.6.0`},dependencies:{camelcase:`^9.0.0`,chalk:`^5.6.2`,"cli-table3":`^0.6.5`,commander:`^14.0.3`,dequal:`^2.0.3`,"fast-glob":`^3.3.3`,"fast-memoize":`^2.5.2`,"find-up":`8.0.0`,"fp-and-or":`^1.0.2`,"hosted-git-info":`^10.1.0`,ini:`^7.0.0`,"js-yaml":`^4.1.1`,"jsonc-parser":`^3.3.1`,jsonlines:`^0.1.1`,lodash:`^4.18.1`,"npm-registry-fetch":`^19.1.1`,"p-map":`^7.0.4`,"parse-github-url":`^1.0.4`,picomatch:`^4.0.4`,progress:`^2.0.3`,"prompts-ncu":`^3.0.2`,"rc-config-loader":`^4.1.4`,rfdc:`^1.4.1`,semver:`^7.8.0`,"semver-utils":`^1.1.4`,"spawn-please":`^3.0.0`,untildify:`^6.0.0`,"update-notifier":`^7.3.1`},devDependencies:{"@baicie/release":`^0.1.15`,"@baicie/scripts":`^0.1.2`,"@eslint/js":`^10.0.1`,"@trivago/prettier-plugin-sort-imports":`^6.0.2`,"@types/bun":`^1.3.14`,"@types/chai":`^5.2.3`,"@types/chai-as-promised":`^8.0.2`,"@types/chai-string":`^1.4.5`,"@types/cli-table":`^0.3.4`,"@types/hosted-git-info":`^3.0.5`,"@types/ini":`^4.1.1`,"@types/js-yaml":`^4.0.9`,"@types/jsonlines":`^0.1.5`,"@types/lodash":`^4.17.24`,"@types/mocha":`^10.0.10`,"@types/node":`^24.12.2`,"@types/npm-registry-fetch":`^8.0.9`,"@types/parse-github-url":`^1.0.3`,"@types/picomatch":`^4.0.3`,"@types/progress":`^2.0.7`,"@types/prompts":`^2.4.9`,"@types/semver":`^7.7.1`,"@types/semver-utils":`^1.1.3`,"@types/sinon":`^21.0.1`,"@types/update-notifier":`^6.0.8`,"@typescript-eslint/eslint-plugin":`^8.59.3`,"@typescript-eslint/parser":`^8.59.3`,chai:`^6.2.2`,"chai-as-promised":`^8.0.2`,"chai-string":`^1.6.0`,"cross-env":`^10.1.0`,eslint:`^10.3.0`,"eslint-config-prettier":`^10.1.8`,"eslint-config-raine":`^0.5.0`,"eslint-config-standard":`^17.1.0`,"eslint-plugin-import":`^2.32.0`,"eslint-plugin-jsdoc":`^62.9.0`,"eslint-plugin-n":`^18.0.1`,"eslint-plugin-promise":`^7.3.0`,"lint-staged":`^17.0.4`,"markdownlint-cli":`^0.48.0`,mocha:`^11.7.5`,"npm-run-all":`^4.1.5`,prettier:`^3.8.3`,rimraf:`^6.1.3`,rolldown:`1.0.1`,"rolldown-plugin-dts":`^0.25.0`,"rollup-plugin-node-externals":`^9.0.1`,"rollup-plugin-visualizer":`^7.0.1`,should:`^13.2.3`,"simple-git-hooks":`^2.13.1`,sinon:`^22.0.0`,"source-map-support":`^0.5.21`,"strip-ansi":`^7.2.0`,"ts-node":`^10.9.2`,tsx:`^4.22.0`,typescript:`^6.0.3`,"typescript-eslint":`^8.59.3`,"typescript-json-schema":`^0.66.0`,verdaccio:`^6.6.2`,vite:`^8.0.13`,"vite-bundle-analyzer":`^1.3.8`,"vite-node":`^6.0.0`,"vite-plugin-dts":`^5.0.0`,yarn:`^1.22.22`},files:[`dist`,`!**/test/**`],mocha:{"check-leaks":!0,extension:[`test.ts`],require:[`source-map-support/register`,`ts-node/register`],timeout:6e4,"trace-deprecation":!0,"trace-warnings":!0,use_strict:!0},packageManager:`pnpm@11.1.2`,publishConfig:{access:`public`,registry:`https://registry.npmjs.org/`}};function P(e,t,n={}){let r=Array.isArray(e);return t||=(e=>({[e]:!0})),Object.entries(e||{}).forEach(([e,i],a)=>{let o=r?t(i,a,n):t(e,i,n);Object.entries(o||{}).forEach(e=>{n[e[0]]=e[1]})}),n}const he={blue:!0,bold:!0,cyan:!0,gray:!0,green:!0,magenta:!0,red:!0,yellow:!0},ge=P(he,e=>({[e]:e=>e.toString()}));let _e;const ve=async e=>{let{default:t,Chalk:n}=await import(`chalk`);_e=e===!0?new n({level:1}):e===null?ge:t},ye=()=>{if(!_e)throw Error(`Chalk has not been imported yet. Chalk is a dynamic import and requires that you await { chalkInit } from './lib/chalk'.`)},F=P(he,e=>{let t=t=>(ye(),_e[e].bold(t)),n=t=>(ye(),_e[e](t));return n.bold=t,{[e]:n}}),I=(e,t)=>P(e,(e,n)=>t(e,n)?{[e]:n}:null),be=e=>g.default.stat(e).then(()=>!0,()=>!1);async function xe(e,{pkgFile:t}={}){let n=require.resolve.paths(e)||[],r=t?[u.default.join(u.default.dirname(t),`node_modules`)]:[],i=[u.default.join(process.cwd(),`node_modules`)],a=[...r,...i,...n];for(let t of a){let n=u.default.join(t,e,`package.json`);if(await be(n))try{return JSON.parse(await g.default.readFile(n,`utf-8`))}catch{}}return null}async function Se(e,t,{pkgFile:n}={}){return t?t.version:(await xe(e,{pkgFile:n}))?.version??null}async function Ce(e,{pkgFile:t}={}){return(await xe(e,{pkgFile:t}))?.repository??null}async function we(e,t,{pkgFile:n}={}){let r=t?t.repository?t.repository:null:await Ce(e,{pkgFile:n});if(!r)return null;let i,a=``;if(typeof r==`string`){i=r;try{let e=new v.URL(i);if(e.protocol===`https:`||e.protocol===`http:`)return i}catch{}}else typeof r.url==`string`&&(i=r.url,typeof r.directory==`string`&&(a=r.directory));if(typeof i==`string`&&typeof a==`string`){let e=_.default.fromUrl(i)?.browse(a);return e===void 0?i:e.replace(/\/$/,``).replace(/\/tree\/HEAD$/,``)}return null}var L=o(((e,t)=>{t.exports=Array.isArray})),Te=o(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),R=o(((e,t)=>{var n=Te(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),Ee=o(((e,t)=>{t.exports=R().Symbol})),De=o(((e,t)=>{var n=Ee(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),Oe=o(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),ke=o(((e,t)=>{var n=Ee(),r=De(),i=Oe(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),Ae=o(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),je=o(((e,t)=>{var n=ke(),r=Ae(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),Me=o(((e,t)=>{var n=L(),r=je(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),Ne=o(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),Pe=o(((e,t)=>{var n=ke(),r=Ne(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),Fe=o(((e,t)=>{t.exports=R()[`__core-js_shared__`]})),Ie=o(((e,t)=>{var n=Fe(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),Le=o(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),Re=o(((e,t)=>{var n=Pe(),r=Ie(),i=Ne(),a=Le(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),ze=o(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),Be=o(((e,t)=>{var n=Re(),r=ze();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),Ve=o(((e,t)=>{t.exports=Be()(Object,`create`)})),He=o(((e,t)=>{var n=Ve();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),Ue=o(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),We=o(((e,t)=>{var n=Ve(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),Ge=o(((e,t)=>{var n=Ve(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),Ke=o(((e,t)=>{var n=Ve(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),qe=o(((e,t)=>{var n=He(),r=Ue(),i=We(),a=Ge(),o=Ke();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Je=o(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),Ye=o(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),Xe=o(((e,t)=>{var n=Ye();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),Ze=o(((e,t)=>{var n=Xe(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),Qe=o(((e,t)=>{var n=Xe();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),$e=o(((e,t)=>{var n=Xe();function r(e){return n(this.__data__,e)>-1}t.exports=r})),et=o(((e,t)=>{var n=Xe();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),tt=o(((e,t)=>{var n=Je(),r=Ze(),i=Qe(),a=$e(),o=et();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),nt=o(((e,t)=>{t.exports=Be()(R(),`Map`)})),rt=o(((e,t)=>{var n=qe(),r=tt(),i=nt();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),it=o(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),at=o(((e,t)=>{var n=it();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),ot=o(((e,t)=>{var n=at();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),st=o(((e,t)=>{var n=at();function r(e){return n(this,e).get(e)}t.exports=r})),ct=o(((e,t)=>{var n=at();function r(e){return n(this,e).has(e)}t.exports=r})),lt=o(((e,t)=>{var n=at();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),ut=o(((e,t)=>{var n=rt(),r=ot(),i=st(),a=ct(),o=lt();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),dt=o(((e,t)=>{var n=ut(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),ft=o(((e,t)=>{var n=dt(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),pt=o(((e,t)=>{var n=ft(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),mt=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),ht=o(((e,t)=>{var n=Ee(),r=mt(),i=L(),a=je(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),gt=o(((e,t)=>{var n=ht();function r(e){return e==null?``:n(e)}t.exports=r})),_t=o(((e,t)=>{var n=L(),r=Me(),i=pt(),a=gt();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),vt=o(((e,t)=>{var n=je(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),yt=o(((e,t)=>{var n=_t(),r=vt();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),bt=l(o(((e,t)=>{var n=yt();function r(e){return function(t){return e==null?void 0:n(e,t)}}t.exports=r}))(),1);function xt(e,t){return e?e.map(e=>({item:e,key:t(e)})).sort((e,t)=>e.key>t.key?1:e.key<t.key?-1:0).map(({item:e})=>e):[]}const St=[`major`,`minor`,`patch`],Ct=[`release`,`build`],z=[...St,...Ct],wt={major:``,minor:`.`,patch:`.`,release:`-`,build:`+`},Tt=[`^`,`~`,`.*`,`.x`],Et=RegExp(`^(${[`^`,`~`,`^*`,`*`,`x`,`x.x`,`x.x.x`].join(`|`).replace(/\^/g,`\\^`).replace(/\*/g,`\\*`)})$`),Dt=/^npm:(.*)@(.*)/;function Ot(e){let[t]=x.default.parseRange(e);if(!t)throw Error(S.default.format(`semverutils.parseRange returned null when trying to parse "%s". This is probably a problem with the "semver-utils" dependency. Please report an issue at https://github.com/raineorshine/npm-check-updates/issues.`,e));return z.reduce((e,n)=>t[n]?e+1:e,0)}function B(e,t){return(t?z.slice(0,z.indexOf(t)+1):z).filter(n=>t&&St.includes(t)||e[n]).map(t=>wt[t]+(e[t]||`0`)).join(``)}function kt(e){let[t]=x.default.parseRange(e);return z.slice().reverse().find((0,bt.default)(t))}function At(e,t){let[n]=x.default.parseRange(e);return B(n,t)}function jt(e,t){return t===`^`||t===`~`?t+e:At(e,`major`)+t}function Mt(e){return Et.test(e)}function Nt(e){return e===`*`||e===`x`}function Pt(e,t){if(e===t)return`none`;/^[~^]/.test(t)&&t[0]===e[0]&&(t=t.slice(1),e=e.slice(1));let n=t.split(`.`),r=e.split(`.`),i=n.findIndex((e,t)=>e!==r[t]);return i=i>=0?i:n.length,n[0]===`0`?`majorVersionZero`:i===0?`major`:i===1?`minor`:`patch`}function Ft(e,t,n){let r=P(e,(r,i,a)=>{let o=t[r],s=Pt(o,i),c=n.groupFunction?.(r,s,(0,x.parseRange)(o),(0,x.parseRange)(i),(0,x.parse)(e[r]))??s;return c===`none`?a:{...a,[c]:{...a[c],[r]:i}}}),i={patch:F.green(F.bold(`Patch`)+` Backwards-compatible bug fixes`),minor:F.cyan(F.bold(`Minor`)+` Backwards-compatible features`),major:F.red(F.bold(`Major`)+` Potentially breaking API changes`),majorVersionZero:F.magenta(F.bold(`Major version zero`)+` Anything may change`)};return Array.from(new Set([`patch`,`minor`,`major`,`majorVersionZero`,...Object.keys(r).sort()])).filter(e=>e in r).map(e=>({groupName:e,heading:e in i?i[e]:e,packages:r[e]}))}function It(e,t){let n=``;/^[~^]/.test(t)&&t[0]===e[0]&&(n=t[0],t=t.slice(1),e=e.slice(1));let r=t.split(`.`),i=e.split(`.`),a=r.findIndex((e,t)=>e!==i[t]);a=a>=0?a:r.length;let o=a===0||r[0]===`0`?`red`:a===1?`cyan`:`green`;try{let n=b.default.valid(e)?e:b.default.minVersion(e)?.version??null,r=b.default.valid(t)?t:b.default.minVersion(t)?.version??null;n&&r&&b.default.gt(n,r)&&(o=`yellow`)}catch{}let s=a>0&&a<r.length?`.`:``;return n+r.slice(0,a).join(`.`)+s+F[o](r.slice(a).join(`.`))}const Lt=e=>{let t=b.default.prerelease(e);return t&&t.slice(0,-1).join(`.`)};function Rt(e,t){let n=Lt(e),r=Lt(t);return typeof n!=`string`||typeof r!=`string`||n===r}function zt(e,t){return(b.default.valid(e)&&b.default.valid(t)?b.default.gt(e,t):e>t)?1:e===t?0:-1}function Bt(e,t,n){if(!b.default.validRange(t))return null;let r=b.default.minVersion(t);return[...e].sort(zt).filter(e=>{let t=b.default.parse(e);return t&&(n===`major`||t.major===r?.major)&&(n===`major`||n===`minor`||t.minor===r?.minor)}).at(-1)||null}function Vt(e){return kt(e)===`release`}const Ht=e=>/^[vV]?\d+$/.test(e),Ut=e=>/^[vV]?\d+\.\d+$/.test(e),Wt=e=>e.replace(/^[vV]/,``),Gt=e=>Ht(e)?e+`.0.0`:e,Kt=e=>Ut(e)?e+`.0`:e,qt=e=>Kt(Gt(Wt(e)));function Jt(e){return e&&(e[0]===`v`||e[1]===`v`)?`v`:``}const Yt=(e,t)=>`npm:${e}@${t}`,Xt=e=>{let t=e&&e.match&&e.match(Dt);return t&&t.slice(1)},Zt=e=>e&&!!e.match(Dt),Qt=(e,t)=>{let n=Xt(e);return n?Yt(n[0],t):null},$t=e=>{if(!e)return!1;let t=null;try{t=(0,y.default)(e)}catch{}if(!t||!t.branch)return!1;let n=decodeURIComponent(t.branch).replace(/^semver:/,``);return!!b.default.validRange(n)},en=e=>{if(!e)return null;let t=(0,y.default)(e);if(!t||!t.branch)return null;let n=decodeURIComponent(t.branch).replace(/^semver:/,``);return t&&t.branch&&b.default.validRange(n)?n:null};function tn(e,t,n={}){if(n.wildcard=n.wildcard||`^`,!t)return e;let[r]=x.default.parseRange(t);if(!r)return e;if(n.removeRange)return t;if(Mt(e))return e;let i=xt(x.default.parseRange(e).filter(e=>e.operator!==`||`&&e.operator!==`-`),e=>Ot(B(e))),[a]=i;function o(e){return(Nt(a[e])?a[e]:St.includes(e)&&a[e]||Ct.includes(e)?r[e]:null)||null}let s=B(P(z,e=>({[e]:o(e)}))),c=Jt(a.semver)+s,l=Array.from(new Set(i.map(e=>e.operator))),u=l[0]||``,d=Tt.some(e=>s.includes(e)),f=l[0]===`<`||l[0]===`<=`,p=l[0]===`>`,m=l.length>1;return!d&&(f||m)?jt(c,n.wildcard):(p?`>=`:u)+c}const nn=(e,t)=>{let n=Jt(e),r=n?n+t:t;return r=Ht(e)?r.slice(0,r.length-4):r,r=Ut(e)?r.slice(0,r.length-2):r,r},rn=(e,t)=>{let n=qt(t),r=(0,y.default)(e);if(!r)return e;let i=decodeURIComponent(r.branch).replace(/^semver:/,``);return e.replace(i,tn(i,nn(i,n)))},an={silent:0,error:1,minimal:2,warn:3,info:4,verbose:5,silly:6},on=e=>!e.startsWith(`file:`)&&!e.startsWith(`link:`)&&!e.startsWith(`workspace:`)&&!/^[^/:@]+\/\w+/.test(e);function V(e,t,n=null,r=`log`){!e.json&&e.loglevel!==`silent`&&(n==null||an[e.loglevel??`warn`]>=an[n])&&console[r](t)}function sn(e,t){e.loglevel!==`silent`&&console.log(JSON.stringify(t,null,2))}function H(e,t,n){V(e,Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}),n)}function cn(e){let t=new h.default({colAligns:[`left`,`right`,`right`,`right`,`left`,`left`],chars:{top:``,"top-mid":``,"top-left":``,"top-right":``,bottom:``,"bottom-mid":``,"bottom-left":``,"bottom-right":``,left:``,"left-mid":``,mid:``,"mid-mid":``,right:``,"right-mid":``,middle:``}});return t.push(...e),t.toString().split(`
|
|
2
2
|
`).map(e=>e.trimEnd()).join(`
|
|
3
|
-
`)}function
|
|
4
|
-
`+t),
|
|
5
|
-
`):
|
|
6
|
-
`+n.toString())}}async function
|
|
3
|
+
`)}function ln(e){return $t(e)?en(e):Zt(e)?Xt(e)[1]:e}function un(e){let t=e.match(/#catalog:([^#]+)/);return t?t[1]:void 0}async function dn({from:e,to:t,format:n,ownersChangedDeps:r,pkgFile:i,time:a,pinnedPackages:o,catalogName:s}){let c=n?.includes(`dep`)&&i?JSON.parse(await g.default.readFile(i,`utf-8`)):null;return cn(await Promise.all(Object.keys(t).sort().map(async l=>{let u=(n?.includes(`installedVersion`)?await Se(l,void 0,{pkgFile:i}):e[l])||``,d=l in(c?.devDependencies??{})?`dev`:l in(c?.peerDependencies??{})?`peer`:l in(c?.optionalDependencies??{})?`optional`:``,f=ln(t[l]||``),p=r?l in r?r[l]?`*owner changed*`:``:`*unknown*`:``,m=It(ln(u),f),h=n?.includes(`repo`)&&await we(l,void 0,{pkgFile:i})||``,g=n?.includes(`time`)&&a?.[l]?a[l]:``,_=o?.has(l)?` `+F.yellow(`(pinned)`):``,v=s?` `+F.cyan(`[catalog:${s}]`):``;return[l,...n?.includes(`dep`)?[d?F.gray(d):``]:[],u,`→`,m+_+v,p,...[h,g].filter(e=>e)]})))}async function fn({current:e,upgraded:t,ownersChangedDeps:n,pkgFile:r,time:i,pinnedPackages:a,catalogName:o},s){if(s.format?.includes(`group`)){let c=Ft(t,e,s);for(let{heading:t,packages:l}of c)V(s,`
|
|
4
|
+
`+t),V(s,await dn({from:e,to:l,format:s.format,ownersChangedDeps:n,pkgFile:r,time:i,pinnedPackages:a,catalogName:o}))}else s.format?.includes(`lines`)?V(s,Object.keys(t).sort().map(e=>a?.has(e)?`${e}@${t[e]} ${F.yellow(`(pinned)`)}`:`${e}@${t[e]}`).join(`
|
|
5
|
+
`)):V(s,await dn({from:e,to:t,format:s.format,ownersChangedDeps:n,pkgFile:r,time:i,pinnedPackages:a,catalogName:o}))}function pn(e,t){if(t&&Object.keys(t).length>0){let n=new h.default({colAligns:[`left`,`right`,`right`,`right`,`left`,`left`],chars:{top:``,"top-mid":``,"top-left":``,"top-right":``,bottom:``,"bottom-mid":``,"bottom-left":``,"bottom-right":``,left:``,"left-mid":``,mid:``,"mid-mid":``,right:``,"right-mid":``,middle:``}});n.push(...Object.entries(t).map(([e,t])=>[e,F.yellow(t)])),V(e,`
|
|
6
|
+
`+n.toString())}}async function mn(e,{current:t,latest:n,upgraded:r,total:i,ownersChangedDeps:a,pkgFile:o,time:s,errors:c}){e.format?.includes(`group`)||V(e,``);let l=F.green.bold(`:)`),u=Object.keys(c||{}).length,d=typeof e.target==`string`?e.target:`target`,f=Object.keys(r).length;f===0&&i===0&&u===0?Object.keys(t).length===0?V(e,`No dependencies.`):n&&Object.keys(n).length===0&&Object.values(I(t,(e,t)=>on(t))).length>0?V(e,`No package versions were returned. This may be a problem with your installed ${e.packageManager}, the npm registry, or your Internet connection. Make sure ${F.cyan(`npx pacote packument ncu-test-v2`)} is working before reporting an issue.`):e.global?V(e,`All global packages are up-to-date ${l}`):V(e,`All dependencies match the ${d} package versions ${l}`):f===0&&i>0?V(e,`No dependencies upgraded ${l}`):f>0&&await fn({current:t,upgraded:r,ownersChangedDeps:a,pkgFile:o,time:s,pinnedPackages:e.pinVersions?new Set(Object.keys(e.pinVersions)):void 0,catalogName:o?un(o):void 0},e),pn(e,c)}function hn(e,t){V(e,`
|
|
7
7
|
Ignored incompatible updates (peer dependencies):
|
|
8
|
-
`),
|
|
8
|
+
`),V(e,cn(Object.entries(t).map(([e,{from:t,to:n,reason:r}])=>{let i=`reason: `+Object.entries(r).map(([e,t])=>e+` requires `+t).join(`, `);return[e,t,`→`,It(t,n),i]})))}function gn(e,t){V(e,`
|
|
9
9
|
Ignored incompatible updates (engines node):
|
|
10
|
-
`),
|
|
11
|
-
`),r=[];return n.forEach(e=>{let n=0;if(e.length===0){r.push(``);return}for(;n<e.length;){let i=e.slice(n,n+t+1),a=i.trimEnd();if(a.length<=t){r.push(a);break}let o=i.split(``).reverse().join(``).match(/[ -][^\W]/)?.index||0,s=i.slice(0,i.length-o);if(s.length===0)break;r.push(s.trimEnd()),n+=s.length}
|
|
12
|
-
`).trim()},
|
|
13
|
-
<tr>`+e.map(e=>`<td>${e}</td>`).join(``)+`</tr>`,
|
|
10
|
+
`),V(e,cn(Object.entries(t).map(([e,{from:t,to:n,enginesNode:r}])=>[e,t,`→`,It(t,n),`reason: requires node ${r}`])))}function _n(e,t=10){return typeof e.timestamp==`number`?e.timestamp+60*1e3*t<Date.now():!1}const vn=`.ncu-cache.json`,yn=`~/${vn}`,bn=u.default.join(m.default.homedir(),vn);function xn(e){return e===yn?bn:e}async function Sn(e){e.cacheFile&&await p.default.promises.rm(xn(e.cacheFile),{force:!0})}async function Cn(e){if(!e.cache||!e.cacheFile)return;let t=xn(e.cacheFile),n={},r=new Set;try{n=JSON.parse(await p.default.promises.readFile(t,`utf-8`)),_n(n,e.cacheExpiration)&&(p.default.promises.rm(t,{force:!0}),n={})}catch{}return typeof n.timestamp!=`number`&&(n.timestamp=Date.now()),n.packages||={},n.peers||={},{get:(e,t)=>{if(!n.packages)return;let i=`${e}___${t}`,a=n.packages[i];return a&&!i.includes(a)&&r.add(e),a},set:(e,t,r)=>{if(!n.packages)return;let i=`${e}___${t}`;n.packages[i]=r},getPeers:(e,t)=>{if(!n.peers)return;let i=`${e}___${t}`,a=n.peers[i];return a&&r.add(e),a},setPeers:(e,t,r)=>{let i=`${e}___${t}`;n.peers&&(n.peers[i]=r)},save:async()=>{await p.default.promises.writeFile(t,JSON.stringify(n))},log:t=>{let n=r.size;n!==0&&(V(e,`\nUsing ${n} cached package ${t?`peer`:`version`}${n>1?`s`:``}`,`warn`),V(e,r,`verbose`),r.clear())}}}const wn=(e,t=92)=>{let n=e.split(`
|
|
11
|
+
`),r=[];return n.forEach(e=>{let n=0;if(e.length===0){r.push(``);return}for(;n<e.length;){let i=e.slice(n,n+t+1),a=i.trimEnd();if(a.length<=t){r.push(a);break}let o=i.split(``).reverse().join(``).match(/[ -][^\W]/)?.index||0,s=i.slice(0,i.length-o);if(s.length===0)break;r.push(s.trimEnd()),n+=s.length}}),r.join(`
|
|
12
|
+
`).trim()},Tn=e=>e.map(([e,t])=>[e,wn(t)]),En=e=>`
|
|
13
|
+
<tr>`+e.map(e=>`<td>${e}</td>`).join(``)+`</tr>`,U=({colAligns:e,markdown:t,rows:n})=>{if(t)return`<table>${n.map(En).join(``)}\n</table>`;{let r=new h.default({...e?{colAligns:e}:null});return r.push(...t?n:Tn(n)),r.toString()}},Dn=[`latest`,`newest`,`greatest`,`minor`,`patch`,`semver`],W=(e,t)=>e.split(`
|
|
14
14
|
`).map(e=>`${``.padStart(t,` `)}${e}`).join(`
|
|
15
|
-
`),
|
|
15
|
+
`),G=(e,{markdown:t}={})=>`${t?"```js\n":``}${W(e,t?0:4)}${t?"\n```":``}`,On=e=>e.replace(/`/g,``),kn=(e,{markdown:t}={})=>{let n=``;if(e.cli!==!1&&(n=`Usage:
|
|
16
16
|
|
|
17
|
-
ncu --${e.long}${e.arg?` [${e.arg}]`:``}${e.long===`doctor`?` -u`:``}\n`),e.type===`boolean`&&(n+=` ncu --no-${e.long}\n`),e.short&&(n+=` ncu -${e.short}${e.arg?` [${e.arg}]`:``}${e.long===`doctor`?`u`:``}\n`),e.default!==void 0&&!(Array.isArray(e.default)&&e.default.length===0)&&(n+=`\nDefault: ${e.default}\n`),e.help){let r=typeof e.help==`function`?t?e.help({markdown:t}):
|
|
17
|
+
ncu --${e.long}${e.arg?` [${e.arg}]`:``}${e.long===`doctor`?` -u`:``}\n`),e.type===`boolean`&&(n+=` ncu --no-${e.long}\n`),e.short&&(n+=` ncu -${e.short}${e.arg?` [${e.arg}]`:``}${e.long===`doctor`?`u`:``}\n`),e.default!==void 0&&!(Array.isArray(e.default)&&e.default.length===0)&&(n+=`\nDefault: ${e.default}\n`),e.help){let r=typeof e.help==`function`?t?e.help({markdown:t}):On(e.help({markdown:t})):e.help;n+=`\n${r.trim()}\n\n`}else if(e.description){let r=t?e.description:On(e.description);n+=`\n${r.replace(/`/g,``)}\n`}return n.trim()},An=[{long:`cache`,description:`Cache versions to a local cache file. Default \`--cacheFile\` is ${yn} and default \`--cacheExpiration\` is 10 minutes.`,type:`boolean`},{long:`cacheClear`,description:"Clear the default cache, or the cache file specified by `--cacheFile`.",type:`boolean`},{long:`cacheExpiration`,arg:`min`,description:"Cache expiration in minutes. Only works with `--cache`.",parse:e=>parseInt(e,10),default:10,type:`number`},{long:`cacheFile`,arg:`path`,description:"Filepath for the cache file. Only works with `--cache`.",parse:e=>u.default.isAbsolute(e)?e:u.default.join(process.cwd(),e),default:yn,type:`string`},{long:`color`,description:`Force color in terminal.`,type:`boolean`},{long:`concurrency`,arg:`n`,description:`Max number of concurrent HTTP requests to registry.`,parse:e=>parseInt(e,10),default:8,type:`number`},{long:`configFileName`,arg:`s`,description:`Config file name. (default: .ncurc.{json,yml,js,cjs})`,type:`string`},{long:`configFilePath`,arg:`path`,description:"Directory of .ncurc config file. (default: directory of `packageFile`)",type:`string`},{long:`cwd`,arg:`path`,description:`Working directory in which npm will be executed.`,type:`string`},{long:`deep`,description:"Run recursively in current working directory. Alias of (`--packageFile '**/package.json'`).",type:`boolean`},{long:`ignore`,arg:`dirs`,description:`Ignore directories containing package.json files (comma-delimited).`,type:`string | readonly string[]`,parse:e=>e&&typeof e==`string`?e.split(`,`):e},{long:`dep`,arg:`value`,description:`Check one or more sections of dependencies only: dev, optional, peer, prod, or packageManager (comma-delimited).`,default:[`prod`,`dev`,`optional`,`packageManager`],parse:e=>e&&typeof e==`string`?e.split(`,`):e,type:`string | readonly string[]`},{long:`deprecated`,default:!0,description:"Include deprecated packages. Use `--no-deprecated` to exclude deprecated packages (20–25% slower).",type:`boolean`},{long:`doctor`,short:`d`,description:"Iteratively installs upgrades and runs tests to identify breaking upgrades. Requires `-u` to execute.",type:`boolean`,help:({markdown:e})=>`Iteratively installs upgrades and runs your project's tests to identify breaking upgrades. Reverts broken upgrades and updates package.json with working upgrades.
|
|
18
18
|
|
|
19
19
|
${F.yellow("Requires `-u` to execute")} (modifies your package file, lock file, and node_modules)
|
|
20
20
|
|
|
@@ -30,7 +30,7 @@ To be more precise:
|
|
|
30
30
|
|
|
31
31
|
Additional options:
|
|
32
32
|
|
|
33
|
-
${
|
|
33
|
+
${U({markdown:e,rows:[[F.cyan(`--doctorInstall`),"specify a custom install script (default: `npm install` or `yarn`)"],[F.cyan(`--doctorTest`),"specify a custom test script (default: `npm test`)"]]})}
|
|
34
34
|
|
|
35
35
|
Example:
|
|
36
36
|
|
|
@@ -68,7 +68,7 @@ You can also specify a custom function in your .ncurc.js file, or when importing
|
|
|
68
68
|
|
|
69
69
|
> :warning: The predicate function is only available in .ncurc.js or when importing npm-check-updates as a module, not on the command line. To convert a JSON config to a JS config, follow the instructions at https://github.com/raineorshine/npm-check-updates#config-functions.
|
|
70
70
|
|
|
71
|
-
${
|
|
71
|
+
${G(`${F.gray(`/**
|
|
72
72
|
@param name The name of the dependency.
|
|
73
73
|
@param semver A parsed Semver array of the current version.
|
|
74
74
|
(See: https://git.coolaj86.com/coolaj86/semver-utils.js#semverutils-parse-semverstring)
|
|
@@ -87,7 +87,7 @@ ${t(`filterResults`)} runs _after_ new versions are fetched, in contrast to ${t(
|
|
|
87
87
|
|
|
88
88
|
> :warning: The predicate function is only available in .ncurc.js or when importing npm-check-updates as a module, not on the command line. To convert a JSON config to a JS config, follow the instructions at https://github.com/raineorshine/npm-check-updates#config-functions.
|
|
89
89
|
|
|
90
|
-
${
|
|
90
|
+
${G(`${F.gray(`/** Exclude major version updates. Note this could also be achieved with --target semver.
|
|
91
91
|
@param {string} packageName The name of the dependency.
|
|
92
92
|
@param {string} current Current version declaration (may be a range).
|
|
93
93
|
@param {SemVer[]} currentVersionSemver Current version declaration in semantic versioning format (may be a range).
|
|
@@ -114,7 +114,7 @@ You can also specify a custom function in your .ncurc.js file, or when importing
|
|
|
114
114
|
|
|
115
115
|
> :warning: The predicate function is only available in .ncurc.js or when importing npm-check-updates as a module, not on the command line. To convert a JSON config to a JS config, follow the instructions at https://github.com/raineorshine/npm-check-updates#config-functions. This function is an alias for the ${t(`filter`)} option function.
|
|
116
116
|
|
|
117
|
-
${
|
|
117
|
+
${G(`${F.gray(`/**
|
|
118
118
|
@param name The name of the dependency.
|
|
119
119
|
@param semver A parsed Semver array of the current version.
|
|
120
120
|
(See: https://git.coolaj86.com/coolaj86/semver-utils.js#semverutils-parse-semverstring)
|
|
@@ -127,12 +127,12 @@ ${F.green(`filterVersion`)}: (name, semver) ${F.cyan(`=>`)} {
|
|
|
127
127
|
${F.red(`return`)} ${F.cyan(`true`)}
|
|
128
128
|
}`,{markdown:e})}
|
|
129
129
|
|
|
130
|
-
`}},{long:`format`,arg:`value`,description:`Modify the output formatting or show additional information. Specify one or more comma-delimited values: dep, group, ownerChanged, repo, time, lines, installedVersion.`,parse:e=>typeof e==`string`?e.split(`,`):e,default:[],type:`readonly string[]`,choices:[`dep`,`group`,`ownerChanged`,`repo`,`time`,`lines`,`installedVersion`],help:({markdown:e})=>`Modify the output formatting or show additional information. Specify one or more comma-delimited values.\n\n${U(
|
|
130
|
+
`}},{long:`format`,arg:`value`,description:`Modify the output formatting or show additional information. Specify one or more comma-delimited values: dep, group, ownerChanged, repo, time, lines, installedVersion.`,parse:e=>typeof e==`string`?e.split(`,`):e,default:[],type:`readonly string[]`,choices:[`dep`,`group`,`ownerChanged`,`repo`,`time`,`lines`,`installedVersion`],help:({markdown:e})=>`Modify the output formatting or show additional information. Specify one or more comma-delimited values.\n\n${W(U({colAligns:[`right`,`left`],markdown:e,rows:[[`dep`,`Prints the dependency type (dev, peer, optional) of each package.`],[`group`,`Groups packages by major, minor, patch, and major version zero updates.`],[`installedVersion`,`Prints the exact current version number instead of a range.`],[`lines`,`Prints name@version on separate lines. Useful for piping to npm install.`],[`ownerChanged`,`Shows if the package owner has changed.`],[`repo`,`Infers and displays links to the package's source code repository. Requires packages to be installed.`],[`time`,`Shows the publish time of each upgrade.`]]}),e?0:4)}
|
|
131
131
|
`},{long:`global`,short:`g`,description:`Check global packages instead of in the current project.`,type:`boolean`},{long:`groupFunction`,arg:`fn`,cli:!1,description:"Customize how packages are divided into groups when using `--format group`.",type:`GroupFunction`,help:({markdown:e})=>`Customize how packages are divided into groups when using \`--format group\`.
|
|
132
132
|
|
|
133
133
|
Only available in .ncurc.js or when importing npm-check-updates as a module, not on the command line. To convert a JSON config to a JS config, follow the instructions at https://github.com/raineorshine/npm-check-updates#config-functions.
|
|
134
134
|
|
|
135
|
-
${
|
|
135
|
+
${G(`${F.gray(`/**
|
|
136
136
|
@param name The name of the dependency.
|
|
137
137
|
@param defaultGroup The predefined group name which will be used by default.
|
|
138
138
|
@param currentSpec The current version range in your package.json.
|
|
@@ -150,8 +150,8 @@ ${F.green(`groupFunction`)}: (name, defaultGroup, currentSpec, upgradedSpec, upg
|
|
|
150
150
|
${F.red(`return`)} defaultGroup
|
|
151
151
|
}`,{markdown:e})}
|
|
152
152
|
|
|
153
|
-
`},{long:`install`,arg:`value`,description:`Control the auto-install behavior: always, never, prompt.`,help:({markdown:e})=>`Control the auto-install behavior.\n\n${U(
|
|
154
|
-
`,default:`prompt`,choices:[`always`,`never`,`prompt`],type:`'always' | 'never' | 'prompt'`},{long:`interactive`,short:`i`,description:"Enable interactive prompts for each dependency; implies `-u` unless one of the json options are set.",type:`boolean`},{long:`jsonAll`,short:`j`,description:`Output new package file instead of human-readable message.`,type:`boolean`},{long:`jsonDeps`,description:"Like `jsonAll` but only lists `dependencies`, `devDependencies`, `optionalDependencies`, etc of the new package data.",type:`boolean`},{long:`jsonUpgraded`,description:`Output upgraded dependencies in json.`,type:`boolean`},{long:`loglevel`,short:`l`,arg:`n`,description:`Amount to log: silent, error, minimal, warn, info, verbose, silly.`,default:`warn`,type:`string`},{long:`mergeConfig`,description:"Merges nested configs with the root config file for `--deep` or `--packageFile` options. (default: false)",type:`boolean`},{long:`minimal`,short:`m`,description:`Do not upgrade newer versions that are already satisfied by the version range according to semver.`,type:`boolean`},{long:`packageData`,arg:`value`,description:`Package file data (you can also use stdin).`,type:`string | PackageFile`},{long:`packageFile`,arg:`path|glob`,description:`Package file(s) location. (default: ./package.json)`,type:`string`},{long:`packageManager`,short:`p`,arg:`s`,description:`npm, yarn, pnpm, deno, bun, staticRegistry (default: npm).`,help:({markdown:e})=>`Specifies the package manager to use when looking up versions.\n\n${U(
|
|
153
|
+
`},{long:`install`,arg:`value`,description:`Control the auto-install behavior: always, never, prompt.`,help:({markdown:e})=>`Control the auto-install behavior.\n\n${W(U({colAligns:[`right`,`left`],markdown:e,rows:[[`always`,`Runs your package manager's install command automatically after upgrading.`],[`never`,`Does not install and does not prompt.`],[`prompt`,`Shows a message after upgrading that recommends an install, but does not install. In interactive mode, prompts for install. (default)`]]}),e?0:4)}
|
|
154
|
+
`,default:`prompt`,choices:[`always`,`never`,`prompt`],type:`'always' | 'never' | 'prompt'`},{long:`interactive`,short:`i`,description:"Enable interactive prompts for each dependency; implies `-u` unless one of the json options are set.",type:`boolean`},{long:`jsonAll`,short:`j`,description:`Output new package file instead of human-readable message.`,type:`boolean`},{long:`jsonDeps`,description:"Like `jsonAll` but only lists `dependencies`, `devDependencies`, `optionalDependencies`, etc of the new package data.",type:`boolean`},{long:`jsonUpgraded`,description:`Output upgraded dependencies in json.`,type:`boolean`},{long:`loglevel`,short:`l`,arg:`n`,description:`Amount to log: silent, error, minimal, warn, info, verbose, silly.`,default:`warn`,type:`string`},{long:`mergeConfig`,description:"Merges nested configs with the root config file for `--deep` or `--packageFile` options. (default: false)",type:`boolean`},{long:`minimal`,short:`m`,description:`Do not upgrade newer versions that are already satisfied by the version range according to semver.`,type:`boolean`},{long:`packageData`,arg:`value`,description:`Package file data (you can also use stdin).`,type:`string | PackageFile`},{long:`packageFile`,arg:`path|glob`,description:`Package file(s) location. (default: ./package.json)`,type:`string`},{long:`packageManager`,short:`p`,arg:`s`,description:`npm, yarn, pnpm, deno, bun, staticRegistry (default: npm).`,help:({markdown:e})=>`Specifies the package manager to use when looking up versions.\n\n${W(U({colAligns:[`right`,`left`],markdown:e,rows:[[`npm`,`System-installed npm. Default.`],[`yarn`,`System-installed yarn. Automatically used if yarn.lock is present.`],[`pnpm`,`System-installed pnpm. Automatically used if pnpm-lock.yaml is present.`],[`bun`,`System-installed bun. Automatically used if bun.lock or bun.lockb is present.`]]}),e?0:4)}
|
|
155
155
|
`,type:`'npm' | 'yarn' | 'pnpm' | 'deno' | 'bun' | 'staticRegistry'`},{long:`peer`,description:`Check peer dependencies of installed packages and filter updates to compatible versions.`,type:`boolean`,help:({markdown:e})=>{let t=t=>e?`\`${t}\``:t;return`Check peer dependencies of installed packages and filter updates to compatible versions.
|
|
156
156
|
|
|
157
157
|
${F.bold(`Example`)}:
|
|
@@ -186,7 +186,7 @@ As a comparison: without using the \`--peer\` option, ncu will suggest the lates
|
|
|
186
186
|
|
|
187
187
|
ncu-test-peer-update 1.0.0 → 1.${F.cyan(`1.0`)}
|
|
188
188
|
ncu-test-return-version 1.0.0 → ${F.red(`2.0.0`)}
|
|
189
|
-
`}},{long:`pre`,arg:`n`,description:"Include prerelease versions, e.g. -alpha.0, -beta.5, -rc.2. Automatically set to 1 when `--target` is newest or greatest, or when the current version is a prerelease. (default: 0)",parse:e=>!!parseInt(e,10),type:`number`},{long:`prefix`,arg:`path`,description:`Current working directory of npm.`,type:`string`},{long:`registry`,short:`r`,arg:`uri`,description:`Specify the registry to use when looking up package versions.`,type:`string`},{long:`registryType`,arg:`type`,description:`Specify whether --registry refers to a full npm registry or a simple JSON file or url: npm, json. (default: npm)`,help:({markdown:e})=>`${`Specify whether ${(t=>e?`\`${t}\``:t)(`--registry`)} refers to a full npm registry or a simple JSON file.`}\n\n${U(
|
|
189
|
+
`}},{long:`pinVersions`,arg:`json`,description:`Pin packages to specific versions, bypassing target strategy. Accepts a JSON object mapping package names to versions (e.g., '{"lodash":"4.17.21"}').`,parse:e=>{if(typeof e==`string`)try{return JSON.parse(e)}catch{throw Error(`pinVersions must be a valid JSON object`)}return e},type:`Index<string>`},{long:`pre`,arg:`n`,description:"Include prerelease versions, e.g. -alpha.0, -beta.5, -rc.2. Automatically set to 1 when `--target` is newest or greatest, or when the current version is a prerelease. (default: 0)",parse:e=>!!parseInt(e,10),type:`number`},{long:`prefix`,arg:`path`,description:`Current working directory of npm.`,type:`string`},{long:`registry`,short:`r`,arg:`uri`,description:`Specify the registry to use when looking up package versions.`,type:`string`},{long:`registryType`,arg:`type`,description:`Specify whether --registry refers to a full npm registry or a simple JSON file or url: npm, json. (default: npm)`,help:({markdown:e})=>`${`Specify whether ${(t=>e?`\`${t}\``:t)(`--registry`)} refers to a full npm registry or a simple JSON file.`}\n\n${W(U({colAligns:[`right`,`left`],markdown:e,rows:[[`npm`,`Default npm registry`],[`json`,`Checks versions from a file or url to a simple JSON registry. Must include the ${F.cyan("`--registry`")} option.
|
|
190
190
|
|
|
191
191
|
Example:
|
|
192
192
|
|
|
@@ -216,7 +216,7 @@ You can also specify a custom function in your .ncurc.js file, or when importing
|
|
|
216
216
|
|
|
217
217
|
> :warning: The predicate function is only available in .ncurc.js or when importing npm-check-updates as a module, not on the command line. To convert a JSON config to a JS config, follow the instructions at https://github.com/raineorshine/npm-check-updates#config-functions.
|
|
218
218
|
|
|
219
|
-
${
|
|
219
|
+
${G(`${F.gray(`/**
|
|
220
220
|
@param name The name of the dependency.
|
|
221
221
|
@param semver A parsed Semver array of the current version.
|
|
222
222
|
(See: https://git.coolaj86.com/coolaj86/semver-utils.js#semverutils-parse-semverstring)
|
|
@@ -237,7 +237,7 @@ You can also specify a custom function in your .ncurc.js file, or when importing
|
|
|
237
237
|
|
|
238
238
|
> :warning: The predicate function is only available in .ncurc.js or when importing npm-check-updates as a module, not on the command line. To convert a JSON config to a JS config, follow the instructions at https://github.com/raineorshine/npm-check-updates#config-functions. This function is an alias for the reject option function.
|
|
239
239
|
|
|
240
|
-
${
|
|
240
|
+
${G(`${F.gray(`/**
|
|
241
241
|
@param name The name of the dependency.
|
|
242
242
|
@param semver A parsed Semver array of the current version.
|
|
243
243
|
(See: https://git.coolaj86.com/coolaj86/semver-utils.js#semverutils-parse-semverstring)
|
|
@@ -252,17 +252,17 @@ ${F.green(`rejectVersion`)}: (name, semver) ${F.cyan(`=>`)} {
|
|
|
252
252
|
|
|
253
253
|
`}},{long:`removeRange`,description:`Remove version ranges from the final package version.`,type:`boolean`},{long:`root`,default:!0,description:"Runs updates on the root project in addition to specified workspaces. Only allowed with `--workspace` or `--workspaces`.",type:`boolean`},{long:`retry`,arg:`n`,description:`Number of times to retry failed requests for package info.`,parse:e=>parseInt(e,10),default:3,type:`number`},{long:`silent`,short:`s`,description:"Don't output anything. Alias for `--loglevel` silent.",type:`boolean`},{long:`stdin`,description:`Read package.json from stdin.`,type:`string`},{long:`target`,short:`t`,arg:`value`,description:"Determines the version to upgrade to: latest, newest, greatest, minor, patch, semver, `@[tag]`, or [function]. (default: latest)",help:({markdown:e})=>`Determines the version to upgrade to. (default: "latest")
|
|
254
254
|
|
|
255
|
-
${U(
|
|
255
|
+
${W(U({colAligns:[`right`,`left`],markdown:e,rows:[[`greatest`,`Upgrade to the highest version number published, regardless of release date or tag. Includes prereleases.`],[`latest`,`Upgrade to whatever the package's "latest" git tag points to. Excludes prereleases unless --pre is specified.`],[`minor`,`Upgrade to the highest minor version without bumping the major version.`],[`newest`,`Upgrade to the version with the most recent publish date, even if there are other version numbers that are higher. Includes prereleases.`],[`patch`,`Upgrade to the highest patch version without bumping the minor or major versions.`],[`semver`,`Upgrade to the highest version within the semver range specified in your package.json.`],[`@[tag]`,`Upgrade to the version published to a specific tag, e.g. 'next' or 'beta'.`]]}),e?0:4)}
|
|
256
256
|
|
|
257
257
|
e.g.
|
|
258
258
|
|
|
259
|
-
${
|
|
259
|
+
${G(`ncu --target semver`)}
|
|
260
260
|
|
|
261
261
|
You can also specify a custom function in your .ncurc.js file, or when importing npm-check-updates as a module.
|
|
262
262
|
|
|
263
263
|
> :warning: The predicate function is only available in .ncurc.js or when importing npm-check-updates as a module, not on the command line. To convert a JSON config to a JS config, follow the instructions at https://github.com/raineorshine/npm-check-updates#config-functions.
|
|
264
264
|
|
|
265
|
-
${
|
|
265
|
+
${G(`${F.gray(`/** Upgrade major version zero to the next minor version, and everything else to latest.
|
|
266
266
|
@param name The name of the dependency.
|
|
267
267
|
@param semver A parsed Semver object of the upgraded version.
|
|
268
268
|
(See: https://git.coolaj86.com/coolaj86/semver-utils.js#semverutils-parse-semverstring)
|
|
@@ -272,7 +272,7 @@ ${F.green(`target`)}: (name, semver) ${F.cyan(`=>`)} {
|
|
|
272
272
|
${F.red(`if`)} (parseInt(semver[0]?.major) ${F.red(`===`)} ${F.yellow(`'0'`)}) ${F.red(`return`)} ${F.yellow(`'minor'`)}
|
|
273
273
|
${F.red(`return`)} ${F.yellow(`'latest'`)}
|
|
274
274
|
}`,{markdown:e})}
|
|
275
|
-
`,type:`${
|
|
275
|
+
`,type:`${Dn.map(e=>`'${e}'`).join(` | `)} | \`@\${string}\` | TargetFunction`},{long:`timeout`,arg:`ms`,description:`Global timeout in milliseconds. (default: no global timeout and 30 seconds per npm-registry-fetch)`,parse:e=>parseInt(e,10),type:`number`},{long:`upgrade`,short:`u`,description:`Overwrite package file with upgraded versions instead of just outputting to console.`,type:`boolean`},{long:`verbose`,description:"Log additional information for debugging. Alias for `--loglevel` verbose.",type:`boolean`},{long:`workspace`,arg:`s`,parse:(e,t)=>[...t,e],default:[],description:"Run on one or more specified workspaces. Add `--no-root` to exclude the root project.",type:`readonly string[]`},{long:`workspaces`,short:`w`,description:"Run on all workspaces. Add `--no-root` to exclude the root project.",type:`boolean`},{long:`catalog`,arg:`names`,description:`Specify which catalogs to check/upgrade. Accepts a comma-separated list of catalog names, or a glob pattern (e.g., "default", "test,staging", "prod*"). If not specified, all catalogs are included.`,parse:e=>typeof e==`string`?e.split(`,`).map(e=>e.trim()):e,type:`string | readonly string[]`},{long:`catalogs`,default:!0,description:`Include catalog dependencies in upgrade checks when using --workspaces or --workspace. Set to false to skip catalogs entirely.`,type:`boolean`},{long:`catalogTarget`,arg:`value`,description:`Version target strategy specifically for catalog dependencies. If not specified, uses the global --target option. Supports: latest, newest, greatest, minor, patch, semver, @[tag], or a custom function.`,type:`string`},{long:`cooldown`,short:`c`,arg:`n`,description:`Sets a minimum age (in days) for package versions to be considered for upgrade, reducing the risk of installing newly published, potentially compromised packages.`,type:`number | CooldownFunction`,help:({markdown:e})=>`The cooldown option helps protect against supply chain attacks by requiring package versions to be published at least the given number of days before considering them for upgrade.
|
|
276
276
|
|
|
277
277
|
Note that previous stable versions will ${F.bold(`not`)} be suggested. The package will be completely ignored if its latest published version is within the cooldown period. This is due to a limitation of the npm registry, which does not provide a way to query previous stable versions.
|
|
278
278
|
|
|
@@ -292,7 +292,7 @@ Let's examine how cooldown works with a package that has these versions availabl
|
|
|
292
292
|
|
|
293
293
|
${F.bold(`With default target (latest)`)}:
|
|
294
294
|
|
|
295
|
-
${
|
|
295
|
+
${G(`${F.cyan(`$`)} ncu --cooldown 5`,{markdown:e})}
|
|
296
296
|
|
|
297
297
|
No update will be suggested because:
|
|
298
298
|
|
|
@@ -302,7 +302,7 @@ No update will be suggested because:
|
|
|
302
302
|
|
|
303
303
|
${F.bold("With `@beta`/`@tag` target")}:
|
|
304
304
|
|
|
305
|
-
${
|
|
305
|
+
${G(`${F.cyan(`$`)} ncu --cooldown 3 --target @beta`,{markdown:e})}
|
|
306
306
|
|
|
307
307
|
No update will be suggested because:
|
|
308
308
|
|
|
@@ -312,7 +312,7 @@ No update will be suggested because:
|
|
|
312
312
|
|
|
313
313
|
${F.bold(`With other targets`)}:
|
|
314
314
|
|
|
315
|
-
${
|
|
315
|
+
${G(`${F.cyan(`$`)} ncu --cooldown 5 --target greatest|newest|minor|patch|semver`,{markdown:e})}
|
|
316
316
|
|
|
317
317
|
Each target will select the best version that is at least 5 days old:
|
|
318
318
|
|
|
@@ -329,46 +329,46 @@ You can also provide a custom function in your .ncurc.js file or when importing
|
|
|
329
329
|
|
|
330
330
|
> :warning: The predicate function is only available in .ncurc.js or when importing npm-check-updates as a module, not on the command line. To convert a JSON config to a JS config, follow the instructions at https://github.com/raineorshine/npm-check-updates#config-functions.
|
|
331
331
|
|
|
332
|
-
${
|
|
332
|
+
${G(`${F.gray(`/** Set cooldown to 3 days but skip it for \`@my-company\` packages.
|
|
333
333
|
@param packageName The name of the dependency.
|
|
334
334
|
@returns Cooldown days restriction for given package.
|
|
335
335
|
*/`)}
|
|
336
336
|
${F.green(`cooldown`)}: packageName ${F.cyan(`=>`)} (packageName.startsWith(${F.yellow(`'@my-company'`)}) ? ${F.cyan(`0`)} : ${F.cyan(`3`)})`,{markdown:e})}
|
|
337
|
-
`,parse:e=>typeof e==`function`?e:parseInt(e,10)}],G=Mn.reduce((e,t)=>({...e,...t.short?{[t.short]:t}:null,...t.long?{[t.long]:t}:null}),{}),Nn=xt(Mn,e=>e.long),Pn=[`package-lock.json`,`yarn.lock`,`pnpm-lock.yaml`,`deno.json`,`deno.jsonc`,`bun.lock`,`bun.lockb`];async function Fn(e,t=g.default.readdir){try{let n=m.default.homedir(),r=m.default.tmpdir(),i=e.cwd?e.cwd:e.packageFile?u.default.dirname(e.packageFile):`.`;for(i=u.default.resolve(i);;){let e=await t(i);for(let t of Pn)if(e.includes(t))return{directoryPath:i,filename:t};let a=u.default.resolve(i,`..`);if(a===i||a===n||a===r)break;i=a}}catch{}return null}const In={"package-lock":`npm`,yarn:`yarn`,"pnpm-lock":`pnpm`,deno:`deno`,bun:`bun`},Ln=()=>{let e=process.env.npm_config_user_agent??``,t=process.env.npm_execpath??``;return e.startsWith(`yarn/`)||t.includes(`yarn`)||__dirname.includes(`/yarn/`)||__dirname.includes(`\\Yarn\\`)?`yarn`:e.startsWith(`pnpm/`)||t.includes(`pnpm`)||__dirname.includes(`/pnpm/`)||__dirname.includes(`\\pnpm\\`)?`pnpm`:e.startsWith(`bun/`)||typeof Bun<`u`||process.versions.bun||__dirname.includes(`/.bun/`)||__dirname.includes(`\\.bun\\`)?`bun`:`npm`},Rn=async(e,t=g.default.readdir)=>{if(e.packageManager)return e.packageManager;if(e.global)return Ln();let n=(await Fn(e,t))?.filename;return n?In[n.split(`.`)[0]]:`npm`};var zn=class e{constructor(e,t,n){this.__specs=e||{},this.__opts=t||{},this.__providers=Wn(n.filter(e=>typeof e==`object`&&!!e)),this.__isFiggyPudding=!0}get(e){return Bn(this,e,!0)}toJSON(){let e={};return this.forEach((t,n)=>{e[n]=t}),e}forEach(e,t=this){for(let[n,r]of this.entries())e.call(t,r,n,this)}*entries(e){for(let e of Object.keys(this.__specs))yield[e,this.get(e)];let t=e||this.__opts.other;if(t){let e=new Set;for(let n of this.__providers){let r=n.entries?n.entries(t):Gn(n);for(let[n,i]of r)t(n)&&!e.has(n)&&(e.add(n),yield[n,i])}}}concat(...t){return new Proxy(new e(this.__specs,this.__opts,Wn(this.__providers).concat(t)),Hn)}};function Bn(e,t,n){let r=e.__specs[t];r||={};let i;for(let n of e.__providers)if(i=Vn(t,n),i!==void 0)break;return i===void 0&&r.default!==void 0?typeof r.default==`function`?r.default(e):r.default:i}function Vn(e,t){let n;return n=t.__isFiggyPudding?Bn(t,e,!1):t[e],n}const Hn={get(e,t){return typeof t==`symbol`||t.slice(0,2)===`__`||t in zn.prototype?e[t]:e.get(t)}};function Un(e,t){function n(...n){return new Proxy(new zn(e,t,n),Hn)}return n}function Wn(e){let t=[];return e.forEach(e=>t.unshift(e)),t}function Gn(e){return Object.keys(e).map(t=>[t,e[t]])}const Kn=Un({},{other(){return!0}}),qn=Un({cache:{default:j.default.join(process.env.HOME||A.default.homedir(),`.npm`)},configNames:{default:[`npmrc`,`.npmrc`]},envPrefix:{default:/^npm_config_/i},cwd:{default:()=>process.cwd()},globalconfig:{default:()=>j.default.join(Xn(),`etc`,`npmrc`)},userconfig:{default:j.default.join(process.env.HOME||A.default.homedir(),`.npmrc`)}});function Jn(e,t){let n=qn(t),r={};Object.keys(process.env).forEach(e=>{if(!e.match(n.envPrefix))return;let t=e.toLowerCase().replace(n.envPrefix,``).replace(/(?!^)_/g,`-`);r[t]=process.env[e]});let i=Kn(e),a=n.userconfig||i.userconfig||r.userconfig,o=a&&Yn(a),s=n.globalconfig||i.globalconfig||r.globalconfig,c=s&&Yn(s),l=(0,O.findUpSync)(n.configNames,{cwd:n.cwd}),u={};l&&l!==a&&(u=Yn(l));let d=Kn(n,c,o,u,r,i);return d.cache?d.concat({cache:j.default.resolve(i.cache||r.cache?n.cwd:u.cache?j.default.dirname(l):o.cache?j.default.dirname(a):c.cache?j.default.dirname(s):j.default.dirname(a),d.cache)}):d}function Yn(e){let t;try{t=k.default.readFileSync(e,`utf8`)}catch(e){if(e.code===`ENOENT`)return``;throw e}return T.default.parse(t)}function Xn(){if(process.env.PREFIX)return process.env.PREFIX;if(process.platform===`win32`)return j.default.dirname(process.execPath);{let e=j.default.dirname(j.default.dirname(process.execPath));return process.env.DESTDIR&&(e=j.default.join(process.env.DESTDIR,e)),e}}function Zn(e,t){return t.deprecated||!e.deprecated}function Qn(e,t){return t.pre?!0:!e.version||!Ut(e.version)}function $n(e,t){if(!t)return!0;let n=b.default.minVersion(t)?.version;if(!n)return!0;let r=e?.engines?.node;return!r||b.default.satisfies(n,r)}function er(e,t){return t?Object.values(t).every(t=>t[e.name]===void 0||b.default.satisfies(e.version,t[e.name])):!0}function tr(e,t){let n=e.version,r=e?.time?.[n];if(!t)return!0;if(!r)return!1;let i=new Date(r),a=typeof t==`function`?t(e.name)??0:t;return Date.now()-i.getTime()>=a*864e5}function nr(e){let t=[t=>Zn(t,e),t=>Qn(t,e),e.enginesNode?t=>$n(t,e.nodeEngineVersion):null,e.peerDependencies?t=>er(t,e.peerDependencies):null,e.cooldown?t=>tr(t,e.cooldown):null];return e=>t.every(t=>t?t(e):!0)}var rr=s({default:()=>gr,defaultPrefix:()=>_r,distTag:()=>Sr,fetchUpgradedPackumentMemo:()=>J,getEngines:()=>br,getPeerDependencies:()=>yr,greatest:()=>vr,latest:()=>Cr,list:()=>xr,minor:()=>Tr,mockFetchUpgradedPackument:()=>pr,newest:()=>wr,normalizeNpmConfig:()=>cr,packageAuthorChanged:()=>dr,parseJson:()=>q,patch:()=>Er,semver:()=>Dr});const ir=new Set([`-`,`||`,`&&`,`<`,`<=`,`>`,`>=`]),ar=e=>(0,x.parseRange)(e).some(e=>ir.has(e.operator||``)),or=e=>e&&(!b.default.validRange(e)||Pt(e)),sr=async(e,t,n,r={},i)=>{let a=E.default.pickRegistry(e,r),o={"user-agent":r.userAgent||`npm-check-updates/${de} node/${process.version}`,"ncu-version":de,"ncu-pkg-id":`registry:${e}`,accept:r.fullMetadata?`application/json`:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`,...r.headers},s=new URL(encodeURIComponent(e),a.endsWith(`/`)?a:`${a}/`);i&&(s.pathname+=`/${i}`);let c={...r,headers:o,spec:e};try{if(r.fullMetadata)return E.default.json(s.href,c);{n||=`latest`;let r=E.default.json.stream(s.href,`$*`,c),i={name:e};for await(let{key:e,value:n}of r)if(t.includes(e)&&(i[e]=n,Object.keys(i).length===t.length+1))break;return i}}catch(a){if(a.code!==`E404`||r.fullMetadata)throw a;return sr(e,t,n,{...r,fullMetadata:!0},i)}},K=(e,t)=>{let n=e.version;return{...e,name:t.name,...t?.time?.[n]?{time:t.time}:null}},cr=(e,t)=>{let n={cafile:e=>{if(!e)return;let n=p.default.readFileSync(u.default.resolve(t||``,(0,D.default)(e)),`utf8`),r=`-----END CERTIFICATE-----`;return{ca:n.split(r).filter(e=>!!e.trim()).map(e=>`${e.trimStart()}${r}`)}},maxsockets:`maxSockets`,"strict-ssl":`strictSSL`},r={all:`boolean`,allowsameversion:`boolean`,audit:`boolean`,binlinks:`boolean`,color:`boolean`,commithooks:`boolean`,description:`boolean`,dev:`boolean`,diffignoreallspace:`boolean`,diffnameonly:`boolean`,diffnoprefix:`boolean`,difftext:`boolean`,dryrun:`boolean`,enginestrict:`boolean`,force:`boolean`,foregroundscripts:`boolean`,formatpackagelock:`boolean`,fund:`boolean`,gittagversion:`boolean`,global:`boolean`,globalstyle:`boolean`,ifpresent:`boolean`,ignorescripts:`boolean`,includestaged:`boolean`,includeworkspaceroot:`boolean`,installlinks:`boolean`,json:`boolean`,legacybundling:`boolean`,legacypeerdeps:`boolean`,link:`boolean`,long:`boolean`,offline:`boolean`,omitlockfileregistryresolved:`boolean`,packagelock:`boolean`,packagelockonly:`boolean`,parseable:`boolean`,preferoffline:`boolean`,preferonline:`boolean`,progress:`boolean`,readonly:`boolean`,rebuildbundle:`boolean`,save:`boolean`,savebundle:`boolean`,savedev:`boolean`,saveexact:`boolean`,saveoptional:`boolean`,savepeer:`boolean`,saveprod:`boolean`,shrinkwrap:`boolean`,signgitcommit:`boolean`,signgittag:`boolean`,strictpeerdeps:`boolean`,strictssl:`boolean`,timing:`boolean`,unicode:`boolean`,updatenotifier:`boolean`,usage:`boolean`,version:`boolean`,versions:`boolean`,workspacesupdate:`boolean`,diffunified:`number`,fetchretries:`number`,fetchretryfactor:`number`,fetchretrymaxtimeout:`number`,fetchretrymintimeout:`number`,fetchtimeout:`number`,logsmax:`number`,maxsockets:`number`,searchlimit:`number`,searchstaleness:`number`,ssopollfrequency:`number`,timeout:`number`},i=e=>!!e&&e!==`false`&&e!==`0`,a=e=>parseInt(e)||0;return P(e,(e,t)=>{let o=typeof t==`string`?r[e.replace(/-/g,``).toLowerCase()]===`boolean`?i(t):r[e.replace(/-/g,``).toLowerCase()]===`number`?a(t):t.replace(/\${([^}]+)}/,(e,t)=>process.env[t]):t,{[e]:s}=n;return typeof s==`string`?{[s]:o}:typeof s==`function`?{...s(o.toString())}:{[e.match(/^[a-z]/i)?(0,C.default)(e):e]:o}})},lr=(0,w.default)(e=>{let t;if(e)try{t=T.default.parse(p.default.readFileSync(e,`utf-8`))}catch(e){if(e.code===`ENOENT`)return null;throw e}else t={...Jn(null,{userconfig:process.env.npm_config_userconfig||process.env.NPM_CONFIG_USERCONFIG}).toJSON(),cache:!1};return cr(t,e)}),ur=lr();function q(e,t){let n;try{n=JSON.parse(e)}catch{throw Error(`Expected JSON from "${t.command}".${t.packageName?` There could be problems with the ${t.packageName} package.`:``} ${e?`Instead received: `+e:`Received empty response.`}`)}return n}async function dr(e,t,n,r={},i){let a=await sr(e,[`versions`],null,{...i,...ur,fullMetadata:!0,...r.registry?{registry:r.registry,silent:!0}:null});if(a.versions){let e=Object.keys(a.versions),r=b.default.minSatisfying(e,t),i=b.default.maxSatisfying(e,n);if(r&&i&&a.versions[r]._npmUser&&a.versions[i]._npmUser)return a.versions[r]._npmUser?.name!==a.versions[i]._npmUser?.name}return!1}const fr=e=>!!(e&&(e.name||e.engines||e.version||e.versions)),pr=e=>(t,n,r,i)=>{let a=typeof e==`function`?e(i)?.[t]:typeof e==`string`||fr(e)?e:e[t],o=fr(a)?a.version:a;if(!o)throw Error(`fetchUpgradedPackument is mocked, but no mock version was supplied for ${t}. Make sure that all dependencies are mocked. `);let s=fr(a)&&a.time?.[o]||new Date().toISOString(),c={name:t,"dist-tags":{[i.distTag||`latest`]:o},engines:{node:``},time:{[o]:s},version:o,versions:{},...fr(a)?a:null},{versions:l,...u}=c;return Promise.resolve({...c,versions:{...fr(a)&&a.versions||{[o]:u}}})},mr=(0,w.default)(({npmConfigLocal:e,npmConfigUser:t,npmConfigWorkspaceProject:n},r)=>{let i=r.packageFile?u.default.join(r.packageFile,`../.npmrc`):null,a=r.packageFile?lr(i||void 0):null,o=r.cwd?u.default.join(r.cwd,`.npmrc`):null,s=r.cwd?lr(o):null;if(n&&Object.keys(n).length>0){B(r,`
|
|
338
|
-
npm config (workspace project):`,`verbose`);let{cache:e,...t}=n;
|
|
339
|
-
npm config (user):`,`verbose`);let{cache:e,...n}=t;
|
|
340
|
-
npm config (local override):`,`verbose`);let{cache:t,...n}=e;
|
|
341
|
-
merged npm config:`,`verbose`);let{cache:e,...t}=c;
|
|
342
|
-
`),e=>{let t=e.match(/.* (.+?)@(.+)/);if(t){let[,e,n]=t;return{[e]:n}}return null})};var Mr=s({default:()=>Hr,defaultPrefix:()=>_r,distTag:()=>Fr,getEngines:()=>br,getPeerDependencies:()=>yr,greatest:()=>Ir,latest:()=>Lr,list:()=>Pr,minor:()=>Rr,newest:()=>zr,packageAuthorChanged:()=>dr,patch:()=>Br,semver:()=>Vr});const Nr=(0,w.default)(async e=>{let t=await(0,O.findUp)(`pnpm-workspace.yaml`);if(!t)return{};let n=u.default.dirname(t),r=u.default.join(n,`.npmrc`),i;try{i=await g.default.readFile(r,`utf-8`)}catch{return{}}
|
|
337
|
+
`,parse:e=>typeof e==`function`?e:parseInt(e,10)}],K=An.reduce((e,t)=>({...e,...t.short?{[t.short]:t}:null,...t.long?{[t.long]:t}:null}),{}),jn=xt(An,e=>e.long),Mn=[`package-lock.json`,`yarn.lock`,`pnpm-lock.yaml`,`deno.json`,`deno.jsonc`,`bun.lock`,`bun.lockb`];async function Nn(e,t=g.default.readdir){try{let n=m.default.homedir(),r=m.default.tmpdir(),i=e.cwd?e.cwd:e.packageFile?u.default.dirname(e.packageFile):`.`;for(i=u.default.resolve(i);;){let e=await t(i);for(let t of Mn)if(e.includes(t))return{directoryPath:i,filename:t};let a=u.default.resolve(i,`..`);if(a===i||a===n||a===r)break;i=a}}catch{}return null}const Pn={"package-lock":`npm`,yarn:`yarn`,"pnpm-lock":`pnpm`,deno:`deno`,bun:`bun`},Fn=()=>{let e=process.env.npm_config_user_agent??``,t=process.env.npm_execpath??``;return e.startsWith(`yarn/`)||t.includes(`yarn`)||__dirname.includes(`/yarn/`)||__dirname.includes(`\\Yarn\\`)?`yarn`:e.startsWith(`pnpm/`)||t.includes(`pnpm`)||__dirname.includes(`/pnpm/`)||__dirname.includes(`\\pnpm\\`)?`pnpm`:e.startsWith(`bun/`)||typeof Bun<`u`||process.versions.bun||__dirname.includes(`/.bun/`)||__dirname.includes(`\\.bun\\`)?`bun`:`npm`},In=async(e,t=g.default.readdir)=>{if(e.packageManager)return e.packageManager;if(e.global)return Fn();let n=(await Nn(e,t))?.filename;return n?Pn[n.split(`.`)[0]]:`npm`};var Ln=class e{constructor(e,t,n){this.__specs=e||{},this.__opts=t||{},this.__providers=Hn(n.filter(e=>typeof e==`object`&&!!e)),this.__isFiggyPudding=!0}get(e){return Rn(this,e,!0)}toJSON(){let e={};return this.forEach((t,n)=>{e[n]=t}),e}forEach(e,t=this){for(let[n,r]of this.entries())e.call(t,r,n,this)}*entries(e){for(let e of Object.keys(this.__specs))yield[e,this.get(e)];let t=e||this.__opts.other;if(t){let e=new Set;for(let n of this.__providers){let r=n.entries?n.entries(t):Un(n);for(let[n,i]of r)t(n)&&!e.has(n)&&(e.add(n),yield[n,i])}}}concat(...t){return new Proxy(new e(this.__specs,this.__opts,Hn(this.__providers).concat(t)),Bn)}};function Rn(e,t,n){let r=e.__specs[t];r||={};let i;for(let n of e.__providers)if(i=zn(t,n),i!==void 0)break;return i===void 0&&r.default!==void 0?typeof r.default==`function`?r.default(e):r.default:i}function zn(e,t){let n;return n=t.__isFiggyPudding?Rn(t,e,!1):t[e],n}const Bn={get(e,t){return typeof t==`symbol`||t.slice(0,2)===`__`||t in Ln.prototype?e[t]:e.get(t)}};function Vn(e,t){function n(...n){return new Proxy(new Ln(e,t,n),Bn)}return n}function Hn(e){let t=[];return e.forEach(e=>t.unshift(e)),t}function Un(e){return Object.keys(e).map(t=>[t,e[t]])}const Wn=Vn({},{other(){return!0}}),Gn=Vn({cache:{default:j.default.join(process.env.HOME||A.default.homedir(),`.npm`)},configNames:{default:[`npmrc`,`.npmrc`]},envPrefix:{default:/^npm_config_/i},cwd:{default:()=>process.cwd()},globalconfig:{default:()=>j.default.join(Jn(),`etc`,`npmrc`)},userconfig:{default:j.default.join(process.env.HOME||A.default.homedir(),`.npmrc`)}});function Kn(e,t){let n=Gn(t),r={};Object.keys(process.env).forEach(e=>{if(!e.match(n.envPrefix))return;let t=e.toLowerCase().replace(n.envPrefix,``).replace(/(?!^)_/g,`-`);r[t]=process.env[e]});let i=Wn(e),a=n.userconfig||i.userconfig||r.userconfig,o=a&&qn(a),s=n.globalconfig||i.globalconfig||r.globalconfig,c=s&&qn(s),l=(0,O.findUpSync)(n.configNames,{cwd:n.cwd}),u={};l&&l!==a&&(u=qn(l));let d=Wn(n,c,o,u,r,i);return d.cache?d.concat({cache:j.default.resolve(i.cache||r.cache?n.cwd:u.cache?j.default.dirname(l):o.cache?j.default.dirname(a):c.cache?j.default.dirname(s):j.default.dirname(a),d.cache)}):d}function qn(e){let t;try{t=k.default.readFileSync(e,`utf8`)}catch(e){if(e.code===`ENOENT`)return``;throw e}return T.default.parse(t)}function Jn(){if(process.env.PREFIX)return process.env.PREFIX;if(process.platform===`win32`)return j.default.dirname(process.execPath);{let e=j.default.dirname(j.default.dirname(process.execPath));return process.env.DESTDIR&&(e=j.default.join(process.env.DESTDIR,e)),e}}function Yn(e,t){return t.deprecated||!e.deprecated}function Xn(e,t){return t.pre?!0:!e.version||!Vt(e.version)}function Zn(e,t){if(!t)return!0;let n=b.default.minVersion(t)?.version;if(!n)return!0;let r=e?.engines?.node;return!r||b.default.satisfies(n,r)}function Qn(e,t){return t?Object.values(t).every(t=>t[e.name]===void 0||b.default.satisfies(e.version,t[e.name])):!0}function $n(e,t){let n=e.version,r=e?.time?.[n];if(!t)return!0;if(!r)return!1;let i=new Date(r),a=typeof t==`function`?t(e.name)??0:t;return Date.now()-i.getTime()>=a*864e5}function er(e){let t=[t=>Yn(t,e),t=>Xn(t,e),e.enginesNode?t=>Zn(t,e.nodeEngineVersion):null,e.peerDependencies?t=>Qn(t,e.peerDependencies):null,e.cooldown?t=>$n(t,e.cooldown):null];return e=>t.every(t=>t?t(e):!0)}var tr=s({default:()=>gr,defaultPrefix:()=>_r,distTag:()=>Sr,fetchUpgradedPackumentMemo:()=>J,getEngines:()=>br,getPeerDependencies:()=>yr,greatest:()=>vr,latest:()=>Cr,list:()=>xr,minor:()=>Tr,mockFetchUpgradedPackument:()=>pr,newest:()=>wr,normalizeNpmConfig:()=>sr,packageAuthorChanged:()=>dr,parseJson:()=>ur,patch:()=>Er,semver:()=>Dr});const nr=typeof C.default==`function`?C.default:C.default.default,rr=new Set([`-`,`||`,`&&`,`<`,`<=`,`>`,`>=`]),ir=e=>(0,x.parseRange)(e).some(e=>rr.has(e.operator||``)),ar=e=>e&&(!b.default.validRange(e)||Mt(e)),or=async(e,t,n,r={},i)=>{let a=E.default.pickRegistry(e,r),o={"user-agent":r.userAgent||`npm-check-updates/${de} node/${process.version}`,"ncu-version":de,"ncu-pkg-id":`registry:${e}`,accept:r.fullMetadata?`application/json`:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`,...r.headers},s=new URL(encodeURIComponent(e),a.endsWith(`/`)?a:`${a}/`);i&&(s.pathname+=`/${i}`);let c={...r,headers:o,spec:e};try{if(r.fullMetadata)return E.default.json(s.href,c);{n||=`latest`;let r=E.default.json.stream(s.href,`$*`,c),i={name:e};for await(let{key:e,value:n}of r)if(t.includes(e)&&(i[e]=n,Object.keys(i).length===t.length+1))break;return i}}catch(a){if(a.code!==`E404`||r.fullMetadata)throw a;return or(e,t,n,{...r,fullMetadata:!0},i)}},q=(e,t)=>{let n=e.version;return{...e,name:t.name,...t?.time?.[n]?{time:t.time}:null}},sr=(e,t)=>{let n={cafile:e=>{if(!e)return;let n=p.default.readFileSync(u.default.resolve(t||``,(0,D.default)(e)),`utf8`),r=`-----END CERTIFICATE-----`;return{ca:n.split(r).filter(e=>!!e.trim()).map(e=>`${e.trimStart()}${r}`)}},maxsockets:`maxSockets`,"strict-ssl":`strictSSL`},r={all:`boolean`,allowsameversion:`boolean`,audit:`boolean`,binlinks:`boolean`,color:`boolean`,commithooks:`boolean`,description:`boolean`,dev:`boolean`,diffignoreallspace:`boolean`,diffnameonly:`boolean`,diffnoprefix:`boolean`,difftext:`boolean`,dryrun:`boolean`,enginestrict:`boolean`,force:`boolean`,foregroundscripts:`boolean`,formatpackagelock:`boolean`,fund:`boolean`,gittagversion:`boolean`,global:`boolean`,globalstyle:`boolean`,ifpresent:`boolean`,ignorescripts:`boolean`,includestaged:`boolean`,includeworkspaceroot:`boolean`,installlinks:`boolean`,json:`boolean`,legacybundling:`boolean`,legacypeerdeps:`boolean`,link:`boolean`,long:`boolean`,offline:`boolean`,omitlockfileregistryresolved:`boolean`,packagelock:`boolean`,packagelockonly:`boolean`,parseable:`boolean`,preferoffline:`boolean`,preferonline:`boolean`,progress:`boolean`,readonly:`boolean`,rebuildbundle:`boolean`,save:`boolean`,savebundle:`boolean`,savedev:`boolean`,saveexact:`boolean`,saveoptional:`boolean`,savepeer:`boolean`,saveprod:`boolean`,shrinkwrap:`boolean`,signgitcommit:`boolean`,signgittag:`boolean`,strictpeerdeps:`boolean`,strictssl:`boolean`,timing:`boolean`,unicode:`boolean`,updatenotifier:`boolean`,usage:`boolean`,version:`boolean`,versions:`boolean`,workspacesupdate:`boolean`,diffunified:`number`,fetchretries:`number`,fetchretryfactor:`number`,fetchretrymaxtimeout:`number`,fetchretrymintimeout:`number`,fetchtimeout:`number`,logsmax:`number`,maxsockets:`number`,searchlimit:`number`,searchstaleness:`number`,ssopollfrequency:`number`,timeout:`number`},i=e=>!!e&&e!==`false`&&e!==`0`,a=e=>parseInt(e)||0;return P(e,(e,t)=>{let o=typeof t==`string`?r[e.replace(/-/g,``).toLowerCase()]===`boolean`?i(t):r[e.replace(/-/g,``).toLowerCase()]===`number`?a(t):t.replace(/\${([^}]+)}/,(e,t)=>process.env[t]):t,{[e]:s}=n;return typeof s==`string`?{[s]:o}:typeof s==`function`?{...s(o.toString())}:{[e.match(/^[a-z]/i)?nr(e):e]:o}})},cr=(0,w.default)(e=>{let t;if(e)try{t=T.default.parse(p.default.readFileSync(e,`utf-8`))}catch(e){if(e.code===`ENOENT`)return null;throw e}else t={...Kn(null,{userconfig:process.env.npm_config_userconfig||process.env.NPM_CONFIG_USERCONFIG}).toJSON(),cache:!1};return sr(t,e)}),lr=cr();function ur(e,t){let n;try{n=JSON.parse(e)}catch(n){throw Error(`Expected JSON from "${t.command}".${t.packageName?` There could be problems with the ${t.packageName} package.`:``} ${e?`Instead received: `+e:`Received empty response.`}`,{cause:n})}return n}async function dr(e,t,n,r={},i){let a=await or(e,[`versions`],null,{...i,...lr,fullMetadata:!0,...r.registry?{registry:r.registry,silent:!0}:null});if(a.versions){let e=Object.keys(a.versions),r=b.default.minSatisfying(e,t),i=b.default.maxSatisfying(e,n);if(r&&i&&a.versions[r]._npmUser&&a.versions[i]._npmUser)return a.versions[r]._npmUser?.name!==a.versions[i]._npmUser?.name}return!1}const fr=e=>!!(e&&(e.name||e.engines||e.version||e.versions)),pr=e=>(t,n,r,i)=>{let a=typeof e==`function`?e(i)?.[t]:typeof e==`string`||fr(e)?e:e[t],o=fr(a)?a.version:a;if(!o)throw Error(`fetchUpgradedPackument is mocked, but no mock version was supplied for ${t}. Make sure that all dependencies are mocked. `);let s=fr(a)&&a.time?.[o]||new Date().toISOString(),c={name:t,"dist-tags":{[i.distTag||`latest`]:o},engines:{node:``},time:{[o]:s},version:o,versions:{},...fr(a)?a:null},{versions:l,...u}=c;return Promise.resolve({...c,versions:{...fr(a)&&a.versions||{[o]:u}}})},mr=(0,w.default)(({npmConfigLocal:e,npmConfigUser:t,npmConfigWorkspaceProject:n},r)=>{let i=r.packageFile?u.default.join(r.packageFile,`../.npmrc`):null,a=r.packageFile?cr(i||void 0):null,o=r.cwd?u.default.join(r.cwd,`.npmrc`):null,s=r.cwd?cr(o):null;if(n&&Object.keys(n).length>0){V(r,`
|
|
338
|
+
npm config (workspace project):`,`verbose`);let{cache:e,...t}=n;H(r,t,`verbose`)}if(t&&Object.keys(t).length>0){V(r,`
|
|
339
|
+
npm config (user):`,`verbose`);let{cache:e,...n}=t;H(r,n,`verbose`)}if(e&&Object.keys(e).length>0){V(r,`
|
|
340
|
+
npm config (local override):`,`verbose`);let{cache:t,...n}=e;H(r,n,`verbose`)}if(a&&Object.keys(a).length>0){V(r,`\nnpm config (project: ${i}):`,`verbose`);let{cache:e,...t}=a;H(r,t,`verbose`)}if(s&&Object.keys(s).length>0){V(r,`\nnpm config (cwd: ${o}):`,`verbose`);let{cache:e,...t}=s;H(r,t,`verbose`)}let c={...n,...t,...e,...a,...s,...r.registry?{registry:r.registry,silent:!0}:null,...r.timeout?{timeout:r.timeout}:null};if(n||e||a||s){V(r,`
|
|
341
|
+
merged npm config:`,`verbose`);let{cache:e,...t}=c;H(r,t,`verbose`)}return c});async function hr(e,t,n,r,i=0,a,o){if(process.env.STUB_VERSIONS)return pr(JSON.parse(process.env.STUB_VERSIONS))(e,t,n,r);if(ar(n))return Promise.resolve({});let s=r.format?.includes(`time`)&&!t.includes(`time`)?[...t,`time`]:t,c=s.includes(`time`),l=mr({npmConfigUser:{...lr,fullMetadata:c},npmConfigLocal:a,npmConfigWorkspaceProject:o},r),u;try{let n=r.distTag||`latest`;u=await or(e,Array.from(new Set([`dist-tags`,...t,...r.deprecated?[]:[`deprecated`,`versions`],...r.enginesNode?[`engines`,`versions`]:[]])),c?null:n,l)}catch(t){if(r.retry&&++i<=r.retry)return hr(e,s,n,r,i,a);throw t}return u}const J=(0,w.default)(hr,{serializer:(([e,t,n,r,i,a,o])=>{let{packageFile:s,...c}=r;return JSON.stringify([e,t,ar(n),c,i,a,o])})});async function gr(e,t={},n={},r={}){let{stdout:i}=await(0,f.default)(process.platform===`win32`?`npm.cmd`:`npm`,[...t.global?[`--global`]:[],...t.prefix?[`--prefix=${t.prefix}`]:[],`--json`,...Array.isArray(e)?e:[e]],n,r);return i}async function _r(e){if(e.prefix)return Promise.resolve(e.prefix);let t=process.platform===`win32`?`npm.cmd`:`npm`,n;try{let{stdout:e}=await(0,f.default)(t,[`config`,`get`,`prefix`]);n=e}catch(t){V(e,"Error executing `npm config get prefix`. Caught and ignored. Unsolved: https://github.com/raineorshine/npm-check-updates/issues/703. ERROR: "+(t.message||t||``).toString(),`verbose`,`error`)}return e.global&&n?.match(`Cellar`)?`/usr/local`:process.platform===`win32`&&e.global&&!process.env.prefix?n?n.trim():`${process.env.AppData}\\npm`:void 0}const vr=async(e,t,n={},r,i)=>{let a=[`versions`];n.cooldown&&a.push(`time`);let o=await J(e,a,t,n,0,r,i),s=o?.versions;return{version:Object.values(s||{}).filter(e=>er(n)(q(e,o))).map(e=>e.version).sort(zt).at(-1)||null}},yr=async(e,t,n)=>{let r=[`view`,`${e}@${t}`,`peerDependencies`],i=await gr(r,{},{rejectOnError:!1},n);return i?ur(i,{command:[...r,`--json`].join(` `)}):{}},br=async(e,t,n={},r)=>(await or(e,[`engines`],null,{...r,...lr,...n.registry?{registry:n.registry,silent:!0}:null},t)).engines||{},xr=async(e={})=>{let t=ur(await gr([`ls`,`--depth=0`],{...e.global?{global:!0}:null,...e.prefix?{prefix:e.prefix}:null},{rejectOnError:!1},{...e.cwd?{cwd:e.cwd}:null}),{command:`npm${process.platform===`win32`?`.cmd`:``} ls --json${e.global?` --global`:``}`}).dependencies;return P(t,(e,t)=>({[e]:t.version||t.required?.version}))},Sr=async(e,t,n={},r,i)=>{let a=[`dist-tags`];n.cooldown&&a.push(`time`);let o=await J(e,a,t,n,0,r,i),s=o?.[`dist-tags`]?.[n.distTag||`latest`],c=o?.versions?o.versions?.[s]:{name:e,version:s},l=q(c,o);return c&&er(n)(l)?{version:c.version,...o?.time?.[s]?{time:o.time[s]}:null}:n.cooldown||n.distTag&&n.distTag!==`latest`?{}:vr(e,t,n,r,i)},Cr=async(e,t,n={},r,i)=>Sr(e,t,{...n,distTag:`latest`},r,i),wr=async(e,t,n={},r,i)=>{let a=await J(e,[`time`,`versions`],t,n,0,r,i),o=P(a?.versions||{},(e,t)=>Zn(t,n.nodeEngineVersion)?{[t.version]:!0}:null),s=I(a?.time||{},e=>o[e]&&(n.pre!==!1||!Vt(e))),c=xt(Object.entries(s),e=>e[1]).map(([e])=>e);return n.cooldown?{version:c.filter(e=>$n(q(a.versions[e],a),n.cooldown)).at(-1)}:{version:c.at(-1)}},Tr=async(e,t,n={},r,i)=>{let a=[`versions`];n.cooldown&&a.push(`time`);let o=await J(e,a,t,n,0,r,i),s=o?.versions;return{version:Bt(Object.values(s||{}).filter(e=>er(n)(q(e,o))).map(e=>e.version),t,`minor`)}},Er=async(e,t,n={},r,i)=>{let a=[`versions`];n.cooldown&&a.push(`time`);let o=await J(e,a,t,n,0,r,i),s=o?.versions;return{version:Bt(Object.values(s||{}).filter(e=>er(n)(q(e,o))).map(e=>e.version),t,`patch`)}},Dr=async(e,t,n={},r,i)=>{let a=[`versions`];n.cooldown&&a.push(`time`);let o=await J(e,a,t,n,0,r,i),s=o?.versions;if(ir(t))return{version:null};let c=Object.values(s||{}).filter(e=>er(n)(q(e,o))).map(e=>e.version);return{version:b.default.maxSatisfying(c,t)}};var Or=s({default:()=>kr,defaultPrefix:()=>Ar,distTag:()=>Sr,getEngines:()=>br,getPeerDependencies:()=>yr,greatest:()=>vr,latest:()=>Cr,list:()=>jr,minor:()=>Tr,newest:()=>wr,packageAuthorChanged:()=>dr,patch:()=>Er,semver:()=>Dr});async function kr(e,t={},n={},r={}){return(0,f.default)(`bun`,[...t.global?[`--global`]:[],...t.prefix?[`--prefix=${t.prefix}`]:[],...Array.isArray(e)?e:[e]],n,r)}const Ar=async e=>e.global?e.prefix||process.env.BUN_INSTALL||u.default.dirname((await(0,f.default)(`bun`,[`pm`,`-g`,`bin`])).stdout):void 0,jr=async(e={})=>{let{default:t}=await Promise.resolve().then(()=>require(`./strip-ansi.cjs`)),{stdout:n}=await kr([`pm`,`ls`],{...e.global?{global:!0}:null,...e.prefix?{prefix:e.prefix}:null},{rejectOnError:!1},{env:{...process.env,NO_COLOR:`1`},...e.cwd?{cwd:e.cwd}:null});return P(t(n).split(`
|
|
342
|
+
`),e=>{let t=e.match(/.* (.+?)@(.+)/);if(t){let[,e,n]=t;return{[e]:n}}return null})};var Mr=s({default:()=>Hr,defaultPrefix:()=>_r,distTag:()=>Fr,getEngines:()=>br,getPeerDependencies:()=>yr,greatest:()=>Ir,latest:()=>Lr,list:()=>Pr,minor:()=>Rr,newest:()=>zr,packageAuthorChanged:()=>dr,patch:()=>Br,semver:()=>Vr,supportsCatalogs:()=>Ur});const Nr=(0,w.default)(async e=>{let t=await(0,O.findUp)(`pnpm-workspace.yaml`);if(!t)return{};let n=u.default.dirname(t),r=u.default.join(n,`.npmrc`),i;try{i=await g.default.readFile(r,`utf-8`)}catch{return{}}V(e,`\nUsing pnpm workspace config at ${r}:`,`verbose`);let a=sr(T.default.parse(i),n);return V(e,a,`verbose`),a}),Pr=async(e={})=>{if(!e.global)return xr(e);let{stdout:t}=await(0,f.default)(process.platform===`win32`?`pnpm.cmd`:`pnpm`,[`ls`,`-g`,`--json`]);return P(JSON.parse(t)[0].dependencies||{},(e,{version:t})=>({[e]:t}))},Y=e=>async(t,n,r={})=>e(t,n,r,{},await Nr(r)),Fr=Y(Sr),Ir=Y(vr),Lr=Y(Cr),Rr=Y(Tr),zr=Y(wr),Br=Y(Er),Vr=Y(Dr);async function Hr(e,t={},n,r){let{stdout:i}=await(0,f.default)(process.platform===`win32`?`pnpm.cmd`:`pnpm`,[...t.global?`global`:[],...Array.isArray(e)?e:[e],...t.prefix?`--prefix=${t.prefix}`:[]],r,n);return i}async function Ur(){try{let{stdout:e}=await(0,f.default)(`pnpm`,[`--version`]),[t,n]=e.trim().split(`.`).map(Number);return t>8||t===8&&n>=6}catch{return!1}}var Wr=o(((e,t)=>{function n(e){return e}t.exports=n})),Gr=o(((e,t)=>{t.exports=Be()(R(),`WeakMap`)})),Kr=o(((e,t)=>{var n=Gr();t.exports=n&&new n})),qr=o(((e,t)=>{var n=Wr(),r=Kr();t.exports=r?function(e,t){return r.set(e,t),e}:n})),Jr=o(((e,t)=>{var n=Ne(),r=Object.create;t.exports=function(){function e(){}return function(t){if(!n(t))return{};if(r)return r(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}()})),Yr=o(((e,t)=>{var n=Jr(),r=Ne();function i(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var i=n(e.prototype),a=e.apply(i,t);return r(a)?a:i}}t.exports=i})),Xr=o(((e,t)=>{var n=Yr(),r=R(),i=1;function a(e,t,a){var o=t&i,s=n(e);function c(){return(this&&this!==r&&this instanceof c?s:e).apply(o?a:this,arguments)}return c}t.exports=a})),Zr=o(((e,t)=>{function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}t.exports=n})),Qr=o(((e,t)=>{var n=Math.max;function r(e,t,r,i){for(var a=-1,o=e.length,s=r.length,c=-1,l=t.length,u=n(o-s,0),d=Array(l+u),f=!i;++c<l;)d[c]=t[c];for(;++a<s;)(f||a<o)&&(d[r[a]]=e[a]);for(;u--;)d[c++]=e[a++];return d}t.exports=r})),$r=o(((e,t)=>{var n=Math.max;function r(e,t,r,i){for(var a=-1,o=e.length,s=-1,c=r.length,l=-1,u=t.length,d=n(o-c,0),f=Array(d+u),p=!i;++a<d;)f[a]=e[a];for(var m=a;++l<u;)f[m+l]=t[l];for(;++s<c;)(p||a<o)&&(f[m+r[s]]=e[a++]);return f}t.exports=r})),ei=o(((e,t)=>{function n(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}t.exports=n})),ti=o(((e,t)=>{function n(){}t.exports=n})),ni=o(((e,t)=>{var n=Jr(),r=ti(),i=4294967295;function a(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=i,this.__views__=[]}a.prototype=n(r.prototype),a.prototype.constructor=a,t.exports=a})),ri=o(((e,t)=>{function n(){}t.exports=n})),ii=o(((e,t)=>{var n=Kr(),r=ri();t.exports=n?function(e){return n.get(e)}:r})),ai=o(((e,t)=>{t.exports={}})),oi=o(((e,t)=>{var n=ai(),r=Object.prototype.hasOwnProperty;function i(e){for(var t=e.name+``,i=n[t],a=r.call(n,t)?i.length:0;a--;){var o=i[a],s=o.func;if(s==null||s==e)return o.name}return t}t.exports=i})),si=o(((e,t)=>{var n=Jr(),r=ti();function i(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}i.prototype=n(r.prototype),i.prototype.constructor=i,t.exports=i})),ci=o(((e,t)=>{function n(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}t.exports=n})),li=o(((e,t)=>{var n=ni(),r=si(),i=ci();function a(e){if(e instanceof n)return e.clone();var t=new r(e.__wrapped__,e.__chain__);return t.__actions__=i(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}t.exports=a})),ui=o(((e,t)=>{var n=ni(),r=si(),i=ti(),a=L(),o=Ae(),s=li(),c=Object.prototype.hasOwnProperty;function l(e){if(o(e)&&!a(e)&&!(e instanceof n)){if(e instanceof r)return e;if(c.call(e,`__wrapped__`))return s(e)}return new r(e)}l.prototype=i.prototype,l.prototype.constructor=l,t.exports=l})),di=o(((e,t)=>{var n=ni(),r=ii(),i=oi(),a=ui();function o(e){var t=i(e),o=a[t];if(typeof o!=`function`||!(t in n.prototype))return!1;if(e===o)return!0;var s=r(o);return!!s&&e===s[0]}t.exports=o})),fi=o(((e,t)=>{var n=800,r=16,i=Date.now;function a(e){var t=0,a=0;return function(){var o=i(),s=r-(o-a);if(a=o,s>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}t.exports=a})),pi=o(((e,t)=>{var n=qr();t.exports=fi()(n)})),mi=o(((e,t)=>{var n=/\{\n\/\* \[wrapped with (.+)\] \*/,r=/,? & /;function i(e){var t=e.match(n);return t?t[1].split(r):[]}t.exports=i})),hi=o(((e,t)=>{var n=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function r(e,t){var r=t.length;if(!r)return e;var i=r-1;return t[i]=(r>1?`& `:``)+t[i],t=t.join(r>2?`, `:` `),e.replace(n,`{
|
|
343
343
|
/* [wrapped with `+t+`] */
|
|
344
|
-
`)}t.exports=r})),
|
|
345
|
-
Merged yarn config in npm format:`,`verbose`),B(e,l,`verbose`)),l});function Xi(e){return new Promise((t,n)=>{let r={},i=N.default.parse();i.on(`data`,e=>{if(e.type===`info`&&!e.data.match(/^Visit/)){let[,t,n]=e.data.match(/"(@?.*)@(.*)"/)||[];r[t]={version:n,from:t}}else e.type===`error`&&n(Error(e.data))}),i.on(`end`,()=>{t({dependencies:r})}),i.on(`error`,n),i.write(e),i.end()})}function Zi(e){return new Promise((t,n)=>{let r=N.default.parse(),i=!1;r.on(`data`,e=>{i||(i=!0,t(JSON.stringify(e)))}),r.on(`error`,n),r.write(e),r.end()})}const Qi=process.platform===`win32`?`yarn.cmd`:`yarn`;async function $i(e,t={},n={},r={}){let{stdout:i}=await(0,f.default)(Qi,[...t.global?[`global`]:[],...t.prefix?[`--prefix=${t.prefix}`]:[],`--depth=0`,`--json`,`--no-progress`,...Array.isArray(e)?e:[e]],n,r);return i}async function ea(e){if(e.prefix)return Promise.resolve(e.prefix);let{stdout:t}=await(0,f.default)(Qi,[`global`,`dir`]).catch(()=>({stdout:null}));return e.global&&t&&t.match(`Cellar`)?`/usr/local`:process.platform===`win32`&&e.global&&!process.env.prefix?t?t.trim():`${process.env.LOCALAPPDATA}\\Yarn\\Data\\global`:null}const ta=async(e={},t)=>P((await Xi(await $i(`list`,e,{},{...e.cwd?{cwd:e.cwd}:{},...t}))).dependencies,(e,t)=>({[e]:t.version||t.required?.version})),X=e=>async(t,n,r={})=>e(t,n,r,await Yi(r)),na=X(Sr),ra=X(vr),ia=X(Cr),aa=X(Tr),oa=X(wr),sa=X(Er),ca=X(Dr),la=async(e,t,n)=>{let{stdout:r}=await(0,f.default)(Qi,[`--version`],{rejectOnError:!1},n);if(r.startsWith(`1`)){let r=[`--json`,`info`,`${e}@${t}`,`peerDependencies`],{stdout:i}=await(0,f.default)(Qi,r,{rejectOnError:!1},n);return i&&q(i,{command:r.join(` `)}).data||{}}else{let r=[`--json`,`npm`,`info`,`${e}@${t}`,`--fields`,`peerDependencies`],{stdout:i}=await(0,f.default)(Qi,r,{rejectOnError:!1},n);if(!i)return{};try{return q(i,{command:r.join(` `)}).peerDependencies||{}}catch(e){try{let e=await Zi(i);if(e)return q(e,{command:r.join(` `)}).peerDependencies||{}}catch{}throw e}}},ua=async(e,t,n={})=>br(e,t,n,await Yi(n)),da=async(e,t,n,r={})=>dr(e,t,n,r,await Yi(r));function Z(e,t,{color:n=!0}={}){if(e.cli)B(e,n?F.red(t):t,null,`error`),process.exit(1);else throw Error(t)}const fa=async(e,t)=>{let n,r;try{r=await g.default.readFile(t,`utf-8`),n=JSON.parse(r)}catch{Z(e,`Missing or invalid ${t}`)}return{name:void 0,pkg:n,pkgFile:r,filepath:t}},pa={dev:`devDependencies`,peer:`peerDependencies`,prod:`dependencies`,optional:`optionalDependencies`},ma=e=>(e?typeof e==`string`?e.split(`,`):e:G.dep.default).map(e=>pa[e]||e);function ha(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)}async function ga(e,t,n){let r=await g.default.readFile(e,`utf-8`);return Object.entries(n).filter(([e])=>t[e]).reduce((e,[n,r])=>{let i=t[n],a=`(${ha(n)}\\s*:\\s*["'])(${ha(i)})(["'])`,o=`(${ha(n)}\\s*:\\s*)(${ha(i)})(\\s*(?:\\n|$))`,s=new RegExp(a,`g`),c=new RegExp(o,`g`);return e.replace(s,`$1${r}$3`).replace(c,`$1${r}$3`)},r)}async function _a(e,t,n){let r=await g.default.readFile(e,`utf-8`);return Object.entries(n).filter(([e])=>t[e]).reduce((e,[n,r])=>{let i=t[n],a=`("${ha(n)}"\\s*:\\s*")(${ha(i)})(")`,o=new RegExp(a,`g`);return e.replace(o,`$1${r}$3`)},r)}async function va(e,t,n){let r=u.default.extname(e);if(r===`.yaml`||r===`.yml`)return ga(e,t,n);if(r===`.json`)return _a(e,t,n);throw Error(`Unsupported catalog file type: ${e}`)}function ya(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)}async function ba(e,t,n,r,i){if(i){let r=u.default.basename(i),a=u.default.extname(i);if(i.includes(`#catalog`)){let e=i.replace(`#catalog`,``);if(u.default.extname(e)===`.json`)return va(e,t,n)}if(r===`pnpm-workspace.yaml`||r.includes(`catalog`)&&(a===`.yaml`||a===`.yml`)){let r=JSON.parse(e);if(typeof r==`object`&&r.name===`catalog-dependencies`&&typeof r.dependencies==`object`&&Object.keys(r).length<=3){let e=await g.default.readFile(i,`utf-8`),t=M.default.load(e);if(t.catalogs&&=Object.entries(t.catalogs).reduce((e,[t,r])=>({...e,[t]:{...r,...Object.entries(n).filter(([e])=>r[e]).reduce((e,[t,n])=>({...e,[t]:n}),{})}}),{}),t.catalog){let e=t.catalog;t.catalog={...e,...Object.entries(n).filter(([t])=>e[t]).reduce((e,[t,n])=>({...e,[t]:n}),{})}}return t.catalogs?.default&&(t.catalog=t.catalogs.default),JSON.stringify(t,null,2)}return va(i,t,n)}if(a===`.json`){let r=JSON.parse(e),a=r.catalog||r.catalogs,o=r.workspaces&&!Array.isArray(r.workspaces)&&(r.workspaces.catalog||r.workspaces.catalogs);if(a||o)return va(i,t,n)}}let a=[...ma(r.dep),`overrides`],o=RegExp(`"(${a.join(`|`)})"s*:[^}]*`,`g`),s=e.replace(o,e=>Object.entries(n).reduce((e,[r])=>{let i=`"${r}"\\s*:\\s*("|{\\s*"."\\s*:\\s*")(${ya(t[r])})"`,a=new RegExp(i,`g`);return e.replace(a,(e,t)=>`"${r}${t?`": ${t}`:`: `}${n[r]}"`)},e));if(a.includes(`packageManager`)){let t=JSON.parse(e);if(t.packageManager){let[e]=t.packageManager.split(`@`);n[e]&&(s=s.replace(/"packageManager"\s*:\s*".*?@[^"]*"/,`"packageManager": "${e}@${n[e]}"`))}}return s}const xa=(e,t,n,{spawnOptions:r,spawnPleaseOptions:i}={})=>{n&&console.log(F.blue([t.packageManager,...e].join(` `)));let a={cwd:t.cwd||process.cwd(),env:{...process.env,...t.packageManager===`pnpm`?null:{CI:`1`},FORCE_COLOR:`1`,...r?.env},...r},o={...t.global?{global:!0}:null,...t.prefix?{prefix:t.prefix}:null};return(t.packageManager===`pnpm`?Hr:t.packageManager===`yarn`?$i:t.packageManager===`bun`?kr:gr)(e,o,i,a)},Sa=async e=>{(e.packageData||e.packageFile)&&(console.error(`--packageData and --packageFile are not allowed with --doctor. You must execute "ncu --doctor" in a directory with a package file so it can install dependencies and test them.`),process.exit(1));let t;try{t=await fa(e,`package.json`)}catch{console.error(`Missing or invalid package.json`),process.exit(1)}return!e.doctorTest&&!t.pkg.scripts?.test&&(console.error(`No npm "test" script defined. You must define a "test" script in the "scripts" section of your package.json to use --doctor.`),process.exit(1)),t},Ca=async(e,t)=>{await ve();let n=t.packageManager===`yarn`?`yarn.lock`:t.packageManager===`pnpm`?`pnpm-lock.yaml`:t.packageManager===`bun`?`bun.lock`:`package-lock.json`,{pkg:r,pkgFile:i}=await Sa(t),a={...r.dependencies,...r.devDependencies,...r.optionalDependencies},o=async()=>{if(t.doctorInstall){let[e,...n]=t.doctorInstall.split(` `);console.log(F.blue(t.doctorInstall)),await(0,f.default)(e,n)}else await xa([`install`],{packageManager:t.packageManager},!0)},s=async()=>{let e={stderr:e=>{console.error(F.red(e.toString()))},stdout:e=>{process.stdout.write(e.toString())}};if(t.doctorTest){let n=t.doctorTest.matchAll(/"(.+?)"|'(.+?)'|[^ ]+/g),r=[];for(let e of n)r=[...r,e[2]||e[1]||e[0]];let[i,...a]=r;console.log(F.blue(t.doctorTest)),await(0,f.default)(i,a,e)}else await xa([`run`,`test`],{packageManager:t.packageManager},!0,{spawnPleaseOptions:e})};console.log(`Running tests before upgrading`),await o();let c=``;try{c=await g.default.readFile(n,`utf-8`)}catch{if(t.packageManager===`bun`){n=`bun.lockb`;try{c=await g.default.readFile(n,`utf-8`)}catch{}}}try{await s()}catch{console.error(`Tests failed before we even got started!`),process.exit(1)}t.interactive||console.log(`Upgrading all dependencies and re-running tests`),console.log(F.blue(`ncu `+process.argv.slice(2).filter(e=>e!==`--doctor`).join(` `))),process.env.NCU_DOCTOR=`1`;let l=await e({...t,silent:!0,doctor:!1});if(Object.keys(l||{}).length===0){console.log(`All dependencies are up-to-date `+F.green.bold(`:)`));return}let u=!1;try{await o(),u=!0,await s(),console.log(`${F.green(`✓`)} Tests pass`),await gn(t,{current:a,upgraded:l,total:Object.keys(l||{}).length}),console.log(`\n${t.interactive?`Chosen`:`All`} dependencies upgraded and installed ${F.green(`:)`)}`)}catch{console.error(F.red(u?`Tests failed`:`Install failed`)),console.log(`Identifying broken dependencies`),await g.default.writeFile(`package.json`,i),c?await g.default.writeFile(n,c):await g.default.rm(n,{recursive:!0,force:!0});let e=i;if(u)try{await o()}catch{let e=(t.packageManager||`npm`)+` install`;throw Error(`Error: Doctor mode was about to test individual upgrades, but ${F.cyan(e)} failed after rolling back to your existing package and lock files. This is unexpected since the initial install before any upgrades succeeded. Either npm failed to revert a partial install, or failed anomalously on the second run. Please check your internet connection and retry. If doctor mode fails consistently, report a bug with your complete list of dependency versions at https://github.com/raineorshine/npm-check-updates/issues.`)}let d,f;for([d,f]of Object.entries(l))try{if(await xa([...t.packageManager===`yarn`||t.packageManager===`pnpm`||t.packageManager===`bun`?[`add`]:[`install`,`--no-save`],`${d}@${f}`],{packageManager:t.packageManager},!0),r.scripts?.prepare)try{await xa([`run`,`prepare`],{packageManager:t.packageManager},!0)}catch(e){throw console.error(F.red(`Prepare script failed`)),e}await s(),console.log(` ${F.green(`✓`)} ${d} ${a[d]} → ${f}`),e=await ba(e,{[d]:a[d]},{[d]:f},t),c=await g.default.readFile(n,`utf-8`)}catch(r){console.error(` ${F.red(`✗`)} ${d} ${a[d]} → ${f}\n`),console.error(F.red(r)),await g.default.writeFile(n,c),(t.packageManager===`yarn`||t.packageManager===`pnpm`||t.packageManager===`bun`)&&await g.default.writeFile(`package.json`,e)}e!==i&&(console.log(`Saving partially upgraded package.json`),await g.default.writeFile(`package.json`,e)),await o()}};async function wa(e){let t,n=null,r=e.packageFile||`package.json`;function i(t,n){if(t!=null){let n=u.default.resolve(t);B(e,`${e.upgrade?`Upgrading`:`Checking`} ${n}`)}else Z(e,`${F.red(`No ${n}`)}\n\nPlease add a ${n} to the current directory, specify the ${F.cyan(`--packageFile`)} or ${F.cyan(`--packageData`)} options, or pipe a ${n} to stdin and specify ${F.cyan(`--stdin`)}.`,{color:!1});return g.default.readFile(t,`utf-8`).catch(t=>{Z(e,t)})}if(B(e,`Running in local mode`,`verbose`),B(e,`Finding package file data`,`verbose`),e.packageData)n=null,t=Promise.resolve(e.packageData);else if(e.packageFile)n=e.packageFile,t=i(n,r);else if(e.stdin){B(e,`Waiting for package data on stdin`,`verbose`);let a=await(0,ee.text)(process.stdin),o=a.trim().length>0?a:null;n=o||!r?null:await(0,O.findUp)(r),t=o||i(await n,r)}else n=r?await(0,O.findUp)(!e.packageFile&&e.packageManager===`deno`?[`deno.json`,`deno.jsonc`]:r,{cwd:e.cwd||process.cwd()}):null,t=i(n,r);return{pkgData:await t,pkgFile:n||null,pkgPath:r}}function Ta(e){return{ignore:[`**/node_modules/**`,...typeof e.ignore==`string`?[e.ignore]:e.ignore||[]]}}const Ea=async e=>{let t=u.default.join(u.default.dirname(e),`pnpm-workspace.yaml`),n;try{n=await g.default.readFile(t,`utf-8`)}catch{return null}return M.default.load(n)},Da=async(e,t)=>{let n={};if(e.packageManager===`pnpm`){let e=await Ea(t);e&&!Array.isArray(e)&&(e.catalog&&Object.assign(n,e.catalog),e.catalogs&&Object.assign(n,...Object.values(e.catalogs)))}let r=JSON.parse(await g.default.readFile(t,`utf-8`));return Object.assign(n,r.catalog,...Object.values(r.catalogs??{})),r.workspaces&&!Array.isArray(r.workspaces)&&Object.assign(n,r.workspaces.catalog,...Object.values(r.workspaces.catalogs??{})),Object.keys(n).length>0?n:null};async function Oa(e,t,n,r){let{pkgData:i,pkgPath:a}=await wa({...e,packageFile:n,loglevel:`silent`}),o=(typeof i==`string`?JSON.parse(i):i).workspaces||await Ea(a||``),s=Array.isArray(o)?o:o?.packages;s||Z(e,`workspaces property missing from package.json. --workspace${e.workspaces?`s`:``} only works when you specify a "workspaces" property in your package.json.`);let c=(s||[]).map(e=>u.default.join(r,e,`package.json`).replace(/\\/g,`/`)),l=Ta(e),d=te.default.sync(c,l),f=await Promise.all(d.map(async t=>{let n=await fa(e,t);return n.name=n.pkg.name||t.split(`/`).slice(-2)[0],n})),p=f.map(e=>e.name||``);return e.workspaces===!0?[f,p]:[f.filter(n=>e.workspace?.some(e=>s?.some(i=>n.name===e||n.filepath===u.default.join(r,u.default.dirname(i),e,t).replace(/\\/g,`/`)))),p]}async function ka(e,t){if(!t)return null;let n=await Da(e,t);if(!n)return null;let r={name:`catalog-dependencies`,version:`1.0.0`,dependencies:n};return{filepath:e.packageManager===`pnpm`?u.default.join(u.default.dirname(t),`pnpm-workspace.yaml`):`${t}#catalog`,pkg:r,pkgFile:JSON.stringify(r,null,2),name:`catalogs`}}async function Aa(e){let t=e.packageFile||`package.json`,n=e.cwd?(0,D.default)(e.cwd):`./`,r=e.packageFile||(e.cwd?u.default.join(n,`package.json`):`package.json`),i=e.workspaces===!0||e.workspace!==void 0&&e.workspace.length!==0,a=[];if(!i||e.root===!0){let t=r.replace(/\\/g,`/`),n=Ta(e),i=te.default.sync(t,n),o=await Promise.all(i.map(async t=>await fa(e,t)));a=[...a,...o]}if(!i)return[a,[]];let o=null;if(i){let{pkgPath:t}=await wa({...e,packageFile:r,loglevel:`silent`});t&&(o=await ka(e,t))}let[s,c]=await Oa(e,t,r,n);if(a=[...a,...s],o&&(a=[...a,o]),e.ignore){let t=Array.isArray(e.ignore)?e.ignore:[e.ignore];a=a.filter(e=>{let r=u.default.relative(n,e.filepath).replace(/\\/g,`/`),i=u.default.dirname(r).replace(/\\/g,`/`);return!t.some(e=>{let t=(0,ne.default)(e);return t(r)||t(i)||t(`${i}/`)})})}return[a,c]}async function ja({configFileName:e,configFilePath:t,packageFile:n,global:r,options:i}){let{default:a,Chalk:o}=await import(`chalk`),s=i?.color?new o({level:1}):a,c=(0,re.rcFile)(`ncurc`,{configFileName:e||`.ncurc`,defaultExtension:[`.json`,`.yml`,`.js`],cwd:t||(r?m.default.homedir():n?u.default.dirname(n):void 0)}),l=c?.filePath;e&&!l&&Z(i,`Config file ${e} not found in ${t||process.cwd()}`);let{$schema:d,...f}=c?.config||{},p=f;typeof p.format==`string`&&(p.format=G.format.parse(p.format));let h=Object.keys(p).filter(e=>!G[e]);return h.length>0&&(console.error(s.red(`Unknown option${h.length===1?``:`s`} found in config file:`),s.gray(h.join(`, `))),console.info(`Using config file `+l),console.info(`You can change the config file path with ${s.blue(`--configFilePath`)}`)),{filePath:l,args:Object.entries(p).flatMap(([e,t])=>typeof t==`boolean`||G[e]?.type===`boolean`?t?[`--${e}`]:[]:[`--${e}`,t]),config:p}}var Ma=s({greatest:()=>La,greatestLevel:()=>Ra,latest:()=>Ia,minor:()=>za,newest:()=>Ha,patch:()=>Ba,semver:()=>Va});const Na=(0,oe.promisify)(ae.default.execFile);async function Pa(e){let t=(await Na(`git`,[`ls-remote`,`--tags`,e])).stdout,n={};for(let e of t.trim().split(`
|
|
346
|
-
`)){let t=e.split(` `);n[t[1].replace(/^refs\/tags\/|\^{}$/g,``)]=t[0]}return n}async function
|
|
347
|
-
See: https://github.com/raineorshine/npm-check-updates/issues/759#issuecomment-723587297`):a.packageFile&&a.deep?Z(a,`Cannot specify both --packageFile and --deep. --deep is an alias for --packageFile '**/package.json'`):a.format?.includes(`lines`)&&a.jsonUpgraded?Z(a,`Cannot specify both --format lines and --jsonUpgraded.`):a.format?.includes(`lines`)&&a.jsonAll?Z(a,`Cannot specify both --format lines and --jsonAll.`):a.format?.includes(`lines`)&&a.format.length>1?Z(a,`Cannot use --format lines with other formatting options.`):a.workspace?.length&&a.workspaces?Z(a,`Cannot specify both --workspace and --workspaces.`):a.deep&&(a.workspace?.length||a.workspaces)?Z(a,`Cannot specify both --deep and --workspace${a.workspaces?`s`:``}.`):a.doctor&&(a.workspace?.length||a.workspaces)?Z(a,`Doctor mode is not currently supported with --workspace${a.workspaces?`s`:``}.`):a.packageManager===`staticRegistry`&&!a.registry?Z(a,`When --package-manager staticRegistry is specified, you must provide the path for the registry file with --registry.`):a.registryType===`json`&&!a.registry?Z(a,`When --registryType json is specified, you must provide the path for the registry file with --registry. Run "ncu --help registryType" for details.`):m!==`json`&&a.registry&&!
|
|
348
|
-
Supported version targets are: `+e.join(`, `)+(h?``:`, and tags (e.g. @next)`),{color:!1})}try{m=await v(a,c,{...t,distTag:f,pre:t.pre==null?u.startsWith(`@`)||
|
|
344
|
+
`)}t.exports=r})),gi=o(((e,t)=>{function n(e){return function(){return e}}t.exports=n})),_i=o(((e,t)=>{var n=Be();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),vi=o(((e,t)=>{var n=gi(),r=_i(),i=Wr();t.exports=r?function(e,t){return r(e,`toString`,{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i})),yi=o(((e,t)=>{var n=vi();t.exports=fi()(n)})),bi=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}t.exports=n})),xi=o(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}t.exports=n})),Si=o(((e,t)=>{function n(e){return e!==e}t.exports=n})),Ci=o(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}t.exports=n})),wi=o(((e,t)=>{var n=xi(),r=Si(),i=Ci();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),Ti=o(((e,t)=>{var n=wi();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),Ei=o(((e,t)=>{var n=bi(),r=Ti(),i=[[`ary`,128],[`bind`,1],[`bindKey`,2],[`curry`,8],[`curryRight`,16],[`flip`,512],[`partial`,32],[`partialRight`,64],[`rearg`,256]];function a(e,t){return n(i,function(n){var i=`_.`+n[0];t&n[1]&&!r(e,i)&&e.push(i)}),e.sort()}t.exports=a})),Di=o(((e,t)=>{var n=mi(),r=hi(),i=yi(),a=Ei();function o(e,t,o){var s=t+``;return i(e,r(s,a(n(s),o)))}t.exports=o})),Oi=o(((e,t)=>{var n=di(),r=pi(),i=Di(),a=1,o=2,s=4,c=8,l=32,u=64;function d(e,t,d,f,p,m,h,g,_,v){var y=t&c,b=y?h:void 0,x=y?void 0:h,S=y?m:void 0,C=y?void 0:m;t|=y?l:u,t&=~(y?u:l),t&s||(t&=~(a|o));var w=[e,t,p,S,b,C,x,g,_,v],T=d.apply(void 0,w);return n(e)&&r(T,w),T.placeholder=f,i(T,e,t)}t.exports=d})),ki=o(((e,t)=>{function n(e){return e.placeholder}t.exports=n})),Ai=o(((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(e,t){var i=typeof e;return t??=n,!!t&&(i==`number`||i!=`symbol`&&r.test(e))&&e>-1&&e%1==0&&e<t}t.exports=i})),ji=o(((e,t)=>{var n=ci(),r=Ai(),i=Math.min;function a(e,t){for(var a=e.length,o=i(t.length,a),s=n(e);o--;){var c=t[o];e[o]=r(c,a)?s[c]:void 0}return e}t.exports=a})),Mi=o(((e,t)=>{var n=`__lodash_placeholder__`;function r(e,t){for(var r=-1,i=e.length,a=0,o=[];++r<i;){var s=e[r];(s===t||s===n)&&(e[r]=n,o[a++]=r)}return o}t.exports=r})),Ni=o(((e,t)=>{var n=Qr(),r=$r(),i=ei(),a=Yr(),o=Oi(),s=ki(),c=ji(),l=Mi(),u=R(),d=1,f=2,p=8,m=16,h=128,g=512;function _(e,t,v,y,b,x,S,C,w,T){var E=t&h,D=t&d,O=t&f,k=t&(p|m),A=t&g,j=O?void 0:a(e);function M(){for(var d=arguments.length,f=Array(d),p=d;p--;)f[p]=arguments[p];if(k)var m=s(M),h=i(f,m);if(y&&(f=n(f,y,b,k)),x&&(f=r(f,x,S,k)),d-=h,k&&d<T){var g=l(f,m);return o(e,t,_,M.placeholder,v,f,g,C,w,T-d)}var N=D?v:this,ee=O?N[e]:e;return d=f.length,C?f=c(f,C):A&&d>1&&f.reverse(),E&&w<d&&(f.length=w),this&&this!==u&&this instanceof M&&(ee=j||a(ee)),ee.apply(N,f)}return M}t.exports=_})),Pi=o(((e,t)=>{var n=Zr(),r=Yr(),i=Ni(),a=Oi(),o=ki(),s=Mi(),c=R();function l(e,t,l){var u=r(e);function d(){for(var r=arguments.length,f=Array(r),p=r,m=o(d);p--;)f[p]=arguments[p];var h=r<3&&f[0]!==m&&f[r-1]!==m?[]:s(f,m);return r-=h.length,r<l?a(e,t,i,d.placeholder,void 0,f,h,void 0,void 0,l-r):n(this&&this!==c&&this instanceof d?u:e,this,f)}return d}t.exports=l})),Fi=o(((e,t)=>{var n=Zr(),r=Yr(),i=R(),a=1;function o(e,t,o,s){var c=t&a,l=r(e);function u(){for(var t=-1,r=arguments.length,a=-1,d=s.length,f=Array(d+r),p=this&&this!==i&&this instanceof u?l:e;++a<d;)f[a]=s[a];for(;r--;)f[a++]=arguments[++t];return n(p,c?o:this,f)}return u}t.exports=o})),Ii=o(((e,t)=>{var n=Qr(),r=$r(),i=Mi(),a=`__lodash_placeholder__`,o=1,s=2,c=4,l=8,u=128,d=256,f=Math.min;function p(e,t){var p=e[1],m=t[1],h=p|m,g=h<(o|s|u),_=m==u&&p==l||m==u&&p==d&&e[7].length<=t[8]||m==(u|d)&&t[7].length<=t[8]&&p==l;if(!(g||_))return e;m&o&&(e[2]=t[2],h|=p&o?0:c);var v=t[3];if(v){var y=e[3];e[3]=y?n(y,v,t[4]):v,e[4]=y?i(e[3],a):t[4]}return v=t[5],v&&(y=e[5],e[5]=y?r(y,v,t[6]):v,e[6]=y?i(e[5],a):t[6]),v=t[7],v&&(e[7]=v),m&u&&(e[8]=e[8]==null?t[8]:f(e[8],t[8])),e[9]??=t[9],e[0]=t[0],e[1]=h,e}t.exports=p})),Li=o(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),Ri=o(((e,t)=>{var n=Li(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),zi=o(((e,t)=>{var n=Ri(),r=Ne(),i=je(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),Bi=o(((e,t)=>{var n=zi(),r=1/0,i=17976931348623157e292;function a(e){return e?(e=n(e),e===r||e===-r?(e<0?-1:1)*i:e===e?e:0):e===0?e:0}t.exports=a})),Vi=o(((e,t)=>{var n=Bi();function r(e){var t=n(e),r=t%1;return t===t?r?t-r:t:0}t.exports=r})),Hi=o(((e,t)=>{var n=qr(),r=Xr(),i=Pi(),a=Ni(),o=Fi(),s=ii(),c=Ii(),l=pi(),u=Di(),d=Vi(),f=`Expected a function`,p=1,m=2,h=8,g=16,_=32,v=64,y=Math.max;function b(e,t,b,x,S,C,w,T){var E=t&m;if(!E&&typeof e!=`function`)throw TypeError(f);var D=x?x.length:0;if(D||(t&=~(_|v),x=S=void 0),w=w===void 0?w:y(d(w),0),T=T===void 0?T:d(T),D-=S?S.length:0,t&v){var O=x,k=S;x=S=void 0}var A=E?void 0:s(e),j=[e,t,b,x,S,O,k,C,w,T];if(A&&c(j,A),e=j[0],t=j[1],b=j[2],x=j[3],S=j[4],T=j[9]=j[9]===void 0?E?0:e.length:y(j[9]-D,0),!T&&t&(h|g)&&(t&=~(h|g)),!t||t==p)var M=r(e,t,b);else M=t==h||t==g?i(e,t,T):(t==_||t==(p|_))&&!S.length?o(e,t,b,x):a.apply(void 0,j);return u((A?n:l)(M,j),e,t)}t.exports=b})),Ui=o(((e,t)=>{var n=Hi(),r=8;function i(e,t,a){t=a?void 0:t;var o=n(e,r,void 0,void 0,void 0,void 0,void 0,t);return o.placeholder=i.placeholder,o}i.placeholder={},t.exports=i})),Wi=s({default:()=>ea,defaultPrefix:()=>ta,distTag:()=>ra,getEngines:()=>da,getPathToLookForYarnrc:()=>Yi,getPeerDependencies:()=>ua,greatest:()=>ia,latest:()=>aa,list:()=>na,minor:()=>oa,newest:()=>sa,npmAuthTokenKeyValue:()=>qi,packageAuthorChanged:()=>fa,patch:()=>ca,semver:()=>la}),Gi=l(Ui(),1);const Ki=(e,t)=>e.replace(/\$\{([^:-]+)(?:(:)?-([^}]*))?\}/g,(e,n,r,i,a)=>t[n]||(i?a:``)),qi=(0,Gi.default)((e,t,n)=>{if(n.npmAuthToken){let r=n.npmRegistryServer||e[`@${t}:registry`];if(r){let e=r.replace(/^https?:/,``);return e.endsWith(`/`)&&(e=e.slice(0,-1)),{[`${e}/:_authToken`]:Ki(n.npmAuthToken,process.env)}}}return null}),Ji=(e,t)=>t.npmRegistryServer?{[`@${e}:registry`]:Ki(t.npmRegistryServer,process.env)}:null;async function Yi(e,t=g.default.readdir){if(e.global)return;let n=(await Nn(e,t))?.directoryPath;if(n)return u.default.join(n,`.yarnrc.yml`)}const Xi=(0,w.default)(async e=>{let t=await Yi(e),n=u.default.join(m.default.homedir(),`.yarnrc.yml`),r=typeof t==`string`&&await be(t),i=await be(n),a=r?await g.default.readFile(t,`utf-8`):``,o=i?await g.default.readFile(n,`utf-8`):``,s=M.default.load(a),c=M.default.load(o),l={...P(c?.npmScopes||{},Ji),...P(s?.npmScopes||{},Ji)};return l={...l,...P(c?.npmScopes||{},qi(l)),...P(s?.npmScopes||{},qi(l))},r&&(V(e,`\nUsing local yarn config at ${t}:`,`verbose`),V(e,s,`verbose`)),i&&(V(e,`\nUsing user yarn config at ${n}:`,`verbose`),V(e,s,`verbose`)),Object.keys(l)&&(V(e,`
|
|
345
|
+
Merged yarn config in npm format:`,`verbose`),V(e,l,`verbose`)),l});function Zi(e){return new Promise((t,n)=>{let r={},i=N.default.parse();i.on(`data`,e=>{if(e.type===`info`&&!e.data.match(/^Visit/)){let[,t,n]=e.data.match(/"(@?.*)@(.*)"/)||[];r[t]={version:n,from:t}}else e.type===`error`&&n(Error(e.data))}),i.on(`end`,()=>{t({dependencies:r})}),i.on(`error`,n),i.write(e),i.end()})}function Qi(e){return new Promise((t,n)=>{let r=N.default.parse(),i=!1;r.on(`data`,e=>{i||(i=!0,t(JSON.stringify(e)))}),r.on(`error`,n),r.write(e),r.end()})}const $i=process.platform===`win32`?`yarn.cmd`:`yarn`;async function ea(e,t={},n={},r={}){let{stdout:i}=await(0,f.default)($i,[...t.global?[`global`]:[],...t.prefix?[`--prefix=${t.prefix}`]:[],`--depth=0`,`--json`,`--no-progress`,...Array.isArray(e)?e:[e]],n,r);return i}async function ta(e){if(e.prefix)return Promise.resolve(e.prefix);let{stdout:t}=await(0,f.default)($i,[`global`,`dir`]).catch(()=>({stdout:null}));return e.global&&t&&t.match(`Cellar`)?`/usr/local`:process.platform===`win32`&&e.global&&!process.env.prefix?t?t.trim():`${process.env.LOCALAPPDATA}\\Yarn\\Data\\global`:null}const na=async(e={},t)=>P((await Zi(await ea(`list`,e,{},{...e.cwd?{cwd:e.cwd}:{},...t}))).dependencies,(e,t)=>({[e]:t.version||t.required?.version})),X=e=>async(t,n,r={})=>e(t,n,r,await Xi(r)),ra=X(Sr),ia=X(vr),aa=X(Cr),oa=X(Tr),sa=X(wr),ca=X(Er),la=X(Dr),ua=async(e,t,n)=>{let{stdout:r}=await(0,f.default)($i,[`--version`],{rejectOnError:!1},n);if(r.startsWith(`1`)){let r=[`--json`,`info`,`${e}@${t}`,`peerDependencies`],{stdout:i}=await(0,f.default)($i,r,{rejectOnError:!1},n);return i&&ur(i,{command:r.join(` `)}).data||{}}else{let r=[`--json`,`npm`,`info`,`${e}@${t}`,`--fields`,`peerDependencies`],{stdout:i}=await(0,f.default)($i,r,{rejectOnError:!1},n);if(!i)return{};try{return ur(i,{command:r.join(` `)}).peerDependencies||{}}catch(e){try{let e=await Qi(i);if(e)return ur(e,{command:r.join(` `)}).peerDependencies||{}}catch{}throw e}}},da=async(e,t,n={})=>br(e,t,n,await Xi(n)),fa=async(e,t,n,r={})=>dr(e,t,n,r,await Xi(r));function Z(e,t,{color:n=!0}={}){if(e.cli)V(e,n?F.red(t):t,null,`error`),process.exit(1);else throw Error(t)}const pa=async(e,t)=>{let n,r;try{r=await g.default.readFile(t,`utf-8`),n=JSON.parse(r)}catch{Z(e,`Missing or invalid ${t}`)}return{name:void 0,pkg:n,pkgFile:r,filepath:t}},ma={dev:`devDependencies`,peer:`peerDependencies`,prod:`dependencies`,optional:`optionalDependencies`},ha=e=>(e?typeof e==`string`?e.split(`,`):e:K.dep.default).map(e=>ma[e]||e);async function ga(e,t,n,r){let i=await g.default.readFile(e,`utf-8`),a=M.default.load(i),o=e=>{if(!e)return;let t={...e};for(let[e,n]of Object.entries(r))e in t&&(t[e]=n);return t},s=[];if(t)a.catalogs?.[t]&&s.push({name:t,data:a.catalogs[t]}),!a.catalogs&&a.catalog&&t===`default`&&s.push({name:`default`,data:a.catalog});else if(a.catalog&&s.push({name:`default`,data:a.catalog}),a.catalogs)for(let[e,t]of Object.entries(a.catalogs))s.push({name:e,data:t});for(let{data:e}of s){let t=o(e);t&&Object.assign(e,t)}return M.default.dump(a,{indent:2,lineWidth:-1,noRefs:!0,sortKeys:!1})}async function _a(e,t,n,r){let i=await g.default.readFile(e,`utf-8`),a=JSON.parse(i),o=e=>{if(!e)return;let t={...e};for(let[e,n]of Object.entries(r))e in t&&(t[e]=n);return t};if((!t||t===`default`)&&(a.catalog&&=o(a.catalog),a.workspaces?.catalog&&(a.workspaces.catalog=o(a.workspaces.catalog))),a.catalogs){let e=t?[t]:Object.keys(a.catalogs);for(let t of e)a.catalogs[t]&&(a.catalogs[t]=o(a.catalogs[t]))}if(a.workspaces?.catalogs){let e=t?[t]:Object.keys(a.workspaces.catalogs);for(let t of e)a.workspaces.catalogs[t]&&(a.workspaces.catalogs[t]=o(a.workspaces.catalogs[t]))}return JSON.stringify(a,null,2)}async function va(e,t,n,r){let i=u.default.extname(e);if(i===`.yaml`||i===`.yml`)return ga(e,t,n,r);if(i===`.json`)return _a(e,t,n,r);throw Error(`Unsupported catalog file type: ${e}`)}function ya(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)}function ba(e){let t=e.match(/#catalog:([^#]+)/);return t?t[1]:void 0}async function xa(e,t,n,r,i){if(i){let r=u.default.basename(i),a=u.default.extname(i),o=ba(i);if(o!==void 0)return va(i.replace(/#catalog:[^#]+/,``),o,t,n);if(r===`pnpm-workspace.yaml`||r.includes(`catalog`)&&(a===`.yaml`||a===`.yml`))return va(i,void 0,t,n);if(a===`.json`){let r=JSON.parse(e),a=r.catalog||r.catalogs,o=r.workspaces&&!Array.isArray(r.workspaces)&&(r.workspaces.catalog||r.workspaces.catalogs);if(a||o)return va(i,void 0,t,n)}}let a=[...ha(r.dep),`overrides`],o=RegExp(`"(${a.join(`|`)})"s*:[^}]*`,`g`),s=e.replace(o,e=>Object.entries(n).reduce((e,[r])=>{let i=`"${r}"\\s*:\\s*("|{\\s*"."\\s*:\\s*")(${ya(t[r])})"`,a=new RegExp(i,`g`);return e.replace(a,(e,t)=>`"${r}${t?`": ${t}`:`: `}${n[r]}"`)},e));if(a.includes(`packageManager`)){let t=JSON.parse(e);if(t.packageManager){let[e]=t.packageManager.split(`@`);n[e]&&(s=s.replace(/"packageManager"\s*:\s*".*?@[^"]*"/,`"packageManager": "${e}@${n[e]}"`))}}return s}const Sa=(e,t,n,{spawnOptions:r,spawnPleaseOptions:i}={})=>{n&&console.log(F.blue([t.packageManager,...e].join(` `)));let a={cwd:t.cwd||process.cwd(),env:{...process.env,...t.packageManager===`pnpm`?null:{CI:`1`},FORCE_COLOR:`1`,...r?.env},...r},o={...t.global?{global:!0}:null,...t.prefix?{prefix:t.prefix}:null};return(t.packageManager===`pnpm`?Hr:t.packageManager===`yarn`?ea:t.packageManager===`bun`?kr:gr)(e,o,i,a)},Ca=async e=>{(e.packageData||e.packageFile)&&(console.error(`--packageData and --packageFile are not allowed with --doctor. You must execute "ncu --doctor" in a directory with a package file so it can install dependencies and test them.`),process.exit(1));let t;try{t=await pa(e,`package.json`)}catch{console.error(`Missing or invalid package.json`),process.exit(1)}return!e.doctorTest&&!t.pkg.scripts?.test&&(console.error(`No npm "test" script defined. You must define a "test" script in the "scripts" section of your package.json to use --doctor.`),process.exit(1)),t},wa=async(e,t)=>{await ve();let n=t.packageManager===`yarn`?`yarn.lock`:t.packageManager===`pnpm`?`pnpm-lock.yaml`:t.packageManager===`bun`?`bun.lock`:`package-lock.json`,{pkg:r,pkgFile:i}=await Ca(t),a={...r.dependencies,...r.devDependencies,...r.optionalDependencies},o=async()=>{if(t.doctorInstall){let[e,...n]=t.doctorInstall.split(` `);console.log(F.blue(t.doctorInstall)),await(0,f.default)(e,n)}else await Sa([`install`],{packageManager:t.packageManager},!0)},s=async()=>{let e={stderr:e=>{console.error(F.red(e.toString()))},stdout:e=>{process.stdout.write(e.toString())}};if(t.doctorTest){let n=t.doctorTest.matchAll(/"(.+?)"|'(.+?)'|[^ ]+/g),r=[];for(let e of n)r=[...r,e[2]||e[1]||e[0]];let[i,...a]=r;console.log(F.blue(t.doctorTest)),await(0,f.default)(i,a,e)}else await Sa([`run`,`test`],{packageManager:t.packageManager},!0,{spawnPleaseOptions:e})};console.log(`Running tests before upgrading`),await o();let c=``;try{c=await g.default.readFile(n,`utf-8`)}catch{if(t.packageManager===`bun`){n=`bun.lockb`;try{c=await g.default.readFile(n,`utf-8`)}catch{}}}try{await s()}catch{console.error(`Tests failed before we even got started!`),process.exit(1)}t.interactive||console.log(`Upgrading all dependencies and re-running tests`),console.log(F.blue(`ncu `+process.argv.slice(2).filter(e=>e!==`--doctor`).join(` `))),process.env.NCU_DOCTOR=`1`;let l=await e({...t,silent:!0,doctor:!1});if(Object.keys(l||{}).length===0){console.log(`All dependencies are up-to-date `+F.green.bold(`:)`));return}let u=!1;try{await o(),u=!0,await s(),console.log(`${F.green(`✓`)} Tests pass`),await mn(t,{current:a,upgraded:l,total:Object.keys(l||{}).length}),console.log(`\n${t.interactive?`Chosen`:`All`} dependencies upgraded and installed ${F.green(`:)`)}`)}catch{console.error(F.red(u?`Tests failed`:`Install failed`)),console.log(`Identifying broken dependencies`),await g.default.writeFile(`package.json`,i),c?await g.default.writeFile(n,c):await g.default.rm(n,{recursive:!0,force:!0});let e=i;if(u)try{await o()}catch(e){let n=(t.packageManager||`npm`)+` install`;throw Error(`Error: Doctor mode was about to test individual upgrades, but ${F.cyan(n)} failed after rolling back to your existing package and lock files. This is unexpected since the initial install before any upgrades succeeded. Either npm failed to revert a partial install, or failed anomalously on the second run. Please check your internet connection and retry. If doctor mode fails consistently, report a bug with your complete list of dependency versions at https://github.com/raineorshine/npm-check-updates/issues.`,{cause:e})}let d,f;for([d,f]of Object.entries(l))try{if(await Sa([...t.packageManager===`yarn`||t.packageManager===`pnpm`||t.packageManager===`bun`?[`add`]:[`install`,`--no-save`],`${d}@${f}`],{packageManager:t.packageManager},!0),r.scripts?.prepare)try{await Sa([`run`,`prepare`],{packageManager:t.packageManager},!0)}catch(e){throw console.error(F.red(`Prepare script failed`)),e}await s(),console.log(` ${F.green(`✓`)} ${d} ${a[d]} → ${f}`),e=await xa(e,{[d]:a[d]},{[d]:f},t),c=await g.default.readFile(n,`utf-8`)}catch(r){console.error(` ${F.red(`✗`)} ${d} ${a[d]} → ${f}\n`),console.error(F.red(r)),await g.default.writeFile(n,c),(t.packageManager===`yarn`||t.packageManager===`pnpm`||t.packageManager===`bun`)&&await g.default.writeFile(`package.json`,e)}e!==i&&(console.log(`Saving partially upgraded package.json`),await g.default.writeFile(`package.json`,e)),await o()}};async function Ta(e){let t,n,r=e.packageFile||`package.json`;function i(t,n){if(t!=null){let n=u.default.resolve(t);V(e,`${e.upgrade?`Upgrading`:`Checking`} ${n}`)}else Z(e,`${F.red(`No ${n}`)}\n\nPlease add a ${n} to the current directory, specify the ${F.cyan(`--packageFile`)} or ${F.cyan(`--packageData`)} options, or pipe a ${n} to stdin and specify ${F.cyan(`--stdin`)}.`,{color:!1});return g.default.readFile(t,`utf-8`).catch(t=>{Z(e,t)})}if(V(e,`Running in local mode`,`verbose`),V(e,`Finding package file data`,`verbose`),e.packageData)n=null,t=Promise.resolve(e.packageData);else if(e.packageFile)n=e.packageFile,t=i(n,r);else if(e.stdin){V(e,`Waiting for package data on stdin`,`verbose`);let a=await(0,ee.text)(process.stdin),o=a.trim().length>0?a:null;n=o||!r?null:await(0,O.findUp)(r),t=o||i(await n,r)}else n=r?await(0,O.findUp)(!e.packageFile&&e.packageManager===`deno`?[`deno.json`,`deno.jsonc`]:r,{cwd:e.cwd||process.cwd()}):null,t=i(n,r);return{pkgData:await t,pkgFile:n||null,pkgPath:r}}async function Ea(e){try{let t=await g.default.readFile(e,`utf-8`),n=M.default.load(t),r={};if(!Array.isArray(n)&&(n.catalog&&(r.default=n.catalog),n.catalogs))for(let[e,t]of Object.entries(n.catalogs))r[e]=t;return r}catch{return{}}}async function Da(e){try{let t=await g.default.readFile(e,`utf-8`),n=JSON.parse(t),r={};if(n.catalog&&(r.default=n.catalog),n.catalogs)for(let[e,t]of Object.entries(n.catalogs))r[e]=t;if(n.workspaces&&!Array.isArray(n.workspaces)&&(n.workspaces.catalog&&(r.default={...r.default||{},...n.workspaces.catalog}),n.workspaces.catalogs))for(let[e,t]of Object.entries(n.workspaces.catalogs))r[e]={...r[e]||{},...t};return r}catch{return{}}}async function Oa(e,t){let n={};if(e.packageManager===`pnpm`){let e=await Ea(u.default.join(u.default.dirname(t),`pnpm-workspace.yaml`));Object.assign(n,e)}let r=await Da(t);for(let[e,t]of Object.entries(r))n[e]?n[e]={...t,...n[e]}:n[e]=t;return n}function ka(e,t){if(!t||Array.isArray(t)&&t.length===0)return e;let n=Array.isArray(t)?t:[t];return Object.fromEntries(Object.entries(e).filter(([e])=>n.some(t=>e===t||ne.default.isMatch(e,t))))}function Aa(e){return{ignore:[`**/node_modules/**`,...typeof e.ignore==`string`?[e.ignore]:e.ignore||[]]}}const ja=async e=>{let t=u.default.join(u.default.dirname(e),`pnpm-workspace.yaml`),n;try{n=await g.default.readFile(t,`utf-8`)}catch{return null}return M.default.load(n)};async function Ma(e,t,n,r){let{pkgData:i,pkgPath:a}=await Ta({...e,packageFile:n,loglevel:`silent`}),o=(typeof i==`string`?JSON.parse(i):i).workspaces||await ja(a||``),s=Array.isArray(o)?o:o?.packages;s||Z(e,`workspaces property missing from package.json. --workspace${e.workspaces?`s`:``} only works when you specify a "workspaces" property in your package.json.`);let c=(s||[]).map(e=>u.default.join(r,e,`package.json`).replace(/\\/g,`/`)),l=Aa(e),d=te.default.sync(c,l),f=await Promise.all(d.map(async t=>{let n=await pa(e,t);return n.name=n.pkg.name||t.split(`/`).slice(-2)[0],n})),p=f.map(e=>e.name||``);return e.workspaces===!0?[f,p]:[f.filter(n=>e.workspace?.some(e=>s?.some(i=>n.name===e||n.filepath===u.default.join(r,u.default.dirname(i),e,t).replace(/\\/g,`/`)))),p]}async function Na(e,t){if(!t||e.catalogs===!1)return[];let n=await Oa(e,t);if(Object.keys(n).length===0)return[];let r=ka(n,e.catalog),i=[];for(let[n,a]of Object.entries(r)){let r={name:`catalog:${n}`,version:`1.0.0`,dependencies:a},o=e.packageManager===`pnpm`?`${u.default.join(u.default.dirname(t),`pnpm-workspace.yaml`)}#catalog:${n}`:`${t}#catalog:${n}`,s=JSON.stringify(r,null,2);i.push({filepath:o,pkg:r,pkgFile:s,name:`catalog:${n}`,catalogName:n})}return i}async function Pa(e){let t=e.packageFile||`package.json`,n=e.cwd?(0,D.default)(e.cwd):`./`,r=e.packageFile||(e.cwd?u.default.join(n,`package.json`):`package.json`),i=e.workspaces===!0||e.workspace!==void 0&&e.workspace.length!==0,a=[];if(!i||e.root===!0){let t=r.replace(/\\/g,`/`),n=Aa(e),i=te.default.sync(t,n),o=await Promise.all(i.map(async t=>await pa(e,t)));a=[...a,...o]}if(!i)return[a,[]];let{pkgPath:o}=await Ta({...e,packageFile:r,loglevel:`silent`}),[s,c]=await Ma(e,t,r,n);if(a=[...a,...s],o){let t=await Na(e,o);t.length>0&&(a=[...a,...t])}if(e.ignore){let t=Array.isArray(e.ignore)?e.ignore:[e.ignore];a=a.filter(e=>{let r=u.default.relative(n,e.filepath).replace(/\\/g,`/`),i=u.default.dirname(r).replace(/\\/g,`/`);return!t.some(e=>{let t=(0,ne.default)(e);return t(r)||t(i)||t(`${i}/`)})})}return[a,c]}async function Fa({configFileName:e,configFilePath:t,packageFile:n,global:r,options:i}){let{default:a,Chalk:o}=await import(`chalk`),s=i?.color?new o({level:1}):a,c=(0,re.rcFile)(`ncurc`,{configFileName:e||`.ncurc`,defaultExtension:[`.json`,`.yml`,`.js`],cwd:t||(r?m.default.homedir():n?u.default.dirname(n):void 0)}),l=c?.filePath;e&&!l&&Z(i,`Config file ${e} not found in ${t||process.cwd()}`);let{$schema:d,...f}=c?.config||{},p=f;typeof p.format==`string`&&(p.format=K.format.parse(p.format));let h=Object.keys(p).filter(e=>!K[e]);return h.length>0&&(console.error(s.red(`Unknown option${h.length===1?``:`s`} found in config file:`),s.gray(h.join(`, `))),console.info(`Using config file `+l),console.info(`You can change the config file path with ${s.blue(`--configFilePath`)}`)),{filePath:l,args:Object.entries(p).flatMap(([e,t])=>typeof t==`boolean`||K[e]?.type===`boolean`?t?[`--${e}`]:[]:[`--${e}`,t]),config:p}}var Ia=s({greatest:()=>Va,greatestLevel:()=>Ha,latest:()=>Ba,minor:()=>Ua,newest:()=>Ka,patch:()=>Wa,semver:()=>Ga});const La=(0,oe.promisify)(ae.default.execFile);async function Ra(e){let t=(await La(`git`,[`ls-remote`,`--tags`,e])).stdout,n={};for(let e of t.trim().split(`
|
|
346
|
+
`)){let t=e.split(` `);n[t[1].replace(/^refs\/tags\/|\^{}$/g,``)]=t[0]}return n}async function za(e,t,n){t=t.replace(/^github:/,``);let{auth:r,protocol:i,host:a,path:o}=(0,y.default)(t),s;try{if(i!==null)s=await Ra(`${i?i.replace(`git+`,``):`https:`}//${r?r+`@`:``}${a}/${o?.replace(/^:/,``)}`);else try{s=await Ra(`ssh://git@${a}/${o?.replace(/^:/,``)}`)}catch{s=await Ra(`https://${r?r+`@`:``}${a}/${o}`)}}catch{V(n??{},`Invalid, private repo, or no tags for ${e}: ${t}`,`verbose`);return}return Object.keys(s).map(qt).filter(e=>(0,b.valid)(e)).sort(zt)}const Ba=async(e,t,n)=>{let r=await za(e,t,n);if(!r)return{version:null};let i=n?.pre?r:r.filter(e=>!Vt(e)),a=i[i.length-1];return{version:a?rn(t,a):null}},Va=async(e,t,n)=>{let r=await za(e,t,n);if(!r)return{version:null};let i=r[r.length-1];return{version:i?rn(t,i):null}},Ha=e=>async(t,n,r={})=>{let i=decodeURIComponent((0,y.default)(n).branch).replace(/^semver:/,``),a=await za(t,n,r);if(!a)return{version:null};let o=Bt(a.map(e=>e.replace(/^v/,``)),i,e);return{version:o?rn(n,o):null}},Ua=Ha(`minor`),Wa=Ha(`patch`),Ga=async(e,t,n)=>({version:null}),Ka=Va;var qa=s({latest:()=>Xa});const Ja=e=>e&&e.startsWith(`http://`)||e.startsWith(`https://`),Ya=(0,w.default)(async e=>{let t=e.registry,n;if(Ja(t))n=await(await fetch(t)).text();else try{n=await g.default.readFile(t,`utf8`)}catch{Z(e,`\nThe specified static registry file does not exist: ${e.registry}`)}return JSON.parse(n)}),Xa=async(e,t,n)=>({version:(await Ya(n||{}))[e]||null});var Q={npm:tr,pnpm:Mr,yarn:Wi,bun:Or,gitTags:Ia,staticRegistry:qa};function Za(e){if(typeof e==`string`)return e.trim();if(Array.isArray(e)&&(e.length===0||typeof e[0]==`string`)){let t=e.map(e=>typeof e==`string`?e.trim():e).filter(e=>e);return t.length>0?t:void 0}else return e}function Qa(e){try{return new URL(e),!0}catch{return!1}}async function $a(e,{cli:t}={}){let{default:n,Chalk:r}=await import(`chalk`),i=e.color?new r({level:1}):n;if(!t){let t=jn.reduce((e,t)=>({...e,...t.default==null?null:{[t.long]:t.default}}),{}),n={jsonUpgraded:!0,silent:e.silent||e.loglevel===void 0&&!e.verbose,args:[]};e={...t,...n,...e}}let a={...e,...e.packageData&&typeof e.packageData!=`string`?{packageData:JSON.stringify(e.packageData,null,2)}:null,cli:t},o=a.silent||a.format?.includes(`lines`)?`silent`:a.verbose?`verbose`:a.loglevel,s=Object.keys(a).filter(e=>e.startsWith(`json`)).some((0,bt.default)(a));!s&&o!==`silent`&&a.rcConfigPath&&!a.doctor&&V(a,`Using config file ${a.rcConfigPath}`);let c=jn.filter(({long:e,deprecated:t})=>t&&a[e]||e===`packageManager`&&a.packageManager===`staticRegistry`);c.length>0&&(c.forEach(({long:e,description:t})=>{let n=e===`packageManager`?`--packageManager staticRegistry is deprecated. Use --registryType json.`:`--${e}: ${t}`;V(a,i.yellow(n),`warn`)}),V(a,``,`warn`)),jn.forEach(({long:e,choices:t})=>{if(!t||t.length===0)return;let n=a[e],r=Array.isArray(n)?n:[n];r.length!==0&&r.every(e=>!t.includes(e))&&Z(a,`Invalid option value: --${e} ${n}. Valid values are: ${t.join(`, `)}.`)}),a.cwd&&!await be(a.cwd)&&Z(a,`No such directory: ${a.cwd}`);let l=Za(a.args),u=Za(a.filter),d=Za(a.filterVersion),f=Za(a.reject),p=Za(a.rejectVersion),m=a.registryType||(a.registry?.endsWith(`.json`)?`json`:`npm`);if(a.filter&&l&&!(0,ie.dequal)(l.join(` `),Array.isArray(u)?u.join(` `):u)?Z(a,`Cannot specify a filter using both --filter and args. Did you forget to quote an argument?
|
|
347
|
+
See: https://github.com/raineorshine/npm-check-updates/issues/759#issuecomment-723587297`):a.packageFile&&a.deep?Z(a,`Cannot specify both --packageFile and --deep. --deep is an alias for --packageFile '**/package.json'`):a.format?.includes(`lines`)&&a.jsonUpgraded?Z(a,`Cannot specify both --format lines and --jsonUpgraded.`):a.format?.includes(`lines`)&&a.jsonAll?Z(a,`Cannot specify both --format lines and --jsonAll.`):a.format?.includes(`lines`)&&a.format.length>1?Z(a,`Cannot use --format lines with other formatting options.`):a.workspace?.length&&a.workspaces?Z(a,`Cannot specify both --workspace and --workspaces.`):a.deep&&(a.workspace?.length||a.workspaces)?Z(a,`Cannot specify both --deep and --workspace${a.workspaces?`s`:``}.`):a.doctor&&(a.workspace?.length||a.workspaces)?Z(a,`Doctor mode is not currently supported with --workspace${a.workspaces?`s`:``}.`):a.packageManager===`staticRegistry`&&!a.registry?Z(a,`When --package-manager staticRegistry is specified, you must provide the path for the registry file with --registry.`):a.registryType===`json`&&!a.registry?Z(a,`When --registryType json is specified, you must provide the path for the registry file with --registry. Run "ncu --help registryType" for details.`):m!==`json`&&a.registry&&!Qa(a.registry)&&Z(a,`--registry must be a valid URL. Invalid value: "${a.registry}"`),a.cooldown!=null){let e=typeof a.cooldown==`number`&&!isNaN(a.cooldown)&&a.cooldown>=0,t=typeof a.cooldown==`function`;!e&&!t&&Z(a,`Cooldown must be a non-negative integer representing days since published or a function`)}let h=a.target||`latest`,g=h===`newest`||h===`greatest`,_=await In(a),v={...a,...a.deep?{packageFile:`**/package.json`}:null,..._===`deno`?{dep:[`imports`]}:null,...a.format&&a.format.length>0?{format:a.format}:null,filter:l||u,filterVersion:d,json:s,loglevel:o,minimal:a.minimal===void 0?!1:a.minimal,...a.pre!=null||g?{pre:a.pre==null?g:!!a.pre}:null,reject:f,rejectVersion:p,target:h,...a.interactive&&a.upgrade===void 0?{upgrade:!s}:null,packageManager:_,...a.prefix?{prefix:await(Q[_||``]?.defaultPrefix||Q.npm.defaultPrefix)(a)}:null,registryType:m};v.cacher=await Cn(v);let y=P(v,(e,t)=>t===void 0?null:{[e]:t});return!a.packageManager&&_!==`npm`&&V(y,`Using ${_}`),y}function eo(e,t){return Array.from(new Set([...e||[],...t||[]]))}function to(e,t){let n=e||{},r=t||{},i={...n,...r};return Object.keys(i).forEach(e=>{Array.isArray(n[e])&&Array.isArray(r[e])&&(i[e]=eo(n[e],r[e]))}),i}var no=l(Wr(),1);function ro(e){let t;if(!e)t=no.default;else if(typeof e==`string`)if(e[0]===`/`&&e.at(-1)===`/`){let n=new RegExp(e.slice(1,-1));t=e=>n.test(e)}else{let n=e.split(/[\s,]+/);t=e=>n.some((0,se.or)(t=>(0,ne.default)(t)(e),t=>!t.includes(`/`)&&e.includes(`/`)&&(0,ne.default)(t)(e.replace(/\//g,`_`))))}else if(Array.isArray(e))t=(t,n)=>e.some(e=>ro(e)(t,n));else if(e instanceof RegExp)t=t=>e.test(t);else if(typeof e==`function`)t=(t,n)=>e(t,(0,x.parseRange)(n??t));else throw TypeError(`Invalid filter. Must be a RegExp, array, or comma-or-space-delimited list.`);return t}function io(e,t,n,r){return(0,se.and)((n,r)=>(0,se.and)(e?ro(e):!0,t?(...e)=>!ro(t)(...e):!0)(n,r),(e,t)=>(0,se.and)(n?ro(n):!0,r?(...e)=>!ro(r)(...e):!0)(t))}function ao(e,t){return!t||t===`deno`?Q.npm:e.registryType===`json`?Q.staticRegistry:(Q[t]||Z(e,`Invalid package manager: ${t}`),Q[t])}async function oo(e={}){let t=await ao(e,e.packageManager).list?.({cwd:e.cwd,prefix:e.prefix,global:e.global});t||Z(e,`Unable to retrieve package list`);let n=io(e.filter,e.reject,e.filterVersion,e.rejectVersion),r={};try{r=I(t,(e,t)=>!!t&&!Nt(t)&&n(e,t))}catch(t){Z(e,`Invalid filter: `+t.message||t)}return r}const so=typeof le.default==`function`?le.default:le.default.default;function co(e,t){let n=[[t]];for(;n.length>0;){let t=[];for(let r of n){let n=Object.keys(e[r[0]]??{});for(let e of n){if(e===r.at(-1))return{isCircular:!0,offendingPackage:r[0]};t.push([e,...r])}}n=t}return{isCircular:!1}}async function lo(e,t){let n=ao(t,t.packageManager);if(!n.getPeerDependencies)return{};let r=Object.keys(e).length,i;!t.json&&t.loglevel!==`silent`&&t.loglevel!==`verbose`&&r>0&&(i=new ce.default(`[:bar] :current/:total :percent`,{total:r,width:20}),i.render());let a=await so(Object.entries(e),async([e,r])=>{let a,o=t.cacher?.getPeers(e,r);return o?a=o:(a=await n.getPeerDependencies(e,r,{cwd:t.cwd}),t.cacher?.setPeers(e,r,a)),i&&i.tick(),{pkg:e,dependencies:a}},{concurrency:t.concurrency}),o={};for(let{pkg:e,dependencies:t}of a){o[e]=t;let n=co(o,e);n.isCircular&&delete o[e][n.offendingPackage]}return await t.cacher?.save(),t.cacher?.log(!0),o}function uo(e,t){let n={};for(let r of t)n[r]=e[r];return n}function $(e,t){let n={};for(let[r,i]of Object.entries(e??{})){let e=r;t(i,e)&&(n[e]=i)}return n}const fo=[`latest`,`newest`,`greatest`,`minor`,`patch`,`semver`];async function po(e,t={}){let{default:n,Chalk:r}=await import(`chalk`),i=t.color?new r({level:1}):n,a=Object.keys(e),o=ao(t,t.packageManager),s;!t.json&&t.loglevel!==`silent`&&t.loglevel!==`verbose`&&a.length>0&&(s=new ce.default(`[:bar] :current/:total :percent`,{total:a.length,width:20}),s.render());async function c(n){let r=Xt(e[n]),[a,c]=r||[n,e[n]],l=t.target||`latest`,u=typeof l==`string`?l:l(a,(0,x.parseRange)(c)),[d,f]=u.startsWith(`@`)?[`distTag`,u.slice(1)]:[u,`latest`],p=t.cacher?.get(a,d);if(p)return s?.tick(),{version:p};let m,h=$t(e[n]),g=h?Q.gitTags:o,_=h?`github urls`:t.packageManager||`npm`,v=g[d];if(!v){let e=fo.filter(e=>e in g);Z(t,i.red(`\nUnsupported target "${d}" using ${_}`)+`
|
|
348
|
+
Supported version targets are: `+e.join(`, `)+(h?``:`, and tags (e.g. @next)`),{color:!1})}try{m=await v(a,c,{...t,distTag:f,pre:t.pre==null?u.startsWith(`@`)||Vt(c):t.pre,retry:t.retry??2}).catch(e=>({error:e?.body?.error||e.toString()})),m.version=!h&&r&&m?.version?Yt(a,m.version):m?.version??null}catch(e){let n=e?(e.message||e).toString():``;if(n.match(/E504|Gateway Timeout/i))return{error:`${n}. All ${t.retry} retry attempts failed.`};if(n.match(/E400|E404|ENOTFOUND|404 Not Found|400 Bad Request/i))return{error:`${n.replace(/ - Not found$/i,``)}. All ${t.retry} retry attempts failed. Either your internet connection is down, the registry is inaccessible, the authentication credentials are invalid, or the package does not exist.`};if(e.code===`ERR_INVALID_URL`)return{error:n||`Invalid URL`};throw!process.env.NCU_TESTS&&/(Response|network) timeout/i.test(n)&&console.error(`
|
|
349
349
|
|
|
350
350
|
`+i.red(`FetchError: Request Timeout. npm-registry-fetch defaults to 30000 (30 seconds). Try setting the --timeout option (in milliseconds) to override this.`)+`
|
|
351
|
-
`),e}return s?.tick(),m.version&&t.cacher?.set(a,d,m.version),m}let l=await(
|
|
352
|
-
Options:`,`verbose`),
|
|
353
|
-
Getting installed packages`,`verbose`);let t={};try{let{cli:n,cwd:r,filter:i,filterVersion:a,global:o,packageManager:s,prefix:c,reject:l,rejectVersion:u}=e;t=await
|
|
351
|
+
`),e}return s?.tick(),m.version&&t.cacher?.set(a,d,m.version),m}let l=await so(a,c,{concurrency:t.concurrency});return await t.cacher?.save(),t.cacher?.log(),P(l,(e,t)=>e.version||e.error?{[a[t]]:e}:null)}var mo=o(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),ho=o(((e,t)=>{var n=ke(),r=Ae(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),go=o(((e,t)=>{var n=ho(),r=Ae(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),_o=o(((e,t)=>{var n=Ee(),r=go(),i=L(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),vo=o(((e,t)=>{var n=mo(),r=_o();function i(e,t,a,o,s){var c=-1,l=e.length;for(a||=r,s||=[];++c<l;){var u=e[c];t>0&&a(u)?t>1?i(u,t-1,a,o,s):n(s,u):o||(s[s.length]=u)}return s}t.exports=i})),yo=o(((e,t)=>{var n=vo();function r(e){return e!=null&&e.length?n(e,1):[]}t.exports=r})),bo=o(((e,t)=>{var n=Zr(),r=Math.max;function i(e,t,i){return t=r(t===void 0?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=r(a.length-t,0),c=Array(s);++o<s;)c[o]=a[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=a[o];return l[t]=i(c),n(e,this,l)}}t.exports=i})),xo=o(((e,t)=>{var n=yo(),r=bo(),i=yi();function a(e){return i(r(e,void 0,n),e+``)}t.exports=a})),So=o(((e,t)=>{var n=si(),r=xo(),i=ii(),a=oi(),o=L(),s=di(),c=`Expected a function`,l=8,u=32,d=128,f=256;function p(e){return r(function(t){var r=t.length,p=r,m=n.prototype.thru;for(e&&t.reverse();p--;){var h=t[p];if(typeof h!=`function`)throw TypeError(c);if(m&&!g&&a(h)==`wrapper`)var g=new n([],!0)}for(p=g?p:r;++p<r;){h=t[p];var _=a(h),v=_==`wrapper`?i(h):void 0;g=v&&s(v[0])&&v[1]==(d|l|u|f)&&!v[4].length&&v[9]==1?g[a(v[0])].apply(g,v[3]):h.length==1&&s(h)?g[_]():g.thru(h)}return function(){var e=arguments,n=e[0];if(g&&e.length==1&&o(n))return g.plant(n).value();for(var i=0,a=r?t[i].apply(this,e):n;++i<r;)a=t[i].call(this,a);return a}})}t.exports=p})),Co=l(o(((e,t)=>{t.exports=So()()}))(),1);function wo(e){if(Object.keys(e).length===0)return null;let t=Object.values(e).reduce((e,t)=>{let n=Tt.find(e=>t&&t.includes(e));return n!==void 0&&(e[n]||=[],e[n].push(t)),e},{}),n=xt(Object.entries(t).map(([e,t])=>({wildcard:e,instances:t})),e=>-e.instances.length);return n.length>0?n[0].wildcard:null}function To(e,t,{downgrade:n}={}){if(!b.validRange(e)||Mt(e))return!1;let[r]=x.default.parseRange(e);if(!r)throw Error(`"${e}" could not be parsed by semver-utils. This is probably a bug. Please file an issue at https://github.com/raineorshine/npm-check-updates.`);let i=qt(t),a=B(r),o=!!b.validRange(a),s=!!b.valid(i);return o&&s&&(!Rt(i,a)||!b.satisfies(i,r.operator===`<`?e:a)&&(n||!b.ltr(i,a)))}function Eo(e,t,n={}){let r=n.target||`latest`;e=I(e,(e,t)=>!!t);let i=wo(e)||`^`,a=(e,t)=>tn(e,t,{wildcard:i,removeRange:n.removeRange});return(0,Co.default)([e=>$(e,(e,n)=>n in t),e=>Object.entries(e).reduce((e,[n,r])=>{let i=t[n],a=null,o=null;if(Zt(r)&&(a=Xt(r)[1]),Zt(i)&&(o=Xt(i)[1]),$t(r)){let[e]=(0,x.parseRange)(en(r));a=B(e)}if($t(i)){let[e]=(0,x.parseRange)(en(i));o=B(e)}return e[n]={current:r,currentParsed:a,latest:i,latestParsed:o},e},{}),e=>$(e,({current:e,currentParsed:t,latest:n,latestParsed:i},a)=>{let o=Vt(e)&&(typeof r==`string`?r:r(a,(0,x.parseRange)(e))).startsWith(`@`),s=t||e,c=i||n,l=e=>{try{if(b.default.valid(e))return e;let t=b.default.minVersion(e);return t?t.version:null}catch{return null}},u=l(s),d=l(c),f=u&&d&&b.default.gt(u,d);return To(s,c,{downgrade:o})||f}),e=>Object.entries(e).reduce((e,[t,{current:n,currentParsed:r,latest:i,latestParsed:o}])=>{let s=a(r||n,o||i);return e[t]=Zt(n)?Qt(n,s):$t(n)?rn(n,s):s,e},{})])(e)}const Do=(e,t,n)=>{let r={...e,...t},i=$(t,(e,t)=>{let i=n[t];return i?Object.entries(i).every(([e,t])=>r[e]===void 0||!(0,b.validRange)(t)||(0,b.intersects)(r[e],t)):!0}),a=Object.keys(t).length>Object.keys(i).length,o=n;return a&&(o=$(n,(e,n)=>i[n]||!t[n])),{violated:a,filteredUpgradedDependencies:i,upgradedPeerDependencies:o}};async function Oo(e,t){let n=await po(e,t),r=P(n,(n,r)=>r?.version&&(!t.filterResults||t.filterResults(n,{currentVersion:e[n],currentVersionSemver:(0,x.parseRange)(e[n]),upgradedVersion:r.version,upgradedVersionSemver:(0,x.parse)(r.version)}))?{[n]:r.version}:null);if(t.pinVersions)for(let[e,n]of Object.entries(t.pinVersions))e in r&&(r[e]=n);let i=$(Eo(e,r,t),(n,i)=>!t.jsonUpgraded||!t.minimal||!(0,b.satisfies)(r[i],e[i])),a=$(r,(e,t)=>i[t]),o=[i,n,t.peerDependencies];if(!t.peer||Object.keys(a).length===0)return o;if(t.peer&&Object.keys(a).length>0){let r=await lo(a,t),s;if((0,ie.dequal)(t.peerDependencies,{...t.peerDependencies,...r})){if(s=Do(e,i,t.peerDependencies),!s.violated)return o}else s={violated:!1,filteredUpgradedDependencies:i,upgradedPeerDependencies:r};let c=0;do{if(c++>6)throw Error(`Stuck in a while loop. Please report an issue`);let r={...t.peerDependencies,...s.upgradedPeerDependencies};if((0,ie.dequal)(t.peerDependencies,r))return[{},n,t.peerDependencies];let[i,a,l]=await Oo({...e,...s.filteredUpgradedDependencies},{...t,peerDependencies:r,loglevel:`silent`});o=[{...s.filteredUpgradedDependencies,...i},{...n,...a},l],s=Do(e,o[0],o[2])}while(s.violated)}return o}async function ko(e){V(e,`
|
|
352
|
+
Options:`,`verbose`),H(e,e,`verbose`),V(e,`
|
|
353
|
+
Getting installed packages`,`verbose`);let t={};try{let{cli:n,cwd:r,filter:i,filterVersion:a,global:o,packageManager:s,prefix:c,reject:l,rejectVersion:u}=e;t=await oo({cli:n,cwd:r,filter:i,filterVersion:a,global:o,packageManager:s,prefix:c,reject:l,rejectVersion:u})}catch(t){Z(e,t.message)}V(e,`globalPackages:`,`verbose`),V(e,t,`verbose`),V(e,``,`verbose`),V(e,`Fetching ${e.target} versions`,`verbose`);let[n,r]=await Oo(t,e);V(e,r,`verbose`);let i=P(r,(e,t)=>t.time?{[e]:t.time}:null),a=Object.keys(n);await mn(e,{current:t,upgraded:n,latest:r,total:a.length,time:i});let o=n?a.map(e=>e+`@`+n[e]).join(` `):`[package]`;if(e.json)sn(e,n);else if(o.length){let t=e.packageManager===`yarn`?`yarn global upgrade`:e.packageManager===`pnpm`?`pnpm -g add`:e.packageManager===`bun`?`bun add -g`:`npm -g install`;V(e,`
|
|
354
354
|
`+F.cyan(`ncu`)+` itself cannot upgrade global packages. Run the following to upgrade all global packages:
|
|
355
355
|
|
|
356
356
|
`+F.cyan(`${t} `+o)+`
|
|
357
|
-
`)}return e.cli&&e.errorLevel===2&&a.length>0&&process.exit(1),n}const
|
|
358
|
-
`);for(let e of t){let t=e.offset,n=1,a=1,o=0;for(let e of i){if(o+e.length>=t){a=t-o+1;break}o+=e.length+1,n++}r+=`Error at line ${n}, column ${a}: ${ue.ParseErrorCode[e.error]}\n${
|
|
357
|
+
`)}return e.cli&&e.errorLevel===2&&a.length>0&&process.exit(1),n}const Ao=(e,t)=>b.validRange(e)&&b.validRange(t)&&b.gt(b.minVersion(e),b.minVersion(t)),jo=e=>{if(!e.packageManager)return{};let[t,n]=e.packageManager.split(`@`);return{[t]:n}};function Mo(e={},t={}){let n=ha(t.dep).reduce((t,n)=>({...t,...n===`packageManager`?jo(e):I(e[n]||{},(e,n)=>!Ao(n,t[e]))}),{}),r=P(t.workspacePackages||[]),i={};try{i=I(I(n,e=>!r[e]),io(t.filter||null,t.reject||null,t.filterVersion||null,t.rejectVersion||null))}catch(e){Z(t,`Invalid filter: `+e.message||e)}return i}async function No(e,t){let n=ao(t,t.packageManager);if(!n.getEngines)return{};let r=Object.keys(e).length,i;return!t.json&&t.loglevel!==`silent`&&t.loglevel!==`verbose`&&r>0&&(i=new ce.default(`[:bar] :current/:total :percent`,{total:r,width:20}),i.render()),Object.entries(e).reduce(async(e,[r,a])=>{let o=(await n.getEngines(r,a,t)).node;return i&&i.tick(),{...await e,[r]:o}},Promise.resolve({}))}const Po=(e,t)=>!e||(0,b.satisfies)(t,e);async function Fo(e,t,n={}){if(!n.nodeEngineVersion)return{};let r=(0,b.minVersion)(n.nodeEngineVersion)?.version;if(!r)return{};let[i,a]=await Oo(e,{...n,enginesNode:!1,nodeEngineVersion:void 0,loglevel:`silent`}),o=await No(P(a,(e,t)=>i[e]&&t?.version?{[e]:t.version}:null),n);return Object.entries(i).filter(([e,n])=>t[e]!==n&&!Po(o[e],r)).reduce((t,[n,r])=>({...t,[n]:{from:e[n],to:r,enginesNode:o[n]}}),{})}async function Io(e,t,n,r={}){let i={...e,...t},[a,o]=await Oo(e,{...r,peer:!1,peerDependencies:void 0,loglevel:`silent`}),s=await lo(Object.fromEntries(Object.entries(a).map(([e,t])=>[e,(0,b.validRange)(t)?(0,b.minVersion)(t)?.version??t:t])),r);return Object.entries(a).filter(([e,n])=>t[e]!==n).reduce((t,[r,a])=>{let c=Object.entries(n).filter(([,e])=>e[r]!==void 0&&o[r]?.version&&!(0,b.satisfies)(o[r].version,e[r])).reduce((e,[t,n])=>({...e,[t]:(0,b.validRange)(n[r])?n[r]:`a range that semver does not understand: ${n[r]}. This range does not work with semver.satisfies or semver.intersects, which npm-check-updates relies on to determine peer dependency compatibility. Either this is a mistake in ${t}, or it relies on a new syntax that is not compatible with the semver package.`}),{});if(Object.keys(c).length===0){let e=s?.[r]||{};c=Object.entries(e).filter(([e,t])=>i[e]&&!(!(0,b.validRange)(t)||(0,b.intersects)(i[e],t))).reduce((e,[t,n])=>({...e,[r]:`${t} ${n}`}),{})}return{...t,[r]:{from:e[r],to:a,reason:c}}},{})}const Lo=process.stdout.columns||80;function Ro(e){return`${e.length?e.slice(0,Math.min(e.length,Lo)):`<empty>`}\n`}function zo(e){return e>Lo?``:`${` `.repeat(e-1)}^\n`}function Bo(e,t,n){let r=e.length;if(r===0)return`<empty>`;if(r===1)return`${Ro(e[0])}${zo(n)}`;let i=Math.min(t+2,r),a=``;for(let r=Math.max(t-2,1);r<=i;r++)a+=Ro(e[r-1]),r===t&&(a+=zo(n));return`${a}\n`}function Vo(e){e=(0,ue.stripComments)(e);try{return JSON.parse(e)}catch{let t=[],n=(0,ue.parse)(e,t);if(t.length===0)return n;let r=``,i=e.split(`
|
|
358
|
+
`);for(let e of t){let t=e.offset,n=1,a=1,o=0;for(let e of i){if(o+e.length>=t){a=t-o+1;break}o+=e.length+1,n++}r+=`Error at line ${n}, column ${a}: ${ue.ParseErrorCode[e.error]}\n${Bo(i,n,a)}\n`}throw SyntaxError(r)}}const Ho=`
|
|
359
359
|
↑/↓: Select a package
|
|
360
360
|
Space: Toggle selection
|
|
361
361
|
a: Toggle all
|
|
362
|
-
Enter: Upgrade`;function
|
|
363
|
-
`).length:0;return process.stdout.rows?Math.max(3,process.stdout.rows-n-1-(t?.length??0)*2):50}async function
|
|
364
|
-
`),e=>({[e.trim().split(` `)[0]]:e.trim()}));if(Object.keys(t).length>0)if(
|
|
365
|
-
`+e,heading:!0},...Object.keys(n).sort().map(e=>({title:o[e],value:e,selected:[`patch`,`minor`].includes(t)}))]),{title:` `,heading:!0}],hint:a&&
|
|
366
|
-
`,instructions:!1,message:`Choose which packages to update`,name:`value`,optionsPerPage:
|
|
367
|
-
Options:`,`verbose`),
|
|
368
|
-
Current versions:`,`verbose`),
|
|
369
|
-
upgradedPeerDependencies:`,`verbose`),
|
|
370
|
-
Upgraded versions:`,`verbose`),
|
|
371
|
-
|
|
372
|
-
If you are still receiving this message after uninstalling Volta, ensure your PATH does not contain an entry for Volta and your shell profile does not define VOLTA_HOME. You may need to reboot for changes to your shell profile to take effect.`,`error`),process.exit(1))},
|
|
373
|
-
Dependencies not up-to-date`),e.upgrade&&(e.packageManager===`deno`?
|
|
362
|
+
Enter: Upgrade`;function Uo(e,t){let n=e?Ho.split(`
|
|
363
|
+
`).length:0;return process.stdout.rows?Math.max(3,process.stdout.rows-n-1-(t?.length??0)*2):50}async function Wo(e,t,n){let r=ao(n,n.packageManager);return await Object.keys(t).reduce(async(i,a)=>{let o=e[a]||null,s=t[a]||null,c=await r.packageAuthorChanged(a,o,s,n);return{...await i,[a]:c}},{})}const Go=async(e,t,n,r)=>{let i=[],a=process.stdout.rows>18,o=P((await dn({from:e,to:t,format:r.format,pkgFile:n||void 0})).toString().split(`
|
|
364
|
+
`),e=>({[e.trim().split(` `)[0]]:e.trim()}));if(Object.keys(t).length>0)if(V(r,``),r.format?.includes(`group`)){let n=Ft(t,e,r);i=(await(0,d.default)({choices:[...n.flatMap(({heading:e,groupName:t,packages:n})=>[{title:`
|
|
365
|
+
`+e,heading:!0},...Object.keys(n).sort().map(e=>({title:o[e],value:e,selected:[`patch`,`minor`].includes(t)}))]),{title:` `,heading:!0}],hint:a&&Ho,instructions:!1,message:`Choose which packages to update`,name:`value`,optionsPerPage:Uo(a,n),type:`multiselect`,onState:e=>{e.aborted&&process.nextTick(()=>process.exit(1))}})).value}else i=(await(0,d.default)({choices:[...Object.keys(t).sort().map(e=>({title:o[e],value:e,selected:!0})),{title:` `,heading:!0}],hint:a&&Ho+`
|
|
366
|
+
`,instructions:!1,message:`Choose which packages to update`,name:`value`,optionsPerPage:Uo(a),type:`multiselect`,onState:e=>{e.aborted&&process.nextTick(()=>process.exit(1))}})).value;return P(i,e=>({[e]:t[e]}))};async function Ko(e,t,n){V(e,`
|
|
367
|
+
Options:`,`verbose`),H(e,e,`verbose`);let r;try{t?r=Vo(t):Z(e,`Missing package data`)}catch(t){Z(e,`Invalid package file${n?`: ${n}`:` from stdin`}. Error details:\n${t.message}`)}let i=Mo(r,e);V(e,`
|
|
368
|
+
Current versions:`,`verbose`),V(e,i,`verbose`),e.enginesNode&&(e.nodeEngineVersion=r?.engines?.node),e.peer&&(e.peerDependencies=await lo(Object.fromEntries(Object.entries(i).map(([e,t])=>[e,b.default.validRange(t)?b.default.minVersion(t)?.version??t:t])),e));let[a,o,s]=await Oo(i,e),c=P(o,(e,t)=>t.version?{[e]:t.version}:null),l=P(o,(e,t)=>t.error?{[e]:t.error}:null),u=P(o,(e,t)=>t.time?{[e]:t.time}:null);e.peer&&(V(e,`
|
|
369
|
+
upgradedPeerDependencies:`,`verbose`),V(e,s,`verbose`)),V(e,`\n${typeof e.target==`string`?`${e.target[0].toUpperCase()}${e.target.slice(1)}`:`Fetched`} versions:`,`verbose`),V(e,c,`verbose`),V(e,`
|
|
370
|
+
Upgraded versions:`,`verbose`),V(e,a,`verbose`);let d=e.minimal?P(a,(e,t)=>b.default.satisfies(c[e],i[e])?null:{[e]:t}):a,f=(e.format||[]).includes(`ownerChanged`)?await Wo(i,d,e):void 0,p=e.interactive?await Go(i,d,n,e):d;if(!e.json||e.deep){if(await mn(e.interactive?{...e,format:(e.format||[]).filter(e=>e!==`group`)}:e,{current:i,upgraded:p,total:Object.keys(a).length,latest:o,ownersChangedDeps:f,pkgFile:n||void 0,errors:l,time:u}),e.peer){let t=await Io(i,a,s,e);Object.keys(t).length>0&&hn(e,t)}if(e.enginesNode){let t=await Fo(i,a,e);Object.keys(t).length>0&&gn(e,t)}}let m=await xa(t,i,p,e,n||void 0),h=e.jsonAll?Vo(m):e.jsonDeps?uo(Vo(m),ha(e.dep)):p,_;if(e.json&&!e.deep&&sn(e,h),Object.keys(d).length>0&&n)if(e.upgrade)_=g.default.writeFile(n.replace(/#catalog:[^#]+/,``),m);else{let t=process.env.npm_lifecycle_event===`npx`?`npx npm-check-updates`:`ncu`,n=process.argv.slice(2).map(e=>e.includes(` `)?`"${e}"`:e).join(` `),r=n&&` `+n;V(e,`\nRun ${F.cyan(`${t}${r} -u`)} to upgrade ${e.packageFile||`package.json`}`)}return await _,h}function qo(e){return e}process.env.INJECT_PROMPTS&&d.default.inject(JSON.parse(process.env.INJECT_PROMPTS));let Jo=!1;process.on(`unhandledRejection`,e=>{console.error(e),Jo=!0});const Yo=e=>{e.global&&(process.env.VOLTA_HOME||process.env.PATH?.includes(`\\Volta`))&&(V(e,`It appears you are using Volta. \`npm-check-updates --global\` cannot be used with Volta because Volta has its own system for managing global packages which circumvents npm.
|
|
371
|
+
|
|
372
|
+
If you are still receiving this message after uninstalling Volta, ensure your PATH does not contain an entry for Volta and your shell profile does not define VOLTA_HOME. You may need to reboot for changes to your shell profile to take effect.`,`error`),process.exit(1))},Xo=async(e,t)=>{let n={...e,cwd:e.cwd||u.default.resolve(t,`..`),packageFile:t};return e.packageManager===`staticRegistry`?await In({...n,packageManager:void 0}):e.packageManager&&e.packageManager!==`npm`?e.packageManager:await In(n)},Zo=(e,t)=>{let n=e.length===1?{[e[0]]:t}:t;return Object.values(n).some(e=>Object.keys(e).length>0)},Qo=async(e,t,n)=>{if(n.install===`never`){V(n,``);return}if(!Zo(e,t))return;let r=await Xo(n,e[0]),i=`Run ${F.cyan(r+` install`)}${e.length>1&&!n.workspace&&!n.workspaces?` in each project directory`:``} to install new versions`,a=n.interactive&&(process.env.NCU_TESTS||!process.env.NCU_DOCTOR),o;if(a&&n.install===`prompt`&&(V(n,``),o=await(0,d.default)({type:`confirm`,name:`value`,message:`${i}?`,initial:!0,onState:e=>{e.aborted&&process.nextTick(()=>process.exit(1))}})),n.install===`always`||a&&o.value){n.install===`always`&&V(n,``),V(n,`Installing dependencies...`);let t=n.workspaces||n.workspace?.length?[`package.json`]:e;for await(let e of t){let t=await Xo(n,e),r=t+(process.platform===`win32`&&t!==`bun`?`.cmd`:``),i=n.cwd||u.default.resolve(e,`..`),a=``;try{await(0,f.default)(r,[`install`],{stdout:e=>{a+=e},stderr:e=>{console.error(F.red(e.toString()))}},{cwd:i,env:{...process.env,...n.color===!1?null:{FORCE_COLOR:!0},...t===`pnpm`?{npm_config_strict_peer_dependencies:!1}:null}}),V(n,a),V(n,`Done`)}catch(e){throw Error(e?.message||e||a,{cause:e})}}}else a||V(n,`\n${i}.`)};async function $o(e,t){let[n,r]=await Pa(e),i=n.map(e=>e.filepath),a=e.workspaces||!!e.workspace?.length;e.deep=e.deep||a||n.length>1;let o;if(e.global){let n=await ko(e);return clearTimeout(t),n}else if(e.deep)o=await n.reduce(async(t,n)=>{let i=await t,a=(await Fa({packageFile:n.filepath,options:e})).config;e.mergeConfig&&Object.keys(a).length&&(a=to(e,a));let o={...e,...a,packageFile:n.filepath,workspacePackages:r},s,c,l;if(n.filepath.includes(`#`)||n.name?.startsWith(`catalog:`)){s=n.pkgFile,c=n.filepath,l=n.filepath.includes(`#catalog`)?n.filepath.replace(/#catalog.*/,``):n.filepath,o={...o,target:o.catalogTarget??o.target};let e=u.default.resolve(l);V(o,`${o.upgrade?`Upgrading`:`Checking`} ${e} catalog dependencies`)}else{let e=await Ta(o);s=e.pkgData,c=e.pkgFile||n.filepath,l=c}return{...i,[o.cwd?u.default.relative(u.default.resolve(o.cwd),l).replace(/\\/g,`/`):l]:await Ko(o,s,c)}},Promise.resolve({})),e.json&&sn(e,o);else{n.length===1&&n[0].filepath!==(e.packageFile||`package.json`)&&(e.packageFile=n[0].filepath);let{pkgData:t,pkgFile:r}=await Ta(e);o=await Ko(e,t,r)}return clearTimeout(t),e.errorLevel===2&&Zo(i,o)&&Z(e,`
|
|
373
|
+
Dependencies not up-to-date`),e.upgrade&&(e.packageManager===`deno`?V(e,``):await Qo(i,o,e)),o}async function es(e={},{cli:t}={}){let n=await $a(e,{cli:t}),r=pe.url;process.on(`exit`,()=>{Jo&&Z(n,`Unhandled Rejection! This is a bug and should be reported: ${r}`)}),await ve(n.color),Yo(n),V(n,`Initializing`,`verbose`),n.cacheClear&&await Sn(n);let i,a=new Promise(()=>null);if(n.timeout){let e=typeof n.timeout==`string`?Number.parseInt(n.timeout,10):n.timeout;a=new Promise((t,r)=>{i=setTimeout(()=>{let t=`Exceeded global timeout of ${e}ms`;r(t);try{Z(n,t)}catch{}},e)})}if(n.doctor){if(n.upgrade)return Promise.race([a,wa(es,n)]);V(n,`Usage: ncu --doctor\n\n${typeof K.doctor.help==`function`?K.doctor.help({}):K.doctor.help}`,`warn`)}else return Promise.race([a,$o(n,i)])}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return jn}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return Fa}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return qo}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return kn}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return es}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return de}});
|
|
374
374
|
//# sourceMappingURL=src.cjs.map
|