@baicie/ncu 0.1.21 → 0.1.25

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.
@@ -1,2 +1,2 @@
1
1
  function e({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}const t=e();function n(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(t,``)}export{n as default};
2
- //# sourceMappingURL=strip-ansi.js.map
2
+ //# sourceMappingURL=strip-ansi.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strip-ansi.mjs","names":[],"sources":["../../../node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js","../../../node_modules/.pnpm/strip-ansi@7.1.2/node_modules/strip-ansi/index.js"],"sourcesContent":["export default function ansiRegex({onlyFirst = false} = {}) {\n\t// Valid string terminator sequences are BEL, ESC\\, and 0x9c\n\tconst ST = '(?:\\\\u0007|\\\\u001B\\\\u005C|\\\\u009C)';\n\n\t// OSC sequences only: ESC ] ... ST (non-greedy until the first ST)\n\tconst osc = `(?:\\\\u001B\\\\][\\\\s\\\\S]*?${ST})`;\n\n\t// CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte\n\tconst csi = '[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:\\\\d{1,4}(?:[;:]\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]';\n\n\tconst pattern = `${osc}|${csi}`;\n\n\treturn new RegExp(pattern, onlyFirst ? undefined : 'g');\n}\n","import ansiRegex from 'ansi-regex';\n\nconst regex = ansiRegex();\n\nexport default function stripAnsi(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(`Expected a \\`string\\`, got \\`${typeof string}\\``);\n\t}\n\n\t// Even though the regex is global, we don't need to reset the `.lastIndex`\n\t// because unlike `.exec()` and `.test()`, `.replace()` does it automatically\n\t// and doing it manually has a performance penalty.\n\treturn string.replace(regex, '');\n}\n"],"x_google_ignoreList":[0,1],"mappings":"AAAA,SAAwB,EAAU,CAAC,YAAY,IAAS,EAAE,CAAE,CAY3D,OAAW,OAFK,gJAEW,EAAY,IAAA,GAAY,IAAI,CCVxD,MAAM,EAAQ,GAAW,CAEzB,SAAwB,EAAU,EAAQ,CACzC,GAAI,OAAO,GAAW,SACrB,MAAU,UAAU,gCAAgC,OAAO,EAAO,IAAI,CAMvE,OAAO,EAAO,QAAQ,EAAO,GAAG"}
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import{a as e,c as t,d as n,i as r,l as i,n as a,o,s,u as c}from"./chunks/src.js";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:c});if(_.update&&_.update.latest!==n){let{default:e}=await import(`chalk`),t=l.parse(_.update.current)?.major,n=l.parse(_.update.latest)?.major,r=(t&&n&&n>=t?Array(n-t).fill(0).map((e,n)=>t+n+1):[]).map(e=>`${i??``}/releases/tag/v${e}.0.0`),a=`${i??``}/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}`)}
2
+ import{a as e,c as t,d as n,i as r,l as i,n as a,o,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:c});if(_.update&&_.update.latest!==n){let{default:e}=await import(`chalk`),t=l.parse(_.update.current)?.major,n=l.parse(_.update.latest)?.major,r=(t&&n&&n>=t?Array(n-t).fill(0).map((e,n)=>t+n+1):[]).map(e=>`${i??``}/releases/tag/v${e}.0.0`),a=`${i??``}/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
4
  ${e.dim.underline(_.update.type===`major`?r.map(t=>e.dim.underline(t)).join(`
5
5
  `):a)}`})}let v=process.argv.slice(2),y=v.findIndex(e=>e===`--help`||e===`-h`);if(y!==-1&&v[y+1]){let e=v[y+1].replace(/^-*/,``);e===`help`||e===`h`?console.info(`Would you like some help with your help?`):(await t(),[...v.slice(0,y),...v.slice(y+1)].forEach(e=>{let t=e.replace(/^-*/,``),n=o.find(e=>t===e.long||t===e.short||t===`no-${e.long}`&&e.type===`boolean`);n?console.info(s(n)+`
6
6
  `):t===`version`||t===`v`||t===`V`?console.info(s({long:`version`,short:`v`,description:m,type:`string`})+`
7
7
  `):console.info(`Unknown option: ${e}`)})),process.exit(0)}let b=new Set(o.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(n),process.exit(0)}),o.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(n);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 t(w);let A=!process.env.NCU_TESTS||E||k?await e({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();a({...A&&Object.keys(A.config).length>0?{rcConfigPath:A.filePath}:null,...r(f.opts(),e=>e!==void 0),args:f.args,...N.filter?{filter:N.filter}:null,...N.reject?{reject:N.reject}:null},{cli:!0})})();
8
- //# sourceMappingURL=cli.js.map
8
+ //# sourceMappingURL=cli.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.mjs","names":["pkg.version","pkg.homepage","cliOptions","option","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,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,EAC0B,IAAI,GAAgB,GAAGC,GAAgB,GAAG,iBAAiB,EAAa,MAAM,CAG1G,EAAa,GAAGA,GAAgB,GAAG,YAAY,EAAS,OAAO,QAAQ,MAAM,EAAS,OAAO,SAEnG,EAAS,OAAO,CACd,MAAO,GACP,SAAU,GACV,QAAS,oBAAoB,EAAM,IAAI,mBAAmB,GAAG,EAAM,MAAM,MAAM,GAC7E,EAAS,OAAO,OAAS,QACrB,EAAM,IAAI,kBAAkB,CAC5B,EAAS,OAAO,OAAS,QACvB,EAAM,OAAO,kBAAkB,CAC/B,EAAM,MAAM,kBAAkB,CACrC;MACD,EAAM,KAAK,kBAAkB,CAAC;EAClC,EAAM,IAAI,UACV,EAAS,OAAO,OAAS,QAAU,EAAY,IAAI,GAAO,EAAM,IAAI,UAAU,EAAI,CAAC,CAAC,KAAK;EAAK,CAAG,EAClG,GACI,CAAC,CAKJ,IAAM,EAAU,QAAQ,KAAK,MAAM,EAAE,CAC/B,EAAY,EAAQ,UAAU,GAA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AgB,cAAgB,EAClC,EAAQ,MAAM,EAAkB,CAChC,IAAM,EAAsB,EAAQ,MAAM,CAa1C,EAVgB,CACd,GAAI,GAAY,OAAO,KAAK,EAAS,OAAO,CAAC,OAAS,EAAI,CAAE,aAAc,EAAS,SAAU,CAAG,KAChG,GAAG,EAAO,EAAQ,MAAM,CAAG,GAAmB,IAAU,IAAA,GAAU,CAClE,KAAM,EAAQ,KACd,GAAI,EAAoB,OAAS,CAAE,OAAQ,EAAoB,OAAQ,CAAG,KAC1E,GAAI,EAAoB,OAAS,CAAE,OAAQ,EAAoB,OAAQ,CAAG,KAC3E,CAIY,CAAE,IAAK,GAAM,CAAC,IACzB"}
@@ -77,21 +77,21 @@ interface RunOptions {
77
77
  /** Clear the default cache, or the cache file specified by `--cacheFile`. */
78
78
  cacheClear?: boolean;
79
79
  /** Cache expiration in minutes. Only works with `--cache`.
80
- *
81
- * @default 10
82
- */
80
+ *
81
+ * @default 10
82
+ */
83
83
  cacheExpiration?: number;
84
84
  /** Filepath for the cache file. Only works with `--cache`.
85
- *
86
- * @default "~/.ncu-cache.json"
87
- */
85
+ *
86
+ * @default "~/.ncu-cache.json"
87
+ */
88
88
  cacheFile?: string;
89
89
  /** Force color in terminal. */
90
90
  color?: boolean;
91
91
  /** Max number of concurrent HTTP requests to registry.
92
- *
93
- * @default 8
94
- */
92
+ *
93
+ * @default 8
94
+ */
95
95
  concurrency?: number;
96
96
  /** Config file name. (default: .ncurc.{json,yml,js,cjs}) */
97
97
  configFileName?: string;
@@ -104,14 +104,14 @@ interface RunOptions {
104
104
  /** Run recursively in current working directory. Alias of (`--packageFile '**\/package.json'`). */
105
105
  deep?: boolean;
106
106
  /** Check one or more sections of dependencies only: dev, optional, peer, prod, or packageManager (comma-delimited).
107
- *
108
- * @default ["prod","dev","optional","packageManager"]
109
- */
107
+ *
108
+ * @default ["prod","dev","optional","packageManager"]
109
+ */
110
110
  dep?: string | readonly string[];
111
111
  /** Include deprecated packages. Use `--no-deprecated` to exclude deprecated packages (20–25% slower).
112
- *
113
- * @default true
114
- */
112
+ *
113
+ * @default true
114
+ */
115
115
  deprecated?: boolean;
116
116
  /** Iteratively installs upgrades and runs tests to identify breaking upgrades. Requires `-u` to execute. Run "ncu --help --doctor" for details. */
117
117
  doctor?: boolean;
@@ -122,9 +122,9 @@ interface RunOptions {
122
122
  /** Include only packages that satisfy engines.node as specified in the package file. */
123
123
  enginesNode?: boolean;
124
124
  /** Set the error level. 1: exits with error code 0 if no errors occur. 2: exits with error code 0 if no packages need updating (useful for continuous integration).
125
- *
126
- * @default 1
127
- */
125
+ *
126
+ * @default 1
127
+ */
128
128
  errorLevel?: number;
129
129
  /** Include only package names matching the given string, wildcard, glob, comma-or-space-delimited list, /regex/, or predicate function. Run "ncu --help --filter" for details. */
130
130
  filter?: string | RegExp | readonly (string | RegExp)[] | FilterFunction;
@@ -141,9 +141,9 @@ interface RunOptions {
141
141
  /** Ignore directories containing package.json files (comma-delimited). */
142
142
  ignore?: string | readonly string[];
143
143
  /** Control the auto-install behavior: always, never, prompt. Run "ncu --help --install" for details.
144
- *
145
- * @default "prompt"
146
- */
144
+ *
145
+ * @default "prompt"
146
+ */
147
147
  install?: 'always' | 'never' | 'prompt';
148
148
  /** Enable interactive prompts for each dependency; implies `-u` unless one of the json options are set. */
149
149
  interactive?: boolean;
@@ -154,9 +154,9 @@ interface RunOptions {
154
154
  /** Output upgraded dependencies in json. */
155
155
  jsonUpgraded?: boolean;
156
156
  /** Amount to log: silent, error, minimal, warn, info, verbose, silly.
157
- *
158
- * @default "warn"
159
- */
157
+ *
158
+ * @default "warn"
159
+ */
160
160
  loglevel?: string;
161
161
  /** Merges nested configs with the root config file for `--deep` or `--packageFile` options. (default: false) */
162
162
  mergeConfig?: boolean;
@@ -185,14 +185,14 @@ interface RunOptions {
185
185
  /** Remove version ranges from the final package version. */
186
186
  removeRange?: boolean;
187
187
  /** Number of times to retry failed requests for package info.
188
- *
189
- * @default 3
190
- */
188
+ *
189
+ * @default 3
190
+ */
191
191
  retry?: number;
192
192
  /** Runs updates on the root project in addition to specified workspaces. Only allowed with `--workspace` or `--workspaces`.
193
- *
194
- * @default true
195
- */
193
+ *
194
+ * @default true
195
+ */
196
196
  root?: boolean;
197
197
  /** Don't output anything. Alias for `--loglevel` silent. */
198
198
  silent?: boolean;
@@ -244,4 +244,4 @@ declare function run(runOptions?: RunOptions, {
244
244
  }): Promise<PackageFile | Index<VersionSpec> | void>;
245
245
  //#endregion
246
246
  export { type RcOptions, type RunOptions, run as default, run, defineConfig };
247
- //# sourceMappingURL=index.d.ts.map
247
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ import{n as e,r as t,t as n}from"./chunks/src.mjs";export{e as default,t as defineConfig,n as run};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baicie/ncu",
3
- "version": "0.1.21",
3
+ "version": "0.1.25",
4
4
  "author": "Tomas Junnonen <tomas1@gmail.com>",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -21,11 +21,32 @@
21
21
  "node": ">=20.0.0",
22
22
  "npm": ">=8.12.1"
23
23
  },
24
- "main": "build/index.js",
25
- "types": "build/index.d.ts",
24
+ "main": "dist/cjs/index.cjs",
25
+ "types": "dist/esm/index.mjs",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/esm/index.d.mts",
29
+ "module": "./dist/esm/index.mjs",
30
+ "import": "./dist/esm/index.mjs",
31
+ "require": "./dist/esm/index.cjs"
32
+ }
33
+ },
34
+ "simple-git-hooks": {
35
+ "pre-commit": "pnpm lint-staged",
36
+ "commit-msg": "node -e \"import('@baicie/scripts').then(m => m.verifyCommit())\""
37
+ },
38
+ "lint-staged": {
39
+ "*.{js,json}": [
40
+ "prettier --write"
41
+ ],
42
+ "*.ts?(x)": [
43
+ "eslint --fix",
44
+ "prettier --parser=typescript --write"
45
+ ]
46
+ },
26
47
  "bin": {
27
- "npm-check-updates": "build/cli.js",
28
- "ncu": "build/cli.js"
48
+ "npm-check-updates": "dist/cjs/cli.cjs",
49
+ "ncu": "dist/cjs/cli.cjs"
29
50
  },
30
51
  "repository": {
31
52
  "type": "git",
@@ -72,9 +93,10 @@
72
93
  },
73
94
  "devDependencies": {
74
95
  "@baicie/release": "^0.1.11",
96
+ "@baicie/scripts": "^0.1.2",
75
97
  "@eslint/js": "^9.39.2",
76
- "@trivago/prettier-plugin-sort-imports": "^6.0.0",
77
- "@types/bun": "^1.3.5",
98
+ "@trivago/prettier-plugin-sort-imports": "^6.0.2",
99
+ "@types/bun": "^1.3.6",
78
100
  "@types/chai": "^5.2.3",
79
101
  "@types/chai-as-promised": "^8.0.2",
80
102
  "@types/chai-string": "^1.4.5",
@@ -83,9 +105,9 @@
83
105
  "@types/ini": "^4.1.1",
84
106
  "@types/js-yaml": "^4.0.9",
85
107
  "@types/jsonlines": "^0.1.5",
86
- "@types/lodash": "^4.17.21",
108
+ "@types/lodash": "^4.17.23",
87
109
  "@types/mocha": "^10.0.10",
88
- "@types/node": "^25.0.3",
110
+ "@types/node": "^25.0.8",
89
111
  "@types/npm-registry-fetch": "^8.0.9",
90
112
  "@types/parse-github-url": "^1.0.3",
91
113
  "@types/picomatch": "^4.0.2",
@@ -95,8 +117,8 @@
95
117
  "@types/semver-utils": "^1.1.3",
96
118
  "@types/sinon": "^21.0.0",
97
119
  "@types/update-notifier": "^6.0.8",
98
- "@typescript-eslint/eslint-plugin": "^8.51.0",
99
- "@typescript-eslint/parser": "^8.51.0",
120
+ "@typescript-eslint/eslint-plugin": "^8.53.0",
121
+ "@typescript-eslint/parser": "^8.53.0",
100
122
  "chai": "^6.2.2",
101
123
  "chai-as-promised": "^8.0.2",
102
124
  "chai-string": "^1.6.0",
@@ -106,52 +128,40 @@
106
128
  "eslint-config-raine": "^0.5.0",
107
129
  "eslint-config-standard": "^17.1.0",
108
130
  "eslint-plugin-import": "^2.32.0",
109
- "eslint-plugin-jsdoc": "^61.5.0",
110
- "eslint-plugin-n": "^17.23.1",
131
+ "eslint-plugin-jsdoc": "^62.0.0",
132
+ "eslint-plugin-n": "^17.23.2",
111
133
  "eslint-plugin-promise": "^7.2.1",
112
- "lockfile-lint": "^4.14.1",
134
+ "lint-staged": "^16.2.7",
113
135
  "markdownlint-cli": "^0.47.0",
114
136
  "mocha": "^11.7.5",
115
137
  "npm-run-all": "^4.1.5",
116
- "prettier": "^3.7.4",
138
+ "prettier": "^3.8.0",
117
139
  "rimraf": "^6.1.2",
118
- "rolldown": "1.0.0-beta.57",
119
- "rolldown-plugin-dts": "^0.20.0",
140
+ "rolldown": "1.0.0-beta.60",
141
+ "rolldown-plugin-dts": "^0.21.1",
120
142
  "rollup-plugin-node-externals": "^8.1.2",
121
143
  "rollup-plugin-visualizer": "^6.0.5",
122
144
  "should": "^13.2.3",
145
+ "simple-git-hooks": "^2.13.1",
123
146
  "sinon": "^21.0.1",
124
147
  "source-map-support": "^0.5.21",
125
148
  "strip-ansi": "^7.1.2",
126
149
  "ts-node": "^10.9.2",
127
150
  "tsx": "^4.21.0",
128
151
  "typescript": "^5.9.3",
129
- "typescript-eslint": "^8.51.0",
152
+ "typescript-eslint": "^8.53.0",
130
153
  "typescript-json-schema": "^0.67.1",
131
154
  "verdaccio": "^6.2.4",
132
- "vite": "^7.3.0",
155
+ "vite": "^7.3.1",
133
156
  "vite-bundle-analyzer": "^1.3.2",
134
157
  "vite-node": "^5.2.0",
135
158
  "vite-plugin-dts": "^4.5.4",
136
159
  "yarn": "^1.22.22"
137
160
  },
138
161
  "files": [
139
- "build",
162
+ "dist",
140
163
  "!**/test/**"
141
164
  ],
142
- "lockfile-lint": {
143
- "allowed-schemes": [
144
- "https:",
145
- "git+ssh:"
146
- ],
147
- "allowed-hosts": [
148
- "npm",
149
- "github.com"
150
- ],
151
- "empty-hostname": false,
152
- "type": "npm ",
153
- "path": "package-lock.json"
154
- },
155
165
  "mocha": {
156
166
  "check-leaks": true,
157
167
  "extension": [
@@ -172,11 +182,10 @@
172
182
  },
173
183
  "scripts": {
174
184
  "dev": "rolldown --watch -c",
175
- "build": "rimraf build && npm run build:options && rolldown -m -c",
185
+ "build": "rimraf dist && npm run build:options && rolldown -m -c",
176
186
  "build:options": "vite-node src/scripts/build-options.ts",
177
- "build:analyze": "rimraf build && npm run build:options && ANALYZER=true vite build",
187
+ "build:analyze": "rimraf dist && npm run build:options && ANALYZER=true vite build",
178
188
  "lint": "cross-env FORCE_COLOR=1 npm-run-all --parallel --aggregate-output lint:*",
179
- "lint:lockfile": "lockfile-lint",
180
189
  "lint:markdown": "markdownlint \"**/*.md\" --ignore \"**/node_modules/**/*.md\" --ignore build --config .markdownlint.cjs",
181
190
  "lint:src": "eslint --cache",
182
191
  "prettier": "prettier . --check",
@@ -185,8 +194,9 @@
185
194
  "test:bun": "test/bun-install.sh && mocha test/bun",
186
195
  "test:unit": "mocha test test/package-managers/*",
187
196
  "test:e2e": "./test/e2e.sh",
188
- "ncu": "node build/cli.js",
197
+ "ncu": "node dist/cjs/cli.cjs",
189
198
  "release": "tsx scripts/release.ts",
190
- "ci-publish": "tsx scripts/publish.ts"
199
+ "ci-publish": "tsx scripts/publish.ts",
200
+ "postinstall": "simple-git-hooks"
191
201
  }
192
202
  }