@visulima/vis 6.5.1 → 6.5.2
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 +6 -0
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/bloom-sync.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 +1 -1
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler32.js +1 -1
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler49.js +1 -1
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler50.js +1 -1
- package/dist/packem_chunks/handler51.js +1 -1
- package/dist/packem_chunks/handler52.js +1 -1
- package/dist/packem_chunks/handler54.js +1 -1
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler56.js +6 -6
- package/dist/packem_chunks/handler58.js +1 -1
- package/dist/packem_chunks/handler59.js +1 -1
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler60.js +1 -1
- package/dist/packem_chunks/handler61.js +1 -1
- package/dist/packem_chunks/handler62.js +1 -1
- package/dist/packem_chunks/handler63.js +1 -1
- package/dist/packem_chunks/handler64.js +1 -1
- package/dist/packem_chunks/handler65.js +1 -1
- package/dist/packem_chunks/handler66.js +1 -1
- package/dist/packem_chunks/handler67.js +1 -1
- package/dist/packem_chunks/handler68.js +1 -1
- package/dist/packem_chunks/handler69.js +1 -1
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +1 -1
- package/dist/packem_chunks/handler71.js +1 -1
- package/dist/packem_chunks/handler72.js +1 -1
- package/dist/packem_chunks/handler73.js +1 -1
- package/dist/packem_chunks/handler74.js +1 -1
- package/dist/packem_chunks/handler75.js +1 -1
- package/dist/packem_chunks/handler76.js +1 -1
- package/dist/packem_chunks/handler77.js +1 -1
- package/dist/packem_chunks/handler78.js +1 -1
- package/dist/packem_chunks/handler79.js +1 -1
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/index3.js +1 -1
- package/dist/packem_chunks/index7.js +1 -1
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/snapshot.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_chunks/workspace.js +1 -1
- package/dist/packem_shared/{ReleaseClient-CQaGkUHL.js → ReleaseClient-PVB_2PkQ.js} +1 -1
- package/dist/packem_shared/{advisories-DzWrfMwP.js → advisories-D6O8_7q8.js} +1 -1
- package/dist/packem_shared/{affected-selection-mQmHyn-j.js → affected-selection-pzrz7Up4.js} +1 -1
- package/dist/packem_shared/{ai-analysis-CIN__RZj.js → ai-analysis-BEP03Gjy.js} +1 -1
- package/dist/packem_shared/{ai-cache-BgoifbUT.js → ai-cache-CMlW-WEd.js} +1 -1
- package/dist/packem_shared/{ai-fix-BG2olCnp.js → ai-fix-CVwgqleW.js} +1 -1
- package/dist/packem_shared/{apply-BrRx__KL.js → apply-VwWv8q05.js} +1 -1
- package/dist/packem_shared/apply-release-plan-DdhDICdO.js +16 -0
- package/dist/packem_shared/{bin-DcZlUzKR.js → bin-CJlwiuPF.js} +1 -1
- package/dist/packem_shared/{build-scripts-BtdNDGRO.js → build-scripts-BwIDu1P_.js} +1 -1
- package/dist/packem_shared/{dependency-scan-BmnwM6FX.js → dependency-scan-DrHMLDiM.js} +1 -1
- package/dist/packem_shared/{detect-DwXq9NzG.js → detect-C5tXtm2Z.js} +1 -1
- package/dist/packem_shared/{docker-CN9h1ZAl.js → docker-APhsTulj.js} +1 -1
- package/dist/packem_shared/{ecosystem-gate-DX0ZULH7.js → ecosystem-gate-3nxiOrV7.js} +1 -1
- package/dist/packem_shared/{env-consistency-B69mYzeD.js → env-consistency-Ds8_I0jB.js} +1 -1
- package/dist/packem_shared/{env-BUf_aJzW.js → env-s78xWj4f.js} +1 -1
- package/dist/packem_shared/{failure-log-DiIZhhLI.js → failure-log-BegnAuGN.js} +1 -1
- package/dist/packem_shared/glob-Cyk1H9ZL-DfmRDyDG.js +1 -0
- package/dist/packem_shared/{index-DhxUCW8T.js → index-Dd7nwlNK.js} +1 -1
- package/dist/packem_shared/{index-CBn2VY5B.js → index-Dp8XCka-.js} +1 -1
- package/dist/packem_shared/{lifecycle-GbShWxRp.js → lifecycle-hseoB2PD.js} +1 -1
- package/dist/packem_shared/{manifests-dmM8N980.js → manifests-DOxbsC47.js} +1 -1
- package/dist/packem_shared/{min-release-age-PO0aM3R7.js → min-release-age-CZvwRysw.js} +1 -1
- package/dist/packem_shared/{missing-package-json-BhiqxoDg.js → missing-package-json-CRA6kB_n.js} +1 -1
- package/dist/packem_shared/{multi-eco-lockfiles-BK7QtgHY.js → multi-eco-lockfiles-B8LKE3Z3.js} +1 -1
- package/dist/packem_shared/{native-config-sync-B0GvRp9j.js → native-config-sync-g2U55rGC.js} +1 -1
- package/dist/packem_shared/{osv-J53omdC9.js → osv-CieXV1_R.js} +1 -1
- package/dist/packem_shared/{package-version-C6xroAcI.js → package-version-C9FT1f_V.js} +1 -1
- package/dist/packem_shared/{packument-DZRLzoJA.js → packument-DqZjBn3G.js} +1 -1
- package/dist/packem_shared/{project-name-filter-DHT0wEZm.js → project-name-filter-60HYlbnm.js} +1 -1
- package/dist/packem_shared/{provenance-Cv6Fj_BX.js → provenance-BgNSfq5T.js} +1 -1
- package/dist/packem_shared/publish-missing-BbE62Cqp.js +35 -0
- package/dist/packem_shared/{registry-B5KGXKED.js → registry-BC__sZgy.js} +1 -1
- package/dist/packem_shared/{registry-keys-BXUXfg-B.js → registry-keys-DQttOEKV.js} +1 -1
- package/dist/packem_shared/{renderToString-DR0zDUjh-BY4_eILr.js → renderToString-DR0zDUjh-D2XYc9RB.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-Sfza3_kc.js → resolve-explicit-Bh0I2Eeh.js} +1 -1
- package/dist/packem_shared/{run-summary-utils-CQjbLnkh.js → run-summary-utils-CDfttQa9.js} +1 -1
- package/dist/packem_shared/{runtime-check-BTZdc1k2.js → runtime-check-DF6jeQlZ.js} +1 -1
- package/dist/packem_shared/{s1ngularity-BrjAz--X.js → s1ngularity-Dm0eZv4j.js} +1 -1
- package/dist/packem_shared/{scaffold-files-B77HPWjE.js → scaffold-files-Cwp0HYeD.js} +1 -1
- package/dist/packem_shared/{scan-progress-D5c-HQ_W.js → scan-progress-DpjrzZsZ.js} +1 -1
- package/dist/packem_shared/{selectors-l6BxIFLB.js → selectors-D3cD94dM.js} +1 -1
- package/dist/packem_shared/{signatures-C4MN75Bv.js → signatures-CVJYTORu.js} +1 -1
- package/dist/packem_shared/{spinner-BryD7iJl.js → spinner-Kqk6UZwr.js} +1 -1
- package/dist/packem_shared/{table-BzBEMntH.js → table-BDPKuUgn.js} +1 -1
- package/dist/packem_shared/{tabs-DL_c_u-P.js → tabs-xU0YiQZD.js} +1 -1
- package/dist/packem_shared/{toolchain-CbsBoqgN.js → toolchain-CCm1qaKl.js} +1 -1
- package/dist/packem_shared/{typosquats-DRl1AA90.js → typosquats-C0GLxAf9.js} +1 -1
- package/dist/packem_shared/{use-measured-height-DobMKRXG.js → use-measured-height-DbDsK33L.js} +1 -1
- package/dist/packem_shared/{vis-update-app-CyCv-5iU.js → vis-update-app-Byt2SgRv.js} +1 -1
- package/dist/packem_shared/{vis-user-error-DjdeJsEK.js → vis-user-error-D8_nt9Ay.js} +1 -1
- package/dist/packem_shared/{watch-loop-D2QKvSts.js → watch-loop-BccjAm0o.js} +1 -1
- package/dist/release/index.js +1 -1
- package/index.js +26 -26
- package/package.json +9 -9
- package/dist/packem_shared/apply-release-plan-Cf6TJxK2.js +0 -15
- package/dist/packem_shared/glob-Cyk1H9ZL-CoX0RPCo.js +0 -1
- package/dist/packem_shared/publish-missing-CfwPeX1q.js +0 -35
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as b}from"node:module";import{e as p}from"./index-0dnGN3GP.js";import{a as j}from"./index--eV4qIz5.js";import{h as S,g as U}from"./env-
|
|
1
|
+
import{createRequire as b}from"node:module";import{e as p}from"./index-0dnGN3GP.js";import{a as j}from"./index--eV4qIz5.js";import{h as S,g as U}from"./env-s78xWj4f.js";import{y as E}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as R}from"./package-version-C9FT1f_V.js";let _;const T=t=>(_??=b(import.meta.url))(t),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=t=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[e,s]=d.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return d.getBuiltinModule(t)}return T(t)},{rmSync:u,writeFileSync:C}=k("node:fs"),g=3,F=1800*1e3,A=15e3,v=()=>p(U(),"packuments"),y=t=>p(v(),`${encodeURIComponent(t)}.json`),M=t=>{const e=y(t);if(E(e))try{const s=R(e);if(s.cacheVersion!==g){u(e,{force:!0});return}if(Date.now()-s.createdAt>s.ttlMs){u(e,{force:!0});return}return s.packument}catch{u(e,{force:!0});return}},w=(t,e,s)=>{S(v());const o={cacheVersion:g,createdAt:Date.now(),packument:e,ttlMs:s};C(y(t),JSON.stringify(o),"utf8")},P=t=>{const e={},s=t.versions??{};for(const[a,r]of Object.entries(s)){const i=r.dist,n={version:a};if(r._npmUser!==void 0&&(n._npmUser=r._npmUser),r.maintainers!==void 0&&(n.maintainers=r.maintainers),r.bin!==void 0&&(n.bin=r.bin),i!==void 0){const c={};i.signatures!==void 0&&(c.signatures=i.signatures),i.attestations!==void 0&&(c.attestations=i.attestations),typeof i.integrity=="string"&&(c.integrity=i.integrity),typeof i.tarball=="string"&&(c.tarball=i.tarball),typeof i.unpackedSize=="number"&&Number.isFinite(i.unpackedSize)&&i.unpackedSize>=0&&(c.unpackedSize=i.unpackedSize),typeof i.fileCount=="number"&&Number.isInteger(i.fileCount)&&i.fileCount>=0&&(c.fileCount=i.fileCount),n.dist=c}r.repository!==void 0&&(n.repository=r.repository),r.license!==void 0&&(n.license=r.license),typeof r.readme=="string"&&(n.readme=r.readme),typeof r.readmeFilename=="string"&&(n.readmeFilename=r.readmeFilename),typeof r.private=="boolean"&&(n.private=r.private),typeof r.deprecated=="string"&&(n.deprecated=r.deprecated),r.scripts!==void 0&&typeof r.scripts=="object"&&(n.scripts=r.scripts),e[a]=n}const o={name:typeof t.name=="string"?t.name:"",versions:e};return t["dist-tags"]!==void 0&&(o["dist-tags"]=t["dist-tags"]),t.time!==void 0&&(o.time=t.time),typeof t.readme=="string"&&(o.readme=t.readme),o},D=t=>{const e={Accept:"application/json"};return t!==void 0&&t!==""&&(e.Authorization=`Bearer ${t}`),e},N=async(t,e)=>{if(e.registryUrl!==void 0)return{authToken:e.authToken,url:e.registryUrl};if(e.workspaceRoot!==void 0){const{getRegistryForPackage:s,loadNpmrc:o}=await import("../packem_chunks/catalog.js"),a=o(e.workspaceRoot),{token:r,url:i}=s(t,a);return{authToken:e.authToken??r,url:i}}return{authToken:e.authToken,url:"https://registry.npmjs.org"}},I=async(t,e={})=>{const s=e.cacheTtlMs??F,o=M(t);if(o!==void 0)return o;if(e.offline)return;const a=await N(t,e),i=`${a.url.endsWith("/")?a.url.slice(0,-1):a.url}/${t.replace("/","%2f")}`,n=new AbortController,c=setTimeout(()=>{n.abort()},A),l=()=>{n.abort()};e.signal?.addEventListener("abort",l,{once:!0});try{const f=await fetch(i,{headers:D(a.authToken),signal:n.signal});if(f.status===404)return;if(!f.ok)throw new Error(`Registry returned ${String(f.status)} for ${t}`);const h=await f.json(),m=P(h);return w(t,m,s),m}finally{clearTimeout(c),e.signal?.removeEventListener("abort",l)}},x=(t,e)=>{const s=Object.keys(t.versions);if(s.length===0)return;if(e===void 0||e===""||e==="latest")return t["dist-tags"]?.latest??s.at(-1);const o=t["dist-tags"]?.[e];return o!==void 0?o:Object.hasOwn(t.versions,e)?e:j.maxSatisfying(s,e)??void 0};export{I as g,x as r};
|
package/dist/packem_shared/{project-name-filter-DHT0wEZm.js → project-name-filter-60HYlbnm.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-D8_nt9Ay.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(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"./index--eV4qIz5.js";import{g as u}from"./packument-
|
|
1
|
+
import{a as i}from"./index--eV4qIz5.js";import{g as u}from"./packument-DqZjBn3G.js";import{c as d}from"../packem_chunks/cli-main.js";const v=8,h=async(r,e,o)=>{if(r.length===0)return[];const t=Math.max(1,Math.min(e,r.length)),s=Array.from({length:r.length});let n=0;const c=async()=>{for(;n<r.length;){const a=n;n+=1;const l=r[a];s[a]=await o(l,a)}};return await Promise.all(Array.from({length:t},()=>c())),s},f=(r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,p=(r,e)=>i.valid(e)?Object.keys(r.versions).filter(t=>i.valid(t)!==null&&i.lt(t,e)).filter(t=>i.satisfies(t,"*",{includePrerelease:!1})).filter(t=>f(r,t)).sort((t,s)=>i.lt(t,s)?1:-1)[0]:void 0,m=async(r,e={})=>{if(d("provenance"))return[];const o=new Set(e.allowlist),t=e.concurrency??v;return(await h(r,t,async({name:n,version:c})=>{if(o.has(n))return;const a=await u(n,{workspaceRoot:e.workspaceRoot});if(a===void 0||f(a,c))return;const l=p(a,c);if(l!==void 0)return{packageName:n,priorVersionWithProvenance:l,version:c}})).filter(n=>n!==void 0)};export{v as D,p as f,h as m,m as r};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import{createRequire as U}from"node:module";import{s as G}from"./index--eV4qIz5.js";import{DEFAULT_CHANGES_DIR as O}from"../packem_chunks/DEFAULT_CLEAN_KEEP.js";import{a as Y,f as X}from"../packem_chunks/context.js";import{c as Q,d as Z,D as x}from"../packem_chunks/version-resolver.js";import{createTag as ee,pushTags as se,resolveReleaseSource as ae,renderTagPattern as ie,defaultTagFor as re}from"../packem_chunks/git.js";import{createShellRunner as E}from"../packem_chunks/shell-runner.js";import{r as W,b as te}from"./apply-VwWv8q05.js";import{p as ne}from"../packem_chunks/native-addon.js";import{c as oe}from"../packem_chunks/index3.js";import{escapeMarkdown as ce}from"../packem_chunks/security.js";import{VisReleaseError as M}from"./VisReleaseError-DZtgcKf8.js";let q;const K=e=>(q??=U(import.meta.url))(e),F=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,D=e=>{if(typeof F<"u"&&F.versions&&F.versions.node){const[s,a]=F.versions.node.split(".").map(Number);if(s>22||s===22&&a>=3||s===20&&a>=16)return F.getBuiltinModule(e)}return K(e)},{mkdir:z,writeFile:J}=D("node:fs/promises"),{join:B}=D("node:path"),ge=/\{(name|version|previousVersion|date|repo|contributors)\}/g,le=(e,s)=>e.replaceAll(ge,(a,g)=>s[g]??""),de=(e,s={})=>{const a=new Set;for(const n of s.internalAuthors??[]){const p=n.trim().toLowerCase().replace(/^@/,"");p.length>0&&a.add(p)}const g=new Set,i=[];for(const n of e){const p=n.meta?.author;if(p)for(const o of p.split(",")){const c=o.trim();if(!c)continue;const t=c.replace(/^@/,"");if(t.length===0)continue;const r=t.toLowerCase();g.has(r)||a.has(r)||(g.add(r),i.push(ce(c)))}}return i.length===0?"":i.map(n=>`- ${n}`).join(`
|
|
2
|
+
`)},pe=e=>e.length===0?"":`## Related releases
|
|
3
|
+
|
|
4
|
+
${e.map(a=>`- [${a.name}](${a.url})`).join(`
|
|
5
|
+
`)}`,ue=(e,s,a)=>{if(!s||!s.header&&!s.footer)return e;const g=n=>le(n,{contributors:a.contributors??"",date:a.date,name:a.name,previousVersion:a.previousVersion,repo:a.repo,version:a.version}).replaceAll(/\n{3,}/g,`
|
|
6
|
+
|
|
7
|
+
`).replace(/\s+$/,""),i=[];if(s.header){const n=g(s.header);n.length>0&&i.push(n)}if(i.push(e),s.footer){const n=g(s.footer);n.length>0&&i.push(n)}return i.join(`
|
|
8
|
+
|
|
9
|
+
`)},he=e=>{if(!Array.isArray(e))return;const[s,a]=e;if(s!=="github"||typeof a!="object"||a===null)return;const{internalAuthors:g}=a;if(Array.isArray(g))return g.filter(i=>typeof i=="string")},fe=e=>(e.config.publish?.publishArgs??[]).includes("--provenance")&&e.pm.id!=="bun",me=async(e,s)=>{const{options:a,persistState:g,releases:i,result:n,state:p}=s,{removePendingStages:o,upsertPendingStages:c}=await import("../packem_chunks/staged-registry.js"),t=await e.pm.readCatalogYaml(e.cwd),r=ne(t),l=e.depGraph.topologicalSort(i.map(d=>d.name)),f=new Map(i.map(d=>[d.name,d])),m=new Set,k=new Map;for(const d of e.plan.releases){const y=e.depGraph.getPackage(d.name);y&&k.set(d.name,{...y.manifest,version:d.newVersion})}const P={config:e.config,cwd:e.cwd},R=e.config.plugins?.length?await import("../packem_chunks/defineReleasePlugin.js"):void 0;for(const d of l){const y=f.get(d);if(!y){n.skipped.push({name:d,reason:"topo-sort returned a name not in the release plan (internal bug)"});continue}const b=e.depGraph.getPackage(d);if(!b)continue;const v=[...new Set(e.depGraph.getDependencies(d).filter(h=>h.kind!=="devDependencies"&&m.has(h.name)).map(h=>h.name))];if(v.length>0){n.skipped.push({name:d,reason:`dependency-failed: not published because ${v.join(", ")} failed to publish (publishing would orphan this package's dependency range)`}),m.add(d);continue}const u=e.perPackageConfig.get(d)??{},C=Y(b,u),$=a.publishActionsOverride??oe(C),w=a.tag??e.channel?.tag;if(R){const h=await R.runWillPublishHooks(P,{dir:b.dir,name:d,oldVersion:y.oldVersion,version:y.newVersion});if(h.skip){n.skipped.push({name:d,reason:`plugin-skipped${h.by?` by "${h.by}"`:""}`}),m.add(d);continue}}const T=s.stagedRegistry.pending.find(h=>h.name===d&&h.version===y.newVersion);try{const h=await $.publish({catalogs:r,cleanPackageJsonConfig:e.config.publish?.cleanPackageJson,dryRun:a.dryRun,otp:a.otp,perPackageConfig:u,pkg:b,pm:e.pm,provenance:fe(e),registry:u.registry,release:y,resumeStageId:T?.id,tag:w,versionedManifestByName:k,workspaceConfig:e.config});if(h.published||h.alreadyPublished){const S=s.stagedRegistry.pending.filter(A=>A.name===d&&A.version===y.newVersion).map(A=>A.id);S.length>0&&(s.stagedRegistry=o(s.stagedRegistry,S))}if(h.published)n.published.push({name:d,stageId:h.stageId,tarball:h.tarball,version:y.newVersion}),p.published.push(`${d}@${y.newVersion}`),R&&await R.runAfterPublishHooks(P,{dir:b.dir,name:d,oldVersion:y.oldVersion,version:y.newVersion});else if(h.alreadyPublished)n.skipped.push({name:d,reason:"already-published"}),p.published.push(`${d}@${y.newVersion}`);else if(n.skipped.push({name:d,reason:h.output??"skipped"}),h.stageId){const S=(h.output??"").startsWith("stage-rejected")?"rejected":"timeout";s.stagedRegistry=c(s.stagedRegistry,[{id:h.stageId,name:d,reason:S,stagedAt:new Date().toISOString(),tag:w??"latest",version:y.newVersion}])}await g()}catch(h){n.failed.push({name:d,reason:h.message}),m.add(d)}}R&&await R.runAfterPublishAllHooks(P,{failed:n.failed.map(d=>({name:d.name,reason:d.reason})),published:n.published.map(d=>({name:d.name,version:d.version})),skipped:n.skipped.map(d=>({name:d.name,reason:d.reason}))})},we=async(e,s,a,g)=>{const{createRemoteClient:i,detectRemoteProvider:n}=await import("../packem_chunks/detect.js"),p=await n(e.cwd,a,e.config.provider),o=i(p,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}),c=await o.detectRepoSlug(e.cwd,a);if(!c)return;const t=typeof e.config.aggregateRelease=="object"?e.config.aggregateRelease:{enabled:e.config.aggregateRelease===!0},r=e.config.publish?.draftRelease===!0,l=e.config.publish?.discussionCategory,f=e.config.publish?.addReleases;if(t.enabled){const u=new Date().toISOString().slice(0,10),$=(t.title??"Release {date}").replaceAll("{date}",u),w=`release-${u}`,T=s.published.map(h=>`- \`${h.name}\` → ${h.version}`).join(`
|
|
10
|
+
`);try{const h=await o.createRelease(a,{body:T,cwd:e.cwd,discussionCategory:l,draft:r,repo:c,tag:w,title:$});if(h?.url)for(const S of s.published)S.url=h.url}catch{}return}const{defaultTagFor:m,renderTagPattern:k}=await import("../packem_chunks/git.js"),P=e.config.releaseTagPattern,R=e.channel?.tag,d=e.config.publish?.releaseAssets??{},y=new Date().toISOString().slice(0,10),b=he(e.config.changelog),v=de(e.plan.consumedChangeFiles??[],{internalAuthors:b});for(const u of g.groups){const C=u.members.map($=>`- \`${$}\` → ${s.published.find(w=>w.name===$)?.version??u.version}`).join(`
|
|
11
|
+
`);try{const $=await o.createRelease(a,{body:C,cwd:e.cwd,discussionCategory:l,draft:r,prerelease:u.version.includes("-"),repo:c,tag:u.tag,title:`${u.name} ${u.version}`});if($?.url)for(const w of s.published)u.members.includes(w.name)&&(w.url=$.url)}catch($){console.warn(`createRelease failed for group ${u.name} (tag ${u.tag}): ${$.message}`)}}for(const u of s.published){if(g.grouped.has(u.name))continue;const $=e.perPackageConfig.get(u.name)?.releaseTagPattern??P,w=$?k($,{channel:R,name:u.name,version:u.version}):m(u.name,u.version),T=u.version.includes("-");let h=`Release of ${u.name}@${u.version}.`;if(u.stageId&&(h=`${h}
|
|
12
|
+
|
|
13
|
+
> ⏳ **Staged — not yet installable.** Approve via \`vis release stage approve ${u.stageId}\` or the npmjs.com web UI.`),d.stampHashes&&u.tarball&&(h=`${h}
|
|
14
|
+
|
|
15
|
+
### Tarball integrity
|
|
16
|
+
|
|
17
|
+
- size: \`${u.tarball.size}\` bytes
|
|
18
|
+
- sha256: \`${u.tarball.sha256}\`
|
|
19
|
+
- sha512: \`${u.tarball.sha512}\``),f!==void 0&&f!==!1)try{const j=w.lastIndexOf("@"),H=j>0?w.slice(0,j+1):"",N=await o.listRecentReleases(a,{cwd:e.cwd,excludeTag:w,limit:5,repo:c,tagPrefix:H}),V=pe(N);V&&(h=f==="top"?`${V}
|
|
20
|
+
|
|
21
|
+
${h}`:`${h}
|
|
22
|
+
|
|
23
|
+
${V}`)}catch{}const{releaseNoteTemplate:S}=e.config;if(S){const H=e.plan.releases.find(N=>N.name===u.name)?.oldVersion??"";h=ue(h,S,{contributors:v,date:y,name:u.name,previousVersion:H,repo:c,version:u.version})}const A=[];d.uploadTarball&&u.tarball&&A.push(u.tarball.path);try{const j=await o.createRelease(a,{assets:A.length>0?A:void 0,body:h,cwd:e.cwd,discussionCategory:l,draft:r,prerelease:T,repo:c,tag:w,title:`${u.name} v${u.version}`});j?.url&&(u.url=j.url)}catch(j){console.warn(`createRelease failed for ${u.name}@${u.version} (tag ${w}): ${j.message}`)}}},be=async(e,s,a)=>{const{changesDir:g,options:i,persistState:n,result:p,runner:o,state:c}=s,{writeStagedRegistry:t}=await import("../packem_chunks/staged-registry.js");if(!i.dryRun&&p.published.length>0&&p.tagsPushed){e.config.publish?.noRelease!==!0&&await we(e,p,o,a);try{const{walkSuccessfulRelease:r}=await import("../packem_chunks/success-walk.js"),{createRemoteClient:l,detectRemoteProvider:f}=await import("../packem_chunks/detect.js"),{resolveFormatter:m}=await import("../packem_chunks/resolveFormatter.js"),k=await f(e.cwd,o,e.config.provider),P=l(k,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}),R=await P.detectRepoSlug(e.cwd,o),d=await m(e.config.changelog,e.cwd),{recordRecentlyWalked:y}=await import("../packem_chunks/staged-registry.js"),b=new Set([...c.walked??[],...(s.stagedRegistry.recentlyWalked??[]).map(C=>C.key)]),v={...p,published:p.published.filter(C=>!b.has(`${C.name}@${C.version}`))},u=v.published.length>0?await r(e,v,o,{client:P,formatter:d,repo:R}):void 0;if(u?.ran===!0){const C=v.published.map($=>`${$.name}@${$.version}`);c.walked=[...c.walked??[],...C],await n(),s.stagedRegistry=y(s.stagedRegistry,C),u.warnings.length>0&&e.plan.warnings.push(...u.warnings)}}catch(r){e.plan.warnings.push(`successWalk: could not run post-release walk: ${r.message}`)}if(e.config.notifications)try{const{dispatchNotifications:r}=await import("../packem_chunks/interface.js"),{createRemoteClient:l,detectRemoteProvider:f}=await import("../packem_chunks/detect.js"),m=await f(e.cwd,o,e.config.provider),P=await l(m,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,o);let R;try{const b=`${e.cwd}/package.json`,v=await import("node:fs/promises");R=JSON.parse(await v.readFile(b,"utf8")).name}catch{}const d=new Set([...c.notified??[],...(s.stagedRegistry.recentlyNotified??[]).map(b=>b.key)]),y=p.published.filter(b=>!d.has(`${b.name}@${b.version}`));if(y.length>0){const b=await r(e.config.notifications,{channel:e.channel?.tag,completedAt:new Date().toISOString(),...R===void 0?{}:{monorepoName:R},published:y.map(v=>({name:v.name,tag:e.channel?.tag,...v.url===void 0?{}:{url:v.url},version:v.version})),...P===void 0?{}:{repo:P},skipped:p.skipped.map(v=>({name:v.name,reason:v.reason}))},{warn:v=>e.plan.warnings.push(v)});if(b.succeeded.length>0){const v=y.map(C=>`${C.name}@${C.version}`);c.notified=[...c.notified??[],...v],await n();const{recordRecentlyNotified:u}=await import("../packem_chunks/staged-registry.js");s.stagedRegistry=u(s.stagedRegistry,v)}if(b.failed.length>0||b.succeeded.length>0){const v=b.succeeded.length+b.failed.length;if(b.failed.length>0){e.plan.warnings.push(`[notifications] dispatched ${b.succeeded.length}/${v} channels${b.succeeded.length>0?` (succeeded: ${b.succeeded.join(", ")})`:""}; ${b.failed.length} failed.`);for(const u of b.failed)e.plan.warnings.push(`[notifications:${u.id}] ${u.error}`)}}}}catch(r){e.plan.warnings.push(`notifications: dispatch failed: ${r.message}`)}if(!i.dryRun)try{const r=await t(e.cwd,g,s.stagedRegistry);if(r.changed){const{stageAndCommitFile:l}=await import("../packem_chunks/git.js");try{await l({cwd:e.cwd,runner:o},r.path,"chore(release): record cross-runner notify/walk dedupe [skip ci]",{author:e.config.gitUser,push:!i.noPush&&!i.noBranchPush,sign:e.config.gitSignCommits===!0})}catch(f){process.stderr.write(`[vis release] Warning: could not commit ${r.path} (notify/walk dedupe): ${f.message}
|
|
24
|
+
`)}}}catch(r){process.stderr.write(`[vis release] Warning: could not update cross-runner dedupe registry: ${r.message}
|
|
25
|
+
`)}}},ye=async e=>{const{defaultTagFor:s,floatingMajorTagFor:a,renderTagPattern:g}=await import("../packem_chunks/git.js"),{resolveSyncTagGroups:i}=await import("../packem_chunks/group-tags.js"),n=e.plan.releases.filter(r=>e.depGraph.getPackage(r.name)?.manifest?.private!==!0).map(r=>({name:r.name,version:r.newVersion})),p=i(e.config,n),o=p.groups.map(r=>r.tag),c=[],t=!!e.channel?.prerelease||!!e.preMode;for(const{name:r,version:l}of n){if(p.grouped.has(r))continue;const f=e.perPackageConfig.get(r),m=f?.releaseTagPattern??e.config.releaseTagPattern;if(o.push(m?g(m,{channel:e.channel?.tag,name:r,version:l}):s(r,l)),e.config.floatingMajorTag===!0&&!t&&!m?.includes("{major}")&&f?.skipNpmPublish!==!0){const k=a(r,l);k!==void 0&&c.push(k)}}return{created:o,updated:c}},ve=async(e,s,a)=>{if((await s.run("git",["remote","get-url","--push","origin"],{cwd:e.cwd,silent:!0})).exitCode!==0)return;const{getCurrentBranch:i,resolvePushCredentials:n,verifyPushAccess:p}=await import("../packem_chunks/git.js"),o={cwd:e.cwd,runner:s},c=await p(o);if(c!==void 0)return`Cannot push to origin, nothing was published. Set VIS_GH_TOKEN (or GITHUB_TOKEN / GITLAB_TOKEN) with write access, or pass --no-push. git said: ${c}`;const{createRemoteClient:t,detectRemoteProvider:r}=await import("../packem_chunks/detect.js");let l;try{l=await r(e.cwd,s,e.config.provider)}catch{return}if(l!=="github")return;const m=await t(l,{githubHost:e.config.githubHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,s);if(!m)return;const k=await n(o),P={...process.env};k!==void 0&&(P.GH_TOKEN=k.token),e.config.githubHost&&(P.GH_HOST=e.config.githubHost),e.config.httpProxy&&(P.HTTPS_PROXY=e.config.httpProxy,P.HTTP_PROXY=e.config.httpProxy);const{checkGithubPushRules:R}=await import("../packem_chunks/github-push-rules.js"),d=a.noTag?{created:[],updated:[]}:await ye(e),y=await R(s,{branch:await i(o),createdTags:d.created,cwd:e.cwd,env:P,repo:m,signedCommits:e.config.gitSignCommits===!0,updatedTags:d.updated});for(const b of y.warnings)process.stderr.write(`[vis release] Warning: ${b}
|
|
26
|
+
`);if(y.blocked.length>0)return`GitHub push rules would reject this release, nothing was published:
|
|
27
|
+
- ${y.blocked.join(`
|
|
28
|
+
- `)}
|
|
29
|
+
Grant the pushing token a bypass, adjust the ruleset, or pass --no-push / --no-tag.`},Pe=async(e,s,a,g)=>{if(!a.dryRun&&e.channel?.mode==="version-pr"){const{createRemoteClient:i,detectRemoteProvider:n}=await import("../packem_chunks/detect.js");let p;try{const c=await n(e.cwd,s,e.config.provider);p=await i(c,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,s)}catch(c){return g.failed.push({name:"_preflight",reason:`Could not read the remote to check for an open release PR: ${c.message}`}),!0}const o=e.config.versionPr?.branch??"vis-release/version-packages";if(p)try{const c=await s.run("gh",["pr","list","--head",o,"--state","open","--json","number"],{cwd:e.cwd,silent:!0});if(c.exitCode===0&&c.stdout.trim()&&c.stdout.trim()!=="[]"){const t=JSON.parse(c.stdout);if(t[0])return g.failed.push({name:"_preflight",reason:`Open release PR #${t[0].number} exists. Merge or close it before publishing locally. (Override: --no-push then \`git push --tags\` manually.)`}),!0}}catch{}}if(!a.dryRun&&e.config.prePublishCommand)try{await W(e.cwd,e.config.prePublishCommand,"prePublishCommand")}catch(i){return g.failed.push({name:"_prePublishCommand",reason:i.message}),!0}if(!a.dryRun&&!a.noPush){let i;try{i=await ve(e,s,{noTag:a.noTag===!0})}catch(n){return g.failed.push({name:"_preflight",reason:`Could not verify the release pushes: ${n.message}`}),!0}if(i!==void 0)return g.failed.push({name:"_pushAccess",reason:i}),!0}return!1},ke=async(e,s)=>{const{changesDir:a,options:g,runner:i}=s,{writeStagedRegistry:n}=await import("../packem_chunks/staged-registry.js");if(!g.dryRun){const p=s.priorRegistrySnapshot.pending.length,o=s.stagedRegistry.pending.length,c=await n(e.cwd,a,s.stagedRegistry);if(c.changed){const{stageAndCommitFile:t}=await import("../packem_chunks/git.js");let r;if(c.removed)r="chore(release): clear pending stage registry [skip ci]";else if(o>p){const l=o-p;r=`chore(release): record ${l} new pending stage${l===1?"":"s"} [skip ci]`}else if(o<p){const l=p-o;r=`chore(release): drain ${l} resolved stage${l===1?"":"s"} [skip ci]`}else r=`chore(release): update pending stage registry (${o} pending) [skip ci]`;try{await t({cwd:e.cwd,runner:i},c.path,r,{author:e.config.gitUser,push:!g.noPush&&!g.noBranchPush,sign:e.config.gitSignCommits===!0})}catch(l){process.stderr.write(`[vis release] Warning: could not commit ${c.path}: ${l.message}
|
|
30
|
+
`)}}}},Re=async(e,s)=>{const{options:a,result:g,runner:i}=s;if(!a.dryRun&&g.published.length>0&&e.config.workspaceChangelog!==!1){const n=e.config.workspaceChangelog,p=typeof n=="object"?n:void 0,o=typeof e.config.aggregateRelease=="object"?e.config.aggregateRelease.enabled:e.config.aggregateRelease===!0;if(p!==void 0||o)try{const{writeWorkspaceChangelogWave:c}=await import("../packem_chunks/workspace.js"),t=new Set(g.published.map(f=>f.name)),r=e.plan.releases.filter(f=>t.has(f.name)),l=await c({changelogConfig:e.config.changelog,cwd:e.cwd,workspaceChangelog:e.config.workspaceChangelog},r);if(l)try{const{stageAndCommitFile:f}=await import("../packem_chunks/git.js");await f({cwd:e.cwd,runner:i},l,"chore(release): record wave [skip ci]",{author:e.config.gitUser,push:!a.noPush&&!a.noBranchPush,sign:e.config.gitSignCommits===!0})}catch(f){process.stderr.write(`[vis release] Warning: could not commit workspace CHANGELOG.md: ${f.message}
|
|
31
|
+
`)}}catch(c){process.stderr.write(`[vis release] Warning: could not write workspace CHANGELOG.md wave entry: ${c.message}
|
|
32
|
+
`)}}},I=async(e,s,a,g,i)=>{const{stageAndCommitFile:n}=await import("../packem_chunks/git.js"),{stateFilePath:p}=await import("../packem_chunks/state.js");try{const o=await n({cwd:e.cwd,runner:s},p(e.cwd,a,!0),`chore(release): ${g} publish lock [skip ci]`,{author:e.config.gitUser,push:!i.noPush,sign:e.config.gitSignCommits===!0});!i.noPush&&o.committed&&!o.pushed&&process.stderr.write(`[vis release] Warning: publish lock (${g}) was committed locally but could not be pushed — cross-runner resume may use a stale lock.
|
|
33
|
+
`)}catch(o){process.stderr.write(`[vis release] Warning: could not commit publish lock (${g}): ${o.message}
|
|
34
|
+
`)}},$e=async(e,s,a,g)=>{const{filterPlanByState:i,newState:n,readState:p,writeState:o}=await import("../packem_chunks/state.js"),{readStagedRegistry:c}=await import("../packem_chunks/staged-registry.js"),t=e.config.changesDir??O,r=e.config.publish?.lockInGit===!0;let l=a.resume||r?await p(e.cwd,t,r):void 0;l&&r&&(l.channel=e.channel?.tag);const f=async()=>{a.dryRun||!l||(await o(e.cwd,t,l,r),r&&await I(e,s,t,"progress",{noPush:a.noPush||a.noBranchPush}))};let m=await c(e.cwd,t);await te(e,"publish",m,{runner:s}),m=await c(e.cwd,t);const k={...m,pending:[...m.pending]};let{releases:P}=e.plan;return l?P=i(P,l):(l=n(e.channel?.tag,e.plan.releases),a.dryRun||(await o(e.cwd,t,l,r),r&&await I(e,s,t,"open",{noPush:a.noPush||a.noBranchPush}))),{changesDir:t,lockInGit:r,options:a,persistState:f,priorRegistrySnapshot:k,releases:P,result:g,runner:s,stagedRegistry:m,state:l}},Ce=async(e,s,a)=>{const{changesDir:g,lockInGit:i,options:n,persistState:p,result:o,runner:c,state:t}=s,{clearState:r}=await import("../packem_chunks/state.js");if(!n.dryRun&&!n.noTag&&o.published.length>0){const{createOrUpdateFloatingTag:l,createTag:f,defaultTagFor:m,floatingMajorTagFor:k,pushTags:P,renderTagPattern:R,resolveReleaseSource:d}=await import("../packem_chunks/git.js");let y;try{y=n.defaultTagTarget??(e.config.tagTarget==="source"?await d({cwd:e.cwd,runner:c}):void 0)}catch(w){o.failed.push({name:"_tagTarget",reason:w.message}),await p();return}const b=[],v=e.config.releaseTagPattern,u=e.channel?.tag,C=e.config.floatingMajorTag===!0,$=!!e.channel?.prerelease||!!e.preMode;for(const{name:w,version:T}of o.published){if(a.grouped.has(w))continue;const S=e.perPackageConfig.get(w)?.releaseTagPattern??v,A=S?R(S,{channel:u,name:w,version:T}):m(w,T);try{await f({cwd:e.cwd,runner:c},A,`Release ${w}@${T}`,{signing:e.config.signing,skipRemoteCheck:e.firstRelease,target:n.tagTargets?.get(w)??y}),o.tags.push(A)}catch(_){e.firstRelease&&_ instanceof M&&_.code==="TAG_COLLISION"?o.skipped.push({name:A,reason:"tag-creation: tag already exists (first-release — skipped)"}):o.failed.push({name:A,reason:`tag-creation: ${_.message}`})}const j=e.depGraph.getPackage(w),H=e.perPackageConfig.get(w),N=j?.manifest?.private===!0,V=H?.skipNpmPublish===!0;if(C&&!$&&!S?.includes("{major}")&&!N&&!V){const _=k(w,T);if(_!==void 0)try{await l({cwd:e.cwd,runner:c},_,{push:!1,signing:e.config.signing,target:y}),b.push(`+refs/tags/${_}:refs/tags/${_}`),o.tags.push(_)}catch(L){o.skipped.push({name:_,reason:`floating-major-tag: ${L.message}`})}}}for(const w of a.groups)try{await f({cwd:e.cwd,runner:c},w.tag,`Release ${w.name} ${w.version}`,{signing:e.config.signing,skipRemoteCheck:e.firstRelease,target:y}),o.tags.push(w.tag)}catch(T){e.firstRelease&&T instanceof M&&T.code==="TAG_COLLISION"?o.skipped.push({name:w.tag,reason:"tag-creation: tag already exists (first-release — skipped)"}):o.failed.push({name:w.tag,reason:`tag-creation: ${T.message}`})}if(!n.noPush&&o.tags.length>0)try{await P({cwd:e.cwd,runner:c},{refspecs:b}),o.tagsPushed=!0}catch(w){o.tagsPushed=!1,o.failed.push({name:"_pushTags",reason:`git push --tags failed: ${w.message}. Retry with: git push --tags`})}t.tagged=[...o.tags],t.pushed=o.tagsPushed,await p(),o.failed.length===0&&!n.dryRun&&(await r(e.cwd,g,i),i&&await I(e,c,g,"close",{noPush:n.noPush||n.noBranchPush}))}},Te=async(e,s={})=>{const a={failed:[],published:[],skipped:[],tags:[],tagsPushed:!1},g=E();if(e.plan.releases.length===0||await Pe(e,g,s,a))return a;const i=e.config.changesDir??O,{acquireLock:n,releaseLock:p}=await import("../packem_chunks/state.js");let o=!1;if(!s.dryRun)try{await n(e.cwd,i),o=!0}catch(c){return a.failed.push({name:"_lock",reason:c.message}),a}try{const c=await $e(e,g,s,a);await me(e,c);const{resolveSyncTagGroups:t}=await import("../packem_chunks/group-tags.js"),r=t(e.config,a.published);if(await Ce(e,c,r),await ke(e,c),await Re(e,c),await be(e,c,r),!s.dryRun&&e.config.postPublishCommand)try{await W(e.cwd,e.config.postPublishCommand,"postPublishCommand")}catch(l){a.failed.push({name:"_postPublishCommand",reason:l.message})}return a}finally{o&&await p(e.cwd,i)}},Se=(e,s)=>async(a,g,i)=>{const n=["view",`${a.name}@${g}`,"version"];i&&n.push("--registry",i);const p=await e.run("npm",n,{cwd:s,silent:!0});return p.exitCode===0?p.stdout.trim()!=="":/\bE404\b/.test(`${p.stdout}
|
|
35
|
+
${p.stderr}`)?!1:void 0},Ae=async(e,s,a)=>{const g=await e.run("git",["log","-1","--format=%H%x00%s",String.raw`-G"version"[[:space:]]*:`,"--",a],{cwd:s,silent:!0}),[i,n]=g.stdout.trim().split("\0");return g.exitCode===0&&i?{sha:i,subject:n??""}:void 0},je=async(e,s={})=>{const a=s.runner??E(),g=s.registryProbe??Se(a,e.cwd),i={missing:[],skipped:[],stranded:[]},n=e.config.versionPr?.title??"🚀 Versioned release",p=t=>t.startsWith(n)||x.some(r=>r.test(t)),{default:o}=await import("../packem_chunks/index.js"),c=s.projects??[];for(const t of e.packages){const r=e.perPackageConfig.get(t.name);if(t.ecosystem!==void 0||t.private||r?.skipNpmPublish===!0||!G.valid(t.version)||c.length>0&&!c.some(d=>d===t.name||o(d,t.name)))continue;const l=await Z(t,"git-tag",e.depGraph,{channelPrerelease:e.channelPrerelease,cwd:e.cwd,perPackageConfig:r,pm:e.pm,runner:a,workspaceConfig:e.config});if(l.resolvedFrom!=="git-tag"||!G.gt(t.version,l.version))continue;const f=d=>{i.skipped.push({name:t.name,reason:`${t.version} is untagged but ${d}`})},m=await Ae(a,e.cwd,t.manifestPath);if(!m){f("the commit that set it could not be found");continue}if(!p(m.subject)){f(`it was set by ${m.sha.slice(0,7)} ("${m.subject}"), which is not a release commit`);continue}const k=await g(t,t.version,r?.registry);if(k===void 0){f("the registry could not confirm whether it is published");continue}if((await a.run("git",["diff","--quiet",m.sha,"--",t.dir],{cwd:e.cwd,silent:!0})).exitCode!==0){k?f(`${t.dir} changed since ${m.sha.slice(0,7)} and the registry has it; tag it by hand`):i.stranded.push({name:t.name,previousVersion:l.version,sha:m.sha,version:t.version});continue}let R;try{R=await ae({cwd:e.cwd,runner:a},m.sha)??m.sha}catch(d){f(d.message);continue}i.missing.push({commit:m.sha,name:t.name,onRegistry:k,previousVersion:l.version,target:R,version:t.version})}return i},Ue=async(e,s)=>{const a=B(e.cwd,e.config.changesDir??O),g=[];await z(a,{recursive:!0});for(const i of s){const n=B(a,`stranded-${i.name.replaceAll(/[@/]/g,"-").replace(/^-/,"")}-${i.version}.md`),p=`Release ${i.version}. Commit ${i.sha.slice(0,7)} set this version and it was never published, so it is released from HEAD.`;await J(n,X({bump:"patch",package:i.name,releaseAs:i.version},p)),g.push(n)}return g},_e=(e,s,a)=>{const g=e.perPackageConfig.get(s)?.releaseTagPattern??e.config.releaseTagPattern;return g?ie(g,{channel:e.channel?.tag,name:s,version:a}):re(s,a)},He=(e,s)=>{const a=G.diff(e,s);return a==="major"||a==="premajor"?"major":a==="minor"||a==="preminor"?"minor":"patch"},qe=async(e,s={})=>{const a=E(),g=await je(e,{projects:s.projects,registryProbe:s.registryProbe,runner:a}),i={completed:[],failed:[],missing:g.missing,published:[],skipped:[...g.skipped],tags:[],tagsPushed:!1,warnings:[...e.plan.warnings]};g.missing.length>0&&Q();const n=g.missing.filter(t=>!t.onRegistry),p=g.missing.filter(t=>t.onRegistry);if(n.length>0){const t=n.map(l=>({changeFiles:[],isCascadeBump:!1,isDependencyBump:!1,isGroupBump:!1,name:l.name,newVersion:l.version,oldVersion:l.previousVersion,reasons:[],sources:[],type:He(l.previousVersion,l.version)})),r=await Te({...e,plan:{consumedChangeFiles:[],releases:t,warnings:i.warnings}},{...s,tagTargets:new Map(n.map(l=>[l.name,l.target]))});i.failed.push(...r.failed),i.published.push(...r.published),i.completed.push(...n.filter(l=>r.published.some(f=>f.name===l.name&&f.version===l.version))),i.skipped.push(...r.skipped),i.tags.push(...r.tags),i.tagsPushed=r.tagsPushed}if(p.length===0||s.dryRun||s.noTag)return i;const o=[],c=[];for(const t of p){const r=_e(e,t.name,t.version);try{await ee({cwd:e.cwd,runner:a},r,`Release ${t.name}@${t.version}`,{signing:e.config.signing,target:t.target}),o.push(r),c.push(t),i.skipped.push({name:t.name,reason:`already-published: tagged ${r}`})}catch(l){i.failed.push({name:r,reason:`tag-creation: ${l.message}`})}}if(i.tags.push(...o),o.length>0&&!s.noPush)try{await se({cwd:e.cwd,runner:a}),i.tagsPushed=!0}catch(t){i.tagsPushed=!1,i.failed.push({name:"_pushTags",reason:`git push --tags failed: ${t.message}. Retry with: git push --tags`})}return(s.noPush||i.tagsPushed)&&i.completed.push(...c),i};export{Te as a,je as f,qe as p,Ue as w};
|