diff --git a/dist/importer.js b/dist/importer.js index 767c16e..87a1446 100644 --- a/dist/importer.js +++ b/dist/importer.js @@ -88,4 +88,4 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1 `,now:{line:1,column:1},lineShift:0});return n&&n.charCodeAt(n.length-1)!==10&&n.charCodeAt(n.length-1)!==13&&(n+=` `),n;function s(a){return r.stack.push(a),o;function o(){r.stack.pop()}}}function fE(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function mE(e){let t=e;throw new Error("Cannot handle unknown node `"+t.type+"`")}function dE(e,t){if(e.type==="definition"&&e.type===t.type)return 0}function xE(e,t){return fx(e,this,t)}function gE(e,t){return mx(e,this,t)}function yE(e,t){return gx(this,e,t)}function ta(e){let t=this;t.compiler=r;function r(n){return hl(n,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}}var bx=pi().use(Dn).use(ta).freeze();function fl({onlyFirst:e=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}var bE=fl();function ml(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(bE,"")}var kx=Je(vx(),1),Ex=Je(wx(),1);function ra(e,t){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,countAnsiEscapeCodes:!1,...t},t.countAnsiEscapeCodes||(e=ml(e)),e.length===0))return 0;let r=t.ambiguousIsNarrow?1:2,n=0;for(let{segment:s}of new Intl.Segmenter().segment(e)){let a=s.codePointAt(0);if(a<=31||a>=127&&a<=159||a>=768&&a<=879)continue;if((0,Ex.default)().test(s)){n+=2;continue}switch(kx.default.eastAsianWidth(s)){case"F":case"W":{n+=2;break}case"A":{n+=r;break}default:n+=1}}return n}function xl(e,t){return na(e,t,"path")}function gl(e,t){return Sx(e,t,"line")||Sx(e,t,"column")||DE(e,t,"fatal")||na(e,t,"source")||na(e,t,"ruleId")||na(e,t,"reason")}function DE(e,t,r){return Fx(e[r])-Fx(t[r])}function Sx(e,t,r){return(e[r]||0)-(t[r]||0)}function na(e,t,r){return String(e[r]||"").localeCompare(String(t[r]||""))}function Fx(e){return e?0:e===!1?1:2}function ia(e){let t={fatal:0,warn:0,info:0};if(!e)throw new TypeError("Expected file or message for `value`, not `"+e+"`");return Array.isArray(e)?r(e):n(e),{fatal:t.fatal,nonfatal:t.warn+t.info,warn:t.warn,info:t.info,total:t.fatal+t.warn+t.info};function r(s){let a=-1;for(;++a=2,has16m:e>=3}}function wE(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=vE();n!==void 0&&(sa=n);let s=r?sa:n;if(s===0)return 0;if(r){if(Jt("color=16m")||Jt("color=full")||Jt("color=truecolor"))return 3;if(Jt("color=256"))return 2}if("TF_BUILD"in Pe&&"AGENT_NAME"in Pe)return 1;if(e&&!t&&s===void 0)return 0;let a=s||0;if(Pe.TERM==="dumb")return a;if(aa.default.platform==="win32"){let o=Ax.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Pe)return"GITHUB_ACTIONS"in Pe||"GITEA_ACTIONS"in Pe?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in Pe)||Pe.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in Pe)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Pe.TEAMCITY_VERSION)?1:0;if(Pe.COLORTERM==="truecolor"||Pe.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in Pe){let o=Number.parseInt((Pe.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Pe.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Pe.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Pe.TERM)||"COLORTERM"in Pe?1:a}function _x(e,t={}){let r=wE(e,{streamIsTTY:e&&e.isTTY,...t});return CE(r)}var kE={stdout:_x({isTTY:yl.default.isatty(1)}),stderr:_x({isTTY:yl.default.isatty(2)})},Tx=kE;var Ix=Tx.stderr.hasBasic;var oa=/\r?\n|\r/;function ua(e,t){if(!e||"name"in e&&"message"in e)throw new TypeError("Unexpected value for `files`, expected one or more `VFile`s");let r=t||{},n=typeof r.color=="boolean"?r.color:Ix,s=!1;return Array.isArray(e)||(s=!0,e=[e]),PE(AE({defaultName:r.defaultName||void 0,oneFileMode:s,quiet:r.quiet||!1,silent:r.silent||!1,traceLimit:typeof r.traceLimit=="number"?r.traceLimit:10,verbose:r.verbose||!1,bold:n?"\x1B[1m":"",underline:n?"\x1B[4m":"",normalIntensity:n?"\x1B[22m":"",noUnderline:n?"\x1B[24m":"",red:n?"\x1B[31m":"",cyan:n?"\x1B[36m":"",green:n?"\x1B[32m":"",yellow:n?"\x1B[33m":"",defaultColor:n?"\x1B[39m":""},e))}function EE(e,t){let r=t.length>e.traceLimit?t.length-e.traceLimit:0,n=t.length,s=[];for(n>r&&s.unshift(" "+e.bold+"[trace]"+e.normalIntensity+":");n-- >r;){let a=t[n],o=a,l=typeof o.tagName=="string"?o.tagName:typeof o.name=="string"?o.name:void 0,c=ze(a.position);s.push(" at "+e.yellow+a.type+(l?"<"+l+">":"")+e.defaultColor+(c?" ("+c+")":""))}return s}function SE(e,t){let r="";return t.fatal&&(r=e.red+"\u2716"+e.defaultColor+" "+t.fatal+" "+(bl(!0)+(t.fatal===1?"":"s"))),t.warn&&(r=(r?r+", ":"")+(e.yellow+"\u26A0"+e.defaultColor)+" "+t.warn+" "+(bl(!1)+(t.warn===1?"":"s"))),t.total!==t.fatal&&t.total!==t.warn&&(r=t.total+" messages ("+r+")"),r}function Px(e,t){let r=[" "+e.bold+"[cause]"+e.normalIntensity+":"],n=!1;if(t!==null&&typeof t=="object"){let s=("stack"in t?String(t.stack):void 0)||("message"in t?String(t.message):void 0);if(typeof s=="string"){n=!0;let a;"file"in t&&"fatal"in t?a=Lx(e,t):(a=s.split(oa),"cause"in t&&t.cause&&a.push(...Px(e,t.cause)));let o=a[0];typeof o=="string"?a[0]=" "+o:o[0]=" "+o[0],r.push(...a)}}return n||r.push(" "+t),r}function FE(e,t){let r=ia(t.messages),n=t.history[0],s=t.path,a="",o="";if(!e.oneFileMode||e.defaultName||n){let l=n||e.defaultName||"";a=e.underline+(r.fatal?e.red:r.total?e.yellow:e.green)+l+e.defaultColor+e.noUnderline+(t.stored&&l!==s?" > "+s:"")}return t.stored?o=e.yellow+"written"+e.defaultColor:r.total||(o="no issues found"),a&&o?a+": "+o:a+o}function _E(e,t){let r=t.split(oa),n=-1;for(;++n0){let g=FE(e,c);o&&g&&a.push(""),g&&a.push(g),p.length>0&&a.push(...p),o=p.length>0}}let l=ia(n);return(l.fatal||l.warn)&&a.push("",SE(e,l)),a}function TE(e,t){return[" "+e.bold+"[url]"+e.normalIntensity+":"," "+t]}function IE(e,t){let r=[],n=[],s=t.indexOf("`");for(;s!==-1;){let o={index:s,size:1};for(n.push(o);t.codePointAt(s+1)===96;)o.size++,s++;s=t.indexOf("`",s+1)}s=-1;let a=0;for(;++so&&(t[a]=l)}}}let n=[];for(r=-1;++r{let t=await Bx.promises.readFile(e,"utf-8"),r=new cr({path:e,contents:t});try{return await bx().use(bn).process(r),await Zu(t),{valid:!0}}catch(n){let s=n;return r.message(s.message,s.place),{valid:!1,error:ua([r])}}},Nx=LE;var BE=async(e,t)=>{let r=[],n=Dl.join(t,e);if(la.existsSync(n)){let s=await la.promises.readdir(n);for(let a of s){let o=Dl.join(n,a),{valid:l,error:c}=await Nx(o);r.push({filename:a,valid:l??!1,error:c??void 0})}}return r},Rx=BE;var NE=async(e,t,r,n)=>{Lr.existsSync(n)||Lr.mkdirSync(n),await Lr.promises.rename(gi.join(r,e,t),gi.join(n,t))},RE=async(e,t)=>{let r={},n=["backend","cloud","frontend","general"],s={};for(let a of n){let o=await Rx(a,t);for(let l of o)if(l.valid){let c=s[a]?gi.join(e,s[a]):gi.join(e,a);await NE(a,l.filename,t,c)}else r[l.filename]=l.error}return Lr.rmSync(t,{recursive:!0}),r},Ox=RE;var OE=e=>{if(Object.keys(e).length){console.error(`\u26D4 The following documents were skipped due to invalid markup: -`);for(let t of Object.values(e))console.error(t)}console.log("\x1B[36m","\u2705 Docs imported!","\x1B[0m")},Mx=OE;var ME=()=>process.argv.slice(2),Vx=ME;var VE=()=>{let e=Vx();return e.length&&typeof e[0]=="string"?e[0]:"docs"},jx=VE;var jE="git@github.com:Amsterdam/development-standards.git",Ux=jx(),qx=zx.join(Ux,"latest");async function Jx(e){await Xh(jE,qx,"feature/md-validation").then(async()=>{let t=await Ox(e,qx);Mx(t)})}Jx(Ux).catch(console.error);0&&(module.exports={app}); +`);for(let t of Object.values(e))console.error(t)}console.log("\x1B[36m","\u2705 Docs imported!","\x1B[0m")},Mx=OE;var ME=()=>process.argv.slice(2),Vx=ME;var VE=()=>{let e=Vx();return e.length&&typeof e[0]=="string"?e[0]:"docs"},jx=VE;var jE="git@github.com:Amsterdam/development-standards.git",Ux=jx(),qx=zx.join(Ux,"latest");async function Jx(e){await Xh(jE,qx).then(async()=>{let t=await Ox(e,qx);Mx(t)})}Jx(Ux).catch(console.error);0&&(module.exports={app});