@kitschpatrol/remark-config 8.2.0 → 8.3.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/bin/cli.js +6 -6
- package/package.json +2 -2
package/bin/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{cosmiconfig as e}from"cosmiconfig";import{TypeScriptLoader as t}from"cosmiconfig-typescript-loader";import{execa as n}from"execa";import r from"fs-extra";import i from"node:fs";import a from"node:path";import{PassThrough as
|
|
3
|
-
`);try{return await r.execute(a,t,n)}catch(e){return console.error(String(e)),1}}function
|
|
4
|
-
`);for(let e of t)
|
|
5
|
-
`),1;let d=
|
|
6
|
-
`),0;let o=
|
|
7
|
-
`);for(let e of o)t.write(`${e}\n`);return 0},name:`Cosmiconfig ${e}`}}async function
|
|
2
|
+
import{cosmiconfig as e}from"cosmiconfig";import{TypeScriptLoader as t}from"cosmiconfig-typescript-loader";import{execa as n}from"execa";import r from"fs-extra";import i from"node:fs";import{availableParallelism as a}from"node:os";import o from"node:path";import{PassThrough as s,Transform as c}from"node:stream";import{fileURLToPath as l}from"node:url";import{packageUp as u,packageUpSync as d}from"package-up";import f from"yargs";import{hideBin as p}from"yargs/helpers";import m from"picocolors";import{stripVTControlCharacters as h}from"node:util";import g from"@pinojs/json-colorizer";import _ from"decircular";import ee from"deepmerge";import v from"json-stringify-pretty-compact";import{findWorkspacesRoot as y}from"find-workspaces";import b from"node:fs/promises";var te=`8.3.0`;const x=[`json`,`machine`,`native`],ne=x;function S(e){return typeof e==`string`&&x.includes(e)}function C(){let e=process.env.KSC_FORMAT;return S(e)?e:`native`}function re(){let{argv:e}=process;for(let[t,n]of e.entries()){let r;n===`--format`?r=e[t+1]:n.startsWith(`--format=`)&&(r=n.slice(9)),S(r)&&(process.env.KSC_FORMAT=r)}}function ie(){let{env:e}=process;if(e.NO_COLOR!==void 0&&e.NO_COLOR!==``)return!1;if(e.FORCE_COLOR!==void 0)return e.FORCE_COLOR!==`0`&&e.FORCE_COLOR!==`false`;if(e.TERM===`dumb`)return!1}function w(e,{ciColor:t=!0}={}){let n=ie();return n===void 0?e.isTTY===!0||t&&!!process.env.CI:n}function T(){return C()===`json`?process.stderr:process.stdout}function E(){return C()===`machine`?m.createColors(!1):m.createColors(w(T()))}function ae(e){if(!e)return{FORCE_COLOR:`0`,NO_COLOR:`1`};let t=process.env.FORCE_COLOR;return t===void 0||t===``?{FORCE_COLOR:`1`}:{}}const oe=/\s*\n\s*/gv,se=/\r?\n/v;function ce(e){let t=e.message.replaceAll(oe,` `),n=e.rule===void 0?e.tool:`${e.tool}/${e.rule}`;return e.file===void 0?`${e.severity}: ${t} [${n}]`:`${e.file}:${e.line??1}:${e.column??1}: ${e.severity}: ${t} [${n}]`}function le(e,t){let n=(e.file??``).localeCompare(t.file??``);if(n!==0)return n;let r=(e.line??0)-(t.line??0);return r===0?(e.column??0)-(t.column??0):r}function ue(e,t){let n=t.toSorted(le);return{cwd:process.cwd(),diagnostics:n,success:e.every(e=>e.exitCode===0),summary:{errors:n.filter(e=>e.severity===`error`).length,infos:n.filter(e=>e.severity===`info`).length,warnings:n.filter(e=>e.severity===`warning`).length},tools:e,version:1}}function D(e){return h(e).split(se).map(e=>e.trimEnd()).filter(e=>e.trim().length>0)}function O(e){return e instanceof Error&&`exitCode`in e&&typeof e.exitCode==`number`}function k(e){return w(process.stdout,{ciColor:!1})?de(e):A(e)}function A(e){return v(_(e),{indent:2,replacer(e,t){return typeof t==`function`?t.name:t}})}function de(e){return g(A(e),{colors:{BRACKET:`gray`}})}const fe=(e,t,n)=>{let r=[...e];for(let[i,a]of t.entries())r[i]===void 0?r[i]=n.cloneUnlessOtherwiseSpecified(a,n):n.isMergeableObject(a)?r[i]=j(e[i],a,n):e.includes(a)||r.push(a);return r};function j(e,t,n={arrayMerge:fe}){return ee(e,t,n)}function M(e){let{tasks:t}=e;return Array.isArray(t)?t:[]}function pe(e,t){let n=[...M(e)];for(let e of M(t)){let t=n.findIndex(t=>t.label!==void 0&&t.label===e.label);t===-1?n.push(e):n[t]=e}return{...e,...t,tasks:n}}function N(){let e=d();if(e===void 0)throw Error(`No package.json found.`);return o.dirname(e)}function P(){let e=y();return e===null?N():o.resolve(e.location)}function F(e){if(e===`workspace-root`)return P();if(e===`package-dir`)return N();if(typeof e==`string`){if(!r.pathExistsSync(e))throw Error(`Custom cwd directory does not exist: ${e}`);return e}return process.cwd()}async function me(e,t){try{let{default:n}=await import(`prettier`),r=await n.resolveConfig(e),i=await n.format(t,{filepath:e,...r});await b.writeFile(e,i,`utf8`)}catch{console.warn(`Skipped formatting ${e} since Prettier is not installed.`)}}async function I(e){try{await me(e,await b.readFile(e,`utf8`))}catch{}}const L=/\r?\n/v;function R(e){let t=``,n=t=>t.filter(t=>t.trim()!==``&&!e(h(t))).map(e=>`${e}\n`).join(``);return new c({flush(e){e(void 0,n([t]))},transform(e,r,i){let a=(t+e.toString()).split(L);t=a.pop()??``,i(void 0,n(a))}})}function z(e,t){let n=C()===`native`?e:void 0,r=n===void 0||n===``?``:t===void 0?n:E()[t](n),i=``,a=e=>e.filter(e=>e.trim().length>0).map(e=>r===``?`${e}\n`:`${r} ${e}\n`).join(``);return new c({flush(e){e(void 0,a([i]))},transform(e,t,n){let r=(i+e.toString()).split(L);i=r.pop()??``,n(void 0,a(r))}})}async function he(e){let t=[];return new Promise((n,r)=>{e.on(`data`,e=>{t.push(e)}),e.on(`error`,e=>{r(e)}),e.on(`end`,()=>{n(Buffer.concat(t).toString(`utf8`))})})}function B(e,t){return t===1?e:e+`s`}async function V(e){return typeof e==`function`?e():e}async function ge(e,t,n,r,i){let a;if(r.logPrefix===void 0)a=e;else{let t=z(r.logPrefix,r.logColor);t.pipe(e),a=t}i&&a.write(E().bold(`Running: "${r.name}() with Positional arguments: ${String(t)} and Option flags: ${String(n)}"`)+`
|
|
3
|
+
`);try{return await r.execute(a,t,n)}catch(e){return console.error(String(e)),1}}function H(e,t,n,r,i){return[...e.subcommands??[],...e.receiveOptionFlags?n:[],...r??[],...i&&e.cache!==void 0?[...e.cache.flags,`--cache-location`,o.join(P(),`node_modules`,`.cache`,`ksc`,e.cache.name)]:[],...e.receivePositionalArguments?t:[],...e.positionalArguments??[]]}async function _e(e,t,r,i,a,o){let c=1,l;if(i.logPrefix===void 0)l=e;else{let t=z(i.logPrefix,i.logColor);t.pipe(e),l=t}let u=H(i,t,r,i.optionFlags,a),d=F(i.cwdOverride);o&&l.write(`Running: "${i.name} ${u.join(` `)}"\n`);let f=i.prettyJsonOutput?new s:l,p=ae(C()===`native`&&i.prettyJsonOutput!==!0&&w(T()));try{let e=n(i.name,u,{cwd:d,env:{...p},preferLocal:!0,reject:!1,stdin:`inherit`});if(i.outputFilter){let t=R(i.outputFilter),n=R(i.outputFilter);e.stdout.pipe(t).pipe(f,{end:!1}),e.stderr.pipe(n).pipe(f,{end:!1})}else e.stdout.pipe(f,{end:!1}),e.stderr.pipe(f,{end:!1});let t=await e;if(i.prettyJsonOutput){f.end();let e=await he(f),t=k(JSON.parse(e)).split(`
|
|
4
|
+
`);for(let e of t)l.write(`${e}\n`)}c=t.exitCode??1}catch(e){console.error(`${i.name} failed with error:`),console.error(e),O(e)&&(c=typeof e.exitCode==`number`?e.exitCode:1)}return c}function U(e){return`execute`in e}function W(e){return`kind`in e}async function G(e,t,r,i,a){let o=H(r,e,t,r.collect?.optionFlags??r.optionFlags,i),s=F(r.cwdOverride);try{let e=n(r.name,o,{cwd:s,env:ae(!1),preferLocal:!0,reject:!1,stdin:`inherit`});a!==void 0&&e.stderr.pipe(a,{end:!1});let t=await e;return{cwd:s,exitCode:t.exitCode??1,stderr:t.stderr,stdout:t.stdout}}catch(e){return console.error(`${r.name} failed with error:`),console.error(e),{cwd:s,exitCode:O(e)&&typeof e.exitCode==`number`?e.exitCode:1,stderr:``,stdout:``}}}function ve(e){return typeof e==`object`&&!!e&&`version`in e&&e.version===1&&`diagnostics`in e&&Array.isArray(e.diagnostics)&&`tools`in e&&Array.isArray(e.tools)}async function ye(e,t,n,r,i){let a=Date.now(),o=()=>Date.now()-a;if(U(r)){if(r.collect!==void 0)try{let{diagnostics:e,exitCode:i,unparsed:a}=await r.collect(t,n);return{diagnostics:e,exitCode:i,tools:[{durationMs:o(),exitCode:i,name:r.name,unparsed:a}]}}catch(e){return{diagnostics:[],exitCode:1,tools:[{durationMs:o(),exitCode:1,name:r.name,unparsed:[String(e)]}]}}let e=``,i=new s;i.on(`data`,t=>{e+=t.toString()});let a;try{a=await r.execute(i,t,n)}catch(t){e+=`\n${String(t)}`,a=1}return{diagnostics:[],exitCode:a,tools:[{durationMs:o(),exitCode:a,name:r.name,unparsed:D(e)}]}}if(W(r))throw Error(`Command groups must be expanded before collection`);if(r.outputFormatAware){let a=await G(t,n,r,i,e);try{let e=JSON.parse(a.stdout);if(!ve(e))throw Error(`Child output is not a lint report`);return{diagnostics:e.diagnostics,exitCode:a.exitCode,tools:e.tools}}catch{return{diagnostics:[],exitCode:a.exitCode,tools:[{durationMs:o(),exitCode:a.exitCode,name:r.name,unparsed:D(a.stdout)}]}}}let c=await G(t,n,r,i);if(r.collect!==void 0)try{let{diagnostics:e,unparsed:t}=r.collect.parse(c);return{diagnostics:e,exitCode:c.exitCode,tools:[{durationMs:o(),exitCode:c.exitCode,name:r.name,unparsed:t}]}}catch(e){return{diagnostics:[],exitCode:c.exitCode,tools:[{durationMs:o(),exitCode:c.exitCode,name:r.name,unparsed:[...D(c.stdout),...D(c.stderr),String(e)]}]}}return{diagnostics:[],exitCode:c.exitCode,tools:[{durationMs:o(),exitCode:c.exitCode,name:r.name,unparsed:[...D(c.stdout),...D(c.stderr)]}]}}const be=/^ksc-/v;function K(e){return e.replace(be,``)}function q(e){return e===void 0||e.length===0?[]:e.flatMap(e=>e.split(`,`)).map(e=>K(e.trim()))}function J(e){return e.option(`skip`,{array:!0,describe:`Tool names to skip (with or without "ksc-" prefix).`,type:`string`})}function Y(e){return e.option(`format`,{choices:ne,default:`native`,describe:`Output format: "native" streams each tool's own output, "machine" prints one parseable line per issue for editor problem matchers, "json" prints an aggregate report.`})}function X(e){return e.option(`cache`,{boolean:!0,default:!0,describe:`Use tool-native caches stored below node_modules/.cache/ksc at the workspace root. Disable with --no-cache.`})}function xe(e,t){return t===`native`||t===`machine`&&!U(e)&&!W(e)&&e.outputFormatAware===!0}function Se(e,t){for(let n of t.diagnostics)e.write(`${ce(n)}\n`);for(let n of t.tools)for(let t of n.unparsed)e.write(`${t}\n`)}function Ce(){return Math.min(4,a())}var we=class{concurrency;active=0;queue=[];constructor(e){this.concurrency=e}async run(e){this.active>=this.concurrency&&await new Promise(e=>{this.queue.push(e)}),this.active+=1;try{return await e()}finally{--this.active,this.queue.shift()?.()}}};async function Te(e){let t=e.cache??!1,n=e.concurrency??Ce();if(!Number.isInteger(n)||n<1)throw Error(`Concurrency must be a positive integer.`);return t&&await r.ensureDir(o.join(P(),`node_modules`,`.cache`,`ksc`)),{cache:t,scheduler:new we(n)}}function Ee(e,t){return e.positionalArgumentMode===`none`?[]:t.length>0?t:e.positionalArgumentDefault===void 0?[]:[e.positionalArgumentDefault]}function De(e,t){if(t.logPrefix===void 0)return e;let n=z(t.logPrefix,t.logColor);return n.pipe(e),n}async function Z(e,t){if(W(e)){if(t.nativeVerbose){let n=[e.subcommand,...t.positionalArguments].join(` `);t.logStream.write(`Running: "${e.name} ${n}"\n`)}let n=De(t.logStream,e);try{let r=await Oe(await V(e.commands),{...t,logStream:n,nativeVerbose:e.verbose,positionalArguments:Ee(e,t.positionalArguments)},e.parallel===!0);return{diagnostics:r.flatMap(({diagnostics:e})=>e),exitCode:+!r.every(({exitCode:e})=>e===0),machineOutcomes:r.flatMap(({machineOutcomes:e})=>e),name:e.name,tools:r.flatMap(({tools:e})=>e)}}catch(r){let i=String(r),a={durationMs:0,exitCode:1,name:e.name,unparsed:[i]};return t.format===`native`&&n.write(`${i}\n`),{diagnostics:[],exitCode:1,machineOutcomes:[{diagnostics:[],exitCode:1,tools:[a]}],name:e.name,tools:[a]}}}return t.scheduler.run(async()=>{if(xe(e,t.format))return{diagnostics:[],exitCode:await(U(e)?ge(t.logStream,t.positionalArguments,t.optionFlags,e,t.nativeVerbose):_e(t.logStream,t.positionalArguments,t.optionFlags,e,t.cache,t.nativeVerbose)),machineOutcomes:[],name:e.name,tools:[]};let n=await ye(t.logStream,t.positionalArguments,t.optionFlags,e,t.cache);return{diagnostics:n.diagnostics,exitCode:n.exitCode,machineOutcomes:[n],name:e.name,tools:n.tools}})}async function Oe(e,t,n){if(!n||t.scheduler.concurrency===1){let n=[];for(let r of e)n.push(await Z(r,t));return n}await Promise.resolve();let r=new Map;for(let[t,n]of e.entries()){let e=n.stage??0,i=r.get(e)??[];i.push({command:n,index:t}),r.set(e,i)}let i=Array.from({length:e.length}),a=r.keys().toArray().toSorted((e,t)=>e-t);for(let e of a){let n=r.get(e)??[],a=await Promise.all(n.map(async({command:e,index:n})=>({index:n,outcome:await Z(e,t)})));for(let{index:e,outcome:t}of a)i[e]=t}return i.filter(e=>e!==void 0)}function ke(e,t,n){let r=[],i=[];for(let e of t)n.length>0&&n.includes(K(e.name))?i.push(e):r.push(e);if(n.length>0){let r=new Set(i.map(e=>K(e.name))),a=n.filter(e=>!r.has(e));if(a.length>0){let n=t.map(e=>K(e.name)).join(`, `);e.write(`⚠️ ${E().yellow(`Unrecognized --skip ${B(`value`,a.length)}: ${a.join(`, `)}. Available: ${n}`)}\n`)}}return{commandsToRun:r,skippedCommands:i}}async function Q(e,t,n,r,i,a,o,s=`native`){let c=typeof s==`string`?{}:s,l=typeof s==`string`?s:c.format??`native`,{commandsToRun:u,skippedCommands:d}=ke(e,r,o??[]),f=l===`native`&&i,{cache:p,scheduler:m}=await Te(c),h=await Oe(u,{cache:p,format:l,logStream:e,nativeVerbose:f,optionFlags:n,positionalArguments:t,scheduler:m},c.parallel===!0),g=h.map(({exitCode:e,name:t})=>({exitCode:e,name:t})),_=h.flatMap(({tools:e})=>e),ee=h.flatMap(({diagnostics:e})=>e);if(l===`machine`)for(let t of h)for(let n of t.machineOutcomes)Se(e,n);let v=r.length,y=E();if(l===`native`&&d.length>0){let t=d.map(({name:e})=>e),n=y.bold(`${t.length} / ${v} ${B(`Command`,t.length)} Skipped:`);e.write(`⏭️ ${y.dim(n)} ${y.dim(t.join(`, `))}\n`)}if(l===`native`&&a){let t=g.filter(({exitCode:e})=>e===0).map(({name:e})=>e),n=g.filter(({exitCode:e})=>e!==0).map(({name:e})=>e);if(t.length>0){let n=y.bold(`${t.length} / ${v} ${B(`Command`,t.length)} Succeeded:`);e.write(`✅ ${y.green(n)} ${y.green(t.join(`, `))}\n`)}if(n.length>0){let t=y.bold(`${n.length} / ${v} ${B(`Command`,n.length)} Failed:`);e.write(`❌ ${y.red(t)} ${y.red(n.join(`, `))}\n`)}}return{exitCode:+!g.every(({exitCode:e})=>e===0),report:l===`json`?ue(_,ee):void 0}}async function Ae(e,t,n,a){let s=await u();if(s===void 0)throw Error("The `init` command must be used in a directory with a package.json file");let c=await u({cwd:l(import.meta.url)});if(c===void 0)return e.write(`Error: The script being called was not in a package, weird.
|
|
5
|
+
`),1;let d=o.join(o.dirname(c),`init`),f=o.dirname(s),p=(t===`file`||t===`package`)&&n!==void 0&&a!==void 0;try{if(p){let n=Object.keys(a)[0],i=r.readJsonSync(s);if(t===`package`){e.write(`Merging: \nPackage config key "${n}" → "${f}" (Because --location is set to "package")\n`);let t=j(i,a);r.writeJSONSync(s,t,{spaces:` `}),await I(s)}else n!==void 0&&Object.keys(i).includes(n)&&(e.write(`Deleting: \nPackage config key "${n}" in "${f}" (Because --location is set to "file")\n`),delete i[n],r.writeJSONSync(s,i,{spaces:` `}),await I(s))}if(!await r.pathExists(d))return 0;if((await r.readdir(d)).length===0)return e.write(`Source directory "${d}" is empty.\n`),0;e.write(`Adding initial configuration files from:\n"${d}" → "${f}"\n`),await r.copy(d,f,{async filter(a,s){let c=i.statSync(a).isFile(),l=i.existsSync(s);if(c){if(p&&t===`package`&&a.includes(n))return l?(e.write(`Deleting: \n"${a}" → "${s}" (Because --location is set to "package")\n`),r.removeSync(s)):e.write(`Skipping: \n"${a}" → "${s}" (Because --location is set to "package")\n`),!1;if(l&&(s.includes(`.vscode/`)||s.includes(`package.json`))&&o.extname(s)===`.json`){e.write(`Merging: \n"${a}" → "${s}"\n`);let t=r.readJSONSync(a),n=r.readJSONSync(s),i=s.endsWith(`.vscode/tasks.json`)?pe(n,t):j(n,t);return r.writeJSONSync(s,i,{spaces:` `}),await I(s),!1}return l?(e.write(`Overwriting: \n"${a}" → "${s}"\n`),await I(s),!0):(e.write(`Copying: \n"${a}" → "${s}"\n`),await I(s),!0)}return!0},overwrite:!0})}catch(e){return console.error(String(e)),1}return 0}async function je(e){let{commands:{fix:t,init:n,lint:r,printConfig:i},description:a,logColor:o,logPrefix:s,name:c,showSummary:l,verbose:u}=e;re();let d=z(s,o);d.pipe(T());let m=f(p(process.argv)).scriptName(c).usage(`$0 <command>`,a);n!==void 0&&m.command({builder(e){let t=n.locationOptionFlag?e.option(`location`,{choices:[`file`,`package`],default:`file`,describe:`Where to store the configuration.`,type:`string`}):e;return l?J(t):t},command:`init`,describe:n.description??`Initialize by copying starter config files to your project root${n.locationOptionFlag?` or to your package.json file.`:`.`}`,async handler(e){let t=n.locationOptionFlag?e.location:void 0,r=q(e.skip),{exitCode:i}=await Q(d,[],t===void 0?[]:[`--location`,t],[{async execute(e,t,r){return Ae(e,r.at(1),n.configFile,n.configPackageJson)},name:`copyAndMergeInitFiles`},...n.commands??[]],void 0,void 0,r);process.exitCode=i}}),r!==void 0&&m.command({builder(e){let t=X(Y(r.positionalArgumentMode===`none`?e:e.positional(`files`,{array:!0,...r.positionalArgumentDefault!==void 0&&{default:r.positionalArgumentDefault},describe:`Files or glob pattern to lint.`,type:`string`})));return l?J(t):t},command:r.positionalArgumentMode===`none`?`lint`:r.positionalArgumentMode===`optional`?`lint [files..]`:`lint <files..>`,describe:r.description,async handler(e){let t=e.files??[],n=q(e.skip),i=C(),{exitCode:a,report:o}=await Q(d,t,[],await V(r.commands),u,l,n,{cache:e.cache,format:i,parallel:r.parallel});o!==void 0&&process.stdout.write(`${k(o)}\n`),process.exitCode=a}}),t!==void 0&&m.command({builder(e){let n=X(Y(t.positionalArgumentMode===`none`?e:e.positional(`files`,{array:!0,...t.positionalArgumentDefault!==void 0&&{default:t.positionalArgumentDefault},describe:`Files or glob pattern to fix.`,type:`string`})));return l?J(n):n},command:t.positionalArgumentMode===`none`?`fix`:t.positionalArgumentMode===`optional`?`fix [files..]`:`fix <files..>`,describe:t.description,async handler(e){let n=e.files??[],r=q(e.skip),i=C(),{exitCode:a,report:o}=await Q(d,n,[],await V(t.commands),void 0,void 0,r,{cache:e.cache,format:i,parallel:t.parallel});o!==void 0&&process.stdout.write(`${k(o)}\n`),process.exitCode=a}}),i!==void 0&&m.command({builder(e){let t=i.positionalArgumentMode===`none`?e:e.positional(`file`,{...i.positionalArgumentDefault!==void 0&&{default:i.positionalArgumentDefault},describe:`File or glob pattern to print configuration for.`,type:`string`});return l?J(t):t},command:i.positionalArgumentMode===`none`?`print-config`:i.positionalArgumentMode===`optional`?`print-config [file]`:`print-config <file>`,describe:i.description,async handler(e){let t=e.file??void 0,n=t===void 0?[]:[t],r=q(e.skip),{exitCode:a}=await Q(d,n,[],await V(i.commands),u,l,r);process.exitCode=a}}),m.alias(`h`,`help`),m.version(te),m.alias(`v`,`version`),m.help(),m.wrap(process.stdout.isTTY?Math.min(120,m.terminalWidth()):0),await m.parseAsync()}function Me(e){return{async execute(t){let n=await Ne(e);if(n===void 0)return 1;let{config:r,filepath:i,isEmpty:a}=n;if(t.write(`Found ${e} configuration at "${i}"\n`),a)return t.write(`Configuration is empty.
|
|
6
|
+
`),0;let o=k(r).split(`
|
|
7
|
+
`);for(let e of o)t.write(`${e}\n`);return 0},name:`Cosmiconfig ${e}`}}async function Ne(n){let r=e(n,{loaders:{".ts":t()},searchStrategy:`project`});try{let e=await r.search();if(e===null){console.error(`No ${n} configuration found.`);return}return e}catch(e){console.error(`Error while searching for ${n} configuration:`,e);return}}const $={fileRun:`Matches files below the current working directory by default.`,monorepoRun:`In a monorepo, it will also run in all packages below the current working directory.`,monorepoSearch:`Searches up to the root of a monorepo if necessary.`,multiArgumentCaveat:`Will use file arguments / globs where possible if provided, but some of the invoked tools only operate at the package scope.`,multiOptionCaveat:`Will use option flags where possible if provided, but some of the invoked tools will ignore them.`,optionalFileRun:`Package-scoped by default, file-scoped if a file argument is provided.`,packageRun:`Package-scoped.`,packageSearch:`Package-scoped.`};await je({commands:{init:{configFile:`.remarkrc.js`,configPackageJson:{remarkConfig:{plugins:[`@kitschpatrol/remark-config`]}},locationOptionFlag:!0},printConfig:{commands:[Me(`remark`)],description:`Print the effective Remark configuration. ${$.packageSearch} ${$.monorepoSearch}`,positionalArgumentMode:`none`}},description:`Kitschpatrol's Remark and Remark Lint shared configuration tools. (Actual linting and fixing is managed through @kitschpatrol/eslint-config.)`,logColor:`blue`,logPrefix:`[remarklint]`,name:`ksc-remark`,order:8});export{};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitschpatrol/remark-config",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"description": "Markdown and MDX linting for @kitschpatrol/shared-config.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shared-config",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"cosmiconfig-typescript-loader": "^6.3.0",
|
|
50
50
|
"decircular": "^1.0.0",
|
|
51
51
|
"deepmerge": "^4.3.1",
|
|
52
|
-
"execa": "^
|
|
52
|
+
"execa": "^10.0.0",
|
|
53
53
|
"find-workspaces": "^0.3.1",
|
|
54
54
|
"fs-extra": "^11.3.6",
|
|
55
55
|
"json-stringify-pretty-compact": "^4.0.0",
|