@visulima/vis 4.2.0 → 4.3.1
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 +26 -0
- package/LICENSE.md +55 -129
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +96 -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/cargo-plan.js +3 -0
- package/dist/packem_chunks/catalog.js +51 -48
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +164 -164
- package/dist/packem_chunks/composer-projects.js +2 -0
- package/dist/packem_chunks/dart-plan.js +1 -0
- package/dist/packem_chunks/dart-projects.js +1 -0
- package/dist/packem_chunks/dispatch.js +1 -1
- package/dist/packem_chunks/fix.js +8 -8
- package/dist/packem_chunks/gem-plan.js +2 -0
- package/dist/packem_chunks/gem-projects.js +1 -0
- package/dist/packem_chunks/git.js +5 -5
- package/dist/packem_chunks/go-plan.js +1 -0
- package/dist/packem_chunks/go-projects.js +2 -0
- package/dist/packem_chunks/gradle-plan.js +1 -0
- 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 +1 -1
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler39.js +6 -6
- package/dist/packem_chunks/handler4.js +3 -3
- package/dist/packem_chunks/handler5.js +2 -2
- package/dist/packem_chunks/handler50.js +1 -1
- package/dist/packem_chunks/handler51.js +1 -1
- 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 +7 -7
- 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 +3 -3
- package/dist/packem_chunks/handler68.js +4 -4
- package/dist/packem_chunks/handler69.js +3 -3
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +5 -5
- package/dist/packem_chunks/handler71.js +5 -5
- package/dist/packem_chunks/handler72.js +2 -2
- package/dist/packem_chunks/handler73.js +87 -86
- package/dist/packem_chunks/handler74.js +1 -1
- package/dist/packem_chunks/handler75.js +23 -23
- package/dist/packem_chunks/handler76.js +6 -6
- package/dist/packem_chunks/handler77.js +2 -2
- package/dist/packem_chunks/handler78.js +19 -19
- 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/hex-plan.js +3 -0
- package/dist/packem_chunks/hex-projects.js +1 -0
- package/dist/packem_chunks/index2.js +52 -42
- package/dist/packem_chunks/index4.js +58 -802
- package/dist/packem_chunks/index5.js +802 -7
- package/dist/packem_chunks/index6.js +7 -58
- 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/maven-plan.js +1 -0
- package/dist/packem_chunks/maven-projects.js +1 -0
- package/dist/packem_chunks/nuget-plan.js +1 -0
- package/dist/packem_chunks/nuget-projects.js +1 -0
- package/dist/packem_chunks/orchestrator.js +33 -33
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/python-plan.js +3 -0
- package/dist/packem_chunks/python-projects.js +1 -0
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/security.js +1 -1
- package/dist/packem_chunks/snapshot.js +2 -2
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/swift-projects.js +1 -0
- package/dist/packem_chunks/sync.js +3 -2
- 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_chunks/version-resolver.js +3 -3
- package/dist/packem_chunks/zig-plan.js +1 -0
- package/dist/packem_chunks/zig-projects.js +1 -0
- package/dist/packem_shared/{affected-selection-M7riOi5-.js → affected-selection-D4giBK2X.js} +1 -1
- package/dist/packem_shared/{affected-shas-CAwpSPmP.js → affected-shas-B2V84O0g.js} +1 -1
- package/dist/packem_shared/{ai-analysis-DSQQDFU9.js → ai-analysis-pldoS_N4.js} +2 -2
- package/dist/packem_shared/{ai-fix-BTm1Z5og.js → ai-fix-BC6aIRJT.js} +4 -4
- package/dist/packem_shared/{augment-CBv1hwMR.js → augment-B9kSZuvW.js} +1 -1
- package/dist/packem_shared/{bin-Cbs_ix6l.js → bin-C1XKj-O-.js} +1 -1
- package/dist/packem_shared/build-scripts-CEDx_nJp.js +1 -0
- package/dist/packem_shared/{command-runtime-BD-4UmPB.js → command-runtime-p4IXiIf6.js} +1 -1
- package/dist/packem_shared/composer-DR3D-Psb.js +1 -0
- package/dist/packem_shared/dart-pubspec-BK_cK2EP.js +2 -0
- package/dist/packem_shared/dependency-scan-B8jroa1D.js +1 -0
- package/dist/packem_shared/{docker-1jgKW5Wd.js → docker-DXqV-07f.js} +3 -3
- package/dist/packem_shared/ecosystem-gate-ddru_hOg.js +6 -0
- package/dist/packem_shared/failure-log-D2x5BT8S.js +2 -0
- package/dist/packem_shared/formatBytes-BHAzNIrn-CrusHOew.js +4 -0
- package/dist/packem_shared/gemspec-K7N05xxc.js +3 -0
- package/dist/packem_shared/go-modules-BsVqtyeC.js +1 -0
- package/dist/packem_shared/gradle-build-CHZDHyjI.js +8 -0
- package/dist/packem_shared/index-BzhrR_iC.js +22 -0
- package/dist/packem_shared/index-Chje3u9v.js +1 -0
- package/dist/packem_shared/{index-Cq-J2MdB.js → index-DQ2GJzmy.js} +1 -1
- package/dist/packem_shared/{isAccessibleSync-DYKTrrvc-K2xhg6sV.js → isAccessibleSync-DYKTrrvc-C-_5cgwu.js} +1 -1
- package/dist/packem_shared/lifecycle-D6PMPor-.js +2 -0
- package/dist/packem_shared/lockfile-CiUtEbnt.js +1 -0
- package/dist/packem_shared/manifests-Du4yKlf_.js +1 -0
- package/dist/packem_shared/maven-pom-B0KG9kJQ.js +1 -0
- package/dist/packem_shared/{min-release-age-Da4V046o.js → min-release-age-JViyQuBM.js} +7 -7
- package/dist/packem_shared/missing-package-json-Cu5YVAot.js +1 -0
- package/dist/packem_shared/mix-project-RYvdZp3_.js +2 -0
- package/dist/packem_shared/multi-eco-lockfiles-B2X3yhyo.js +1 -0
- package/dist/packem_shared/{native-config-sync-CEB0rWlk.js → native-config-sync-TdTWjVgI.js} +1 -1
- package/dist/packem_shared/nuget-project-RApYSW_y.js +4 -0
- package/dist/packem_shared/{osv-bloom-BRacgzs7.js → osv-bloom-BCAX5ARR.js} +1 -1
- package/dist/packem_shared/package-version-Dxirp-UO.js +4 -0
- package/dist/packem_shared/packument-BQv4je9m.js +1 -0
- package/dist/packem_shared/pm-runner-CMSml1Bj.js +1 -0
- package/dist/packem_shared/{project-name-filter-zrdrEQbu.js → project-name-filter-D6tXD8gd.js} +1 -1
- package/dist/packem_shared/{provenance-CFPT_FQA.js → provenance-DNyVMxNv.js} +1 -1
- package/dist/packem_shared/readJsonSync-CbryXYxN-EWl7_7KX.js +1 -0
- package/dist/packem_shared/registry-keys-DwB3ZXS_.js +1 -0
- package/dist/packem_shared/{resolve-explicit-opfIkxoY.js → resolve-explicit-BPsdmuty.js} +1 -1
- package/dist/packem_shared/resolve-runtime-CNiHcVtx.js +1 -0
- package/dist/packem_shared/run-file-UBukWaha.js +1 -0
- package/dist/packem_shared/runtime-check-1U8HrQd9.js +1 -0
- package/dist/packem_shared/s1ngularity-QD2LD1sO.js +1 -0
- package/dist/packem_shared/{scan-progress-BGB9hIrD.js → scan-progress-CkumcBG-.js} +2 -2
- package/dist/packem_shared/{selectors-CjIZ3gy2.js → selectors-edwcgNl3.js} +1 -1
- package/dist/packem_shared/{signatures-DpqZVmmU.js → signatures-t8LbOaqr.js} +1 -1
- package/dist/packem_shared/spinner-ukDEdGvp.js +1 -0
- package/dist/packem_shared/swift-package-B6X5kzQE.js +1 -0
- package/dist/packem_shared/tabs--uxJGL8N.js +1 -0
- package/dist/packem_shared/{target-merge-hsawesT4.js → target-merge-DVJl-7Qz.js} +1 -1
- package/dist/packem_shared/target-options-DsHFmRZH.js +1 -0
- package/dist/packem_shared/toolchain-BRdpaAC4.js +5 -0
- package/dist/packem_shared/typosquats-8u0drCqQ.js +1 -0
- package/dist/packem_shared/use-measured-height-DUZyyias.js +1 -0
- package/dist/packem_shared/verify-B_MblU_Q.js +1 -0
- package/dist/packem_shared/{vis-update-app-D9KWJ9Ir.js → vis-update-app-BCIccZfA.js} +1 -1
- package/dist/packem_shared/{vis-user-error-Bdg9NRuJ.js → vis-user-error-75VtCwMv.js} +15 -15
- package/dist/packem_shared/watch-CcTketln.js +1 -0
- package/dist/packem_shared/watch-loop-qRn0IHPG.js +11 -0
- package/dist/packem_shared/{writeFileSync-DJoHk3Ks-O9zOKqeM.js → writeFileSync-DJoHk3Ks-BPRoepNw.js} +1 -1
- package/dist/packem_shared/zig-manifest-P7ydLEOa.js +7 -0
- package/dist/release/plugin-sdk.d.ts +1 -1
- package/dist/release/types.d.ts +133 -7
- package/dist/runtime/preload.js +1 -1
- package/index.d.ts +204 -204
- package/index.js +52 -52
- package/package.json +11 -11
- package/schemas/vis-config.schema.json +265 -5
- package/schemas/vis-release-config.schema.json +132 -5
- package/dist/packem_shared/advisories-BSpzRIXP.js +0 -1
- package/dist/packem_shared/build-scripts-BIgkWVgY.js +0 -1
- package/dist/packem_shared/cyclonedx-CT1rtKxV.js +0 -4
- package/dist/packem_shared/dependency-scan-W9b2X0a1.js +0 -1
- package/dist/packem_shared/failure-log-B91LvYWw.js +0 -2
- package/dist/packem_shared/formatBytes-BHAzNIrn-CLYsxlUj.js +0 -4
- package/dist/packem_shared/index-CVBR-Kit.js +0 -22
- package/dist/packem_shared/index-onibYJkv.js +0 -1
- package/dist/packem_shared/lifecycle-DDJzp-4H.js +0 -2
- package/dist/packem_shared/lockfile-Bi1mw9jJ.js +0 -1
- package/dist/packem_shared/manifests-D671Sb1T.js +0 -1
- package/dist/packem_shared/missing-package-json-CMoHdvmj.js +0 -1
- package/dist/packem_shared/package-version-C5EPMgRw.js +0 -4
- package/dist/packem_shared/packument-DuEV-qSE.js +0 -1
- package/dist/packem_shared/path-CxEa27Rz-pjheKk6v.js +0 -1
- package/dist/packem_shared/pm-runner-9L6ocnu2.js +0 -1
- package/dist/packem_shared/readJsonSync-CbryXYxN-BxKjDZnF.js +0 -1
- package/dist/packem_shared/registry-keys-C3EsP_s4.js +0 -1
- package/dist/packem_shared/resolve-runtime-lJ5L9gU4.js +0 -1
- package/dist/packem_shared/run-file-DZff6GqY.js +0 -1
- package/dist/packem_shared/runtime-check-DAbveBr_.js +0 -1
- package/dist/packem_shared/s1ngularity-DTvrfWIM.js +0 -1
- package/dist/packem_shared/spinner-BVCEMm3G.js +0 -1
- package/dist/packem_shared/tabs-Dz6xVpfX.js +0 -1
- package/dist/packem_shared/target-options-Bxb0Y5qa.js +0 -1
- package/dist/packem_shared/toolchain-887JoquG.js +0 -5
- package/dist/packem_shared/typosquats-Xv6dN4sr.js +0 -1
- package/dist/packem_shared/use-measured-height-BPQg2q_p.js +0 -1
- package/dist/packem_shared/verify-BLoaI7En.js +0 -1
- package/dist/packem_shared/watch-BTZw2Y8Q.js +0 -1
- package/dist/packem_shared/watch-loop-Cjh2wlUl.js +0 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as Xs}from"node:module";import
|
|
1
|
+
import{createRequire as Xs}from"node:module";import{e as Le,a as to,m as _i}from"./index-BzhrR_iC.js";import{h as so,S as oo}from"./index-BisalDCf.js";import{y as fo}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as ns}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{U as ut,h as lo}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";let Zs;const eo=a=>(Zs??=Xs(import.meta.url))(a),zr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ro=a=>{if(typeof zr<"u"&&zr.versions&&zr.versions.node){const[g,C]=zr.versions.node.split(".").map(Number);if(g>22||g===22&&C>=3||g===20&&C>=16)return zr.getBuiltinModule(a)}return eo(a)},{rmSync:ki,existsSync:es,readFileSync:at,cpSync:rs,lstatSync:no,readdirSync:io}=ro("node:fs");class Ze extends Error{constructor(g){super(g),this.name="LockfilePruneError"}}const is=a=>{let g=a.startsWith("/")?a.slice(1):a;const C=g.indexOf("(");return C!==-1&&(g=g.slice(0,C)),g},co=(a,g)=>{if(!(g.startsWith("link:")||g.startsWith("file:")||g.startsWith("workspace:")))return`${a}@${g}`},ao=a=>{const g=[];for(const C of[a.dependencies,a.devDependencies,a.optionalDependencies])if(C)for(const[s,h]of Object.entries(C))h?.version&&g.push({name:s,version:h.version});return g},pt=a=>{const g=[];for(const C of[a.dependencies,a.optionalDependencies])if(C)for(const[s,h]of Object.entries(C))typeof h=="string"&&g.push({name:s,version:h});return g},ht=a=>{const g=new Map;if(!a)return g;for(const C of Object.keys(a)){const s=is(C),h=g.get(s);h?h.push(C):g.set(s,[C])}return g},ts=a=>{const g=a.displayName??"pnpm-lock.yaml",C=typeof a.lockfileContent=="string"?a.lockfileContent:a.lockfileContent.toString("utf8");let s;try{s=so(C)}catch(V){throw new Ze(`${g}: parse failed — ${V.message}`)}const h=V=>V.packages?Object.keys(V.packages).length:0;let e;for(const V of s){const[ne]=V.errors;if(ne)throw new Ze(`${g}: parse failed — ${ne.message}`);const M=V.toJS();if(!M||typeof M!="object")continue;const le=M;(e===void 0||h(le)>h(e))&&(e=le)}if(e===void 0)throw new Ze(`${g}: top-level value is not an object`);const d=e.importers??{},w=ht(e.packages),m=ht(e.snapshots),A=new Set(["."]);for(const V of a.closure)A.add(V.relativeRoot===""?".":V.relativeRoot);const x={};for(const[V,ne]of Object.entries(d))A.has(V)&&(x[V]=ne);const Y=new Set,y=new Set,v=[];for(const V of Object.values(x))for(const ne of ao(V))v.push(ne);for(;v.length>0;){const{name:V,version:ne}=v.shift(),M=co(V,ne);if(!M)continue;const le=is(M),we=m.get(le)??m.get(M)??[];for(const ve of we){if(y.has(ve))continue;y.add(ve);const Se=e.snapshots?.[ve];if(Se)for(const xe of pt(Se))v.push(xe)}const ge=w.get(le)??w.get(M)??[];for(const ve of ge){if(Y.has(ve))continue;Y.add(ve);const Se=e.packages?.[ve];if(Se&&!e.snapshots)for(const xe of pt(Se))v.push(xe)}}const $={lockfileVersion:e.lockfileVersion};for(const V of["settings","overrides","patchedDependencies","catalogs"])e[V]!==void 0&&($[V]=e[V]);if($.importers=x,e.packages){const V={};for(const ne of Object.keys(e.packages))Y.has(ne)&&(V[ne]=e.packages[ne]);$.packages=V}if(e.snapshots){const V={};for(const ne of Object.keys(e.snapshots))y.has(ne)&&(V[ne]=e.snapshots[ne]);$.snapshots=V}const P=Object.keys(e.packages??{}).length,ie=Object.keys($.packages??{}).length,oe=P-ie,R=Object.keys(d).length-Object.keys(x).length;return{content:oo($,{lineWidth:0}),message:`${g}: kept ${ie}/${P} packages and ${Object.keys(x).length} importers (dropped ${oe} packages, ${R} importers)`,status:"pruned"}},uo=a=>ts({...a,displayName:a.displayName??"aube-lock.yaml"}),po=a=>{let g="",C=!1,s=!1,h=!1;for(let e=0;e<a.length;e+=1){const d=a[e],w=a[e+1];if(s){d===`
|
|
2
2
|
`&&(s=!1,g+=d);continue}if(h){d==="*"&&w==="/"&&(h=!1,e+=1);continue}if(C){if(d==="\\"){g+=d,w!==void 0&&(g+=w,e+=1);continue}d==='"'&&(C=!1),g+=d;continue}if(d==='"'){C=!0,g+=d;continue}if(d==="/"&&w==="/"){s=!0,e+=1;continue}if(d==="/"&&w==="*"){h=!0,e+=1;continue}g+=d}return g},ho=a=>{const g=[];for(const C of[a.dependencies,a.devDependencies,a.optionalDependencies,a.peerDependencies])if(C)for(const[s,h]of Object.entries(C))typeof h=="string"&&g.push({name:s,spec:h});return g},go=a=>{for(const g of a)if(typeof g=="object"&&!Array.isArray(g))return g},mo=a=>{if(!a)return[];const g=[];for(const C of["dependencies","optionalDependencies","peerDependencies"]){const s=a[C];s!==null&&typeof s=="object"&&!Array.isArray(s)&&g.push(...Object.keys(s))}return g},yo=a=>{if(Buffer.isBuffer(a.lockfileContent))return{message:"bun.lockb is binary; run `bun install --save-text-lockfile` to regenerate as bun.lock, then rerun `vis docker scaffold`.",status:"skipped"};const g=po(a.lockfileContent);let C;try{C=JSON.parse(g)}catch(P){throw new Ze(`bun.lock: parse failed — ${P.message}`)}if(!C||typeof C!="object")throw new Ze("bun.lock: top-level value is not an object");const s=C.workspaces??{},h=C.packages??{},e=new Set([""]);for(const P of a.closure)e.add(P.relativeRoot===""?"":P.relativeRoot);const d={},w=[];for(const[P,ie]of Object.entries(s))e.has(P)&&(d[P]=ie,w.push(...ho(ie)));const m=new Set;for(const{name:P}of w)m.add(P);const A=[...m];for(;A.length>0;){const P=A.shift();for(const ie of Object.keys(h)){if(ie.split("/")[0]!==P&&ie!==P)continue;const R=go(h[ie]);for(const V of mo(R))m.has(V)||(m.add(V),A.push(V))}}const x={};for(const[P,ie]of Object.entries(h)){const oe=P.split("/")[0];(m.has(oe)||m.has(P))&&(x[P]=ie)}const Y={...C,packages:x,workspaces:d},y=Object.keys(h).length,v=Object.keys(x).length,$=y-v;return{content:`${JSON.stringify(Y,null,2)}
|
|
3
3
|
`,message:`bun.lock: kept ${v}/${y} packages (dropped ${$})`,status:"pruned"}},Jn="node_modules/",$o=(a,g,C)=>{let s=g;for(;;){const h=s===""?`${Jn}${C}`:`${s}/${Jn}${C}`;if(a[h]!==void 0)return h;if(s==="")return;const e=s.lastIndexOf(`/${Jn.slice(0,-1)}/`);s=e===-1?"":s.slice(0,e)}},vo=a=>{const g=[];for(const C of[a.dependencies,a.devDependencies,a.optionalDependencies,a.peerDependencies])if(C)for(const s of Object.keys(C))g.push(s);return g},Ao=a=>{const g=a.displayName??"package-lock.json",C=typeof a.lockfileContent=="string"?a.lockfileContent:a.lockfileContent.toString("utf8");let s;try{s=JSON.parse(C)}catch($){throw new Ze(`${g}: parse failed — ${$.message}`)}if(!s||typeof s!="object")throw new Ze(`${g}: top-level value is not an object`);const h=s.packages??{},e=new Set([""]);for(const $ of a.closure)$.relativeRoot!==""&&e.add($.relativeRoot);const d=new Set,w=[];for(const $ of Object.keys(h))e.has($)&&(d.add($),w.push($));for(const[$,P]of Object.entries(h))P.link===!0&&typeof P.resolved=="string"&&e.has(P.resolved)&&d.add($);for(;w.length>0;){const $=w.shift(),P=h[$];if(P)for(const ie of vo(P)){const oe=$o(h,$,ie);if(!oe||d.has(oe))continue;d.add(oe);const R=h[oe];R.link===!0&&typeof R.resolved=="string"&&h[R.resolved]!==void 0&&!d.has(R.resolved)?(d.add(R.resolved),w.push(R.resolved)):w.push(oe)}}const m={};for(const $ of Object.keys(h))d.has($)&&(m[$]=h[$]);const A=m[""];A&&Array.isArray(A.workspaces)&&(A.workspaces=A.workspaces.filter($=>{if(typeof $!="string")return!1;const P=$.replace(/\/?\*+$/,"").replace(/\/$/,"");if(P===""||P==="*")return!0;for(const ie of e)if(ie===$||ie===P||ie.startsWith(`${P}/`))return!0;return!1}));const x={...s,packages:m};delete x.dependencies;const Y=Object.keys(h).length,y=Object.keys(m).length,v=Y-y;return{content:`${JSON.stringify(x,null,2)}
|
|
4
4
|
`,message:`${g}: kept ${y}/${Y} entries (dropped ${v})`,status:"pruned"}};var Qn={},Fe={},zn,gt;function wo(){if(gt)return zn;gt=1;function a(s,h){function e(){this.constructor=s}e.prototype=h.prototype,s.prototype=new e}function g(s,h,e,d){this.message=s,this.expected=h,this.found=e,this.location=d,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,g)}a(g,Error),g.buildMessage=function(s,h){var e={literal:function(y){return'"'+w(y.text)+'"'},class:function(y){var v="",$;for($=0;$<y.parts.length;$++)v+=y.parts[$]instanceof Array?m(y.parts[$][0])+"-"+m(y.parts[$][1]):m(y.parts[$]);return"["+(y.inverted?"^":"")+v+"]"},any:function(y){return"any character"},end:function(y){return"end of input"},other:function(y){return y.description}};function d(y){return y.charCodeAt(0).toString(16).toUpperCase()}function w(y){return y.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+d(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+d(v)})}function m(y){return y.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+d(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+d(v)})}function A(y){return e[y.type](y)}function x(y){var v=new Array(y.length),$,P;for($=0;$<y.length;$++)v[$]=A(y[$]);if(v.sort(),v.length>0){for($=1,P=1;$<v.length;$++)v[$-1]!==v[$]&&(v[P]=v[$],P++);v.length=P}switch(v.length){case 1:return v[0];case 2:return v[0]+" or "+v[1];default:return v.slice(0,-1).join(", ")+", or "+v[v.length-1]}}function Y(y){return y?'"'+w(y)+'"':"end of input"}return"Expected "+x(s)+" but "+Y(h)+" found."};function C(s,h){h=h!==void 0?h:{};var e={},d={Start:Vi},w=Vi,m=function(r){return r||[]},A=function(r,t,o){return[{command:r,type:t}].concat(o||[])},x=function(r,t){return[{command:r,type:t||";"}]},Y=function(r){return r},y=";",v=ce(";",!1),$="&",P=ce("&",!1),ie=function(r,t){return t?{chain:r,then:t}:{chain:r}},oe=function(r,t){return{type:r,line:t}},R="&&",V=ce("&&",!1),ne="||",M=ce("||",!1),le=function(r,t){return t?{...r,then:t}:r},we=function(r,t){return{type:r,chain:t}},ge="|&",ve=ce("|&",!1),Se="|",xe=ce("|",!1),je="=",Be=ce("=",!1),$e=function(r,t){return{name:r,args:[t]}},Ne=function(r){return{name:r,args:[]}},Qe="(",Ee=ce("(",!1),re=")",Ie=ce(")",!1),De=function(r,t){return{type:"subshell",subshell:r,args:t}},Oe="{",Pe=ce("{",!1),_e="}",B=ce("}",!1),G=function(r,t){return{type:"group",group:r,args:t}},X=function(r,t){return{type:"command",args:t,envs:r}},me=function(r){return{type:"envs",envs:r}},qe=function(r){return r},ze=function(r){return r},Me=/^[0-9]/,Ye=We([["0","9"]],!1,!1),er=function(r,t,o){return{type:"redirection",subtype:t,fd:r!==null?parseInt(r):null,args:[o]}},or=">>",hr=ce(">>",!1),fr=">&",lr=ce(">&",!1),Cr=">",gr=ce(">",!1),Ke="<<<",rr=ce("<<<",!1),Ge="<&",dr=ce("<&",!1),mr="<",yr=ce("<",!1),Ue=function(r){return{type:"argument",segments:[].concat(...r)}},n=function(r){return r},k="$'",j=ce("$'",!1),J="'",l=ce("'",!1),b=function(r){return[{type:"text",text:r}]},E='""',T=ce('""',!1),O=function(){return{type:"text",text:""}},q='"',U=ce('"',!1),N=function(r){return r},Z=function(r){return{type:"arithmetic",arithmetic:r,quoted:!0}},Q=function(r){return{type:"shell",shell:r,quoted:!0}},ae=function(r){return{type:"variable",...r,quoted:!0}},de=function(r){return{type:"text",text:r}},se=function(r){return{type:"arithmetic",arithmetic:r,quoted:!1}},En=function(r){return{type:"shell",shell:r,quoted:!1}},kn=function(r){return{type:"variable",...r,quoted:!1}},tn=function(r){return{type:"glob",pattern:r}},jr=/^[^']/,Fr=We(["'"],!0,!1),$r=function(r){return r.join("")},sn=/^[^$"]/,on=We(["$",'"'],!0,!1),Kr=`\\
|
|
@@ -55,5 +55,5 @@ ${Se}:`:`${ge}:`,je=ve.startsWith(`
|
|
|
55
55
|
${ne}`:`${ne}`}throw new Error(`Unsupported value type (${v})`)}function m(v){try{const $=w(v,0,!1);return $!==`
|
|
56
56
|
`?$:""}catch($){throw $.location&&($.message=$.message.replace(/(\.)?$/,` (line ${$.location.start.line}, column ${$.location.start.column})$1`)),$}}m.PreserveOrdering=h;function A(v){return v.endsWith(`
|
|
57
57
|
`)||(v+=`
|
|
58
|
-
`),(0,g.parse)(v)}const x=/^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i;function Y(v){if(x.test(v))return A(v);const $=(0,a.load)(v,{schema:a.FAILSAFE_SCHEMA,json:!0});if($==null)return{};if(typeof $!="object")throw new Error(`Expected an indexed object, got a ${typeof $} instead. Does your file follow Yaml's rules?`);if(Array.isArray($))throw new Error("Expected an indexed object, got an array instead. Does your file follow Yaml's rules?");return $}function y(v){return Y(v)}return Rr}var Qt;function Go(){return Qt||(Qt=1,(function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.stringifySyml=a.parseSyml=a.stringifyResolution=a.parseResolution=a.stringifyValueArgument=a.stringifyShellLine=a.stringifyRedirectArgument=a.stringifyEnvSegment=a.stringifyCommandLineThen=a.stringifyCommandLine=a.stringifyCommandChainThen=a.stringifyCommandChain=a.stringifyCommand=a.stringifyArithmeticExpression=a.stringifyArgumentSegment=a.stringifyArgument=a.stringifyShell=a.parseShell=void 0;var g=bo();Object.defineProperty(a,"parseShell",{enumerable:!0,get:function(){return g.parseShell}}),Object.defineProperty(a,"stringifyShell",{enumerable:!0,get:function(){return g.stringifyShell}}),Object.defineProperty(a,"stringifyArgument",{enumerable:!0,get:function(){return g.stringifyArgument}}),Object.defineProperty(a,"stringifyArgumentSegment",{enumerable:!0,get:function(){return g.stringifyArgumentSegment}}),Object.defineProperty(a,"stringifyArithmeticExpression",{enumerable:!0,get:function(){return g.stringifyArithmeticExpression}}),Object.defineProperty(a,"stringifyCommand",{enumerable:!0,get:function(){return g.stringifyCommand}}),Object.defineProperty(a,"stringifyCommandChain",{enumerable:!0,get:function(){return g.stringifyCommandChain}}),Object.defineProperty(a,"stringifyCommandChainThen",{enumerable:!0,get:function(){return g.stringifyCommandChainThen}}),Object.defineProperty(a,"stringifyCommandLine",{enumerable:!0,get:function(){return g.stringifyCommandLine}}),Object.defineProperty(a,"stringifyCommandLineThen",{enumerable:!0,get:function(){return g.stringifyCommandLineThen}}),Object.defineProperty(a,"stringifyEnvSegment",{enumerable:!0,get:function(){return g.stringifyEnvSegment}}),Object.defineProperty(a,"stringifyRedirectArgument",{enumerable:!0,get:function(){return g.stringifyRedirectArgument}}),Object.defineProperty(a,"stringifyShellLine",{enumerable:!0,get:function(){return g.stringifyShellLine}}),Object.defineProperty(a,"stringifyValueArgument",{enumerable:!0,get:function(){return g.stringifyValueArgument}});var C=So();Object.defineProperty(a,"parseResolution",{enumerable:!0,get:function(){return C.parseResolution}}),Object.defineProperty(a,"stringifyResolution",{enumerable:!0,get:function(){return C.stringifyResolution}});var s=Vo();Object.defineProperty(a,"parseSyml",{enumerable:!0,get:function(){return s.parseSyml}}),Object.defineProperty(a,"stringifySyml",{enumerable:!0,get:function(){return s.stringifySyml}})})(Qn)),Qn}var zt=Go();const Zr="__metadata",Jo=a=>{const g=a.trim();if(g==="")return;const C=g.startsWith("@")?1:0,s=g.indexOf("@",C);if(s!==-1)return{name:g.slice(0,s),spec:g.slice(s+1)}},Qo=a=>a.split(",").map(g=>Jo(g)).filter(g=>g!==void 0),zo=a=>{const g=new Map;for(const C of Object.keys(a)){if(C==="__metadata")continue;const s=Qo(C),h=new Map;for(const{name:e,spec:d}of s){const w=h.get(e);w?w.push(d):h.set(e,[d])}for(const[e,d]of h){const w=g.get(e);w?w.push({key:C,specs:d}):g.set(e,[{key:C,specs:d}])}}return g},Xt=(a,g,C)=>{const s=a.get(g);if(!s)return[];const h=new Set([C]);return C.includes(":")?C.startsWith("npm:")&&h.add(C.slice(4)):h.add(`npm:${C}`),s.filter(d=>d.specs.some(w=>h.has(w))).map(d=>d.key)},Xo=(a,g)=>{const C=new Set,s=new Set(g.map(h=>h.relativeRoot).filter(h=>h!==""));for(const[h,e]of Object.entries(a)){if(h==="__metadata")continue;const{resolution:d}=e;if(typeof d!="string"||!d.includes("@workspace:"))continue;const w=d.split("@workspace:")[1];w!==void 0&&(w==="."||s.has(w))&&C.add(h)}return C},Zo=a=>{const g=[];for(const C of[a.dependencies,a.optionalDependencies])if(C)for(const[s,h]of Object.entries(C))typeof h=="string"&&g.push({name:s,spec:h});return g},ef=a=>{const g=typeof a.lockfileContent=="string"?a.lockfileContent:a.lockfileContent.toString("utf8");let C;try{C=zt.parseSyml(g)}catch(y){throw new Ze(`yarn.lock: parse failed — ${y.message}`)}if(!C||typeof C!="object")throw new Ze("yarn.lock: top-level value is not an object");const s=zo(C),h=new Set;C[Zr]!==void 0&&h.add(Zr);const e=Xo(C,a.closure);for(const y of e)h.add(y);for(const y of a.closure)if(y.deps)for(const[v,$]of Object.entries(y.deps)){if(typeof $!="string"||$.startsWith("workspace:")||$.startsWith("link:")||$.startsWith("portal:"))continue;const P=Xt(s,v,$);for(const ie of P)h.add(ie)}const d=[...h];for(;d.length>0;){const y=d.shift();if(y==="__metadata")continue;const v=C[y];if(v)for(const{name:$,spec:P}of Zo(v)){if(P.startsWith("workspace:")||P.startsWith("link:")||P.startsWith("portal:"))continue;const ie=Xt(s,$,P);for(const oe of ie)h.has(oe)||(h.add(oe),d.push(oe))}}const w={};for(const y of Object.keys(C))h.has(y)&&(w[y]=C[y]);const m=Object.keys(C).length-(C[Zr]===void 0?0:1),A=h.size-(h.has(Zr)?1:0),x=m-A,Y=C[Zr]!==void 0;return{content:zt.stringifySyml(w),message:`yarn.lock (${Y?"berry":"classic"}): kept ${A}/${m} entries (dropped ${x})`,status:"pruned"}},rf=a=>{switch(a.packageManager){case"aube":return uo(a);case"bun":return yo(a);case"npm":return Ao(a);case"pnpm":return ts(a);case"yarn":return ef(a);default:{const g=a.packageManager;throw new Ze(`Unsupported package manager: ${g}`)}}},nf=(a,g)=>{const C=new Set,s=[a],h=new Set([a]);for(;s.length>0;){const e=s.shift(),d=g.dependencies[e]??[];for(const w of d)h.has(w.target)||(h.add(w.target),C.add(w.target),s.push(w.target))}return C},Cn="vis-docker-manifest.json",tf=["package.json","project.json"],sf=[{file:"bun.lock",manager:"bun"},{file:"bun.lockb",manager:"bun"},{file:"npm-shrinkwrap.json",manager:"npm"},{file:"package-lock.json",manager:"npm"},{file:"pnpm-lock.yaml",manager:"pnpm"},{file:"yarn.lock",manager:"yarn"}],of=["package.json","pnpm-workspace.yaml",".npmrc","vis.config.ts","vis.config.mts","vis.config.cts","vis.config.js","vis.config.mjs","vis.config.cjs"],ff=(a,g)=>{const C=new Set(a);for(const s of a){const h=nf(s,g);for(const e of h)C.add(e)}return C},qr=a=>{lo(a)},en=(a,g)=>{try{return qr(_i(g)),rs(a,g),!0}catch(C){if(C.code==="ENOENT")return!1;throw C}},ls=(a,g)=>{let C;try{C=no(a)}catch{return}if(!C.isSymbolicLink()){if(C.isFile()){qr(_i(g)),rs(a,g);return}qr(g);for(const s of io(a,{withFileTypes:!0}))s.name==="node_modules"||s.name===".git"||s.isSymbolicLink()||ls(Le(a,s.name),Le(g,s.name))}},Zt=a=>{if(!es(a))return;let g;try{g=ns(a)}catch{return}const C={};for(const s of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){const h=g[s];if(!(h===null||typeof h!="object"||Array.isArray(h)))for(const[e,d]of Object.entries(h))typeof d=="string"&&(C[e]=d)}return{deps:C,name:typeof g.name=="string"?g.name:void 0}},
|
|
59
|
-
`),{projects:[...x]}},
|
|
58
|
+
`),(0,g.parse)(v)}const x=/^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i;function Y(v){if(x.test(v))return A(v);const $=(0,a.load)(v,{schema:a.FAILSAFE_SCHEMA,json:!0});if($==null)return{};if(typeof $!="object")throw new Error(`Expected an indexed object, got a ${typeof $} instead. Does your file follow Yaml's rules?`);if(Array.isArray($))throw new Error("Expected an indexed object, got an array instead. Does your file follow Yaml's rules?");return $}function y(v){return Y(v)}return Rr}var Qt;function Go(){return Qt||(Qt=1,(function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.stringifySyml=a.parseSyml=a.stringifyResolution=a.parseResolution=a.stringifyValueArgument=a.stringifyShellLine=a.stringifyRedirectArgument=a.stringifyEnvSegment=a.stringifyCommandLineThen=a.stringifyCommandLine=a.stringifyCommandChainThen=a.stringifyCommandChain=a.stringifyCommand=a.stringifyArithmeticExpression=a.stringifyArgumentSegment=a.stringifyArgument=a.stringifyShell=a.parseShell=void 0;var g=bo();Object.defineProperty(a,"parseShell",{enumerable:!0,get:function(){return g.parseShell}}),Object.defineProperty(a,"stringifyShell",{enumerable:!0,get:function(){return g.stringifyShell}}),Object.defineProperty(a,"stringifyArgument",{enumerable:!0,get:function(){return g.stringifyArgument}}),Object.defineProperty(a,"stringifyArgumentSegment",{enumerable:!0,get:function(){return g.stringifyArgumentSegment}}),Object.defineProperty(a,"stringifyArithmeticExpression",{enumerable:!0,get:function(){return g.stringifyArithmeticExpression}}),Object.defineProperty(a,"stringifyCommand",{enumerable:!0,get:function(){return g.stringifyCommand}}),Object.defineProperty(a,"stringifyCommandChain",{enumerable:!0,get:function(){return g.stringifyCommandChain}}),Object.defineProperty(a,"stringifyCommandChainThen",{enumerable:!0,get:function(){return g.stringifyCommandChainThen}}),Object.defineProperty(a,"stringifyCommandLine",{enumerable:!0,get:function(){return g.stringifyCommandLine}}),Object.defineProperty(a,"stringifyCommandLineThen",{enumerable:!0,get:function(){return g.stringifyCommandLineThen}}),Object.defineProperty(a,"stringifyEnvSegment",{enumerable:!0,get:function(){return g.stringifyEnvSegment}}),Object.defineProperty(a,"stringifyRedirectArgument",{enumerable:!0,get:function(){return g.stringifyRedirectArgument}}),Object.defineProperty(a,"stringifyShellLine",{enumerable:!0,get:function(){return g.stringifyShellLine}}),Object.defineProperty(a,"stringifyValueArgument",{enumerable:!0,get:function(){return g.stringifyValueArgument}});var C=So();Object.defineProperty(a,"parseResolution",{enumerable:!0,get:function(){return C.parseResolution}}),Object.defineProperty(a,"stringifyResolution",{enumerable:!0,get:function(){return C.stringifyResolution}});var s=Vo();Object.defineProperty(a,"parseSyml",{enumerable:!0,get:function(){return s.parseSyml}}),Object.defineProperty(a,"stringifySyml",{enumerable:!0,get:function(){return s.stringifySyml}})})(Qn)),Qn}var zt=Go();const Zr="__metadata",Jo=a=>{const g=a.trim();if(g==="")return;const C=g.startsWith("@")?1:0,s=g.indexOf("@",C);if(s!==-1)return{name:g.slice(0,s),spec:g.slice(s+1)}},Qo=a=>a.split(",").map(g=>Jo(g)).filter(g=>g!==void 0),zo=a=>{const g=new Map;for(const C of Object.keys(a)){if(C==="__metadata")continue;const s=Qo(C),h=new Map;for(const{name:e,spec:d}of s){const w=h.get(e);w?w.push(d):h.set(e,[d])}for(const[e,d]of h){const w=g.get(e);w?w.push({key:C,specs:d}):g.set(e,[{key:C,specs:d}])}}return g},Xt=(a,g,C)=>{const s=a.get(g);if(!s)return[];const h=new Set([C]);return C.includes(":")?C.startsWith("npm:")&&h.add(C.slice(4)):h.add(`npm:${C}`),s.filter(d=>d.specs.some(w=>h.has(w))).map(d=>d.key)},Xo=(a,g)=>{const C=new Set,s=new Set(g.map(h=>h.relativeRoot).filter(h=>h!==""));for(const[h,e]of Object.entries(a)){if(h==="__metadata")continue;const{resolution:d}=e;if(typeof d!="string"||!d.includes("@workspace:"))continue;const w=d.split("@workspace:")[1];w!==void 0&&(w==="."||s.has(w))&&C.add(h)}return C},Zo=a=>{const g=[];for(const C of[a.dependencies,a.optionalDependencies])if(C)for(const[s,h]of Object.entries(C))typeof h=="string"&&g.push({name:s,spec:h});return g},ef=a=>{const g=typeof a.lockfileContent=="string"?a.lockfileContent:a.lockfileContent.toString("utf8");let C;try{C=zt.parseSyml(g)}catch(y){throw new Ze(`yarn.lock: parse failed — ${y.message}`)}if(!C||typeof C!="object")throw new Ze("yarn.lock: top-level value is not an object");const s=zo(C),h=new Set;C[Zr]!==void 0&&h.add(Zr);const e=Xo(C,a.closure);for(const y of e)h.add(y);for(const y of a.closure)if(y.deps)for(const[v,$]of Object.entries(y.deps)){if(typeof $!="string"||$.startsWith("workspace:")||$.startsWith("link:")||$.startsWith("portal:"))continue;const P=Xt(s,v,$);for(const ie of P)h.add(ie)}const d=[...h];for(;d.length>0;){const y=d.shift();if(y==="__metadata")continue;const v=C[y];if(v)for(const{name:$,spec:P}of Zo(v)){if(P.startsWith("workspace:")||P.startsWith("link:")||P.startsWith("portal:"))continue;const ie=Xt(s,$,P);for(const oe of ie)h.has(oe)||(h.add(oe),d.push(oe))}}const w={};for(const y of Object.keys(C))h.has(y)&&(w[y]=C[y]);const m=Object.keys(C).length-(C[Zr]===void 0?0:1),A=h.size-(h.has(Zr)?1:0),x=m-A,Y=C[Zr]!==void 0;return{content:zt.stringifySyml(w),message:`yarn.lock (${Y?"berry":"classic"}): kept ${A}/${m} entries (dropped ${x})`,status:"pruned"}},rf=a=>{switch(a.packageManager){case"aube":return uo(a);case"bun":return yo(a);case"npm":return Ao(a);case"pnpm":return ts(a);case"yarn":return ef(a);default:{const g=a.packageManager;throw new Ze(`Unsupported package manager: ${g}`)}}},nf=(a,g)=>{const C=new Set,s=[a],h=new Set([a]);for(;s.length>0;){const e=s.shift(),d=g.dependencies[e]??[];for(const w of d)h.has(w.target)||(h.add(w.target),C.add(w.target),s.push(w.target))}return C},Cn="vis-docker-manifest.json",tf=["package.json","project.json"],sf=[{file:"bun.lock",manager:"bun"},{file:"bun.lockb",manager:"bun"},{file:"npm-shrinkwrap.json",manager:"npm"},{file:"package-lock.json",manager:"npm"},{file:"pnpm-lock.yaml",manager:"pnpm"},{file:"yarn.lock",manager:"yarn"}],of=["package.json","pnpm-workspace.yaml",".npmrc","vis.config.ts","vis.config.mts","vis.config.cts","vis.config.js","vis.config.mjs","vis.config.cjs"],ff=(a,g)=>{const C=new Set(a);for(const s of a){const h=nf(s,g);for(const e of h)C.add(e)}return C},qr=a=>{lo(a)},en=(a,g)=>{try{return qr(_i(g)),rs(a,g),!0}catch(C){if(C.code==="ENOENT")return!1;throw C}},ls=(a,g)=>{let C;try{C=no(a)}catch{return}if(!C.isSymbolicLink()){if(C.isFile()){qr(_i(g)),rs(a,g);return}qr(g);for(const s of io(a,{withFileTypes:!0}))s.name==="node_modules"||s.name===".git"||s.isSymbolicLink()||ls(Le(a,s.name),Le(g,s.name))}},Zt=a=>{if(!es(a))return;let g;try{g=ns(a)}catch{return}const C={};for(const s of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){const h=g[s];if(!(h===null||typeof h!="object"||Array.isArray(h)))for(const[e,d]of Object.entries(h))typeof d=="string"&&(C[e]=d)}return{deps:C,name:typeof g.name=="string"?g.name:void 0}},gf=a=>{const{focus:g,includeSources:C=!1,log:s=P=>{console.log(P)},outDir:h,projectGraph:e,pruneLockfile:d=!0,workspace:w,workspaceRoot:m}=a,A=g.filter(P=>w.projects[P]===void 0);if(A.length>0)throw new Error(`Unknown focus project(s): ${A.join(", ")}. Check project names in your workspace.`);const x=ff(g,e),Y=Le(h,"workspace"),y=Le(h,"sources");ki(Y,{force:!0,recursive:!0}),ki(y,{force:!0,recursive:!0}),qr(Y);for(const P of of)en(Le(m,P),Le(Y,P));const v=Zt(Le(m,"package.json")),$=[{deps:v?.deps,name:v?.name,relativeRoot:""}];for(const P of x){const ie=w.projects[P];if(!ie?.root)continue;for(const R of tf)en(Le(m,ie.root,R),Le(Y,ie.root,R));const oe=Zt(Le(m,ie.root,"package.json"));$.push({deps:oe?.deps,name:oe?.name,relativeRoot:ie.root})}for(const{file:P,manager:ie}of sf){const oe=Le(m,P);if(!es(oe))continue;const R=Le(Y,P);if(!d){en(oe,R);continue}const V=P.endsWith(".lockb")?at(oe):at(oe,"utf8");try{const ne=rf({closure:$,displayName:P,lockfileContent:V,packageManager:ie});ne.status==="pruned"&&ne.content!==void 0?(qr(_i(R)),ut(R,ne.content)):en(oe,R),s(ne.message)}catch(ne){if(ne instanceof Ze)s(`${P}: pruning failed (${ne.message}); copying verbatim`),en(oe,R);else throw ne}}if(C){qr(y);for(const P of g){const ie=w.projects[P];ie?.root&&ls(Le(m,ie.root),Le(y,ie.root))}}return ut(Le(h,Cn),`${JSON.stringify({focus:g,projects:[...x].sort()},null,2)}
|
|
59
|
+
`),{projects:[...x]}},df=a=>{const{contextRoot:g,workspace:C,workspaceRoot:s}=a,h=Le(g,Cn);if(!fo(h))throw new Error(`No ${Cn} at ${g}. Run \`vis docker scaffold\` first.`);const e=ns(h);if(!Array.isArray(e.projects))throw new TypeError(`Invalid ${Cn}: "projects" must be an array.`);const d=new Set(e.projects),w=[];for(const[m,A]of Object.entries(C.projects)){if(d.has(m)||!A.root)continue;const x=Le(s,A.root),Y=to(s,x);Y===""||Y==="."||Y.startsWith("..")||(ki(x,{force:!0,recursive:!0}),w.push(Y))}return{removed:w}};export{df as p,ff as r,gf as s};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{createRequire as ze}from"node:module";import{e as M,z as Fe}from"./index-BzhrR_iC.js";import{r as qe}from"./docker-DXqV-07f.js";import{parse as We}from"../packem_chunks/index4.js";import Re from"../packem_chunks/index.js";import{b as fe,l as Ke,a as Ze,d as Qe,e as en,f as nn,g as tn}from"./multi-eco-lockfiles-B2X3yhyo.js";import{p as ke,r as ue,c as sn}from"./composer-DR3D-Psb.js";import{p as Ie}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{e as on}from"./license-DvlYdo6T.js";import{S as rn}from"./lockfile-DhHAaHN5.js";import{a as cn}from"./index-B4AjSxHU.js";import{V as Le}from"./vis-user-error-75VtCwMv.js";import{w as an,r as pn,Z as Ce}from"./zig-manifest-P7ydLEOa.js";let He;const Ve=e=>(He??=ze(import.meta.url))(e),ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,be=e=>{if(typeof ee<"u"&&ee.versions&&ee.versions.node){const[t,n]=ee.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return ee.getBuiltinModule(e)}return Ve(e)},{randomUUID:Be}=be("node:crypto"),{readFileSync:G,readdirSync:Pe,statSync:Xe,existsSync:Je}=be("node:fs"),{join:A,relative:$e,resolve:De,basename:Ye}=be("node:path"),ne=e=>e.replaceAll(/[^\w.~-]/g,t=>`%${(t.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),j=(e,t)=>{const n=e.toLowerCase();if(n.startsWith("@")){const s=n.indexOf("/");if(s>0){const o=n.slice(0,s),r=n.slice(s+1);return`pkg:npm/${ne(o)}/${ne(r)}@${ne(t)}`}}return`pkg:npm/${ne(n)}@${ne(t)}`},_={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},ln=[_.STRING,_.NUMBER,_.BOOLEAN],un='<?xml version="1.0" encoding="UTF-8"?>',Ee=["_selfCloseTag","_attrs"],fn=(e="",t=0)=>e.repeat(t),pe=e=>Array.isArray(e)&&_.ARRAY||typeof e===_.OBJECT&&e!==null&&e._name&&_.JSTOXML_OBJECT||e instanceof Date&&_.DATE||e===null&&_.NULL||typeof e,Ue=e=>e.startsWith("<![CDATA["),je=(e="",t={},n)=>{let s=e;if(typeof e===_.STRING){if(Ue(e))return e;const o=new RegExp(`(${Object.keys(t).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(o,(r,l)=>t[l]||"")}return typeof n=="function"?n(s):s},dn=(e={},t,n,s)=>(Array.isArray(e)?e:Object.entries(e).map(([r,l])=>({[r]:l}))).reduce((r,l)=>{const c=Object.keys(l)[0],i=l[c];if(typeof n===_.FUNCTION&&n(c,i))return r;const a=t?je(i,t):i,f=!s&&a===!0?"":`="${a}"`;return r.push(`${c}${f}`),r},[]),mn=(e={},t,n,s)=>{const o=dn(e,t,n,s);return o.length===0?"":` ${o.join(" ")}`},hn=(e={})=>Object.keys(e).map(t=>({_name:t,_content:e[t]})),gn=e=>ln.includes(pe(e)),vn=e=>!e.match("<"),yn=({header:e,isOutputStart:t})=>e&&t?typeof e===_.BOOLEAN?un:e:"",Ae={"<":"<",">":">","&":"&",'"':"""},q=(e={},t={})=>{const{depth:n=0,indent:s,_isFirstItem:o,_isOutputStart:r=!0,header:l,attributeReplacements:c={},attributeFilter:i,attributeExplicitTrue:a=!1,contentReplacements:f={},contentMap:g,selfCloseTags:y=!0}=t,X=typeof c=="boolean"&&!c?{}:{...Ae,...c},z=typeof f=="boolean"&&!f?{}:{...Ae,...f},N=typeof s=="string",H=fn(s,n),J=pe(e),Y=yn({header:l,isOutputStart:r}),O=r&&!Y&&o&&n===0,V=N&&!O?`
|
|
2
|
+
`:"";let k="";switch(J){case _.JSTOXML_OBJECT:{const{_name:b,_content:S}=e;if(S===null&&typeof g!="function"){k=`${V}${H}${b}`;break}if(Array.isArray(S)&&S.every(gn))return S.map(ae=>q({_name:b,_content:ae},{...t,depth:n,_isOutputStart:!1})).join("");if(Ee.includes(b))break;const $=q(S,{...t,depth:n+1,_isOutputStart:O}),B=pe($),E=vn($),oe=Ue($),T=`${V}${H}`;if(b==="_comment"){k+=`${T}<!-- ${S} -->`;break}const R=B==="undefined"||$==="",D=y,W=e._selfCloseTag,K=typeof W===_.BOOLEAN?R&&W:R&&D,I=K?"/":"",re=mn(e._attrs,X,i,a),Z=`<${b}${re}${I}>`,ce=N&&!E&&!oe?`
|
|
3
|
+
${H}`:"",ie=K?"":`${$}${ce}</${b}>`;k+=`${T}${Z}${ie}`;break}case _.OBJECT:{const b=Object.keys(e);k=b.map((v,$)=>{const B={...t,_isFirstItem:$===0,_isLastItem:$+1===b.length,_isOutputStart:O},E={_name:v};if(pe(e[v])===_.OBJECT&&(Ee.forEach(R=>{const D=e[v][R];typeof D<"u"&&(E[R]=D,delete e[v][R])}),typeof e[v]._content<"u"&&Object.keys(e[v]).length>1)){const R=Object.assign({},e[v]);delete R._content,E._content=[...hn(R),e[v]._content]}return typeof E._content>"u"&&(E._content=e[v]),q(E,B)},t).join("");break}case _.FUNCTION:{const b=e(t);k=q(b,t);break}case _.ARRAY:{k=e.map((S,v)=>{const $={...t,_isFirstItem:v===0,_isLastItem:v+1===e.length,_isOutputStart:O};return q(S,$)}).join("");break}default:{k=je(e,z,g);break}}return`${Y}${k}`},_n=(e,t)=>`pkg:cargo/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,se=e=>e,bn=e=>{const t=e.split(" ")[0];if(t===void 0||t==="")return;const n=/^\S+\s+(\d[^\s(]*)/.exec(e)?.[1],s=/\(([^)]+)\)/.exec(e)?.[1];return{kind:"main",name:t,source:s,version:n}},$n=e=>{const t=[];let n,s=!1;const o=()=>{n?.name!==void 0&&n.version!==void 0&&t.push({deps:n.deps,member:n.source===void 0,name:n.name,source:n.source,version:n.version})};for(const r of e.split(`
|
|
4
|
+
`)){const l=r.trim();if(l==="[[package]]"){o(),n={deps:[]},s=!1;continue}if(n===void 0)continue;if(s){const i=/^"([^"]+)",?$/.exec(l);if(i){const a=bn(i[1]);a!==void 0&&n.deps.push(a)}else l==="]"&&(s=!1);continue}if(l==="dependencies = ["){s=!0;continue}const c=/^(name|version|source)\s*=\s*"([^"]*)"$/.exec(l);if(c){const[,i="",a=""]=c;i==="name"?n.name=a:i==="version"?n.version=a:n.source=a}}return o(),t},Cn=(e,t)=>{const n=typeof t=="object"&&t!==null?t.package:void 0;return typeof n=="string"?n:e},Sn=(e,t)=>{const n=Array.isArray(t.workspace?.members)?t.workspace.members.filter(r=>typeof r=="string"):[],s=Array.isArray(t.workspace?.exclude)?t.workspace.exclude.filter(r=>typeof r=="string"):[],o=new Set;for(const r of n){let l=[e];for(const c of r.split("/").filter(i=>i!==""&&i!==".")){const i=[];for(const a of l){if(!/[*?[{]/.test(c)){i.push(A(a,c));continue}let f;try{f=Pe(a)}catch{f=[]}for(const g of f){const y=A(a,g);Re(c,g)&&Xe(y).isDirectory()&&i.push(y)}}l=i}for(const c of l){const i=c.slice(e.length+1).split("\\").join("/");s.some(a=>Re(a,i))||o.add(c)}}return[...o]},Rn=e=>{const t=new Map;let n;try{n=Oe(G(A(e,"Cargo.toml"),"utf8"))}catch{return t}const s=Sn(e,n);n.package?.name!==void 0&&s.push(e);for(const o of s){let r;try{r=Oe(G(A(o,"Cargo.toml"),"utf8"))}catch{continue}if(typeof r.package?.name!="string")continue;const l=new Set,c=i=>{for(const[a,f]of Object.entries(i??{}))l.add(se(Cn(a,f)))};c(r.dependencies),c(r["build-dependencies"]);for(const i of Object.values(r.target??{}))c(i.dependencies),c(i["build-dependencies"]);t.set(se(r.package.name),l)}return t},Oe=e=>We(e),kn=(e,t={})=>{let n;try{n=G(A(e,"Cargo.lock"),"utf8")}catch{return{components:[],dependencies:[]}}const s=Rn(e),o=$n(n).map(r=>{const l=r.member?s.get(se(r.name)):void 0;return l===void 0?r:{...r,deps:r.deps.map(c=>l.has(se(c.name))?c:{...c,kind:"dev"})}});return fe(o,{focusNames:t.focusNames,includeDev:t.includeDev,normalize:se,purl:_n})},En=(e,t)=>`pkg:composer/${e.split("/").map(n=>encodeURIComponent(n)).join("/")}@${encodeURIComponent(t)}`,te=e=>e.toLowerCase(),An=e=>{const t=[];for(const[n,s]of[["packages",!1],["packages-dev",!0]]){const o=e[n];if(Array.isArray(o))for(const r of o){if(typeof r.name!="string"||typeof r.version!="string")continue;const l=[...ue(r,"require").map(c=>({kind:s?"dev":"main",name:c})),...ue(r,"require-dev").map(c=>({kind:"dev",name:c}))];t.push({deps:l,member:!1,name:r.name,version:sn(r.version)})}}return t},On=(e,t={})=>{const n={components:[],dependencies:[]};let s,o;try{s=ke(G(A(e,"composer.lock"),"utf8")),o=ke(G(A(e,"composer.json"),"utf8"))}catch{return n}const r=typeof o.name=="string"?te(o.name):void 0;if(t.focusNames!==void 0&&!t.focusNames.some(i=>te(i)===r))return n;const l=new Set([...ue(o,"require"),...t.includeDev?ue(o,"require-dev"):[]].map(i=>te(i))),c=An(s).map(i=>({...i,member:l.has(te(i.name))}));return fe(c,{includeDev:t.includeDev,normalize:te,purl:En})},Te=e=>e.split("/").map(t=>encodeURIComponent(t)).join("/"),Tn={Go:(e,t)=>`pkg:golang/${Te(e)}@${encodeURIComponent(t)}`,Pub:(e,t)=>`pkg:pub/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,SwiftURL:(e,t)=>`pkg:swift/${Te(e)}@${encodeURIComponent(t)}`},wn=(e,t)=>{const n=Ke(e,t).map(s=>{const o=Tn[t](s.name,s.version);return{"bom-ref":o,name:s.name,purl:o,type:"library",version:s.version}}).sort((s,o)=>(s["bom-ref"]??"").localeCompare(o["bom-ref"]??""));return{components:n,dependencies:n.map(s=>({ref:s["bom-ref"]??""}))}},xn=(e,t)=>`pkg:gem/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,Nn=/^ {4}(\S+) \(([^()]+)\)\s*$/,Pn=/^ {6}(\S+)(?: \(.*\))?\s*$/,Dn=e=>{const t=new Map;let n,s,o;for(const r of e.split(/\r?\n/)){if(r.length>0&&!r.startsWith(" ")){n=r.trim(),s=void 0,o=void 0;continue}if(n!=="PATH"&&n!=="GEM"&&n!=="GIT")continue;const l=/^ {2}remote: (.+)$/.exec(r);if(l?.[1]!==void 0){s=l[1].trim();continue}const c=Nn.exec(r);if(c?.[1]!==void 0&&c[2]!==void 0){const a=c[1],f=c[2].split("-")[0]??c[2],g=n==="GIT"&&s!==void 0?`git:${s}`:void 0,y=`${a}\0${f}\0${g??""}`;o=t.get(y)??{deps:[],member:n==="PATH",name:a,source:g,version:f},t.set(y,o);continue}const i=Pn.exec(r);i?.[1]!==void 0&&o!==void 0&&o.deps.push({kind:"main",name:i[1]})}return[...t.values()]},In=(e,t={})=>{let n;try{n=G(A(e,"Gemfile.lock"),"utf8")}catch{return{components:[],dependencies:[]}}return fe(Dn(n),{focusNames:t.focusNames,includeDev:t.includeDev,normalize:s=>s,purl:xn})},ye=e=>{try{return Ie(e)}catch{return}},Ln=e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const t=e.indexOf("/");return t>1&&!e.includes("/",t+1)}return!e.includes("/")},Un=e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),jn=(e,t,n)=>{const o=`${t.replaceAll("/","+")}@${n}`,r=M(e,"node_modules",".pnpm"),l=ye(M(r,o,"node_modules",t,"package.json"));if(l)return l;let c;try{c=Pe(r)}catch{return}const i=`${o}_`;for(const a of c){if(!a.startsWith(i))continue;const f=ye(M(r,a,"node_modules",t,"package.json"));if(f)return f}},Mn=(e,t,n)=>{const s=ye(M(e,"node_modules",t,"package.json"));return s?.version===n?s:void 0},Gn=(e,t,n)=>{if(!(!Ln(t)||!Un(n)))return jn(e,t,n)??Mn(e,t,n)},zn={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},Hn={sha256:64,sha384:96,sha512:128},Vn=e=>{const t={name:e.name,version:e.version},{integrity:n}=e;return n&&n.hex.length===Hn[n.algorithm]&&(t.hash={alg:zn[n.algorithm],content:n.hex}),e.dependencies&&(t.dependencies=e.dependencies),e.peerDependencies&&(t.peerDependencies=e.peerDependencies),e.optionalDependencies&&(t.optionalDependencies=e.optionalDependencies),t},Bn=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Fn=e=>{for(const{file:t,type:n}of Bn){let s;try{s=Fe(M(e,t))}catch{continue}const o=new Map;for(const r of rn(s,n))o.set(`${r.name}@${r.version}`,Vn(r));return{packages:o,type:n}}},Me=e=>e.toLowerCase().replaceAll(/[-_.]+/g,"-"),qn=(e,t)=>`pkg:pypi/${encodeURIComponent(Me(e))}@${encodeURIComponent(t)}`,Xn=/^source\s*=\s*\{\s*(?:editable|virtual|directory)\s*=/,Jn=/\{\s*name\s*=\s*"([^"]+)"([^}]*)\}/,Yn=e=>{const t=[];let n,s="none",o=!1;const r=()=>{n?.name!==void 0&&n.version!==void 0&&t.push({deps:n.deps,member:n.member,name:n.name,source:n.source,version:n.version})};for(const l of e.split(`
|
|
5
|
+
`)){const c=l.trim();if(c==="[[package]]"){r(),n={deps:[],member:!1},s="none",o=!1;continue}if(n===void 0)continue;if(c.startsWith("[")){s=c==="[package.optional-dependencies]"?"optional":c==="[package.dev-dependencies]"?"dev":"none",o=!1;continue}if(o){if(c==="]"||c==="],"){o=!1,s=s==="main"?"none":s;continue}const f=Jn.exec(c);if(f&&s!=="none"){const g=/version\s*=\s*"([^"]*)"/.exec(f[2]??"")?.[1];n.deps.push({kind:s,name:f[1],version:g})}continue}if(c==="dependencies = ["){s="main",o=!0;continue}if((s==="optional"||s==="dev")&&/^[\w.-]+\s*=\s*\[$/.test(c)){o=!0;continue}if(Xn.test(c)){n.member=!0;continue}const i=/^source\s*=\s*\{\s*(\w+)\s*=\s*"([^"]*)"/.exec(c);if(i&&s==="none"){n.source=`${i[1]}:${i[2]}`;continue}const a=/^(name|version|source)\s*=\s*"?([^"}]*)"?$/.exec(c);if(a&&s==="none"){const[,f="",g=""]=a;f==="name"?n.name=g:f==="version"&&(n.version=g)}}return r(),t},Wn=(e,t={})=>{let n;try{n=G(A(e,"uv.lock"),"utf8")}catch{return{components:[],dependencies:[]}}return fe(Yn(n),{focusNames:t.focusNames,includeDev:t.includeDev,normalize:Me,purl:qn})},Kn=e=>{const t=e.indexOf(":");return t<=0?e:e.slice(0,t)==="npm"?e.slice(t+1):e},ge=(e,t,n)=>{const s=n.get(e);if(!s||s.size===0)return;if(s.has(t))return t;const o=Kn(t);if(o!==t&&s.has(o))return o;const r=[...s],l=cn.maxSatisfying(r,o,{includePrerelease:!0});return l||r[0]},Zn=/^(?<repo>\/.+?)\/archive\/refs\/tags\/(?<tag>.+)\.(?:tar\.gz|tgz|zip)$/,Qn=/^1220([0-9a-f]{64})$/i,we="vis:zig:version",et="vis:zig:hash",nt="vis:zig:path",Ge=e=>e.replaceAll("\\","/"),tt=e=>{const t=new Map;try{for(const s of an(e,e,pn))for(const o of s.manifest.dependencies){const r=st(o,s.dir,s.path,e);t.has(r)||t.set(r,ot(o,s.dir,s.path,e,r))}}catch(s){throw s instanceof Ce?new Le(s.message):s}const n=[...t.values()].sort((s,o)=>(s["bom-ref"]??"").localeCompare(o["bom-ref"]??""));return{components:n,dependencies:n.map(s=>({ref:s["bom-ref"]??""}))}},st=(e,t,n,s)=>{if(e.url!==void 0)return`url:${e.url}`;if(e.path!==void 0)return`path:${Ge($e(s,De(t,e.path)))}`;throw new Ce(n,`${n} line ${String(e.line)}: dependency .${e.name} has neither .url nor .path.`)},ot=(e,t,n,s,o)=>{const r=`zig:${o}`;if(e.url===void 0){const y=De(t,e.path??""),x=Ye(y);return{"bom-ref":r,name:x,properties:[{name:we,value:"unversioned: local path dependency"},{name:nt,value:Ge($e(s,y))}],purl:`pkg:generic/${encodeURIComponent(x)}`,type:"library"}}const{name:l,purl:c,tag:i}=rt(e.url,n),a=[],f=[];if(i===void 0&&a.push({name:we,value:"unversioned: URL is not a tag archive"}),e.hash!==void 0){const y=Qn.exec(e.hash);y?.[1]===void 0?a.push({name:et,value:e.hash}):f.push({alg:"SHA-256",content:y[1].toLowerCase()})}const g=[{type:"distribution",url:e.url}];return{"bom-ref":r,externalReferences:g,hashes:f.length>0?f:void 0,name:l,properties:a.length>0?a:void 0,purl:c,type:"library",version:i===void 0?void 0:i.replace(/^v/,"")}},rt=(e,t)=>{let n;try{n=new URL(e.startsWith("git+")?e.slice(4):e)}catch{throw new Ce(t,`${t}: dependency URL "${e}" is not a valid URL.`)}const s=Zn.exec(n.pathname),o=s?.groups?.tag,r=(s?.groups?.repo??n.pathname.replace(/\/archive\/.*$/,"")).replace(/\.git$/,""),l=`${n.host}${r}`,c=r.split("/").filter(a=>a!==""),i=o===void 0?"":`@${encodeURIComponent(o)}`;if(n.hostname==="github.com"&&c.length===2){const[a,f]=c;return{name:l,purl:`pkg:github/${a.toLowerCase()}/${f.toLowerCase()}${i}`,tag:o}}return{name:l,purl:`pkg:generic/${encodeURIComponent(l)}${i}?download_url=${encodeURIComponent(e)}`,tag:o}},ct={Go:"go",Pub:"dart",SwiftURL:"swift"},it="1.7",at="CycloneDX",pt="http://cyclonedx.org/schema/bom-1.7.schema.json",lt="@visulima/vis",xe=e=>{try{return Ie(e)}catch{return}},ut=e=>{if(e){if(typeof e=="string")return e;if(typeof e=="object"&&e.name)return e.email?`${e.name} <${e.email}>`:e.name}},ft=e=>{if(e)return typeof e=="string"?e:e.url},dt=e=>{if(e)return typeof e=="string"?e:e.url},mt=e=>{const t=[];e.homepage&&t.push({type:"website",url:e.homepage});const n=ft(e.repository);n&&t.push({type:"vcs",url:n});const s=dt(e.bugs);return s&&t.push({type:"issue-tracker",url:s}),t.length>0?t:void 0},ht=e=>e==="application"||e==="service"||e==="tool"?"application":"library",ve=(e,t)=>{if(!t)return;t.description&&(e.description=t.description);const n=ut(t.author);n&&(e.author=n);const s=on(t);s&&(e.licenses=s);const o=mt(t);o&&(e.externalReferences=o)},Pt=e=>{const{ecosystems:t=new Set,focus:n,generatorVersion:s,includeDev:o=!1,now:r=new Date,projectGraph:l,serialNumber:c,workspace:i,workspaceRoot:a}=e,f=n&&n.length>0?[...qe(n,l)].sort():Object.keys(i.projects).sort(),g=new Set(f),y=new Map;for(const p of f){const u=i.projects[p];u&&y.set(p,xe(M(a,u.root,"package.json")))}const x=[],X=new Map;for(const p of f){const u=i.projects[p];if(!u)continue;const m=y.get(p);if(!m)continue;const d=m.version??"0.0.0",h=j(p,d);X.set(p,h);const C={"bom-ref":h,name:p,purl:h,type:ht(u.projectType),version:d};ve(C,m),x.push(C)}const de=Fn(a),z=new Map,N=new Map;if(de)for(const p of de.packages.values()){z.set(`${p.name}@${p.version}`,p);let u=N.get(p.name);u||(u=new Set,N.set(p.name,u)),u.add(p.version)}const H=[],J=[],Y=new Map;for(const p of f){const u=y.get(p);if(!u)continue;const m=[u.dependencies,u.peerDependencies];o&&m.push(u.devDependencies);const d=new Set,h=(C,L)=>{if(L)for(const[U,P]of Object.entries(L)){if(g.has(U)){const F=X.get(U);F&&d.add(F);continue}const w=ge(U,P,N);w&&(d.add(j(U,w)),C.push(`${U}@${w}`))}};for(const C of m)h(H,C);h(J,u.optionalDependencies),Y.set(p,d)}const O=new Map,V=new Map,k=(p,u)=>{const m=[...p];for(;m.length>0;){const d=m.pop(),h=O.get(d);if(h==="required"||h==="optional"&&u==="optional")continue;O.set(d,u);const C=z.get(d);if(!C)continue;const L=V.get(d)??new Set,U=[C.dependencies,C.peerDependencies];for(const P of U)if(P)for(const[w,F]of Object.entries(P))for(const Q of F){const he=ge(w,Q,N);he&&(L.add(j(w,he)),m.push(`${w}@${he}`))}if(C.optionalDependencies)for(const[P,w]of Object.entries(C.optionalDependencies))for(const F of w){const Q=ge(P,F,N);Q&&(L.add(j(P,Q)),J.push(`${P}@${Q}`))}L.size>0&&V.set(d,L)}};k(H,"required"),k(J,"optional");const b=[],S=[...O.keys()].sort();for(const p of S){const u=z.get(p);if(!u)continue;const m=j(u.name,u.version),d={"bom-ref":m,name:u.name,purl:m,scope:O.get(p)??"required",type:"library",version:u.version};u.hash&&(d.hashes=[u.hash]),ve(d,Gn(a,u.name,u.version)),b.push(d)}const v=[];for(const[p,u]of Y){const m=X.get(p);if(!m)continue;const d=[...u].sort();v.push(d.length>0?{dependsOn:d,ref:m}:{ref:m})}for(const p of S){const u=z.get(p);if(!u)continue;const m=j(u.name,u.version),d=V.get(p),h=d?[...d].sort():[];v.push(h.length>0?{dependsOn:h,ref:m}:{ref:m})}v.sort((p,u)=>p.ref.localeCompare(u.ref));const $=xe(M(a,"package.json")),B=(()=>{if(n?.length===1){const h=x.find(C=>C.name===n[0]);if(h)return{"bom-ref":h["bom-ref"],name:h.name,purl:h.purl,type:h.type,version:h.version}}const p=$?.name??"workspace",u=$?.version??"0.0.0",m=j(p,u),d={"bom-ref":m,name:p,purl:m,type:"application",version:u};return ve(d,$),d})(),E=B["bom-ref"],oe=E?x.filter(p=>p["bom-ref"]!==E):x,T={focusNames:n&&n.length>0?f:void 0,includeDev:o},R=kn(a,T),D=Wn(a,T),W=On(a,T),K=In(a,T),I={components:[],dependencies:[]},re=t.has("hex")?Ze(a,{includeDev:o}):I,Z=t.has("maven")?Qe(a,{focusNames:T.focusNames,includeDev:o}):I,ce=new Set(Z.components.map(p=>p["bom-ref"])),ie=t.has("gradle")?en(a,{includeDev:o}):I,me=["Go","Pub","SwiftURL"].filter(p=>t.has(ct[p])).map(p=>wn(a,p)),ae=t.has("nuget")?nn(a):I,Se=t.has("zig")?tt(a):I;return{$schema:pt,bomFormat:at,components:[...oe,...b,...R.components,...D.components,...W.components,...K.components,...re.components,...Z.components,...ie.components.filter(p=>!ce.has(p["bom-ref"])),...me.flatMap(p=>p.components),...ae.components,...Se.components],dependencies:[...v,...R.dependencies,...D.dependencies,...W.dependencies,...K.dependencies,...re.dependencies,...Z.dependencies,...ie.dependencies.filter(p=>!ce.has(p.ref)),...me.flatMap(p=>p.dependencies),...ae.dependencies,...Se.dependencies].sort((p,u)=>p.ref.localeCompare(u.ref)),metadata:{component:B,lifecycles:[{phase:"build"}],timestamp:r.toISOString(),tools:{components:[{name:lt,type:"application",...s?{version:s}:{}}]}},serialNumber:c??`urn:uuid:${Be()}`,specVersion:it,version:1}},Dt=e=>{const t={version:e.version??1,xmlns:"http://cyclonedx.org/schema/bom/1.7"};e.serialNumber&&(t.serialNumber=e.serialNumber);const n=[];return e.metadata&&n.push(gt(e.metadata)),e.components&&e.components.length>0&&n.push({_content:e.components.map(o=>_e(o)),_name:"components"}),e.dependencies&&e.dependencies.length>0&&n.push({_content:e.dependencies.map(o=>yt(o)),_name:"dependencies"}),`${q({_attrs:t,_content:n,_name:"bom"},{header:!0,indent:" ",selfCloseTags:!0})}
|
|
6
|
+
`},gt=e=>{const t=[];return e.timestamp&&t.push({timestamp:e.timestamp}),e.lifecycles&&e.lifecycles.length>0&&t.push({_content:e.lifecycles.map(n=>{const s=[];return n.phase&&s.push({phase:n.phase}),n.name&&s.push({name:n.name}),n.description&&s.push({description:n.description}),{_content:s,_name:"lifecycle"}}),_name:"lifecycles"}),e.tools?.components&&t.push({_content:[{_content:e.tools.components.map(n=>_e(n)),_name:"components"}],_name:"tools"}),e.component&&t.push(_e(e.component)),{_content:t,_name:"metadata"}},_e=e=>{const t={type:e.type};e["bom-ref"]&&(t["bom-ref"]=e["bom-ref"]);const n=[];e.group&&n.push({group:e.group}),n.push({name:e.name}),e.version&&n.push({version:e.version}),e.description&&n.push({description:e.description}),e.author&&n.push({author:e.author}),e.hashes&&e.hashes.length>0&&n.push({_content:e.hashes.map(o=>({_attrs:{alg:o.alg},_content:o.content,_name:"hash"})),_name:"hashes"});const s=vt(e.licenses);return s&&n.push(s),e.purl&&n.push({purl:e.purl}),e.scope&&n.push({scope:e.scope}),e.externalReferences&&e.externalReferences.length>0&&n.push({_content:e.externalReferences.map(o=>({_attrs:{type:o.type},_content:[{url:o.url}],_name:"reference"})),_name:"externalReferences"}),e.properties&&e.properties.length>0&&n.push({_content:e.properties.map(o=>({_attrs:{name:o.name},_content:o.value??"",_name:"property"})),_name:"properties"}),{_attrs:t,_content:n,_name:"component"}},vt=e=>{if(!e||e.length===0)return;const t=[];for(const n of e){if("expression"in n){t.push({expression:n.expression});continue}const s=[];"id"in n.license&&n.license.id?s.push({id:n.license.id}):"name"in n.license&&n.license.name&&s.push({name:n.license.name}),t.push({_content:s,_name:"license"})}return{_content:t,_name:"licenses"}},yt=e=>e.dependsOn&&e.dependsOn.length>0?{_attrs:{ref:e.ref},_content:e.dependsOn.map(t=>({_attrs:{ref:t},_name:"dependency"})),_name:"dependency"}:{_attrs:{ref:e.ref},_name:"dependency"},le=["maven","gradle","hex","go","dart","swift","nuget","zig"],Ne={dart:"pubspec.lock",go:"go.sum",hex:"mix.lock",maven:"pom.xml",nuget:"packages.lock.json",swift:"Package.resolved",zig:"build.zig.zon"},It=e=>{const t=[];for(const n of le){if(n==="gradle"){for(const s of tn(e))t.push({file:$e(e,s).split("\\").join("/"),id:n});continue}Je(A(e,Ne[n]))&&t.push({file:Ne[n],id:n})}return t},_t=e=>`${e}.discover`,Lt=e=>{const t=new Set;for(const n of le)e?.[n]?.discover===!0&&t.add(n);for(const n of e?.sbom?.ecosystems??[]){if(!le.includes(n))throw new Le(`sbom.ecosystems: unknown ecosystem "${n}". Expected one of: ${le.join(", ")}.`);t.add(n)}return t},Ut=e=>e.length===0?void 0:`vis sbom: ecosystems found by file, which does not show they are used. ${e.map(({file:n,id:s})=>`${n} found; not included. Set ${_t(s)} or add '${s}' to sbom.ecosystems.`).join(" ")}`;export{le as G,Dt as a,Pt as b,It as f,Lt as o,Ut as s,j as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as p}from"node:module";import{e as j}from"./index-BzhrR_iC.js";import{a as F}from"./formatBytes-BHAzNIrn-CrusHOew.js";let h;const m=t=>(h??=p(import.meta.url))(t),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=t=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,r]=s.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return s.getBuiltinModule(t)}return m(t)},{mkdirSync:f,writeFileSync:y,readdirSync:g}=c("node:fs"),{readFile:_}=c("node:fs/promises"),i=t=>F(t),a=(t,e)=>j(i(t),`${encodeURIComponent(e)}.json`);class R{#e;#t;constructor(e,r){this.#e=e,this.#t=r}printTaskTerminalOutput(e,r,o){if(r!=="failure")return;const n=i(this.#e);try{f(n,{recursive:!0})}catch{return}const u=e.overrides.command,d=e.projectRoot,l={command:u,cwd:d,exitCode:void 0,hash:e.hash,runId:this.#t,status:r,taskId:e.id,terminalOutput:o,timestamp:new Date().toISOString()};try{y(a(this.#e,e.id),`${JSON.stringify(l,void 0,2)}
|
|
2
|
+
`,"utf8")}catch{}}}const S=async(t,e)=>{const r=a(t,e);try{const o=await _(r,"utf8");return JSON.parse(o)}catch{return}},w=t=>{const e=i(t);let r;try{r=g(e)}catch{return[]}const o=[];for(const n of r)if(n.endsWith(".json"))try{o.push(decodeURIComponent(n.slice(0,-5)))}catch{}return o};export{R as F,S as a,w as l};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{createRequire as st}from"node:module";import{e as f}from"./index-BzhrR_iC.js";import{y as G}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as ht}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{h as dt}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";let nt;const ot=t=>(nt??=st(import.meta.url))(t),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=t=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[s,e]=x.versions.node.split(".").map(Number);if(s>22||s===22&&e>=3||s===20&&e>=16)return x.getBuiltinModule(t)}return ot(t)},{existsSync:it,readdirSync:z,statSync:rt,rmSync:Y,writeFileSync:at}=R("node:fs"),{spawn:F}=R("node:child_process"),{createHash:ct}=R("node:crypto"),{homedir:lt,platform:ut}=R("node:os"),pt=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],ft=12288,gt=65510,mt=[12288,12288,65281,65376,65504,65510],wt=8361,bt=65518,yt=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],St=32,Et=10630,xt=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],$t=4352,Mt=262141,V=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],$=(t,s)=>{let e=0,n=Math.floor(t.length/2)-1;for(;e<=n;){const r=Math.floor((e+n)/2),c=r*2;if(s<t[c])n=r-1;else if(s>t[c+1])e=r+1;else return!0}return!1},D=19968,[Bt,kt]=vt(V);function vt(t){let s=t[0],e=t[1];for(let n=0;n<t.length;n+=2){const r=t[n],c=t[n+1];if(D>=r&&D<=c)return[r,c];c-r>e-s&&(s=r,e=c)}return[s,e]}const Tt=t=>t<161||t>1114109?!1:$(pt,t),It=t=>t<ft||t>gt?!1:$(mt,t),Rt=t=>t<wt||t>bt?!1:$(yt,t),Wt=t=>t<St||t>Et?!1:$(xt,t),_t=t=>t>=Bt&&t<=kt?!0:t<$t||t>Mt?!1:$(V,t);function Ct(t){return Tt(t)?"ambiguous":It(t)?"fullwidth":Rt(t)?"halfwidth":Wt(t)?"narrow":_t(t)?"wide":"neutral"}function Nt(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function Z(t){return Nt(t),Ct(t)}const H=String.raw,j=H`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,At=()=>new RegExp(H`\p{RI}{2}|(?)${j}(?:\u200D${j})*`,"gu"),he=new Set(["\x1B",""]),de="\x07",pe="]8;;",fe=/[\u200B\uFEFF\u2060-\u2064]/g,U=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\)|\][^\u0007\u001B]{0,1000}(?:\u0007|\u001B\\))/g,ge=/\u001B\[[\d;]*m[^\u001B]*(?:\u001B\[[\d;]*m|$)/g,me=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)[^\u001B]*\u001B\]8;;(?:\u0007|\u001B\\)/g,v=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,q=At(),we=/[-_./\s]+/g,be=/(\u001B\[[0-9;]*[a-z])/i,ye=new RegExp("\\p{Script=Arabic}","u"),Se=new RegExp("\\p{Script=Bengali}","u"),Ee=new RegExp("\\p{Script=Cyrillic}","u"),xe=new RegExp("\\p{Script=Devanagari}","u"),$e=new RegExp("\\p{Script=Ethiopic}","u"),Me=new RegExp("\\p{Script=Greek}","u"),Be=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),ke=new RegExp("\\p{Script=Gujarati}","u"),ve=new RegExp("\\p{Script=Gurmukhi}","u"),Te=new RegExp("\\p{Script=Hangul}","u"),Ie=new RegExp("\\p{Script=Hebrew}","u"),Re=new RegExp("\\p{Script=Hiragana}","u"),We=new RegExp("\\p{Script=Han}","u"),_e=new RegExp("\\p{Script=Kannada}","u"),Ce=new RegExp("\\p{Script=Katakana}","u"),Ne=new RegExp("\\p{Script=Khmer}","u"),Ae=new RegExp("\\p{Script=Lao}","u"),Fe=new RegExp("\\p{Script=Latin}","u"),De=new RegExp("\\p{Script=Malayalam}","u"),je=new RegExp("\\p{Script=Myanmar}","u"),Oe=new RegExp("\\p{Script=Oriya}","u"),Pe=new RegExp("\\p{Script=Sinhala}","u"),Ke=new RegExp("\\p{Script=Tamil}","u"),Le=new RegExp("\\p{Script=Telugu}","u"),ze=new RegExp("\\p{Script=Thai}","u"),Ye=new RegExp("\\p{Script=Tibetan}","u"),Ge=/[\u02BB\u02BC\u0027]/u,Ve=t=>t.replace(q,""),O=new Map,Ft=t=>[t.ambiguousIsNarrow?1:0,t.control,t.fullWidth,t.regular,t.wide].join("|"),Dt=t=>{const s=Ft(t.width);let e=O.get(s);return e||(e=new Map,O.set(s,e)),e},T=new RegExp(U.source,"y"),_=new RegExp(q.source,"uy"),I=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,J=t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other",jt=(t,s)=>{const e=Dt(s),n=Math.floor(t/65536),r=t%65536;let c=e.get(n);if(c||(c=new Map,e.set(n,c)),c.has(r))return c.get(r);let o;switch(J(t)){case"control":{o=s.width.control;break}case"latin":{o=s.width.regular;break}case"wide":{o=s.width.wide;break}case"zero":{o=0;break}default:switch(Z(t)){case"ambiguous":{o=s.width.ambiguousIsNarrow?s.width.regular:s.width.wide;break}case"fullwidth":{o=s.width.fullWidth;break}case"wide":{o=s.width.wide;break}default:o=s.width.regular}}return c.set(r,o),o},Ot=t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,C=(t,s={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const e={truncation:{countAnsiEscapeCodes:s.countAnsiEscapeCodes??!1,ellipsis:s.ellipsis??"",ellipsisWidth:s.ellipsisWidth??(s.ellipsis?C(s.ellipsis,{...s,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:s.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:s.ambiguousIsNarrow??!1,ansi:s.ansiWidth??0,control:s.controlWidth??0,emoji:s.emojiWidth??2,fullWidth:s.fullWidth??2,halfWidth:s.halfWidth??1,regular:s.regularWidth??1,tab:s.tabWidth??8,wide:s.wideWidth??2}},n=Math.max(0,e.truncation.limit-e.truncation.ellipsisWidth),{length:r}=t,c=r>1e4;let o=0,i=0,a=r,l=!1;const p=t.includes("\x1B")||t.includes("");for(;o<r;){if(p&&(t[o]==="\x1B"||t[o]==="")){if(t.startsWith("\x1B]8;;",o)){const d="\x1B]8;;\x07",w=d.length,y=t.indexOf("\x07",o+5);if(y!==-1){const S=t.indexOf(d,y+1);if(S!==-1){const B=S+w,W=t.slice(y+1,S).replace(U,""),k=C(W,{ambiguousIsNarrow:e.width.ambiguousIsNarrow,ansiWidth:e.width.ansi,controlWidth:e.width.control,countAnsiEscapeCodes:!1,ellipsis:e.truncation.ellipsis,ellipsisWidth:e.truncation.ellipsisWidth,emojiWidth:e.width.emoji,fullWidth:e.width.fullWidth,halfWidth:e.width.halfWidth,limit:Math.max(0,n-i),regularWidth:e.width.regular,tabWidth:e.width.tab,wideWidth:e.width.wide}),E=k.width;if(k.truncated)l=!0,a=Math.min(a,o);else if(i+E>n&&(a=Math.min(a,o),l=!0,i+E>e.truncation.limit))break;if(i+=E,o=B,l&&i>=e.truncation.limit)break;continue}}}if(T.lastIndex=o,T.test(t)){const d=T.lastIndex-o,w=e.truncation.countAnsiEscapeCodes?d:e.width.ansi;if(i+w>n&&(a=Math.min(a,o),i+w>e.truncation.limit)){l=!0;break}i+=w,o=T.lastIndex;continue}}const u=t.codePointAt(o);if(u===8203||u===65279||u>=8288&&u<=8292){o+=1;continue}if(u===9){if(i+e.width.tab>n&&(a=Math.min(a,o),i+e.width.tab>e.truncation.limit)){l=!0;break}i+=e.width.tab,o+=1;continue}if(I.lastIndex=o,I.test(t)){const d=(I.lastIndex-o)*e.width.regular;if(i+d>n){const w=e.width.regular>0?Math.floor((n-i)/e.width.regular):0;if(a=Math.min(a,o+w),i+d>e.truncation.limit){l=!0;break}}i+=d,o=I.lastIndex;continue}if((u<=31||u>=127&&u<=159)&&(v.lastIndex=o,v.test(t))){const d=(v.lastIndex-o)*e.width.control;if(i+d>n){const w=e.width.control>0?Math.floor((n-i)/e.width.control):0;if(a=Math.min(a,o+w),i+d>e.truncation.limit){l=!0;break}}i+=d,o=v.lastIndex;continue}if(_.lastIndex=o,_.test(t)){if(i+e.width.emoji>n&&(a=Math.min(a,o),i+e.width.emoji>e.truncation.limit)){l=!0;break}i+=e.width.emoji,o=_.lastIndex;continue}const m=t.codePointAt(o)??0;if(Ot(m)){o+=m>65535?2:1;continue}let h;if(c)h=jt(m,e);else switch(J(m)){case"control":{h=e.width.control;break}case"latin":{h=e.width.regular;break}case"wide":{h=e.width.wide;break}case"zero":{h=0;break}default:switch(Z(m)){case"ambiguous":{h=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{h=e.width.fullWidth;break}case"wide":{h=e.width.wide;break}default:h=e.width.regular}}if(i+h>n&&(a=Math.min(a,o),i+h>e.truncation.limit)){l=!0;break}i+=h,o+=m>65535?2:1}let g=i,b=!1;return l&&e.truncation.limit>=e.truncation.ellipsisWidth&&(g=e.truncation.limit,b=!0),{ellipsed:b,index:l?a:r,truncated:l,width:g}},Ze=(t,s={})=>C(t,{...s,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,N=()=>f(lt(),".vis"),Pt=()=>f(N(),"cache"),He=()=>f(N(),"state"),Kt=t=>ct("sha256").update(t).digest("hex").slice(0,12),Ue=t=>f(N(),"workspaces",Kt(t)),Lt=".vis",A=t=>f(t,Lt),qe="node_modules/.cache/vis",Je=t=>f(A(t),"runs"),Xe=t=>f(A(t),"last-summary.json"),Qe=t=>f(A(t),"last-failures"),ts=t=>{const s=ut()==="win32";for(const e of[".task-runner",".task-runner-cache"]){const n=f(t,e);if(it(n))try{const r=s?F("cmd.exe",["/c","rmdir","/s","/q",n],{detached:!0,stdio:"ignore"}):F("rm",["-rf",n],{detached:!0,stdio:"ignore"});r.on("error",()=>{}),r.unref()}catch{}}},zt="https://api.socket.dev/v0/purl?alerts=true",M=()=>f(Pt(),"socket-security"),Yt=3600*1e3,X=.4,P=100,Gt=t=>typeof t=="object"&&t!==null&&"id"in t&&"type"in t&&"name"in t&&"version"in t&&"alerts"in t&&"score"in t&&t.type==="npm",Vt=()=>{dt(M())},Q=(t,s)=>`${encodeURIComponent(t)}@${encodeURIComponent(s)}`,Zt=(t,s)=>{const e=Q(t,s),n=f(M(),`${e}.json`);try{const r=ht(n);if(Date.now()-r.createdAt>r.ttlMs){Y(n,{force:!0});return}return r.report}catch{return}},Ht=(t,s,e,n)=>{const r=Q(t,s),c={createdAt:Date.now(),report:e,ttlMs:n};at(f(M(),`${r}.json`),JSON.stringify(c),"utf8")},Ut=t=>{const s=[t.license,t.maintenance,t.quality,t.supplyChain,t.vulnerability];return Number((s.reduce((e,n)=>e+n,0)/s.length).toFixed(2))},qt=async(t,s={})=>{const{apiToken:e,cacheTtlMs:n=Yt,timeoutMs:r=15e3}=s,c=new Map;if(t.length===0||!e)return c;const o=[];for(const l of t){const p=Zt(l.name,l.version);p?c.set(`${l.name}@${l.version}`,p):o.push(l)}if(o.length===0)return c;const i=`Basic ${Buffer.from(`${e}:`).toString("base64")}`;Vt();const a=[];for(let l=0;l<o.length;l+=P)a.push(o.slice(l,l+P));for(const l of a){const p=l.map(u=>({purl:`pkg:npm/${u.name}@${u.version}`})),g=new AbortController,b=setTimeout(()=>{g.abort()},r);try{const u=await fetch(zt,{body:JSON.stringify({components:p}),headers:{Authorization:i,"Content-Type":"application/json","User-Agent":"@visulima/vis"},method:"POST",signal:g.signal});if(!u.ok)continue;const m=await u.text();Jt(m,l,c,n)}catch{}finally{clearTimeout(b)}}return c},Jt=(t,s,e,n)=>{const r=new Map;for(const o of s)r.set(`${o.name}@${o.version}`,o);const c=t.split(`}
|
|
2
|
+
`);for(const o of c){const i=o.trim();if(i)try{const a=JSON.parse(i.endsWith("}")?i:`${i}}`),p=`${a.namespace?`${a.namespace}/`:""}${a.name}`,g=`${p}@${a.version}`;if(!r.has(g))continue;const b=a.score.overall??Ut(a.score),u={alerts:a.alerts,author:a.author,id:a.id,license:a.license,name:a.name,score:{...a.score,overall:b},size:a.size,type:"npm",version:a.version};a.namespace&&(u.namespace=a.namespace),Gt(u)&&(e.set(g,u),Ht(p,a.version,u,n))}catch{}}},Xt=t=>t.namespace?`${t.namespace}/${t.name}`:t.name,es=t=>t>=.8?"excellent":t>=.6?"good":t>=.4?"fair":t>=.2?"poor":"critical",ss=t=>t>=.6?"green":t>=.4?"yellow":"red",ns=t=>{const s=Xt(t),e=`score: ${String(Math.round(t.score.overall*100))}%`,n=t.alerts.length,r=n>0?`${String(n)} alert${n===1?"":"s"}`:"no alerts";return`${s}@${t.version} (${e}, ${r})`},os=(t,s=X)=>{if(t.size===0)return"";let e=0,n=0,r=0,c=0,o=0,i=0;for(const l of t.values()){for(const p of l.alerts)switch(e++,p.severity){case"critical":{n++;break}case"high":{r++;break}case"medium":{c++;break}default:o++}l.score.overall<s&&i++}const a=[`Socket.dev: scanned ${String(t.size)} package${t.size===1?"":"s"}`];if(e>0){const l=[];n>0&&l.push(`${String(n)} critical`),r>0&&l.push(`${String(r)} high`),c>0&&l.push(`${String(c)} medium`),o>0&&l.push(`${String(o)} low`),a.push(` Alerts: ${String(e)} total (${l.join(", ")})`)}else a.push(" No security alerts found.");if(i>0){const l=Math.round(s*100);a.push(` ${String(i)} package${i===1?"":"s"} with low security score (<${String(l)}%)`)}return a.join(`
|
|
3
|
+
`)},Qt=()=>{const t=M();if(!G(t))return 0;const s=z(t).filter(e=>e.endsWith(".json"));for(const e of s)Y(f(t,e),{force:!0});return s.length},te=()=>{const t=M();if(!G(t))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const s=z(t).filter(c=>c.endsWith(".json"));let e=0,n,r;for(const c of s){const o=rt(f(t,c));e+=o.size;const{mtimeMs:i}=o;(n===void 0||i<n)&&(n=i),(r===void 0||i>r)&&(r=i)}return{entries:s.length,newestEntry:r,oldestEntry:n,totalSizeBytes:e}},ee=(t,s)=>t?.enabled?{apiToken:t.apiToken??process.env.VIS_SOCKET_TOKEN,cacheTtlMs:t.cacheTtlMs,minimumScore:s??X,timeoutMs:t.timeoutMs}:void 0,is=(t,s,e,n)=>{if(!e)return;const r=Date.now(),c=i=>{if(i.expiresAt){const a=Date.parse(i.expiresAt);if(!Number.isNaN(a)&&a<r)return!1}return!(n&&i.policies&&!i.policies.includes(n))},o=`${t}@${s}`;if(e[o]&&c(e[o]))return e[o];if(e[t]&&c(e[t]))return e[t];for(const[i,a]of Object.entries(e))if(i.endsWith("*")&&t.startsWith(i.slice(0,-1))&&c(a))return a},rs=(t,s,e,n)=>[" // Add to security.acceptedRisks in vis.config.ts:",` ${`"${t}"`}: {`,` reason: "${n}",`,` acceptedAt: "${new Date().toISOString()}",`,` acceptedScore: ${String(e)},`,' policies: ["score"],'," },"].join(`
|
|
4
|
+
`),as=(t,s={})=>{const e=ee(t,s.minimumScore);if(e)return{clearCache:Qt,displayName:"Socket.dev",fetchReports:n=>qt(n,e),getCacheStats:te,id:"socket"}},cs=t=>{if(t===void 0)return!1;const s=t.trim().toLowerCase();return s!==""&&s!=="0"&&s!=="false"&&s!=="no"},tt={iec:[{long:"Bytes",short:"B"},{long:"Kibibytes",short:"KiB"},{long:"Mebibytes",short:"MiB"},{long:"Gibibytes",short:"GiB"},{long:"Tebibytes",short:"TiB"},{long:"Pebibytes",short:"PiB"},{long:"Exbibytes",short:"EiB"},{long:"Zebibytes",short:"ZiB"},{long:"Yobibytes",short:"YiB"}],iec_octet:[{long:"Octets",short:"o"},{long:"Kibioctets",short:"Kio"},{long:"Mebioctets",short:"Mio"},{long:"Gibioctets",short:"Gio"},{long:"Tebioctets",short:"Tio"},{long:"Pebioctets",short:"Pio"},{long:"Exbioctets",short:"Eio"},{long:"Zebioctets",short:"Zio"},{long:"Yobioctets",short:"Yio"}],metric:[{long:"Bytes",short:"Bytes"},{long:"Kilobytes",short:"KB"},{long:"Megabytes",short:"MB"},{long:"Gigabytes",short:"GB"},{long:"Terabytes",short:"TB"},{long:"Petabytes",short:"PB"},{long:"Exabytes",short:"EB"},{long:"Zettabytes",short:"ZB"},{long:"Yottabytes",short:"YB"}],metric_octet:[{long:"Octets",short:"o"},{long:"Kilo-octets",short:"ko"},{long:"Mega-octets",short:"Mo"},{long:"Giga-octets",short:"Go"},{long:"Tera-octets",short:"To"},{long:"Peta-octets",short:"Po"},{long:"Exa-octets",short:"Eo"},{long:"Zetta-octets",short:"Zo"},{long:"Yotta-octets",short:"Yo"}]},se=[{long:"bits",short:"bit"},{long:"Kilobits",short:"kbit"},{long:"Megabits",short:"Mbit"},{long:"Gigabits",short:"Gbit"},{long:"Terabits",short:"Tbit"},{long:"Petabits",short:"Pbit"},{long:"Exabits",short:"Ebit"},{long:"Zettabits",short:"Zbit"},{long:"Yottabits",short:"Ybit"}],K=new Map,L=(t,s)=>{const e=`${t}\0${JSON.stringify(s)}`;let n=K.get(e);return n===void 0&&(n=new Intl.NumberFormat(t,s),K.set(e,n)),n},ne=t=>{switch(t){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},oe=(t,s,e)=>({maximumFractionDigits:t,minimumFractionDigits:t,...s,...e}),ie=(t,s,e,n)=>{if(t===void 0)return-1;const r=s.findIndex(c=>c.short===t);return r===-1&&n?tt[e].findIndex(c=>c.short===t):r},ls=(t,s)=>{if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("Bytesize is not a number.");const{base:e,bits:n,decimals:r,locale:c,long:o,signed:i,unit:a,units:l,...p}={base:2,bits:!1,decimals:0,locale:"en-US",long:!1,signed:!1,units:"metric",...s},g=ne(e),b=n?t*8:t,u=Math.abs(b),m=s?.space??!0?" ":"",h=n?se:tt[l],d=ie(a,h,l,n),w=r<0?void 0:r,y=i?{signDisplay:"exceptZero"}:{};if(b===0){const E=d===-1?0:Math.min(d,h.length-1),et=h[E][o?"long":"short"];return L(c,{...y,...p}).format(0)+m+et}const S=Math.max(0,Math.min(Math.floor(Math.log(u)/Math.log(g)),h.length-1)),B=d===-1?S:d,W=h[B][o?"long":"short"],k=b/g**B;return L(c,oe(w,y,p)).format(k)+m+W};export{ls as $,Ae as A,Ee as B,ve as C,X as D,je as E,Te as F,$e as G,xe as H,Ne as I,ze as J,Be as K,we as L,ke as M,Oe as N,Me as O,_e as P,ts as Q,q as R,ge as S,be as T,Fe as U,Ye as V,Ce as W,me as X,De as Y,Ge as Z,U as _,Qe as a,C as a0,It as a1,_t as a2,fe as a3,he as a4,pe as a5,de as a6,as as a7,os as a8,qe as a9,te as aa,Qt as ab,Xe as ac,N as b,A as c,Je as d,Xt as e,is as f,Pt as g,ns as h,es as i,rs as j,cs as k,He as l,Ut as m,qt as n,Ze as o,Ue as p,Ve as q,We as r,ss as s,Re as t,Ie as u,Ke as v,Se as w,ye as x,Le as y,Pe as z};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{createRequire as R}from"node:module";let N;const y=n=>(N??=R(import.meta.url))(n),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$=n=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[e,s]=p.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return p.getBuiltinModule(n)}return y(n)},{existsSync:x,readdirSync:I,statSync:w}=$("node:fs"),{join:_}=$("node:path"),b=new Set([".bundle","node_modules","vendor"]),G=/^(?:"([^"\\#]*)"|'([^'\\]*)')$/,O=/^[A-Z]\w*(?:::[A-Z]\w*)*::VERSION$/,V=/^\s*(\w+)\.(name|version)\s*=\s*(.*?)\s*$/,T=/^\s*\w+\.add_(?:runtime_)?dependency\s*\(?\s*["']([^"']+)["']/,j=/Gem::Specification\.new\s*(?:do|\{)\s*\|\s*(\w+)\s*\|/;class d extends Error{file;constructor(e,s){super(s),this.name="GemspecReadError",this.file=e}}const v=n=>{const e=G.exec(n);return e===null?void 0:e[1]??e[2]},k=(n,e)=>{const s=n.split(/\r?\n/),i=j.exec(n)?.[1]??"spec",o=[];let t,r;const a=(l,u)=>{throw new d(e,`${e} line ${String(l)}: ${u}`)};if(/Gem::Specification\.new\s*\(/.test(n))throw new d(e,`${e} passes arguments to Gem::Specification.new. vis reads the version only from spec.version = "…" inside the block.`);for(const[l,u]of s.entries()){const c=l+1,h=T.exec(u);if(h?.[1]!==void 0){o.push(h[1]);continue}const f=V.exec(u);if(f?.[1]!==i)continue;const E=f[2],m=(f[3]??"").replace(/\s+#.*$/,"");if(E==="name"){t!==void 0&&a(c,`spec.name is set twice (lines ${String(t.line)} and ${String(c)}). vis cannot tell which one applies.`);const g=v(m);g===void 0&&a(c,'spec.name is not a plain string literal. vis reads only spec.name = "my-gem".'),t={line:c,value:g};continue}r!==void 0&&a(c,`spec.version is set twice (lines ${String(r.line)} and ${String(c)}). vis cannot tell which one applies.`);const S=v(m);S!==void 0?r={kind:"literal",line:c,value:S}:O.test(m)?r={constant:m,kind:"constant",line:c}:a(c,'spec.version is not a string literal or Name::VERSION. vis reads only spec.version = "1.0.0" or a VERSION constant in lib/<name>/version.rb.')}if(r===void 0&&/\.version\s*=/.test(n))throw new d(e,`${e} assigns a version that vis cannot read. Put spec.version = "1.0.0" on its own line inside the Gem::Specification block.`);return{dependencies:o,name:t,version:r}},C=(n,e)=>_(n,"lib",...e.split("-"),"version.rb"),P=(n,e)=>{const s=[];for(const[i,o]of n.split(/\r?\n/).entries()){const t=/^\s*VERSION\s*=\s*(.*?)\s*$/.exec(o);if(t===null)continue;const r=v((t[1]??"").replace(/\s+#.*$/,""));if(r===void 0)throw new d(e,`${e} line ${String(i+1)}: VERSION is not a plain string literal. vis reads only VERSION = "1.0.0".`);s.push({line:i+1,value:r})}if(s.length!==1)throw new d(e,`${e} declares VERSION ${String(s.length)} times. vis needs exactly one VERSION = "…" literal.`);return s[0]},D=(n,e,s)=>{const i=n.split(`
|
|
2
|
+
`),o=e-1,t=i[o];if(t===void 0||!/=\s*(["'])[^"'\\]*\1/.test(t))throw new d("",`line ${String(e)} has no string literal to rewrite`);return i[o]=t.replace(/=(\s*)(["'])[^"'\\]*\2/,(r,a,l)=>`=${a}${l}${s}${l}`),i.join(`
|
|
3
|
+
`)},L=n=>{const e=[],s=i=>{for(const o of I(i).sort()){const t=_(i,o);if(o.endsWith(".gemspec")){w(t).isFile()&&e.push(t);continue}!b.has(o)&&w(t).isDirectory()&&s(t)}};return x(n)&&s(n),e};export{d as G,D as a,L as f,C as g,k as p,P as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=s=>{const t=s.indexOf("//");return(t===-1?s:s.slice(0,t)).trim()},i=s=>/^["`].*["`]$/u.test(s)?s.slice(1,-1):s,u=s=>{for(const t of s.split(/\r?\n/u)){const e=/^\s*module\s+(\S.*)$/u.exec(r(t));if(e?.[1]!==void 0)return i(e[1].trim())}},f=s=>{const t=[];let e=!1;for(const c of s.split(/\r?\n/u)){const o=r(c);if(o==="")continue;if(e){o===")"?e=!1:t.push(i(o));continue}const n=/^use\s+(.*)$/u.exec(o);n?.[1]==="("?e=!0:n?.[1]!==void 0&&t.push(i(n[1].trim()))}return t};export{f as a,u as p};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const A=t=>{let e="",c,s=0;for(;s<t.length;){const n=t[s],o=t[s+1];if(c!==void 0){if(e+=n,n==="\\"&&o!==void 0){e+=o,s+=2;continue}(n===c||n===`
|
|
2
|
+
`)&&(c=void 0),s+=1;continue}if((n==='"'||n==="'")&&(c=n),n==="/"&&o==="/"){const l=t.indexOf(`
|
|
3
|
+
`,s),r=l===-1?t.length:l;e+=" ".repeat(r-s),s=r;continue}if(n==="/"&&o==="*"){const l=t.indexOf("*/",s+2),r=l===-1?t.length:l+2;e+=t.slice(s,r).replaceAll(/[^\n]/g," "),s=r;continue}e+=n,s+=1}return e},S=/^(\s*)(group|version)(\s*=\s*|\s+)(.*?)\s*;?\s*$/d,k=/^(["'])([^"'$\n]*)\1$/,E=/\b(allprojects|subprojects)\b/,R=/([A-Z_]\w*)\s*(?:\([^()]*\))?\s*$/i,$=t=>{const e=E.exec(t);return e?e[1]:R.exec(t.trim())?.[1]??""},x=t=>{const e=A(t),c=[],s=[];let n=0,o="",l,r=!1;const p=i=>e.slice(0,i).split(`
|
|
4
|
+
`).length,h=(i,a)=>{const u=e.slice(i,a),f=S.exec(u);if(f?.indices===void 0)return;const L=f[2],j=f[4]??"",b=k.exec(j),g={blocks:[...s],line:p(i+f.indices[0][0]),name:L};if(b){const m=i+f.indices[4][0]+1;g.literal={value:b[2],valueEnd:m+b[2].length,valueStart:m}}c.push(g)};for(let i=0;i<e.length;i++){const a=e[i];if(l!==void 0){r?r=!1:a==="\\"?r=!0:(a===l||a===`
|
|
5
|
+
`)&&(l=void 0);continue}if(a==='"'||a==="'"){l=a;continue}if(a===`
|
|
6
|
+
`||a===";"||a==="{"||a==="}"){h(n,i);const u=e.slice(n,i).trim();a==="{"?(u!==""&&(o=u),s.push($(o)),o=""):a==="}"?s.pop():u!==""&&(o=u),n=i+1}}h(n,e.length);const d=[...e.matchAll(/\bproject\(\s*["']([^"']+)["']\s*\)/g)].map(i=>i[1]);return{assignments:c,projectRefs:d,usesArchiveName:/\barchives(?:Base)?Name\b/.test(e)}},I=(t,e)=>t.filter(c=>c.name===e&&c.blocks.length===0),N=(t,e,c)=>t.filter(s=>s.name===e&&s.blocks.length===1&&(s.blocks[0]==="allprojects"||!c&&s.blocks[0]==="subprojects")),O=/\binclude\b\s*(\(?)/g,v=/(["'])([^"'\n]*)\1/g,_=(t,e,c)=>{let s=c?1:0,n,o=e;for(;o<t.length;o++){const l=t[o];if(n!==void 0){l===n&&(n=void 0);continue}switch(l){case`
|
|
7
|
+
`:case";":case"{":case"}":{if(s<=0&&(l!==`
|
|
8
|
+
`||!/,\s*$/.test(t.slice(e,o))))return t.slice(e,o);break}case'"':case"'":{n=l;break}case"(":{s++;break}case")":{if(s--,s<=0&&c)return t.slice(e,o);break}}}return t.slice(e,o)},T=t=>{const e=A(t),c=new Set,s=[];let n=!1;for(const l of e.matchAll(O)){const r=_(e,l.index+l[0].length,l[1]==="("),p=[...r.matchAll(v)].map(d=>d[2]);r.replaceAll(v,"").replaceAll(/[\s(),]/g,"")!==""&&(n=!0);for(const d of p){const i=d.replace(/^:+/,"").split(":").filter(a=>a!=="").join("/");i!==""&&c.add(i)}}/\.projectDir\s*=/.test(e)&&s.push("projectDir"),/\bproject\(\s*["'][^"']*["']\s*\)\s*\.\s*name\s*=/.test(e)&&s.push("project name");const o=/\brootProject\.name\s*=\s*["']([^"']+)["']/.exec(e)?.[1];return{dynamicIncludes:n,includes:[...c],...o===void 0?{}:{rootName:o},unsupported:s}},D=(t,e,c)=>`${t.slice(0,e.valueStart)}${c}${t.slice(e.valueEnd)}`;export{T as a,N as i,A as m,I as o,D as r,x as s};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{createRequire as bu}from"node:module";let wu;const xu=u=>(wu??=bu(import.meta.url))(u),V=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,vu=u=>{if(typeof V<"u"&&V.versions&&V.versions.node){const[D,e]=V.versions.node.split(".").map(Number);if(D>22||D===22&&e>=3||D===20&&e>=16)return V.getBuiltinModule(u)}return xu(u)},{createRequire:Y}=vu("node:module"),z0=0,_0=4,Su=Symbol("findUpStop"),I0=/"(?:[^"\\]|\\.)*"|\/\/[^\r\n]*|\/\*[\s\S]*?\*\//g,$u=/^[A-Z]:\//i,I=(u="")=>u&&u.replaceAll("\\","/").replace($u,D=>D.toUpperCase()),Nu=/^[/\\]{2}/,ku=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,iu=/^[A-Z]:$/i,Fu=/^\/([A-Z]:)?$/i,Cu=/^([A-Z]:)\/$/i,Pu=/[^/](\.[^./]+)$/,ju=/^[/\\]|^[a-z]:[/\\]/i,Ou=/\/$/,zu=()=>{if(typeof process.cwd=="function")try{const u=process.cwd();if(typeof u=="string")return I(u)}catch{}return"/"},T0="/",pu=(u,D)=>{let e="",r=0,n=-1,i=0,c;for(let E=0;E<=u.length;++E){if(E<u.length)c=u[E];else{if(c==="/")break;c="/"}if(c==="/"){if(!(n===E-1||i===1))if(i===2){if(e.length<2||r!==2||!e.endsWith(".")||e.at(-2)!=="."){if(e.length>2){const d=e.lastIndexOf("/");d===-1?(e="",r=0):(e=e.slice(0,d),r=e.length-1-e.lastIndexOf("/")),n=E,i=0;continue}else if(e.length>0){e="",r=0,n=E,i=0;continue}}D&&(e+=e.length>0?"/..":"..",r=2)}else e.length>0?e+=`/${u.slice(n+1,E)}`:e=u.slice(n+1,E),r=E-n-1;n=E,i=0}else c==="."&&i!==-1?++i:i=-1}return e},M=u=>ku.test(u),_u=function(u){if(u.length===0)return".";u=I(u);const D=Nu.exec(u),e=M(u),r=u.at(-1)==="/";return u=pu(u,!e),u.length===0?e?"/":r?"./":".":(r&&(u+="/"),iu.test(u)&&(u+="/"),D?e?`//${u}`:`//./${u}`:e&&!M(u)?`/${u}`:u)},L0=(...u)=>{let D="";for(const e of u)if(e)if(D.length>0){const r=D.at(-1)==="/",n=e[0]==="/";r&&n?D+=e.slice(1):D+=r||n?e:`/${e}`}else D+=e;return _u(D)},H=function(...u){u=u.map(r=>I(r));let D="",e=!1;for(let r=u.length-1;r>=-1&&!e;r--){const n=r>=0?u[r]:zu();!n||n.length===0||(D=`${n}/${D}`,e=M(n))}return D=pu(D,!e),iu.test(D)?`${D}/`:e&&!M(D)?`/${D}`:D.length>0?D:"."},M0=function(u){return I(u)},Iu=function(u){return Pu.exec(I(u))?.[1]??""},V0=function(u,D){const e=H(u).replace(Fu,"$1").replace(Cu,"$1").split("/"),r=H(D).replace(Fu,"$1").replace(Cu,"$1").split("/");if(r[0][1]===":"&&e[0][1]===":"&&e[0]!==r[0])return r.join("/");const n=Math.min(e.length,r.length);let i=0;for(;i<n&&e[i]===r[i];)i+=1;const c=e.length-i;return[...Array.from({length:c}).fill(".."),...r.slice(i)].join("/")},mu=u=>{const D=I(u).replace(Ou,""),e=D.lastIndexOf("/");if(e===-1)return M(u)?"/":".";const r=D.slice(0,e);return iu.test(r)?`${r}/`:r||(M(u)?"/":".")},Tu=(u,D)=>{const e=I(u),r=e.slice(e.lastIndexOf("/")+1);if(D&&r.endsWith(D)){if(D===e)return"";const n=r.slice(0,-D.length);if(n.length>0)return n}return r},Lu=function(u){const D=ju.exec(u)?.[0]?.replaceAll("\\","/")??"",e=Tu(u),r=Iu(e);return{base:e,dir:mu(u),ext:r,name:e.slice(0,e.length-r.length),root:D}};let Mu;const Vu=u=>(Mu??=Y(import.meta.url))(u),R=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ru=u=>{if(typeof R<"u"&&R.versions&&R.versions.node){const[D,e]=R.versions.node.split(".").map(Number);if(D>22||D===22&&e>=3||D===20&&e>=16)return R.getBuiltinModule(u)}return Vu(u)},{fileURLToPath:Ju}=Ru("node:url");function qu(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var Au,au;function Wu(){return au||(au=1,Au=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Au}var Uu=Wu();const Hu=qu(Uu);new Set(Hu);const Zu=/^(?:\.?\.[/\\]|\.\.\B)/,R0=u=>Zu.test(u)||u==="..",K=u=>I(u instanceof URL?Ju(u):u),Gu=u=>{if(!u||!(u instanceof URL)&&typeof u!="string")throw new TypeError("Path must be a non-empty string or URL.")};let Ku;const Qu=u=>(Ku??=Y(import.meta.url))(u),J=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xu=u=>{if(typeof J<"u"&&J.versions&&J.versions.node){const[D,e]=J.versions.node.split(".").map(Number);if(D>22||D===22&&e>=3||D===20&&e>=16)return J.getBuiltinModule(u)}return Qu(u)},{statSync:Yu,lstatSync:u0}=Xu("node:fs"),J0=(u,D={})=>{if(typeof u!="string"&&!Array.isArray(u)&&typeof u!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const e=D.cwd?K(D.cwd):process.cwd();let r=H(e);const{root:n}=Lu(r),i=K(D.stopAt??n),c=H(r,i),E=D.type??"file",d=function(A){return typeof u=="function"?[u(A)]:typeof u=="string"?[u]:Array.isArray(u)?u:[u]};D.allowSymlinks??=!0;const $=D.allowSymlinks?Yu:u0;for(;r;){for(let A of d(r)){if(A===Su)return;if(A===void 0)continue;Buffer.isBuffer(A)?A=A.toString():A instanceof URL&&(A=K(A));const B=M(A)?A:H(r,A);try{const h=$(B);if(E==="file"&&h.isFile()||E==="directory"&&h.isDirectory())return B}catch{}}if(r===c||r===n)break;r=mu(r)}};let D0=class extends Error{constructor(D){super(`ENOENT: ${D}`)}get code(){return"ENOENT"}set code(D){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(D){throw new Error("Cannot overwrite name of NotFoundError")}};class e0 extends Error{constructor(D){super(`EPERM: Operation not permitted, ${D}`)}get code(){return"EPERM"}set code(D){throw new Error("Cannot overwrite code EPERM")}get name(){return"PermissionError"}set name(D){throw new Error("Cannot overwrite name of PermissionError")}}const t0=(u,D)=>{const e=u?.code;return e==="ENOENT"?new D0(`no such file or directory, open '${D}'`):e==="EACCES"||e==="EPERM"?new e0(`unable to read the non-readable file: ${D}`):u};let r0;const n0=u=>(r0??=Y(import.meta.url))(u),q=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gu=u=>{if(typeof q<"u"&&q.versions&&q.versions.node){const[D,e]=q.versions.node.split(".").map(Number);if(D>22||D===22&&e>=3||D===20&&e>=16)return q.getBuiltinModule(u)}return n0(u)},{readFileSync:i0}=gu("node:fs"),{unzipSync:s0,brotliDecompressSync:o0}=gu("node:zlib"),F0={brotli:o0,gzip:s0,none:u=>u},W0=(u,D)=>{Gu(u),u=K(u);const{buffer:e,compression:r,encoding:n,flag:i}=D??{};let c;try{c=i0(u,i?{flag:i}:{})}catch($){throw t0($,u)}const E=F0[r??"none"],d=E(c);return e?d:d.toString(n??"utf8")},C0=globalThis.process??Object.create(null),Eu={versions:{}},cu=new Proxy(C0,{get(u,D){if(D in u)return u[D];if(D in Eu)return Eu[D]}}),A0=u=>u.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
2
|
+
`),a0=(u,D,e,r)=>{const n={column:0,line:-1,...u.start},i={...n,...u.end},c=n.line,E=n.column,d=i.line,$=i.column;let A=Math.max(c-(e+1),0),B=Math.min(D.length,d+r);c===-1&&(A=0),d===-1&&(B=D.length);const h=d-c,p={};if(h)for(let l=0;l<=h;l++){const o=l+c;if(!E)p[o]=!0;else if(l===0){const f=D[o-1]?.length;p[o]=[E,(f??0)-E+1]}else if(l===h)p[o]=[0,$];else{const f=D[o-l]?.length;p[o]=[0,f]}}else E===$?p[c]=E?[E,0]:!0:p[c]=[E,($??0)-(E??0)];return{end:B,markerLines:p,start:A}},E0=cu.platform==="win32"&&!cu.env?.WT_SESSION?">":"❯",U0=(u,D,e)=>{const r={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...e,color:{gutter:l=>l,marker:l=>l,message:l=>l,...e?.color}},n=typeof D.start.column=="number";let i=(u.includes("\r")?A0(u):u).split(`
|
|
3
|
+
`);typeof r.tabWidth=="number"&&u.includes(" ")&&(i=i.map(l=>l.replaceAll(" "," ".repeat(r.tabWidth))));const{end:c,markerLines:E,start:d}=a0(D,i,r.linesAbove,r.linesBelow),$=String(c).length,{gutter:A,marker:B,message:h}=r.color;let p=i.slice(d,c).map((l,o)=>{const f=d+1+o,s=E[f],w=String(f).padStart($),v=!E[f+1],y=` ${w}${r.showGutter?" |":""}`;if(s){let x="";if(Array.isArray(s)){const z=l.replaceAll(/[^\t]/g," ").slice(0,Math.max(s[0]-1,0)),yu=s[1]||1;x=[`
|
|
4
|
+
`,r.prefix+A(y.replaceAll(/\d/g," "))," ",z,B("^").repeat(yu)].join(""),v&&r.message&&(x+=` ${h(r.message)}`)}return[r.prefix+B(E0),A(y),l.length>0?` ${l}`:"",x].join("")}return`${r.prefix} ${A(y)}${l.length>0?` ${l}`:""}`}).join(`
|
|
5
|
+
`);return r.message&&!n&&(p=`${r.prefix+" ".repeat($+1)+r.message}
|
|
6
|
+
${p}`),p},lu=(u,D)=>{let e=0,r=D.length-2;for(;e<r;){const n=e+(r-e>>1);if(u<D[n])r=n-1;else if(u>=D[n+1])e=n+1;else{e=n;break}}return e},c0=/\n|\r(?!\n)/,l0=u=>u.split(c0).reduce((D,e)=>(D.push(D.at(-1)+e.length+1),D),[0]),H0=(u,D,e)=>{if(!Array.isArray(u)&&typeof u!="string"||(typeof u=="string"||Array.isArray(u))&&u.length===0)return{column:0,line:0};if(typeof D!="number"||typeof u=="string"&&D>=u.length||Array.isArray(u)&&D+1>=u.at(-1))return{column:0,line:0};if(typeof u=="string"){const n=l0(u),i=lu(D,n);return{column:D-n[i]+1,line:i+1}}const r=lu(D,u);return{column:D-u[r]+1,line:r+1}};class Z0 extends Error{fileName;codeFrame;name="JSONError";#u;constructor(D){super(),this.#u=D}get message(){return`${this.#u}${this.fileName?` in ${this.fileName}`:""}${this.codeFrame?`
|
|
7
|
+
|
|
8
|
+
${this.codeFrame}
|
|
9
|
+
`:""}`}set message(D){this.#u=D}}let f0;const B0=u=>(f0??=Y(import.meta.url))(u),W=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,su=u=>{if(typeof W<"u"&&W.versions&&W.versions.node){const[D,e]=W.versions.node.split(".").map(Number);if(D>22||D===22&&e>=3||D===20&&e>=16)return W.getBuiltinModule(u)}return B0(u)},p0=su("fs"),m0=su("os"),g0=su("path");var uu={},fu;function d0(){if(fu)return uu;fu=1;var u=Object.defineProperty,D=(A,B)=>u(A,"name",{value:B,configurable:!0}),e=p0,r=m0,n=g0;const i=D(A=>{let B="";for(let h=0;h<A.length;h+=1){const p=A[h],l=p.toUpperCase();B+=p===l?p.toLowerCase():l}return B},"invertCase"),c=new Map,E=D((A,B)=>{const h=n.join(A,`.is-fs-case-sensitive-test-${process.pid}`);try{return B.writeFileSync(h,""),!B.existsSync(i(h))}finally{try{B.unlinkSync(h)}catch{}}},"checkDirectoryCaseWithWrite"),d=D((A,B,h)=>{try{return E(A,h)}catch(p){if(B===void 0)return E(r.tmpdir(),h);throw p}},"checkDirectoryCaseWithFallback"),$=D((A,B=e,h=!0)=>{const p=A??process.cwd();if(h&&c.has(p))return c.get(p);let l;const o=i(p);return o!==p&&B.existsSync(p)?l=!B.existsSync(o):l=d(p,A,B),h&&c.set(p,l),l},"isFsCaseSensitive");return uu.isFsCaseSensitive=$,uu}var h0=d0();const G0=h0.isFsCaseSensitive;var y0=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,b0=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,w0=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Du={Space_Separator:y0,ID_Start:b0,ID_Continue:w0},b={isSpaceSeparator(u){return typeof u=="string"&&Du.Space_Separator.test(u)},isIdStartChar(u){return typeof u=="string"&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u==="$"||u==="_"||Du.ID_Start.test(u))},isIdContinueChar(u){return typeof u=="string"&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||u==="$"||u==="_"||u===""||u===""||Du.ID_Continue.test(u))},isDigit(u){return typeof u=="string"&&/[0-9]/.test(u)},isHexDigit(u){return typeof u=="string"&&/[0-9A-Fa-f]/.test(u)}};let tu,N,j,Q,_,k,S,ou,Z;var x0=function(D,e){tu=String(D),N="start",j=[],Q=0,_=1,k=0,S=void 0,ou=void 0,Z=void 0;do S=v0(),N0[N]();while(S.type!=="eof");return typeof e=="function"?ru({"":Z},"",e):Z};function ru(u,D,e){const r=u[D];if(r!=null&&typeof r=="object")if(Array.isArray(r))for(let n=0;n<r.length;n++){const i=String(n),c=ru(r,i,e);c===void 0?delete r[i]:Object.defineProperty(r,i,{value:c,writable:!0,enumerable:!0,configurable:!0})}else for(const n in r){const i=ru(r,n,e);i===void 0?delete r[n]:Object.defineProperty(r,n,{value:i,writable:!0,enumerable:!0,configurable:!0})}return e.call(u,D,r)}let C,F,U,P,a;function v0(){for(C="default",F="",U=!1,P=1;;){a=O();const u=du[C]();if(u)return u}}function O(){if(tu[Q])return String.fromCodePoint(tu.codePointAt(Q))}function t(){const u=O();return u===`
|
|
10
|
+
`?(_++,k=0):u?k+=u.length:k++,u&&(Q+=u.length),u}const du={default(){switch(a){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
|
|
11
|
+
`:case"\r":case"\u2028":case"\u2029":t();return;case"/":t(),C="comment";return;case void 0:return t(),m("eof")}if(b.isSpaceSeparator(a)){t();return}return du[N]()},comment(){switch(a){case"*":t(),C="multiLineComment";return;case"/":t(),C="singleLineComment";return}throw g(t())},multiLineComment(){switch(a){case"*":t(),C="multiLineCommentAsterisk";return;case void 0:throw g(t())}t()},multiLineCommentAsterisk(){switch(a){case"*":t();return;case"/":t(),C="default";return;case void 0:throw g(t())}t(),C="multiLineComment"},singleLineComment(){switch(a){case`
|
|
12
|
+
`:case"\r":case"\u2028":case"\u2029":t(),C="default";return;case void 0:return t(),m("eof")}t()},value(){switch(a){case"{":case"[":return m("punctuator",t());case"n":return t(),T("ull"),m("null",null);case"t":return t(),T("rue"),m("boolean",!0);case"f":return t(),T("alse"),m("boolean",!1);case"-":case"+":t()==="-"&&(P=-1),C="sign";return;case".":F=t(),C="decimalPointLeading";return;case"0":F=t(),C="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":F=t(),C="decimalInteger";return;case"I":return t(),T("nfinity"),m("numeric",1/0);case"N":return t(),T("aN"),m("numeric",NaN);case'"':case"'":U=t()==='"',F="",C="string";return}throw g(t())},identifierNameStartEscape(){if(a!=="u")throw g(t());t();const u=nu();switch(u){case"$":case"_":break;default:if(!b.isIdStartChar(u))throw Bu();break}F+=u,C="identifierName"},identifierName(){switch(a){case"$":case"_":case"":case"":F+=t();return;case"\\":t(),C="identifierNameEscape";return}if(b.isIdContinueChar(a)){F+=t();return}return m("identifier",F)},identifierNameEscape(){if(a!=="u")throw g(t());t();const u=nu();switch(u){case"$":case"_":case"":case"":break;default:if(!b.isIdContinueChar(u))throw Bu();break}F+=u,C="identifierName"},sign(){switch(a){case".":F=t(),C="decimalPointLeading";return;case"0":F=t(),C="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":F=t(),C="decimalInteger";return;case"I":return t(),T("nfinity"),m("numeric",P*(1/0));case"N":return t(),T("aN"),m("numeric",NaN)}throw g(t())},zero(){switch(a){case".":F+=t(),C="decimalPoint";return;case"e":case"E":F+=t(),C="decimalExponent";return;case"x":case"X":F+=t(),C="hexadecimal";return}return m("numeric",P*0)},decimalInteger(){switch(a){case".":F+=t(),C="decimalPoint";return;case"e":case"E":F+=t(),C="decimalExponent";return}if(b.isDigit(a)){F+=t();return}return m("numeric",P*Number(F))},decimalPointLeading(){if(b.isDigit(a)){F+=t(),C="decimalFraction";return}throw g(t())},decimalPoint(){switch(a){case"e":case"E":F+=t(),C="decimalExponent";return}if(b.isDigit(a)){F+=t(),C="decimalFraction";return}return m("numeric",P*Number(F))},decimalFraction(){switch(a){case"e":case"E":F+=t(),C="decimalExponent";return}if(b.isDigit(a)){F+=t();return}return m("numeric",P*Number(F))},decimalExponent(){switch(a){case"+":case"-":F+=t(),C="decimalExponentSign";return}if(b.isDigit(a)){F+=t(),C="decimalExponentInteger";return}throw g(t())},decimalExponentSign(){if(b.isDigit(a)){F+=t(),C="decimalExponentInteger";return}throw g(t())},decimalExponentInteger(){if(b.isDigit(a)){F+=t();return}return m("numeric",P*Number(F))},hexadecimal(){if(b.isHexDigit(a)){F+=t(),C="hexadecimalInteger";return}throw g(t())},hexadecimalInteger(){if(b.isHexDigit(a)){F+=t();return}return m("numeric",P*Number(F))},string(){switch(a){case"\\":t(),F+=S0();return;case'"':if(U)return t(),m("string",F);F+=t();return;case"'":if(!U)return t(),m("string",F);F+=t();return;case`
|
|
13
|
+
`:case"\r":throw g(t());case"\u2028":case"\u2029":k0(a);break;case void 0:throw g(t())}F+=t()},start(){switch(a){case"{":case"[":return m("punctuator",t())}C="value"},beforePropertyName(){switch(a){case"$":case"_":F=t(),C="identifierName";return;case"\\":t(),C="identifierNameStartEscape";return;case"}":return m("punctuator",t());case'"':case"'":U=t()==='"',C="string";return}if(b.isIdStartChar(a)){F+=t(),C="identifierName";return}throw g(t())},afterPropertyName(){if(a===":")return m("punctuator",t());throw g(t())},beforePropertyValue(){C="value"},afterPropertyValue(){switch(a){case",":case"}":return m("punctuator",t())}throw g(t())},beforeArrayValue(){if(a==="]")return m("punctuator",t());C="value"},afterArrayValue(){switch(a){case",":case"]":return m("punctuator",t())}throw g(t())},end(){throw g(t())}};function m(u,D){return{type:u,value:D,line:_,column:k}}function T(u){for(const D of u){if(O()!==D)throw g(t());t()}}function S0(){switch(O()){case"b":return t(),"\b";case"f":return t(),"\f";case"n":return t(),`
|
|
14
|
+
`;case"r":return t(),"\r";case"t":return t()," ";case"v":return t(),"\v";case"0":if(t(),b.isDigit(O()))throw g(t());return"\0";case"x":return t(),$0();case"u":return t(),nu();case`
|
|
15
|
+
`:case"\u2028":case"\u2029":return t(),"";case"\r":return t(),O()===`
|
|
16
|
+
`&&t(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw g(t());case void 0:throw g(t())}return t()}function $0(){let u="",D=O();if(!b.isHexDigit(D)||(u+=t(),D=O(),!b.isHexDigit(D)))throw g(t());return u+=t(),String.fromCodePoint(parseInt(u,16))}function nu(){let u="",D=4;for(;D-- >0;){const e=O();if(!b.isHexDigit(e))throw g(t());u+=t()}return String.fromCodePoint(parseInt(u,16))}const N0={start(){if(S.type==="eof")throw L();eu()},beforePropertyName(){switch(S.type){case"identifier":case"string":ou=S.value,N="afterPropertyName";return;case"punctuator":G();return;case"eof":throw L()}},afterPropertyName(){if(S.type==="eof")throw L();N="beforePropertyValue"},beforePropertyValue(){if(S.type==="eof")throw L();eu()},beforeArrayValue(){if(S.type==="eof")throw L();if(S.type==="punctuator"&&S.value==="]"){G();return}eu()},afterPropertyValue(){if(S.type==="eof")throw L();switch(S.value){case",":N="beforePropertyName";return;case"}":G()}},afterArrayValue(){if(S.type==="eof")throw L();switch(S.value){case",":N="beforeArrayValue";return;case"]":G()}},end(){}};function eu(){let u;switch(S.type){case"punctuator":switch(S.value){case"{":u={};break;case"[":u=[];break}break;case"null":case"boolean":case"numeric":case"string":u=S.value;break}if(Z===void 0)Z=u;else{const D=j[j.length-1];Array.isArray(D)?D.push(u):Object.defineProperty(D,ou,{value:u,writable:!0,enumerable:!0,configurable:!0})}if(u!==null&&typeof u=="object")j.push(u),Array.isArray(u)?N="beforeArrayValue":N="beforePropertyName";else{const D=j[j.length-1];D==null?N="end":Array.isArray(D)?N="afterArrayValue":N="afterPropertyValue"}}function G(){j.pop();const u=j[j.length-1];u==null?N="end":Array.isArray(u)?N="afterArrayValue":N="afterPropertyValue"}function g(u){return X(u===void 0?`JSON5: invalid end of input at ${_}:${k}`:`JSON5: invalid character '${hu(u)}' at ${_}:${k}`)}function L(){return X(`JSON5: invalid end of input at ${_}:${k}`)}function Bu(){return k-=5,X(`JSON5: invalid identifier character at ${_}:${k}`)}function k0(u){console.warn(`JSON5: '${hu(u)}' in strings is not valid ECMAScript; consider escaping`)}function hu(u){const D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){const e=u.charCodeAt(0).toString(16);return"\\x"+("00"+e).substring(e.length)}return u}function X(u){const D=new SyntaxError(u);return D.lineNumber=_,D.columnNumber=k,D}var P0=function(D,e,r){const n=[];let i="",c,E,d="",$;if(e!=null&&typeof e=="object"&&!Array.isArray(e)&&(r=e.space,$=e.quote,e=e.replacer),typeof e=="function")E=e;else if(Array.isArray(e)){c=[];for(const o of e){let f;typeof o=="string"?f=o:(typeof o=="number"||o instanceof String||o instanceof Number)&&(f=String(o)),f!==void 0&&c.indexOf(f)<0&&c.push(f)}}return r instanceof Number?r=Number(r):r instanceof String&&(r=String(r)),typeof r=="number"?r>0&&(r=Math.min(10,Math.floor(r)),d=" ".substr(0,r)):typeof r=="string"&&(d=r.substr(0,10)),A("",{"":D});function A(o,f){let s=f[o];switch(s!=null&&(typeof s.toJSON5=="function"?s=s.toJSON5(o):typeof s.toJSON=="function"&&(s=s.toJSON(o))),E&&(s=E.call(f,o,s)),s instanceof Number?s=Number(s):s instanceof String?s=String(s):s instanceof Boolean&&(s=s.valueOf()),s){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof s=="string")return B(s);if(typeof s=="number")return String(s);if(typeof s=="object")return Array.isArray(s)?l(s):h(s)}function B(o){const f={"'":.1,'"':.2},s={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let w="";for(let y=0;y<o.length;y++){const x=o[y];switch(x){case"'":case'"':f[x]++,w+=x;continue;case"\0":if(b.isDigit(o[y+1])){w+="\\x00";continue}}if(s[x]){w+=s[x];continue}if(x<" "){let z=x.charCodeAt(0).toString(16);w+="\\x"+("00"+z).substring(z.length);continue}w+=x}const v=$||Object.keys(f).reduce((y,x)=>f[y]<f[x]?y:x);return w=w.replace(new RegExp(v,"g"),s[v]),v+w+v}function h(o){if(n.indexOf(o)>=0)throw TypeError("Converting circular structure to JSON5");n.push(o);let f=i;i=i+d;let s=c||Object.keys(o),w=[];for(const y of s){const x=A(y,o);if(x!==void 0){let z=p(y)+":";d!==""&&(z+=" "),z+=x,w.push(z)}}let v;if(w.length===0)v="{}";else{let y;if(d==="")y=w.join(","),v="{"+y+"}";else{let x=`,
|
|
17
|
+
`+i;y=w.join(x),v=`{
|
|
18
|
+
`+i+y+`,
|
|
19
|
+
`+f+"}"}}return n.pop(),i=f,v}function p(o){if(o.length===0)return B(o);const f=String.fromCodePoint(o.codePointAt(0));if(!b.isIdStartChar(f))return B(o);for(let s=f.length;s<o.length;s++)if(!b.isIdContinueChar(String.fromCodePoint(o.codePointAt(s))))return B(o);return o}function l(o){if(n.indexOf(o)>=0)throw TypeError("Converting circular structure to JSON5");n.push(o);let f=i;i=i+d;let s=[];for(let v=0;v<o.length;v++){const y=A(String(v),o);s.push(y!==void 0?y:"null")}let w;if(s.length===0)w="[]";else if(d==="")w="["+s.join(",")+"]";else{let v=`,
|
|
20
|
+
`+i,y=s.join(v);w=`[
|
|
21
|
+
`+i+y+`,
|
|
22
|
+
`+f+"]"}return n.pop(),i=f,w}};const j0={parse:x0,stringify:P0};var K0=j0;export{Tu as $,K as C,_u as G,R0 as L,U0 as T,H as U,_0 as _,V0 as a,Lu as b,H0 as c,t0 as d,L0 as e,K0 as f,D0 as g,I0 as h,J0 as k,T0 as l,mu as m,Gu as n,z0 as o,G0 as q,Z0 as r,M0 as t,M as v,W0 as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as k,D as S,f as L}from"./provenance-DNyVMxNv.js";import{g as $}from"./packument-BQv4je9m.js";import{f}from"./formatBytes-BHAzNIrn-CrusHOew.js";import{a as E}from"./build-scripts-CEDx_nJp.js";import{n as h}from"./license-DvlYdo6T.js";import{v as A,U as P,z as x}from"./index-BzhrR_iC.js";import{S as M}from"./lockfile-DhHAaHN5.js";import{L as b}from"./dependency-scan-B8jroa1D.js";import{M as O}from"../packem_chunks/catalog.js";const C=2,m=4,y={CRITICAL:0,HIGH:1,LOW:3,MODERATE:C,UNKNOWN:m},le=(e,s)=>{const n=y[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??m,t=y[(s.vulnerability.severity??"UNKNOWN").toUpperCase()]??m;return n-t||e.packageName.localeCompare(s.packageName)||e.packageVersion.localeCompare(s.packageVersion)},D=(e,s)=>{const n=y[s.toUpperCase()]??C;return(y[e.toUpperCase()]??m)<=n},R=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"],w=6e4,W=(e,s,n)=>{for(const t of n)if(t===e||t===`${e}@${s}`||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},U=async(e,s)=>{const n=s.security?.policies?.firstSeen;if(n?.minutes===void 0||n.minutes<=0)return[];const{minutes:t}=n,r=n.exclude??[],c=s.security?.acceptedRisks,a=t*w,o=Date.now();return(await k(e.packages,S,async l=>{if(W(l.name,l.version,r))return;const p=await $(l.name,{workspaceRoot:e.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>=a)return;const g=Math.max(0,Math.floor(v/w));return{acceptedRisk:f(l.name,l.version,c,"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)},_=(e,s)=>{const n=s.security?.policies?.installScripts;if(!n)return[];const t=n.allow??{},r=n.strict===!0;if(!r&&Object.keys(t).length===0)return[];const c=E(e.workspaceRoot,t,{pinVersions:s.security?.pinVersions===!0});if(c.unapproved.length===0)return[];const a=s.security?.acceptedRisks,o=r?"block":"warn";return c.unapproved.map(i=>({acceptedRisk:f(i.name,i.version??"*",a,"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??"*"}))},I=new Set(["AND","OR"]),F=e=>{const s=e.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(r=>r.trim()).filter(r=>r.length>0),n=[];let t=!1;for(const r of s){const c=r.toUpperCase();if(t){t=!1;continue}if(c==="WITH"){t=!0;continue}if(I.has(c))continue;const a=r.endsWith("+"),o=a?r.slice(0,-1):r,i=h(o)??o;n.push(i),a&&n.push(`${i}-or-later`)}return n},T=e=>{if(typeof e.license=="string"){const s=e.license.trim();return s.length>0?s:void 0}if(e.license&&typeof e.license=="object"&&typeof e.license.type=="string"){const s=e.license.type.trim();if(s.length>0)return s}if(Array.isArray(e.licenses)&&e.licenses.length>0){const s=e.licenses.map(n=>n&&typeof n.type=="string"?n.type.trim():"").filter(n=>n.length>0);if(s.length>0)return s.length===1?s[0]:`(${s.join(" OR ")})`}},V=(e,s)=>{if(s.length===0)return;const n=new Set(s.map(t=>h(t)??t).map(t=>t.toLowerCase()));for(const t of e)if(n.has(t.toLowerCase()))return t},K=(e,s)=>{if(s.length===0)return;const n=new Set(s.map(t=>h(t)??t).map(t=>t.toLowerCase()));for(const t of e)if(!n.has(t.toLowerCase()))return t},j=(e,s)=>{const n=s.security?.policies?.license;if(!n)return[];const t=n.allow??[],r=n.deny??[];if(t.length===0&&r.length===0)return[];const c=s.security?.acceptedRisks,a=[];for(const o of e.packages){const i=e.manifestData?.get(`${o.name}@${o.version}`),l=i?T(i):void 0;if(!l){t.length>0&&a.push({acceptedRisk:f(o.name,o.version,c,"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=F(l),u=V(p,r);if(u){a.push({acceptedRisk:f(o.name,o.version,c,"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=K(p,t);d&&a.push({acceptedRisk:f(o.name,o.version,c,"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 a},z=6e4,B=(e,s,n)=>{for(const t of n)if(t===e||t===`${e}@${s}`||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},Y=async(e,s)=>{const n=s.security?.policies?.publisherChange;if(n?.mode!=="no-downgrade")return[];const t=n.exclude??[],r=typeof n.ignoreAfter=="number"?n.ignoreAfter*z:void 0,c=s.security?.acceptedRisks,a=Date.now();return(await k(e.packages,S,async i=>{if(B(i.name,i.version,t))return;const l=await $(i.name,{workspaceRoot:e.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)&&a-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,c,"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)},H=e=>{for(const s of Object.values(b))for(const n of[s.file,...s.aliases??[]])if(e===n||e.endsWith(`/${n}`)||e.endsWith(`.${n}`))return s.type},q=(e,s,n)=>{const t=A(s)?s:P(e,s);let r;try{r=x(t)}catch{return}const c=H(t)??b[n]?.type;if(!c)return;const a=M(r,c);if(a.length===0)return;const o=new Set;for(const i of a)o.add(`${i.name}@${i.version}`);return o},G=(e,s)=>{for(const n of s)if(n===e||n.endsWith("*")&&e.startsWith(n.slice(0,-1)))return!0;return!1},X=(e,s)=>{const n=s.security?.policies?.unexpectedDeps;if(!n)return[];const t=n.allow??[],r=n.baselineLockfile;if(t.length===0&&!r)return[];const c=r?q(e.workspaceRoot,r,e.packageManager):void 0,a=s.security?.acceptedRisks,o=[];for(const i of e.packages){const l=t.length===0||G(i.name,t),p=c?c.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&&c&&(u.push(`not present in baseline lockfile (${r})`),d.baselineLockfile=r),o.push({acceptedRisk:f(i.name,i.version,a,"unexpectedDeps"),data:d,packageName:i.name,policy:"unexpectedDeps",reason:`${i.name}@${i.version} is unexpected: ${u.join("; ")}`,severity:"block",version:i.version})}return o},J=(e,s)=>{if(!e.osvFindings||e.osvFindings.size===0)return[];const t=s.security?.policies?.vulnerability?.failOn,r=s.security?.acceptedRisks,c=[];for(const a of e.packages){const o=e.osvFindings.get(O(a.name,a.version))??e.osvFindings.get(a.name);if(!(!o||o.length===0))for(const i of o){const l=t?D(i.severity,t)?"block":"warn":"info";c.push({acceptedRisk:f(a.name,a.version,r,"vulnerability"),data:{advisoryId:i.id,aliases:i.aliases??[],cvssScore:i.cvssScore,fixedVersions:i.fixedVersions,severity:i.severity,summary:i.summary},packageName:a.name,policy:"vulnerability",reason:`${i.severity} ${i.id} affects ${a.name}@${a.version}: ${i.summary}`,severity:l,version:a.version})}}return c},N=[{evaluate:J,isConfigured:e=>e.security?.policies?.vulnerability!==void 0,name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:j,isConfigured:e=>{const s=e.security?.policies?.license;return!!(s&&(s.allow&&s.allow.length>0||s.deny&&s.deny.length>0))},name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:_,isConfigured:e=>{const s=e.security?.policies?.installScripts;return!!(s&&(s.allow&&Object.keys(s.allow).length>0||s.strict===!0))},name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:X,isConfigured:e=>{const s=e.security?.policies?.unexpectedDeps;return!!(s&&(s.allow&&s.allow.length>0||typeof s.baselineLockfile=="string"))},name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:U,isConfigured:e=>{const s=e.security?.policies?.firstSeen?.minutes;return typeof s=="number"&&s>0},name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:Y,isConfigured:e=>e.security?.policies?.publisherChange?.mode==="no-downgrade",name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],Q=(e,s,n)=>N.filter(t=>t.surfaces.includes(e)?n!==void 0?n.has(t.name):t.isConfigured(s):!1),ue=async(e,s,n)=>{const t=Q(s,n.visConfig,n.enabledPolicies),r=[];for(const c of t){if(e.offline&&!c.offlineSupported){r.push({packageName:"*",policy:c.name,reason:`policy.${c.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const a=await c.evaluate(e,n.visConfig);r.push(...a)}catch(a){const o=a instanceof Error?a.message:String(a);r.push({packageName:"*",policy:c.name,reason:`policy.${c.name} failed: ${o}`,severity:"info",version:"*"})}}return r},Z=(()=>{const e=new Map;for(const s of R)e.set(s.toLowerCase(),s);return e})(),de=()=>N.map(e=>e.name),pe=(e,s)=>{if(e===void 0)return;const n=e.trim().toLowerCase();if(n===""||n==="none")return new Set;if(n==="all")return new Set(R);const t=new Set;for(const r of e.split(",").map(c=>c.trim()).filter(c=>c.length>0)){const c=r.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(o,i)=>i.toUpperCase()),a=Z.get(c.toLowerCase());a===void 0?s?.(r):t.add(a)}return t};export{le as c,ue as e,de as g,pe as p,D as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./vis-user-error-
|
|
1
|
+
import{b as e}from"./vis-user-error-75VtCwMv.js";const o={filter:{alias:"F",description:"Filter packages by name pattern",multiple:!0,type:String},parallel:{defaultValue:!1,description:"Run concurrently without topological ordering",type:Boolean},recursive:{alias:"r",defaultValue:!1,description:"Run in every workspace package",type:Boolean},reverse:{defaultValue:!1,description:"Reverse topological execution order",type:Boolean},"shell-mode":{alias:"c",defaultValue:!1,description:"Execute within shell environment",type:Boolean},"workspace-root":{alias:"w",defaultValue:!1,description:"Run on workspace root only",type:Boolean}},l=e({argument:{description:"Command to execute followed by arguments",name:"command",type:String},description:"Execute a local node_modules/.bin command (no remote fallback)",examples:[["vis exec eslint .","Run local eslint"],["vis exec tsc --noEmit","Run local TypeScript check"],["vis exec -r -- eslint .","Run in all workspace packages"],["vis exec -c 'echo $PATH'","Shell mode"]],group:"Run & Execute",loader:()=>import("../packem_chunks/handler.js"),name:"exec",options:o});export{l as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as n}from"node:module";import{o as p,n as a,C as f}from"./index-
|
|
1
|
+
import{createRequire as n}from"node:module";import{o as p,n as a,C as f}from"./index-BzhrR_iC.js";let i;const c=e=>(i??=n(import.meta.url))(e),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[o,s]=r.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return r.getBuiltinModule(e)}return c(e)},{createRequire:l}=u("node:module");let d;const _=e=>(d??=l(import.meta.url))(e),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=e=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[o,s]=t.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return t.getBuiltinModule(e)}return _(e)},{accessSync:g}=m("node:fs");function h(e,o=p){a(e),e=f(e);try{return g(e,o),!0}catch{return!1}}export{h as y};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as K}from"node:module";import{n as E,o as z,C as S,d as X,e as h}from"./index-BzhrR_iC.js";import{p as rt}from"./formatBytes-BHAzNIrn-CrusHOew.js";import{N as it}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{r as D}from"./writeFileSync-DJoHk3Ks-BPRoepNw.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as p}from"node:module";import{e as a}from"./index-BzhrR_iC.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as j}from"node:module";import{e as d}from"./index-BzhrR_iC.js";import{y}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as P}from"./readJsonSync-CbryXYxN-EWl7_7KX.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const v=["build","dependencyManagement","distributionManagement","pluginRepositories","profiles","reporting","repositories"],h=["dependencies","modules","parent","properties"],m=e=>" ".repeat(e.length),I=e=>e.replaceAll(/<!--[\s\S]*?-->/g,m),f=(e,n)=>e.replaceAll(new RegExp(String.raw`<(${n.join("|")})\b[^>]*>[\s\S]*?</\1>`,"g"),m),u=(e,n)=>{const t=new RegExp(String.raw`<${n}(?:\s[^>]*)?>`).exec(e);if(!t)return;const s=t.index+t[0].length,r=e.indexOf(`</${n}>`,s);return r===-1?void 0:{end:r,start:s}},a=(e,n,t)=>{const s=new RegExp(String.raw`<${t}>(\s*)([^<]*?)\s*</${t}>`).exec(e);if(!s)return;const r=n+s.index+t.length+2+s[1].length;return{end:r+s[2].length,start:r,value:s[2]}},S=e=>{const n=I(e),t=f(n,v),s=f(t,h),r={artifactId:a(s,0,"artifactId"),dependencies:[],groupId:a(s,0,"groupId"),modules:[],properties:new Map,version:a(s,0,"version")},c=u(t,"parent");if(c){const i=t.slice(c.start,c.end),o=/<relativePath>\s*([^<]*?)\s*<\/relativePath>/.exec(e.slice(c.start,c.end))?.[1];r.parent={artifactId:a(i,c.start,"artifactId"),groupId:a(i,c.start,"groupId"),relativePath:o,version:a(i,c.start,"version")}}const p=u(t,"properties");if(p){const i=t.slice(p.start,p.end);for(const o of i.matchAll(/<([A-Z_][\w.-]*)>(\s*)([^<]*?)\s*<\/\1>/gi)){const d=p.start+o.index+o[1].length+2+o[2].length;r.properties.set(o[1],{end:d+o[3].length,start:d,value:o[3]})}}const g=u(t,"modules");if(g)for(const i of t.slice(g.start,g.end).matchAll(/<module>\s*([^<]+?)\s*<\/module>/g))r.modules.push(i[1]);const l=u(t,"dependencies");if(l){const i=f(t.slice(l.start,l.end),["exclusions"]);for(const o of i.matchAll(/<dependency>([\s\S]*?)<\/dependency>/g)){const d=l.start+o.index+12;r.dependencies.push({artifactId:a(o[1],d,"artifactId"),groupId:a(o[1],d,"groupId"),scope:a(o[1],d,"scope"),version:a(o[1],d,"version")})}}return r},A=(e,n)=>{let t=e;for(const{slot:s,value:r}of[...n].sort((c,p)=>p.slot.start-c.slot.start))t=`${t.slice(0,s.start)}${r}${t.slice(s.end)}`;return t},x=e=>e.groupId?.value??e.parent?.groupId?.value,R=(e,n)=>{const t=n.groupId?.value==="${project.groupId}"?x(e):n.groupId?.value,s=n.artifactId?.value;return t===void 0||s===void 0?void 0:`${t}:${s}`},$=e=>e.includes("${"),w=e=>!$(e)&&!/^[[(]/.test(e);export{$ as a,A as b,R as d,x as e,w as i,S as s};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e as g,z as d}from"./index-BzhrR_iC.js";import{r as A}from"../packem_chunks/cli-main.js";import{y as $}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{U as u}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";const x=(k,p,h,m=[])=>{const t=[];if(h===void 0)return t.push("minimumReleaseAge not set in vis.config; skipping native sync."),t;const r=Number.isFinite(h)?Math.max(0,Math.round(h)):0;switch(k){case"bun":{const n=g(p,"bunfig.toml");let e=$(n)?d(n):"";const s=r*60,i=`minimumReleaseAge = ${String(s)}`,a=m.length>0?`minimumReleaseAgeExcludes = [${m.map(c=>`"${c.replaceAll(String.raw`"`,String.raw`\"`)}"`).join(", ")}]`:void 0,o=/^\[install\][ \t]*\n/m.exec(e);if(o?.index===void 0){const c=a?`${i}
|
|
2
2
|
${a}`:i;e=`${e.trimEnd()?`${e.trimEnd()}
|
|
3
3
|
|
|
4
4
|
`:""}[install]
|
|
5
5
|
${c}
|
|
6
|
-
`}else{const c=o.index+o[0].length,b=e.slice(c),
|
|
6
|
+
`}else{const c=o.index+o[0].length,b=e.slice(c),y=/^\[/m.exec(b),f=y?.index===void 0?e.length:c+y.index;let l=e.slice(c,f);l=/^[ \t]*minimumReleaseAge[ \t]*=/m.test(l)?l.replace(/^[ \t]*minimumReleaseAge[ \t]*=.*$/m,i):`${i}
|
|
7
7
|
${l}`,a&&(l=/^[ \t]*minimumReleaseAgeExcludes[ \t]*=/m.test(l)?l.replace(/^[ \t]*minimumReleaseAgeExcludes[ \t]*=.*$/m,a):`${a}
|
|
8
|
-
${l}`),e=`${e.slice(0,c)}${l}${e.slice(
|
|
8
|
+
${l}`),e=`${e.slice(0,c)}${l}${e.slice(f)}`}u(n,e.endsWith(`
|
|
9
9
|
`)?e:`${e}
|
|
10
|
-
`),t.push(`Updated bunfig.toml [install] minimumReleaseAge = ${String(s)} (${String(r)} minutes)`),a&&t.push(`Updated bunfig.toml [install] minimumReleaseAgeExcludes (${String(m.length)} entries)`);break}case"npm":{const n=
|
|
10
|
+
`),t.push(`Updated bunfig.toml [install] minimumReleaseAge = ${String(s)} (${String(r)} minutes)`),a&&t.push(`Updated bunfig.toml [install] minimumReleaseAgeExcludes (${String(m.length)} entries)`);break}case"npm":{const n=g(p,".npmrc");let e=$(n)?d(n):"";const s=r===0?0:Math.max(1,Math.ceil(r/1440)),i=`min-release-age=${String(s)}`;e=/^\s*min-release-age\s*=/m.test(e)?e.replace(/^\s*min-release-age\s*=.*$/m,i):`${e.trimEnd()}
|
|
11
11
|
${i}
|
|
12
12
|
`,u(n,e.endsWith(`
|
|
13
13
|
`)?e:`${e}
|
|
14
|
-
`),t.push(`Updated .npmrc min-release-age=${String(s)} (rounded up from ${String(r)} minutes; npm's unit is days)`),m.length>0&&t.push("npm has no native per-package exclude list; skipped excludes sync.");break}case"pnpm":{const n=
|
|
14
|
+
`),t.push(`Updated .npmrc min-release-age=${String(s)} (rounded up from ${String(r)} minutes; npm's unit is days)`),m.length>0&&t.push("npm has no native per-package exclude list; skipped excludes sync.");break}case"pnpm":{const n=g(p,"pnpm-workspace.yaml");if(!$(n)){t.push("pnpm-workspace.yaml not found. Cannot sync minimumReleaseAge.");break}let e=d(n);e.endsWith(`
|
|
15
15
|
`)||(e+=`
|
|
16
16
|
`);const s=`minimumReleaseAge: ${String(r)}
|
|
17
17
|
`;if(e=/^minimumReleaseAge[ \t]*:.*$/m.test(e)?e.replace(/^minimumReleaseAge[ \t]*:.*$/m,s.trimEnd()):`${e.trimEnd()}
|
|
@@ -21,7 +21,7 @@ ${m.map(o=>` - ${A(o)}`).join(`
|
|
|
21
21
|
`)}
|
|
22
22
|
`,a=/^minimumReleaseAgeExclude:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;e=a.test(e)?e.replace(a,i):`${e.trimEnd()}
|
|
23
23
|
|
|
24
|
-
${i}`}u(n,e),t.push(`Updated pnpm-workspace.yaml minimumReleaseAge: ${String(r)} minutes`),m.length>0&&t.push(`Updated pnpm-workspace.yaml minimumReleaseAgeExclude (${String(m.length)} entries)`);break}case"yarn":{const n=
|
|
24
|
+
${i}`}u(n,e),t.push(`Updated pnpm-workspace.yaml minimumReleaseAge: ${String(r)} minutes`),m.length>0&&t.push(`Updated pnpm-workspace.yaml minimumReleaseAgeExclude (${String(m.length)} entries)`);break}case"yarn":{const n=g(p,".yarnrc.yml");if(!$(n)){t.push("yarn classic lacks npmMinimalAgeGate; .yarnrc.yml not found, skipping.");break}let e=d(n);const s=`npmMinimalAgeGate: ${String(r)}`;if(e.endsWith(`
|
|
25
25
|
`)||(e+=`
|
|
26
26
|
`),e=/^npmMinimalAgeGate[ \t]*:.*$/m.test(e)?e.replace(/^npmMinimalAgeGate[ \t]*:.*$/m,s):`${e.trimEnd()}
|
|
27
27
|
|
|
@@ -31,4 +31,4 @@ ${m.map(o=>` - ${A(o)}`).join(`
|
|
|
31
31
|
`)}
|
|
32
32
|
`,a=/^npmPreapprovedPackages:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;e=a.test(e)?e.replace(a,i):`${e.trimEnd()}
|
|
33
33
|
|
|
34
|
-
${i}`}u(n,e),t.push(`Updated .yarnrc.yml npmMinimalAgeGate: ${String(r)} (minutes; bare integer dodges yarn duration-string bug)`),m.length>0&&t.push(`Updated .yarnrc.yml npmPreapprovedPackages (${String(m.length)} entries)`);break}}return t};export{
|
|
34
|
+
${i}`}u(n,e),t.push(`Updated .yarnrc.yml npmMinimalAgeGate: ${String(r)} (minutes; bare integer dodges yarn duration-string bug)`),m.length>0&&t.push(`Updated .yarnrc.yml npmPreapprovedPackages (${String(m.length)} entries)`);break}}return t};export{x as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as d,U as u}from"./index-BzhrR_iC.js";import{k as m,z as E,B as D,L as o}from"../packem_chunks/catalog.js";import{y as l}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";const S=/\/+$/,f=/node_modules/,p=/\.git/,_=/[$()+.?[\\\]^{|}]/g,y=/\/\*\*$|\/\*\/\*$/,P=t=>{for(const r of o(t,{includeDirs:!1,includeSymlinks:!1,skip:[f,p]}))if(r.name==="package.json")return!0;return!1},h=(t,r,n)=>{for(const e of o(t,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[f,p]})){if(e.path===t||e.name.startsWith(".")||l(d(e.path,"package.json")))continue;const i=`${r}/${e.name}`;P(e.path)?h(e.path,i,n):n.push(i)}},g=(t,r)=>{const n=r.replace(S,"");if(n.startsWith("!"))return[];const e=[];if(n.endsWith("/*")&&!n.endsWith("/*/*")){const a=n.slice(0,-2),s=u(t,a);if(!l(s))return[];for(const c of o(s,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[f,p]}))c.path===s||c.name.startsWith(".")||e.push(d(a,c.name));return e}if(n.endsWith("/**")||n.endsWith("/*/*")){const a=n.replace(y,""),s=u(t,a);return l(s)&&h(s,a,e),e}if(!n.includes("/")&&n.includes("*")){const a=n.replaceAll(_,String.raw`\$&`).replaceAll("*",".*"),s=new RegExp(`^${a}$`);for(const c of o(t,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[f,p]}))c.path!==t&&s.test(c.name)&&e.push(c.name);return e}const i=u(t,n);return l(i)&&e.push(n),e},x=t=>{const n=m(t)??E(t)??[],e=new Set,i=[];for(const a of n)for(const s of g(t,a))s==="."||e.has(s)||(e.add(s),D(d(t,s))||i.push({packageDir:s}));return i};export{x as l};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as P}from"node:module";let S;const T=t=>(S??=P(import.meta.url))(t),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=t=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[e,n]=p.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return p.getBuiltinModule(t)}return T(t)},{existsSync:b,readFileSync:q,readdirSync:D}=k("node:fs"),{join:u}=k("node:path");class a extends Error{file;constructor(e,n){super(n),this.name="MixProjectError",this.file=e}}const j=(t,e)=>t.slice(0,e).split(`
|
|
2
|
+
`).length,A=(t,e)=>{let n=0;for(let s=e;s<t.length;s++)if(t[s]==="[")n++;else if(t[s]==="]"&&(n--,n===0))return s;return t.length},d=t=>!t.includes("#{"),B=(t,e)=>{const n=/^[ \t]*def project\b[^\n]*\n/m.exec(t);if(n===null)throw new a(e,`${e} has no def project/0 that vis can read.`);const s=n.index+n[0].length,m=t.slice(s),f=/^[ \t]*defp?\s/m.exec(m),r=f===null?m:m.slice(0,f.index),_=/\bapps_path:/.test(r);let y;if(_){const o=/\bapps_path:\s*"([^"]*)"/.exec(r);if(o===null||!d(o[1]))throw new a(e,`${e} sets apps_path to something other than a plain string literal. vis reads only apps_path: "apps".`);[,y]=o}const $=/\bapp:\s*:([a-z_]\w*)/.exec(r);let w;if(/\bpackage:/.test(r)){const o=/\bpackage:\s*\[/.exec(r);if(o===null)throw new a(e,`${e} sets package to an expression. vis reads only a package: [name: "…"] keyword list.`);const l=o.index+o[0].length-1,c=r.slice(l,A(r,l)+1),i=/\bname:\s*"([^"]*)"/.exec(c);if(/\bname:/.test(c)&&(i===null||!d(i[1])))throw new a(e,`${e} sets package name to something other than a plain string literal. vis reads only name: "…".`);w=i?.[1]}const g=[...r.matchAll(/\bversion:[ \t]*([^\n,\]]*)/g)];if(g.length>1)throw new a(e,`${e} declares version ${g.length} times in project/0. vis cannot tell which one applies.`);const[v]=g;let x;if(v!==void 0){const o=(v[1]??"").trim(),l=j(t,s+v.index),c=/^"([^"]*)"$/.exec(o);if(c!==null&&d(c[1]))x={kind:"literal",line:l,value:c[1]};else if(o==="@version"){const i=[...t.matchAll(/^[ \t]*@version[ \t]+"([^"]*)"[ \t]*$/gm)],[h]=i;if(i.length!==1||h===void 0||!d(h[1]))throw new a(e,`${e} uses version: @version but has ${i.length} plain @version "…" attributes. vis needs exactly one.`);x={kind:"attribute",line:j(t,h.index),value:h[1]}}else throw new a(e,`${e} sets version to something other than a plain "…" literal or @version on line ${l}. vis reads only those.`)}const M=[...t.matchAll(/\{:([a-z_]\w*),\s*(?:in_umbrella:\s*true|path:\s*"[^"]*")/g)].map(o=>o[1]);return{app:$?.[1],appsPath:y,isUmbrella:_,localDeps:[...new Set(M)],packageName:w,version:x}},R=t=>{const e=u(t,"mix.exs");if(!b(e))return;const n=q(e,"utf8");return{file:e,project:B(n,e),raw:n}},z=(t,e)=>{const n=u(t,e);return b(n)?D(n,{withFileTypes:!0}).filter(s=>s.isDirectory()&&b(u(n,s.name,"mix.exs"))).map(s=>u(n,s.name)).sort():[]};export{a as M,z as l,R as r};
|