@visulima/vis 4.0.2 → 4.1.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 +46 -0
- package/README.md +2 -2
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/catalog.js +1 -1
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +155 -155
- package/dist/packem_chunks/git.js +4 -3
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler39.js +6 -6
- package/dist/packem_chunks/handler40.js +1 -75
- package/dist/packem_chunks/handler56.js +6 -6
- package/dist/packem_chunks/handler59.js +73 -9
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler60.js +11 -3
- package/dist/packem_chunks/handler61.js +3 -22
- package/dist/packem_chunks/handler62.js +21 -60
- package/dist/packem_chunks/handler63.js +61 -3
- package/dist/packem_chunks/handler64.js +3 -6
- package/dist/packem_chunks/handler65.js +6 -9
- package/dist/packem_chunks/handler72.js +1 -1
- package/dist/packem_chunks/handler78.js +1 -1
- package/dist/packem_chunks/help-command.js +2 -2
- package/dist/packem_chunks/resolveFormatter.js +7 -5
- package/dist/packem_chunks/root-handler.js +1 -0
- package/dist/packem_chunks/version-resolver.js +3 -2
- package/dist/packem_shared/DEFAULT_BREAKING_SECTION-DUAcKVLD.js +1 -0
- package/dist/packem_shared/DEFAULT_CONVENTIONAL_HEADING-D7oNGUcP.js +1 -0
- package/dist/packem_shared/{affected-selection-BdFnUyQZ.js → affected-selection-D3rosWKF.js} +1 -1
- package/dist/packem_shared/{api.d-BPftyU9r.d.ts → api.d-C10vHKJZ.d.ts} +1 -1
- package/dist/packem_shared/{bin-BieNPL6n.js → bin-Bc5j8Cdm.js} +1 -1
- package/dist/packem_shared/buildCompareUrl-BLaukjgu.js +1 -0
- package/dist/packem_shared/conventional-CGiOOEq1.js +4 -0
- package/dist/packem_shared/hasBulletMarker-BX2KwzI5.js +1 -0
- package/dist/packem_shared/{index-BPeT7L7t.js → index-B0ahNAKR.js} +1 -1
- package/dist/packem_shared/{package-version-DqNoc-rP.js → package-version-BhrkMRQ2.js} +1 -1
- package/dist/packem_shared/{project-name-filter-B0y95mKx.js → project-name-filter-jDQpaOkI.js} +1 -1
- package/dist/packem_shared/release-heading-DRpkhETz.js +1 -0
- package/dist/packem_shared/run-D-uVGHQ4.js +10 -0
- package/dist/packem_shared/{vis-user-error-4RgO8nMw.js → vis-user-error-CEc_asoq.js} +1 -1
- package/dist/release/core/changelog/index.d.ts +274 -31
- package/dist/release/core/changelog/index.js +1 -1
- package/dist/release/plugin-sdk.d.ts +2 -2
- package/dist/release/types.d.ts +44 -2
- package/index.js +52 -52
- package/package.json +11 -11
- package/schemas/vis-config.schema.json +19 -1
- package/schemas/vis-release-config.schema.json +19 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import{createRequire as
|
|
1
|
+
import{createRequire as U}from"node:module";import{d as M,l as q,s as z,c as S}from"../packem_shared/conventional-CGiOOEq1.js";import{b as R,r as V,a as H}from"../packem_shared/release-heading-DRpkhETz.js";import{renderGroupedEntries as F,withBullet as k,DEFAULT_CONVENTIONAL_TYPES as K}from"../packem_shared/DEFAULT_BREAKING_SECTION-DUAcKVLD.js";import{createShellRunner as W}from"./shell-runner.js";let D;const G=e=>(D??=U(import.meta.url))(e),$=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,j=e=>{if(typeof $<"u"&&$.versions&&$.versions.node){const[o,n]=$.versions.node.split(".").map(Number);if(o>22||o===22&&n>=3||o===20&&n>=16)return $.getBuiltinModule(e)}return G(e)},{pathToFileURL:O}=j("node:url"),T="breaking",X="Miscellaneous",L="-",Y=[{section:"Breaking Changes",type:T},{section:"Features",type:"feat"},{section:"Bug Fixes",type:"fix"},{section:"Performance Improvements",type:"perf"},{section:"Reverts",type:"revert"},{section:"Documentation",type:"docs"},{hidden:!0,section:"Styles",type:"style"},{hidden:!0,section:"Code Refactoring",type:"refactor"},{hidden:!0,section:"Tests",type:"test"},{hidden:!0,section:"Build System",type:"build"},{hidden:!0,section:"Continuous Integration",type:"ci"},{hidden:!0,section:"Miscellaneous Chores",type:"chore"}],J=e=>`(${e.startsWith("@")?e:`@${e}`})`,Q=(e,o)=>{for(const n of o)e.push(`${k(n.line,L)}${n.suffix??""}`)},P=(e={})=>o=>{const{changeFiles:n,date:i,release:t,target:p}=o,c=[];if(p!=="github-release")if(e.heading===void 0)c.push(`## ${t.newVersion}`),c.push(`<sub>${i}</sub>`),c.push("");else{const s=R({compareUrlPrefix:e.compareUrlPrefix,name:t.name,newVersion:t.newVersion,oldVersion:t.oldVersion,repo:e.repo,tagPattern:e.tagPattern});c.push(V(e.heading,{compareUrl:s,date:i,name:t.name,version:t.newVersion}),"")}const u=[];for(const s of n){const r=s.body.trim();if(!r)continue;const d=e.authorCredit?s.meta?.author:void 0,l=d?` ${J(d)}`:"";for(const v of r.split(/\r?\n/)){const m=v.trim();m&&u.push({line:m,suffix:l})}}const a=e.sections===void 0?void 0:e.sections.length===0?Y:e.sections;if(a?c.push(...F(u,{breakingSection:!1,breakingType:T,bullet:L,entryStyle:"verbatim",types:a,uncategorizedSection:X})):Q(c,u),t.isCascadeBump||t.isGroupBump)for(const s of t.sources){const r=t.isCascadeBump?"Cascade from":"Group bump with";c.push(`- ${r} ${s.name}@${s.newVersion}`)}else if(t.isDependencyBump&&n.length===0)for(const s of t.sources)s.newVersion===""?c.push(`- Removed dependency ${s.name}`):c.push(`- Updated dependency ${s.name}@${s.newVersion}`);return c.join(`
|
|
2
2
|
`).replaceAll(/\n{3,}/g,`
|
|
3
3
|
|
|
4
|
-
`).trim()},
|
|
5
|
-
`)[0]?.trim()||void 0},
|
|
6
|
-
`)
|
|
4
|
+
`).trim()},Z=P(),ee={includeCommitLink:!0,internalAuthors:[],thankContributors:!0},te=async(e,o,n)=>{const i=await e.run("git",["log","--diff-filter=A","--pretty=format:%aN%n%aE","--",n],{cwd:o,silent:!0});return i.exitCode!==0?void 0:i.stdout.split(`
|
|
5
|
+
`)[0]?.trim()||void 0},_=(e={})=>{const o={...ee,...e},n=e.runner??W();let i;return async p=>{const{changeFiles:c,date:u,release:a,target:s}=p,r=[],d=[],l=new Set,v=process.cwd();i||(i=M(e.repo,n,v));const m=await i,C=m.slug===void 0?void 0:H(m.provider,m.slug);if(s!=="github-release")if(e.heading===void 0)r.push(`## ${a.newVersion}`),r.push(`<sub>${u}</sub>`),r.push("");else{const f=R({name:a.name,newVersion:a.newVersion,oldVersion:a.oldVersion,provider:m.provider,repo:m.slug,tagPattern:e.tagPattern});r.push(V(e.heading,{compareUrl:f,date:u,name:a.name,version:a.newVersion}),"")}for(const f of c){const b=f.body.trim(),h=f.meta??{},g=h.author??await te(n,v,f.path);g&&o.thankContributors&&!o.internalAuthors.includes(g.replace(/^@/,""))&&l.add(g.startsWith("@")?g:`@${g}`);const y=[];if(h.pr&&C?y.push(`[#${h.pr}](${C.pullRequest(String(h.pr))})`):h.pr&&y.push(`#${h.pr}`),h.commit&&o.includeCommitLink&&C){const w=h.commit.slice(0,7);y.push(`[\`${w}\`](${C.commit(h.commit)})`)}const N=y.length>0?` (${y.join(", ")})`:"";if(b)for(const w of b.split(/\r?\n/)){const A=w.trim();A&&d.push({line:q(A,m),suffix:N})}}if(e.types===void 0){for(const f of d)r.push(`${k(f.line,"-")}${f.suffix??""}`);if(a.isCascadeBump||a.isGroupBump)for(const f of a.sources){const b=a.isCascadeBump?"Cascade from":"Group bump with";r.push(`- ${b} ${f.name}@${f.newVersion}`)}else if(a.isDependencyBump&&c.length===0)for(const f of a.sources)f.newVersion===""?r.push(`- Removed dependency ${f.name}`):r.push(`- Updated dependency ${f.name}@${f.newVersion}`)}else d.push(...z(p)),r.push(...F(d,{breakingSection:e.breakingSection,types:e.types.length===0?K:e.types}));o.thankContributors&&l.size>0&&(r.push(""),r.push(`Thanks ${[...l].join(", ")}!`));const E=r.join(`
|
|
6
|
+
`);return e.types===void 0?E:E.replaceAll(/\n{3,}/g,`
|
|
7
|
+
|
|
8
|
+
`).trimEnd()}},I=["Added","Changed","Deprecated","Removed","Fixed","Security"],ne=e=>{const o=e.toLowerCase();return I.find(n=>n.toLowerCase()===o)},re={add:"Added",bugfix:"Fixed",change:"Changed",changed:"Changed",chore:"Changed",deprecate:"Deprecated",deprecated:"Deprecated",feat:"Added",feature:"Added",fix:"Fixed",perf:"Changed",refactor:"Changed",remove:"Removed",removed:"Removed",sec:"Security",security:"Security"},oe=/^\s*\[(added|changed|deprecated|removed|fixed|security)\]\s*:?\s*(.*)$/i,se=e=>e.replace(/^[-*]\s+/,"").trim(),ie=e=>{const o=/^([a-z]+)(?:\([^)]+\))?!?\s*:\s*(.*)$/i.exec(e.trim());if(!o)return;const n=o[1].toLowerCase(),i=re[n];if(i)return{rest:o[2].trim(),section:i}},ce=e=>e==="major"?"Changed":e==="minor"?"Added":"Fixed",x=(e,o)=>/\bBREAKING(?:\s+CHANGE)?\b/.test(e)||/^\s*[a-z]+(?:\([^)]+\))?!\s*:/i.test(e)||o==="major",ae=(e,o,n,i)=>{const t=se(e);if(!t)return;const p=oe.exec(t);if(p){const u=ne(p[1]);if(u){n[u].push(`- ${p[2].trim()}`);return}}const c=ie(t);if(c){x(t,o)&&i.push(`- ${c.rest||t}`),n[c.section].push(`- ${c.rest||t}`);return}x(t,o)&&i.push(`- ${t}`),n[ce(o)].push(`- ${t}`)},ue=(e,o,n,i,t)=>{if(o)return`${o}/compare/${i}...${t}`;if(e)return`https://github.com/${e}/compare/${i}...${t}`},B=(e={})=>o=>{const{changeFiles:n,date:i,release:t,target:p}=o,c={Added:[],Changed:[],Deprecated:[],Fixed:[],Removed:[],Security:[]},u=[],a=t.type;for(const r of n)for(const d of r.body.trim().split(/\r?\n/))d.trim()&&ae(d,a,c,u);if(t.isCascadeBump||t.isGroupBump)for(const r of t.sources){const d=t.isCascadeBump?"Cascade from":"Group bump with";c.Changed.push(`- ${d} \`${r.name}\`@${r.newVersion}`)}else if(t.isDependencyBump&&n.length===0)for(const r of t.sources)r.newVersion===""?c.Removed.push(`- Removed dependency \`${r.name}\``):c.Changed.push(`- Updated dependency \`${r.name}\`@${r.newVersion}`);const s=[];if(p!=="github-release"&&(s.push(`## [${t.newVersion}] - ${i}`),s.push("")),u.length>0){s.push("### ⚠ BREAKING CHANGES"),s.push("");for(const r of u)s.push(r);s.push("")}for(const r of I){const d=c[r];if(d.length!==0){s.push(`### ${r}`),s.push("");for(const l of d)s.push(l);s.push("")}}if(p!=="github-release"){const r=`${t.name}@${t.oldVersion}`,d=`${t.name}@${t.newVersion}`,l=ue(e.repo,e.compareUrlPrefix,t.name,r,d);l&&s.push(`[${t.newVersion}]: ${l}`)}return s.join(`
|
|
7
9
|
`).replaceAll(/\n{3,}/g,`
|
|
8
10
|
|
|
9
|
-
`).trimEnd()},
|
|
11
|
+
`).trimEnd()},he=async(e,o)=>{if(e===!1)return()=>"";if(e===void 0||e==="default")return Z;if(e==="github")return _();if(e==="keep-a-changelog"||e==="keepachangelog")return B();if(e==="conventional"||e==="conventionalcommits")return S();let n,i={};if(Array.isArray(e)?[n,i={}]=e:n=e,n==="default")return P(i);if(n==="github")return _(i);if(n==="keep-a-changelog"||n==="keepachangelog")return B(i);if(n==="conventional"||n==="conventionalcommits")return S(i);const t=n.startsWith(".")?`${o}/${n}`:n,p=O(t).href,{dynamicEsmImport:c}=await import("./dynamic-import.js"),u=await c(p),a=typeof u=="function"?u:u.default;if(typeof a!="function")throw new TypeError(`Custom changelog formatter at ${n} did not export a default function or a callable module.`);if(Array.isArray(e))try{const s=a(i);if(typeof s=="function")return s}catch{}return a};export{he as resolveFormatter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=async e=>{const a=e.runtime.getCommands().get("help");if(typeof a?.execute!="function"){e.logger.info('Run "vis release <subcommand> --help" — for example "vis release status --help".');return}await a.execute({...e,argument:["release"],commandName:"help"})};export{t as default};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import{a as h}from"../packem_shared/index-B4AjSxHU.js";import{b}from"./index2.js";import{r as
|
|
2
|
-
`).map(c=>c.trim()).filter(Boolean);if(d.length===0)return{fallbackReason:`no git tag matched pattern "${n}" for ${e.name}; falling back to manifest version ${e.version}. (Pass --first-release to bootstrap.)`,resolvedFrom:"disk",version:e.version};const f
|
|
1
|
+
import{a as h}from"../packem_shared/index-B4AjSxHU.js";import{b as R}from"./index2.js";import{r as y}from"./orchestrator.js";const P=e=>{let s=0;const o=[],t=()=>{if(s>=e)return;const n=o.shift();n&&(s+=1,n())};return async n=>new Promise((m,a)=>{const d=()=>{s-=1,t()},f=()=>{n().then(m,a).finally(d)};o.push(f),t()})},x=4,g=new Map,$=(e,s)=>{const o=d=>d.replaceAll(/[$()*+.?[\\\]^{|}]/g,String.raw`\$&`);let t="^",n=0;const m=/\{(name|unscopedName|version|major|minor|patch|date|channel)\}/g;let a;for(;(a=m.exec(e))!==null;){switch(t+=o(e.slice(n,a.index)),a[1]){case"name":{t+=o(s.name);break}case"unscopedName":{t+=o(s.name.replace(/^@[^/]+\//,""));break}case"version":{t+=String.raw`(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)`;break}default:t+="[^/]+"}n=a.index+a[0].length}return t+=`${o(e.slice(n))}$`,new RegExp(t)},p="{name}@{version}",w=(e,s)=>e.replaceAll(/\{(name|unscopedName|version|major|minor|patch|date|channel)\}/g,(o,t)=>t==="name"?s.name:t==="unscopedName"?s.name.replace(/^@[^/]+\//,""):"*"),C=async(e,s,o,t)=>{if(s==="disk")return{resolvedFrom:"disk",version:e.version};if(s==="registry"){const c=y(e,t.perPackageConfig??{}),r=await R(c).readPublishedVersion({pkg:e,pm:t.pm,workspaceConfig:t.workspaceConfig});return r&&h.valid(r)?{resolvedFrom:"registry",version:r}:{fallbackReason:r===void 0?`registry returned no version for ${e.name} (likely a 404 / not-yet-published); falling back to manifest version ${e.version}.`:`registry returned an invalid semver "${r}" for ${e.name}; falling back to manifest version ${e.version}.`,resolvedFrom:"disk",version:e.version}}const n=t.perPackageConfig?.releaseTagPattern??t.workspaceConfig?.releaseTagPattern??p,m=w(n,e),a=await t.runner.run("git",["tag","--list",m,"--sort=-v:refname"],{cwd:t.cwd,silent:!0});if(a.exitCode!==0)return{fallbackReason:`git tag --list ${m} failed (exit ${a.exitCode}); falling back to manifest version ${e.version}.`,resolvedFrom:"disk",version:e.version};const d=a.stdout.split(`
|
|
2
|
+
`).map(c=>c.trim()).filter(Boolean);if(d.length===0)return{fallbackReason:`no git tag matched pattern "${n}" for ${e.name}; falling back to manifest version ${e.version}. (Pass --first-release to bootstrap.)`,resolvedFrom:"disk",version:e.version};const f=$(n,e),i=[];for(const c of d){const u=f.exec(c);u?.[1]&&h.valid(u[1])&&i.push(u[1])}return i.length===0?{fallbackReason:`git tag pattern "${n}" matched tags but none yielded a valid semver for ${e.name}; falling back to manifest version ${e.version}.`,resolvedFrom:"disk",version:e.version}:(i.sort(h.rcompare),{resolvedFrom:"git-tag",version:i[0]})},A=(e,s,o)=>o?"disk":s?.currentVersionResolver??e?.currentVersionResolver??"disk",M=async(e,s,o,t,n)=>{const m=new Map,a=[],d=P(x),f=await Promise.all(e.map(async i=>d(async()=>{const c=t.get(i.name),u=A(o,c,n.firstRelease),r=n.skipRegistryLookup?"disk":u,l=`${i.name}@${r}@${i.version}`,b=g.get(l);if(b)return{mode:r,pkg:i,result:await b};const v=C(i,r,s,{...n,perPackageConfig:c,workspaceConfig:o});return g.set(l,v),v.catch(()=>{g.get(l)===v&&g.delete(l)}),{mode:r,pkg:i,result:await v}})));for(const{mode:i,pkg:c,result:u}of f)m.set(c.name,u.version),u.fallbackReason&&i!=="disk"&&a.push(`currentVersionResolver (${i}): ${u.fallbackReason}`);return{versions:m,warnings:a}},V=async e=>{const{cwd:s,packages:o,perPackageConfig:t,runner:n,workspaceConfig:m}=e,a=new Set,d=new Map;for(const r of o){const l=t?.get(r.name)?.releaseTagPattern??m?.releaseTagPattern??p;d.set(r.name,l),a.add(w(l,r))}const f=async r=>{const l=await n.run("git",["rev-list","--max-parents=0","HEAD"],{cwd:s,silent:!0}),v=(l.exitCode===0?l.stdout.split(`
|
|
3
|
+
`).map(k=>k.trim()).filter(Boolean):[]).at(-1);return v?{kind:"root-commit",reason:`${r}; the only remaining boundary is the repository root commit (${v.slice(0,7)}) — the whole history`,ref:v}:{kind:"unresolved",reason:`${r} and the repository root commit could not be resolved`}};if(a.size===0)return f("no workspace packages to derive a release tag pattern from");const i=await n.run("git",["describe","--tags","--abbrev=0",...[...a].flatMap(r=>["--match",r]),"HEAD"],{cwd:s,silent:!0}),c=i.exitCode===0?i.stdout.trim():"";return c?o.some(r=>{const l=$(d.get(r.name)??p,r).exec(c);return l?.[1]!==void 0&&h.valid(l[1])!==null})?{kind:"tag",reason:`resolved the last release boundary to tag "${c}"`,ref:c,tag:c}:f(`the nearest matching tag "${c}" did not parse as a release tag`):f("no git tag matching the configured releaseTagPattern is reachable from HEAD")};export{p as DEFAULT_RELEASE_TAG_PATTERN,x as REGISTRY_LOOKUP_CONCURRENCY,$ as compileReleaseTagRegex,w as releaseTagListGlob,C as resolveCurrentVersion,M as resolveCurrentVersionsForWorkspace,V as resolveLastReleaseRef,A as resolveModeForPackage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseConventionalHeader as b,isBreakingChange as w,hasBulletMarker as v,stripBulletMarker as I}from"./hasBulletMarker-BX2KwzI5.js";const i="other",N="⚠ BREAKING CHANGES",S="Other Changes",m=[{section:"Features",type:"feat"},{section:"Features",type:"feature"},{section:"Bug Fixes",type:"fix"},{section:"Performance Improvements",type:"perf"},{section:"Reverts",type:"revert"},{hidden:!0,section:"Documentation",type:"docs"},{hidden:!0,section:"Styles",type:"style"},{hidden:!0,section:"Code Refactoring",type:"refactor"},{hidden:!0,section:"Tests",type:"test"},{hidden:!0,section:"Build System",type:"build"},{hidden:!0,section:"Continuous Integration",type:"ci"},{hidden:!0,section:"Miscellaneous Chores",type:"chore"},{section:"Dependencies",type:"deps"},{hidden:!0,section:"Developer Experience",type:"dx"},{hidden:!0,section:"Types",type:"types"},{hidden:!0,section:"Work In Progress",type:"wip"},{hidden:!0,section:"Releases",type:"release"},{hidden:!0,section:"Workflow",type:"workflow"},{section:S,type:i}],A=(o,e)=>v(o)?o:`${e} ${o}`,B=(o,e,s,p)=>{const c=o.suffix??"";return p==="verbatim"?`${A(o.line,s)}${c}`:e?e.scope?`${s} **${e.scope}:** ${e.subject}${c}`:`${s} ${e.subject}${c}`:`${s} ${I(o.line)}${c}`},l=(o,e,s,p)=>{s.length!==0&&(o.push(`### ${e}`,""),o.push(...s),p&&o.push(""))},D=(o,e={})=>{const s=e.bullet??"*",p=e.entryStyle??"scope",c=e.types??m,g=e.breakingSection===void 0?N:e.breakingSection,$=e.uncategorizedSection??S,T=e.breakingType?.toLowerCase(),a=new Map,E=[];for(const n of c){const t=n.type.toLowerCase();a.has(t)||(a.set(t,n),E.push(n))}const h=new Map,k=[];for(const n of o){const t=b(n.line),r=t===void 0?i:T!==void 0&&t.breakingMarker?T:t.type,u=B(n,a.has(r)?t:void 0,s,p);g!==!1&&t!==void 0&&w(t)&&k.push(u);const d=h.get(r)??[];d.push(u),h.set(r,d)}const C=()=>{const n=[];for(const[t,r]of h)t!==i&&a.has(t)||n.push(...r);return n},y=[];g!==!1&&l(y,g,k,!0);const f=new Set;for(const n of E){const t=n.type.toLowerCase();if(n.hidden||f.has(t))continue;if(f.add(t),t===i){l(y,n.section,C(),!0);continue}const r=[];for(const u of E){const d=u.type.toLowerCase();u.hidden||d===i||u.section!==n.section||(f.add(d),r.push(...h.get(d)??[]))}l(y,n.section,r,!0)}return!f.has(i)&&a.get(i)?.hidden!==!0&&l(y,$,C(),!1),y};export{N as DEFAULT_BREAKING_SECTION,m as DEFAULT_CONVENTIONAL_TYPES,S as DEFAULT_UNCATEGORIZED_SECTION,i as UNCATEGORIZED_TYPE,D as renderGroupedEntries,A as withBullet};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../packem_chunks/shell-runner.js";import"./release-heading-DRpkhETz.js";import{D as m,c as i}from"./conventional-CGiOOEq1.js";import"./DEFAULT_BREAKING_SECTION-DUAcKVLD.js";export{m as DEFAULT_CONVENTIONAL_HEADING,i as createConventionalFormatter};
|
package/dist/packem_shared/{affected-selection-BdFnUyQZ.js → affected-selection-D3rosWKF.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as C}from"node:module";import{getAffectedProjects as S}from"@visulima/task-runner";import{i as W}from"./index-BjdW45xX.js";import{V as j}from"./vis-user-error-
|
|
1
|
+
import{createRequire as C}from"node:module";import{getAffectedProjects as S}from"@visulima/task-runner";import{i as W}from"./index-BjdW45xX.js";import{V as j}from"./vis-user-error-CEc_asoq.js";import{r as A}from"./affected-shas-Dd0P7fGD.js";let T;const $=e=>(T??=C(import.meta.url))(e),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=e=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[t,s]=f.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return f.getBuiltinModule(e)}return $(e)},{spawnSync:I}=R("node:child_process"),v=new Set(["deep","direct","none"]),B=e=>{const t=[],s=e.split("\0");for(let n=0;n<s.length;n++){const o=s[n];if(!o||o.length<4)continue;const p=o.slice(0,2),d=o.slice(3);if(d&&t.push(d),p.includes("R")||p.includes("C")){n+=1;const c=s[n];c&&t.push(c)}}return t},P=e=>{const t=I("git",["status","--porcelain","-z"],{cwd:e,encoding:"utf8"});return t.error||t.status!==0||typeof t.stdout!="string"?[]:B(t.stdout)},D=async(e,t,s={})=>{const n=e.downstream??"deep",o=e.upstream??"none";if(!v.has(n))throw new j(`Invalid --downstream value: "${n}". Must be "none", "direct", or "deep".`);if(!v.has(o))throw new j(`Invalid --upstream value: "${o}". Must be "none", "direct", or "deep".`);const{projectGraph:p,projects:d,workspaceRoot:c}=t,u=[];let{base:m}=e,{head:r}=e;if(!m||!r){const l=A({defaultBase:s.defaultBase,workspaceRoot:c});m=m||l.base,r=r||l.head,u.push(`Resolved affected refs from ${l.provider} (${l.notes.join("; ")})`)}const k=s.runningInCi??W,h=r==="HEAD"||r==="",b=e.uncommitted??(!k&&h);let a=[];if(b)if(h){const g=(s.readWorkingTreeChanges??P)(c),y=Object.values(d).map(i=>i.root?.replace(/\/$/,"")).filter(i=>!!i&&i!==".");a=g.filter(i=>y.some(_=>i===_||i.startsWith(`${_}/`)));const w=g.length-a.length;a.length>0&&u.push(`including ${a.length} uncommitted working-tree file(s)`),w>0&&u.push(`ignoring ${w} uncommitted path(s) outside any project (untracked scratch would otherwise mark every project affected)`)}else u.push(`ignoring --uncommitted: --head=${r} pins the comparison to a commit, not the working tree`);return{...await S({additionalChangedFiles:a,base:m,downstream:n,head:r,projectGraph:p,projects:d,upstream:o,workspaceRoot:c}),notes:u,uncommittedFileCount:a.length}};export{D as s};
|
|
@@ -24,4 +24,4 @@ interface ChangeFileMeta {
|
|
|
24
24
|
}
|
|
25
25
|
/** Helper for custom formatters that wrap the default behaviour. */
|
|
26
26
|
declare const defineFormatter: (formatter: ChangelogFormatter) => ChangelogFormatter;
|
|
27
|
-
export { ChangelogFormatter as C,
|
|
27
|
+
export { ChangelogFormatter as C, ChangelogContext as a, ChangelogFormatterModule as b, ChangelogTarget as c, ChangeFileMeta as d, defineFormatter as e };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as v}from"node:module";import{t as T}from"./compile-cache-DoMHRsRZ.js";import{l as w,i as R,a as j,b as M,c as m,g as S}from"./package-version-
|
|
1
|
+
import{createRequire as v}from"node:module";import{t as T}from"./compile-cache-DoMHRsRZ.js";import{l as w,i as R,a as j,b as M,c as m,g as S}from"./package-version-BhrkMRQ2.js";import{i as $}from"./index-BjdW45xX.js";let _;const x=s=>(_??=v(import.meta.url))(s),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=s=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[e,o]=t.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return t.getBuiltinModule(s)}return x(s)},{createRequire:y}=b("node:module");let N;const O=s=>(N??=y(import.meta.url))(s),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=s=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[e,o]=r.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return r.getBuiltinModule(s)}return O(s)},{execFileSync:C}=f("node:child_process"),{totalmem:I}=f("node:os"),q=/--max-old-space-size=(\d+)/,z=/--max-semi-space-size=(\d+)/,E=s=>Math.floor(I()/1024/1024*s),P=s=>s<=512?4:s<=1024?8:s<=2048?16:s<=4096?32:s<=8192?64:Math.floor(Math.log2(s))*8,d=(s,e)=>{for(const o of e){const n=s.exec(o);if(n)return Number.parseInt(n[1],10)}},B=s=>{const o=[...w()],n=[...R()],a=d(q,o),p=d(z,o);if(a!==void 0&&p!==void 0)return;const l=a??E(.75),g=p??P(l),c=[];if(a===void 0&&c.push(`--max-old-space-size=${String(l)}`),p===void 0&&c.push(`--max-semi-space-size=${String(g)}`),c.length!==0)try{C(j(),[...c,...o,...n.slice(1)],{env:M(),stdio:"inherit"}),m(0)}catch(h){const u=h.status;m(typeof u=="number"?u:1)}},V=()=>{process.env.VIS_VERSION=S()},H=s=>{!process.stdout.isTTY||$||process.env.TERM==="dumb"||process.stdout.write(`\x1B]0;${s}\x07`)},L=new Set(["","--help","--version","-h","-v","completion","dlx","exec","x"]),i=process.argv[2]??"";!L.has(i)&&!process.argv.includes("--help")&&!process.argv.includes("-h")&&B();process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");V();T();(async()=>{if(i==="__pm-shim"){const{dispatchShim:e}=await import("../packem_chunks/dispatch.js");e(process.argv[3]??"",process.argv.slice(4));return}if(i==="x"){const{runLeanX:e}=await import("../packem_chunks/lean.js");await e(process.argv.slice(3));return}if(i==="exec"||i==="dlx"){const{runExecCli:e}=await import("../packem_chunks/cli-exec.js");await e();return}const{runCli:s}=await import("../packem_chunks/cli-main.js").then(e=>e.ax);await s()})();export{H as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../packem_chunks/git.js";import{b as o,r as d}from"./release-heading-DRpkhETz.js";export{o as buildCompareUrl,d as renderReleaseHeading};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{createShellRunner as v}from"../packem_chunks/shell-runner.js";import{a as w,b as V,r as y}from"./release-heading-DRpkhETz.js";import{DEFAULT_CONVENTIONAL_TYPES as C,renderGroupedEntries as E}from"./DEFAULT_BREAKING_SECTION-DUAcKVLD.js";const U=async(e,t,r)=>{try{const{createRemoteClient:n,detectRemoteProvider:s}=await import("../packem_chunks/detect.js"),a=await s(r,t,void 0);return e?{provider:a,slug:e}:{provider:a,slug:await n(a).detectRepoSlug(r,t)}}catch{return{provider:"github",slug:e}}},$=(e,t)=>{const{slug:r}=t;if(!r)return e;const n=w(t.provider,r);return e.replaceAll(/(?<!\[)#(\d+)/g,(s,a)=>`[#${a}](${n.issue(a)})`)},A=e=>{const{changeFiles:t,release:r}=e;if(r.isCascadeBump||r.isGroupBump){const n=r.isCascadeBump?"cascade bump to":"group bump to";return r.sources.map(s=>({line:`deps(${s.name}): ${n} ${s.newVersion}`}))}return r.isDependencyBump&&t.length===0?r.sources.map(n=>({line:n.newVersion===""?`deps(${n.name}): removed`:`deps(${n.name}): upgraded to ${n.newVersion}`})):[]},P="## {name} [{version}]({compareUrl}) ({date})",D=(e={})=>{const t=e.runner??v(),r=e.heading??P,n=e.types??C;let s;return async u=>{const{changeFiles:g,date:f,release:o,target:h}=u;s??=U(e.repo,t,process.cwd());const i=await s,c=[];for(const m of g){const p=m.body.trim();if(p)for(const b of p.split(/\r?\n/)){const d=b.trim();d&&c.push({line:$(d,i)})}}c.push(...A(u));const l=[];if(h!=="github-release"){const m=V({compareUrlPrefix:e.compareUrlPrefix,name:o.name,newVersion:o.newVersion,oldVersion:o.oldVersion,provider:i.provider,repo:i.slug,tagPattern:e.tagPattern});l.push(y(r,{compareUrl:m,date:f,name:o.name,version:o.newVersion}),"")}return l.push(...E(c,{breakingSection:e.breakingSection,bullet:e.bullet,types:n})),l.join(`
|
|
2
|
+
`).replaceAll(/\n{3,}/g,`
|
|
3
|
+
|
|
4
|
+
`).trim()}};export{P as D,D as c,U as d,$ as l,A as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=/^[*+-]\s+/,c=new RegExp("^(?:[\\p{Emoji_Presentation}\\p{Extended_Pictographic}][\\uFE0E\\uFE0F]?\\p{Emoji_Modifier}?(?:\\u200D[\\p{Emoji_Presentation}\\p{Extended_Pictographic}][\\uFE0E\\uFE0F]?\\p{Emoji_Modifier}?)*|:\\w+:)\\s+","u"),a=/^([a-z][\w-]*)(?:\(([^()]*)\))?(!)?:[ \t](.*)$/i,p="BREAKING CHANGE",_="BREAKING-CHANGE",N=e=>n.test(e),u=e=>e.replace(n,"").trim(),d=e=>{const t=u(e).replace(c,""),i=a.exec(t);if(!i)return;const[,r,o,E,s]=i;return{breakingMarker:E==="!",breakingNote:t.includes(p)||t.includes(_),scope:o===void 0||o.trim()===""?void 0:o.trim(),subject:s.trim(),type:r.toLowerCase()}},R=e=>e.breakingMarker||e.breakingNote;export{N as hasBulletMarker,R as isBreakingChange,d as parseConventionalHeader,u as stripBulletMarker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./vis-user-error-
|
|
1
|
+
import{b as e}from"./vis-user-error-CEc_asoq.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,4 +1,4 @@
|
|
|
1
1
|
import{createRequire as ct}from"node:module";import{k as be,m as te,l as De,a as mt,h as gt,z as Lt,g as St}from"./index-DHD8wb6Z.js";import{a as ie,g as vt}from"./_commonjsHelpers-DTfxOvZk.js";import{r as Ct,a as Pt}from"./clean-DRiLimTx.js";import{p as bt}from"./readJsonSync-CbryXYxN-B2aSeDpC.js";let ht;const ut=h=>(ht??=ct(import.meta.url))(h),G=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=h=>{if(typeof G<"u"&&G.versions&&G.versions.node){const[e,t]=G.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return G.getBuiltinModule(h)}return ut(h)},{dirname:pt}=R("node:path"),Pe=R("node:url"),{fileURLToPath:ft}=Pe,ye=R("node:module"),{createRequire:dt}=ye,yt=R("util"),E=h=>"Deno"in h,Di=()=>{if(E(globalThis)){const h=globalThis.Deno,e=h.execPath();let t=e;try{const{importMeta:i}=globalThis;i?.url&&(t=i.url)}catch{}return[e,t,...h.args]}return process.argv},Ai=()=>E(globalThis)?globalThis.Deno.cwd():process.cwd(),wi=()=>{if(E(globalThis)){const h=globalThis.Deno;return new Proxy(h.env.toObject(),{get:(e,t)=>typeof t=="string"?h.env.get(t):e[t],has:(e,t)=>typeof t=="string"?h.env.has(t):t in e,set:(e,t,i)=>typeof t=="string"?(i===void 0||h.env.set(t,i),!0):!1})}return process.env},xi=()=>E(globalThis)?[]:process.execArgv,Ei=()=>E(globalThis)?globalThis.Deno.execPath():process.execPath,Oi=()=>{if(E(globalThis)){const h=globalThis.Deno.build?.os??"unknown";return h==="windows"?"win32":h}return process.platform},Ni=()=>{if(E(globalThis)){const h=globalThis.Deno.build?.arch??"unknown";return h==="x86_64"?"x64":h==="aarch64"?"arm64":h}return process.arch},Fi=(h=0)=>{if(E(globalThis))throw globalThis.Deno.exit(h),new Error("Deno exit failed");process.exit(h)},Gi=(h,e)=>{if(E(globalThis))return()=>{};const t=process;return t.on(h,e),()=>{t.removeListener(h,e)}};var U,ne;function Ae(){return ne||(ne=1,U=["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","ALGLIB-Documentation","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Advanced-Cryptics-Dictionary","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","Artistic-dist","Aspell-RU","BOLA-1.1","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-2-Clause-pkgconf-disclaimer","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-Tso","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Mark-Modifications","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","Buddy","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CAPEC-tou","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CryptoSwift","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-DTD","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","ESA-PL-permissive-2.4","ESA-PL-strong-copyleft-2.4","ESA-PL-weak-copyleft-2.4","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRSD","FSFULLRWD","FSL-1.1-ALv2","FSL-1.1-MIT","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Game-Programming-Gems","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HDF5","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-SMC","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HPND-sell-variant-critical-systems","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ISO-permission","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIPS","MIT","MIT-0","MIT-CMU","MIT-Click","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-STK","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MMPL-1.0.1","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-TNT","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTIA-PD","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSC-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OSSP","OpenMDW-1.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","ParaType-Free-Font-1.3","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGMLUG-PM","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMAIL-GPL","SMLNJ","SMPPL","SNIA","SOFA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SUL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TekHVC","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","UnRAR","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","Vixie-Cron","W3C","W3C-19980720","W3C-20150513","WTFNMFPL","WTFPL","Watcom-1.0","Widget-Workshop","WordNet","Wsuipa","X11","X11-distribute-modifications-variant","X11-no-permit-persons","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","any-OSI-perl-modules","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","generic-xts","gnuplot","gtkbook","hdparm","hyphen-bulgarian","iMatix","jove","libpng-1.6.35","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","man2html","metamail","mpi-permissive","mpich2","mplus","ngrep","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","wwl","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"]),U}var M,se;function Dt(){return se||(se=1,M=["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"]),M}var k,oe;function At(){return oe||(oe=1,k=["389-exception","Asterisk-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"]),k}var _,le;function wt(){if(le)return _;le=1;var h=[].concat(Ae()).concat(Dt()),e=At();return _=function(t){var i=0;function s(){return i<t.length}function n(L){if(L instanceof RegExp){var c=t.slice(i),g=c.match(L);if(g)return i+=g[0].length,g[0]}else if(t.indexOf(L,i)===i)return i+=L.length,L}function l(){n(/[ ]*/)}function a(){for(var L,c=["WITH","AND","OR","(",")",":","+"],g=0;g<c.length&&(L=n(c[g]),!L);g++);if(L==="+"&&i>1&&t[i-2]===" ")throw new Error("Space before `+`");return L&&{type:"OPERATOR",string:L}}function o(){return n(/[A-Za-z0-9-.]+/)}function u(){var L=o();if(!L)throw new Error("Expected idstring at offset "+i);return L}function f(){if(n("DocumentRef-")){var L=u();return{type:"DOCUMENTREF",string:L}}}function S(){if(n("LicenseRef-")){var L=u();return{type:"LICENSEREF",string:L}}}function b(){var L=i,c=o();if(h.indexOf(c)!==-1)return{type:"LICENSE",string:c};if(e.indexOf(c)!==-1)return{type:"EXCEPTION",string:c};i=L}function v(){return a()||f()||S()||b()}for(var C=[];s()&&(l(),!!s());){var m=v();if(!m)throw new Error("Unexpected `"+t[i]+"` at offset "+i);C.push(m)}return C},_}var W,ae;function xt(){return ae||(ae=1,W=function(h){var e=0;function t(){return e<h.length}function i(){return t()?h[e]:null}function s(){if(!t())throw new Error;e++}function n(m){var L=i();if(L&&L.type==="OPERATOR"&&m===L.string)return s(),L.string}function l(){if(n("WITH")){var m=i();if(m&&m.type==="EXCEPTION")return s(),m.string;throw new Error("Expected exception after `WITH`")}}function a(){var m=e,L="",c=i();if(c.type==="DOCUMENTREF"&&(s(),L+="DocumentRef-"+c.string+":",!n(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(c=i(),c.type==="LICENSEREF")return s(),L+="LicenseRef-"+c.string,{license:L};e=m}function o(){var m=i();if(m&&m.type==="LICENSE"){s();var L={license:m.string};n("+")&&(L.plus=!0);var c=l();return c&&(L.exception=c),L}}function u(){var m=n("(");if(m){var L=v();if(!n(")"))throw new Error("Expected `)`");return L}}function f(){return u()||a()||o()}function S(m,L){return function c(){var g=L();if(g){if(!n(m))return g;var y=c();if(!y)throw new Error("Expected expression");return{left:g,conjunction:m.toLowerCase(),right:y}}}}var b=S("AND",f),v=S("OR",b),C=v();if(!C||t())throw new Error("Syntax error");return C}),W}var H,ce;function we(){if(ce)return H;ce=1;var h=wt(),e=xt();return H=function(t){return e(h(t))},H}var j,he;function Et(){if(he)return j;he=1;var h=we(),e=Ae();function t(c){try{return h(c),!0}catch{return!1}}function i(c,g){var y=g[0].length-c[0].length;return y!==0?y:c[0].toUpperCase().localeCompare(g[0].toUpperCase())}var s=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(i),n=0,l=1,a=[function(c){return c.toUpperCase()},function(c){return c.trim()},function(c){return c.replace(/\./g,"")},function(c){return c.replace(/\s+/g,"")},function(c){return c.replace(/\s+/g,"-")},function(c){return c.replace("v","-")},function(c){return c.replace(/,?\s*(\d)/,"-$1")},function(c){return c.replace(/,?\s*(\d)/,"-$1.0")},function(c){return c.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(c){return c.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(c){return c[0].toUpperCase()+c.slice(1)},function(c){return c.replace("/","-")},function(c){return c.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(c){return c.indexOf("3.0")!==-1?c+"-or-later":c+"-only"},function(c){return c+"only"},function(c){return c.replace(/(\d)$/,"-$1.0")},function(c){return c.replace(/(-| )?(\d)$/,"-$2-Clause")},function(c){return c.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(c){return c.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(c){return c.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(c){return c.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(c){return c.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(c){return c.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(c){return"CC-"+c},function(c){return"CC-"+c+"-4.0"},function(c){return c.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(c){return"CC-"+c.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],o=e.map(function(c){var g=/^(.*)-\d+\.\d+$/.exec(c);return g?[g[0],g[1]]:[c,null]}).reduce(function(c,g){var y=g[1];return c[y]=c[y]||[],c[y].push(g[0]),c},{}),u=Object.keys(o).map(function(g){return[g,o[g]]}).filter(function(g){return g[1].length===1&&g[0]!==null&&g[0]!=="APL"}).map(function(g){return[g[0],g[1][0]]});o=void 0;var f=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(u).sort(i),S=0,b=1,v=function(c){for(var g=0;g<a.length;g++){var y=a[g](c).trim();if(y!==c&&t(y))return y}return null},C=function(c){for(var g=c.toUpperCase(),y=0;y<f.length;y++){var r=f[y];if(g.indexOf(r[S])>-1)return r[b]}return null},m=function(c,g){for(var y=0;y<s.length;y++){var r=s[y],p=r[n];if(c.indexOf(p)>-1){var d=c.replace(p,r[l]),P=g(d);if(P!==null)return P}}return null};j=function(c,g){g=g||{};var y=g.upgrade===void 0?!0:!!g.upgrade;function r(D){return y?L(D):D}var p=typeof c=="string"&&c.trim().length!==0;if(!p)throw Error("Invalid argument. Expected non-empty string.");if(c=c.trim(),t(c))return r(c);var d=c.replace(/\+$/,"").trim();if(t(d))return r(d);var P=v(c);return P!==null||(P=m(c,function(D){return t(D)?D:v(D)}),P!==null)||(P=C(c),P!==null)||(P=m(c,C),P!==null)?r(P):null};function L(c){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(c)!==-1?c+"-only":["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(c)!==-1?c.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(c)!==-1?c+"-or-later":c}return j}var z,ue;function Ot(){if(ue)return z;ue=1;var h=we(),e=Et(),t='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',i=/^SEE LICEN[CS]E IN (.+)$/;function s(l,a){return a.slice(0,l.length)===l}function n(l){if(l.hasOwnProperty("license")){var a=l.license;return s("LicenseRef",a)||s("DocumentRef",a)}else return n(l.left)||n(l.right)}return z=function(l){var a;try{a=h(l)}catch{var o;if(l==="UNLICENSED"||l==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(o=i.exec(l))return{validForOldPackages:!0,validForNewPackages:!0,inFile:o[1]};var u={validForOldPackages:!1,validForNewPackages:!1,warnings:[t]};if(l.trim().length!==0){var f=e(l);f&&u.warnings.push('license is similar to the valid expression "'+f+'"')}return u}return n(a)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[t]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}},z}var xe={hasSubscribers:!1},A=xe,F=xe;import("node:diagnostics_channel").then(h=>{A=h.channel("lru-cache:metrics"),F=h.tracingChannel("lru-cache")}).catch(()=>{});var Nt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Y=()=>A.hasSubscribers||F.hasSubscribers,Ee=new Set,pe=process||{},Ft=(h,e,t,i)=>{typeof pe.emitWarning=="function"?pe.emitWarning(h,e,t,i):console.error(`[${t}] ${e}: ${h}`)},Gt=h=>!Ee.has(h),N=h=>!!h&&h===Math.floor(h)&&h>0&&isFinite(h),Oe=h=>N(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?B:null:null,B=class extends Array{constructor(h){super(h),this.fill(0)}},$t=class T{heap;length;static#n=!1;static create(e){let t=Oe(e);if(!t)return[];T.#n=!0;let i=new T(e,t);return T.#n=!1,i}constructor(e,t){if(!T.#n)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Tt=class Ne{#n;#c;#t;#O;#L;#B;#R;#S;get perf(){return this.#S}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#o;#v;#s;#r;#e;#u;#f;#h;#l;#C;#a;#P;#y;#d;#m;#b;#I;#p;#N;static unsafeExposeInternals(e){return{starts:e.#y,ttls:e.#d,autopurgeTimers:e.#m,sizes:e.#P,keyMap:e.#s,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#f,get head(){return e.#h},get tail(){return e.#l},free:e.#C,isBackgroundFetch:t=>e.#i(t),backgroundFetch:(t,i,s,n)=>e.#k(t,i,s,n),moveToTail:t=>e.#T(t),indexes:t=>e.#D(t),rindexes:t=>e.#A(t),isStale:t=>e.#g(t)}}get max(){return this.#n}get maxSize(){return this.#c}get calculatedSize(){return this.#v}get size(){return this.#o}get fetchMethod(){return this.#B}get memoMethod(){return this.#R}get dispose(){return this.#t}get onInsert(){return this.#O}get disposeAfter(){return this.#L}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:l,updateAgeOnHas:a,allowStale:o,dispose:u,onInsert:f,disposeAfter:S,noDisposeOnSet:b,noUpdateTTL:v,maxSize:C=0,maxEntrySize:m=0,sizeCalculation:L,fetchMethod:c,memoMethod:g,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:r,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:d,ignoreFetchAbort:P,backgroundFetchSize:D=1,perf:w}=e;if(this.backgroundFetchSize=D,w!==void 0&&typeof w?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#S=w??Nt,t!==0&&!N(t))throw new TypeError("max option must be a nonnegative integer");let x=t?Oe(t):Array;if(!x)throw new Error("invalid max value: "+t);if(this.#n=t,this.#c=C,this.maxEntrySize=m||this.#c,this.sizeCalculation=L,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(g!==void 0&&typeof g!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#R=g,c!==void 0&&typeof c!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#B=c,this.#I=!!c,this.#s=new Map,this.#r=Array.from({length:t}).fill(void 0),this.#e=Array.from({length:t}).fill(void 0),this.#u=new x(t),this.#f=new x(t),this.#h=0,this.#l=0,this.#C=$t.create(t),this.#o=0,this.#v=0,typeof u=="function"&&(this.#t=u),typeof f=="function"&&(this.#O=f),typeof S=="function"?(this.#L=S,this.#a=[]):(this.#L=void 0,this.#a=void 0),this.#b=!!this.#t,this.#N=!!this.#O,this.#p=!!this.#L,this.noDisposeOnSet=!!b,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!d,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#c!==0&&!N(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!N(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!r,this.updateAgeOnGet=!!l,this.updateAgeOnHas=!!a,this.ttlResolution=N(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!N(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#_()}if(this.#n===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#n&&!this.#c){let I="LRU_CACHE_UNBOUNDED";Gt(I)&&(Ee.add(I),Ft("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",I,Ne))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#_(){let e=new B(this.#n),t=new B(this.#n);this.#d=e,this.#y=t;let i=this.ttlAutopurge?Array.from({length:this.#n}):void 0;this.#m=i,this.#W=(o,u,f=this.#S.now())=>{t[o]=u!==0?f:0,e[o]=u,s(o,u)},this.#F=o=>{t[o]=e[o]!==0?this.#S.now():0,s(o,e[o])};let s=this.ttlAutopurge?(o,u)=>{if(i?.[o]&&(clearTimeout(i[o]),i[o]=void 0),u&&u!==0&&i){let f=setTimeout(()=>{this.#g(o)?(this.#w(this.#r[o],"expire"),i[o]=void 0):s(o,a(o))},u+1);f.unref&&f.unref(),i[o]=f}}:()=>{};this.#x=(o,u)=>{if(e[u]){let f=e[u],S=t[u];if(!f||!S)return;o.ttl=f,o.start=S,o.now=n||l();let b=o.now-S;o.remainingTTL=f-b}};let n=0,l=()=>{let o=this.#S.now();if(this.ttlResolution>0){n=o;let u=setTimeout(()=>n=0,this.ttlResolution);u.unref&&u.unref()}return o};this.getRemainingTTL=o=>{let u=this.#s.get(o);return u===void 0?0:a(u)};let a=o=>{let u=e[o],f=t[o];if(!u||!f)return 1/0;let S=(n||l())-f;return u-S};this.#g=o=>{let u=t[o],f=e[o];return!!f&&!!u&&(n||l())-u>f}}#F=()=>{};#x=()=>{};#W=()=>{};#g=()=>!1;#V(){let e=new B(this.#n);this.#v=0,this.#P=e,this.#G=t=>{this.#v-=e[t],e[t]=0},this.#H=(t,i,s,n)=>{if(!N(s)){if(this.#i(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!N(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#U=(t,i,s)=>{if(e[t]=i,this.#c){let n=this.#c-e[t];for(;this.#v>n;)this.#M(!0)}this.#v+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#v)}}#G=e=>{};#U=(e,t,i)=>{};#H=(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#D({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#l;this.#j(t)&&((e||!this.#g(t))&&(yield t),t!==this.#h);)t=this.#f[t]}*#A({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#h;this.#j(t)&&((e||!this.#g(t))&&(yield t),t!==this.#l);)t=this.#u[t]}#j(e){return e!==void 0&&this.#s.get(this.#r[e])===e}*entries(){for(let e of this.#D())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#i(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*rentries(){for(let e of this.#A())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#i(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*keys(){for(let e of this.#D()){let t=this.#r[e];t!==void 0&&!this.#i(this.#e[e])&&(yield t)}}*rkeys(){for(let e of this.#A()){let t=this.#r[e];t!==void 0&&!this.#i(this.#e[e])&&(yield t)}}*values(){for(let e of this.#D())this.#e[e]!==void 0&&!this.#i(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#A())this.#e[e]!==void 0&&!this.#i(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#D()){let s=this.#e[i],n=this.#i(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#r[i],this))return this.#$(this.#r[i],t)}}forEach(e,t=this){for(let i of this.#D()){let s=this.#e[i],n=this.#i(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#r[i],this)}}rforEach(e,t=this){for(let i of this.#A()){let s=this.#e[i],n=this.#i(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#r[i],this)}}purgeStale(){let e=!1;for(let t of this.#A({allowStale:!0}))this.#g(t)&&(this.#w(this.#r[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let i=this.#e[t],s=this.#i(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#y){let l=this.#d[t],a=this.#y[t];if(l&&a){let o=l-(this.#S.now()-a);n.ttl=o,n.start=Date.now()}}return this.#P&&(n.size=this.#P[t]),n}dump(){let e=[];for(let t of this.#D({allowStale:!0})){let i=this.#r[t],s=this.#e[t],n=this.#i(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let l={value:n};if(this.#d&&this.#y){l.ttl=this.#d[t];let a=this.#S.now()-this.#y[t];l.start=Math.floor(Date.now()-a)}this.#P&&(l.size=this.#P[t]),e.unshift([i,l])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=this.#S.now()-s}this.#E(t,i.value,i)}}set(e,t,i={}){let{status:s=A.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=e,t!==void 0&&(s.value=t),s.cache=this);let n=this.#E(e,t,i);return s&&A.hasSubscribers&&A.publish(s),n}#E(e,t,i,s){let{ttl:n=this.ttl,start:l,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:u}=i,f=this.#i(t);if(t===void 0)return u&&(u.set="deleted"),this.delete(e),this;let{noUpdateTTL:S=this.noUpdateTTL}=i;u&&!f&&(u.value=t);let b=this.#H(e,t,i.size||0,o,u);if(this.maxEntrySize&&b>this.maxEntrySize)return this.#w(e,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let v=this.#o===0?void 0:this.#s.get(e);if(v===void 0)v=this.#o===0?this.#l:this.#C.length!==0?this.#C.pop():this.#o===this.#n?this.#M(!1):this.#o,this.#r[v]=e,this.#e[v]=t,this.#s.set(e,v),this.#u[this.#l]=v,this.#f[v]=this.#l,this.#l=v,this.#o++,this.#U(v,b,u),u&&(u.set="add"),S=!1,this.#N&&!f&&this.#O?.(t,e,"add");else{this.#T(v);let C=this.#e[v];if(t!==C){if(!a)if(this.#i(C)){C!==s&&C.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=C;m!==void 0&&m!==t&&(this.#b&&this.#t?.(m,e,"set"),this.#p&&this.#a?.push([m,e,"set"]))}else this.#b&&this.#t?.(C,e,"set"),this.#p&&this.#a?.push([C,e,"set"]);if(this.#G(v),this.#U(v,b,u),this.#e[v]=t,!f){let m=C&&this.#i(C)?C.__staleWhileFetching:C,L=m===void 0?"add":t!==m?"replace":"update";u&&(u.set=L,m!==void 0&&(u.oldValue=m)),this.#N&&this.onInsert?.(t,e,L)}}else f||(u&&(u.set="update"),this.#N&&this.onInsert?.(t,e,"update"))}if(n!==0&&!this.#d&&this.#_(),this.#d&&(S||this.#W(v,n,l),u&&this.#x(u,v)),!a&&this.#p&&this.#a){let C=this.#a,m;for(;m=C?.shift();)this.#L?.(...m)}return this}pop(){try{for(;this.#o;){let e=this.#e[this.#h];if(this.#M(!0),this.#i(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#a){let e=this.#a,t;for(;t=e?.shift();)this.#L?.(...t)}}}#M(e){let t=this.#h,i=this.#r[t],s=this.#e[t],n=this.#i(s);n&&s.__abortController.abort(new Error("evicted"));let l=n?s.__staleWhileFetching:s;return(this.#b||this.#p)&&l!==void 0&&(this.#b&&this.#t?.(l,i,"evict"),this.#p&&this.#a?.push([l,i,"evict"])),this.#G(t),this.#m?.[t]&&(clearTimeout(this.#m[t]),this.#m[t]=void 0),e&&(this.#r[t]=void 0,this.#e[t]=void 0,this.#C.push(t)),this.#o===1?(this.#h=this.#l=0,this.#C.length=0):this.#h=this.#u[t],this.#s.delete(i),this.#o--,t}has(e,t={}){let{status:i=A.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let s=this.#K(e,t);return A.hasSubscribers&&A.publish(i),s}#K(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=this.#s.get(e);if(n!==void 0){let l=this.#e[n];if(this.#i(l)&&l.__staleWhileFetching===void 0)return!1;if(this.#g(n))s&&(s.has="stale",this.#x(s,n));else return i&&this.#F(n),s&&(s.has="hit",this.#x(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{status:i=Y()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let s=this.#X(e,t);return A.hasSubscribers&&A.publish(i),s}#X(e,t){let{status:i,allowStale:s=this.allowStale}=t,n=this.#s.get(e);if(n===void 0||!s&&this.#g(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let l=this.#e[n],a=this.#i(l)?l.__staleWhileFetching:l;return i&&(a!==void 0?(i.peek="hit",i.value=a):i.peek="miss"),a}#k(e,t,i,s){let n=t===void 0?void 0:this.#e[t];if(this.#i(n))return n;let l=new AbortController,{signal:a}=i;a?.addEventListener("abort",()=>l.abort(a.reason),{signal:l.signal});let o={signal:l.signal,options:i,context:s},u=(m,L=!1)=>{let{aborted:c}=l.signal,g=i.ignoreFetchAbort&&m!==void 0,y=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&m!==void 0);if(i.status&&(c&&!L?(i.status.fetchAborted=!0,i.status.fetchError=l.signal.reason,g&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),c&&!g&&!L)return S(l.signal.reason,y);let r=v,p=this.#e[t];return(p===v||p===void 0&&g&&L)&&(m===void 0?r.__staleWhileFetching!==void 0?this.#e[t]=r.__staleWhileFetching:this.#w(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#E(e,m,o.options,r))),m},f=m=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=m),S(m,!1)),S=(m,L)=>{let{aborted:c}=l.signal,g=c&&i.allowStaleOnFetchAbort,y=g||i.allowStaleOnFetchRejection,r=y||i.noDeleteOnFetchRejection,p=v;if(this.#e[t]===v&&(!r||!L&&p.__staleWhileFetching===void 0?this.#w(e,"fetch"):g||(this.#e[t]=p.__staleWhileFetching)),y)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw m},b=(m,L)=>{let c=this.#B?.(e,n,o);l.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=g=>u(g,!0)))}),c&&c instanceof Promise?c.then(g=>m(g===void 0?void 0:g),L):c!==void 0&&m(c)};i.status&&(i.status.fetchDispatched=!0);let v=new Promise(b).then(u,f),C=Object.assign(v,{__abortController:l,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.#E(e,C,{...o.options,status:void 0}),t=this.#s.get(e)):this.#e[t]=C,C}#i(e){if(!this.#I)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let i=F.hasSubscribers,{status:s=Y()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#z(e,t);return s&&i&&(s.trace=!0,F.tracePromise(()=>n,s).catch(()=>{})),n}async#z(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:l=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:o=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:C=this.allowStaleOnFetchAbort,context:m,forceRefresh:L=!1,status:c,signal:g}=t;if(c&&(c.op="fetch",c.key=e,L&&(c.forceRefresh=!0),c.cache=this),!this.#I)return c&&(c.fetch="get"),this.#$(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:c});let y={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:l,noDisposeOnSet:a,size:o,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:C,ignoreFetchAbort:v,status:c,signal:g},r=this.#s.get(e);if(r===void 0){c&&(c.fetch="miss");let p=this.#k(e,r,y,m);return p.__returned=p}else{let p=this.#e[r];if(this.#i(p)){let w=i&&p.__staleWhileFetching!==void 0;return c&&(c.fetch="inflight",w&&(c.returnedStale=!0)),w?p.__staleWhileFetching:p.__returned=p}let d=this.#g(r);if(!L&&!d)return c&&(c.fetch="hit"),this.#T(r),s&&this.#F(r),c&&this.#x(c,r),p;let P=this.#k(e,r,y,m),D=P.__staleWhileFetching!==void 0&&i;return c&&(c.fetch=d?"stale":"refresh",D&&d&&(c.returnedStale=!0)),D?P.__staleWhileFetching:P.__returned=P}}forceFetch(e,t={}){let i=F.hasSubscribers,{status:s=Y()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#J(e,t);return s&&i&&(s.trace=!0,F.tracePromise(()=>n,s).catch(()=>{})),n}async#J(e,t={}){let i=await this.#z(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=A.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let s=this.#Z(e,t);return i&&(i.value=s),A.hasSubscribers&&A.publish(i),s}#Z(e,t={}){let i=this.#R;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:l,...a}=t;n&&l&&(n.forceRefresh=!0);let o=this.#$(e,a),u=l||o===void 0;if(n&&(n.memo=u?"miss":"hit",u||(n.value=o)),!u)return o;let f=i(e,o,{options:a,context:s});return n&&(n.value=f),this.#E(e,f,a),f}get(e,t={}){let{status:i=A.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let s=this.#$(e,t);return i&&(s!==void 0&&(i.value=s),A.hasSubscribers&&A.publish(i)),s}#$(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:l}=t,a=this.#s.get(e);if(a===void 0){l&&(l.get="miss");return}let o=this.#e[a],u=this.#i(o);return l&&this.#x(l,a),this.#g(a)?u?(l&&(l.get="stale-fetching"),i&&o.__staleWhileFetching!==void 0?(l&&(l.returnedStale=!0),o.__staleWhileFetching):void 0):(n||this.#w(e,"expire"),l&&(l.get="stale"),i?(l&&(l.returnedStale=!0),o):void 0):(l&&(l.get=u?"fetching":"hit"),this.#T(a),s&&this.#F(a),u?o.__staleWhileFetching:o)}#Y(e,t){this.#f[t]=e,this.#u[e]=t}#T(e){e!==this.#l&&(e===this.#h?this.#h=this.#u[e]:this.#Y(this.#f[e],this.#u[e]),this.#Y(this.#l,e),this.#l=e)}delete(e){return this.#w(e,"delete")}#w(e,t){A.hasSubscribers&&A.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(this.#o!==0){let s=this.#s.get(e);if(s!==void 0)if(this.#m?.[s]&&(clearTimeout(this.#m[s]),this.#m[s]=void 0),i=!0,this.#o===1)this.#q(t);else{this.#G(s);let n=this.#e[s];if(this.#i(n)?n.__abortController.abort(new Error("deleted")):(this.#b||this.#p)&&(this.#b&&this.#t?.(n,e,t),this.#p&&this.#a?.push([n,e,t])),this.#s.delete(e),this.#r[s]=void 0,this.#e[s]=void 0,s===this.#l)this.#l=this.#f[s];else if(s===this.#h)this.#h=this.#u[s];else{let l=this.#f[s];this.#u[l]=this.#u[s];let a=this.#u[s];this.#f[a]=this.#f[s]}this.#o--,this.#C.push(s)}}if(this.#p&&this.#a?.length){let s=this.#a,n;for(;n=s?.shift();)this.#L?.(...n)}return i}clear(){return this.#q("delete")}#q(e){for(let t of this.#A({allowStale:!0})){let i=this.#e[t];if(this.#i(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#r[t];this.#b&&this.#t?.(i,s,e),this.#p&&this.#a?.push([i,s,e])}}if(this.#s.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#d&&this.#y){this.#d.fill(0),this.#y.fill(0);for(let t of this.#m??[])t!==void 0&&clearTimeout(t);this.#m?.fill(void 0)}if(this.#P&&this.#P.fill(0),this.#h=0,this.#l=0,this.#C.length=0,this.#v=0,this.#o=0,this.#p&&this.#a){let t=this.#a,i;for(;i=t?.shift();)this.#L?.(...i)}}};const Bt=Object.defineProperty({__proto__:null,LRUCache:Tt},Symbol.toStringTag,{value:"Module"}),Rt=ie(Bt);var q,fe;function It(){if(fe)return q;fe=1;const h=(...n)=>n.every(l=>l)?n.join(""):"",e=n=>n?encodeURIComponent(n):"",t=n=>n.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),i={sshtemplate:({domain:n,user:l,project:a,committish:o})=>`git@${n}:${l}/${a}.git${h("#",o)}`,sshurltemplate:({domain:n,user:l,project:a,committish:o})=>`git+ssh://git@${n}/${l}/${a}.git${h("#",o)}`,edittemplate:({domain:n,user:l,project:a,committish:o,editpath:u,path:f})=>`https://${n}/${l}/${a}${h("/",u,"/",e(o||"HEAD"),"/",f)}`,browsetemplate:({domain:n,user:l,project:a,committish:o,treepath:u})=>`https://${n}/${l}/${a}${h("/",u,"/",e(o))}`,browsetreetemplate:({domain:n,user:l,project:a,committish:o,treepath:u,path:f,fragment:S,hashformat:b})=>`https://${n}/${l}/${a}/${u}/${e(o||"HEAD")}/${f}${h("#",b(S||""))}`,browseblobtemplate:({domain:n,user:l,project:a,committish:o,blobpath:u,path:f,fragment:S,hashformat:b})=>`https://${n}/${l}/${a}/${u}/${e(o||"HEAD")}/${f}${h("#",b(S||""))}`,docstemplate:({domain:n,user:l,project:a,treepath:o,committish:u})=>`https://${n}/${l}/${a}${h("/",o,"/",e(u))}#readme`,httpstemplate:({auth:n,domain:l,user:a,project:o,committish:u})=>`git+https://${h(n,"@")}${l}/${a}/${o}.git${h("#",u)}`,filetemplate:({domain:n,user:l,project:a,committish:o,path:u})=>`https://${n}/${l}/${a}/raw/${e(o||"HEAD")}/${u}`,shortcuttemplate:({type:n,user:l,project:a,committish:o})=>`${n}:${l}/${a}${h("#",o)}`,pathtemplate:({user:n,project:l,committish:a})=>`${n}/${l}${h("#",a)}`,bugstemplate:({domain:n,user:l,project:a})=>`https://${n}/${l}/${a}/issues`,hashformat:t},s={};s.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:n,user:l,project:a,committish:o,path:u})=>`https://${h(n,"@")}raw.githubusercontent.com/${l}/${a}/${e(o||"HEAD")}/${u}`,gittemplate:({auth:n,domain:l,user:a,project:o,committish:u})=>`git://${h(n,"@")}${l}/${a}/${o}.git${h("#",u)}`,tarballtemplate:({domain:n,user:l,project:a,committish:o})=>`https://codeload.${n}/${l}/${a}/tar.gz/${e(o||"HEAD")}`,extract:n=>{let[,l,a,o,u]=n.pathname.split("/",5);if(!(o&&o!=="tree")&&(o||(u=n.hash.slice(1)),a&&a.endsWith(".git")&&(a=a.slice(0,-4)),!(!l||!a)))return{user:l,project:a,committish:u}}},s.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:n,user:l,project:a,committish:o,treepath:u,path:f,editpath:S})=>`https://${n}/${l}/${a}${h("/",u,"/",e(o||"HEAD"),"/",f,S)}`,tarballtemplate:({domain:n,user:l,project:a,committish:o})=>`https://${n}/${l}/${a}/get/${e(o||"HEAD")}.tar.gz`,extract:n=>{let[,l,a,o]=n.pathname.split("/",4);if(!["get"].includes(o)&&(a&&a.endsWith(".git")&&(a=a.slice(0,-4)),!(!l||!a)))return{user:l,project:a,committish:n.hash.slice(1)}}},s.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",tarballtemplate:({domain:n,user:l,project:a,committish:o})=>`https://${n}/api/v4/projects/${e(l+"/"+a)}/repository/archive.tar.gz?sha=${e(o||"HEAD")}`,extract:n=>{const l=n.pathname.slice(1);if(l.includes("/-/")||l.includes("/archive.tar.gz"))return;const a=l.split("/");let o=a.pop();o.endsWith(".git")&&(o=o.slice(0,-4));const u=a.join("/");if(!(!u||!o))return{user:u,project:o,committish:n.hash.slice(1)}}},s.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:n,project:l,committish:a})=>`git@${n}:${l}.git${h("#",a)}`,sshurltemplate:({domain:n,project:l,committish:a})=>`git+ssh://git@${n}/${l}.git${h("#",a)}`,edittemplate:({domain:n,user:l,project:a,committish:o,editpath:u})=>`https://${n}/${l}/${a}${h("/",e(o))}/${u}`,browsetemplate:({domain:n,project:l,committish:a})=>`https://${n}/${l}${h("/",e(a))}`,browsetreetemplate:({domain:n,project:l,committish:a,path:o,hashformat:u})=>`https://${n}/${l}${h("/",e(a))}${h("#",u(o))}`,browseblobtemplate:({domain:n,project:l,committish:a,path:o,hashformat:u})=>`https://${n}/${l}${h("/",e(a))}${h("#",u(o))}`,docstemplate:({domain:n,project:l,committish:a})=>`https://${n}/${l}${h("/",e(a))}`,httpstemplate:({domain:n,project:l,committish:a})=>`git+https://${n}/${l}.git${h("#",a)}`,filetemplate:({user:n,project:l,committish:a,path:o})=>`https://gist.githubusercontent.com/${n}/${l}/raw${h("/",e(a))}/${o}`,shortcuttemplate:({type:n,project:l,committish:a})=>`${n}:${l}${h("#",a)}`,pathtemplate:({project:n,committish:l})=>`${n}${h("#",l)}`,bugstemplate:({domain:n,project:l})=>`https://${n}/${l}`,gittemplate:({domain:n,project:l,committish:a})=>`git://${n}/${l}.git${h("#",a)}`,tarballtemplate:({project:n,committish:l})=>`https://codeload.github.com/gist/${n}/tar.gz/${e(l||"HEAD")}`,extract:n=>{let[,l,a,o]=n.pathname.split("/",4);if(o!=="raw"){if(!a){if(!l)return;a=l,l=null}return a.endsWith(".git")&&(a=a.slice(0,-4)),{user:l,project:a,committish:n.hash.slice(1)}}},hashformat:function(n){return n&&"file-"+t(n)}},s.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:n,user:l,project:a,committish:o,path:u})=>`https://${n}/${l}/${a}/blob/${e(o)||"HEAD"}/${u}`,httpstemplate:({domain:n,user:l,project:a,committish:o})=>`https://${n}/${l}/${a}${h("#",o)}`,tarballtemplate:({domain:n,user:l,project:a,committish:o})=>`https://${n}/${l}/${a}/archive/${e(o)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:n=>{let[,l,a,o]=n.pathname.split("/",4);if(!["archive"].includes(o)&&(a&&a.endsWith(".git")&&(a=a.slice(0,-4)),!(!l||!a)))return{user:l,project:a,committish:n.hash.slice(1)}}};for(const[n,l]of Object.entries(s))s[n]=Object.assign({},i,l);return q=s,q}var V,de;function Fe(){if(de)return V;de=1;const h=(s,n,l)=>{const a=s.indexOf(l);return s.lastIndexOf(n,a>-1?a:1/0)},e=s=>{try{return new URL(s)}catch{}},t=(s,n)=>{const l=s.indexOf(":"),a=s.slice(0,l+1);if(Object.prototype.hasOwnProperty.call(n,a)||s.substr(l,3)==="://")return s;const o=s.indexOf("@");return o>-1?o>l?`git+ssh://${s}`:s:`${s.slice(0,l+1)}//${s.slice(l+1)}`},i=s=>{const n=h(s,"@","#"),l=h(s,":","#");return l>n&&(s=s.slice(0,l)+"/"+s.slice(l+1)),h(s,":","#")===-1&&s.indexOf("//")===-1&&(s=`git+ssh://${s}`),s};return V=(s,n)=>{const l=n?t(s,n):s;return e(l)||e(i(l))},V}var K,me;function Ut(){if(me)return K;me=1;const h=Fe(),e=t=>{const i=t.indexOf("#"),s=t.indexOf("/"),n=t.indexOf("/",s+1),l=t.indexOf(":"),a=/\s/.exec(t),o=t.indexOf("@"),u=!a||i>-1&&a.index>i,f=o===-1||i>-1&&o>i,S=l===-1||i>-1&&l>i,b=n===-1||i>-1&&n>i,v=s>0,C=i>-1?t[i-1]!=="/":!t.endsWith("/"),m=!t.startsWith(".");return u&&v&&C&&m&&f&&S&&b};return K=(t,i,{gitHosts:s,protocols:n})=>{if(!t)return;const l=e(t)?`github:${t}`:t,a=h(l,n);if(!a)return;const o=s.byShortcut[a.protocol],u=s.byDomain[a.hostname.startsWith("www.")?a.hostname.slice(4):a.hostname],f=o||u;if(!f)return;const S=s[o||u];let b=null;n[a.protocol]?.auth&&(a.username||a.password)&&(b=`${a.username}${a.password?":"+a.password:""}`);let v=null,C=null,m=null,L=null;try{if(o){let c=a.pathname.startsWith("/")?a.pathname.slice(1):a.pathname;const g=c.indexOf("@");g>-1&&(c=c.slice(g+1));const y=c.lastIndexOf("/");y>-1?(C=decodeURIComponent(c.slice(0,y)),C||(C=null),m=decodeURIComponent(c.slice(y+1))):m=decodeURIComponent(c),m.endsWith(".git")&&(m=m.slice(0,-4)),a.hash&&(v=decodeURIComponent(a.hash.slice(1))),L="shortcut"}else{if(!S.protocols.includes(a.protocol))return;const c=S.extract(a);if(!c)return;C=c.user&&decodeURIComponent(c.user),m=decodeURIComponent(c.project),v=decodeURIComponent(c.committish),L=n[a.protocol]?.name||a.protocol.slice(0,-1)}}catch(c){if(c instanceof URIError)return;throw c}return[f,C,b,m,v,L,i]},K}var X,ge;function Mt(){if(ge)return X;ge=1;const{LRUCache:h}=Rt,e=It(),t=Ut(),i=Fe(),s=new h({max:1e3});function n(a){try{const{protocol:o,hostname:u,pathname:f}=new URL(a);if(!u)return null;const S=/(?:git\+)http:$/.test(o)?"http:":"https:",b=f.replace(/\.git$/,"");return`${S}//${u}${b}`}catch{return null}}class l{constructor(o,u,f,S,b,v,C={}){Object.assign(this,l.#n[o],{type:o,user:u,auth:f,project:S,committish:b,default:v,opts:C})}static#n={byShortcut:{},byDomain:{}};static#c={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(o,u){l.#n[o]=u,l.#n.byDomain[u.domain]=o,l.#n.byShortcut[`${o}:`]=o,l.#c[`${o}:`]={name:o}}static fromUrl(o,u){if(typeof o!="string")return;const f=o+JSON.stringify(u||{});if(!s.has(f)){const S=t(o,u,{gitHosts:l.#n,protocols:l.#c});s.set(f,S?new l(...S):void 0)}return s.get(f)}static fromManifest(o,u={}){if(!o||typeof o!="object")return;const f=o.repository,S=f&&(typeof f=="string"?f:typeof f=="object"&&typeof f.url=="string"?f.url:null);if(!S)throw new Error("no repository");const b=S&&l.fromUrl(S.replace(/^git\+/,""),u)||null;if(b)return b;const v=n(S);return l.fromUrl(v,u)||v}static parseUrl(o){return i(o)}#t(o,u){if(typeof o!="function")return null;const f={...this,...this.opts,...u};f.path||(f.path=""),f.path.startsWith("/")&&(f.path=f.path.slice(1)),f.noCommittish&&(f.committish=null);const S=o(f);return f.noGitPlus&&S.startsWith("git+")?S.slice(4):S}hash(){return this.committish?`#${this.committish}`:""}ssh(o){return this.#t(this.sshtemplate,o)}sshurl(o){return this.#t(this.sshurltemplate,o)}browse(o,...u){return typeof o!="string"?this.#t(this.browsetemplate,o):typeof u[0]!="string"?this.#t(this.browsetreetemplate,{...u[0],path:o}):this.#t(this.browsetreetemplate,{...u[1],fragment:u[0],path:o})}browseFile(o,...u){return typeof u[0]!="string"?this.#t(this.browseblobtemplate,{...u[0],path:o}):this.#t(this.browseblobtemplate,{...u[1],fragment:u[0],path:o})}docs(o){return this.#t(this.docstemplate,o)}bugs(o){return this.#t(this.bugstemplate,o)}https(o){return this.#t(this.httpstemplate,o)}git(o){return this.#t(this.gittemplate,o)}shortcut(o){return this.#t(this.shortcuttemplate,o)}path(o){return this.#t(this.pathtemplate,o)}tarball(o){return this.#t(this.tarballtemplate,{...o,noCommittish:!1})}file(o,u){return this.#t(this.filetemplate,{...u,path:o})}edit(o,u){return this.#t(this.edittemplate,{...u,path:o})}getDefaultRepresentation(){return this.default}toString(o){return this.default&&typeof this[this.default]=="function"?this[this.default](o):this.sshurl(o)}}for(const[a,o]of Object.entries(e))l.addHost(a,o);return X=l,X}var J,Le;function kt(){if(Le)return J;Le=1,J=h;function h(e){if(!e||e==="ERROR: No README data found!")return;e=e.trim().split(`
|
|
2
2
|
`);let t=0;for(;e[t]&&e[t].trim().match(/^(#|$)/);)t++;const i=e.length;let s=t+1;for(;s<i&&e[s].trim();)s++;return e.slice(t,s).join(" ").trim()}return J}var Ge={dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},$e={web:"url",name:"url"},Te={server:"start",tests:"test"};const _t={topLevel:Ge,bugs:$e,script:Te},Wt=Object.defineProperty({__proto__:null,bugs:$e,default:_t,script:Te,topLevel:Ge},Symbol.toStringTag,{value:"Module"}),Ht=ie(Wt);var Z,Se;function jt(){if(Se)return Z;Se=1;var{URL:h}=Pe,e=Ct(),t=Pt(),i=Ot(),s=Mt(),{isBuiltin:n}=ye,l=["dependencies","devDependencies","optionalDependencies"],a=kt(),o=Ht,u=r=>r.includes("@")&&r.indexOf("@")<r.lastIndexOf(".");Z={warn:function(){},fixRepositoryField:function(r){if(r.repositories&&(this.warn("repositories"),r.repository=r.repositories[0]),!r.repository)return this.warn("missingRepository");typeof r.repository=="string"&&(r.repository={type:"git",url:r.repository});var p=r.repository.url||"";if(p){var d=s.fromUrl(p);d&&(p=r.repository.url=d.getDefaultRepresentation()==="shortcut"?d.https():d.toString())}p.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",p)},fixTypos:function(r){Object.keys(o.topLevel).forEach(function(p){Object.prototype.hasOwnProperty.call(r,p)&&this.warn("typo",p,o.topLevel[p])},this)},fixScriptsField:function(r){if(r.scripts){if(typeof r.scripts!="object"){this.warn("nonObjectScripts"),delete r.scripts;return}Object.keys(r.scripts).forEach(function(p){typeof r.scripts[p]!="string"?(this.warn("nonStringScript"),delete r.scripts[p]):o.script[p]&&!r.scripts[o.script[p]]&&this.warn("typo",p,o.script[p],"scripts")},this)}},fixFilesField:function(r){var p=r.files;p&&!Array.isArray(p)?(this.warn("nonArrayFiles"),delete r.files):r.files&&(r.files=r.files.filter(function(d){return!d||typeof d!="string"?(this.warn("invalidFilename",d),!1):!0},this))},fixBinField:function(r){if(r.bin&&typeof r.bin=="string"){var p={},d;(d=r.name.match(/^@[^/]+[/](.*)$/))?p[d[1]]=r.bin:p[r.name]=r.bin,r.bin=p}},fixManField:function(r){r.man&&typeof r.man=="string"&&(r.man=[r.man])},fixBundleDependenciesField:function(r){var p="bundledDependencies",d="bundleDependencies";r[p]&&!r[d]&&(r[d]=r[p],delete r[p]),r[d]&&!Array.isArray(r[d])?(this.warn("nonArrayBundleDependencies"),delete r[d]):r[d]&&(r[d]=r[d].filter(function(P){return!P||typeof P!="string"?(this.warn("nonStringBundleDependency",P),!1):(r.dependencies||(r.dependencies={}),Object.prototype.hasOwnProperty.call(r.dependencies,P)||(this.warn("nonDependencyBundleDependency",P),r.dependencies[P]="*"),!0)},this))},fixDependencies:function(r){g(r,this.warn),L(r,this.warn),this.fixBundleDependenciesField(r),["dependencies","devDependencies"].forEach(function(p){if(p in r){if(!r[p]||typeof r[p]!="object"){this.warn("nonObjectDependencies",p),delete r[p];return}Object.keys(r[p]).forEach(function(d){var P=r[p][d];typeof P!="string"&&(this.warn("nonStringDependency",d,JSON.stringify(P)),delete r[p][d]);var D=s.fromUrl(r[p][d]);D&&(r[p][d]=D.toString())},this)}},this)},fixModulesField:function(r){r.modules&&(this.warn("deprecatedModules"),delete r.modules)},fixKeywordsField:function(r){typeof r.keywords=="string"&&(r.keywords=r.keywords.split(/,\s+/)),r.keywords&&!Array.isArray(r.keywords)?(delete r.keywords,this.warn("nonArrayKeywords")):r.keywords&&(r.keywords=r.keywords.filter(function(p){return typeof p!="string"||!p?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(r,p){var d=!p;if(!r.version)return r.version="",!0;if(!e(r.version,d))throw new Error('Invalid version: "'+r.version+'"');return r.version=t(r.version,d),!0},fixPeople:function(r){v(r,C),v(r,m)},fixNameField:function(r,p){typeof p=="boolean"?p={strict:p}:typeof p>"u"&&(p={});var d=p.strict;if(!r.name&&!d){r.name="";return}if(typeof r.name!="string")throw new Error("name field must be a string.");d||(r.name=r.name.trim()),b(r.name,d,p.allowLegacyCase),n(r.name)&&this.warn("conflictingName",r.name)},fixDescriptionField:function(r){r.description&&typeof r.description!="string"&&(this.warn("nonStringDescription"),delete r.description),r.readme&&!r.description&&(r.description=a(r.readme)),r.description===void 0&&delete r.description,r.description||this.warn("missingDescription")},fixReadmeField:function(r){r.readme||(this.warn("missingReadme"),r.readme="ERROR: No README data found!")},fixBugsField:function(r){if(!r.bugs&&r.repository&&r.repository.url){var p=s.fromUrl(r.repository.url);p&&p.bugs()&&(r.bugs={url:p.bugs()})}else if(r.bugs){if(typeof r.bugs=="string")u(r.bugs)?r.bugs={email:r.bugs}:h.canParse(r.bugs)?r.bugs={url:r.bugs}:this.warn("nonEmailUrlBugsString");else{y(r.bugs,this.warn);var d=r.bugs;r.bugs={},d.url&&(h.canParse(d.url)?r.bugs.url=d.url:this.warn("nonUrlBugsUrlField")),d.email&&(typeof d.email=="string"&&u(d.email)?r.bugs.email=d.email:this.warn("nonEmailBugsEmailField"))}!r.bugs.email&&!r.bugs.url&&(delete r.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(r){if(!r.homepage&&r.repository&&r.repository.url){var p=s.fromUrl(r.repository.url);p&&p.docs()&&(r.homepage=p.docs())}if(r.homepage){if(typeof r.homepage!="string")return this.warn("nonUrlHomepage"),delete r.homepage;h.canParse(r.homepage)||(r.homepage="http://"+r.homepage)}},fixLicenseField:function(r){const p=r.license||r.licence;if(!p)return this.warn("missingLicense");if(typeof p!="string"||p.length<1||p.trim()==="")return this.warn("invalidLicense");if(!i(p).validForNewPackages)return this.warn("invalidLicense")}};function f(r){if(r.charAt(0)!=="@")return!1;var p=r.slice(1).split("/");return p.length!==2?!1:p[0]&&p[1]&&p[0]===encodeURIComponent(p[0])&&p[1]===encodeURIComponent(p[1])}function S(r){return!r.match(/[/@\s+%:]/)&&r===encodeURIComponent(r)}function b(r,p,d){if(r.charAt(0)==="."||!(f(r)||S(r))||p&&!d&&r!==r.toLowerCase()||r.toLowerCase()==="node_modules"||r.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(r))}function v(r,p){return r.author&&(r.author=p(r.author)),["maintainers","contributors"].forEach(function(d){Array.isArray(r[d])&&(r[d]=r[d].map(p))}),r}function C(r){if(typeof r=="string")return r;var p=r.name||"",d=r.url||r.web,P=d?" ("+d+")":"",D=r.email||r.mail,w=D?" <"+D+">":"";return p+w+P}function m(r){if(typeof r!="string")return r;var p=r.match(/^([^(<]+)/),d=r.match(/\(([^()]+)\)/),P=r.match(/<([^<>]+)>/),D={};return p&&p[0].trim()&&(D.name=p[0].trim()),P&&(D.email=P[1]),d&&(D.url=d[1]),D}function L(r){var p=r.optionalDependencies;if(p){var d=r.dependencies||{};Object.keys(p).forEach(function(P){d[P]=p[P]}),r.dependencies=d}}function c(r,p,d){if(!r)return{};if(typeof r=="string"&&(r=r.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(r))return r;d("deprecatedArrayDependencies",p);var P={};return r.filter(function(D){return typeof D=="string"}).forEach(function(D){D=D.trim().split(/(:?[@\s><=])/);var w=D.shift(),x=D.join("");x=x.trim(),x=x.replace(/^@/,""),P[w]=x}),P}function g(r,p){l.forEach(function(d){r[d]&&(r[d]=c(r[d],d,p))})}function y(r,p){r&&Object.keys(r).forEach(function(d){o.bugs[d]&&(p("typo",d,o.bugs[d],"bugs"),r[o.bugs[d]]=r[d],delete r[d])})}return Z}var Be="'repositories' (plural) Not supported. Please pick one as the 'repository' field",Re="No repository field.",Ie="Probably broken git url: %s",Ue="scripts must be an object",Me="script values must be string commands",ke="Invalid 'files' member",_e="Invalid filename in 'files' list: %s",We="Invalid 'bundleDependencies' list. Must be array of package names",He="Invalid bundleDependencies member: %s",je="Non-dependency in bundleDependencies: %s",ze="%s field must be an object",Ye="Invalid dependency: %s %s",qe="specifying %s as array is deprecated",Ve="modules field is deprecated",Ke="keywords should be an array of strings",Xe="keywords should be an array of strings",Je="%s is also the name of a node core module.",Ze="'description' field should be a string",Qe="No description",et="No README data",tt="No license field.",it="Bug string field must be url, email, or {email,url}",rt="bugs.url field must be a string url. Deleted.",nt="bugs.email field must be a string email. Deleted.",st="Normalized value of bugs field is an empty object. Deleted.",ot="homepage field must be a string url. Deleted.",lt="license should be a valid SPDX license expression",at="%s should probably be %s.";const zt={repositories:Be,missingRepository:Re,brokenGitUrl:Ie,nonObjectScripts:Ue,nonStringScript:Me,nonArrayFiles:ke,invalidFilename:_e,nonArrayBundleDependencies:We,nonStringBundleDependency:He,nonDependencyBundleDependency:je,nonObjectDependencies:ze,nonStringDependency:Ye,deprecatedArrayDependencies:qe,deprecatedModules:Ve,nonArrayKeywords:Ke,nonStringKeyword:Xe,conflictingName:Je,nonStringDescription:Ze,missingDescription:Qe,missingReadme:et,missingLicense:tt,nonEmailUrlBugsString:it,nonUrlBugsUrlField:rt,nonEmailBugsEmailField:nt,emptyNormalizedBugs:st,nonUrlHomepage:ot,invalidLicense:lt,typo:at},Yt=Object.defineProperty({__proto__:null,brokenGitUrl:Ie,conflictingName:Je,default:zt,deprecatedArrayDependencies:qe,deprecatedModules:Ve,emptyNormalizedBugs:st,invalidFilename:_e,invalidLicense:lt,missingDescription:Qe,missingLicense:tt,missingReadme:et,missingRepository:Re,nonArrayBundleDependencies:We,nonArrayFiles:ke,nonArrayKeywords:Ke,nonDependencyBundleDependency:je,nonEmailBugsEmailField:nt,nonEmailUrlBugsString:it,nonObjectDependencies:ze,nonObjectScripts:Ue,nonStringBundleDependency:He,nonStringDependency:Ye,nonStringDescription:Ze,nonStringKeyword:Xe,nonStringScript:Me,nonUrlBugsUrlField:rt,nonUrlHomepage:ot,repositories:Be,typo:at},Symbol.toStringTag,{value:"Module"}),qt=ie(Yt);var Q,ve;function Vt(){if(ve)return Q;ve=1;var h=yt,e=qt;Q=function(){var i=Array.prototype.slice.call(arguments,0),s=i.shift();if(s==="typo")return t.apply(null,i);var n=e[s]?e[s]:s+": '%s'";return i.unshift(n),h.format.apply(null,i)};function t(i,s,n){return n&&(i=n+"['"+i+"']",s=n+"['"+s+"']"),h.format(e.typo,i,s)}return Q}var ee,Ce;function Kt(){if(Ce)return ee;Ce=1,ee=n;var h=jt();n.fixer=h;var e=Vt(),t=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],i=["dependencies","people","typos"],s=t.map(function(a){return l(a)+"Field"});s=s.concat(i);function n(a,o,u){o===!0&&(o=null,u=!0),u||(u=!1),(!o||a.private)&&(o=function(){}),a.scripts&&a.scripts.install==="node-gyp rebuild"&&!a.scripts.preinstall&&(a.gypfile=!0),h.warn=function(){o(e.apply(null,arguments))},s.forEach(function(f){h["fix"+l(f)](a,u)}),a._id=a.name+"@"+a.version}function l(a){return a.charAt(0).toUpperCase()+a.slice(1)}return ee}var Xt=Kt();const Jt=vt(Xt),Zt=(h,e,t)=>{const i=te(h),s=te(e),n=s===i?".":mt(i,s);return t.some(l=>{const a=l.startsWith("./")?l.slice(2):l,o=n.startsWith("./")?n.slice(2):n;if(a==="."&&o===".")return!0;if(a.endsWith("/**")){const u=a.slice(0,-3);return o===u||o.startsWith(`${u}/`)}if(a.endsWith("/*")){const u=a.slice(0,-2);return u===""?o!=="."&&!o.includes("/"):o.startsWith(`${u}/`)||o===u}return o===a||o.startsWith(`${a}/`)})},Qt=h=>{const e=be("pnpm-workspace.yaml",{cwd:te(h),type:"file"});if(!e)return;const t=De(e),i=Array.isArray(t.packages)?t.packages:[];if(!Zt(e,h,i))return;const s={};return t.catalog&&typeof t.catalog=="object"&&(s.catalog=t.catalog),t.catalogs&&typeof t.catalogs=="object"&&(s.catalogs=t.catalogs),Object.keys(s).length>0?s:void 0},ei=(h,e,t)=>{if(e==="catalog:")return t.catalog?.[h];if(e.startsWith("catalog:")){const i=e.slice(8);return t.catalogs?.[i]?.[h]}},ti=(h,e)=>{for(const[t,i]of Object.entries(h)){if(typeof i!="string")continue;const s=ei(t,i,e);s&&(h[t]=s)}},ii=(h,e)=>{const t=["dependencies","devDependencies","peerDependencies","optionalDependencies"];for(const i of t){if(!h[i]||typeof h[i]!="object")continue;const s=h[i];ti(s,e)}};let ri;const ni=h=>(ri??=dt(import.meta.url))(h),$=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,re=h=>{if(typeof $<"u"&&$.versions&&$.versions.node){const[e,t]=$.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return $.getBuiltinModule(h)}return ni(h)},{existsSync:$i}=re("node:fs"),{createInterface:Ti}=re("node:readline"),{styleText:Bi}=re("node:util"),si=new Set(["__proto__","prototype","constructor"]);Math.max(...[...si].map(h=>h.length));typeof process.stdout<"u"&&!process.versions.deno&&globalThis.window;const oi=/, ([^,]*)$/,li=new Map,ai=(h,e={})=>{const t=e.strict&&e.ignoreWarnings?e.ignoreWarnings.map(String).toSorted((i,s)=>i.localeCompare(s)).join(","):"";return`${h}|s${String(e.strict?1:0)}|c${String(e.resolveCatalogs?1:0)}|j${String(e.json5===!1?0:1)}|y${String(e.yaml===!1?0:1)}|w${t}`};class ci extends Error{constructor(e){super(`The following warnings were encountered while normalizing package data:
|
|
3
3
|
- ${e.join(`
|
|
4
|
-
- `)}`),this.name="PackageJsonValidationError"}}const hi=(h,e,t=[])=>{const i=[];if(Jt(h,s=>{i.push(s)},e),e&&i.length>0){const s=i.filter(n=>!t.some(l=>l instanceof RegExp?l.test(n):l===n));if(s.length>0)throw new ci(s)}return h},ui=h=>De(h),pi=h=>{const e=Lt(h);return St.parse(e)},fi=(h,e)=>e?.yaml!==!1&&(h.endsWith(".yaml")||h.endsWith(".yml"))?ui(h):e?.json5!==!1&&h.endsWith(".json5")?pi(h):bt(h),di=(h,e={})=>{const t={type:"file"};h&&(t.cwd=h);const i=["package.json"];e.yaml!==!1&&i.push("package.yaml","package.yml"),e.json5!==!1&&i.push("package.json5");const s=be(i,t);if(!s)throw new gt(`No such file or directory, for ${i.join(", ").replace(oi," or $1")} found.`);const n=e.cache&&typeof e.cache!="boolean"?e.cache:li,l=ai(s,e);if(e.cache&&n.has(l))return n.get(l);const a=fi(s,e);if(e.resolveCatalogs){const u=Qt(s);u&&ii(a,u)}hi(a,e.strict??!1,e.ignoreWarnings);const o={packageJson:a,path:s};return e.cache&&n.set(l,o),o};var mi="4.0
|
|
4
|
+
- `)}`),this.name="PackageJsonValidationError"}}const hi=(h,e,t=[])=>{const i=[];if(Jt(h,s=>{i.push(s)},e),e&&i.length>0){const s=i.filter(n=>!t.some(l=>l instanceof RegExp?l.test(n):l===n));if(s.length>0)throw new ci(s)}return h},ui=h=>De(h),pi=h=>{const e=Lt(h);return St.parse(e)},fi=(h,e)=>e?.yaml!==!1&&(h.endsWith(".yaml")||h.endsWith(".yml"))?ui(h):e?.json5!==!1&&h.endsWith(".json5")?pi(h):bt(h),di=(h,e={})=>{const t={type:"file"};h&&(t.cwd=h);const i=["package.json"];e.yaml!==!1&&i.push("package.yaml","package.yml"),e.json5!==!1&&i.push("package.json5");const s=be(i,t);if(!s)throw new gt(`No such file or directory, for ${i.join(", ").replace(oi," or $1")} found.`);const n=e.cache&&typeof e.cache!="boolean"?e.cache:li,l=ai(s,e);if(e.cache&&n.has(l))return n.get(l);const a=fi(s,e);if(e.resolveCatalogs){const u=Qt(s);u&&ii(a,u)}hi(a,e.strict??!1,e.ignoreWarnings);const o={packageJson:a,path:s};return e.cache&&n.set(l,o),o};var mi="4.1.0";const gi={version:mi},Li=gi.version,Si="@visulima/vis";let O;const Ri=()=>{if(O!==void 0)return O;const h=process.env.VIS_VERSION;if(h)return O=h,O;try{const{packageJson:e}=di(pt(ft(import.meta.url)),{json5:!1,yaml:!1});if(e.name===Si&&typeof e.version=="string")return O=e.version,O}catch{}return O=Li,O};export{Ei as a,wi as b,Fi as c,Ai as d,Gi as e,Ri as g,Ni as h,Di as i,xi as l,Oi as u};
|
package/dist/packem_shared/{project-name-filter-B0y95mKx.js → project-name-filter-jDQpaOkI.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as p}from"node:module";import{V as l}from"./vis-user-error-
|
|
1
|
+
import{createRequire as p}from"node:module";import{V as l}from"./vis-user-error-CEc_asoq.js";let g;const m=e=>(g??=p(import.meta.url))(e),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[s,n]=c.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return c.getBuiltinModule(e)}return m(e)},{createInterface:j}=h("node:readline"),y=e=>{const s=new Set;for(const n of Object.values(e.projects))for(const t of Object.keys(n.targets??{}))s.add(t);return[...s].sort()},b=e=>{const s=new Map;for(const n of e.values())for(const[t,o]of Object.entries(n))for(const r of o.aliases??[])s.has(r)||s.set(r,t);return s},$=(e,s)=>s.get(e)??e,w=(e,s)=>{if(e.length===0)return s.length;if(s.length===0)return e.length;const n=[];for(let t=0;t<=s.length;t++)n[t]=[t];for(let t=0;t<=e.length;t++)n[0][t]=t;for(let t=1;t<=s.length;t++)for(let o=1;o<=e.length;o++){const r=s[t-1]===e[o-1]?0:1;n[t][o]=Math.min(n[t-1][o]+1,n[t][o-1]+1,n[t-1][o-1]+r)}return n[s.length][e.length]},v=(e,s,n=3)=>f(e,s,1,n)[0],f=(e,s,n=3,t=3)=>{const o=[];for(const r of s){const i=w(e.toLowerCase(),r.toLowerCase());i<=t&&o.push({distance:i,name:r})}return o.sort((r,i)=>r.distance-i.distance||r.name.localeCompare(i.name)),o.slice(0,n).map(r=>r.name)},M=e=>e.length===0?" (no targets found)":e.map(s=>` - ${s}`).join(`
|
|
2
2
|
`),S=async e=>{if(e.length===0||!process.stdin.isTTY||!process.stdout.isTTY)return;const s=j({input:process.stdin,output:process.stdout});try{process.stdout.write(`Available targets:
|
|
3
3
|
`);for(const[r,i]of e.entries())process.stdout.write(` ${String(r+1).padStart(2," ")}. ${i}
|
|
4
4
|
`);process.stdout.write(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{renderTagPattern as m}from"../packem_chunks/git.js";const p={github:"https://github.com",gitlab:"https://gitlab.com"},g=(t,e)=>{const r=`${p[t]}/${e}`,o=t==="gitlab"?`${r}/-`:r;return{commit:n=>`${o}/commit/${n}`,compare:(n,s)=>`${o}/compare/${n}...${s}`,issue:n=>`${o}/issues/${n}`,pullRequest:n=>`${o}/${t==="gitlab"?"merge_requests":"pull"}/${n}`}},d=/\{(name|version|date|compareUrl)\}/g,c="]({compareUrl})",$=t=>{let e=t,r=e.indexOf(c);for(;r!==-1;){const o=e.lastIndexOf("[",r);e=o===-1?e.slice(0,r)+e.slice(r+c.length):e.slice(0,o)+e.slice(o+1,r)+e.slice(r+c.length),r=e.indexOf(c)}return e},b=(t,e)=>{const r=e.compareUrl??"",o=r===""?$(t):t,n={compareUrl:r,date:e.date,name:e.name,version:e.version};return o.replaceAll(d,(s,i)=>n[i]??"")},u=t=>{let e=t.length;for(;e>0&&t.codePointAt(e-1)===47;)e-=1;return e===t.length?t:t.slice(0,e)},f=t=>{const{compareUrlPrefix:e,name:r,newVersion:o,oldVersion:n,repo:s}=t;if(!n)return;const i=t.tagPattern??"{name}@{version}",a=m(i,{name:r,version:n}),l=m(i,{name:r,version:o});if(e)return`${u(e)}/compare/${a}...${l}`;if(s)return g(t.provider??"github",s).compare(a,l)};export{g as a,f as b,b as r};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{createRequire as J}from"node:module";import{DEFAULT_CHANGES_DIR as ee}from"../packem_chunks/DEFAULT_CLEAN_KEEP.js";import{maxBump as te}from"../release/types.js";import{f as re}from"../packem_chunks/orchestrator.js";import{r as ne}from"./slug-OBHcH7wV.js";import{resolveLastReleaseRef as se}from"../packem_chunks/version-resolver.js";let Y;const Z=r=>(Y??=J(import.meta.url))(r),$=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Q=r=>{if(typeof $<"u"&&$.versions&&$.versions.node){const[e,t]=$.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return $.getBuiltinModule(r)}return Z(r)},{join:F}=Q("node:path"),K=/(?!.*)/;function ie(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function I(r){return r.map(e=>typeof e=="string"?ie(e.trim()):e.source).filter(Boolean).join("|")}function oe(r,e){if(!r)return K;const t=I(r);return e?e(t):new RegExp(`^(?:\\*\\s+)?(${t}):\\s*(.*)`,"i")}function ae(r,e){if(!r)return K;const t=e?"g":"gi";return new RegExp(`(?:.*?)??\\s*([\\w-\\.\\/]*?)??(${I(r)})([\\w-]+)(?=\\s|$|[,;.)\\]])`,t)}function ce(r){if(!r)return/()(.+)/gi;const e=I(r);return new RegExp(`(${e})(?:\\s+(.*?))(?=(?:${e})|$)`,"gi")}function le(r){const e=r?`|\\s+(?:${I(r)})`:"";return new RegExp(`^(?:BREAKING CHANGE|[\\w-]+)(?::\\s+${e}).+`,"i")}function fe(r={}){const e=oe(r.noteKeywords,r.notesPattern),t=ae(r.issuePrefixes,r.issuePrefixesCaseSensitive),n=ce(r.referenceActions),s=le(r.issuePrefixes);return{notes:e,referenceParts:t,references:n,footerToken:s,mentions:/@([\w-]+)/g,url:/\b(?:https?):\/\/(?:www\.)?([-a-zA-Z0-9@:%_+.~#?&//=])+\b/}}const he="------------------------ >8 ------------------------";function S(r){const e=r.match(/[^\r\n]/);if(typeof e?.index!="number")return"";const t=e.index;let n=r.length-1;for(;r[n]==="\r"||r[n]===`
|
|
2
|
+
`;)n--;return r.substring(t,n+1)}function k(r,e){return r?`${r}
|
|
3
|
+
${e||""}`:e||""}function ue(r){return r?e=>!e.startsWith(r):()=>!0}function de(r,e){const t=r.indexOf(`${e} ${he}`);return t===-1?r:r.slice(0,t)}function O(r){return!r.match(/^\s*gpg:/)}function M(r,e,t){const{groups:n}=e;for(let s=0,o=t.length,i;s<o;s++)i=t[s],r[i]=(n?n[i]:e[s+1])||null;return r}const me={noteKeywords:["BREAKING CHANGE","BREAKING-CHANGE"],issuePrefixes:["#"],referenceActions:["close","closes","closed","fix","fixes","fixed","resolve","resolves","resolved"],headerPattern:/^(\w*)(?:\(([\w$@.\-*/ ]*)\))?: (.*)$/,headerCorrespondence:["type","scope","subject"],revertPattern:/^Revert\s"([\s\S]*)"\s*This reverts commit (\w*)\.?/,revertCorrespondence:["header","hash"],fieldPattern:/^-(?=.*\w)(.*?)-$/};function G(r={}){return{merge:null,revert:null,header:null,body:null,footer:null,notes:[],mentions:[],references:[],...r}}class ge{options;regexes;lines=[];lineIndex=0;commit=G();constructor(e={}){this.options={...me,...e},this.regexes=fe(this.options)}currentLine(){return this.lines[this.lineIndex]}nextLine(){return this.lines[this.lineIndex++]}isLineAvailable(){return this.lineIndex<this.lines.length}parseReference(e,t){const{regexes:n}=this;if(n.url.test(e))return null;const s=n.referenceParts.exec(e);if(!s)return null;let[o,i=null,c,f]=s,u=null;if(i){const x=i.indexOf("/");x!==-1&&(u=i.slice(0,x),i=i.slice(x+1))}return{raw:o,action:t,owner:u,repository:i,prefix:c,issue:f}}parseReferences(e){const{regexes:t}=this,n=e.match(t.references)?t.references:/()(.+)/gi,s=[];let o,i,c,f;for(;o=n.exec(e),!!o;)for(i=o[1]||null,c=o[2]||"";f=this.parseReference(c,i),!!f;)s.push(f);return s}skipEmptyLines(){let e=this.currentLine();for(;e!==void 0&&!e.trim();)this.nextLine(),e=this.currentLine()}parseMerge(){const{commit:e,options:t}=this,n=t.mergeCorrespondence||[],s=this.currentLine(),o=s&&t.mergePattern?s.match(t.mergePattern):null;return o?(this.nextLine(),e.merge=o[0]||null,M(e,o,n),!0):!1}parseHeader(e){e&&this.skipEmptyLines();const{commit:t,options:n}=this,s=n.headerCorrespondence||[],o=t.header??this.nextLine();let i=null;o&&(n.breakingHeaderPattern&&(i=o.match(n.breakingHeaderPattern)),!i&&n.headerPattern&&(i=o.match(n.headerPattern))),o&&(t.header=o),i&&M(t,i,s)}parseMeta(){const{options:e,commit:t}=this;if(!e.fieldPattern||!this.isLineAvailable())return!1;let n,s=null,o=!1;for(;this.isLineAvailable();){if(n=this.currentLine().match(e.fieldPattern),n){s=n[1]||null,this.nextLine();continue}if(s)o=!0,t[s]=k(t[s],this.currentLine()),this.nextLine();else break}return o}parseNotes(){const{regexes:e,commit:t}=this;if(!this.isLineAvailable())return!1;const n=this.currentLine().match(e.notes);let s;if(n){const o={title:n[1],text:n[2]};for(t.notes.push(o),t.footer=k(t.footer,this.currentLine()),this.nextLine();this.isLineAvailable();){if(this.parseMeta()||this.parseNotes())return!0;if(s=e.footerToken.test(this.currentLine()),t.references.push(...this.parseReferences(this.currentLine())),s||(o.text=k(o.text,this.currentLine())),t.footer=k(t.footer,this.currentLine()),this.nextLine(),s)break}return!0}return!1}parseBodyAndFooter(e){const{commit:t,regexes:n}=this;if(!this.isLineAvailable())return e;const o=!n.footerToken.test(this.currentLine())&&e;return t.references.push(...this.parseReferences(this.currentLine())),o?t.body=k(t.body,this.currentLine()):t.footer=k(t.footer,this.currentLine()),this.nextLine(),o}parseBreakingHeader(){const{commit:e,options:t}=this;if(!t.breakingHeaderPattern||e.notes.length||!e.header)return;const n=e.header.match(t.breakingHeaderPattern);n&&e.notes.push({title:"BREAKING CHANGE",text:n[3]})}parseMentions(e){const{commit:t,regexes:n}=this;let s;for(;s=n.mentions.exec(e),!!s;)t.mentions.push(s[1])}parseRevert(e){const{commit:t,options:n}=this,s=n.revertCorrespondence||[],o=n.revertPattern?e.match(n.revertPattern):null;o&&(t.revert=M({},o,s))}cleanupCommit(){const{commit:e}=this;e.body&&=S(e.body),e.footer&&=S(e.footer),e.notes.forEach(n=>{n.text=S(n.text)});const t=new Set;e.references=e.references.filter(n=>{const s=`${n.action} ${n.raw}`.toLocaleLowerCase(),o=!t.has(s);return o&&t.add(s),o})}parse(e){if(!e.trim())throw new TypeError("Expected a raw commit");const{commentChar:t}=this.options,n=ue(t),s=S(e).split(/\r?\n/),o=t?de(s,t).filter(u=>n(u)&&O(u)):s.filter(u=>O(u)),i=G();this.lines=o,this.lineIndex=0,this.commit=i;const c=this.parseMerge();this.parseHeader(c),i.header&&(i.references=this.parseReferences(i.header));let f=!0;for(;this.isLineAvailable();)this.parseMeta(),this.parseNotes()&&(f=!1),this.parseBodyAndFooter(f)||(f=!1);return this.parseBreakingHeader(),this.parseMentions(e),this.parseRevert(e),this.cleanupCommit(),i}}const D={build:"patch",chore:"patch",ci:"patch",docs:"patch",feat:"minor",fix:"patch",perf:"patch",refactor:"patch",style:"patch",test:"patch"},pe=new ge,xe=/^Revert\s+"(.+)"\s*$/,we=/This reverts commit\s+([0-9a-f]{7,40})/i,be=/^(?:[\p{Emoji_Presentation}\p{Extended_Pictographic}]|:\w+:)\s+/u,Re=(r,e)=>{const t=r.replace(be,""),n=pe.parse(`${t}
|
|
4
|
+
|
|
5
|
+
${e}`);return{breaking:n.notes.some(o=>/BREAKING/i.test(o.title)),scope:n.scope??void 0,type:n.type??void 0}},ve=(r,e,t)=>{let n,s=!1;if(t.type==="revert"){s=!0;const c=r.indexOf(":");c!==-1&&(n=r.slice(c+1).trim())}else{const c=xe.exec(r.trim());c&&(s=!0,n=c[1]?.trim())}let o;const i=we.exec(e);return i&&(o=i[1]?.toLowerCase()),{isRevert:s,targetSha:o,targetSubject:n}},Ee=(r,e=new Set,t)=>{const n=r.map(a=>{const h=Re(a.subject,a.body),{isRevert:l,targetSha:g,targetSubject:d}=ve(a.subject,a.body,h);return{...a,cancelled:!1,parsed:h,revert:l,revertSubject:d,revertTargetSha:g}}),s=n.toReversed(),o=12,i=new Map;for(const a of s)if(i.set(a.hash,a),a.hash.length>=7){const h=Math.min(a.hash.length-1,o);for(let l=7;l<=h;l+=1){const g=a.hash.slice(0,l);if(i.has(g)){const d=i.get(g);d!==null&&d!==a&&i.set(g,null)}else i.set(g,a)}}const c=(a,h)=>{if(a.revertTargetSha){const l=a.revertTargetSha.toLowerCase();let d=i.get(l)??void 0;if(d||(d=s.find(A=>A.hash.startsWith(l))),d&&d!==a)return d}if(a.revertSubject)for(let l=h.length-1;l>=0;l-=1){const g=h[l];if(g.subject===a.revertSubject)return g}},f=64,u=a=>{let h=a;for(let l=0;l<f;l+=1){if(!h.revert)return h;const g=h.cancelledBy;let d;if(g&&(d=i.get(g)??void 0,d||(d=i.get(g.slice(0,7))??void 0)),!d||d===h)return h;h=d}},x=[],m=[];for(const a of s){if(a.revert){const h=c(a,m);if(h){if(e.has(h.hash)){m.push(a);continue}const l=u(h);if(l===void 0){x.push(`Revert chain at ${a.hash} exceeded depth limit (${f}) — skipping cancellation`),m.push(a);continue}if(e.has(l.hash)){m.push(a);continue}l.cancelled=!l.cancelled,l.cancelledBy=l.cancelled?a.hash:void 0,a.cancelled=!0,a.cancelledBy=h.hash}}m.push(a)}const v=n.filter(a=>!a.cancelled&&!a.revert&&!a.subject?.startsWith("Merge ")),C=v.filter(a=>!a.parsed.type);if(v.length>0&&C.length/v.length>.5){const a=t??"<from>..HEAD";x.push(`${C.length}/${v.length} commits in ${a} have no conventional-commits prefix. Consider enabling commit-message linting.`)}return{commits:n,warnings:x}},ye=[/^chore\(release\)!?:/i,/^chore\([^\n)]{0,64}\)!?:[ \t]{0,8}release[ \t]/i,/^chore!?:[ \t]{0,8}release[ \t]/i,/^release(?:\([^\n)]{0,64}\))?!?:/i],Le=(r={})=>{const e=r.ignoreReleaseCommits===!1?[]:[...ye],t=r.ignoreCommitPattern,n=t===void 0?[]:typeof t=="string"?[t]:t;for(const s of n)if(!(typeof s!="string"||s.trim()===""))try{e.push(new RegExp(s))}catch(o){r.onInvalidPattern?.(s,o)}return e},ke=512,Ce=(r,e)=>{if(e.length===0)return!1;const t=r.slice(0,ke);return e.some(n=>(n.lastIndex=0,n.test(t)))},_e=r=>{const e=[],t=r.indexOf(`
|
|
6
|
+
`);t!==-1&&e.push(t);const n=String.raw`\n\n`;let s=r.indexOf(n);for(;s!==-1;){if(/^\s{0,8}#/.test(r.slice(s+n.length))){e.push(s);break}s=r.indexOf(n,s+1)}return(e.length>0?r.slice(0,Math.min(...e)):r).trim()},Pe=async r=>{const{config:e,cwd:t,packages:n,perPackageConfig:s,runner:o}=r,i=[],c=[];if(r.from)return{notes:i,ref:r.from,warnings:c};if(r.sinceLastRelease){const m=await se({cwd:t,packages:n,perPackageConfig:s,runner:o,workspaceConfig:e});if(m.kind==="tag"&&m.ref)return i.push(`--since-last-release: ${m.reason}.`),{notes:i,ref:m.ref,warnings:c};if(m.kind==="root-commit"&&m.ref)return r.allowFullHistory!==!0?{error:`--since-last-release: ${m.reason}. Refusing to walk it: every package touched anywhere in that history would be bumped (major, for any breaking-change marker in it) and, on the auto-publish path, published. Pass --allow-full-history if this really is a first release, or pin the start of the range explicitly.`,notes:i,warnings:c}:(c.push(`--since-last-release: ${m.reason}. Walking it because --allow-full-history was passed.`),{notes:i,ref:m.ref,warnings:c});c.push(`--since-last-release: ${m.reason}. Falling back to the merge-base with baseBranch.`)}const f=e.baseBranch??"main",u=await o.run("git",["merge-base",`origin/${f}`,"HEAD"],{cwd:t,silent:!0});if(u.exitCode===0&&u.stdout.trim())return{notes:i,ref:u.stdout.trim(),warnings:c};const x=await o.run("git",["merge-base",f,"HEAD"],{cwd:t,silent:!0});return{notes:i,ref:x.exitCode===0&&x.stdout.trim()?x.stdout.trim():"HEAD~10",warnings:c}},Ne=async r=>{const{config:e,cwd:t,fs:n,packages:s,runner:o}=r,i=await Pe(r),c=[...i.notes],f=[...i.warnings];if(i.error!==void 0||i.ref===void 0)return{error:i.error??"Could not resolve the start of the commit range.",ignoredCommits:0,notes:c,status:"failed",warnings:f};const u=i.ref,x=new Map;for(const p of s){const w=(p.dir.startsWith(t)?p.dir.slice(t.length):p.dir).replaceAll("\\","/").replace(/^\/+/,"");x.set(w,p.name)}const m=p=>{for(const[R,w]of x)if(p.startsWith(`${R}/`)||p===`${R}/package.json`)return w},v=Math.random().toString(16).slice(2,10),C=`@@VIS_RELEASE_COMMIT_${v}@@`,a=`@@VIS_RELEASE_FILES_${v}@@`,h=await o.run("git",["log",`${u}..HEAD`,`--pretty=format:${C}%n%H%n%s%n%b%n${a}`,"--name-only"],{cwd:t,silent:!0});if(h.exitCode!==0)return{error:`git log failed: ${h.stderr}`,fromRef:u,ignoredCommits:0,notes:c,status:"failed",warnings:f};const l=new Map,g=[],d=[],A=h.stdout.split(C).map(p=>p.trim()).filter(Boolean);for(const p of A){const[R,w=""]=p.split(a).toReversed(),P=w.split(`
|
|
7
|
+
`),E=P[0]?.trim()??"",y=_e(P[1]??""),b=P.slice(2).join(`
|
|
8
|
+
`).trim(),L=(R??"").split(`
|
|
9
|
+
`).map(V=>V.trim()).filter(Boolean);E&&d.push({body:b,files:L,hash:E,subject:y})}const N=Le({ignoreCommitPattern:e.ignoreCommitPattern,ignoreReleaseCommits:e.ignoreReleaseCommits,onInvalidPattern:(p,R)=>{f.push(`Ignoring invalid release.ignoreCommitPattern entry ${JSON.stringify(p)}: ${R.message}`)}}),H=d.filter(p=>!Ce(p.subject,N)),_=d.length-H.length;_>0&&c.push(`Skipped ${_} release/ignored commit(s) in ${u}..HEAD.`);const{commits:W,warnings:z}=Ee(H,void 0,`${u}..HEAD`);f.push(...z);for(const{cancelled:p,files:R,parsed:w,subject:P}of W){if(p)continue;let E="patch";w.breaking?E="major":w.type&&D[w.type]&&(E=D[w.type]??"patch");const y=new Set;if(w.scope)for(const b of s)(b.name===w.scope||b.name.endsWith(`/${w.scope}`))&&y.add(b.name);if(y.size===0)for(const b of R){const L=m(b);L&&y.add(L)}for(const b of y){const L=l.get(b);l.set(b,L?te(L,E):E)}y.size>0&&g.push(`- ${P}`)}if(l.size===0)return c.push("No commits affected workspace packages — nothing to generate."),{bumps:l,fromRef:u,ignoredCommits:_,notes:c,status:"no-changes",warnings:f};const X={bumps:Object.fromEntries(l)},q=g.length>0?g.join(`
|
|
10
|
+
`):"Auto-generated change file.",T=re(X,q);if(r.dryRun)return{bumps:l,content:T,fromRef:u,ignoredCommits:_,notes:c,status:"dry-run",warnings:f};const j=e.changesDir??ee,U=(r.name??ne()).replaceAll(/[^a-z0-9-]/gi,"-"),B=F(t,j,`${U}.md`);return await n.mkdir(F(t,j),{recursive:!0}),await n.writeFile(B,T),{bumps:l,content:T,createdFile:B,fromRef:u,ignoredCommits:_,notes:c,status:"written",warnings:f}};export{Ne as r};
|