@baicie/ncu 0.1.29 → 0.1.30
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/dist/cjs/chunks/src.cjs +34 -34
- package/dist/cjs/chunks/src.cjs.map +1 -1
- package/dist/cjs/cli.cjs +4 -4
- package/dist/cjs/cli.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/chunks/src.mjs +115 -115
- package/dist/esm/chunks/src.mjs.map +1 -1
- package/dist/esm/cli.mjs +5 -5
- package/dist/esm/cli.mjs.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/package.json +19 -19
package/dist/esm/cli.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as e,c as t,
|
|
2
|
+
import{a as e,c as t,i as n,l as r,o as i,r as a,s as o,t as s,u as c}from"./chunks/src.mjs";import l from"semver";import{Help as u,Option as d,program as f}from"commander";import p from"rfdc";const m=`Output the version number of npm-check-updates.`,h=e=>e.replace(/`/g,``),g=p();(async()=>{let{default:p}=await import(`update-notifier`),_=p({pkg:r});if(_.update&&_.update.latest!==c){let{default:e}=await import(`chalk`),n=l.parse(_.update.current)?.major,r=l.parse(_.update.latest)?.major,i=(n&&r&&r>=n?Array(r-n).fill(0).map((e,t)=>n+t+1):[]).map(e=>`${t??``}/releases/tag/v${e}.0.0`),a=`${t??``}/compare/v${_.update.current}...v${_.update.latest}`;_.notify({defer:!1,isGlobal:!0,message:`Update available ${e.dim(`{currentVersion}`)}${e.reset(` → `)}${_.update.type===`major`?e.red(`{latestVersion}`):_.update.type===`minor`?e.yellow(`{latestVersion}`):e.green(`{latestVersion}`)}
|
|
3
3
|
Run ${e.cyan(`{updateCommand}`)} to update
|
|
4
|
-
${e.dim.underline(_.update.type===`major`?
|
|
5
|
-
`):a)}`})}let v=process.argv.slice(2),y=v.findIndex(e=>e===`--help`||e===`-h`);if(y!==-1&&v[y+1]){let
|
|
6
|
-
`):
|
|
7
|
-
`):console.info(`Unknown option: ${
|
|
4
|
+
${e.dim.underline(_.update.type===`major`?i.map(t=>e.dim.underline(t)).join(`
|
|
5
|
+
`):a)}`})}let v=process.argv.slice(2),y=v.findIndex(e=>e===`--help`||e===`-h`);if(y!==-1&&v[y+1]){let t=v[y+1].replace(/^-*/,``);t===`help`||t===`h`?console.info(`Would you like some help with your help?`):(await o(),[...v.slice(0,y),...v.slice(y+1)].forEach(t=>{let n=t.replace(/^-*/,``),r=e.find(e=>n===e.long||n===e.short||n===`no-${e.long}`&&e.type===`boolean`);r?console.info(i(r)+`
|
|
6
|
+
`):n===`version`||n===`v`||n===`V`?console.info(i({long:`version`,short:`v`,description:m,type:`string`})+`
|
|
7
|
+
`):console.info(`Unknown option: ${t}`)})),process.exit(0)}let b=new Set(e.filter(e=>e.cli===!1).map(e=>`--${e.long}`));f.description(`[filter] is a list or regex of package names to check (all others will be ignored).`).usage(`[options] [filter]`).configureHelp({optionTerm:e=>e.long&&b.has(e.long)?e.long.replace(`--`,``)+`*`:e.long===`--version`?`-v, -V, --version`:e.flags.replace(`[bool]`,``),optionDescription:e=>e.long===`--version`?m:e.long===`--help`?`You're lookin' at it. Run "ncu --help <option>" for a specific option.`:u.prototype.optionDescription(e)}).addOption(new d(`-v, --versionAlias`).hideHelp()).on(`option:versionAlias`,()=>{console.info(c),process.exit(0)}),e.forEach(({long:e,short:t,arg:n,description:r,default:i,help:a,parse:o,type:s})=>{let c=`${t?`-${t}, `:``}--${e}${n?` <${n}>`:``}`,l=`${h(r)}${a?` Run "ncu --help ${e}" for details.`:``}`;f.option(c,l,o||i,o?i:void 0),s===`boolean`&&f.addOption(new d(`--no-${e}`).default(!1).hideHelp())}),f.version(c);let x=g(f._optionValues);f.allowExcessArguments(!0),f.parse(process.argv);let S=f.opts(),C=process.argv.slice(2),{color:w,configFileName:T,configFilePath:E,global:D,packageFile:O,mergeConfig:k}=S;await o(w);let A=!process.env.NCU_TESTS||E||k?await n({configFileName:T,configFilePath:E,global:D,packageFile:O,options:{...S,cli:!0}}):null,j=(A?.args||[]).filter((e,t,n)=>(typeof e!=`string`||!e.startsWith(`-`)||!C.includes(e))&&(typeof n[t-1]!=`string`||!n[t-1].startsWith(`-`)||!C.includes(n[t-1]))),M=[...process.argv.slice(0,2),...j,...C];f._optionValues=x,f.parse(M);let N=f.opts();s({...A&&Object.keys(A.config).length>0?{rcConfigPath:A.filePath}:null,...a(f.opts(),e=>e!==void 0),args:f.args,...N.filter?{filter:N.filter}:null,...N.reject?{reject:N.reject}:null},{cli:!0})})();
|
|
8
8
|
//# sourceMappingURL=cli.mjs.map
|
package/dist/esm/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.mjs","names":["pkg.version","pkg.homepage","cliOptions","getNcuRc"],"sources":["../../src/bin/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Help, Option, program } from 'commander'\nimport createCloneDeep from 'rfdc'\nimport semver from 'semver'\nimport pkg from '../../package.json'\nimport cliOptions, { renderExtendedHelp } from '../cli-options'\nimport ncu from '../index'\nimport { chalkInit } from '../lib/chalk'\n// async global contexts are only available in esm modules -> function\nimport getNcuRc from '../lib/getNcuRc'\nimport { pickBy } from '../lib/pick'\n\nconst optionVersionDescription = 'Output the version number of npm-check-updates.'\n\n/** Removes inline code ticks. */\nconst uncode = (s: string) => s.replace(/`/g, '')\n\nconst cloneDeep = createCloneDeep()\n\n;(async () => {\n // importing update-notifier dynamically as esm modules are only allowed to be dynamically imported inside of cjs modules\n const { default: updateNotifier } = await import('update-notifier')\n\n // check if a new version of ncu is available and print an update notification\n //\n // For testing from specific versions, use:\n //\n // updateNotifier({\n // pkg: {\n // name: 'npm-check-updates',\n // version: x.y.z\n // },\n // updateCheckInterval: 0\n // })\n\n const notifier = updateNotifier({ pkg })\n if (notifier.update && notifier.update.latest !== pkg.version) {\n const { default: chalk } = await import('chalk')\n\n // generate release urls for all the major versions from the current version up to the latest\n const currentMajor = semver.parse(notifier.update.current)?.major\n const latestMajor = semver.parse(notifier.update.latest)?.major\n const majorVersions =\n // Greater than or equal to (>=) will always return false if either operant is NaN or undefined.\n // Without this condition, it can result in a RangeError: Invalid array length.\n // See: https://github.com/raineorshine/npm-check-updates/issues/1200\n currentMajor && latestMajor && latestMajor >= currentMajor\n ? new Array(latestMajor - currentMajor).fill(0).map((x, i) => currentMajor + i + 1)\n : []\n const releaseUrls = majorVersions.map(majorVersion => `${pkg.homepage ?? ''}/releases/tag/v${majorVersion}.0.0`)\n\n // for non-major updates, generate a URL to view all commits since the current version\n const compareUrl = `${pkg.homepage ?? ''}/compare/v${notifier.update.current}...v${notifier.update.latest}`\n\n notifier.notify({\n defer: false,\n isGlobal: true,\n message: `Update available ${chalk.dim('{currentVersion}')}${chalk.reset(' → ')}${\n notifier.update.type === 'major'\n ? chalk.red('{latestVersion}')\n : notifier.update.type === 'minor'\n ? chalk.yellow('{latestVersion}')\n : chalk.green('{latestVersion}')\n }\nRun ${chalk.cyan('{updateCommand}')} to update\n${chalk.dim.underline(\n notifier.update.type === 'major' ? releaseUrls.map(url => chalk.dim.underline(url)).join('\\n') : compareUrl,\n)}`,\n })\n }\n\n // manually detect option-specific help\n // https://github.com/raineorshine/npm-check-updates/issues/787\n const rawArgs = process.argv.slice(2)\n const indexHelp = rawArgs.findIndex(arg => arg === '--help' || arg === '-h')\n if (indexHelp !== -1 && rawArgs[indexHelp + 1]) {\n const helpOption = rawArgs[indexHelp + 1].replace(/^-*/, '')\n if (helpOption === 'help' || helpOption === 'h') {\n console.info('Would you like some help with your help?')\n } else {\n await chalkInit()\n const nonHelpArgs = [...rawArgs.slice(0, indexHelp), ...rawArgs.slice(indexHelp + 1)]\n nonHelpArgs.forEach(arg => {\n // match option by long or short\n const query = arg.replace(/^-*/, '')\n const option = cliOptions.find(\n option =>\n query === option.long ||\n query === option.short ||\n (query === `no-${option.long}` && option.type === 'boolean'),\n )\n if (option) {\n console.info(renderExtendedHelp(option) + '\\n')\n } else if (query === 'version' || query === 'v' || query === 'V') {\n console.info(\n renderExtendedHelp({\n long: 'version',\n short: 'v',\n description: optionVersionDescription,\n // do not pass boolean or it will print --no-version\n type: 'string',\n }) + '\\n',\n )\n } else {\n console.info(`Unknown option: ${arg}`)\n }\n })\n }\n process.exit(0)\n }\n\n // a set of options that only work in an rc config file, not on the command line\n const noCli = new Set(cliOptions.filter(option => option.cli === false).map(option => `--${option.long}`))\n\n // start commander program\n program\n .description('[filter] is a list or regex of package names to check (all others will be ignored).')\n .usage('[options] [filter]')\n // See: boolean optional arg below\n .configureHelp({\n optionTerm: option =>\n option.long && noCli.has(option.long)\n ? option.long.replace('--', '') + '*'\n : option.long === '--version'\n ? // add -v to version help to cover the alias added below\n '-v, -V, --version'\n : option.flags.replace('[bool]', ''),\n optionDescription: option =>\n option.long === '--version'\n ? optionVersionDescription\n : option.long === '--help'\n ? `You're lookin' at it. Run \"ncu --help <option>\" for a specific option.`\n : Help.prototype.optionDescription(option),\n })\n // add hidden -v alias for --V/--version\n .addOption(new Option('-v, --versionAlias').hideHelp())\n .on('option:versionAlias', () => {\n console.info(pkg.version)\n process.exit(0)\n })\n\n // add cli options\n cliOptions.forEach(({ long, short, arg, description, default: defaultValue, help, parse, type }) => {\n const flags = `${short ? `-${short}, ` : ''}--${long}${arg ? ` <${arg}>` : ''}`\n // format description for cli by removing inline code ticks\n // point to help in description if extended help text is available\n const descriptionFormatted = `${uncode(description)}${help ? ` Run \"ncu --help ${long}\" for details.` : ''}`\n\n // handle 3rd/4th argument polymorphism\n program.option(flags, descriptionFormatted, parse || defaultValue, parse ? defaultValue : undefined)\n\n // add --no- prefixed boolean options\n // necessary for overriding booleans set to true in the ncurc\n if (type === 'boolean') {\n program.addOption(new Option(`--no-${long}`).default(false).hideHelp())\n }\n })\n\n // set version option at the end\n program.version(pkg.version)\n\n // commander mutates its optionValues with program.parse\n // In order to call program.parse again and parse the rc file options, we need to clear commander's internal optionValues\n // Otherwise array options will be duplicated\n const defaultOptionValues = cloneDeep((program as any)._optionValues)\n program.allowExcessArguments(true)\n program.parse(process.argv)\n\n const programOpts = program.opts()\n const programArgs = process.argv.slice(2)\n\n const { color, configFileName, configFilePath, global, packageFile, mergeConfig } = programOpts\n\n // Force color on all chalk instances.\n // See: /src/lib/chalk.ts\n await chalkInit(color)\n\n // load .ncurc\n // Do not load when tests are running (can be overridden if configFilePath is set explicitly, or --mergeConfig option specified)\n const rcResult =\n !process.env.NCU_TESTS || configFilePath || mergeConfig\n ? await getNcuRc({\n configFileName,\n configFilePath,\n global,\n packageFile,\n options: { ...programOpts, cli: true },\n })\n : null\n\n // override rc args with program args\n const rcArgs = (rcResult?.args || []).filter(\n (arg, i, args) =>\n (typeof arg !== 'string' || !arg.startsWith('-') || !programArgs.includes(arg)) &&\n (typeof args[i - 1] !== 'string' || !args[i - 1].startsWith('-') || !programArgs.includes(args[i - 1])),\n )\n\n // insert config arguments into command line arguments so they can all be parsed by commander\n const combinedArguments = [...process.argv.slice(0, 2), ...rcArgs, ...programArgs]\n\n // See defaultOptionValues comment above\n ;(program as any)._optionValues = defaultOptionValues\n program.parse(combinedArguments)\n const combinedProgramOpts = program.opts()\n\n // filter out undefined program options and combine cli options with config file options\n const options = {\n ...(rcResult && Object.keys(rcResult.config).length > 0 ? { rcConfigPath: rcResult.filePath } : null),\n ...pickBy(program.opts(), (value: unknown) => value !== undefined),\n args: program.args,\n ...(combinedProgramOpts.filter ? { filter: combinedProgramOpts.filter } : null),\n ...(combinedProgramOpts.reject ? { reject: combinedProgramOpts.reject } : null),\n }\n\n // NOTE: Options handling and defaults go in initOptions in index.js\n\n ncu(options, { cli: true })\n})()\n"],"mappings":";uLAYA,MAAM,EAA2B,kDAG3B,EAAU,GAAc,EAAE,QAAQ,KAAM,GAAG,CAE3C,EAAY,GAAiB,EAEjC,SAAY,CAEZ,GAAM,CAAE,QAAS,GAAmB,MAAM,OAAO,mBAc3C,EAAW,EAAe,CAAE,IAAA,EAAK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,OAAQ,EAAoB,OAAQ,CAAG,KAC1E,GAAI,EAAoB,OAAS,CAAE,OAAQ,EAAoB,OAAQ,CAAG,KAC3E,CAIY,CAAE,IAAK,GAAM,CAAC,IACzB"}
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":["pkg.version","pkg.homepage","cliOptions"],"sources":["../../src/bin/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Help, Option, program } from 'commander'\nimport createCloneDeep from 'rfdc'\nimport semver from 'semver'\nimport pkg from '../../package.json'\nimport cliOptions, { renderExtendedHelp } from '../cli-options'\nimport ncu from '../index'\nimport { chalkInit } from '../lib/chalk'\n// async global contexts are only available in esm modules -> function\nimport getNcuRc from '../lib/getNcuRc'\nimport { pickBy } from '../lib/pick'\n\nconst optionVersionDescription = 'Output the version number of npm-check-updates.'\n\n/** Removes inline code ticks. */\nconst uncode = (s: string) => s.replace(/`/g, '')\n\nconst cloneDeep = createCloneDeep()\n\n;(async () => {\n // importing update-notifier dynamically as esm modules are only allowed to be dynamically imported inside of cjs modules\n const { default: updateNotifier } = await import('update-notifier')\n\n // check if a new version of ncu is available and print an update notification\n //\n // For testing from specific versions, use:\n //\n // updateNotifier({\n // pkg: {\n // name: 'npm-check-updates',\n // version: x.y.z\n // },\n // updateCheckInterval: 0\n // })\n\n const notifier = updateNotifier({ pkg })\n if (notifier.update && notifier.update.latest !== pkg.version) {\n const { default: chalk } = await import('chalk')\n\n // generate release urls for all the major versions from the current version up to the latest\n const currentMajor = semver.parse(notifier.update.current)?.major\n const latestMajor = semver.parse(notifier.update.latest)?.major\n const majorVersions =\n // Greater than or equal to (>=) will always return false if either operant is NaN or undefined.\n // Without this condition, it can result in a RangeError: Invalid array length.\n // See: https://github.com/raineorshine/npm-check-updates/issues/1200\n currentMajor && latestMajor && latestMajor >= currentMajor\n ? new Array(latestMajor - currentMajor).fill(0).map((x, i) => currentMajor + i + 1)\n : []\n const releaseUrls = majorVersions.map(majorVersion => `${pkg.homepage ?? ''}/releases/tag/v${majorVersion}.0.0`)\n\n // for non-major updates, generate a URL to view all commits since the current version\n const compareUrl = `${pkg.homepage ?? ''}/compare/v${notifier.update.current}...v${notifier.update.latest}`\n\n notifier.notify({\n defer: false,\n isGlobal: true,\n message: `Update available ${chalk.dim('{currentVersion}')}${chalk.reset(' → ')}${\n notifier.update.type === 'major'\n ? chalk.red('{latestVersion}')\n : notifier.update.type === 'minor'\n ? chalk.yellow('{latestVersion}')\n : chalk.green('{latestVersion}')\n }\nRun ${chalk.cyan('{updateCommand}')} to update\n${chalk.dim.underline(\n notifier.update.type === 'major' ? releaseUrls.map(url => chalk.dim.underline(url)).join('\\n') : compareUrl,\n)}`,\n })\n }\n\n // manually detect option-specific help\n // https://github.com/raineorshine/npm-check-updates/issues/787\n const rawArgs = process.argv.slice(2)\n const indexHelp = rawArgs.findIndex(arg => arg === '--help' || arg === '-h')\n if (indexHelp !== -1 && rawArgs[indexHelp + 1]) {\n const helpOption = rawArgs[indexHelp + 1].replace(/^-*/, '')\n if (helpOption === 'help' || helpOption === 'h') {\n console.info('Would you like some help with your help?')\n } else {\n await chalkInit()\n const nonHelpArgs = [...rawArgs.slice(0, indexHelp), ...rawArgs.slice(indexHelp + 1)]\n nonHelpArgs.forEach(arg => {\n // match option by long or short\n const query = arg.replace(/^-*/, '')\n const option = cliOptions.find(\n option =>\n query === option.long ||\n query === option.short ||\n (query === `no-${option.long}` && option.type === 'boolean'),\n )\n if (option) {\n console.info(renderExtendedHelp(option) + '\\n')\n } else if (query === 'version' || query === 'v' || query === 'V') {\n console.info(\n renderExtendedHelp({\n long: 'version',\n short: 'v',\n description: optionVersionDescription,\n // do not pass boolean or it will print --no-version\n type: 'string',\n }) + '\\n',\n )\n } else {\n console.info(`Unknown option: ${arg}`)\n }\n })\n }\n process.exit(0)\n }\n\n // a set of options that only work in an rc config file, not on the command line\n const noCli = new Set(cliOptions.filter(option => option.cli === false).map(option => `--${option.long}`))\n\n // start commander program\n program\n .description('[filter] is a list or regex of package names to check (all others will be ignored).')\n .usage('[options] [filter]')\n // See: boolean optional arg below\n .configureHelp({\n optionTerm: option =>\n option.long && noCli.has(option.long)\n ? option.long.replace('--', '') + '*'\n : option.long === '--version'\n ? // add -v to version help to cover the alias added below\n '-v, -V, --version'\n : option.flags.replace('[bool]', ''),\n optionDescription: option =>\n option.long === '--version'\n ? optionVersionDescription\n : option.long === '--help'\n ? `You're lookin' at it. Run \"ncu --help <option>\" for a specific option.`\n : Help.prototype.optionDescription(option),\n })\n // add hidden -v alias for --V/--version\n .addOption(new Option('-v, --versionAlias').hideHelp())\n .on('option:versionAlias', () => {\n console.info(pkg.version)\n process.exit(0)\n })\n\n // add cli options\n cliOptions.forEach(({ long, short, arg, description, default: defaultValue, help, parse, type }) => {\n const flags = `${short ? `-${short}, ` : ''}--${long}${arg ? ` <${arg}>` : ''}`\n // format description for cli by removing inline code ticks\n // point to help in description if extended help text is available\n const descriptionFormatted = `${uncode(description)}${help ? ` Run \"ncu --help ${long}\" for details.` : ''}`\n\n // handle 3rd/4th argument polymorphism\n program.option(flags, descriptionFormatted, parse || defaultValue, parse ? defaultValue : undefined)\n\n // add --no- prefixed boolean options\n // necessary for overriding booleans set to true in the ncurc\n if (type === 'boolean') {\n program.addOption(new Option(`--no-${long}`).default(false).hideHelp())\n }\n })\n\n // set version option at the end\n program.version(pkg.version)\n\n // commander mutates its optionValues with program.parse\n // In order to call program.parse again and parse the rc file options, we need to clear commander's internal optionValues\n // Otherwise array options will be duplicated\n const defaultOptionValues = cloneDeep((program as any)._optionValues)\n program.allowExcessArguments(true)\n program.parse(process.argv)\n\n const programOpts = program.opts()\n const programArgs = process.argv.slice(2)\n\n const { color, configFileName, configFilePath, global, packageFile, mergeConfig } = programOpts\n\n // Force color on all chalk instances.\n // See: /src/lib/chalk.ts\n await chalkInit(color)\n\n // load .ncurc\n // Do not load when tests are running (can be overridden if configFilePath is set explicitly, or --mergeConfig option specified)\n const rcResult =\n !process.env.NCU_TESTS || configFilePath || mergeConfig\n ? await getNcuRc({\n configFileName,\n configFilePath,\n global,\n packageFile,\n options: { ...programOpts, cli: true },\n })\n : null\n\n // override rc args with program args\n const rcArgs = (rcResult?.args || []).filter(\n (arg, i, args) =>\n (typeof arg !== 'string' || !arg.startsWith('-') || !programArgs.includes(arg)) &&\n (typeof args[i - 1] !== 'string' || !args[i - 1].startsWith('-') || !programArgs.includes(args[i - 1])),\n )\n\n // insert config arguments into command line arguments so they can all be parsed by commander\n const combinedArguments = [...process.argv.slice(0, 2), ...rcArgs, ...programArgs]\n\n // See defaultOptionValues comment above\n ;(program as any)._optionValues = defaultOptionValues\n program.parse(combinedArguments)\n const combinedProgramOpts = program.opts()\n\n // filter out undefined program options and combine cli options with config file options\n const options = {\n ...(rcResult && Object.keys(rcResult.config).length > 0 ? { rcConfigPath: rcResult.filePath } : null),\n ...pickBy(program.opts(), (value: unknown) => value !== undefined),\n args: program.args,\n ...(combinedProgramOpts.filter ? { filter: combinedProgramOpts.filter } : null),\n ...(combinedProgramOpts.reject ? { reject: combinedProgramOpts.reject } : null),\n }\n\n // NOTE: Options handling and defaults go in initOptions in index.js\n\n ncu(options, { cli: true })\n})()\n"],"mappings":";iMAYA,MAAM,EAA2B,kDAG3B,EAAU,GAAc,EAAE,QAAQ,KAAM,GAAG,CAE3C,EAAY,GAAiB,EAEjC,SAAY,CAEZ,GAAM,CAAE,QAAS,GAAmB,MAAM,OAAO,mBAc3C,EAAW,EAAe,CAAE,IAAA,EAAK,CAAC,CACxC,GAAI,EAAS,QAAU,EAAS,OAAO,SAAWA,EAAa,CAC7D,GAAM,CAAE,QAAS,GAAU,MAAM,OAAO,SAGlC,EAAe,EAAO,MAAM,EAAS,OAAO,QAAQ,EAAE,MACtD,EAAc,EAAO,MAAM,EAAS,OAAO,OAAO,EAAE,MAQpD,GAHJ,GAAgB,GAAe,GAAe,EACtC,MAAM,EAAc,EAAa,CAAC,KAAK,EAAE,CAAC,KAAK,EAAG,IAAM,EAAe,EAAI,EAAE,CACjF,EAAE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"name": "@baicie/ncu",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"author": "Tomas Junnonen <tomas1@gmail.com>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"camelcase": "^9.0.0",
|
|
66
66
|
"chalk": "^5.6.2",
|
|
67
67
|
"cli-table3": "^0.6.5",
|
|
68
|
-
"commander": "^14.0.
|
|
68
|
+
"commander": "^14.0.3",
|
|
69
69
|
"dequal": "^2.0.3",
|
|
70
70
|
"fast-glob": "^3.3.3",
|
|
71
71
|
"fast-memoize": "^2.5.2",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"prompts-ncu": "^3.0.2",
|
|
86
86
|
"rc-config-loader": "^4.1.3",
|
|
87
87
|
"rfdc": "^1.4.1",
|
|
88
|
-
"semver": "^7.7.
|
|
88
|
+
"semver": "^7.7.4",
|
|
89
89
|
"semver-utils": "^1.1.4",
|
|
90
90
|
"spawn-please": "^3.0.0",
|
|
91
91
|
"untildify": "^6.0.0",
|
|
@@ -94,9 +94,9 @@
|
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@baicie/release": "^0.1.11",
|
|
96
96
|
"@baicie/scripts": "^0.1.2",
|
|
97
|
-
"@eslint/js": "^
|
|
97
|
+
"@eslint/js": "^10.0.1",
|
|
98
98
|
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
|
99
|
-
"@types/bun": "^1.3.
|
|
99
|
+
"@types/bun": "^1.3.9",
|
|
100
100
|
"@types/chai": "^5.2.3",
|
|
101
101
|
"@types/chai-as-promised": "^8.0.2",
|
|
102
102
|
"@types/chai-string": "^1.4.5",
|
|
@@ -105,9 +105,9 @@
|
|
|
105
105
|
"@types/ini": "^4.1.1",
|
|
106
106
|
"@types/js-yaml": "^4.0.9",
|
|
107
107
|
"@types/jsonlines": "^0.1.5",
|
|
108
|
-
"@types/lodash": "^4.17.
|
|
108
|
+
"@types/lodash": "^4.17.24",
|
|
109
109
|
"@types/mocha": "^10.0.10",
|
|
110
|
-
"@types/node": "^25.0
|
|
110
|
+
"@types/node": "^25.3.0",
|
|
111
111
|
"@types/npm-registry-fetch": "^8.0.9",
|
|
112
112
|
"@types/parse-github-url": "^1.0.3",
|
|
113
113
|
"@types/picomatch": "^4.0.2",
|
|
@@ -117,30 +117,30 @@
|
|
|
117
117
|
"@types/semver-utils": "^1.1.3",
|
|
118
118
|
"@types/sinon": "^21.0.0",
|
|
119
119
|
"@types/update-notifier": "^6.0.8",
|
|
120
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
121
|
-
"@typescript-eslint/parser": "^8.
|
|
120
|
+
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
121
|
+
"@typescript-eslint/parser": "^8.56.1",
|
|
122
122
|
"chai": "^6.2.2",
|
|
123
123
|
"chai-as-promised": "^8.0.2",
|
|
124
124
|
"chai-string": "^1.6.0",
|
|
125
125
|
"cross-env": "^10.1.0",
|
|
126
|
-
"eslint": "^
|
|
126
|
+
"eslint": "^10.0.2",
|
|
127
127
|
"eslint-config-prettier": "^10.1.8",
|
|
128
128
|
"eslint-config-raine": "^0.5.0",
|
|
129
129
|
"eslint-config-standard": "^17.1.0",
|
|
130
130
|
"eslint-plugin-import": "^2.32.0",
|
|
131
|
-
"eslint-plugin-jsdoc": "^62.
|
|
132
|
-
"eslint-plugin-n": "^17.
|
|
131
|
+
"eslint-plugin-jsdoc": "^62.7.0",
|
|
132
|
+
"eslint-plugin-n": "^17.24.0",
|
|
133
133
|
"eslint-plugin-promise": "^7.2.1",
|
|
134
134
|
"lint-staged": "^16.2.7",
|
|
135
135
|
"markdownlint-cli": "^0.47.0",
|
|
136
136
|
"mocha": "^11.7.5",
|
|
137
137
|
"npm-run-all": "^4.1.5",
|
|
138
138
|
"prettier": "^3.8.1",
|
|
139
|
-
"rimraf": "^6.1.
|
|
140
|
-
"rolldown": "1.0.0-rc.
|
|
141
|
-
"rolldown-plugin-dts": "^0.
|
|
139
|
+
"rimraf": "^6.1.3",
|
|
140
|
+
"rolldown": "1.0.0-rc.5",
|
|
141
|
+
"rolldown-plugin-dts": "^0.22.1",
|
|
142
142
|
"rollup-plugin-node-externals": "^8.1.2",
|
|
143
|
-
"rollup-plugin-visualizer": "^
|
|
143
|
+
"rollup-plugin-visualizer": "^7.0.0",
|
|
144
144
|
"should": "^13.2.3",
|
|
145
145
|
"simple-git-hooks": "^2.13.1",
|
|
146
146
|
"sinon": "^21.0.1",
|
|
@@ -149,11 +149,11 @@
|
|
|
149
149
|
"ts-node": "^10.9.2",
|
|
150
150
|
"tsx": "^4.21.0",
|
|
151
151
|
"typescript": "^5.9.3",
|
|
152
|
-
"typescript-eslint": "^8.
|
|
152
|
+
"typescript-eslint": "^8.56.1",
|
|
153
153
|
"typescript-json-schema": "^0.67.1",
|
|
154
|
-
"verdaccio": "^6.2.
|
|
154
|
+
"verdaccio": "^6.2.7",
|
|
155
155
|
"vite": "^7.3.1",
|
|
156
|
-
"vite-bundle-analyzer": "^1.3.
|
|
156
|
+
"vite-bundle-analyzer": "^1.3.6",
|
|
157
157
|
"vite-node": "^5.3.0",
|
|
158
158
|
"vite-plugin-dts": "^4.5.4",
|
|
159
159
|
"yarn": "^1.22.22"
|