@visulima/vis 4.1.20 → 4.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/CHANGELOG.md +24 -0
- package/LICENSE.md +804 -360
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +21 -0
- package/dist/packem_chunks/CONFIG_FILES.js +3 -3
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/catalog.js +49 -49
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +151 -147
- package/dist/packem_chunks/dispatch.js +1 -1
- package/dist/packem_chunks/fix.js +8 -8
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +3 -3
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +2 -2
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -2
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler22.js +1 -1
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler26.js +1 -1
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +2 -2
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler51.js +1 -1
- package/dist/packem_chunks/handler52.js +3 -3
- package/dist/packem_chunks/handler53.js +1 -1
- package/dist/packem_chunks/handler54.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler58.js +2 -2
- package/dist/packem_chunks/handler59.js +1 -1
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler60.js +8 -8
- package/dist/packem_chunks/handler61.js +1 -1
- package/dist/packem_chunks/handler62.js +16 -16
- package/dist/packem_chunks/handler63.js +2 -2
- package/dist/packem_chunks/handler64.js +1 -1
- package/dist/packem_chunks/handler65.js +3 -3
- package/dist/packem_chunks/handler66.js +2 -2
- package/dist/packem_chunks/handler67.js +10 -10
- package/dist/packem_chunks/handler68.js +2 -2
- package/dist/packem_chunks/handler69.js +3 -3
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +3 -3
- package/dist/packem_chunks/handler71.js +2 -2
- package/dist/packem_chunks/handler72.js +2 -2
- package/dist/packem_chunks/handler73.js +2 -2
- package/dist/packem_chunks/handler74.js +1 -1
- package/dist/packem_chunks/handler75.js +18 -18
- package/dist/packem_chunks/handler76.js +3 -3
- package/dist/packem_chunks/handler77.js +2 -2
- package/dist/packem_chunks/handler78.js +64 -64
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +7 -7
- package/dist/packem_chunks/index5.js +2 -2
- package/dist/packem_chunks/index6.js +7 -8
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +1 -1
- package/dist/packem_chunks/list.js +2 -2
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +2 -2
- package/dist/packem_chunks/ts-loader.js +5 -5
- package/dist/packem_chunks/verify-lockfile.js +2 -2
- package/dist/packem_shared/Table-BB8xHTU5-BLPS917D.js +11 -0
- package/dist/packem_shared/{advisories-0ScpWAHV.js → advisories-BSpzRIXP.js} +1 -1
- package/dist/packem_shared/affected-selection-M7riOi5-.js +1 -0
- package/dist/packem_shared/{affected-shas-Dd0P7fGD.js → affected-shas-CAwpSPmP.js} +1 -1
- package/dist/packem_shared/{ai-fix-BHyx1F1j.js → ai-fix-BTm1Z5og.js} +1 -1
- package/dist/packem_shared/{augment-COAiXSIx.js → augment-CBv1hwMR.js} +1 -1
- package/dist/packem_shared/{bin-Bq3tJmvE.js → bin-Cbs_ix6l.js} +1 -1
- package/dist/packem_shared/build-scripts-BIgkWVgY.js +1 -0
- package/dist/packem_shared/{command-runtime-CiLVo4ED.js → command-runtime-BD-4UmPB.js} +1 -1
- package/dist/packem_shared/{cyclonedx-CX2fFvDi.js → cyclonedx-CT1rtKxV.js} +3 -3
- package/dist/packem_shared/dependency-scan-W9b2X0a1.js +1 -0
- package/dist/packem_shared/{docker-Dy-X_BuM.js → docker-1jgKW5Wd.js} +3 -3
- package/dist/packem_shared/failure-log-B91LvYWw.js +2 -0
- package/dist/packem_shared/formatBytes-BHAzNIrn-CLYsxlUj.js +4 -0
- package/dist/packem_shared/glob-Cyk1H9ZL-Dxlf9Swz.js +1 -0
- package/dist/packem_shared/{index-DHD8wb6Z.js → index-CVBR-Kit.js} +5 -5
- package/dist/packem_shared/{index-Vm90Te96.js → index-Cq-J2MdB.js} +1 -1
- package/dist/packem_shared/index-onibYJkv.js +1 -0
- package/dist/packem_shared/{isAccessibleSync-DYKTrrvc-CSnBISfV.js → isAccessibleSync-DYKTrrvc-K2xhg6sV.js} +1 -1
- package/dist/packem_shared/lifecycle-DDJzp-4H.js +2 -0
- package/dist/packem_shared/lockfile-Bi1mw9jJ.js +1 -0
- package/dist/packem_shared/manifests-D671Sb1T.js +1 -0
- package/dist/packem_shared/{min-release-age-ChzTC7_I.js → min-release-age-Da4V046o.js} +7 -7
- package/dist/packem_shared/missing-package-json-CMoHdvmj.js +1 -0
- package/dist/packem_shared/{native-config-sync-BSzU4qUO.js → native-config-sync-CEB0rWlk.js} +2 -2
- package/dist/packem_shared/{osv-bloom-JYIWcH3F.js → osv-bloom-BRacgzs7.js} +1 -1
- package/dist/packem_shared/{package-version-DFlytdgJ.js → package-version-C5EPMgRw.js} +2 -2
- package/dist/packem_shared/packument-DuEV-qSE.js +1 -0
- package/dist/packem_shared/path-CxEa27Rz-pjheKk6v.js +1 -0
- package/dist/packem_shared/pm-runner-9L6ocnu2.js +1 -0
- package/dist/packem_shared/{project-name-filter-CC5FF49q.js → project-name-filter-zrdrEQbu.js} +1 -1
- package/dist/packem_shared/{provenance-BH80RHXx.js → provenance-CFPT_FQA.js} +1 -1
- package/dist/packem_shared/readJsonSync-CbryXYxN-BxKjDZnF.js +1 -0
- package/dist/packem_shared/registry-keys-C3EsP_s4.js +1 -0
- package/dist/packem_shared/{resolve-explicit-DuJ3mbzt.js → resolve-explicit-opfIkxoY.js} +1 -1
- package/dist/packem_shared/resolve-runtime-lJ5L9gU4.js +1 -0
- package/dist/packem_shared/run-file-DZff6GqY.js +1 -0
- package/dist/packem_shared/runtime-check-DAbveBr_.js +1 -0
- package/dist/packem_shared/s1ngularity-DTvrfWIM.js +1 -0
- package/dist/packem_shared/{scan-progress-DRIGQRMr.js → scan-progress-BGB9hIrD.js} +2 -2
- package/dist/packem_shared/{selectors-B7lSFz7l.js → selectors-CjIZ3gy2.js} +1 -1
- package/dist/packem_shared/{signatures-BP042BlB.js → signatures-DpqZVmmU.js} +1 -1
- package/dist/packem_shared/spinner-BVCEMm3G.js +1 -0
- package/dist/packem_shared/{tabs-UDYQ3tqt.js → tabs-Dz6xVpfX.js} +1 -1
- package/dist/packem_shared/{target-merge-B4No-LHM.js → target-merge-hsawesT4.js} +1 -1
- package/dist/packem_shared/target-options-Bxb0Y5qa.js +1 -0
- package/dist/packem_shared/toolchain-887JoquG.js +5 -0
- package/dist/packem_shared/typosquats-Xv6dN4sr.js +1 -0
- package/dist/packem_shared/verify-BLoaI7En.js +1 -0
- package/dist/packem_shared/{vis-update-app-CR21zyht.js → vis-update-app-D9KWJ9Ir.js} +1 -1
- package/dist/packem_shared/{vis-user-error-qqqhLoF6.js → vis-user-error-Bdg9NRuJ.js} +15 -15
- package/dist/packem_shared/watch-BTZw2Y8Q.js +1 -0
- package/dist/packem_shared/watch-loop-Cjh2wlUl.js +11 -0
- package/dist/packem_shared/{writeFileSync-DJoHk3Ks-CgQ-VNNT.js → writeFileSync-DJoHk3Ks-O9zOKqeM.js} +1 -1
- package/dist/runtime/preload.js +1 -1
- package/index.d.ts +204 -204
- package/index.js +26 -26
- package/package.json +10 -10
- package/schemas/vis-config.schema.json +14 -0
- package/dist/packem_shared/Table-kgZ-Cd21-DdNsp69H.js +0 -9
- package/dist/packem_shared/affected-selection-Bt4qkPUb.js +0 -1
- package/dist/packem_shared/build-scripts-pdVmqXRm.js +0 -1
- package/dist/packem_shared/dependency-scan-DBH2Qo4I.js +0 -1
- package/dist/packem_shared/failure-log-3R522Vb5.js +0 -2
- package/dist/packem_shared/formatBytes-BHAzNIrn-XohRrPdt.js +0 -4
- package/dist/packem_shared/glob-Cyk1H9ZL-ox19CSsT.js +0 -1
- package/dist/packem_shared/index-Czrll7SU.js +0 -1
- package/dist/packem_shared/lifecycle-CAIJbxIa.js +0 -2
- package/dist/packem_shared/lockfile-DVFySxTS.js +0 -1
- package/dist/packem_shared/manifests-BNSmpPF_.js +0 -1
- package/dist/packem_shared/missing-package-json-C0keIt78.js +0 -1
- package/dist/packem_shared/packument-DyuhH1Gz.js +0 -1
- package/dist/packem_shared/pm-runner-d93_73O6.js +0 -1
- package/dist/packem_shared/readJsonSync-CbryXYxN-B2aSeDpC.js +0 -1
- package/dist/packem_shared/registry-keys-BWHRFWbb.js +0 -1
- package/dist/packem_shared/resolve-runtime-C7NBCA1C.js +0 -1
- package/dist/packem_shared/run-file-jMngGQhs.js +0 -1
- package/dist/packem_shared/runtime-check-BklgEMkC.js +0 -1
- package/dist/packem_shared/s1ngularity-BJ5j2vbJ.js +0 -1
- package/dist/packem_shared/spinner-BM_0Bj6x.js +0 -1
- package/dist/packem_shared/target-options-d_rIrLyq.js +0 -1
- package/dist/packem_shared/toolchain-DY11tPCw.js +0 -5
- package/dist/packem_shared/typosquats-CSkIFgF5.js +0 -1
- package/dist/packem_shared/verify-D8wYvB85.js +0 -1
- package/dist/packem_shared/watch-Dswvj6Zp.js +0 -1
- package/dist/packem_shared/watch-loop-COWvvSbR.js +0 -11
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as ae}from"node:module";let le;const ce=t=>(le??=ae(import.meta.url))(t),dt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,pe=t=>{if(typeof dt<"u"&&dt.versions&&dt.versions.node){const[e,n]=dt.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return dt.getBuiltinModule(t)}return ce(t)},{createRequire:he}=pe("node:module");function fe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Lt={},xt,Pt;function vt(){if(Pt)return xt;Pt=1;const t="\\\\/",e=`[^${t}]`,n=0,l=Symbol("unignore"),c="\\.",u="\\+",r="\\?",p="\\/",y="(?=.)",$="[^/]",v=`(?:${p}|$)`,x=`(?:^|${p})`,T=`${c}{1,2}${v}`,E=`(?!${c})`,O=`(?!${x}${T})`,L=`(?!${c}{0,1}${v})`,m=`(?!${T})`,j=`[^.${p}]`,C=`${$}*?`,g={DOT_LITERAL:c,PLUS_LITERAL:u,QMARK_LITERAL:r,SLASH_LITERAL:p,ONE_CHAR:y,QMARK:$,END_ANCHOR:v,DOTS_SLASH:T,NO_DOT:E,NO_DOTS:O,NO_DOT_SLASH:L,NO_DOTS_SLASH:m,QMARK_NO_DOT:j,STAR:C,START_ANCHOR:x,SEP:"/"},d={...g,SLASH_LITERAL:`[${t}]`,QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${c}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${c})`,NO_DOTS:`(?!(?:^|[${t}])${c}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${c}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${c}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"},s={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return xt={DEFAULT_MAX_EXTGLOB_RECURSION:n,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:s,UNIGNORE:l,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(b){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${b.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(b){return b===!0?d:g}},xt}var It;function St(){return It||(It=1,(function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:l,REGEX_SPECIAL_CHARS_GLOBAL:c}=vt();t.isObject=u=>u!==null&&typeof u=="object"&&!Array.isArray(u),t.hasRegexChars=u=>l.test(u),t.isRegexChar=u=>u.length===1&&t.hasRegexChars(u),t.escapeRegex=u=>u.replace(c,"\\$1"),t.toPosixSlashes=u=>u.replace(e,"/"),t.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const u=navigator.platform.toLowerCase();return u==="win32"||u==="windows"}return process.platform?process.platform==="win32":!1},t.removeBackslashes=u=>u.replace(n,r=>r==="\\"?"":r),t.escapeLast=(u,r,p)=>{const y=u.lastIndexOf(r,p);return y===-1?u:u[y-1]==="\\"?t.escapeLast(u,r,y-1):`${u.slice(0,y)}\\${u.slice(y)}`},t.removePrefix=(u,r={})=>{let p=u;return p.startsWith("./")&&(p=p.slice(2),r.prefix="./"),p},t.wrapOutput=(u,r={},p={})=>{const y=p.contains?"":"^",$=p.contains?"":"$";let v=`${y}(?:${u})${$}`;return r.negated===!0&&(v=`(?:^(?!${v}).*$)`),v},t.basename=(u,{windows:r}={})=>{const p=u.split(r?/[\\/]/:"/"),y=p[p.length-1];return y===""?p[p.length-2]:y}})(Lt)),Lt}var mt,Nt;function ge(){if(Nt)return mt;Nt=1;const t=St(),{CHAR_ASTERISK:e,CHAR_AT:n,CHAR_BACKWARD_SLASH:l,CHAR_COMMA:c,CHAR_DOT:u,CHAR_EXCLAMATION_MARK:r,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:y,CHAR_LEFT_PARENTHESES:$,CHAR_LEFT_SQUARE_BRACKET:v,CHAR_PLUS:x,CHAR_QUESTION_MARK:T,CHAR_RIGHT_CURLY_BRACE:E,CHAR_RIGHT_PARENTHESES:O,CHAR_RIGHT_SQUARE_BRACKET:L}=vt(),m=C=>C===p||C===l,j=C=>{C.isPrefix!==!0&&(C.depth=C.isGlobstar?1/0:1)};return mt=(C,g)=>{const d=g||{},s=C.length-1,b=d.parts===!0||d.scanToEnd===!0,w=[],R=[],_=[];let A=C,I=-1,M=0,V=0,at=!1,J=!1,K=!1,tt=!1,lt=!1,rt=!1,et=!1,U=!1,st=!1,Q=!1,ct=0,z,S,N={value:"",depth:0,isGlob:!1};const W=()=>I>=s,a=()=>A.charCodeAt(I+1),F=()=>(z=S,A.charCodeAt(++I));for(;I<s;){S=F();let Z;if(S===l){et=N.backslashes=!0,S=F(),S===y&&(rt=!0);continue}if(rt===!0||S===y){for(ct++;W()!==!0&&(S=F());){if(S===l){et=N.backslashes=!0,F();continue}if(S===y){ct++;continue}if(rt!==!0&&S===u&&(S=F())===u){if(at=N.isBrace=!0,K=N.isGlob=!0,Q=!0,b===!0)continue;break}if(rt!==!0&&S===c){if(at=N.isBrace=!0,K=N.isGlob=!0,Q=!0,b===!0)continue;break}if(S===E&&(ct--,ct===0)){rt=!1,at=N.isBrace=!0,Q=!0;break}}if(b===!0)continue;break}if(S===p){if(w.push(I),R.push(N),N={value:"",depth:0,isGlob:!1},Q===!0)continue;if(z===u&&I===M+1){M+=2;continue}V=I+1;continue}if(d.noext!==!0&&(S===x||S===n||S===e||S===T||S===r)&&a()===$){if(K=N.isGlob=!0,tt=N.isExtglob=!0,Q=!0,S===r&&I===M&&(st=!0),b===!0){for(;W()!==!0&&(S=F());){if(S===l){et=N.backslashes=!0,S=F();continue}if(S===O){K=N.isGlob=!0,Q=!0;break}}continue}break}if(S===e){if(z===e&&(lt=N.isGlobstar=!0),K=N.isGlob=!0,Q=!0,b===!0)continue;break}if(S===T){if(K=N.isGlob=!0,Q=!0,b===!0)continue;break}if(S===v){for(;W()!==!0&&(Z=F());){if(Z===l){et=N.backslashes=!0,F();continue}if(Z===L){J=N.isBracket=!0,K=N.isGlob=!0,Q=!0;break}}if(b===!0)continue;break}if(d.nonegate!==!0&&S===r&&I===M){U=N.negated=!0,M++;continue}if(d.noparen!==!0&&S===$){if(K=N.isGlob=!0,b===!0){for(;W()!==!0&&(S=F());){if(S===$){et=N.backslashes=!0,S=F();continue}if(S===O){Q=!0;break}}continue}break}if(K===!0){if(Q=!0,b===!0)continue;break}}d.noext===!0&&(tt=!1,K=!1);let B=A,pt="",o="";M>0&&(pt=A.slice(0,M),A=A.slice(M),V-=M),B&&K===!0&&V>0?(B=A.slice(0,V),o=A.slice(V)):K===!0?(B="",o=A):B=A,B&&B!==""&&B!=="/"&&B!==A&&m(B.charCodeAt(B.length-1))&&(B=B.slice(0,-1)),d.unescape===!0&&(o&&(o=t.removeBackslashes(o)),B&&et===!0&&(B=t.removeBackslashes(B)));const i={prefix:pt,input:C,start:M,base:B,glob:o,isBrace:at,isBracket:J,isGlob:K,isExtglob:tt,isGlobstar:lt,negated:U,negatedExtglob:st};if(d.tokens===!0&&(i.maxDepth=0,m(S)||R.push(N),i.tokens=R),d.parts===!0||d.tokens===!0){let Z;for(let P=0;P<w.length;P++){const nt=Z?Z+1:M,ot=w[P],Y=C.slice(nt,ot);d.tokens&&(P===0&&M!==0?(R[P].isPrefix=!0,R[P].value=pt):R[P].value=Y,j(R[P]),i.maxDepth+=R[P].depth),(P!==0||Y!=="")&&_.push(Y),Z=ot}if(Z&&Z+1<C.length){const P=C.slice(Z+1);_.push(P),d.tokens&&(R[R.length-1].value=P,j(R[R.length-1]),i.maxDepth+=R[R.length-1].depth)}i.slashes=w,i.parts=_}return i},mt}var Ct,Dt;function de(){if(Dt)return Ct;Dt=1;const t=vt(),e=St(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:l,REGEX_NON_SPECIAL_CHARS:c,REGEX_SPECIAL_CHARS_BACKREF:u,REPLACEMENTS:r}=t,p=(g,d)=>{if(typeof d.expandRange=="function")return d.expandRange(...g,d);g.sort();const s=`[${g.join("-")}]`;try{new RegExp(s)}catch{return g.map(b=>e.escapeRegex(b)).join("..")}return s},y=(g,d)=>`Missing ${g}: "${d}" - use "\\\\${d}" to match literal characters`,$=g=>{const d=[];let s=0,b=0,w=0,R="",_=!1;for(const A of g){if(_===!0){R+=A,_=!1;continue}if(A==="\\"){R+=A,_=!0;continue}if(A==='"'){w=w===1?0:1,R+=A;continue}if(w===0){if(A==="[")s++;else if(A==="]"&&s>0)s--;else if(s===0){if(A==="(")b++;else if(A===")"&&b>0)b--;else if(A==="|"&&b===0){d.push(R),R="";continue}}}R+=A}return d.push(R),d},v=g=>{let d=!1;for(const s of g){if(d===!0){d=!1;continue}if(s==="\\"){d=!0;continue}if(/[?*+@!()[\]{}]/.test(s))return!1}return!0},x=g=>{let d=g.trim(),s=!0;for(;s===!0;)s=!1,/^@\([^\\()[\]{}|]+\)$/.test(d)&&(d=d.slice(2,-1),s=!0);if(v(d))return d.replace(/\\(.)/g,"$1")},T=g=>{const d=g.map(x).filter(Boolean);for(let s=0;s<d.length;s++)for(let b=s+1;b<d.length;b++){const w=d[s],R=d[b],_=w[0];if(!(!_||w!==_.repeat(w.length)||R!==_.repeat(R.length))&&(w===R||w.startsWith(R)||R.startsWith(w)))return!0}return!1},E=(g,d=!0)=>{if(g[0]!=="+"&&g[0]!=="*"||g[1]!=="(")return;let s=0,b=0,w=0,R=!1;for(let _=1;_<g.length;_++){const A=g[_];if(R===!0){R=!1;continue}if(A==="\\"){R=!0;continue}if(A==='"'){w=w===1?0:1;continue}if(w!==1){if(A==="["){s++;continue}if(A==="]"&&s>0){s--;continue}if(!(s>0)){if(A==="("){b++;continue}if(A===")"&&(b--,b===0))return d===!0&&_!==g.length-1?void 0:{type:g[0],body:g.slice(2,_),end:_}}}}},O=g=>`${g.length===1?e.escapeRegex(g[0]):`[${g.map(d=>e.escapeRegex(d)).join("")}]`}*`,L=g=>{let d=0;const s=[];for(;d<g.length;){const b=E(g.slice(d),!1);if(!b||b.type!=="*")return;const w=$(b.body).map(_=>_.trim());if(w.length!==1)return;const R=x(w[0]);if(!R||R.length!==1)return;s.push(R),d+=b.end+1}if(!(s.length<1))return s},m=g=>{let d=0,s=g.trim(),b=E(s);for(;b;)d++,s=b.body.trim(),b=E(s);return d},j=(g,d)=>{if(d.maxExtglobRecursion===!1)return{risky:!1};const s=typeof d.maxExtglobRecursion=="number"?d.maxExtglobRecursion:t.DEFAULT_MAX_EXTGLOB_RECURSION,b=$(g).map(A=>A.trim());if(b.length>1&&(b.some(A=>A==="")||b.some(A=>/^[*?]+$/.test(A))||T(b)))return{risky:!0};const w=[];let R=!1,_=!0;for(const A of b){const I=L(A);if(I){R=!0,w.push(...I);continue}const M=x(A);if(M&&M.length===1){w.push(M);continue}if(_=!1,m(A)>s)return{risky:!0}}return R?_?{risky:!0,safeOutput:O([...new Set(w)])}:{risky:!0}:{risky:!1}},C=(g,d)=>{if(typeof g!="string")throw new TypeError("Expected a string");g=r[g]||g;const s={...d},b=typeof s.maxLength=="number"?Math.min(n,s.maxLength):n;let w=g.length;if(w>b)throw new SyntaxError(`Input length: ${w}, exceeds maximum allowed length: ${b}`);const R={type:"bos",value:"",output:s.prepend||""},_=[R],A=s.capture?"":"?:",I=t.globChars(s.windows),M=t.extglobChars(I),{DOT_LITERAL:V,PLUS_LITERAL:at,SLASH_LITERAL:J,ONE_CHAR:K,DOTS_SLASH:tt,NO_DOT:lt,NO_DOT_SLASH:rt,NO_DOTS_SLASH:et,QMARK:U,QMARK_NO_DOT:st,STAR:Q,START_ANCHOR:ct}=I,z=f=>`(${A}(?:(?!${ct}${f.dot?tt:V}).)*?)`,S=s.dot?"":lt,N=s.dot?U:st;let W=s.bash===!0?z(s):Q;s.capture&&(W=`(${W})`),typeof s.noext=="boolean"&&(s.noextglob=s.noext);const a={input:g,index:-1,start:0,dot:s.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:_};g=e.removePrefix(g,a),w=g.length;const F=[],B=[],pt=[];let o=R,i;const Z=()=>a.index===w-1,P=a.peek=(f=1)=>g[a.index+f],nt=a.advance=()=>g[++a.index]||"",ot=()=>g.slice(a.index+1),Y=(f="",G=0)=>{a.consumed+=f,a.index+=G},_t=f=>{a.output+=f.output!=null?f.output:f.value,Y(f.value)},ue=()=>{let f=1;for(;P()==="!"&&(P(2)!=="("||P(3)==="?");)nt(),a.start++,f++;return f%2===0?!1:(a.negated=!0,a.start++,!0)},bt=f=>{a[f]++,pt.push(f)},ht=f=>{a[f]--,pt.pop()},k=f=>{if(o.type==="globstar"){const G=a.braces>0&&(f.type==="comma"||f.type==="brace"),h=f.extglob===!0||F.length&&(f.type==="pipe"||f.type==="paren");f.type!=="slash"&&f.type!=="paren"&&!G&&!h&&(a.output=a.output.slice(0,-o.output.length),o.type="star",o.value="*",o.output=W,a.output+=o.output)}if(F.length&&f.type!=="paren"&&(F[F.length-1].inner+=f.value),(f.value||f.output)&&_t(f),o&&o.type==="text"&&f.type==="text"){o.output=(o.output||o.value)+f.value,o.value+=f.value;return}f.prev=o,_.push(f),o=f},Et=(f,G)=>{const h={...M[G],conditions:1,inner:""};h.prev=o,h.parens=a.parens,h.output=a.output,h.startIndex=a.index,h.tokensIndex=_.length;const H=(s.capture?"(":"")+h.open;bt("parens"),k({type:f,value:G,output:a.output?"":K}),k({type:"paren",extglob:!0,value:nt(),output:H}),F.push(h)},ie=f=>{const G=g.slice(f.startIndex,a.index+1),h=g.slice(f.startIndex+2,a.index),H=j(h,s);if((f.type==="plus"||f.type==="star")&&H.risky){const D=H.safeOutput?(f.output?"":K)+(s.capture?`(${H.safeOutput})`:H.safeOutput):void 0,ut=_[f.tokensIndex];ut.type="text",ut.value=G,ut.output=D||e.escapeRegex(G);for(let it=f.tokensIndex+1;it<_.length;it++)_[it].value="",_[it].output="",delete _[it].suffix;a.output=f.output+ut.output,a.backtrack=!0,k({type:"paren",extglob:!0,value:i,output:""}),ht("parens");return}let q=f.close+(s.capture?")":""),X;if(f.type==="negate"){let D=W;if(f.inner&&f.inner.length>1&&f.inner.includes("/")&&(D=z(s)),(D!==W||Z()||/^\)+$/.test(ot()))&&(q=f.close=`)$))${D}`),f.inner.includes("*")&&(X=ot())&&/^\.[^\\/.]+$/.test(X)){const ut=C(X,{...d,fastpaths:!1}).output;q=f.close=`)${ut})${D})`}f.prev.type==="bos"&&(a.negatedExtglob=!0)}k({type:"paren",extglob:!0,value:i,output:q}),ht("parens")};if(s.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(g)){let f=!1,G=g.replace(u,(h,H,q,X,D,ut)=>X==="\\"?(f=!0,h):X==="?"?H?H+X+(D?U.repeat(D.length):""):ut===0?N+(D?U.repeat(D.length):""):U.repeat(q.length):X==="."?V.repeat(q.length):X==="*"?H?H+X+(D?W:""):W:H?h:`\\${h}`);return f===!0&&(s.unescape===!0?G=G.replace(/\\/g,""):G=G.replace(/\\+/g,h=>h.length%2===0?"\\\\":h?"\\":"")),G===g&&s.contains===!0?(a.output=g,a):(a.output=e.wrapOutput(G,a,d),a)}for(;!Z();){if(i=nt(),i==="\0")continue;if(i==="\\"){const h=P();if(h==="/"&&s.bash!==!0||h==="."||h===";")continue;if(!h){i+="\\",k({type:"text",value:i});continue}const H=/^\\+/.exec(ot());let q=0;if(H&&H[0].length>2&&(q=H[0].length,a.index+=q,q%2!==0&&(i+="\\")),s.unescape===!0?i=nt():i+=nt(),a.brackets===0){k({type:"text",value:i});continue}}if(a.brackets>0&&(i!=="]"||o.value==="["||o.value==="[^")){if(s.posix!==!1&&i===":"){const h=o.value.slice(1);if(h.includes("[")&&(o.posix=!0,h.includes(":"))){const H=o.value.lastIndexOf("["),q=o.value.slice(0,H),X=o.value.slice(H+2),D=l[X];if(D){o.value=q+D,a.backtrack=!0,nt(),!R.output&&_.indexOf(o)===1&&(R.output=K);continue}}}(i==="["&&P()!==":"||i==="-"&&P()==="]")&&(i=`\\${i}`),i==="]"&&(o.value==="["||o.value==="[^")&&(i=`\\${i}`),s.posix===!0&&i==="!"&&o.value==="["&&(i="^"),o.value+=i,_t({value:i});continue}if(a.quotes===1&&i!=='"'){i=e.escapeRegex(i),o.value+=i,_t({value:i});continue}if(i==='"'){a.quotes=a.quotes===1?0:1,s.keepQuotes===!0&&k({type:"text",value:i});continue}if(i==="("){bt("parens"),k({type:"paren",value:i});continue}if(i===")"){if(a.parens===0&&s.strictBrackets===!0)throw new SyntaxError(y("opening","("));const h=F[F.length-1];if(h&&a.parens===h.parens+1){ie(F.pop());continue}k({type:"paren",value:i,output:a.parens?")":"\\)"}),ht("parens");continue}if(i==="["){if(s.nobracket===!0||!ot().includes("]")){if(s.nobracket!==!0&&s.strictBrackets===!0)throw new SyntaxError(y("closing","]"));i=`\\${i}`}else bt("brackets");k({type:"bracket",value:i});continue}if(i==="]"){if(s.nobracket===!0||o&&o.type==="bracket"&&o.value.length===1){k({type:"text",value:i,output:`\\${i}`});continue}if(a.brackets===0){if(s.strictBrackets===!0)throw new SyntaxError(y("opening","["));k({type:"text",value:i,output:`\\${i}`});continue}ht("brackets");const h=o.value.slice(1);if(o.posix!==!0&&h[0]==="^"&&!h.includes("/")&&(i=`/${i}`),o.value+=i,_t({value:i}),s.literalBrackets===!1||e.hasRegexChars(h))continue;const H=e.escapeRegex(o.value);if(a.output=a.output.slice(0,-o.value.length),s.literalBrackets===!0){a.output+=H,o.value=H;continue}o.value=`(${A}${H}|${o.value})`,a.output+=o.value;continue}if(i==="{"&&s.nobrace!==!0){bt("braces");const h={type:"brace",value:i,output:"(",outputIndex:a.output.length,tokensIndex:a.tokens.length};B.push(h),k(h);continue}if(i==="}"){const h=B[B.length-1];if(s.nobrace===!0||!h){k({type:"text",value:i,output:i});continue}let H=")";if(h.dots===!0){const q=_.slice(),X=[];for(let D=q.length-1;D>=0&&(_.pop(),q[D].type!=="brace");D--)q[D].type!=="dots"&&X.unshift(q[D].value);H=p(X,s),a.backtrack=!0}if(h.comma!==!0&&h.dots!==!0){const q=a.output.slice(0,h.outputIndex),X=a.tokens.slice(h.tokensIndex);h.value=h.output="\\{",i=H="\\}",a.output=q;for(const D of X)a.output+=D.output||D.value}k({type:"brace",value:i,output:H}),ht("braces"),B.pop();continue}if(i==="|"){F.length>0&&F[F.length-1].conditions++,k({type:"text",value:i});continue}if(i===","){let h=i;const H=B[B.length-1];H&&pt[pt.length-1]==="braces"&&(H.comma=!0,h="|"),k({type:"comma",value:i,output:h});continue}if(i==="/"){if(o.type==="dot"&&a.index===a.start+1){a.start=a.index+1,a.consumed="",a.output="",_.pop(),o=R;continue}k({type:"slash",value:i,output:J});continue}if(i==="."){if(a.braces>0&&o.type==="dot"){o.value==="."&&(o.output=V);const h=B[B.length-1];o.type="dots",o.output+=i,o.value+=i,h.dots=!0;continue}if(a.braces+a.parens===0&&o.type!=="bos"&&o.type!=="slash"){k({type:"text",value:i,output:V});continue}k({type:"dot",value:i,output:V});continue}if(i==="?"){if(!(o&&o.value==="(")&&s.noextglob!==!0&&P()==="("&&P(2)!=="?"){Et("qmark",i);continue}if(o&&o.type==="paren"){const h=P();let H=i;(o.value==="("&&!/[!=<:]/.test(h)||h==="<"&&!/<([!=]|\w+>)/.test(ot()))&&(H=`\\${i}`),k({type:"text",value:i,output:H});continue}if(s.dot!==!0&&(o.type==="slash"||o.type==="bos")){k({type:"qmark",value:i,output:st});continue}k({type:"qmark",value:i,output:U});continue}if(i==="!"){if(s.noextglob!==!0&&P()==="("&&(P(2)!=="?"||!/[!=<:]/.test(P(3)))){Et("negate",i);continue}if(s.nonegate!==!0&&a.index===0){ue();continue}}if(i==="+"){if(s.noextglob!==!0&&P()==="("&&P(2)!=="?"){Et("plus",i);continue}if(o&&o.value==="("||s.regex===!1){k({type:"plus",value:i,output:at});continue}if(o&&(o.type==="bracket"||o.type==="paren"||o.type==="brace")||a.parens>0){k({type:"plus",value:i});continue}k({type:"plus",value:at});continue}if(i==="@"){if(s.noextglob!==!0&&P()==="("&&P(2)!=="?"){k({type:"at",extglob:!0,value:i,output:""});continue}k({type:"text",value:i});continue}if(i!=="*"){(i==="$"||i==="^")&&(i=`\\${i}`);const h=c.exec(ot());h&&(i+=h[0],a.index+=h[0].length),k({type:"text",value:i});continue}if(o&&(o.type==="globstar"||o.star===!0)){o.type="star",o.star=!0,o.value+=i,o.output=W,a.backtrack=!0,a.globstar=!0,Y(i);continue}let f=ot();if(s.noextglob!==!0&&/^\([^?]/.test(f)){Et("star",i);continue}if(o.type==="star"){if(s.noglobstar===!0){Y(i);continue}const h=o.prev,H=h.prev,q=h.type==="slash"||h.type==="bos",X=H&&(H.type==="star"||H.type==="globstar");if(s.bash===!0&&(!q||f[0]&&f[0]!=="/")){k({type:"star",value:i,output:""});continue}const D=a.braces>0&&(h.type==="comma"||h.type==="brace"),ut=F.length&&(h.type==="pipe"||h.type==="paren");if(!q&&h.type!=="paren"&&!D&&!ut){k({type:"star",value:i,output:""});continue}for(;f.slice(0,3)==="/**";){const it=g[a.index+4];if(it&&it!=="/")break;f=f.slice(3),Y("/**",3)}if(h.type==="bos"&&Z()){o.type="globstar",o.value+=i,o.output=z(s),a.output=o.output,a.globstar=!0,Y(i);continue}if(h.type==="slash"&&h.prev.type!=="bos"&&!X&&Z()){a.output=a.output.slice(0,-(h.output+o.output).length),h.output=`(?:${h.output}`,o.type="globstar",o.output=z(s)+(s.strictSlashes?")":"|$)"),o.value+=i,a.globstar=!0,a.output+=h.output+o.output,Y(i);continue}if(h.type==="slash"&&h.prev.type!=="bos"&&f[0]==="/"){const it=f[1]!==void 0?"|$":"";a.output=a.output.slice(0,-(h.output+o.output).length),h.output=`(?:${h.output}`,o.type="globstar",o.output=`${z(s)}${J}|${J}${it})`,o.value+=i,a.output+=h.output+o.output,a.globstar=!0,Y(i+nt()),k({type:"slash",value:"/",output:""});continue}if(h.type==="bos"&&f[0]==="/"){o.type="globstar",o.value+=i,o.output=`(?:^|${J}|${z(s)}${J})`,a.output=o.output,a.globstar=!0,Y(i+nt()),k({type:"slash",value:"/",output:""});continue}if(D&&f[0]==="/"){o.type="globstar",o.value+=i,o.output=`(?:^|${J}|${z(s)}${J})`,a.output+=o.output,a.globstar=!0,Y(i+nt()),k({type:"slash",value:"/",output:""});continue}a.output=a.output.slice(0,-o.output.length),o.type="globstar",o.output=z(s),o.value+=i,a.output+=o.output,a.globstar=!0,Y(i);continue}const G={type:"star",value:i,output:W};if(s.bash===!0){G.output=".*?",(o.type==="bos"||o.type==="slash")&&(G.output=S+G.output),k(G);continue}if(o&&(o.type==="bracket"||o.type==="paren")&&s.regex===!0){G.output=i,k(G);continue}(a.index===a.start||o.type==="slash"||o.type==="dot")&&(o.type==="dot"?(a.output+=rt,o.output+=rt):s.dot===!0?(a.output+=et,o.output+=et):(a.output+=S,o.output+=S),P()!=="*"&&(a.output+=K,o.output+=K)),k(G)}for(;a.brackets>0;){if(s.strictBrackets===!0)throw new SyntaxError(y("closing","]"));a.output=e.escapeLast(a.output,"["),ht("brackets")}for(;a.parens>0;){if(s.strictBrackets===!0)throw new SyntaxError(y("closing",")"));a.output=e.escapeLast(a.output,"("),ht("parens")}for(;a.braces>0;){if(s.strictBrackets===!0)throw new SyntaxError(y("closing","}"));a.output=e.escapeLast(a.output,"{"),ht("braces")}if(s.strictSlashes!==!0&&(o.type==="star"||o.type==="bracket")&&k({type:"maybe_slash",value:"",output:`${J}?`}),a.backtrack===!0){a.output="";for(const f of a.tokens)a.output+=f.output!=null?f.output:f.value,f.suffix&&(a.output+=f.suffix)}return a};return C.fastpaths=(g,d)=>{const s={...d},b=typeof s.maxLength=="number"?Math.min(n,s.maxLength):n,w=g.length;if(w>b)throw new SyntaxError(`Input length: ${w}, exceeds maximum allowed length: ${b}`);g=r[g]||g;const{DOT_LITERAL:R,SLASH_LITERAL:_,ONE_CHAR:A,DOTS_SLASH:I,NO_DOT:M,NO_DOTS:V,NO_DOTS_SLASH:at,STAR:J,START_ANCHOR:K}=t.globChars(s.windows),tt=s.dot?V:M,lt=s.dot?at:M,rt=s.capture?"":"?:",et={negated:!1,prefix:""};let U=s.bash===!0?".*?":J;s.capture&&(U=`(${U})`);const st=S=>S.noglobstar===!0?U:`(${rt}(?:(?!${K}${S.dot?I:R}).)*?)`,Q=S=>{switch(S){case"*":return`${tt}${A}${U}`;case".*":return`${R}${A}${U}`;case"*.*":return`${tt}${U}${R}${A}${U}`;case"*/*":return`${tt}${U}${_}${A}${lt}${U}`;case"**":return tt+st(s);case"**/*":return`(?:${tt}${st(s)}${_})?${lt}${A}${U}`;case"**/*.*":return`(?:${tt}${st(s)}${_})?${lt}${U}${R}${A}${U}`;case"**/.*":return`(?:${tt}${st(s)}${_})?${R}${A}${U}`;default:{const N=/^(.*?)\.(\w+)$/.exec(S);if(!N)return;const W=Q(N[1]);return W?W+R+N[2]:void 0}}},ct=e.removePrefix(g,et);let z=Q(ct);return z&&s.strictSlashes!==!0&&(z+=`${_}?`),z},Ct=C,Ct}var kt,Bt;function ye(){if(Bt)return kt;Bt=1;const t=ge(),e=de(),n=St(),l=vt(),c=r=>r&&typeof r=="object"&&!Array.isArray(r),u=(r,p,y=!1)=>{if(Array.isArray(r)){const m=r.map(j=>u(j,p,y));return j=>{for(const C of m){const g=C(j);if(g)return g}return!1}}const $=c(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!$)throw new TypeError("Expected pattern to be a non-empty string");const v=p||{},x=v.windows,T=$?u.compileRe(r,p):u.makeRe(r,p,!1,!0),E=T.state;delete T.state;let O=()=>!1;if(v.ignore){const m={...p,ignore:null,onMatch:null,onResult:null};O=u(v.ignore,m,y)}const L=(m,j=!1)=>{const{isMatch:C,match:g,output:d}=u.test(m,T,p,{glob:r,posix:x}),s={glob:r,state:E,regex:T,posix:x,input:m,output:d,match:g,isMatch:C};if(typeof v.onResult=="function"&&v.onResult(s),C===!1)return s.isMatch=!1,j?s:!1;t:if(O(m)){if(typeof v.onIgnore=="function"&&v.onIgnore(s)===l.UNIGNORE){s.isMatch=!0;break t}return s.isMatch=!1,j?s:!1}return typeof v.onMatch=="function"&&v.onMatch(s),j?s:!0};return y&&(L.state=E),L};return u.test=(r,p,y,{glob:$,posix:v}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};const x=y||{},T=x.format||(v?n.toPosixSlashes:null);let E=r===$,O=E&&T?T(r):r;return E===!1&&(O=T?T(r):r,E=O===$),(E===!1||x.capture===!0)&&(x.matchBase===!0||x.basename===!0?E=u.matchBase(r,p,y,v):E=p.exec(O)),{isMatch:!!E,match:E,output:O}},u.matchBase=(r,p,y,$=y&&y.windows)=>(p instanceof RegExp?p:u.makeRe(p,y)).test(n.basename(r,{windows:$})),u.isMatch=(r,p,y)=>u(p,y)(r),u.parse=(r,p)=>Array.isArray(r)?r.map(y=>u.parse(y,p)):e(r,{...p,fastpaths:!1}),u.scan=(r,p)=>t(r,p),u.compileRe=(r,p,y=!1,$=!1)=>{if(y===!0)return r.output;const v=p||{},x=v.contains?"":"^",T=v.contains?"":"$";let E=`${x}(?:${r.output})${T}`;r&&r.negated===!0&&(E=`^(?!${E}).*$`);const O=u.toRegex(E,p);return $===!0&&(O.state=r),O},u.makeRe=(r,p={},y=!1,$=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let v={negated:!1,fastpaths:!0};return p.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(v.output=e.fastpaths(r,p)),v.output||(v=e(r,p)),u.compileRe(v,p,y,$)},u.toRegex=(r,p)=>{try{const y=p||{};return new RegExp(r,y.flags||(y.nocase?"i":""))}catch(y){if(p&&p.debug===!0)throw y;return/$^/}},u.constants=l,kt=u,kt}var wt,Mt;function Ae(){if(Mt)return wt;Mt=1;const t=ye(),e=St();function n(l,c,u=!1){return c&&(c.windows===null||c.windows===void 0)&&(c={...c,windows:e.isWindows()}),t(l,c,u)}return Object.assign(n,t),wt=n,wt}var Re=Ae();const ft=fe(Re);let _e;const be=t=>(_e??=he(import.meta.url))(t),yt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Rt=t=>{if(typeof yt<"u"&&yt.versions&&yt.versions.node){const[e,n]=yt.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return yt.getBuiltinModule(t)}return be(t)},Ft=Rt("fs"),Ee={...Ft,default:Ft},{statSync:ve,stat:Se,realpathSync:$e,realpath:xe,readdirSync:me,readdir:Ce}=Rt("fs"),{sep:Wt,basename:ke,dirname:Tt,resolve:Qt,normalize:we,relative:He,posix:gt,isAbsolute:Oe}=Rt("path"),{fileURLToPath:Te}=Rt("url"),{createRequire:Le}=Rt("module");var Gt=Le(import.meta.url);function Pe(t){let e=we(t);return e.length>1&&e[e.length-1]===Wt&&(e=e.substring(0,e.length-1)),e}const Ie=/[\\/]/g;function zt(t,e){return t.replace(Ie,e)}const Ne=/^[a-z]:[\\/]$/i;function De(t){return t==="/"||Ne.test(t)}function Ht(t,e){const{resolvePaths:n,normalizePath:l,pathSeparator:c}=e,u=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(n&&(t=Qt(t)),(l||u)&&(t=Pe(t)),t===".")return"";const r=t[t.length-1]!==c;return zt(r?t+c:t,c)}function Zt(t,e){return e+t}function Be(t,e){return function(n,l){return l.startsWith(t)?l.slice(t.length)+n:zt(He(t,l),e.pathSeparator)+e.pathSeparator+n}}function Me(t){return t}function Fe(t,e,n){return e+t+n}function Ge(t,e){const{relativePaths:n,includeBasePath:l}=e;return n&&t?Be(t,e):l?Zt:Me}function Ue(t){return function(e,n){n.push(e.substring(t.length)||".")}}function qe(t){return function(e,n,l){const c=e.substring(t.length)||".";l.every(u=>u(c,!0))&&n.push(c)}}const Ke=(t,e)=>{e.push(t||".")},Xe=(t,e,n)=>{const l=t||".";n.every(c=>c(l,!0))&&e.push(l)},je=()=>{};function We(t,e){const{includeDirs:n,filters:l,relativePaths:c}=e;return n?c?l&&l.length?qe(t):Ue(t):l&&l.length?Xe:Ke:je}const Qe=(t,e,n,l)=>{l.every(c=>c(t,!1))&&n.files++},ze=(t,e,n,l)=>{l.every(c=>c(t,!1))&&e.push(t)},Ze=(t,e,n,l)=>{n.files++},Ye=(t,e)=>{e.push(t)},Ve=()=>{};function Je(t){const{excludeFiles:e,filters:n,onlyCounts:l}=t;return e?Ve:n&&n.length?l?Qe:ze:l?Ze:Ye}const tn=t=>t,en=()=>[""].slice(0,0);function nn(t){return t.group?en:tn}const rn=(t,e,n)=>{t.push({directory:e,files:n,dir:e})},sn=()=>{};function on(t){return t.group?rn:sn}const un=function(t,e,n){const{queue:l,fs:c,options:{suppressErrors:u}}=e;l.enqueue(),c.realpath(t,(r,p)=>{if(r)return l.dequeue(u?null:r,e);c.stat(p,(y,$)=>{if(y)return l.dequeue(u?null:y,e);if($.isDirectory()&&Yt(t,p,e))return l.dequeue(null,e);n($,p),l.dequeue(null,e)})})},an=function(t,e,n){const{queue:l,fs:c,options:{suppressErrors:u}}=e;l.enqueue();try{const r=c.realpathSync(t),p=c.statSync(r);if(p.isDirectory()&&Yt(t,r,e))return;n(p,r)}catch(r){if(!u)throw r}};function ln(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?an:un}function Yt(t,e,n){if(n.options.useRealPaths)return cn(e,n);let l=Tt(t),c=1;for(;l!==n.root&&c<2;){const u=n.symlinks.get(l);u&&(u===e||u.startsWith(e)||e.startsWith(u))?c++:l=Tt(l)}return n.symlinks.set(t,e),c>1}function cn(t,e){return e.visited.includes(t+e.options.pathSeparator)}const pn=t=>t.counts,hn=t=>t.groups,fn=t=>t.paths,gn=t=>t.paths.slice(0,t.options.maxFiles),dn=(t,e,n)=>($t(e,n,t.counts,t.options.suppressErrors),null),yn=(t,e,n)=>($t(e,n,t.paths,t.options.suppressErrors),null),An=(t,e,n)=>($t(e,n,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),Rn=(t,e,n)=>($t(e,n,t.groups,t.options.suppressErrors),null);function $t(t,e,n,l){e(t&&!l?t:null,n)}function _n(t,e){const{onlyCounts:n,group:l,maxFiles:c}=t;return n?e?pn:dn:l?e?hn:Rn:c?e?gn:An:e?fn:yn}const Vt={withFileTypes:!0},bn=(t,e,n,l,c)=>{if(t.queue.enqueue(),l<0)return t.queue.dequeue(null,t);const{fs:u}=t;t.visited.push(e),t.counts.directories++,u.readdir(e||".",Vt,(r,p=[])=>{c(p,n,l),t.queue.dequeue(t.options.suppressErrors?null:r,t)})},En=(t,e,n,l,c)=>{const{fs:u}=t;if(l<0)return;t.visited.push(e),t.counts.directories++;let r=[];try{r=u.readdirSync(e||".",Vt)}catch(p){if(!t.options.suppressErrors)throw p}c(r,n,l)};function vn(t){return t?En:bn}var Sn=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},$n=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},xn=class{aborted=!1;abort(){this.aborted=!0}},Jt=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,n){this.isSynchronous=!n,this.callbackInvoker=_n(e,this.isSynchronous),this.root=Ht(t,e),this.state={root:De(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new $n,options:e,queue:new Sn((l,c)=>this.callbackInvoker(c,l,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new xn,fs:e.fs||Ee},this.joinPath=Ge(this.root,e),this.pushDirectory=We(this.root,e),this.pushFile=Je(e),this.getArray=nn(e),this.groupFiles=on(e),this.resolveSymlink=ln(e,this.isSynchronous),this.walkDirectory=vn(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,n)=>{const{paths:l,options:{filters:c,resolveSymlinks:u,excludeSymlinks:r,exclude:p,maxFiles:y,signal:$,useRealPaths:v,pathSeparator:x},controller:T}=this.state;if(T.aborted||$&&$.aborted||y&&l.length>y)return;const E=this.getArray(this.state.paths);for(let O=0;O<t.length;++O){const L=t[O];if(L.isFile()||L.isSymbolicLink()&&!u&&!r){const m=this.joinPath(L.name,e);this.pushFile(m,E,this.state.counts,c)}else if(L.isDirectory()){let m=Fe(L.name,e,this.state.options.pathSeparator);if(p&&p(L.name,m))continue;this.pushDirectory(m,l,c),this.walkDirectory(this.state,m,m,n-1,this.walk)}else if(this.resolveSymlink&&L.isSymbolicLink()){let m=Zt(L.name,e);this.resolveSymlink(m,this.state,(j,C)=>{if(j.isDirectory()){if(C=Ht(C,this.state.options),p&&p(L.name,v?C:m+x))return;this.walkDirectory(this.state,C,v?C:m+x,n-1,this.walk)}else{C=v?C:m;const g=ke(C),d=Ht(Tt(C),this.state.options);C=this.joinPath(g,d),this.pushFile(C,E,this.state.counts,c)}})}}this.groupFiles(this.state.groups,e,E)}};function mn(t,e){return new Promise((n,l)=>{te(t,e,(c,u)=>{if(c)return l(c);n(u)})})}function te(t,e,n){new Jt(t,e,n).start()}function Cn(t,e){return new Jt(t,e).start()}var Ut=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return mn(this.root,this.options)}withCallback(t){te(this.root,this.options,t)}sync(){return Cn(this.root,this.options)}};let ee=null;try{Gt.resolve("picomatch"),ee=Gt("picomatch")}catch{}var kn=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:Wt,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new Ut(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new Ut(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){const n=this.globFunction||ee;if(!n)throw new Error("Please specify a glob function to use glob matching.");var l=this.globCache[t.join("\0")];return l||(l=n(t,...e),this.globCache[t.join("\0")]=l),this.options.filters.push(c=>l(c)),this}};const wn=Array.isArray,ne=/\\/g,Hn=/^[A-Za-z]:$/,re=process.platform==="win32",On=/^(\/?\.\.)+$/;function qt(t,e={}){const n=t.length,l=Array(n),c=Array(n);let u,r;for(u=0;u<n;u++){const p=se(t[u]);l[u]=p;const y=p.length,$=Array(y);for(r=0;r<y;r++)$[r]=ft(p[r],e);c[u]=$}return p=>{const y=p.split("/");if(y[0]===".."&&On.test(p))return!0;for(u=0;u<n;u++){const $=l[u],v=c[u],x=y.length,T=Math.min(x,$.length);for(r=0;r<T;){const E=$[r];if(E.includes("/"))return!0;if(!v[r](y[r]))break;if(!e.noglobstar&&E==="**")return!0;r++}if(r===x)return!0}return!1}}const Tn=/^[A-Z]:\/$/i,Ln=re?t=>Tn.test(t):t=>t==="/";function Kt(t,e,n){if(t===e||e.startsWith(`${t}/`)){if(n){const c=t.length+ +!Ln(t);return(u,r)=>u.slice(c,r?-1:void 0)||"."}const l=e.slice(t.length+1);return l?(c,u)=>{if(c===".")return l;const r=`${l}/${c}`;return u?r.slice(0,-1):r}:(c,u)=>u&&c!=="."?c.slice(0,-1):c}return n?l=>gt.relative(t,l)||".":l=>gt.relative(t,`${e}/${l}`)||"."}function Pn(t,e){if(e.startsWith(`${t}/`)){const n=e.slice(t.length+1);return l=>`${n}/${l}`}return n=>{const l=gt.relative(t,`${e}/${n}`);return n[n.length-1]==="/"&&l!==""?`${l}/`:l||"."}}function Xt(t){return t.replace(Hn,e=>`${e}/`)}const In={parts:!0};function se(t){var e;const n=ft.scan(t,In);return!((e=n.parts)===null||e===void 0)&&e.length?n.parts:[t]}const Nn=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Dn=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Bn=t=>t.replace(Nn,"\\$&"),Mn=t=>t.replace(Dn,"\\$&"),Fn=re?Mn:Bn;function Gn(t,e){const n=ft.scan(t);return n.isGlob||n.negated}function At(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function oe(t){return typeof t=="string"?[t]:t??[]}const Un=/^(\/?\.\.)+/,qn=/\\(?=[()[\]{}!*+?@|])/g;function Ot(t,e,n,l){var c;const u=e.cwd;let r=t;t[t.length-1]==="/"&&(r=t.slice(0,-1));const p=r.lastIndexOf("/"),y=(p===-1?r:r.slice(p+1)).startsWith("!(");r[r.length-1]!=="*"&&!y&&e.expandDirectories&&(r+="/**");const $=Fn(u);r=Oe(r.replace(qn,""))?gt.relative($,r):gt.normalize(r);const v=(c=Un.exec(r))===null||c===void 0?void 0:c[0],x=se(r);if(v){const E=(v.length+1)/3;let O=0;const L=$.split("/");for(;O<E&&x[O+E]===L[L.length+O-E];)r=r.slice(0,(E-O-1)*3)+r.slice((E-O)*3+x[O+E].length+1)||".",O++;const m=gt.join(u,v.slice(O*3));m[0]!=="."&&n.root.length>m.length&&(n.root=Xt(m),n.depthOffset=-E+O)}if(!l&&n.depthOffset>=0){var T;(T=n.commonPath)!==null&&T!==void 0||(n.commonPath=x);const E=[],O=Math.min(n.commonPath.length,x.length);for(let L=0;L<O;L++){const m=x[L];if(m==="**"&&!x[L+1]){E.pop();break}if(L===x.length-1||m!==n.commonPath[L]||Gn(m))break;E.push(m)}n.depthOffset=E.length,n.commonPath=E,n.root=Xt(E.length>0?gt.join(u,...E):u)}return r}function Kn(t,e,n){const l=[],c=[],u=[];for(const r of t.ignore)r&&(r[0]!=="!"||r[1]==="("?c.push(Ot(r,t,n,!0)):u.push(r.slice(1)));for(const r of e)r&&(r[0]!=="!"||r[1]==="("?l.push(Ot(r,t,n,!1)):(r[1]!=="!"||r[2]==="(")&&c.push(Ot(r.slice(1),t,n,!0)));return{match:l,ignore:c,unignore:u}}function Xn(t,e){const n=t.cwd,l={root:n,depthOffset:0},c=Kn(t,e,l);t.debug&&At("internal processing patterns:",c);const{absolute:u,caseSensitiveMatch:r,debug:p,dot:y,followSymbolicLinks:$,onlyDirectories:v}=t,x=l.root.replace(ne,""),T={dot:y,nobrace:t.braceExpansion===!1,nocase:!r,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},E=c.unignore.length>0,O=E?ft(c.unignore,T):void 0,L=E?qt(c.unignore,T):void 0,m=ft(c.match,{...T,ignore:c.ignore,onIgnore:O?_=>O(_.output)&&ft.constants.UNIGNORE:void 0}),j=ft(c.ignore,T),C=qt(c.match,T),g=Kt(n,x,u),d=u?g:Kt(n,x,!0),s=c.match.length>0&&c.match.every(_=>_==="**"||_==="**/*"),b=c.ignore.length>0||E||!s?(_,A)=>{const I=d(A,!0);return I==="."||L&&L(I)?!1:!C(I)||j(I)}:void 0;let w;t.deep!==void 0&&(w=Math.round(t.deep-l.depthOffset));const R=new kn({filters:[p?(_,A)=>{const I=g(_,A),M=m(I);return M&&At(`matched ${I}`),M}:(_,A)=>{const I=g(_,A);return m(I)}],exclude:p&&b?(_,A)=>{const I=b(_,A);return At(`${I?"skipped":"crawling"} ${A}`),I}:b,fs:t.fs,pathSeparator:"/",relativePaths:!u,resolvePaths:u,includeBasePath:u,resolveSymlinks:$,excludeSymlinks:!$,excludeFiles:v,includeDirs:v||!t.onlyFiles,maxDepth:w,signal:t.signal}).crawl(x);return t.debug&&At("internal properties:",{...l,root:x}),[R,n!==x&&!u&&Pn(n,x)]}function jn(t,e){if(e)for(let n=t.length-1;n>=0;n--)t[n]=e(t[n]);return t}const jt={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Wn(t){const e=Object.assign({},t);for(const n in jt)e[n]===void 0&&Object.assign(e,{[n]:jt[n]});return e.cwd=(e.cwd instanceof URL?Te(e.cwd):Qt(e.cwd||process.cwd())).replace(ne,"/"),e.ignore=oe(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||Ce,readdirSync:e.fs.readdirSync||me,realpath:e.fs.realpath||xe,realpathSync:e.fs.realpathSync||$e,stat:e.fs.stat||Se,statSync:e.fs.statSync||ve}),e.debug&&At("globbing with options:",e),e}function Qn(t,e={}){var n;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const l=wn(t)||typeof t=="string",c=oe((n=l?t:t.patterns)!==null&&n!==void 0?n:"**/*"),u=Wn(l?e:t);return c.length>0?Xn(u,c):[]}async function zn(t,e){const[n,l]=Qn(t,e);return n?jn(await n.withPromise(),l):[]}const Yn=async(t,e)=>await zn(t,e);export{Yn as l};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{m as k,D as S,f as L}from"./provenance-BH80RHXx.js";import{g as $}from"./packument-DyuhH1Gz.js";import{f}from"./formatBytes-BHAzNIrn-XohRrPdt.js";import{a as E}from"./build-scripts-pdVmqXRm.js";import{n as h}from"./license-DvlYdo6T.js";import{v as A,U as P,z as x}from"./index-DHD8wb6Z.js";import{S as O}from"./lockfile-DhHAaHN5.js";import{L as b}from"./dependency-scan-DBH2Qo4I.js";const C=2,m=4,y={CRITICAL:0,HIGH:1,LOW:3,MODERATE:C,UNKNOWN:m},ae=(s,e)=>{const n=y[(s.vulnerability.severity??"UNKNOWN").toUpperCase()]??m,t=y[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??m;return n-t||s.packageName.localeCompare(e.packageName)||s.packageVersion.localeCompare(e.packageVersion)},M=(s,e)=>{const n=y[e.toUpperCase()]??C;return(y[s.toUpperCase()]??m)<=n},R=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"],w=6e4,D=(s,e,n)=>{for(const t of n)if(t===s||t===`${s}@${e}`||t.endsWith("*")&&s.startsWith(t.slice(0,-1)))return!0;return!1},W=async(s,e)=>{const n=e.security?.policies?.firstSeen;if(n?.minutes===void 0||n.minutes<=0)return[];const{minutes:t}=n,r=n.exclude??[],a=e.security?.acceptedRisks,c=t*w,o=Date.now();return(await k(s.packages,S,async l=>{if(D(l.name,l.version,r))return;const p=await $(l.name,{workspaceRoot:s.workspaceRoot});if(p===void 0)return;const u=p.time?.[l.version];if(u===void 0)return;const d=Date.parse(u);if(Number.isNaN(d))return;const v=o-d;if(v>=c)return;const g=Math.max(0,Math.floor(v/w));return{acceptedRisk:f(l.name,l.version,a,"firstSeen"),data:{ageMinutes:g,minimumMinutes:t,publishedAt:u},packageName:l.name,policy:"firstSeen",reason:`${l.name}@${l.version} was published ${String(g)} min ago — below the ${String(t)} min firstSeen cooldown.`,severity:"block",version:l.version}})).filter(l=>l!==void 0)},U=(s,e)=>{const n=e.security?.policies?.installScripts;if(!n)return[];const t=n.allow??{},r=n.strict===!0;if(!r&&Object.keys(t).length===0)return[];const a=E(s.workspaceRoot,t,{pinVersions:e.security?.pinVersions===!0});if(a.unapproved.length===0)return[];const c=e.security?.acceptedRisks,o=r?"block":"warn";return a.unapproved.map(i=>({acceptedRisk:f(i.name,i.version??"*",c,"installScripts"),data:{hooks:i.hooks},packageName:i.name,policy:"installScripts",reason:`${i.name}${i.version?`@${i.version}`:""} declares unapproved build script(s): ${i.hooks.join(", ")}`,severity:o,version:i.version??"*"}))},_=new Set(["AND","OR"]),I=s=>{const e=s.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(r=>r.trim()).filter(r=>r.length>0),n=[];let t=!1;for(const r of e){const a=r.toUpperCase();if(t){t=!1;continue}if(a==="WITH"){t=!0;continue}if(_.has(a))continue;const c=r.endsWith("+"),o=c?r.slice(0,-1):r,i=h(o)??o;n.push(i),c&&n.push(`${i}-or-later`)}return n},T=s=>{if(typeof s.license=="string"){const e=s.license.trim();return e.length>0?e:void 0}if(s.license&&typeof s.license=="object"&&typeof s.license.type=="string"){const e=s.license.type.trim();if(e.length>0)return e}if(Array.isArray(s.licenses)&&s.licenses.length>0){const e=s.licenses.map(n=>n&&typeof n.type=="string"?n.type.trim():"").filter(n=>n.length>0);if(e.length>0)return e.length===1?e[0]:`(${e.join(" OR ")})`}},V=(s,e)=>{if(e.length===0)return;const n=new Set(e.map(t=>h(t)??t).map(t=>t.toLowerCase()));for(const t of s)if(n.has(t.toLowerCase()))return t},F=(s,e)=>{if(e.length===0)return;const n=new Set(e.map(t=>h(t)??t).map(t=>t.toLowerCase()));for(const t of s)if(!n.has(t.toLowerCase()))return t},j=(s,e)=>{const n=e.security?.policies?.license;if(!n)return[];const t=n.allow??[],r=n.deny??[];if(t.length===0&&r.length===0)return[];const a=e.security?.acceptedRisks,c=[];for(const o of s.packages){const i=s.manifestData?.get(`${o.name}@${o.version}`),l=i?T(i):void 0;if(!l){t.length>0&&c.push({acceptedRisk:f(o.name,o.version,a,"license"),data:{declaredLicense:null},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} declares no license; allow-list mode requires one of: ${t.join(", ")}`,severity:"block",version:o.version});continue}const p=I(l),u=V(p,r);if(u){c.push({acceptedRisk:f(o.name,o.version,a,"license"),data:{declaredLicense:l,deniedLicense:u},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} uses denied license '${u}' (declared: ${l})`,severity:"block",version:o.version});continue}const d=F(p,t);d&&c.push({acceptedRisk:f(o.name,o.version,a,"license"),data:{allowList:t,declaredLicense:l,unallowedLicense:d},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} uses license '${d}' which is not on the allow-list (declared: ${l})`,severity:"block",version:o.version})}return c},K=6e4,z=(s,e,n)=>{for(const t of n)if(t===s||t===`${s}@${e}`||t.endsWith("*")&&s.startsWith(t.slice(0,-1)))return!0;return!1},B=async(s,e)=>{const n=e.security?.policies?.publisherChange;if(n?.mode!=="no-downgrade")return[];const t=n.exclude??[],r=typeof n.ignoreAfter=="number"?n.ignoreAfter*K:void 0,a=e.security?.acceptedRisks,c=Date.now();return(await k(s.packages,S,async i=>{if(z(i.name,i.version,t))return;const l=await $(i.name,{workspaceRoot:s.workspaceRoot});if(l===void 0)return;if(r!==void 0){const d=l.time?.[i.version],v=d===void 0?Number.NaN:Date.parse(d);if(!Number.isNaN(v)&&c-v>r)return}if(l.versions[i.version]?.dist?.attestations?.provenance!==void 0)return;const u=L(l,i.version);if(u!==void 0)return{acceptedRisk:f(i.name,i.version,a,"publisherChange"),data:{priorVersionWithProvenance:u},packageName:i.name,policy:"publisherChange",reason:`${i.name}@${i.version} dropped the provenance attestation that ${i.name}@${u} carried — publisher trust downgrade.`,severity:"block",version:i.version}})).filter(i=>i!==void 0)},Y=s=>{for(const e of Object.values(b))for(const n of[e.file,...e.aliases??[]])if(s===n||s.endsWith(`/${n}`)||s.endsWith(`.${n}`))return e.type},H=(s,e,n)=>{const t=A(e)?e:P(s,e);let r;try{r=x(t)}catch{return}const a=Y(t)??b[n]?.type;if(!a)return;const c=O(r,a);if(c.length===0)return;const o=new Set;for(const i of c)o.add(`${i.name}@${i.version}`);return o},q=(s,e)=>{for(const n of e)if(n===s||n.endsWith("*")&&s.startsWith(n.slice(0,-1)))return!0;return!1},G=(s,e)=>{const n=e.security?.policies?.unexpectedDeps;if(!n)return[];const t=n.allow??[],r=n.baselineLockfile;if(t.length===0&&!r)return[];const a=r?H(s.workspaceRoot,r,s.packageManager):void 0,c=e.security?.acceptedRisks,o=[];for(const i of s.packages){const l=t.length===0||q(i.name,t),p=a?a.has(`${i.name}@${i.version}`):!0;if(l&&p)continue;const u=[],d={};l||(u.push(`not on allow-list (${t.length} entr${t.length===1?"y":"ies"})`),d.allowList=t),!p&&a&&(u.push(`not present in baseline lockfile (${r})`),d.baselineLockfile=r),o.push({acceptedRisk:f(i.name,i.version,c,"unexpectedDeps"),data:d,packageName:i.name,policy:"unexpectedDeps",reason:`${i.name}@${i.version} is unexpected: ${u.join("; ")}`,severity:"block",version:i.version})}return o},X=(s,e)=>{if(!s.osvFindings||s.osvFindings.size===0)return[];const t=e.security?.policies?.vulnerability?.failOn,r=e.security?.acceptedRisks,a=[];for(const c of s.packages){const o=s.osvFindings.get(c.name);if(!(!o||o.length===0))for(const i of o){const l=t?M(i.severity,t)?"block":"warn":"info";a.push({acceptedRisk:f(c.name,c.version,r,"vulnerability"),data:{advisoryId:i.id,aliases:i.aliases??[],cvssScore:i.cvssScore,fixedVersions:i.fixedVersions,severity:i.severity,summary:i.summary},packageName:c.name,policy:"vulnerability",reason:`${i.severity} ${i.id} affects ${c.name}@${c.version}: ${i.summary}`,severity:l,version:c.version})}}return a},N=[{evaluate:X,isConfigured:s=>s.security?.policies?.vulnerability!==void 0,name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:j,isConfigured:s=>{const e=s.security?.policies?.license;return!!(e&&(e.allow&&e.allow.length>0||e.deny&&e.deny.length>0))},name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:U,isConfigured:s=>{const e=s.security?.policies?.installScripts;return!!(e&&(e.allow&&Object.keys(e.allow).length>0||e.strict===!0))},name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:G,isConfigured:s=>{const e=s.security?.policies?.unexpectedDeps;return!!(e&&(e.allow&&e.allow.length>0||typeof e.baselineLockfile=="string"))},name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:W,isConfigured:s=>{const e=s.security?.policies?.firstSeen?.minutes;return typeof e=="number"&&e>0},name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:B,isConfigured:s=>s.security?.policies?.publisherChange?.mode==="no-downgrade",name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],J=(s,e,n)=>N.filter(t=>t.surfaces.includes(s)?n!==void 0?n.has(t.name):t.isConfigured(e):!1),ce=async(s,e,n)=>{const t=J(e,n.visConfig,n.enabledPolicies),r=[];for(const a of t){if(s.offline&&!a.offlineSupported){r.push({packageName:"*",policy:a.name,reason:`policy.${a.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const c=await a.evaluate(s,n.visConfig);r.push(...c)}catch(c){const o=c instanceof Error?c.message:String(c);r.push({packageName:"*",policy:a.name,reason:`policy.${a.name} failed: ${o}`,severity:"info",version:"*"})}}return r},Q=(()=>{const s=new Map;for(const e of R)s.set(e.toLowerCase(),e);return s})(),le=()=>N.map(s=>s.name),ue=(s,e)=>{if(s===void 0)return;const n=s.trim().toLowerCase();if(n===""||n==="none")return new Set;if(n==="all")return new Set(R);const t=new Set;for(const r of s.split(",").map(a=>a.trim()).filter(a=>a.length>0)){const a=r.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(o,i)=>i.toUpperCase()),c=Q.get(a.toLowerCase());c===void 0?e?.(r):t.add(c)}return t};export{ae as c,ce as e,le as g,ue as p,M as s};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as K}from"node:module";import{n as E,o as z,C as S,f as X,e as h}from"./index-DHD8wb6Z.js";import{p as rt}from"./formatBytes-BHAzNIrn-XohRrPdt.js";import{N as it}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";import{r as D}from"./writeFileSync-DJoHk3Ks-CgQ-VNNT.js";import{withEnhancedPath as lt}from"@visulima/task-runner";let V;const U=t=>(V??=K(import.meta.url))(t),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=t=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[e,o]=f.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return f.getBuiltinModule(t)}return U(t)},{Socket:Y}=l("node:net"),{randomBytes:J}=l("node:crypto"),{readdir:Q,rm:b,unlink:$,open:Z,readFile:tt,stat:et,writeFile:ot,rename:st}=l("node:fs/promises"),{createRequire:M}=l("node:module"),{spawn:nt}=l("node:child_process"),{openSync:ct,closeSync:at}=l("node:fs");let ht;const dt=t=>(ht??=M(import.meta.url))(t),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ft=t=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,o]=u.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return u.getBuiltinModule(t)}return dt(t)},{lstat:A,mkdir:ut}=ft("node:fs/promises"),pt=async t=>{E(t);try{const e=await A(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(D(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await ut(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const o=await A(t);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(D(o))}'`,{cause:e})}};let wt;const yt=t=>(wt??=M(import.meta.url))(t),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,kt=t=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[e,o]=p.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return p.getBuiltinModule(t)}return yt(t)},{access:mt}=kt("node:fs/promises");async function _t(t,e=z){E(t),t=S(t);try{return await mt(t,e),!0}catch{return!1}}let gt;const vt=t=>(gt??=M(import.meta.url))(t),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=t=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[e,o]=w.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return w.getBuiltinModule(t)}return vt(t)},{readFile:bt}=x("node:fs/promises"),{unzip:Tt,brotliDecompress:Et}=x("node:zlib"),St={brotli:Et,gzip:Tt,none:(t,e)=>{e(null,t)}},Mt=async(t,e)=>{E(t),t=S(t);const{buffer:o,compression:s,encoding:r,flag:i}=e??{};let n;try{n=await bt(t,i?{flag:i}:{})}catch(c){throw X(c,t)}return await new Promise((c,g)=>{St[s??"none"](n,(k,m)=>{k?g(k):c(o?m:m.toString(r??"utf8"))})})};async function C(t,e,o){const s=await Mt(t,{buffer:!0,encoding:void 0});let r=new TextDecoder().decode(s);const{beforeParse:i,color:n}={};return typeof i=="function"&&(r=i(r)),it(r,e,S(t),{color:n})}const Ht=3e4,N=100;class Rt extends Error{constructor(e,o){super(e),this.elapsedMs=o,this.name="ServiceReadinessError"}elapsedMs}const Pt=async t=>{const e=t.host??"127.0.0.1",{port:o}=t,s=t.timeoutMs??Ht,r=Date.now();for(;Date.now()-r<s;){if(await $t(e,o))return;await Dt(N)}throw new Rt(`Timed out waiting for ${e}:${String(o)} to accept TCP connections (${String(s)}ms)`,Date.now()-r)},$t=(t,e)=>new Promise(o=>{const s=new Y,r=i=>{s.removeAllListeners(),s.destroy(),o(i)};s.once("connect",()=>{r(!0)}),s.once("error",()=>{r(!1)}),s.setTimeout(N,()=>{r(!1)});try{s.connect(e,t)}catch{r(!1)}}),Dt=t=>new Promise(e=>{setTimeout(e,t)}),At=async(t,e)=>{const o=t.readiness??(t.port===void 0?void 0:{tcp:{port:t.port}});o&&await Pt({host:o.tcp.host,port:o.tcp.port,timeoutMs:e?.timeoutMs??o.tcp.timeoutMs})},H=384,L=5e3,Lt=50,Ot=3e4,d=async t=>{const e=h(rt(t),"services");try{await pt(e)}catch(o){throw o.code==="ENOTDIR"?new Error(`Service registry path ${e} exists but is not a directory. Remove it or move the conflicting file before running \`vis service\`.`,{cause:o}):o}return e},R=t=>t.replaceAll("/","_").replaceAll(":","__"),P=(t,e)=>h(t,`${R(e)}.json`),It=(t,e)=>h(t,`${R(e)}.lock`),_=async(t,e)=>{const o=await d(t),s=P(o,e);if(await _t(s))try{return await C(s)}catch{return}},xt=async t=>{const e=await d(t);let o;try{o=await Q(e)}catch{return[]}const s=[];for(const r of o)if(r.endsWith(".json"))try{const i=await C(h(e,r));s.push(i)}catch{}return s},Ct=async(t,e)=>{const o=await d(t),s=P(o,e.id),r=h(o,`.${J(8).toString("hex")}.tmp`);await ot(r,`${JSON.stringify(e,void 0,2)}
|
|
2
|
-
`,{mode:H});try{await Wt(r,s)}catch(i){throw await b(r,{force:!0}).catch(()=>{}),i}},Nt=new Set(["EACCES","EBUSY","EPERM"]),Ft=8,jt=20,Wt=async(t,e)=>{let o=0;for(;;)try{await st(t,e);return}catch(s){const{code:r}=s;if(!(r!==void 0&&Nt.has(r))||o>=Ft)throw s;const n=jt*2**o;await new Promise(c=>{setTimeout(c,n)}),o+=1}},y=async(t,e,o)=>{const s=await d(t),r=o??await _(t,e);await b(P(s,e),{force:!0}),r&&await b(r.logFile,{force:!0}).catch(()=>{})},a=t=>{try{return process.kill(t,0),!0}catch{return!1}},se=async t=>{const e=await xt(t),o=[],s=[];for(const r of e){if(a(r.pid)){s.push(r);continue}const i=await _(t,r.id);if(i&&i.pid!==r.pid){s.push(i);continue}await y(t,r.id,r).catch(()=>{}),o.push(r.id)}return{pruned:o,surviving:s}},Bt=t=>new Promise(e=>{setTimeout(e,t)}),Gt=async t=>{try{const e=await Z(t,"wx",H);try{await e.writeFile(String(process.pid))}finally{await e.close().catch(()=>{})}return!0}catch(e){if(e.code==="EEXIST")return!1;throw e}},qt=async t=>{let e;try{const o=await tt(t,"utf8"),s=Number.parseInt(o.trim(),10);e=Number.isFinite(s)?s:void 0}catch{return!0}if(e!==void 0&&!a(e))return!0;try{const o=await et(t);return Date.now()-o.mtimeMs>Ot}catch{return!0}},F=async(t,e,o)=>{const s=await d(t),r=It(s,e),i=Date.now();for(;!await Gt(r);){if(await qt(r)){await $(r).catch(()=>{});continue}if(Date.now()-i>=L)throw new Error(`Could not acquire service lock for ${e} within ${String(L)}ms — another \`vis service\` invocation appears to be holding it.`);await Bt(Lt)}try{return await o()}finally{await $(r).catch(()=>{})}};function T(t,e={},o){for(const s in t){const r=t[s],i=o?`${o}:${s}`:s;typeof r=="object"&&r!==null?T(r,e,i):typeof r=="function"&&(e[i]=r)}return e}const j=(()=>{if(console.createTask)return console.createTask;const t={run:e=>e()};return()=>t})();function W(t,e,o,s){for(let r=o;r<t.length;r+=1)try{const i=s?s.run(()=>t[r](...e)):t[r](...e);if(i&&typeof i.then=="function")return Promise.resolve(i).then(()=>W(t,e,r+1,s))}catch(i){return Promise.reject(i)}}function Kt(t,e,o){if(t.length>0)return W(t,e,0,j(o))}function Vt(t,e,o){if(t.length>0){const s=j(o);return Promise.all(t.map(r=>s.run(()=>r(...e))))}}function v(t,e){for(const o of[...t])o(e)}var Ut=class{_hooks;_before;_after;_deprecatedHooks;_deprecatedMessages;constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(t,e,o={}){if(!t||typeof e!="function")return()=>{};const s=t;let r;for(;this._deprecatedHooks[t];)r=this._deprecatedHooks[t],t=r.to;if(r&&!o.allowDeprecated){let i=r.message;i||(i=`${s} hook has been deprecated`+(r.to?`, please use ${r.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(i)||(console.warn(i),this._deprecatedMessages.add(i))}if(!e.name)try{Object.defineProperty(e,"name",{get:()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(e),()=>{e&&(this.removeHook(t,e),e=void 0)}}hookOnce(t,e){let o,s=(...r)=>(typeof o=="function"&&o(),o=void 0,s=void 0,e(...r));return o=this.hook(t,s),o}removeHook(t,e){const o=this._hooks[t];if(o){const s=o.indexOf(e);s!==-1&&o.splice(s,1),o.length===0&&(this._hooks[t]=void 0)}}clearHook(t){this._hooks[t]=void 0}deprecateHook(t,e){this._deprecatedHooks[t]=typeof e=="string"?{to:e}:e;const o=this._hooks[t]||[];this._hooks[t]=void 0;for(const s of o)this.hook(t,s)}deprecateHooks(t){for(const e in t)this.deprecateHook(e,t[e])}addHooks(t){const e=T(t),o=Object.keys(e).map(s=>this.hook(s,e[s]));return()=>{for(const s of o)s();o.length=0}}removeHooks(t){const e=T(t);for(const o in e)this.removeHook(o,e[o])}removeAllHooks(){this._hooks={}}callHook(t,...e){return this.callHookWith(Kt,t,e)}callHookParallel(t,...e){return this.callHookWith(Vt,t,e)}callHookWith(t,e,o){const s=this._before||this._after?{name:e,args:o,context:{}}:void 0;this._before&&v(this._before,s);const r=t(this._hooks[e]?[...this._hooks[e]]:[],o,e);return r instanceof Promise?r.finally(()=>{this._after&&s&&v(this._after,s)}):(this._after&&s&&v(this._after,s),r)}beforeEach(t){return this._before=this._before||[],this._before.push(t),()=>{if(this._before!==void 0){const e=this._before.indexOf(t);e!==-1&&this._before.splice(e,1)}}}afterEach(t){return this._after=this._after||[],this._after.push(t),()=>{if(this._after!==void 0){const e=this._after.indexOf(t);e!==-1&&this._after.splice(e,1)}}}};function zt(){return new Ut}const re=()=>zt(),ie=async(t,e)=>{if(!(!e||e.length===0))for(const o of e){if(o.hooks)for(const[s,r]of Object.entries(o.hooks)){const i=Array.isArray(r)?r:[r];for(const n of i)t.hook(s,n)}o.setup&&await o.setup(t)}};class ne{#o;#e;#s=new Map;constructor(e,o){this.#o=e,this.#e=o}startTasks(e){for(const o of e)this.#s.set(o.id,o),this.#t("task:before",o)}endTasks(e){for(const o of e)this.#s.delete(o.task.id),this.#t("task:after",o.task,o),o.status==="failure"?this.#t("task:failure",o.task,o):Xt(o.status)&&this.#t("task:cacheHit",o.task,o)}printCacheMiss(e,o){this.#t("task:cacheMiss",e,o)}onTaskStdout(e,o){this.#t("task:stdout",e,o)}onTaskStderr(e,o){this.#t("task:stderr",e,o)}#t(e,...o){Promise.resolve(this.#o.callHook(e,...o)).catch(s=>{if(this.#e)try{this.#e(e,s)}catch{}})}}const Xt=t=>t==="local-cache"||t==="local-cache-kept-existing"||t==="remote-cache",O=process.platform==="win32",Yt=async t=>{const{command:e,cwd:o,env:s,logFile:r}=t,i=ct(r,"a",H);let n;const c=O?"cmd":"/bin/sh",g=O?["/d","/s","/c",e]:["-c",e];try{n=nt(c,g,{cwd:o,detached:!0,env:lt({...process.env,...s},o),stdio:["ignore",i,i],windowsHide:!0})}finally{at(i)}if(n.pid===void 0&&await new Promise((k,m)=>{n.once("spawn",()=>{k()}),n.once("error",q=>{m(q)})}),n.pid===void 0)throw new Error(`Failed to spawn detached process for command: ${e}`);return n.unref(),{pid:n.pid}},B=5e3,ce=async t=>F(t.workspaceRoot,t.id,async()=>{const e=await _(t.workspaceRoot,t.id);if(e&&a(e.pid))throw new Error(`Service ${t.id} is already running (pid ${String(e.pid)})`);e&&await y(t.workspaceRoot,t.id,e);const o=await d(t.workspaceRoot),s=R(t.id),r=h(o,`${s}.log`),{pid:i}=await Yt({command:t.command,cwd:t.cwd,env:t.env,logFile:r}),n={command:t.command,config:t.config,cwd:t.cwd,env:t.config.env??{},id:t.id,logFile:r,pid:i,slug:s,startedAt:new Date().toISOString(),visVersion:process.env.VIS_VERSION??"0.0.0"};if(await Ct(t.workspaceRoot,n),t.skipReadiness!==!0)try{await At(t.config,{timeoutMs:t.readinessTimeoutMs})}catch(c){throw await G(i,t.config.killGracePeriodMs??B).catch(()=>{}),await y(t.workspaceRoot,t.id,n).catch(()=>{}),c}return{entry:n}}),ae=async t=>F(t.workspaceRoot,t.id,async()=>{const e=await _(t.workspaceRoot,t.id);if(!e)return{stopped:!1};if(!a(e.pid))return await y(t.workspaceRoot,t.id,e),{stopped:!1};const o=t.graceMs??e.config.killGracePeriodMs??B;return await G(e.pid,o),await y(t.workspaceRoot,t.id,e),{stopped:!0}}),G=async(t,e)=>{I(t,"SIGTERM");const o=Date.now();for(;Date.now()-o<e;){if(!a(t))return;await new Promise(s=>{setTimeout(s,100)})}a(t)&&I(t,"SIGKILL")},I=(t,e)=>{try{process.platform==="win32"?process.kill(t,e):process.kill(-t,e)}catch(o){if(o.code==="ESRCH")return;throw o}};export{ne as H,Rt as S,ce as a,At as b,xt as c,re as d,ie as e,y as f,_t as g,a as i,se as p,_ as r,ae as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as p}from"node:module";import{e as a}from"./index-DHD8wb6Z.js";let k;const _=e=>(k??=p(import.meta.url))(e),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,y=e=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[o,t]=i.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return i.getBuiltinModule(e)}return _(e)},{statSync:u,existsSync:m,readFileSync:f}=y("node:fs"),h={aube:["aube-lock.yaml"],bun:["bun.lock","bun.lockb"],npm:["npm-shrinkwrap.json","package-lock.json"],pnpm:["pnpm-lock.yaml"],yarn:["yarn.lock"]},b={aube:["node_modules/.aube-state","node_modules/.modules.yaml"],bun:["node_modules/.bun-tag"],npm:["node_modules/.package-lock.json"],pnpm:["node_modules/.modules.yaml","node_modules/.pnpm/lock.yaml"],yarn:["node_modules/.yarn-integrity","node_modules/.yarn-state.yml",".yarn/install-state.gz"]},g={pnpm:"node_modules/.pnpm/lock.yaml"},M={ci:{aube:"aube ci",bun:"bun install --frozen-lockfile",npm:"npm ci",pnpm:"pnpm install --frozen-lockfile",yarn:"yarn install --immutable"},tty:{aube:"aube install",bun:"bun install",npm:"npm install",pnpm:"pnpm install",yarn:"yarn install"}},L=1e3,S=e=>{for(const[o,t]of Object.entries(h))for(const s of t)if(m(a(e,s)))return{lockfileFile:s,manager:o}},j=(e,o,t)=>{const s=g[t];if(!s)return;const n=a(e,s);if(!m(n))return;const r=a(e,o);try{return u(r).size!==u(n).size?!1:f(r).equals(f(n))}catch{return}},v=(e,o)=>{let t;for(const s of b[o]){const n=a(e,s);if(!m(n))continue;const{mtimeMs:r}=u(n);(!t||r>t.mtimeMs)&&(t={mtimeMs:r,path:s})}return t},C=(e,o={})=>{const t=S(e);if(!t)return{checked:!1};const{lockfileFile:s,manager:n}=t,r=u(a(e,s)).mtimeMs,l=v(e,n),d=M[o.inCi?"ci":"tty"][n],c={comparedBy:"mtime",installMarkerMtimeMs:l?.mtimeMs,lockfileMtimeMs:r,lockfilePath:s,marker:l?.path,packageManager:n};return l?j(e,s,n)===!0?{checked:!0,detail:{...c,comparedBy:"content"}}:r>l.mtimeMs+L?{checked:!0,detail:c,failure:"stale-install",message:`${s} is newer than node_modules (${l.path}) — run \`${d}\` to sync.`}:{checked:!0,detail:c}:{checked:!0,detail:c,failure:"missing-install",message:`lockfile detected but node_modules looks uninitialised — run \`${d}\` before \`vis run\`.`}},E=(e,o,t,s={})=>{if(s.skip)return{checked:!1,shouldContinue:!0};const n=C(e,{inCi:o});if(!n.failure)return{...n,shouldContinue:!0};const r=`preflight: ${n.message??"lockfile drift detected"}`;return o&&!s.ciAsWarning?{...n,formattedMessage:r,shouldContinue:!1}:(t.warn(r),{...n,formattedMessage:r,shouldContinue:!0})};export{S as d,E as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as j}from"node:module";import{e as d}from"./index-DHD8wb6Z.js";import{y}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as P}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";let M;const b=o=>(M??=j(import.meta.url))(o),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,N=o=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[e,t]=l.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return l.getBuiltinModule(o)}return b(o)},{readdirSync:g,lstatSync:S}=N("node:fs"),R=/^([^<(]+?)?(?:<([^>]+)>)?\s*(?:\(([^)]+)\))?\s*$/u,T=o=>{const e=o.match(R);if(!e)return;const t=e[1]?.trim(),n=e[2]?.trim(),r=e[3]?.trim();if(!(!t&&!n&&!r))return{email:n||void 0,name:t||void 0,url:r||void 0}},k=o=>{if(!Array.isArray(o)||o.length===0)return;const e=[];for(const t of o)if(typeof t=="string"){const n=T(t);n&&e.push(n)}else if(t&&typeof t=="object"){const n=t,r=typeof n.name=="string"?n.name:void 0,i=typeof n.email=="string"?n.email:void 0,u=typeof n.url=="string"?n.url:void 0;(r||i||u)&&e.push({email:i,name:r,url:u})}return e.length>0?e:void 0},D=o=>{const e=d(o,"node_modules");if(!y(e))return new Map;const t=new Map,n=new Set,r=(i,u="")=>{if(n.has(i))return;n.add(i);let h;try{h=g(i)}catch{return}for(const a of h){const c=d(i,a);let m;try{m=S(c)}catch{continue}if(m.isSymbolicLink())continue;if(a.startsWith("@")){m.isDirectory()&&r(c,`${a}/`);continue}if(a===".pnpm"&&u===""){let s;try{s=g(c)}catch{continue}for(const p of s){const f=d(c,p,"node_modules");y(f)&&r(f)}continue}if(a.startsWith(".")||!m.isDirectory())continue;const v=u+a,_=d(c,"package.json");try{if(!y(_))continue;const s=P(_);if(typeof s.version!="string")continue;const p=`${v}@${s.version}`;t.has(p)||t.set(p,{directory:c,license:s.license,licenses:Array.isArray(s.licenses)?s.licenses:void 0,maintainers:k(s.maintainers),name:v,scripts:s.scripts&&typeof s.scripts=="object"?s.scripts:void 0,version:s.version});const f=d(c,"node_modules");y(f)&&r(f)}catch{}}};return r(e),t};export{k as n,D as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as h,U as l}from"./index-DHD8wb6Z.js";import{i as d,v as E,L as o}from"../packem_chunks/catalog.js";import{y as c}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";const _=/\/+$/,f=/node_modules/,p=/\.git/,S=/[$()+.?[\\\]^{|}]/g,P=/\/\*\*$|\/\*\/\*$/,g=(s,u)=>{const n=u.replace(_,"");if(n.startsWith("!"))return[];const t=[];if(n.endsWith("/*")){const r=n.slice(0,-2),e=l(s,r);if(!c(e))return[];for(const i of o(e,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[f,p]}))i.path===e||i.name.startsWith(".")||t.push(h(r,i.name));return t}if(n.endsWith("/**")||n.endsWith("/*/*")){const r=n.replace(P,""),e=l(s,r);if(!c(e))return[];for(const i of o(e,{includeFiles:!1,includeSymlinks:!1,skip:[f,p]})){if(i.path===e)continue;const m=i.path.slice(e.length+1);t.push(`${r}/${m}`)}return t}if(!n.includes("/")&&n.includes("*")){const r=n.replaceAll(S,String.raw`\$&`).replaceAll("*",".*"),e=new RegExp(`^${r}$`);for(const i of o(s,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[f,p]}))i.path!==s&&e.test(i.name)&&t.push(i.name);return t}const a=l(s,n);return c(a)&&t.push(n),t},W=s=>{const n=d(s)??E(s)??[],t=new Set,a=[];for(const r of n)for(const e of g(s,r))e==="."||t.has(e)||(t.add(e),c(h(s,e,"package.json"))||a.push({packageDir:e}));return a};export{W as l};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as b}from"node:module";import{e as p}from"./index-DHD8wb6Z.js";import{s as j}from"./index-B4AjSxHU.js";import{g as S}from"./formatBytes-BHAzNIrn-XohRrPdt.js";import{y as U}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as E}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";import{h as R}from"./writeFileSync-DJoHk3Ks-CgQ-VNNT.js";let _;const T=t=>(_??=b(import.meta.url))(t),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=t=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[e,s]=d.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return d.getBuiltinModule(t)}return T(t)},{rmSync:u,writeFileSync:C}=k("node:fs"),g=3,F=1800*1e3,A=15e3,v=()=>p(S(),"packuments"),y=t=>p(v(),`${encodeURIComponent(t)}.json`),M=t=>{const e=y(t);if(U(e))try{const s=E(e);if(s.cacheVersion!==g){u(e,{force:!0});return}if(Date.now()-s.createdAt>s.ttlMs){u(e,{force:!0});return}return s.packument}catch{u(e,{force:!0});return}},w=(t,e,s)=>{R(v());const o={cacheVersion:g,createdAt:Date.now(),packument:e,ttlMs:s};C(y(t),JSON.stringify(o),"utf8")},P=t=>{const e={},s=t.versions??{};for(const[a,r]of Object.entries(s)){const i=r.dist,n={version:a};if(r._npmUser!==void 0&&(n._npmUser=r._npmUser),r.maintainers!==void 0&&(n.maintainers=r.maintainers),r.bin!==void 0&&(n.bin=r.bin),i!==void 0){const c={};i.signatures!==void 0&&(c.signatures=i.signatures),i.attestations!==void 0&&(c.attestations=i.attestations),typeof i.integrity=="string"&&(c.integrity=i.integrity),typeof i.tarball=="string"&&(c.tarball=i.tarball),typeof i.unpackedSize=="number"&&Number.isFinite(i.unpackedSize)&&i.unpackedSize>=0&&(c.unpackedSize=i.unpackedSize),typeof i.fileCount=="number"&&Number.isInteger(i.fileCount)&&i.fileCount>=0&&(c.fileCount=i.fileCount),n.dist=c}r.repository!==void 0&&(n.repository=r.repository),r.license!==void 0&&(n.license=r.license),typeof r.readme=="string"&&(n.readme=r.readme),typeof r.readmeFilename=="string"&&(n.readmeFilename=r.readmeFilename),typeof r.private=="boolean"&&(n.private=r.private),typeof r.deprecated=="string"&&(n.deprecated=r.deprecated),r.scripts!==void 0&&typeof r.scripts=="object"&&(n.scripts=r.scripts),e[a]=n}const o={name:typeof t.name=="string"?t.name:"",versions:e};return t["dist-tags"]!==void 0&&(o["dist-tags"]=t["dist-tags"]),t.time!==void 0&&(o.time=t.time),typeof t.readme=="string"&&(o.readme=t.readme),o},D=t=>{const e={Accept:"application/json"};return t!==void 0&&t!==""&&(e.Authorization=`Bearer ${t}`),e},N=async(t,e)=>{if(e.registryUrl!==void 0)return{authToken:e.authToken,url:e.registryUrl};if(e.workspaceRoot!==void 0){const{getRegistryForPackage:s,loadNpmrc:o}=await import("../packem_chunks/catalog.js").then(n=>n.ab),a=o(e.workspaceRoot),{token:r,url:i}=s(t,a);return{authToken:e.authToken??r,url:i}}return{authToken:e.authToken,url:"https://registry.npmjs.org"}},x=async(t,e={})=>{const s=e.cacheTtlMs??F,o=M(t);if(o!==void 0)return o;if(e.offline)return;const a=await N(t,e),i=`${a.url.endsWith("/")?a.url.slice(0,-1):a.url}/${t.replace("/","%2f")}`,n=new AbortController,c=setTimeout(()=>{n.abort()},A),l=()=>{n.abort()};e.signal?.addEventListener("abort",l,{once:!0});try{const f=await fetch(i,{headers:D(a.authToken),signal:n.signal});if(f.status===404)return;if(!f.ok)throw new Error(`Registry returned ${String(f.status)} for ${t}`);const h=await f.json(),m=P(h);return w(t,m,s),m}finally{clearTimeout(c),e.signal?.removeEventListener("abort",l)}},B=(t,e)=>{const s=Object.keys(t.versions);if(s.length===0)return;if(e===void 0||e===""||e==="latest")return t["dist-tags"]?.latest??s.at(-1);const o=t["dist-tags"]?.[e];return o!==void 0?o:Object.hasOwn(t.versions,e)?e:j.maxSatisfying(s,e)??void 0};export{x as g,B as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as U}from"node:module";import{e as y,m as O,c as S,z as J}from"./index-DHD8wb6Z.js";import{withEnhancedPath as Y,collectNodeModulesBinDirs as z}from"@visulima/task-runner";import{s as j}from"./index-B4AjSxHU.js";import{detectPackageManager as G,resolveAdd as H,resolveRemove as V,whichBin as X,resolveUnlink as K,resolveInstall as Q,execPmCommandInteractive as Z,resolveDlx as ee,resolveExec as ne,resolveDedupe as re,resolveWhy as se,resolveLink as ae,resolvePmCommand as ie}from"#native";import{y as R}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";let T;const x=e=>(T??=U(import.meta.url))(e),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q=e=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[n,r]=k.versions.node.split(".").map(Number);if(n>22||n===22&&r>=3||n===20&&r>=16)return k.getBuiltinModule(e)}return x(e)},{spawn:F,spawnSync:E}=q("node:child_process"),p=(e,n,r,s)=>{for(const a of n)e.push("--filter",a);r&&e.push("--recursive"),s&&e.push("--workspace-root")},te=e=>{const n=[],r=[];return p(n,e.filter,e.recursive,e.workspaceRoot),e.silent&&n.push("--silent"),e.frozenLockfile&&n.push("--frozen-lockfile"),n.push("install"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.force&&n.push("--force"),e.ignoreScripts&&n.push("--ignore-scripts"),e.lockfileOnly&&n.push("--lockfile-only"),e.noOptional&&n.push("--no-optional"),e.offline&&n.push("--offline"),{args:n,bin:"aube",warnings:r}},oe=e=>{const n=[],r=[];return p(n,e.filter,!1,!1),n.push("add"),e.saveDev&&n.push("--save-dev"),e.exact&&n.push("--save-exact"),e.global&&n.push("--global"),e.optional&&n.push("--save-optional"),e.peer&&n.push("--save-peer"),e.workspace&&r.push("aube has no flag for the `workspace:` protocol; it auto-detects local workspace members during add. Ignoring --workspace."),e.workspaceRoot&&n.push("--workspace"),n.push(...e.packages),{args:n,bin:"aube",warnings:r}},ue=e=>{const n=[];return p(n,e.filter,e.recursive,!1),n.push("remove"),e.saveDev&&n.push("--save-dev"),e.global&&n.push("--global"),e.workspaceRoot&&n.push("--workspace"),n.push(...e.packages),{args:n,bin:"aube",warnings:[]}},ce=e=>{const n=["dedupe"];return e&&n.push("--check"),{args:n,bin:"aube",warnings:[]}},le=e=>{const n=[],r=[];p(n,e.filter,e.recursive,!1),n.push("why"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.json&&n.push("--json"),e.long&&n.push("--long"),e.parseable&&n.push("--parseable"),e.depth!==void 0&&r.push("aube why does not accept --depth; ignoring."),e.noOptional&&r.push("aube why does not accept --no-optional; ignoring."),e.global&&r.push("aube why does not accept --global; ignoring.");const[s,...a]=e.packages;return s===void 0?r.push("aube why requires a package name; none provided."):(a.length>0&&r.push("aube why takes a single package; using the first."),n.push(s)),{args:n,bin:"aube",warnings:r}},fe=e=>{const n=[];e.silent&&n.push("--silent"),n.push("dlx");for(const r of e.additionalPackages)n.push("--package",r);return e.shellMode&&n.push("--shell-mode"),n.push(e.package),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},de=e=>{const n=[];return p(n,e.filter,e.recursive,e.workspaceRoot),n.push("exec"),e.parallel&&n.push("--parallel"),e.reverse&&n.push("--reverse"),e.shellMode&&n.push("--shell-mode"),n.push(e.command),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},he=e=>{const n=["link"];return e!==null&&n.push(e),{args:n,bin:"aube",warnings:[]}},pe=(e,n)=>{const r=[],s=[];return n&&r.push("--recursive"),r.push("unlink"),e.length>1&&s.push("aube unlink takes a single package; using the first."),e.length>0&&r.push(e[0]),{args:r,bin:"aube",warnings:s}},ge=e=>{const n=["view","--",e.package],r=[],[s,...a]=e.fields;return s!==void 0?(a.length>0&&r.push("aube view only supports a single field; using the first."),e.json&&r.push("aube view does not support --json with a field selector; printing the field without --json."),n.push(s)):e.json&&n.push("--json"),{args:n,bin:"aube",warnings:r}},Ye=e=>{const n=[],r=[];return p(n,e.filters,e.recursive,e.workspaceRoot),n.push("update"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.global&&n.push("--global"),e.interactive&&n.push("--interactive"),e.latest&&n.push("--latest"),e.noOptional&&n.push("--no-optional"),e.noSave&&n.push("--no-save"),n.push(...e.packages),{args:n,bin:"aube",warnings:r}},be=new Set(["fund","ping","search","token"]),ke=(e,n)=>be.has(e)?{args:[e,...n],bin:"npm",warnings:[`'${e}' is not natively supported by aube. Delegating to npm.`]}:{args:[e,...n],bin:"aube",warnings:[]},w=256*1024,we=e=>{const n=e?{...process.env,...e}:{...process.env};return process.stderr.isTTY&&n.FORCE_COLOR===void 0&&n.NO_COLOR===void 0&&(n.FORCE_COLOR="1"),n},I=e=>e!==""&&!/[\s"&()<>^|%!]/u.test(e)?e:`"${e.replaceAll(/(\\*)"/gu,String.raw`$1$1\"`).replace(/(\\+)$/u,"$1$1").replaceAll(/[&()<>^|%!]/gu,String.raw`^$&`)}"`,ve=async(e,n,r)=>new Promise((s,a)=>{const i=process.platform==="win32",t=F(i?I(e):e,i?n.map(o=>I(o)):[...n],{cwd:r.cwd,env:we(r.env),shell:i,stdio:["inherit","pipe","pipe"],windowsHide:!0});let c=[],f=0;const d=o=>{if(c.push(o),f+=o.length,!(f<=w)){for(;c.length>1&&f-c[0].length>w;)f-=c.shift().length;if(c.length===1&&f>w){const h=c[0];c[0]=h.subarray(h.length-w),f=w}}},b=()=>Buffer.concat(c).toString("utf8");t.stdout?.on("data",o=>{process.stdout.write(o),d(o)}),t.stderr?.on("data",o=>{process.stderr.write(o),d(o)}),t.on("error",a),t.on("close",o=>{const h=b();c=[],s({code:o??1,output:h})})}),v=e=>{const n=j.coerce(e);return n?j.gte(n,"11.0.0"):!1},l=e=>e.name==="yarn"&&!e.version.startsWith("1."),$=e=>e.name==="yarn"&&e.version.startsWith("1."),ye=e=>e[0]==="rm"?["remove",...e.slice(1)]:e,me=(e,n,r)=>{switch(n){case"audit":return l(e)?{args:["npm","audit",...r],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"config":{if(l(e)){const[s,...a]=r;return s==="delete"?{args:["config","unset",...a],bin:"yarn",kind:"rewrite",warning:"yarn berry uses `config unset`, not `config delete`."}:{kind:"passthrough"}}return e.name==="bun"?{kind:"skip",warning:"bun has no `config` CLI. Edit bunfig.toml or .npmrc directly."}:e.name==="deno"?{kind:"skip",warning:"deno has no registry-config CLI. Edit deno.json directly."}:{kind:"passthrough"}}case"dist-tag":return $(e)?{args:["tag",...r],bin:"yarn",kind:"rewrite",warning:"yarn 1 has no `dist-tag`; using `yarn tag`."}:l(e)?{args:["npm","tag",...ye(r)],bin:"yarn",kind:"rewrite"}:e.name==="bun"||e.name==="deno"?{kind:"skip",warning:`${e.name} has no \`dist-tag\`. Use \`npm dist-tag\` instead.`}:{kind:"passthrough"};case"login":case"logout":return l(e)?{args:["npm",n,...r],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:[n,...r],bin:"npm",kind:"rewrite",warning:`bun has no \`${n}\`; falling back to \`npm ${n}\` (writes ~/.npmrc, which bun reads).`}:e.name==="deno"?{kind:"skip",warning:`deno has no \`${n}\`. JSR uses browser OAuth via \`deno publish\`.`}:{kind:"passthrough"};case"owner":return e.name==="pnpm"&&v(e.version)?{args:["owner",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `owner`; falling back to `npm owner`."}:l(e)?{args:["owner",...r],bin:"npm",kind:"rewrite",warning:"yarn berry has no `owner` (not in `yarn npm`); falling back to `npm owner`."}:e.name==="bun"?{args:["owner",...r],bin:"npm",kind:"rewrite",warning:"bun has no `owner`; falling back to `npm owner`."}:e.name==="deno"?{kind:"skip",warning:"deno has no `owner`. JSR uses scope-member roles via the web UI."}:{kind:"passthrough"};case"ping":return e.name==="pnpm"&&v(e.version)?{args:["ping",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `ping`; falling back to `npm ping`."}:{kind:"passthrough"};case"plugin":return l(e)?{kind:"passthrough"}:{kind:"skip",warning:`${e.name} does not support yarn-style plugins. Skipping (no-op).`};case"prune":return $(e)?{kind:"skip",warning:"yarn 1 has no `prune`. Use `yarn install --production` for a prod-only tree."}:l(e)?{kind:"skip",warning:"yarn berry has no `prune`. Use `yarn workspaces focus --production` instead."}:e.name==="bun"||e.name==="deno"?{kind:"skip",warning:`${e.name} has no \`prune\`. Pruning happens automatically on install.`}:{kind:"passthrough"};case"publish":return l(e)?{args:["npm","publish",...r],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"rebuild":return $(e)?{kind:"skip",warning:"yarn 1 has no `rebuild`. Re-install instead."}:e.name==="bun"?{kind:"skip",warning:"bun has no `rebuild`. Use `bun install --force` instead."}:e.name==="deno"?{kind:"skip",warning:"deno has no `rebuild`."}:{kind:"passthrough"};case"search":return e.name==="pnpm"&&v(e.version)?{args:["search",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `search`; falling back to `npm search`."}:{kind:"passthrough"};case"token":return e.name==="pnpm"&&v(e.version)?{args:["token",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `token`; falling back to `npm token`."}:{kind:"passthrough"};case"whoami":return e.name==="pnpm"&&v(e.version)?{args:["whoami",...r],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `whoami`; falling back to `npm whoami`."}:l(e)?{args:["npm","whoami",...r],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:["pm","whoami",...r],bin:"bun",kind:"rewrite"}:e.name==="deno"?{kind:"skip",warning:"deno has no `whoami`. JSR uses browser auth."}:{kind:"passthrough"};default:return{kind:"passthrough"}}},A=e=>X(e)!==null,je=e=>{const n=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"],["bun.lock","bun"],["bun.lockb","bun"],["deno.lock","deno"]];let r=e;for(;;){for(const[a,i]of n)if(R(y(r,a)))return i;const s=O(r);if(s===r||S(r).root===r)return;r=s}},ze=(e,n)=>{if(n.name!=="aube")return;const r=je(e);if(r!==void 0)return`Resolved installer is aube but the workspace has a ${r} lockfile. Aube reads and writes ${r}'s lockfile format in place, but its byte output may differ subtly — expect a one-time churn diff on the first install, and ongoing drift if your team mixes tools on the same lockfile. To pin the choice across the team, set \`install.backend\` in vis.config; to bypass aube for this run, pass --no-aube.`},C=e=>{if(R(e))try{return JSON.parse(J(e,{buffer:!1}))}catch{return}},Re=e=>{let n=e;for(;;){const r=y(n,"package.json"),s=C(r);if(s&&typeof s.packageManager=="string"&&s.packageManager.length>0)return s.packageManager;const a=O(n);if(a===n||S(n).root===n)return;n=a}},M=new Set(["npm","pnpm","yarn"]),P=(e,n,r)=>r===!1||!M.has(n)||!A("corepack")?!1:r===!0?!0:Re(e)!==void 0,Ge=(e,n)=>{const r=n.backend,s=process.env.VIS_INSTALLER,a=r??s??n.configBackend,i=n.configCorepack??"auto";if(a&&a!=="auto"){if(a==="aube"&&!A("aube"))throw new Error('install.backend is set to "aube" but the `aube` binary is not on PATH. Install it via `npm i -g @endevco/aube`, `mise use -g aube`, or `brew install endevco/tap/aube`.');return{name:a,useCorepack:P(e,a,i),version:"latest"}}if(A("aube"))return{name:"aube",useCorepack:!1,version:"latest"};const t=$e(e);return{...t,useCorepack:P(e,t.name,i)}},$e=e=>{if(!R(e))throw new Error(`Could not detect package manager in ${e}. Directory does not exist.`);const n=G(e);return{name:n.name,version:n.version||"latest"}},L=(e,n)=>n.useCorepack!==!0||!M.has(n.name)||e.bin==="corepack"||e.bin!==n.name?e:{...e,args:[n.name,...e.args],bin:"corepack"},Ae=(e,n,r)=>{if(r===void 0)return Z(e.bin,e.args,n);const s=E(e.bin,e.args,{cwd:n,env:{...process.env,...r},stdio:"inherit"});if(s.error)throw s.error;return s.status??1},u=(e,n,r,s,a={})=>{const i=L(n,e);for(const t of i.warnings)s.warn(`warning: ${t}`);return a.dry?(s.log(`[dry-run] ${i.bin} ${i.args.join(" ")}`),0):Ae(i,r,a.env)},g=(e,n,r,s,a={})=>u(e,n(),r,s,a),Oe=(e,n)=>n==="aube"||n==="deno"?e:{...e,args:[...e.args,"--prefer-offline"]},Se=(e,n,r)=>n!=="yarn"||r.startsWith("1.")||!e.args.includes("--immutable")||e.args.includes("--immutable-cache")?e:{...e,args:[...e.args,"--immutable-cache"]},W=(e,n,r)=>{let s=e.name==="aube"?te(n):Q(e.name,e.version,{...n,silent:n.silent||r.silent===!0});return r.preferOffline&&(s=Oe(s,e.name)),r.ciMode&&(s=Se(s,e.name,e.version)),s},He=(e,n,r,s,a={})=>{const i=W(e,n,a);return D(e,i,r,s,{dry:a.dry,env:a.env})},Ve=async(e,n,r,s,a={})=>{const i=L(W(e,n,a),e);for(const t of i.warnings)s.warn(`warning: ${t}`);return a.dry?(s.log(`[dry-run] ${i.bin} ${i.args.join(" ")}`),{code:0,output:""}):ve(i.bin,i.args,{cwd:r,env:a.env?{...process.env,...a.env}:process.env})},N=(e,n)=>{const r=n==="deno"?"--quiet":"--silent";return{...e,args:[...e.args,r]}},Ce=(e,n)=>n==="yarn"||n==="aube"?null:{...e,args:[...e.args,"--dry-run"]},D=(e,n,r,s,a)=>{if(a.dry!==!0)return u(e,n,r,s,a);const i=Ce(n,e.name);return i===null?u(e,n,r,s,a):u(e,i,r,s,{env:a.env})},De=(e,n)=>n==="aube"?{...e,args:[...e.args,"--ignore-scripts"]}:n==="deno"?e:{...e,args:[...e.args,"--ignore-scripts"]},_e=(e,n,r,s,a={})=>{let i=e.name==="aube"?oe(n):H(e.name,e.version,n);a.ignoreScripts&&(i=De(i,e.name)),a.silent&&(i=N(i,e.name));const t=D(e,i,r,s,{dry:a.dry,env:a.env});return t===0&&a.autoInstallPeers&&Me(e,n,r,s,a),t},Ie=e=>{if(e.startsWith("@")){const r=e.indexOf("/");if(r===-1)return e;const s=e.indexOf("@",r);return s===-1?e:e.slice(0,s)}const n=e.indexOf("@");return n===-1?e:e.slice(0,n)},Pe=(e,n)=>{let r=e;for(;;){const s=y(r,"node_modules",n,"package.json"),a=C(s);if(a)return a;const i=O(r);if(i===r||S(r).root===r)return;r=i}},Ee=e=>{const n=C(y(e,"package.json")),r=new Set;if(!n)return r;for(const s of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const a=n[s];if(a)for(const i of Object.keys(a))r.add(i)}return r},Me=(e,n,r,s,a)=>{if(e.name==="deno")return;const i=Ee(r),t=new Map;for(const d of n.packages){const b=Ie(d),o=Pe(r,b);if(!o?.peerDependencies)continue;const h=o.peerDependenciesMeta??{};for(const[m,B]of Object.entries(o.peerDependencies))h[m]?.optional||i.has(m)||t.has(m)||t.set(m,B)}if(t.size===0)return;const c=[...t.entries()].map(([d,b])=>`${d}@${b}`);s.log(`auto-installing peer dependencies: ${c.join(", ")}`);const f={exact:!1,filter:n.filter,global:!1,optional:!1,packages:c,peer:!1,saveDev:n.saveDev,workspace:!1,workspaceRoot:n.workspaceRoot};_e(e,f,r,s,{ignoreScripts:a.ignoreScripts})},Xe=(e,n,r,s,a={})=>{let i=e.name==="aube"?ue(n):V(e.name,e.version,n);return a.silent&&(i=N(i,e.name)),D(e,i,r,s,{dry:a.dry,env:a.env})},Ke=(e,n,r,s,a={})=>e.name==="aube"?u(e,ce(n),r,s,a):g(e,()=>re(e.name,e.version,n),r,s,a),Qe=(e,n,r,s,a={})=>e.name==="aube"?u(e,le(n),r,s,a):g(e,()=>se(e.name,e.version,n),r,s,a),Le=(e,n)=>{if(e.name==="aube")return ge(n);const r=[],s=[],a=e.name;switch(e.name){case"bun":{const i=j.coerce(e.version);i&&j.lt(i,"1.3.0")&&s.push(`bun ${e.version} does not support \`bun pm view\` (added in bun 1.3). Upgrade bun, or run \`npm view ${n.package}\` instead.`),r.push("pm","view","--",n.package,...n.fields),n.json&&r.push("--json");break}case"deno":{const i=n.package.startsWith("npm:")||n.package.startsWith("jsr:")||n.package.startsWith("https://")||n.package.startsWith("http://")||n.package.startsWith("file:")?n.package:`npm:${n.package}`;r.push("info","--",i),n.json&&r.push("--json"),n.fields.length>0&&s.push("deno info does not accept field selectors; ignoring.");break}case"npm":case"pnpm":{r.push("view","--",n.package,...n.fields),n.json&&r.push("--json");break}case"yarn":{if(e.version.startsWith("1.")){r.push("info","--",n.package);const[i,...t]=n.fields;i!==void 0&&(t.length>0&&s.push("yarn v1 only supports querying one field at a time; using the first."),r.push(i)),n.json&&r.push("--json")}else r.push("npm","info","--",n.package),n.fields.length>0&&s.push("yarn berry does not support field arguments to 'npm info'; ignoring."),n.json&&r.push("--json");break}default:{const i=e.name;throw new Error(`Unsupported package manager: ${i}`)}}return{args:r,bin:a,warnings:s}},Ze=(e,n,r,s,a={})=>u(e,Le(e,n),r,s,a),en=(e,n,r,s,a={})=>e.name==="aube"?u(e,he(n),r,s,a):g(e,()=>ae(e.name,e.version,n),r,s,a),nn=(e,n,r,s,a,i={})=>e.name==="aube"?u(e,pe(n,r),s,a,i):g(e,()=>K(e.name,e.version,n,r),s,a,i),We=(e,n,r)=>{if(e.args.includes("--offline")||e.args.includes("--cached-only"))return e;const s=(a,i)=>{const t=[...e.args];return t.splice(i,0,a),{...e,args:t}};switch(n){case"aube":case"pnpm":return s("--offline",1);case"bun":return{...e,warnings:[...e.warnings,"bun x does not support --offline. Pre-install the package via `vis install` so bun x resolves from the local cache."]};case"deno":return s("--cached-only",1);case"npm":return s("--offline",1);case"yarn":return r.startsWith("1.")?s("--offline",0):{...e,warnings:[...e.warnings,"yarn berry has no --offline flag for dlx. Configure `enableNetwork: false` in .yarnrc.yml or set `enableMirror: true` for offline-first behavior."]};default:{const a=n;return{...e,warnings:[...e.warnings,`applyDlxOffline: unsupported pm ${String(a)}`]}}}},rn=(e,n,r,s,a={})=>{let i=e.name==="aube"?fe(n):ee(e.name,e.version,n);return a.offline&&(i=We(i,e.name,e.version)),u(e,i,r,s,{dry:a.dry,env:a.env})},_=process.platform==="win32",Ne=_?[".exe",".cmd",".bat",".ps1",""]:[""],Be=(e,n)=>{if(!(e.includes("/")||e.includes("\\")))for(const r of z(n))for(const s of Ne){const a=y(r,`${e}${s}`);if(R(a))return _?a.replaceAll("/","\\"):a}},sn=(e,n,r)=>{const s=Be(e,r);if(s===void 0||_&&!s.toLowerCase().endsWith(".exe"))return null;const a=E(s,n,{cwd:r,env:Y({...process.env},r),stdio:"inherit"});if(a.error)throw a.error;return a.status??1},an=(e,n,r,s,a={})=>e.name==="aube"?u(e,de(n),r,s,a):g(e,()=>ne(e.name,e.version,n),r,s,a),tn=(e,n,r,s,a,i={})=>{if(e.name==="aube")return u(e,ke(n,r),s,a,i);const t=me(e,n,r);return t.kind==="skip"?(a.warn(`warning: ${t.warning}`),0):t.kind==="rewrite"?u(e,{args:t.args,bin:t.bin,warnings:t.warning?[t.warning]:[]},s,a,i):g(e,()=>ie(e.name,e.version,n,r),s,a,i)};export{Ge as a,an as b,_e as c,$e as d,Ke as e,Ze as f,ze as g,Ve as h,en as i,tn as j,Xe as k,nn as l,Qe as m,He as n,rn as o,Ye as p,sn as r,ve as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as u,d as a,T as l,z as f,C as d}from"./index-DHD8wb6Z.js";const m=e=>String.raw`\u{${e.codePointAt(0).toString(16)}}`,p=(e,r,c)=>l(e,{start:r},{tabWidth:!1,...c}),g=/in JSON at position (\d+)(?: \(line (\d+) column (\d+)\))?$/,N=(e,r)=>{const c=g.exec(r);if(!c)return;const[,i,t,n]=c;if(t&&n)return{column:Number(n),line:Number(t)};let o=Number(i);return o===e.length&&(o=e.length-1),a(e,o)},b=/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,h=e=>e.replace(b,(r,c,i)=>`"${i}"(${m(i)})`);function $(e,r,c,i){let t;try{return JSON.parse(e,r)}catch(s){t=s.message}let n;e?(n=N(e,t),t=h(t)):t+=" while parsing empty string";const o=new u(t);throw o.fileName=c,n&&(o.codeFrame=p(e,n,i)),o}function x(e,r,c){const i=f(e,{buffer:!0,encoding:void 0});let t=new TextDecoder().decode(i);const{beforeParse:n,color:o}={};return typeof n=="function"&&(t=n(t)),$(t,r,d(e),{color:o})}export{$ as N,x as p};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as _}from"node:module";import{e as l}from"./index-DHD8wb6Z.js";import{g as T}from"./formatBytes-BHAzNIrn-XohRrPdt.js";import{y as d}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as b}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";import{h as j}from"./writeFileSync-DJoHk3Ks-CgQ-VNNT.js";let p;const g=e=>(p??=_(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,r]=o.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return o.getBuiltinModule(e)}return g(e)},{rmSync:f,writeFileSync:k}=v("node:fs"),C=1440*60*1e3,A=15e3,E="https://registry.npmjs.org/-/npm/v1/keys",m=()=>l(T(),"registry-keys"),c=()=>l(m(),"npmjs.json"),L=()=>{const e=c();if(d(e))try{const t=b(e),r=Date.now()-t.createdAt>t.ttlMs;return{entry:t,expired:r}}catch{f(e,{force:!0});return}},M=(e,t)=>{j(m());const r={createdAt:Date.now(),keys:e,ttlMs:t};k(c(),JSON.stringify(r),"utf8")},F=async(e={})=>{const t=e.ttlMs??C,r=e.keysUrl??process.env.VIS_NPM_KEYS_URL??E,s=L();if(s!==void 0&&!s.expired&&e.forceRefresh!==!0)return{fromCache:!0,keys:s.entry.keys};const n=new AbortController,h=setTimeout(()=>{n.abort()},A),i=()=>{n.abort()};e.signal?.addEventListener("abort",i,{once:!0});try{const a=await fetch(r,{headers:{Accept:"application/json"},signal:n.signal});if(!a.ok)return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0;const u=await a.json(),y=Array.isArray(u.keys)?u.keys:[];return M(y,t),{fromCache:!1,keys:y}}catch{return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0}finally{clearTimeout(h),e.signal?.removeEventListener("abort",i)}},P=()=>{const e=c();return d(e)?(f(e,{force:!0}),!0):!1};export{P as c,F as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as d,m as E,c as b}from"./index-DHD8wb6Z.js";import{y as u}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";const g={id:"bun",label:"Bun",lockfiles:["bun.lock","bun.lockb"],scriptSource:"package.json"},R={id:"node",label:"Node.js",lockfiles:["pnpm-lock.yaml","yarn.lock","package-lock.json","npm-shrinkwrap.json"],scriptSource:"package.json"},l={bun:g,node:R},a=["node","bun"],i={"deno.lock":"deno"},j=a.flatMap(n=>l[n].lockfiles.map(e=>[e,n])),p="Deno is not supported yet (deferred — see rfc/design-runtime-multitool.md).",s=(n,e)=>{if(n==="node"||n==="bun")return n;throw n in i||n==="deno"?new Error(`${e} requested runtime "${n}", but ${p}`):new Error(`${e} requested unknown runtime "${n}". Supported: ${a.join(", ")}.`)},D=n=>{let e=n;for(;;){for(const[o,t]of j)if(u(d(e,o)))return{runtime:t};for(const o of Object.keys(i))if(u(d(e,o)))return{deferred:i[o]};const r=E(e);if(r===e||b(e).root===e)return{};e=r}},$=(n,e={})=>{const r=e.env??process.env,o=(f,m,k)=>({adapter:l[f],deferredNotice:k,runtime:f,source:m});if(e.flag!==void 0&&e.flag!=="")return o(s(e.flag,"--runtime"),"flag");const t=r.VIS_RUNTIME;if(t!==void 0&&t!=="")return o(s(t,"VIS_RUNTIME"),"env");if(e.config!==void 0)return o(s(e.config,"config runtime:"),"config");const c=D(n);return c.runtime!==void 0?o(c.runtime,"lockfile"):c.deferred!==void 0?o("node","default",`Detected a ${c.deferred} project but ${p} Falling back to node.`):o("node","default")};export{$ as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as O}from"node:module";import{e as i,m as p}from"./index-DHD8wb6Z.js";import{p as E}from"./augment-COAiXSIx.js";let h;const y=s=>(h??=O(import.meta.url))(s),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=s=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[e,r]=c.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return c.getBuiltinModule(s)}return y(s)},{spawnSync:u}=d("node:child_process"),{existsSync:l}=d("node:fs"),b=s=>{let e=s;for(;;){const r=i(e,".pnp.cjs");if(l(r)){const o=i(e,".pnp.loader.mjs");return{esmLoader:l(o)?o:void 0,pnpCjs:r}}const t=p(e);if(t===e)return;e=t}},x=s=>{const e=b(s);if(e===void 0)return[];const r=["--require",e.pnpCjs];return e.esmLoader!==void 0&&r.push("--import",e.esmLoader),r},I=[{flag:"--enable-source-maps",key:"sourcemaps",min:[22,0]},{flag:"--experimental-sqlite",key:"sqlite",min:[22,5]},{flag:"--experimental-webstorage",key:"webstorage",min:[22,4]},{flag:"--experimental-eventsource",key:"eventsource",min:[22,3]},{flag:"--experimental-websocket",key:"websocket",max:[21,999],min:[20,10]},{flag:"--experimental-vm-modules",key:"vm-modules",min:[22,0]}],P=[22,4],j=s=>{const[e,r]=s.split(".").map(t=>Number.parseInt(t,10));return[e??0,r??0]},f=(s,e)=>s[0]>e[0]||s[0]===e[0]&&s[1]>=e[1],T=(s,e)=>s[0]<e[0]||s[0]===e[0]&&s[1]<=e[1],L=(s,e)=>f(s,e.min)&&(e.max===void 0||T(s,e.max)),A=s=>{const e=s.trim().toLowerCase();return e===""||e==="all"||e==="1"||e==="true"},m=(s,e)=>A(s)||s.split(",").some(r=>r.trim().toLowerCase()===e),g=(s,e,r)=>{const t=j(e),o=[];for(const n of I)m(s,n.key)&&L(t,n)&&o.push(n.flag);return m(s,"localstorage")&&f(t,P)&&(o.includes("--experimental-webstorage")||o.push("--experimental-webstorage"),o.push(`--localstorage-file=${r}`)),o},v="VIS_X_REEXEC",C=(s,e,r)=>{const t={...process.env},o=i(p(process.argv[1]),"runtime","preload.js");if(t.NODE_OPTIONS){const a=t.NODE_OPTIONS.replace(`--import ${JSON.stringify(o)}`,"").replace(`--import ${o}`,"").replaceAll(/\s+/gu," ").trim();a===""?delete t.NODE_OPTIONS:t.NODE_OPTIONS=a}delete t.VIS_AUGMENT_SUBPROCESS,delete t.VIS_UNFLAG,delete t.VIS_POLYFILL;const n=u(process.execPath,[s,...e],{cwd:r,env:t,stdio:"inherit"});if(n.error)throw n.error;return n.status??(n.signal===null?0:1)},_=s=>{let e=s;for(;;){if(l(i(e,"package.json"))||l(i(e,".pnp.cjs")))return i(e,".vis","localstorage");const r=p(e);if(r===e)return i(s,".vis","localstorage");e=r}},R=s=>{const e=process.env.VIS_UNFLAG;return[...e===void 0?[]:g(e,process.versions.node,_(s)),...x(s)]},U=(s,e,r)=>{const t=u("bun",["run",s,...e],{cwd:r,stdio:"inherit"});if(t.error)throw t.error.code==="ENOENT"?new Error("Runtime is set to bun but the `bun` binary is not on PATH. Install it from https://bun.sh."):t.error;return t.status??(t.signal===null?0:1)},k=(s,e,r,t)=>{const o=u(process.execPath,[...s,process.argv[1],"x",e,...r],{cwd:t,env:{...process.env,[v]:"1"},stdio:"inherit"});return o.status??(o.signal===null?0:1)},w=async(s,e,r)=>{if(process.env[v]===void 0){const n=R(r);if(n.length>0)return k(n,s,e,r)}if(process.env.VIS_AUGMENT_SUBPROCESS!==void 0){const n=i(p(process.argv[1]),"runtime","preload.js"),a=process.env.VIS_UNFLAG,N=a===void 0?[]:g(a,process.versions.node,_(r)),S=[process.env.NODE_OPTIONS??"",...N,`--import ${JSON.stringify(n)}`].filter(Boolean);process.env.NODE_OPTIONS=S.join(" ").trim()}const{importTs:t}=await import("../packem_chunks/ts-loader.js").then(n=>n.t);await E(r);const o=process.argv;process.argv=[process.execPath,s,...e];try{await t(s)}finally{process.argv=o}return typeof process.exitCode=="number"?process.exitCode:0},B=async(s,e,r,t,o={})=>o.node?C(s,e,t):r==="bun"?U(s,e,t):w(s,e,t);export{B as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as f,z as d}from"./index-DHD8wb6Z.js";import{whichBin as m}from"#native";import{p as h}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";import{y as k}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";const v=s=>{for(const r of[".nvmrc",".node-version"]){const o=f(s,r);if(k(o))try{return d(o).trim().replace(/^v/,"")}catch{}}},l=(s,r)=>{const o=s.split(/[.\-+]/).map(n=>Number.parseInt(n,10)||0),a=r.split(/[.\-+]/).map(n=>Number.parseInt(n,10)||0),e=Math.max(o.length,a.length);for(let n=0;n<e;n++){const t=o[n]??0,i=a[n]??0;if(t!==i)return t-i}return 0},b=(s,r)=>{const o=r.trim();if(o===""||o==="*")return!0;const a=o.split(/\s+/).filter(Boolean);for(const e of a)if(e.startsWith(">=")){if(l(s,e.slice(2).trim())<0)return!1}else if(e.startsWith("<=")){if(l(s,e.slice(2).trim())>0)return!1}else if(e.startsWith(">")){if(l(s,e.slice(1).trim())<=0)return!1}else if(e.startsWith("<")){if(l(s,e.slice(1).trim())>=0)return!1}else if(/^\d/.test(e)){const n=s.split("."),t=e.split(".");for(const[i,c]of t.entries())if(c!==n[i])return!1}return!0},x=s=>{const r=[],o=f(s,"package.json");let a;try{a=h(o)}catch{return r}const e=process.versions.node;if(a.engines?.node){const t=a.engines.node;b(e,t)||r.push({actual:e,expected:t,kind:"node",message:`package.json engines.node requires ${t}, but the current Node.js is ${e}.`,severity:"error"})}const n=v(s);if(n){const[t,i]=n.split("."),[c,p]=e.split(".");(t!==c||i!==void 0&&i!==p)&&r.push({actual:e,expected:n,kind:"node",message:`.nvmrc pins Node ${n} but the current Node.js is ${e}. Run \`nvm use\` or switch runtimes.`,severity:"warning"})}if(a.packageManager){const[t,i]=a.packageManager.split("@"),c=(process.env.npm_config_user_agent??"").split(" ")[0]??"",[p,u]=c.split("/"),g=t==="aube"&&m("aube")!==null;p&&t&&p!==t?r.push({actual:p,expected:t,kind:"packageManager",message:`package.json packageManager pins ${a.packageManager} but the current invocation is ${c}. Install the correct package manager.`,severity:g?"warning":"error"}):u&&i&&u!==i&&r.push({actual:u,expected:i,kind:"packageManager",message:`package.json packageManager pins ${t}@${i} but the current invocation uses ${t}@${u}.`,severity:"warning"})}return r};export{x as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as X}from"node:module";import{X as j,b as T}from"./index.server-sXNQYpsl.js";import{e as A}from"./index-DHD8wb6Z.js";import{g as L}from"./formatBytes-BHAzNIrn-XohRrPdt.js";import{D as m,m as y}from"./provenance-BH80RHXx.js";import{g as E}from"./packument-DyuhH1Gz.js";import{c as w}from"../packem_chunks/cli-main.js";import{y as U}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as O}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";import{h as C}from"./writeFileSync-DJoHk3Ks-CgQ-VNNT.js";import{s as p}from"./index-B4AjSxHU.js";let Y;const Q=r=>(Y??=X(import.meta.url))(r),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$=r=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[e,t]=b.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return b.getBuiltinModule(r)}return Q(r)},{rmSync:D,writeFileSync:P}=$("node:fs"),{createHash:Z}=$("node:crypto"),{Resolver:ee}=$("node:dns/promises");class rr{entries=[];add(e){this.entries.push(e)}addMany(e){for(const t of e)this.entries.push(t)}all(){return this.entries}errors(){return this.entries.filter(e=>e.severity==="error")}warnings(){return this.entries.filter(e=>e.severity==="warning")}hasErrors(){return this.entries.some(e=>e.severity==="error")}hasWarnings(){return this.entries.some(e=>e.severity==="warning")}isEmpty(){return this.entries.length===0}size(){return this.entries.length}}const tr=r=>{if(r.length===0)return[];const e=[],t=r.filter(s=>s.severity==="error"),n=r.filter(s=>s.severity==="warning");if(t.length>0){e.push(j(`${String(t.length)} error${t.length===1?"":"s"}:`));for(const s of t)e.push(` ${j("✗")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${T("→")} ${s.suggestedAction}`)}if(n.length>0){t.length>0&&e.push(""),e.push(T(`${String(n.length)} warning${n.length===1?"":"s"}:`));for(const s of n)e.push(` ${T("⚠")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${T("→")} ${s.suggestedAction}`)}return e},nr=r=>({errors:r.filter(e=>e.severity==="error"),findings:[...r],summary:{errorCount:r.filter(e=>e.severity==="error").length,warningCount:r.filter(e=>e.severity==="warning").length},warnings:r.filter(e=>e.severity==="warning")}),re=1440*60*1e3,te=15e3,ne="https://api.github.com/repos",W=()=>A(L(),"archived-repo"),q=(r,e)=>A(W(),`${encodeURIComponent(r)}__${encodeURIComponent(e)}.json`),se=(r,e)=>{const t=q(r,e);if(U(t))try{const n=O(t);if(Date.now()-n.createdAt>n.ttlMs){D(t,{force:!0});return}return n}catch{D(t,{force:!0});return}},B=(r,e,t,n)=>{C(W());const s={createdAt:Date.now(),ttlMs:n,...t};P(q(r,e),JSON.stringify(s),"utf8")},oe=r=>{if(typeof r!="string"||r.trim()==="")return;const e=r.trim().replace(/^git\+/,""),t=/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(t)return{owner:t[1],repo:t[2]};const n=/^ssh:\/\/git@github\.com\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(n)return{owner:n[1],repo:n[2]};const s=/^https?:\/\/(?:www\.)?github\.com\/([^/]+)\/([^/?#]+?)(?:\.git)?\/?$/i.exec(e);if(s)return{owner:s[1],repo:s[2]}},ie=async(r,e,t,n)=>{const s=`${ne}/${encodeURIComponent(r)}/${encodeURIComponent(e)}`,l=new AbortController,o=setTimeout(()=>{l.abort()},te),i=()=>{l.abort()};n?.addEventListener("abort",i,{once:!0});const a={Accept:"application/vnd.github+json","User-Agent":"visulima-vis-marshall"};t!==void 0&&t!==""&&(a.Authorization=`Bearer ${t}`);try{const c=await fetch(s,{headers:a,signal:l.signal});if(c.status===404)return{kind:"missing"};if(!c.ok)return{kind:"transient-error"};const d=await c.json(),u=d.archived===!0,f=typeof d.archived_at=="string"?d.archived_at:void 0;return{archived:u,archivedAt:f,kind:"ok"}}catch{return{kind:"transient-error"}}finally{clearTimeout(o),n?.removeEventListener("abort",i)}},ae=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),sr=async(r,e={})=>{if(w("archivedRepo"))return[];const t=new Set(e.allowlist),n=e.cacheTtlMs??re,s=e.githubToken??process.env.GITHUB_TOKEN,l=e.concurrency??m,o=new Map,i=async(c,d)=>{const u=`${c}/${d}`;let f=o.get(u);return f===void 0&&(f=(async()=>{const h=se(c,d);if(h!==void 0)return h.missing===!0?{archived:!1,kind:"missing"}:{archived:h.archived,archivedAt:h.archivedAt,kind:"ok"};const v=await ie(c,d,s,e.signal);return v.kind==="missing"?B(c,d,{archived:!1,missing:!0},n):v.kind==="ok"&&B(c,d,{archived:v.archived===!0,archivedAt:v.archivedAt},n),v})(),o.set(u,f)),f};return(await y(r,l,async({name:c,version:d})=>{if(t.has(c))return;const u=await E(c,{workspaceRoot:e.workspaceRoot});if(u===void 0)return;const f=u.versions[d]??u.versions[ae(Object.keys(u.versions),u["dist-tags"]?.latest)??""];if(f===void 0)return;const h=oe(f.repository?.url);if(h===void 0)return;const v=await i(h.owner,h.repo);if(v.kind!=="transient-error"){if(v.kind==="missing")return{kind:"missing-repo",owner:h.owner,packageName:c,repo:h.repo};if(v.archived===!0)return{...v.archivedAt===void 0?{}:{archivedAt:v.archivedAt},kind:"archived",owner:h.owner,packageName:c,repo:h.repo}}})).filter(c=>c!==void 0)},ce={dormantErrorDays:274,dormantWarnDays:183,newPublisherWindowDays:21,recentVersionErrorDays:7,recentVersionWarnDays:30},de=1440*60*1e3,F=(r,e)=>(r-e)/de,_=r=>{if(r!==void 0)return r.email??r.name},ue=(r,e,t,n,s)=>{const l=r.time?.[t];if(l===void 0)return;const o=new Date(l).getTime();if(!Number.isFinite(o))return;const i=F(n,o);if(i<s.recentVersionErrorDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (error threshold: ${String(s.recentVersionErrorDays)})`,packageName:e,severity:"error",version:t};if(i<s.recentVersionWarnDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (warn threshold: ${String(s.recentVersionWarnDays)})`,packageName:e,severity:"warning",version:t}},le=(r,e,t,n,s)=>{const l=r.versions[t],o=_(l?._npmUser);if(o===void 0)return;const a=Object.keys(r.versions).filter(h=>p.valid(h)!==null).filter(h=>p.lt(h,t));if(a.length===0||a.some(h=>_(r.versions[h]?._npmUser)===o))return;const d=r.time?.[a[0]??""];if(d===void 0)return;const u=new Date(d).getTime();if(!Number.isFinite(u))return;const f=F(n,u);if(!(f<=s.newPublisherWindowDays))return{kind:"new-publisher",message:`first publish by ${o} on a ${f.toFixed(0)}-day-old package`,packageName:e,severity:"error",version:t}},fe=(r,e,t,n,s)=>{const l=r.versions[t],o=_(l?._npmUser);if(o===void 0)return;const i=[];for(const[d,u]of Object.entries(r.versions)){if(d===t||_(u._npmUser)!==o)continue;const f=r.time?.[d];if(f===void 0)continue;const h=new Date(f).getTime();Number.isFinite(h)&&i.push(h)}if(i.length===0)return;const a=Math.max(...i),c=F(n,a);if(c>=s.dormantErrorDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${c.toFixed(0)} days ago (error threshold: ${String(s.dormantErrorDays)})`,packageName:e,severity:"error",version:t};if(c>=s.dormantWarnDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${c.toFixed(0)} days ago (warn threshold: ${String(s.dormantWarnDays)})`,packageName:e,severity:"warning",version:t}},or=async(r,e={})=>{if(w("author"))return[];const t=new Set(e.allowlist),n={...ce,...e.thresholds},s=e.now??(()=>Date.now()),l=e.concurrency??m;return(await y(r,l,async({name:i,version:a})=>{if(t.has(i))return[];const c=await E(i,{cacheTtlMs:e.cacheTtlMs,signal:e.signal,workspaceRoot:e.workspaceRoot});if(c===void 0)return[];const d=s(),u=[],f=ue(c,i,a,d,n);f!==void 0&&u.push(f);const h=le(c,i,a,d,n);h!==void 0&&u.push(h);const v=fe(c,i,a,d,n);return v!==void 0&&u.push(v),u})).flat()},he=1440*60*1e3,ve=15e3,ge=20,pe=1e4,me="https://api.npmjs.org/downloads/point/last-month",G=()=>A(L(),"downloads"),J=r=>A(G(),`${encodeURIComponent(r)}.json`),ye=r=>{const e=J(r);if(U(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){D(e,{force:!0});return}return t.downloads}catch{D(e,{force:!0});return}},we=(r,e,t)=>{C(G());const n={createdAt:Date.now(),downloads:e,observedAt:new Date().toISOString(),ttlMs:t};P(J(r),JSON.stringify(n),"utf8")},ke=async(r,e)=>{const t=`${me}/${encodeURIComponent(r)}`,n=new AbortController,s=setTimeout(()=>{n.abort()},ve),l=()=>{n.abort()};e?.addEventListener("abort",l,{once:!0});try{const o=await fetch(t,{signal:n.signal});if(o.status===404)return{kind:"no-data"};if(!o.ok)return{kind:"error"};const i=await o.json();return typeof i.downloads=="number"?{downloads:i.downloads,kind:"ok"}:{kind:"no-data"}}catch{return{kind:"error"}}finally{clearTimeout(s),e?.removeEventListener("abort",l)}},ir=async(r,e={})=>{if(w("downloads"))return[];const t=new Set(e.allowlist),n=e.errorThreshold??ge,s=e.warnThreshold??pe,l=e.cacheTtlMs??he,o=e.concurrency??m;return(await y(r,o,async a=>{if(t.has(a))return;let d=ye(a);if(d===void 0){const u=await ke(a,e.signal);if(u.kind==="no-data"||u.kind==="error")return{downloadsLastMonth:void 0,kind:"no-data",packageName:a,severity:"warning"};d=u.downloads??0,we(a,d,l)}if(d<n)return{downloadsLastMonth:d,kind:"below-error",packageName:a,severity:"error"};if(d<s)return{downloadsLastMonth:d,kind:"below-warning",packageName:a,severity:"warning"}})).filter(a=>a!==void 0)},De=1440*60*1e3,Ae=4e3,Ee=["1.1.1.1","8.8.8.8"],K=()=>A(L(),"expired-domains"),z=r=>{const e=Z("sha256").update(r).digest("hex").slice(0,12);return A(K(),`${e}.json`)},be=r=>{const e=z(r);if(U(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){D(e,{force:!0});return}return t}catch{D(e,{force:!0});return}},Re=(r,e,t)=>{C(K());const n={createdAt:Date.now(),outcome:e,ttlMs:t};P(z(r),JSON.stringify(n),"utf8")},Te=r=>{if(typeof r!="string")return;const e=r.lastIndexOf("@");if(e===-1||e===r.length-1)return;const t=r.slice(e+1).trim().toLowerCase();return t===""?void 0:t},_e=(r,e)=>{const t=[];e!==void 0&&t.push(e);for(const n of r??[])t.push(n);return t},Me=async(r,e)=>{let t;try{return await Promise.race([r,new Promise((n,s)=>{t=setTimeout(()=>{s(new Error("ETIMEDOUT"))},e)})])}finally{t!==void 0&&clearTimeout(t)}},Se=r=>{if(r===null||typeof r!="object")return!1;const{code:e}=r;return e==="ENOTFOUND"||e==="ENODATA"||e==="NXDOMAIN"},$e=async(r,e,t)=>{try{const n=await Me(r.resolveNs(e),t);return Array.isArray(n)&&n.length>0?{kind:"ok"}:{kind:"expired"}}catch(n){return Se(n)?{kind:"expired"}:{kind:"transient-error"}}},Pe=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),ar=async(r,e={})=>{if(w("expiredDomains"))return[];const t=new Set(e.allowlist),n=new Set((e.allowDomains??[]).map(f=>f.toLowerCase())),s=e.cacheTtlMs??De,l=e.perDomainTimeoutMs??Ae,o=e.dnsServers??Ee,i=e.concurrency??m,a=e.createResolver===void 0?new ee:e.createResolver();typeof a.setServers=="function"&&a.setServers(o);const c=new Map,d=async f=>{let h=c.get(f);return h===void 0&&(h=(async()=>{const v=be(f);if(v!==void 0)return{kind:v.outcome==="ok"?"ok":"expired"};const g=await $e(a,f,l);return g.kind!=="transient-error"&&Re(f,g.kind,s),g})(),c.set(f,h)),h};return(await y(r,i,async({name:f,version:h})=>{if(t.has(f))return[];const v=await E(f,{workspaceRoot:e.workspaceRoot});if(v===void 0)return[];const g=v.versions[h]??v.versions[Pe(Object.keys(v.versions),v["dist-tags"]?.latest)??""];if(g===void 0)return[];const M=_e(g.maintainers,g._npmUser),N=new Set,S=[];for(const R of M){const k=Te(R.email);if(k===void 0||n.has(k))continue;const I=`${k}:${R.email??""}`;if(N.has(I))continue;N.add(I);const x=await d(k);x.kind==="expired"?S.push({domain:k,kind:"expired",maintainer:R.email??"",packageName:f,severity:"error"}):x.kind==="transient-error"&&S.push({domain:k,kind:"unresolved",maintainer:R.email??"",packageName:f,severity:"warning"})}return S})).flat()},Le=["readme","license","repo"],Ue=["ERROR: No README data found!","# Security holding package"],Oe=r=>{const e=r.trim();return e===""?!0:Ue.some(t=>e.startsWith(t))},Ce=(r,e)=>{if(typeof e.readme=="string")return e.readme;if(typeof r.readme=="string")return r.readme},Fe=(r,e)=>{const t=Ce(r,e);if(t===void 0)return"missing-readme";if(Oe(t))return"placeholder-readme"},Ne=r=>{const{license:e}=r;return e===void 0?"missing-license":typeof e=="string"?e.trim()===""?"missing-license":void 0:typeof e.type=="string"&&e.type.trim()!==""?void 0:"missing-license"},Ie=r=>{const{repository:e}=r;if(e===void 0)return"missing-repo";const t=typeof e.url=="string"?e.url.trim():"";if(t==="")return"missing-repo";let n=t.replace(/^git\+/,"");const s=/^git@([^:]+):(.+?)(?:\.git)?$/.exec(n);return s&&(n=`https://${s[1]}/${s[2]}`),URL.canParse(n)?void 0:"invalid-repo-url"},xe=r=>{const e=r["dist-tags"]?.latest;return e!==void 0&&Object.hasOwn(r.versions,e)?e:Object.keys(r.versions).at(-1)},cr=async(r,e={})=>{if(w("metadata"))return[];const t=new Set(e.allowlist),n=new Set(e.checks??Le),s=e.concurrency??m;return(await y(r,s,async({name:o,version:i})=>{if(t.has(o))return;const a=await E(o,{workspaceRoot:e.workspaceRoot});if(a===void 0)return;const c=a.versions[i]??a.versions[xe(a)??""];if(c===void 0||c.private===!0)return;const d=[];if(n.has("readme")){const u=Fe(a,c);u!==void 0&&d.push(u)}if(n.has("license")){const u=Ne(c);u!==void 0&&d.push(u)}if(n.has("repo")){const u=Ie(c);u!==void 0&&d.push(u)}if(d.length!==0)return{issues:d,packageName:o,version:i}})).filter(o=>o!==void 0)},H=(r,e)=>r===void 0?{}:typeof r=="string"?{[e.startsWith("@")?e.split("/").at(1)??e:e]:r}:{...r},je=(r,e)=>p.valid(e)?Object.keys(r.versions).filter(n=>p.valid(n)!==null&&p.lt(n,e)).sort((n,s)=>p.lt(n,s)?1:-1)[0]:void 0,dr=async(r,e={})=>{if(w("newBin"))return[];const t=new Set(e.allowlist),n=new Set(e.allowBins),s=e.concurrency??m;return(await y(r,s,async({name:o,version:i})=>{if(t.has(o))return;const a=await E(o,{workspaceRoot:e.workspaceRoot});if(a===void 0)return;const c=a.versions[i];if(c===void 0)return;const d=je(a,i);if(d===void 0)return;const u=a.versions[d];if(u===void 0)return;const f=H(c.bin,o),h=H(u.bin,o),v=Object.entries(f).filter(([g])=>!(g in h)).filter(([g])=>!n.has(g)).map(([g,M])=>({command:M,name:g}));if(v.length!==0)return{fromVersion:d,newBins:v,packageName:o,toVersion:i}})).filter(o=>o!==void 0)},Be=["preinstall","install","postinstall"],V=(r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,He=(r,e)=>{if(p.valid(e)!==null)return Object.keys(r.versions).filter(t=>p.valid(t)!==null&&p.prerelease(t)===null&&p.lt(t,e)).sort((t,n)=>p.lt(t,n)?1:-1)[0]},Ve=(r,e)=>{const t=r??{},n=e??{},s=[];for(const l of Be){const o=t[l];if(o===void 0||o==="")continue;const i=n[l];i===void 0||i===""?s.push({command:o,hook:l,kind:"introduced"}):i!==o&&s.push({command:o,hook:l,kind:"changed"})}return s},ur=async(r,e={})=>{if(w("s1ngularity"))return[];const t=new Set(e.allowlist),n=e.concurrency??m;return(await y(r,n,async({name:l,version:o})=>{if(t.has(l))return;const i=await E(l,{workspaceRoot:e.workspaceRoot});if(i?.versions[o]===void 0)return;const a=He(i,o);if(a===void 0||!V(i,a)||V(i,o))return;const c=Ve(i.versions[o]?.scripts,i.versions[a]?.scripts);if(c.length!==0)return{hookChanges:c,packageName:l,priorVersion:a,trustSignal:"provenance-dropped",version:o}})).filter(l=>l!==void 0)};export{rr as M,ur as a,dr as b,cr as c,ir as d,ar as e,sr as f,nr as g,tr as h,or as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as r,y as K,m as S}from"../packem_chunks/catalog.js";import{W as h}from"./getRandomSpinner-4ZEcbTYv-DCyIuj19.js";import{m as T}from"../packem_chunks/cli-main.js";const R=100,j=2147483647,l={delta:0,frame:0,time:0};function k(s){const{interval:i=R,isActive:e=!0}=s??{},t=L(i),{renderThrottleMs:c,subscribe:v}=r.useContext(T),[n,A]=r.useState(0),[M,p]=r.useState(l),o=r.useRef(0),f=r.useRef(0),y=r.useRef({isActive:e,resetKey:n,safeInterval:t}),m=y.current,E=e&&(t!==m.safeInterval||!m.isActive||n!==m.resetKey),b=r.useCallback(()=>{A(u=>u+1)},[]);return r.useLayoutEffect(()=>{if(!e)return;p(l);let u=0;const{startTime:d,unsubscribe:I}=v(a=>{if(c>0&&a<o.current)return;const x=a-u,C=a-f.current;f.current=a,o.current=a+c,p({delta:C,frame:Math.floor(x/t),time:x})},t);return u=d,f.current=d,o.current=u+c,I},[t,e,v,c,n]),r.useLayoutEffect(()=>{y.current={isActive:e,resetKey:n,safeInterval:t}},[e,t,n]),E?{...l,reset:b}:{...M,reset:b}}function L(s){return Number.isFinite(s)?Math.min(j,Math.max(1,s)):R}function D({type:s="dots"}){const i=h(s)??h("dots"),e=i?.frames??[" "],{frame:t}=k({interval:i?.interval??80});return K.jsx(S,{children:e[t%e.length]})}export{D as l};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as b}from"node:module";import{v as m,e as _,z as C}from"./index-DHD8wb6Z.js";import{y as T}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";let g;const y=e=>(g??=b(import.meta.url))(e),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[s,r]=h.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return h.getBuiltinModule(e)}return y(e)},{platform:S}=I("node:os"),k={server:{cache:!1,interactive:!1,persistent:!0,runInCI:!1},utility:{cache:!1,runInCI:!1}},A=e=>{const s=e.preset??e.options?.preset;if(!s)return e;const r=k[s];if(!r)return e;const{cache:t,...n}=r;return{...e,cache:e.cache??t,options:{...n,...e.options}}},v=()=>{const e=S();return e==="darwin"?"macos":e==="win32"?"windows":"linux"},D=(e,s)=>{if(!s||s.size===0)return!0;const r=e?.runnerTags;return!r||r.length===0?!0:r.some(t=>s.has(t))},E=(e,s,r=!0)=>{const t=e?.runInCI??!0;return t===!0||t==="always"?!0:t===!1?!s:t==="affected"?!s||r:!0},N=(e,s,r)=>r||!s?e:m(s)?s:_(e,s),O=(e,s)=>{if(s===!1)return{};const r=s===!0?P(process.env.NODE_ENV):Array.isArray(s)?s:[s],t={};for(const n of r)Object.assign(t,$(e,n,t));return t},w=(e,s)=>{const r=n=>{const c=s[n];return c!==void 0?c:process.env[n]??""};let t="";for(let n=0;n<e.length;n+=1){const c=e[n];if(c==="\\"&&e[n+1]==="$"){t+="$",n+=1;continue}if(c!=="$"){t+=c;continue}const u=e[n+1];if(u==="{"){let i=1,l=n+2;for(;l<e.length;){const d=e[l];if(d==="}"){if(i-=1,i===0)break}else d==="{"&&e[l-1]==="$"&&(i+=1);l+=1}if(i!==0){t+=e.slice(n);break}const a=l,o=e.slice(n+2,a),f=o.indexOf(":-");if(f===-1)t+=r(o);else{const d=o.slice(0,f),x=o.slice(f+2),p=s[d]??process.env[d];t+=p!==void 0&&p!==""?p:w(x,s)}n=a;continue}if(u!==void 0&&/[A-Z_]/i.test(u)){let i=n+1;for(;i<e.length&&/\w/.test(e[i]);)i+=1;t+=r(e.slice(n+1,i)),n=i-1;continue}t+=c}return t},P=e=>{const s=[".env"];return e&&s.push(`.env.${e}`),e!=="test"&&s.push(".env.local"),e&&e!=="test"&&s.push(`.env.${e}.local`),s},$=(e,s,r={})=>{const t=m(s)?s:_(e,s);if(!T(t))return{};let n;try{n=C(t)}catch{return{}}const c={};for(const u of n.split(/\r?\n/)){const i=u.trim();if(i===""||i.startsWith("#"))continue;const l=i.indexOf("=");if(l===-1)continue;const a=i.slice(0,l).trim();if(a==="")continue;let o=i.slice(l+1).trim();const f=o.length>=2&&o.startsWith("'")&&o.endsWith("'");(o.startsWith('"')&&o.endsWith('"')||f)&&(o=o.slice(1,-1)),f||(o=w(o,{...r,...c})),c[a]=o}return c},z=(e,s=v())=>{if(e)return s==="windows"&&e.windowsShell?e.windowsShell:(s==="linux"||s==="macos")&&e.unixShell?e.unixShell:e.shell},B=e=>{if(e==="run")return!1;if(e==="build"||e==="test")return!0};export{z as a,A as b,B as c,v as d,O as l,D as m,N as r,E as s};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{createRequire as z}from"node:module";import{e as p,b as H,z as M}from"./index-DHD8wb6Z.js";import{y as v}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as A}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";let B;const D=e=>(B??=z(import.meta.url))(e),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=e=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[n,t]=k.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return k.getBuiltinModule(e)}return D(e)},{execFileSync:P}=T("node:child_process"),{randomBytes:L}=T("node:crypto"),{writeFileSync:V,renameSync:q,unlinkSync:R}=T("node:fs"),{delimiter:U}=T("node:path"),J=["proto","mise","fnm","volta","asdf","nvm","corepack"],G={asdf:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],corepack:["npm","pnpm","yarn"],fnm:["node"],mise:["aube","bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],nvm:["node"],proto:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],volta:["node","npm","pnpm","yarn"]},Z=["proto","mise","fnm","volta","asdf","nvm","corepack"],O={asdf:[".tool-versions"],corepack:[],fnm:[".nvmrc",".node-version"],mise:[".mise.toml",".config/mise.toml","mise.toml"],nvm:[".nvmrc"],proto:[".prototools"],volta:[]},y=new Map,b=e=>{const n=y.get(e);if(n!==void 0||y.has(e))return n;const t=process.env.PATH;if(!t){y.set(e,void 0);return}const o=process.platform==="win32"?["",...(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";")]:[""];for(const i of t.split(U)){const c=i.replaceAll(/^["']|["']$/g,"").trim();if(c!=="")for(const s of o){const a=`${c}${H}${e}${s}`;if(v(a))return y.set(e,a),a}}y.set(e,void 0)},S=(e,n=["--version"])=>{try{const t=P(e,n,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}),r=/\d+\.\d+(?:\.\d+)?/.exec(t);return r?r[0]:t.trim()||void 0}catch{return}},j=(e,n)=>{const t=p(e,"package.json");if(!v(t))return[];try{const o=A(t)[n];if(n==="volta"&&typeof o=="object"&&o!==null&&Object.keys(o).length>0)return["package.json"];if(n==="packageManager"&&typeof o=="string"&&o.length>0)return["package.json"]}catch{}return[]},X=(e,n)=>e==="volta"?j(n,"volta"):e==="corepack"?j(n,"packageManager"):O[e].filter(t=>v(p(n,t))),x=new Map,Y=()=>{x.clear(),y.clear()},N=(e,n)=>{{const i=x.get(e);if(i)return i}const t=[],r=!!b("pnpm")||!!b("yarn");for(const i of Z){const c=i==="nvm"?void 0:b(i),s=i==="nvm"&&!!process.env.NVM_DIR,a=X(i,e),l=!!c||s;i==="corepack"&&!l&&(!(a.length>0)||r)||!l&&a.length===0||t.push({binPath:c,configFiles:a,installed:l,name:i,version:c?S(c):void 0})}const o=Object.freeze(t);return x.set(e,o),o},$n=(e,n,t)=>{const r=N(e);return n?.preferredManager&&n.preferredManager!=="none"?r.find(o=>o.name===n.preferredManager)??{configFiles:[],installed:!1,name:n.preferredManager}:r.find(o=>o.installed&&o.configFiles.length>0)??r.find(o=>o.installed)??r.find(o=>o.configFiles.length>0)??{configFiles:[],installed:!1,name:"none"}},K=(e,n)=>{for(const t of n){const r=p(e,t);if(v(r))try{const o=M(r).trim();if(o!=="")return{name:t,value:o.replace(/^v/,"")}}catch{}}},Q=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,nn=e=>{const n=p(e,".prototools");if(!v(n))return[];const t=M(n),r=[];let o=!1;for(const i of t.split(/\r?\n/)){const c=i.trim();if(c===""||c.startsWith("#"))continue;if(c.startsWith("[")){o=!0;continue}if(o)continue;const s=Q.exec(c);if(!s)continue;const[,a,l]=s,f=g(a);f&&r.push({source:".prototools",tool:f,version:l.trim()})}return r},en=/^\[tools\]\s*$/i,tn=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,on=e=>{for(const n of O.mise){const t=p(e,n);if(!v(t))continue;const r=[],o=M(t);let i=!1;for(const c of o.split(/\r?\n/)){const s=c.trim();if(s===""||s.startsWith("#"))continue;if(s.startsWith("[")){i=en.test(s);continue}if(!i)continue;const a=tn.exec(s);if(!a)continue;const[,l,f]=a,d=g(l);d&&r.push({source:".mise.toml",tool:d,version:f.trim()})}if(r.length>0)return r}return[]},rn=e=>{const n=p(e,".tool-versions");if(!v(n))return[];const t=M(n),r=[];for(const o of t.split(/\r?\n/)){const i=o.trim();if(i===""||i.startsWith("#"))continue;const c=i.split(/\s+/);if(c.length<2)continue;const[s,...a]=c,l=g(s);l&&a[0]&&r.push({source:".tool-versions",tool:l,version:a[0]})}return r},g=e=>{switch(e.toLowerCase()){case"aube":return"aube";case"bun":return"bun";case"deno":return"deno";case"go":case"golang":return"go";case"node":case"nodejs":return"node";case"npm":return"npm";case"pnpm":return"pnpm";case"python":case"python3":return"python";case"ruby":return"ruby";case"rust":case"rustc":return"rust";case"yarn":return"yarn";default:return}},sn=e=>{const[n]=e.split("+",1),t=/^(pnpm|yarn|npm|bun)@(.+)$/.exec(n??"");if(!t)return;const r=g(t[1]);if(r)return{source:"packageManager",tool:r,version:t[2]}},an=(e,n)=>{const t=new Map,r=s=>{t.set(s.tool,s)},o=p(e,"package.json");let i={};try{v(o)&&(i=A(o))}catch{}if(i.engines)for(const[s,a]of Object.entries(i.engines)){const l=g(s);l&&typeof a=="string"&&r({source:"engines",tool:l,version:a})}if(i.packageManager){const s=sn(i.packageManager);s&&r(s)}if(i.volta)for(const[s,a]of Object.entries(i.volta)){const l=g(s);l&&typeof a=="string"&&r({source:"volta",tool:l,version:a})}const c=K(e,[".nvmrc",".node-version"]);c&&r({source:c.name===".nvmrc"?".nvmrc":".node-version",tool:"node",version:c.value});for(const s of rn(e))r(s);for(const s of on(e))r(s);for(const s of nn(e))r(s);if(n?.tools)for(const[s,a]of Object.entries(n.tools)){const l=g(s);l&&typeof a=="string"&&r({source:"vis.config.ts",tool:l,version:a})}return[...t.values()]},E={aube:{args:["--version"],binaries:["aube"]},bun:{args:["--version"],binaries:["bun"]},deno:{args:["--version"],binaries:["deno"]},go:{args:["version"],binaries:["go"]},node:{args:["--version"],binaries:["node"]},npm:{args:["--version"],binaries:["npm"]},pnpm:{args:["--version"],binaries:["pnpm"]},python:{args:["--version"],binaries:["python","python3"]},ruby:{args:["--version"],binaries:["ruby"]},rust:{args:["--version"],binaries:["rustc"]},yarn:{args:["--version"],binaries:["yarn"]}},F=e=>{const n=E[e];for(const t of n.binaries){const r=b(t);if(r)return S(r,n.args)}if(e==="node")return process.versions.node},W=(e,n)=>{const t=n.trim();if(t===""||t==="*"||t==="latest")return!0;if(/^\d[\d.]*$/.test(t))return e===t||e.startsWith(`${t}.`);const r=s=>s.split(/[.\-+]/).map(a=>Number.parseInt(a,10)||0),o=(s,a)=>{const l=r(s),f=r(a),d=Math.max(l.length,f.length);for(let h=0;h<d;h++){const $=l[h]??0,u=f[h]??0;if($!==u)return $-u}return 0},i=s=>{for(const a of s)if(a.startsWith(">=")){if(o(e,a.slice(2).trim())<0)return!1}else if(a.startsWith("<=")){if(o(e,a.slice(2).trim())>0)return!1}else if(a.startsWith(">")){if(o(e,a.slice(1).trim())<=0)return!1}else if(a.startsWith("<")){if(o(e,a.slice(1).trim())>=0)return!1}else if(a.startsWith("^")||a.startsWith("~")){const l=a.slice(1).trim(),[f,d]=r(l),[h,$]=r(e);if(h!==f||a.startsWith("~")&&$!==d||o(e,l)<0)return!1}return!0},c=t.split("||").map(s=>s.trim().split(/\s+/).filter(Boolean)).filter(s=>s.length>0);return c.length===0?!0:c.some(s=>i(s))},cn=(e,n)=>{switch(e){case".mise.toml":return["mise"];case".node-version":case".nvmrc":return["fnm","nvm","volta","proto","mise","asdf"];case".prototools":return["proto"];case".tool-versions":return["asdf","mise"];case"packageManager":return n==="pnpm"||n==="yarn"?["self-activate","volta","proto","mise","corepack"]:n==="npm"?["volta","proto","mise","asdf","corepack"]:n==="aube"?["mise"]:n==="bun"?["proto","mise","asdf"]:["volta","proto","mise"];case"volta":return["volta"];default:return["proto","mise","fnm","volta","asdf","nvm","corepack"]}},ln=(e,n,t)=>{if(t?.preferredManager&&t.preferredManager!=="none"&&_(t.preferredManager,e.tool)){const o=n.find(i=>i.name===t.preferredManager);return o?{installed:o.installed,name:o.name}:{installed:!1,name:t.preferredManager,note:`${t.preferredManager} is the preferred manager but isn't on PATH`}}const r=cn(e.source,e.tool);for(const o of r){if(o==="self-activate"){if((e.tool==="pnpm"||e.tool==="yarn")&&b(e.tool))return{installed:!0,name:"self-activate",note:`${e.tool} will activate ${e.version} from the packageManager field on next invocation`};continue}if(!_(o,e.tool))continue;if(n.find(c=>c.name===o)?.installed)return{installed:!0,name:o}}for(const o of r)if(!(o==="self-activate"||!_(o,e.tool)))return{installed:!1,name:o,note:`${o} can install ${e.tool} — run \`vis toolchain install\` after adding it to PATH`};return{installed:!1,name:"none",note:"No manager knows how to install this tool"}},_=(e,n)=>e==="none"?!1:e==="self-activate"?n==="pnpm"||n==="yarn":G[e].includes(n),fn=(e,n)=>{const t=N(e),o=an(e,n).map(i=>{const c=F(i.tool),s=c!==void 0&&W(c,i.version),a=ln(i,t,n);return{actual:c,expected:i,manager:a,matches:s}});return{detected:t,tools:o}},un=(e,n)=>{switch(e){case"asdf":return n?{args:["install",n.tool,n.version],bin:"asdf"}:void 0;case"corepack":return n?{args:["prepare",`${n.tool}@${n.version}`,"--activate"],bin:"corepack"}:{args:["prepare","--activate"],bin:"corepack",hint:"reads the packageManager field in package.json"};case"fnm":return n?.tool!=="node"?void 0:{args:["install",n.version],bin:"fnm"};case"mise":return n?{args:["install",`${n.tool}@${n.version}`],bin:"mise"}:void 0;case"none":return;case"nvm":return{args:[],bin:"nvm",hint:"nvm is a shell function — run `nvm install` / `nvm use` from your shell"};case"proto":return n?{args:["install",n.tool,n.version],bin:"proto"}:void 0;case"self-activate":return{args:[],bin:n?.tool??"pnpm",hint:`${n?.tool??"pnpm"} will self-activate on next invocation — no install needed`};case"volta":return n?{args:["install",`${n.tool}@${n.version}`],bin:"volta"}:{args:["install","node@lts"],bin:"volta",hint:"volta pins per-tool; specify <tool>@<version>"};default:{const t=e;throw new Error(`Unknown manager: ${t}`)}}},yn=(e,n)=>{switch(e){case"asdf":return{args:["local",n.tool,n.version],bin:"asdf",configChange:{file:".tool-versions",hint:`Pins ${n.tool} ${n.version}`}};case"corepack":return n.tool!=="npm"&&n.tool!=="pnpm"&&n.tool!=="yarn"?void 0:{args:["use",`${n.tool}@${n.version}`],bin:"corepack",configChange:{file:"package.json",hint:`Writes packageManager: "${n.tool}@${n.version}"`}};case"fnm":return n.tool==="node"?{args:["use",n.version],bin:"fnm"}:void 0;case"mise":return{args:["use","--",`${n.tool}@${n.version}`],bin:"mise",configChange:{file:".mise.toml",hint:`Pins ${n.tool} ${n.version}`}};case"none":return;case"nvm":return n.tool==="node"?{args:[],bin:"nvm",configChange:{file:".nvmrc",hint:"Write version to .nvmrc manually (nvm doesn't persist)."}}:void 0;case"proto":return{args:["pin",n.tool,n.version],bin:"proto",configChange:{file:".prototools",hint:`Pins ${n.tool} ${n.version}`}};case"self-activate":return{args:[],bin:n.tool,configChange:{file:"package.json",hint:`Set packageManager: "${n.tool}@${n.version}" — ${n.tool} will self-activate on next invocation`}};case"volta":return{args:["pin",`${n.tool}@${n.version}`],bin:"volta",configChange:{file:"package.json",hint:`Writes volta.${n.tool}`}};default:{const t=e;throw new Error(`Unknown manager: ${t}`)}}},Mn=e=>{for(const n of E[e].binaries){const t=b(n);if(t)return t}},wn=(e,n)=>{const t=E[n].binaries;if(e.installed&&e.binPath&&(e.name==="proto"||e.name==="mise"||e.name==="asdf"||e.name==="volta"||e.name==="fnm"))for(const r of t)try{const i=P(e.binPath,["which",r],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}).trim();if(i)return i}catch{}for(const r of t){const o=b(r);if(o)return o}},I=(e,n)=>{const t=`${e}.${process.pid}.${L(6).toString("hex")}.tmp`;V(t,n);try{q(t,e)}catch(r){try{R(t)}catch{}throw r}},dn=(e,n)=>{if("packageManager"in e)return e.packageManager=n,e;const t={};let r=!1;for(const[o,i]of Object.entries(e))!r&&(o==="dependencies"||o==="devDependencies"||o==="peerDependencies"||o==="optionalDependencies")&&(t.packageManager=n,r=!0),t[o]=i;return r||(t.packageManager=n),t},kn=(e,n)=>{if(n.tool!=="pnpm"&&n.tool!=="yarn"&&n.tool!=="npm"&&n.tool!=="bun")return;const t=p(e,"package.json");if(!v(t))throw new Error(`Cannot pin ${n.tool}: ${t} does not exist.`);const r=M(t),i=/\n([ \t]+)/.exec(r)?.[1]??" ";let c;try{c=JSON.parse(r)}catch(f){throw new Error(`${t} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${f.message}`,{cause:f})}const s=`${n.tool}@${n.version}`,a=dn(c,s),l=r.endsWith(`
|
|
2
|
-
`)?`
|
|
3
|
-
`:"";return I(t,`${JSON.stringify(a,void 0,i)}${l}`),s},Tn=(e,n)=>{const t=p(e,"package.json");if(!v(t))return;const r=M(t);let o;try{o=JSON.parse(r)}catch(a){throw new Error(`${t} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${a.message}`,{cause:a})}if(o.engines?.[n.tool]===void 0||o.engines[n.tool]===n.version)return;o.engines[n.tool]=n.version;const c=/\n([ \t]+)/.exec(r)?.[1]??" ",s=r.endsWith(`
|
|
4
|
-
`)?`
|
|
5
|
-
`:"";return I(t,`${JSON.stringify(o,void 0,c)}${s}`),n.version},Pn=e=>{const n=/^([a-z][\w-]*)@(.+)$/i.exec(e.trim());if(!n)return;const t=g(n[1]);if(t)return{source:"vis.config.ts",tool:t,version:n[2]}},mn=async(e,n,t)=>{const r=fn(e,n),o=r.tools.filter(f=>!f.matches);if(o.length===0)return{attempted:[],failed:[],upToDate:!0};const i=r.detected.some(f=>f.installed);if(!(n?.autoInstall??i))return{attempted:[],failed:[],upToDate:!1};const s=[],a=[],l=new Map;for(const f of o){const d=l.get(f.manager.name);d?d.push(f):l.set(f.manager.name,[f])}for(const[f,d]of l){if(f==="self-activate"){for(const{expected:u}of d)t.info(`toolchain: ${u.tool} ${u.version} will self-activate on next ${u.tool} invocation`),s.push(u);continue}if(f==="none"){for(const{expected:u}of d)a.push({error:`no manager can install ${u.tool} — install one of ${J.join(", ")}`,spec:u});continue}if(!r.detected.find(u=>u.name===f)?.installed){for(const{expected:u}of d)a.push({error:`${f} is not on PATH`,spec:u});continue}const $=d.map(u=>({invocation:un(f,u.expected),tool:u})).filter(u=>u.invocation!==void 0);for(const{invocation:u,tool:C}of $){const{expected:m}=C;if(u.bin==="nvm"&&u.args.length===0){const w=F(m.tool);if(w!==void 0&&W(w,m.version)){t.info(`toolchain: ${m.tool} ${w} already satisfies ${m.version}; skipping nvm shell activation`),s.push(m);continue}t.warn(`toolchain: nvm requires a shell-side activation for ${m.tool} ${m.version}. Run \`nvm install\` / \`nvm use\` manually.`),a.push({error:"nvm requires shell-side activation",spec:m});continue}t.info(`toolchain: $ ${u.bin} ${u.args.join(" ")}`);try{P(u.bin,u.args,{cwd:e,stdio:"inherit"}),s.push(m),f==="fnm"&&vn(u.bin,t)}catch(w){a.push({error:w.message,spec:m});break}}}return Y(),{attempted:s,failed:a,upToDate:!1}},_n=async(e,n,t,r=!1)=>{if(r)return;const o=await mn(e,n,t);for(const i of o.failed)t.warn(`toolchain: ${i.spec.tool} ${i.spec.version} — ${i.error}`)},vn=(e,n)=>{const t=process.platform==="win32"?"powershell":"bash";try{const r=P(e,["env","--shell",t],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3});for(const o of r.split(/\r?\n/)){const i=o.trim();if(i==="")continue;const c=/^\$env:([A-Z_]\w*)\s*=\s*(.+)$/i.exec(i);if(c){const[,l,f]=c;process.env[l]=f.replaceAll(/^["']|["']$/g,"");continue}const s=/^set\s+"?([A-Z_]\w*)=(.*?)"?$/i.exec(i);if(s){const[,l,f]=s;process.env[l]=f;continue}const a=/^(?:export\s+)?([A-Z_]\w*)=(.+)$/i.exec(i);if(a){const[,l,f]=a;process.env[l]=f.replaceAll(/^["']|["']$/g,"")}}}catch(r){n.warn(`toolchain: could not activate fnm env (${r.message}). Subsequent tasks may use the previous Node version.`)}};export{J as S,Pn as a,un as b,ln as c,yn as d,wn as e,N as f,fn as g,Mn as h,$n as p,_n as r,Tn as u,kn as w};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as $}from"node:module";import{X as j,b as k}from"./index.server-sXNQYpsl.js";import{e as D}from"./index-DHD8wb6Z.js";import{g as M}from"./_commonjsHelpers-DTfxOvZk.js";import{c as g,p as i}from"../packem_chunks/cli-main.js";import{y as A}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as R}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";let _;const z=e=>(_??=$(import.meta.url))(e),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=e=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[o,r]=l.versions.node.split(".").map(Number);if(o>22||o===22&&r>=3||o===20&&r>=16)return l.getBuiltinModule(e)}return z(e)},{createInterface:S}=T("node:readline");var B=["aj","aju","av","avj","ejv","jav","jv"],C=["angula","angular-node","angularjs"],E=["auto-prefixer"],L=["aaxios","aios","axio","axioos","axios-node","axioss","axis","axiso","axois","axos","axxios"],O=["abel","babbel","babe","babel-js","babel-node","babl","bable","bbael","bebel"],F=["bcrpyt","bcrypt-node","brcypt","crypt","dcrypt"],I=["bcryptjs-node","dcryptjs"],P=["bunan","bunya","bunyan-node","buynan"],U=["cai","cha","chaijs","chal","chi","chia","hai"],W=["cahlk","calk","cchalk","ch4lk","cha1k","chaalk","chaik","chak","chakl","chalk-node","chalkk","challk","chhalk","chlak","chlk","halk","hcalk"],V=["cheero","cherio"],X=["c0lor","ccolor","clor","colo","coloor","color-js","colorjs","colorr","colr","coolor","coolr"],J=["ccolors","colors-node","colorss","colorz","colrs","coolors"],Y=["c0mmander","ccommander","cmmander","cmomander","co-mmander","comamnder","comander","comm4nder","commaander","commader","commadner","commamder","command3r","commandder","commande","commandeer","commander-js","commanderr","commandr","commandre","commanedr","commaner","commannder","commender","commmander","commnader","commnder","coommander","ocmmander","ommander"],G=["cor","corss","cos","cosr","cros","crs","ors"],H=["days"],K=["d3bug","dbeug","dbug","ddebug","debbug","debg","debgu","debu","debu9","debug-js","debug-node","debugg","debugjs","debuug","deebug","deubg","deug","ebug","edbug"],Q=["dot-env","dotenv-node","dotenvjs","dotevn"],Z=["3lectron","eectron","eelctron","eelectron","el3ctron","elcetron","elctron","elecctron","elecron","elecrton","electon","electorn","electr0n","electrn","electrno","electro","electrom","electron-node","electronn","electroon","electrron","electtron","eleectron","eletcron","eletron","ellectron","lectron","leectron"],N=["asbuild","ebuild","esbuild-node","esbuildjs","ezbuild","sbuild"],ee=["aslint","elint","eslint-js","eslint-node","eslit","ezlint","slint"],oe=["eexpress","epress","epxress","experss","expess","exppress","expreess","expres","express-node","expressjs","expresss","exprress","exprses","exprss","exress","exrpess","exxpress","xepress","xpress"],se=["astify"],re=["firebasejs"],te=["form1dable"],ae=["glb","glo","glob-js","globjs","gob","golb","lob"],ce=["go","goot","gotjs","gott","gt","gto","ogt","ot","qot"],ne=["helmetjs","helnet"],ie=["homo","hon","hoo","hoon","ohno","ono"],de=["inquire","inquirer-js","nquirer"],le=["iredis"],me=["ejst","est","jast","jes","jestjs","jestt","jet","jets","jst"],pe=["imp","jim","jip","jmp"],ue=["ji","jio","jo","joii","jol","oi","oji"],he=["jdom","jsdm","jsdo","jsdom-js","jsdon","jsom","sdom"],ve=["jsonwebtoken-js","jsonwebtoken-node"],be=["ka","kao","ko","koaa","koajs","koe","oa","oka"],je=["1odash","iodash","l0dash","ldash","ldoash","llodash","lo-dash","loadsh","loash","lobash","lod4sh","lodaash","lodah","lodahs","lodas","lodash-node","lodashh","lodassh","loddash","lodesh","lodsah","lodsh","loodash","odash","oldash"],ke=["luca","luci","lucie"],fe=["luon","luxo","luxon-js"],ge=["imcromatch","mciromatch","micormatch","micrmoatch","micro-match","microamtch","micromacth","micromathc","micromtach","mircomatch"],ye=["minimath"],xe=["mcha","mmocha","moca","moch","mocha-js","moha","nocha","ocha"],we=["m0ment","mment","mmoent","mmoment","moemnt","moent","mom3nt","momeent","momemt","momen","momen7","momennt","moment-js","momentjs","momentt","momet","mometn","momment","momnet","momnt","monent","mooment","oment","omment"],qe=["mognoose","mogoose","mongoos","mongose","monqoose","moongoose"],$e=["moran","organ"],_e=["muler","multer-js","muter"],ze=["mysql"],Te=["ext","mext","n3xt","naxt","net","netx","nex","next-js","next-node","nextjs","nxt"],Se=["node-mailer","nodemailer-js"],De=["nodemo","nodemonjs","nodmeon"],Me=["oar","or","ora-node","ore","ra","roa"],Ae=["arcel","parce","parceljs"],Re=["passport-js"],Be=["phase","phaser-node"],Ce=["ino","pimo","pin","pino-node","pinojs","pio","pion"],Ee=["playright","playwright-js"],Le=["postcss-js","postcss-node","potscss"],Oe=["pettier","pprettier","pretier","prettierjs","prettierr","prtetier"],Fe=["prima","prism","prisma-js","prismajs","prizma"],Ie=["pupeteer"],Pe=["rada","rama","ramd","randa"],Ue=["eact","eract","r3act","raact","ract","raect","re4ct","reaact","reac","reac7","reacct","react-node","reactjs","reactt","reat","reatc","recat","rect","reeact","reect","rreact"],We=["erdis","radis","rdis","redi","redis-js","redis-node","rediss","rediz","reds","reis","rredis"],Ve=["resen","rsend"],Xe=["ollup","rollup-js","rollup-node"],Je=["ass","asss","sas","sass-node","sess","ssas","sss"],Ye=["emver","seemver","semver-node","semvre","senver","sever"],Ge=["sequelize-js","sequelize-node"],He=["harp","shap","shar","sharp-js","sharpjs"],Ke=["stipe","strip","stripe-node","tripe"],Qe=["supabase-js"],Ze=["suelte","svelt3","svelte-js","sveltejs","velte"],Ne=["tailwindcss-js"],eo=["auri","taui"],oo=["hree","htree","thee","there","three-js","three-node","tree"],so=["stx","sx","ts","tsxx","ttsx","tx","txs","tzx"],ro=["ttypescript","typecript","typescipt","typescript-node","typescriptjs","typescrit","typescritp"],to=["udnerscore","undercore","underscoer","underscore-node","underscroe","undersocre","undesrcore"],ao=["uid","uud","uudi","uui","uuid-js","uuid-node","uuidjs","vuid"],co=["ite","vie","vit","vita","vite-node","vitee","vlte","vte"],no=["itest","uitest","vitestjs","vitezt","vittest","vtest"],io=["ue","uue","uve","ve","veu","vu","vu3","vua","vue-node","vuee","vuejs","vuue","vve","vvue"],lo=["web-pack","weback","webpac","webpack-node","webpackjs","webpak","weebpack","wepack","wepback"],mo=["winson","winston-js","winstoon"],po=["up","uyp","yp","yu","yupjs","yupp"],uo=["od","zd","zdo","zo","zob","zod-js","zodjs"];const ho={ajv:B,angular:C,autoprefixer:E,"aws-sdk":["awssdk","ews-sdk"],axios:L,babel:O,bcrypt:F,bcryptjs:I,"body-parser":["body-paresr","body-parse","body-parser-js","body_parser"],bunyan:P,chai:U,chalk:W,cheerio:V,color:X,colors:J,commander:Y,"cookie-parser":["cookie-parse","cookieparser"],cors:G,"cross-env":["crossenv"],"date-fns":["data-fns","date-fn"],dayjs:H,debug:K,dotenv:Q,electron:Z,esbuild:N,eslint:ee,express:oe,fastify:se,firebase:re,formidable:te,glob:ae,got:ce,helmet:ne,hono:ie,inquirer:de,ioredis:le,jest:me,jimp:pe,joi:ue,jsdom:he,jsonwebtoken:ve,koa:be,lodash:je,lucia:ke,luxon:fe,micromatch:ge,minimatch:ye,mocha:xe,moment:we,mongoose:qe,morgan:$e,multer:_e,mysql2:ze,next:Te,"node-fetch":["node-fecth","node-fethc","node.fetch"],nodemailer:Se,nodemon:De,ora:Me,parcel:Ae,passport:Re,phaser:Be,pino:Ce,playwright:Ee,postcss:Le,prettier:Oe,prisma:Fe,puppeteer:Ie,ramda:Pe,react:Ue,"react-dom":["eact-dom","eract-dom","r3act-dom","ract-dom","raect-dom","re4ct-dom","reaact-dom","reac-dom","reac7-dom","reacct-dom","react-bom","react-d0m","react-ddom","react-dm","react-dmo","react-do","react-domm","react-don","react-doom","react-odm","react-om","react.dom","reactdom","reactt-dom","reat-dom","reatc-dom","recat-dom","rect-dom","reeact-dom","rreact-dom"],redis:We,resend:Ve,rollup:Xe,sass:Je,semver:Ye,sequelize:Ge,sharp:He,"socket.io":["ocket.io","oscket.io","scket.io","scoket.io","soccket.io","socekt.io","socet.io","sock3t.io","socke.io","socke7.io","sockeet.io","socket.1o","socket.i","socket.iio","socket.ioo","socket.lo","socket.o","socket.oi","sockett.io","sockket.io","sockt.io","sockte.io","sokcet.io","soket.io","soocket.io","ssocket.io"],stripe:Ke,supabase:Qe,svelte:Ze,tailwindcss:Ne,tauri:eo,three:oo,"ts-node":["tts-node"],tsx:so,typescript:ro,underscore:to,uuid:ao,vite:co,vitest:no,vue:io,webpack:lo,winston:mo,yup:po,zod:uo};var h,f;function vo(){return f||(f=1,h={"@tanstack/start":["start-tanstack-app","tanstack","tanstack-app","tanstack-start"]}),h}var bo=vo();const jo=M(bo),ko={a:["4","e"],b:["d"],d:["b"],e:["3","a"],g:["9","q"],i:["1","l"],l:["1","i"],m:["n"],n:["m"],o:["0"],s:["5","z"],t:["7"],u:["v"],v:["u"]},fo=["app","cli","core","kit","lib","pkg","sdk"],go=e=>{const o=new Set;if(e.length<3)return o;for(let s=0;s<e.length;s++){const a=e[s],c=a==="-"||a==="."||a==="_";if(c||o.add(e.slice(0,s)+e.slice(s+1)),c||o.add(e.slice(0,s)+a+e.slice(s)),s<e.length-1&&e[s]!==e[s+1]){const u=e[s+1]==="-"||e[s+1]==="."||e[s+1]==="_";if(!c&&!u){const d=[...e];[d[s],d[s+1]]=[d[s+1],d[s]],o.add(d.join(""))}}const n=e[s].toLowerCase(),b=ko[n];if(b)for(const u of b)o.add(e.slice(0,s)+u+e.slice(s+1))}const r=/[-._]/g;if(r.test(e))o.add(e.replaceAll(r,"")),o.add(e.replaceAll(r,"-")),o.add(e.replaceAll(r,".")),o.add(e.replaceAll(r,"_"));else if(e.length>5)for(let s=2;s<e.length-2;s++)o.add(`${e.slice(0,s)}-${e.slice(s)}`),o.add(`${e.slice(0,s)}.${e.slice(s)}`),o.add(`${e.slice(0,s)}_${e.slice(s)}`);if(e.startsWith("@")||(o.add(`${e}-js`),o.add(`${e}js`),o.add(`${e}-node`)),e.startsWith("@")){const s=e.indexOf("/");if(s>1&&s<e.length-1){const a=e.slice(1,s),c=e.slice(s+1);a.length>=3&&o.add(a);for(const n of["","-",".","_"])o.add(`${a}${n}${c}`),o.add(`${c}${n}${a}`);for(const n of fo)o.add(`${a}-${n}`),o.add(`${c}-${a}-${n}`),o.add(`${n}-${a}-${c}`)}}return o.delete(e),o};let v,p,m;const y=()=>{if(!v){const e={};for(const o of[ho,jo])for(const[r,t]of Object.entries(o)){const s=e[r]??(e[r]=[]);for(const a of t)s.includes(a)||s.push(a)}v=e}return v},yo=()=>{if(!p){p=new Map;for(const[e,o]of Object.entries(y()))for(const r of o)p.set(r,e)}return p},xo=()=>{if(!m){m=new Map;for(const e of Object.keys(y()))for(const o of go(e))m.has(o)||m.set(o,e)}return m},wo=e=>e.startsWith("@")?e.split("/")[1]??e:e,qo=e=>{const o=wo(e),r=yo().get(o);if(r)return{input:e,legitimate:r,method:"blocklist"};const t=xo().get(o);if(t)return{input:e,legitimate:t,method:"heuristic"}},x=(e,o)=>{const r=o?new Set(o):void 0,t=[];for(const s of e){if(r?.has(s))continue;const a=qo(s);a&&t.push(a)}return t},w=(e,o)=>{i.warn(""),i.warn(j(`Possible typosquat${e.length===1?"":"s"} ${o}:`));for(const r of e){const t=r.method==="blocklist"?"known typosquat":"similar name";i.warn(` ${k("⚠")} ${j(r.input)} — did you mean ${k(r.legitimate)}? (${t})`)}i.warn("")},q=async e=>{if(!process.stdin.isTTY){i.warn("Aborting: potential typosquat detected in non-interactive mode. Use --no-typosquat-check to skip.");return}const o=S({input:process.stdin,output:process.stdout}),r=await new Promise(t=>{o.question(e,s=>{t(s.trim().toLowerCase())})});return o.close(),r},Co=async(e,o)=>{if(g("typosquats"))return{ok:!0,packages:e};const r=x(e,o);if(r.length===0)return{ok:!0,packages:e};w(r,"detected");const t=await q(`Use suggested package${r.length===1?"":"s"} instead? [S]uggested / [y]es, keep original / [N]o, abort (default: N) `);if(t===void 0)return{ok:!1,packages:e};if(t==="s"||t==="suggested"){const s=new Map(r.map(c=>[c.input,c.legitimate]));return{ok:!0,packages:e.map(c=>s.get(c)??c)}}return t==="y"||t==="yes"?{ok:!0,packages:e}:{ok:!1,packages:e}},$o=/^(?:npm|pnpm|yarn):(.+?)(?:@.*)?$/,_o=e=>$o.exec(e)?.[1],zo=e=>{if(!A(e))return[];const o=R(e),r={...o.dependencies,...o.devDependencies,...o.optionalDependencies,...o.peerDependencies},t=new Set;for(const[s,a]of Object.entries(r)){t.add(s);const c=_o(a);c&&t.add(c)}return[...t]},Eo=async(e,o)=>{if(g("typosquats"))return!0;const r=D(e,"package.json"),t=zo(r);if(t.length===0)return!0;const s=x(t,o);if(s.length===0)return!0;w(s,"in package.json dependencies"),i.warn("Fix the package name in package.json before proceeding.");const a=await q("Continue anyway? [y/N] ");return a==="y"||a==="yes"};export{Co as r,Eo as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as y}from"node:module";import{e as o,z as f,l as b}from"./index-DHD8wb6Z.js";import{y as a}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";let u;const h=c=>(u??=y(import.meta.url))(c),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=c=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[t,e]=p.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return p.getBuiltinModule(c)}return h(c)},{readdirSync:j}=m("node:fs"),v=[".husky/pre-commit",".vis/hooks/pre-commit",".git/hooks/pre-commit"],_=[".secretlintrc",".secretlintrc.json",".secretlintrc.js",".secretlintrc.mjs",".secretlintrc.cjs",".secretlintrc.yml",".secretlintrc.yaml"],$=[".syncpackrc",".syncpackrc.json",".syncpackrc.yaml",".syncpackrc.yml",".syncpackrc.cjs",".syncpackrc.js",".syncpackrc.mjs",".syncpackrc.ts","syncpack.config.cjs","syncpack.config.js","syncpack.config.mjs","syncpack.config.ts"],w=c=>{const t=o(c,"package.json");if(!a(t))return[];let e;try{e=JSON.parse(f(t))}catch{return[]}const n=[];if(e.scripts)for(const[s,i]of Object.entries(e.scripts))typeof i=="string"&&(/\bgitleaks\b/.test(i)&&n.push({detail:`Script "${s}" still invokes gitleaks: ${i}`,kind:"script",location:"package.json",tool:"gitleaks"}),/\bsecretlint\b/.test(i)&&n.push({detail:`Script "${s}" still invokes secretlint: ${i}`,kind:"script",location:"package.json",tool:"secretlint"}),/\bsyncpack\b/.test(i)&&n.push({detail:`Script "${s}" still invokes syncpack: ${i}`,kind:"script",location:"package.json",tool:"syncpack"}),/\bsherif\b/.test(i)&&n.push({detail:`Script "${s}" still invokes sherif: ${i}`,kind:"script",location:"package.json",tool:"sherif"}));if(e.devDependencies)for(const s of Object.keys(e.devDependencies))(s==="gitleaks"||s==="@gitleaks/cli")&&n.push({detail:`devDependency \`${s}\` is still installed`,kind:"devDep",location:"package.json",tool:"gitleaks"}),(s==="secretlint"||s.startsWith("@secretlint/"))&&n.push({detail:`devDependency \`${s}\` is still installed`,kind:"devDep",location:"package.json",tool:"secretlint"}),s==="syncpack"&&n.push({detail:`devDependency \`${s}\` is still installed`,kind:"devDep",location:"package.json",tool:"syncpack"}),s==="sherif"&&n.push({detail:`devDependency \`${s}\` is still installed`,kind:"devDep",location:"package.json",tool:"sherif"});return e.sherif&&n.push({detail:"`sherif` config block still present in package.json",kind:"config",location:"package.json",tool:"sherif"}),n},C=c=>{const t=[];for(const e of v){const n=o(c,e);if(!a(n))continue;const s=f(n);/\bgitleaks\b/.test(s)&&t.push({detail:"gitleaks invocation still present in hook",kind:"hook",location:e,tool:"gitleaks"}),/\bsecretlint\b/.test(s)&&t.push({detail:"secretlint invocation still present in hook",kind:"hook",location:e,tool:"secretlint"}),/\bsyncpack\b/.test(s)&&t.push({detail:"syncpack invocation still present in hook",kind:"hook",location:e,tool:"syncpack"}),/\bsherif\b/.test(s)&&t.push({detail:"sherif invocation still present in hook",kind:"hook",location:e,tool:"sherif"})}return t},D=c=>{const t=[];for(const e of _)a(o(c,e))&&t.push({detail:"secretlint config should be removed after migration",kind:"config",location:e,tool:"secretlint"});for(const e of $)a(o(c,e))&&t.push({detail:"syncpack config should be removed after migration",kind:"config",location:e,tool:"syncpack"});return t},S=[".github/workflows",".gitlab-ci.yml",".circleci/config.yml",".woodpecker.yml",".drone.yml"],I=c=>{const t=[],e=n=>{const s=o(c,n);if(!a(s))return;const i=f(s);/\bsyncpack\b/.test(i)&&t.push({detail:"syncpack invocation still present in CI",kind:"ci",location:n,tool:"syncpack"}),/\bsherif\b/.test(i)&&t.push({detail:"sherif invocation still present in CI",kind:"ci",location:n,tool:"sherif"})};for(const n of S){const s=o(c,n);if(a(s)){if(n===".github/workflows"){try{for(const i of j(s))(i.endsWith(".yml")||i.endsWith(".yaml"))&&e(`.github/workflows/${i}`)}catch{}continue}e(n)}}return t},N=c=>{const t=[],e=o(c,"pnpm-workspace.yaml");if(a(e)){let s;try{s=b(e)}catch{s=void 0}if(s&&typeof s=="object"){const i=s.catalog;i&&typeof i.syncpack=="string"&&t.push({detail:"`syncpack` still listed in pnpm-workspace.yaml#catalog",kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"});const l=s.catalogs;if(l&&typeof l=="object")for(const[k,r]of Object.entries(l))r&&typeof r.syncpack=="string"&&t.push({detail:`\`syncpack\` still listed in pnpm-workspace.yaml#catalogs.${k}`,kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"})}}const n=o(c,"package.json");if(a(n)){let s;try{s=JSON.parse(f(n))}catch{return t}const i=s.workspaces;if(i&&typeof i=="object"&&!Array.isArray(i)){const k=i.catalog;k&&typeof k.syncpack=="string"&&t.push({detail:"`syncpack` still listed in package.json#workspaces.catalog",kind:"catalog",location:"package.json",tool:"syncpack"});const r=i.catalogs;if(r&&typeof r=="object")for(const[g,d]of Object.entries(r))d&&typeof d.syncpack=="string"&&t.push({detail:`\`syncpack\` still listed in package.json#workspaces.catalogs.${g}`,kind:"catalog",location:"package.json",tool:"syncpack"})}const l=s.catalog;l&&typeof l.syncpack=="string"&&t.push({detail:"`syncpack` still listed in package.json#catalog",kind:"catalog",location:"package.json",tool:"syncpack"})}return t},O=c=>[...w(c),...C(c),...D(c),...I(c),...N(c)],E=(c,t)=>{const e=O(c);if(e.length===0)return t.info("✓ No unmigrated gitleaks/secretlint/sherif/syncpack references found."),[];t.warn(`Found ${String(e.length)} unmigrated reference(s):`);for(const n of e)t.warn(` [${n.kind}] ${n.location} — ${n.detail}`);return e};export{O as s,E as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as b}from"node:module";import{U as v,m as j,a as R}from"./index-DHD8wb6Z.js";import{p as h}from"../packem_chunks/cli-main.js";let y;const $=o=>(y??=b(import.meta.url))(o),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=o=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[c,r]=m.versions.node.split(".").map(Number);if(c>22||c===22&&r>=3||c===20&&r>=16)return m.getBuiltinModule(o)}return $(o)},{watch:T}=w("node:fs"),{execFileSync:S}=w("node:child_process"),{createRequire:W}=w("node:module"),g=W(import.meta.url);let p;const q=()=>{if(p!==void 0)return p;try{g.resolve("fb-watchman")}catch{return p=!1,!1}try{S("watchman",["--version"],{stdio:"ignore",timeout:2e3})}catch{return p=!1,!1}return p=!0,!0},k=(o,c)=>{if(!q())return;let r;try{r=g("fb-watchman")}catch(s){h.warn(`[vis watch] fb-watchman failed to load, using native watcher: ${s.message}`);return}const a=new r.Client;a.on("error",s=>{h.warn(`[vis watch] watchman error: ${s.message}`)}),a.on("subscription",s=>{const t=s;if(!t.is_fresh_instance)for(const e of t.files??[])c(e)});for(const[s,t]of o.entries()){const e=v(t),i=`vis-watch-${s}-${process.pid}`;a.command(["watch-project",e],(l,u)=>{if(l){h.warn(`[vis watch] watchman could not watch ${t}: ${l.message}`);return}const f={expression:["allof",["type","f"]],fields:["name"]};u.relative_path&&(f.relative_root=u.relative_path),a.command(["subscribe",u.watch,i,f],n=>{n&&h.warn(`[vis watch] watchman subscribe failed for ${t}: ${n.message}`)})})}return{close:()=>{try{a.end()}catch{}}}},A=[/node_modules(?:\/|$)/,/\.git(?:\/|$)/,/\.vis(?:\/|$)/],M=(o,c)=>{const r=new Set,a=new Set;for(const[,e]of o){const i=e.task.hashDetails?.nodes;if(i)for(const l of Object.keys(i))r.add(l),a.add(j(v(c,l)))}const s=[...a].sort(),t=[];for(const e of s)t.some(i=>e===i||e.startsWith(`${i}/`))||t.push(e);return{directories:t,files:r}},z=(o,c,r)=>{const a=new Set;for(const s of o){const t=v(c,s);for(const e of r)if(t===e||t.startsWith(`${e}/`)){const i=R(e,t);i.length>0&&a.add(i)}}return s=>{const t=s.replaceAll("\\","/");return a.has(t)}},P=o=>{const c=o.replaceAll("\\","/");return A.some(r=>r.test(c))},B=o=>{const{debounceMs:c=150,filter:r,onChange:a,paths:s}=o;let t=new Set,e;const i=()=>{e=void 0;const n=[...t];t=new Set,n.length!==0&&Promise.resolve(a(n)).catch(d=>{h.error("[vis watch] onChange handler failed:",d)})},l=n=>{P(n)||r&&!r(n)||(t.add(n),e&&clearTimeout(e),e=setTimeout(i,c))},u=k(s,l);if(u)return{close:()=>{e&&clearTimeout(e),u.close()}};const f=[];for(const n of s)try{const d=T(n,{recursive:!0},(x,_)=>{_&&l(_)});f.push(d)}catch(d){h.warn(`[vis watch] unable to watch ${n}: ${d.message}`)}return{close:()=>{e&&clearTimeout(e);for(const n of f)try{n.close()}catch{}}}};export{z as a,M as c,B as s};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{createRequire as K}from"node:module";import{e as h,z as H,v as S,U as Y,m as Q}from"./index-DHD8wb6Z.js";import{T as w}from"../packem_chunks/catalog.js";import{y as C}from"./isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as ee}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";import{h as le}from"./writeFileSync-DJoHk3Ks-CgQ-VNNT.js";import{s as ue}from"./watch-Dswvj6Zp.js";let z;const G=e=>(z??=K(import.meta.url))(e),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=e=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[t,n]=x.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return x.getBuiltinModule(e)}return G(e)},{createHash:g}=A("node:crypto"),{fileURLToPath:X,pathToFileURL:Z}=A("node:url"),{spawnSync:te,spawn:ne}=A("node:child_process"),{openSync:se,writeSync:re,closeSync:oe,statSync:ie,readFileSync:P,mkdirSync:ce,writeFileSync:ae}=A("node:fs"),{availableParallelism:k}=A("node:os"),D=(e,t)=>{for(const n of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){const s=e[n];if(s&&typeof s[t]=="string")return s[t]}},F=(e,t)=>{for(const n of t){const s=h(e,n);if(C(s))return s}},de=e=>{const t=h(e,"package.json");if(!C(t))return{};try{return ee(t)}catch{return{}}},rt=(e,t)=>{const n=de(e),s=new Map;for(const o of t){const r=o.detect(e,n);r&&s.set(o.id,r)}return s},fe={error:"error",info:"info",information:"info",warning:"warning"},ot={argsCheck:(e,t)=>I(e,t,!1),argsFix:(e,t)=>I(e,t,!0),bin:()=>["pnpm","exec","biome"],cacheKey:(e,t)=>{const n=["biome",e.declaredVersion??"unknown",e.configFile??"no-config",t.maxWarnings===void 0?"":`mw=${t.maxWarnings}`,t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:(e,t)=>{const n=D(t,w.biome.packageNames[0]),s=F(e,w.biome.configFiles);if(!(!n&&!s))return{adapter:"biome",configFile:s,declared:!!n,declaredVersion:n,root:e}},extensions:["astro","cjs","css","cts","js","json","jsonc","jsx","mjs","mts","svelte","ts","tsx","vue"],id:"biome",kind:"both",parse:(e,t)=>{if(!e.stdout.trim())return[];let n;try{n=JSON.parse(e.stdout)}catch{return[{adapter:"biome",file:t.root,fixable:!1,message:`biome output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const s=[];for(const o of n.diagnostics??[]){const r=o.location?.start,i=o.location?.end,c=pe(t.root,o.location?.path),u=o.category??"",a=u==="format"||u.startsWith("format/");s.push({adapter:"biome",column:r?.column&&r.column>0?r.column:void 0,endColumn:i?.column&&i.column>0?i.column:void 0,endLine:i?.line&&i.line>0?i.line:void 0,file:c,fixable:!0,line:r?.line&&r.line>0?r.line:void 0,message:a?"Code style issues would be auto-fixed":o.message??"",ruleId:u||void 0,severity:fe[o.severity??""]??"warning"})}return s}},I=(e,t,n)=>{const s=["check","--reporter=json"];return n&&s.push("--write"),typeof t.maxWarnings=="number"&&s.push(`--max-diagnostics=${String(t.maxWarnings)}`),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},pe=(e,t)=>{const n=typeof t=="string"?t:t?.file;return n?n.startsWith("/")||/^[a-z]:[\\/]/i.test(n)?n:h(e,n):e},N=e=>t=>{const n=F(t,w.deno.configFiles);if(n)return{adapter:e,configFile:n,declared:!1,root:t}},O=e=>e.startsWith("/")||/^[a-z]:[\\/]/i.test(e),it={argsCheck:(e,t)=>b(e,t,!1),argsFix:(e,t)=>b(e,t,!0),bin:()=>["deno","lint"],cacheKey:(e,t)=>{const n=["deno-lint",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:N("deno-lint"),extensions:["js","jsx","mjs","mts","ts","tsx"],id:"deno-lint",kind:"lint",parse:(e,t)=>{if(!e.stdout.trim())return[];let n;try{n=JSON.parse(e.stdout)}catch{return[{adapter:"deno-lint",file:t.root,fixable:!1,message:`deno lint output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const s=[];for(const o of n.diagnostics??[]){const r=o.range?.start,i=o.range?.end;s.push({adapter:"deno-lint",column:r?.col===void 0?void 0:r.col+1,endColumn:i?.col===void 0?void 0:i.col+1,endLine:i?.line===void 0?void 0:i.line+1,file:he(o.filename??t.root,t.root),fixable:!1,line:r?.line===void 0?void 0:r.line+1,message:o.message??"",ruleId:o.code,severity:"warning"})}return s}},ct={argsCheck:(e,t)=>R(e,t,!1),argsFix:(e,t)=>R(e,t,!0),bin:()=>["deno","fmt"],cacheKey:(e,t)=>{const n=["deno-fmt",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:N("deno-fmt"),extensions:["astro","cjs","css","cts","html","ipynb","js","json","jsonc","jsx","less","md","mjs","mts","sass","scss","sql","svelte","ts","tsx","vue","yaml","yml"],id:"deno-fmt",kind:"fmt",parse:(e,t)=>{if(e.exitCode===0)return[];const n=[],s=new Set;for(const o of e.stdout.split(/\r?\n/)){const r=/^from (.+):$/.exec(o);if(!r)continue;const i=r[1];s.has(i)||(s.add(i),n.push({adapter:"deno-fmt",file:O(i)?i:`${t.root}/${i}`,fixable:!0,message:"Code style issues would be auto-fixed",severity:"info"}))}return n}},b=(e,t,n)=>{const s=["--json"];return n&&s.push("--fix"),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},R=(e,t,n)=>{const s=[];return n||s.push("--check"),t.quiet&&s.push("--quiet"),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},he=(e,t)=>e.startsWith("file://")?X(e):O(e)?e:`${t}/${e}`,W="pyproject.toml",me=/^\[tool\.ruff(?:\.[\w-]+)*\]\s*$/m,ge=/^Would reformat:?\s+(.+)$/,ye=e=>{const t=h(e,W);if(!C(t))return!1;try{const n=H(t);return me.test(n)}catch{return!1}},B=e=>(t,n)=>{const s=w.ruff.packageNames.map(c=>D(n,c)).find(c=>c!==void 0),o=F(t,w.ruff.configFiles),r=o?void 0:ye(t)?h(t,W):void 0,i=o??r;if(!(!s&&!i))return{adapter:e,configFile:i,declared:!!s,declaredVersion:s,root:t}},xe=e=>e.startsWith("/")||/^[a-z]:[\\/]/i.test(e),J=(e,t)=>e?xe(e)?e:h(t,e):t,ve=e=>ge.exec(e)?.[1]?.trim(),at={argsCheck:(e,t)=>T(e,t,!1),argsFix:(e,t)=>T(e,t,!0),bin:()=>["ruff","check"],cacheKey:(e,t)=>{const n=["ruff-check",e.declaredVersion??"unknown",e.configFile??"no-config",t.maxWarnings===void 0?"":`mw=${t.maxWarnings}`,t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:B("ruff-check"),extensions:["py","pyi"],id:"ruff-check",kind:"lint",parse:(e,t)=>{if(!e.stdout.trim())return[];let n;try{n=JSON.parse(e.stdout)}catch{return[{adapter:"ruff-check",file:t.root,fixable:!1,message:`ruff check output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const s=[];for(const o of n){const r=o.location,i=o.end_location;s.push({adapter:"ruff-check",column:r?.column,endColumn:i?.column,endLine:i?.row,file:J(o.filename,t.root),fixable:!!o.fix,line:r?.row,message:o.message??"",ruleId:o.code,severity:"warning"})}return s}},lt={argsCheck:(e,t)=>L(e,t,!1),argsFix:(e,t)=>L(e,t,!0),bin:()=>["ruff","format"],cacheKey:(e,t)=>{const n=["ruff-fmt",e.declaredVersion??"unknown",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return g("sha256").update(n.join("|")).digest("hex").slice(0,16)},detect:B("ruff-fmt"),extensions:["py","pyi"],id:"ruff-fmt",kind:"fmt",parse:(e,t)=>{if(e.exitCode===0)return[];const n=[],s=new Set;for(const o of e.stdout.split(/\r?\n/)){const r=ve(o);!r||s.has(r)||(s.add(r),n.push({adapter:"ruff-fmt",file:J(r,t.root),fixable:!0,message:"Code style issues would be auto-fixed",severity:"info"}))}return n}},T=(e,t,n)=>{const s=["--output-format=json"];return n&&s.push("--fix"),t.quiet&&s.push("--quiet"),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},L=(e,t,n)=>{const s=[];return n||s.push("--check"),t.quiet&&s.push("--quiet"),t.extraArgs?.length&&s.push(...t.extraArgs),s.push(...e),s},ut=(e,t)=>{const n=v(e,["diff","--name-only","--diff-filter=ACMR","-z",`${t}...HEAD`]);if(n===void 0)return;const s=v(e,["diff","--name-only","--diff-filter=ACMR","-z"]),o=v(e,["diff","--name-only","--diff-filter=ACMR","--cached","-z"]),r=v(e,["ls-files","--others","--exclude-standard","-z"]),i=new Set;for(const c of[n,s??"",o??"",r??""])for(const u of c.split("\0"))u.length!==0&&i.add(S(u)?u:h(e,u));return[...i].sort()},dt=e=>{const t=v(e,["diff","--name-only","--diff-filter=ACMR","--cached","-z"]);if(t===void 0)return;const n=new Set;for(const s of t.split("\0"))s.length!==0&&n.add(S(s)?s:h(e,s));return[...n].sort()},v=(e,t)=>{const n=te("git",[...t],{cwd:e,encoding:"utf8",timeout:1e4});if(n.status===0)return n.stdout},ft=(e,t)=>{const n=new Set(t.map(r=>r.toLowerCase())),s=[],o=new Set;for(const r of e){const i=r.lastIndexOf(".");if(i===-1||i===r.length-1)continue;const c=r.slice(i+1).toLowerCase();n.has(c)&&(o.has(r)||(o.add(r),s.push(r)))}return s},we=new Set(["-","stdout"]),_=e=>({close:()=>{},write:t=>{e.write(t)}}),Ae=e=>{le(Q(e));const t=se(e,"w");let n=[];return{close:()=>{n.length>0&&(re(t,n.join("")),n=[]),oe(t)},write:s=>{n.push(s)}}},pt=e=>{const{cwd:t,target:n}=e;if(n===void 0||we.has(n))return _(process.stdout);if(n==="stderr")return _(process.stderr);const s=S(n)?n:Y(t,n);return Ae(s)},j=["oxlint","oxfmt","biome","eslint","dprint","prettier","stylelint","ruff-check","ruff-fmt","markdownlint","shellcheck","deno-lint","deno-fmt"],ht=(e,t)=>{const n=new Map(e.map(i=>[i.id,i])),s=[],o=new Set,r=t&&t.length>0?t:j;for(const i of r){const c=n.get(i);c&&!o.has(i)&&(s.push(c),o.add(i))}if(t&&t.length>0)for(const i of j){const c=n.get(i);c&&!o.has(i)&&(s.push(c),o.add(i))}for(const i of e)o.has(i.id)||(s.push(i),o.add(i.id));return s},mt=(e,t,n)=>{const s=[];for(const o of t){const r=e.get(o.id);r&&Se(o.kind,n)&&s.push({adapter:o,presence:r})}return s},Se=(e,t)=>e===t||e==="both",gt=(e,t,n={})=>{const s=new Map;for(const o of e){const r=$e(o),i=Ce(r,t,n);if(!i)continue;const c=s.get(i);c?c.push(o):s.set(i,[o])}return s},$e=e=>{const t=e.lastIndexOf(".");return t===-1||t===e.length-1?"":e.slice(t+1).toLowerCase()},Ce=(e,t,n)=>{const s=n[e];if(s&&t.some(o=>o.adapter.id===s))return s;for(const{adapter:o}of t)if(o.extensions.includes(e))return o.id},Fe=e=>e==="error"?"error":e==="warning"?"warning":"notice",V=e=>e.replaceAll("%","%25").replaceAll("\r","%0D").replaceAll(`
|
|
2
|
-
`,"%0A"),M=e=>V(e).replaceAll(",","%2C").replaceAll(":","%3A").replaceAll("=","%3D"),ke=(e,t)=>t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e,Ie=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),be=(e,t)=>{const n=Fe(e.severity),s=ke(e.file,t),o=e.ruleId?`${e.adapter}(${e.ruleId})`:e.adapter,r=[`file=${M(s)}`];return e.line!==void 0&&r.push(`line=${String(e.line)}`),e.endLine!==void 0&&r.push(`endLine=${String(e.endLine)}`),e.column!==void 0&&r.push(`col=${String(e.column)}`),e.endColumn!==void 0&&r.push(`endColumn=${String(e.endColumn)}`),r.push(`title=${M(o)}`),`::${n} ${r.join(",")}::${V(e.message)}
|
|
3
|
-
`},yt=e=>e.runs.flatMap(n=>[...n.findings]).sort(Ie).map(n=>be(n,e.workspaceRoot)).join(""),y=e=>e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'"),Re=e=>`<![CDATA[${e.replaceAll("]]>","]]]]><![CDATA[>")}]]>`,Te=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),Le=e=>e==="error"?"error":e==="warning"?"warning":"info",_e=(e,t)=>{let{file:n}=e;return t&&e.file.startsWith(`${t}/`)&&(n=e.file.slice(t.length+1)),e.line===void 0?n:e.column===void 0?`${n}:${String(e.line)}`:`${n}:${String(e.line)}:${String(e.column)}`},je=(e,t,n)=>{const s=_e(e,n),o=Le(e.severity),r=e.ruleId?`[${e.ruleId}] ${e.message}`:e.message;return[` <testcase classname="${y(t)}" name="${y(s)}">`,` <failure type="${y(o)}" message="${y(r)}">${Re(e.message)}</failure>`," </testcase>",""].join(`
|
|
4
|
-
`)},Me=(e,t,n)=>{const s=[...e.findings].sort(Te),o=s.filter(d=>d.severity==="error").length,r=s.filter(d=>d.severity==="warning").length,i=s.length,c=(e.durationMs/1e3).toFixed(3),u=s.map(d=>je(d,e.adapter,n)).join("");return` <testsuite ${[`name="${y(e.adapter)}"`,`tests="${String(i)}"`,`failures="${String(o)}"`,'errors="0"',`skipped="${String(r)}"`,`time="${c}"`,`timestamp="${t}"`].join(" ")}>
|
|
5
|
-
${u} </testsuite>
|
|
6
|
-
`},xt=e=>{const t=(e.now??new Date).toISOString(),n=e.suiteName??"vis-lint-fmt",s=e.runs.map(a=>Me(a,t,e.workspaceRoot)).join(""),o=e.runs.reduce((a,d)=>a+d.findings.length,0),r=e.runs.reduce((a,d)=>a+d.findings.filter(l=>l.severity==="error").length,0),i=e.runs.reduce((a,d)=>a+d.findings.filter(l=>l.severity==="warning").length,0),c=(e.runs.reduce((a,d)=>a+d.durationMs,0)/1e3).toFixed(3);return`<?xml version="1.0" encoding="UTF-8"?>
|
|
7
|
-
<testsuites ${[`name="${y(n)}"`,`tests="${String(o)}"`,`failures="${String(r)}"`,'errors="0"',`skipped="${String(i)}"`,`time="${c}"`].join(" ")}>
|
|
8
|
-
${s}</testsuites>
|
|
9
|
-
`},Ee="2.1.0",qe="https://json.schemastore.org/sarif-2.1.0.json",Pe=e=>e==="error"?"error":e==="warning"?"warning":"note",De=(e,t)=>t&&e.startsWith(`${t}/`)?{uri:e.slice(t.length+1),uriBaseId:"SRCROOT"}:{uri:e},Ne=e=>{const{href:t}=Z(e);return t.endsWith("/")?t:`${t}/`},Oe=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),We=e=>{const t=new Map;for(const n of e)n.ruleId&&(t.has(n.ruleId)||t.set(n.ruleId,{id:n.ruleId,name:n.ruleId}));return[...t.values()]},Be=(e,t)=>{const{uri:n,uriBaseId:s}=De(e.file,t),o={artifactLocation:s?{uri:n,uriBaseId:s}:{uri:n}};if(e.line!==void 0){const i={startLine:e.line};e.column!==void 0&&(i.startColumn=e.column),e.endLine!==void 0&&(i.endLine=e.endLine),e.endColumn!==void 0&&(i.endColumn=e.endColumn),o.region=i}const r={level:Pe(e.severity),locations:[{physicalLocation:o}],message:{text:e.message}};return e.ruleId&&(r.ruleId=e.ruleId),r},Je=(e,t)=>{const n=[...e.findings].sort(Oe),s=We(n),o={name:e.adapter,rules:s};e.presence?.declaredVersion&&(o.version=e.presence.declaredVersion);const r={results:n.map(i=>Be(i,t)),tool:{driver:o}};return t&&(r.originalUriBaseIds={SRCROOT:{uri:Ne(t)}}),r},vt=e=>{const t={$schema:qe,runs:e.runs.map(n=>Je(n,e.workspaceRoot)),version:Ee};return`${JSON.stringify(t,void 0,2)}
|
|
10
|
-
`},E={error:3,info:1,warning:2},wt=e=>{const t=[],n=[];let s,o=!1;for(const r of e){n.push({adapter:r.adapter,durationMs:r.durationMs,exitCode:r.exitCode,findingCount:r.findings.length}),r.exitCode!==0&&r.exitCode!==null&&r.findings.length===0&&(o=!0);for(const i of r.findings)t.push(i),(!s||E[i.severity]>E[s])&&(s=i.severity)}return{findings:t,hadProcessFailure:o,maxSeverity:s,runs:n}},At=e=>{const t=new Map;for(const n of e){const s=t.get(n.file);s?s.push(n):t.set(n.file,[n])}return t},St=e=>e.hadProcessFailure||e.maxSeverity==="error"?1:0,Ve=(e,t)=>{if(t==="fix"||process.env.VIS_NO_CACHE==="1"||e.length===0)return!1;for(const n of e)if(n==="."||n==="./"||n==="..")return!1;return!0},Ue=e=>{try{const t=P(e);return g("sha256").update(t).digest("hex")}catch{return}},Ke=(e,t,n,s,o)=>{const r=e.cacheKey(t,s),i=[];for(const u of[...n].sort()){const a=S(u)?u:h(t.root,u);try{ie(a)}catch{return}const d=Ue(a);if(!d)return;i.push({hash:d,path:a})}const c=g("sha256");c.update(e.id),c.update("\0"),c.update(r),c.update("\0"),c.update(o);for(const u of i)c.update("\0"),c.update(u.path),c.update("\0"),c.update(u.hash);return{fileHashes:i,key:c.digest("hex")}},U=(e,t)=>h(e,"lint-fmt",t),ze=(e,t,n)=>{const s=h(U(e,t.id),`${n}.json`);try{const o=P(s,"utf8"),r=JSON.parse(o);return r.schema!==1?void 0:r}catch{return}},Ge=(e,t,n,s,o)=>{const r=U(e,t.id),i={fileHashes:o,result:s,savedAt:Date.now(),schema:1};try{ce(r,{recursive:!0}),ae(h(r,`${n}.json`),JSON.stringify(i))}catch{}},q=async(e,t,n,s,o)=>{const r=e.bin(t),i=[...r.slice(1),...o==="fix"?e.argsFix(n,s):e.argsCheck(n,s)];return new Promise(c=>{const u=Date.now(),a=ne(r[0],i,{cwd:t.root}),d=[],l=[];let m=!1;const p=setTimeout(()=>{m=!0,a.kill("SIGKILL")},6e4);a.stdout.on("data",f=>d.push(f)),a.stderr.on("data",f=>l.push(f)),a.on("error",f=>{clearTimeout(p),c({durationMs:Date.now()-u,exitCode:null,stderr:f.message,stdout:""})}),a.on("close",f=>{clearTimeout(p),c({durationMs:Date.now()-u,exitCode:m?null:f,stderr:Buffer.concat(l).toString("utf8"),stdout:Buffer.concat(d).toString("utf8")})})})},$t=async(e,t,n,s=k())=>{if(e.length===0)return[];const{cacheRoot:o,concurrency:r}=typeof s=="number"?{concurrency:s}:{cacheRoot:s.cacheRoot,concurrency:s.concurrency??k()},i=async l=>{const m=l.options??t;if(o&&Ve(l.files,n)){const p=Ke(l.adapter,l.presence,l.files,m,n);if(p){const f=ze(o,l.adapter,p.key);if(f)return f.result;const $=await q(l.adapter,l.presence,l.files,m,n);return $.exitCode!==null&&Ge(o,l.adapter,p.key,$,p.fileHashes),$}}return q(l.adapter,l.presence,l.files,m,n)};if(process.env.VIS_LINT_FMT_SERIAL==="1"){const l=[];for(const m of e)l.push(await i(m));return l}const c=Math.max(1,Math.min(r,e.length)),u=Array.from({length:e.length});let a=0;const d=async()=>{for(;;){const l=a;if(a+=1,l>=e.length)return;u[l]=await i(e[l])}};return await Promise.all(Array.from({length:c},()=>d())),u},He=e=>{const t=new Set;for(const n of e)t.add(n.toLowerCase());return t},Ye=(e,t)=>{const n=e.lastIndexOf(".");return n===-1||n===e.length-1?!1:t.has(e.slice(n+1).toLowerCase())},Ct=async e=>{const{extensions:t,initialFiles:n,label:s,log:o,runCycle:r,workspaceRoot:i}=e,c=o??(p=>{process.stdout.write(`${p}
|
|
11
|
-
`)}),u=He(t);await r(n),c(`▸ ${s}: watching workspace — press Ctrl-C to exit`);let a=new Set,d=!1;const l=async()=>{for(;a.size>0;){const p=[...a];a=new Set;try{await r(p)}catch(f){c(`✗ ${s}: watch cycle failed — ${f.message}`)}}},m=ue({debounceMs:200,filter:p=>Ye(p,u),onChange:async p=>{for(const f of p)a.add(S(f)?f:h(i,f));if(!d){d=!0;try{await l()}finally{d=!1}}},paths:[i]});await new Promise(p=>{const f=()=>{m.close(),process.off("SIGINT",f),process.off("SIGTERM",f),p()};process.once("SIGINT",f),process.once("SIGTERM",f)})};export{rt as a,mt as b,ut as c,D as d,Ct as e,F as f,ot as g,lt as h,ct as i,gt as j,$t as k,wt as l,pt as m,vt as n,xt as o,yt as p,St as q,ht as r,dt as s,At as t,at as u,it as v,ft as w};
|