@visulima/vis 6.3.0 → 6.4.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 +12 -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/catalog2.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/git.js +8 -5
- 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 +5 -5
- 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/index2.js +3 -3
- 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/status.js +1 -1
- package/dist/packem_chunks/success-walk.js +7 -7
- 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_shared/ReleaseClient-MyutNe6z.js +1 -0
- package/dist/packem_shared/{advisories-DvmoRKco.js → advisories-DTwACNnG.js} +1 -1
- package/dist/packem_shared/{affected-selection-BCYW97-p.js → affected-selection-D_APcBUH.js} +1 -1
- package/dist/packem_shared/{ai-analysis-C7JT_zkS.js → ai-analysis-CXV3P9IN.js} +1 -1
- package/dist/packem_shared/{ai-cache-B-3KMpa9.js → ai-cache-CAwR0t_H.js} +1 -1
- package/dist/packem_shared/{ai-fix-PRDGLhGn.js → ai-fix-CZSdH72D.js} +1 -1
- package/dist/packem_shared/apply-DA-Dv8Pq.js +8 -0
- package/dist/packem_shared/{bin-Bi_j0gXS.js → bin-BUpNU4sc.js} +1 -1
- package/dist/packem_shared/{build-scripts-Bc8dOvdA.js → build-scripts-BedOAAkJ.js} +1 -1
- package/dist/packem_shared/{dependency-scan-YbYZyLNf.js → dependency-scan-CIhI1eyk.js} +1 -1
- package/dist/packem_shared/{detect-clCqXvt_.js → detect-DHj8Ofgf.js} +1 -1
- package/dist/packem_shared/{docker-hegwl1I6.js → docker-aU0BWfDE.js} +1 -1
- package/dist/packem_shared/{ecosystem-gate-C9GmY9oJ.js → ecosystem-gate-B4JHFwgQ.js} +1 -1
- package/dist/packem_shared/{env-DDmZsWBr.js → env-B5goXAfs.js} +1 -1
- package/dist/packem_shared/{env-consistency-Bn8a_NXB.js → env-consistency-C8bLhpjg.js} +1 -1
- package/dist/packem_shared/{failure-log-D-YtsYF3.js → failure-log-CcPGcBQL.js} +1 -1
- package/dist/packem_shared/glob-Cyk1H9ZL-CWIhTwGz.js +1 -0
- package/dist/packem_shared/{index-BRrpyvTT.js → index-D089GoZ9.js} +1 -1
- package/dist/packem_shared/{index-C297jo7X.js → index-D1clv9vM.js} +1 -1
- package/dist/packem_shared/{interface.d-CrHOtJc1.d.ts → interface.d-Bb_1pid9.d.ts} +1 -1
- package/dist/packem_shared/{interface.d-CRqRz4jt.d.ts → interface.d-BlaMrDqd.d.ts} +7 -0
- package/dist/packem_shared/{lifecycle-BBEFEzfq.js → lifecycle-B-0T5Yuq.js} +1 -1
- package/dist/packem_shared/{manifests-Caf3hlIO.js → manifests-D7c5FRMX.js} +1 -1
- package/dist/packem_shared/{min-release-age-BysoCN79.js → min-release-age-D4LRTLUm.js} +1 -1
- package/dist/packem_shared/{missing-package-json-Cvjhtrwa.js → missing-package-json-B9Xir-Vw.js} +1 -1
- package/dist/packem_shared/{multi-eco-lockfiles-g-vAXRj7.js → multi-eco-lockfiles-DT7U-DYp.js} +1 -1
- package/dist/packem_shared/{native-config-sync-Bm9PtGpG.js → native-config-sync-BKbgIItW.js} +1 -1
- package/dist/packem_shared/{osv-9k7R7LU3.js → osv-Bio6kt4F.js} +1 -1
- package/dist/packem_shared/{package-version-CNjr03oy.js → package-version-DSr8JAeI.js} +1 -1
- package/dist/packem_shared/{packument-D_qCUp6X.js → packument-DbQ_r11E.js} +1 -1
- package/dist/packem_shared/{project-name-filter-D7cvTZtS.js → project-name-filter-BcztXZE-.js} +1 -1
- package/dist/packem_shared/{provenance-DSeGe6vU.js → provenance-DMbTd536.js} +1 -1
- package/dist/packem_shared/publish-missing-BCp0_pj1.js +35 -0
- package/dist/packem_shared/publish-report-DOXKGOAj.js +3 -0
- package/dist/packem_shared/{registry-Mb5e6Tf4.js → registry-DSnDqaMj.js} +1 -1
- package/dist/packem_shared/{registry-keys-CQxcAR-Z.js → registry-keys-AfmCDN0t.js} +1 -1
- package/dist/packem_shared/{renderToString-DR0zDUjh-DPXtZSQK.js → renderToString-DR0zDUjh-tkxcyz0F.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-YbCvwu7l.js → resolve-explicit-58Z6lTQV.js} +1 -1
- package/dist/packem_shared/{run-summary-utils-B0K6xaLZ.js → run-summary-utils-DkFMNNG6.js} +1 -1
- package/dist/packem_shared/{runtime-check-DDPs78Zv.js → runtime-check-B7QxGpK0.js} +1 -1
- package/dist/packem_shared/{s1ngularity-CCkRFMDX.js → s1ngularity-Cpp6-qlj.js} +1 -1
- package/dist/packem_shared/{scaffold-files-Xt6zE44I.js → scaffold-files-CHFgRMFa.js} +1 -1
- package/dist/packem_shared/{scan-progress-BbxXKvTV.js → scan-progress-CvsykB5m.js} +1 -1
- package/dist/packem_shared/{selectors-CwKjRLHo.js → selectors-0QAupVtN.js} +1 -1
- package/dist/packem_shared/{signatures-DDD9Iaer.js → signatures-CoEhOr9P.js} +1 -1
- package/dist/packem_shared/{spinner-BItORXCk.js → spinner-qG4qR4qA.js} +1 -1
- package/dist/packem_shared/{table-DsmWzLWy.js → table-2p7PFkBg.js} +1 -1
- package/dist/packem_shared/{tabs-D61j1uvE.js → tabs-DbOgtQo8.js} +1 -1
- package/dist/packem_shared/{toolchain-Z0l12EQs.js → toolchain-COSpTkfG.js} +1 -1
- package/dist/packem_shared/{typosquats-Da4w5sjI.js → typosquats-2YY_t-BX.js} +1 -1
- package/dist/packem_shared/{use-measured-height-UU40gqT7.js → use-measured-height-BHsk7UvV.js} +1 -1
- package/dist/packem_shared/{vis-update-app-Bin63opa.js → vis-update-app-BtSSrY1T.js} +1 -1
- package/dist/packem_shared/{vis-user-error-wkTUvlyX.js → vis-user-error-BrIWyJ2j.js} +1 -1
- package/dist/packem_shared/{watch-loop-CGBVtTBl.js → watch-loop-ipSruNM2.js} +1 -1
- package/dist/release/core/changelog/index.d.ts +1 -1
- package/dist/release/core/package-managers/index.d.ts +2 -2
- package/dist/release/core/version-actions/index.d.ts +3 -3
- package/dist/release/index.d.ts +2 -0
- package/dist/release/index.js +1 -1
- package/dist/release/plugin-sdk.d.ts +3 -3
- package/dist/release/types.d.ts +31 -0
- package/index.js +26 -26
- package/package.json +9 -9
- package/schemas/vis-config.schema.json +16 -0
- package/schemas/vis-release-config.schema.json +16 -0
- package/dist/packem_shared/ReleaseClient-DXlaCQuQ.js +0 -1
- package/dist/packem_shared/apply-DBU-Gu24.js +0 -6
- package/dist/packem_shared/glob-Cyk1H9ZL-BjuiUjNv.js +0 -1
- package/dist/packem_shared/publish-missing-DwaM7zcX.js +0 -35
|
@@ -4538,6 +4538,10 @@
|
|
|
4538
4538
|
"$ref": "#/$defs/PublishConfig",
|
|
4539
4539
|
"description": "Publish-related config."
|
|
4540
4540
|
},
|
|
4541
|
+
"pushRetries": {
|
|
4542
|
+
"type": "number",
|
|
4543
|
+
"description": "How many times `vis release ci release` (auto-publish) rebases its version commit onto the release branch and pushes again when the branch moved during the run. Requires `tagTarget: \"source\"`: rebasing puts the commits that moved the branch below the release commit, where tags on that commit would hide them from the next release.\n\nDefault: `3` with `tagTarget: \"source\"`, otherwise no retry."
|
|
4544
|
+
},
|
|
4541
4545
|
"python": {
|
|
4542
4546
|
"type": "object",
|
|
4543
4547
|
"properties": {
|
|
@@ -4604,10 +4608,22 @@
|
|
|
4604
4608
|
"additionalProperties": false,
|
|
4605
4609
|
"description": "Swift packages as release packages. Off by default. Every directory under the root with a `Package.swift` is a release package named by its `Package(name: \"…\")` literal. The version comes from Git tags, and the release creates the tag."
|
|
4606
4610
|
},
|
|
4611
|
+
"tagTarget": {
|
|
4612
|
+
"type": "string",
|
|
4613
|
+
"enum": [
|
|
4614
|
+
"release-commit",
|
|
4615
|
+
"source"
|
|
4616
|
+
],
|
|
4617
|
+
"description": "Which commit the release tags point at.\n\n- `\"release-commit\"` (default): the version commit the release creates.\n- `\"source\"`: the commit the release was planned from, already on the branch. The version commit records it in a `Release-Source:` trailer, so it survives the rebase `vis release ci release` does when the branch moved during the run (see `pushRetries`): commits landing mid-run stay in the next release's range. A tag's tree then still holds the previous manifest versions."
|
|
4618
|
+
},
|
|
4607
4619
|
"updateInternalDependencies": {
|
|
4608
4620
|
"$ref": "#/$defs/UpdateInternalDependenciesMode",
|
|
4609
4621
|
"description": "Dep-propagation mode. Default: `\"out-of-range\"`."
|
|
4610
4622
|
},
|
|
4623
|
+
"verifyLockfile": {
|
|
4624
|
+
"type": "boolean",
|
|
4625
|
+
"description": "After the version step regenerates the lockfile, check that a frozen install accepts it (`pnpm install --frozen-lockfile --lockfile-only`) and fail the release, before anything is committed or published, when it does not. pnpm only: `true` with another package manager is an error.\n\nDefault: on for pnpm."
|
|
4626
|
+
},
|
|
4611
4627
|
"versionPr": {
|
|
4612
4628
|
"$ref": "#/$defs/VersionPrConfig",
|
|
4613
4629
|
"description": "Version-PR config."
|
|
@@ -392,6 +392,10 @@
|
|
|
392
392
|
"$ref": "#/$defs/PublishConfig",
|
|
393
393
|
"description": "Publish-related config."
|
|
394
394
|
},
|
|
395
|
+
"pushRetries": {
|
|
396
|
+
"type": "number",
|
|
397
|
+
"description": "How many times `vis release ci release` (auto-publish) rebases its version commit onto the release branch and pushes again when the branch moved during the run. Requires `tagTarget: \"source\"`: rebasing puts the commits that moved the branch below the release commit, where tags on that commit would hide them from the next release.\n\nDefault: `3` with `tagTarget: \"source\"`, otherwise no retry."
|
|
398
|
+
},
|
|
395
399
|
"python": {
|
|
396
400
|
"type": "object",
|
|
397
401
|
"properties": {
|
|
@@ -458,10 +462,22 @@
|
|
|
458
462
|
"additionalProperties": false,
|
|
459
463
|
"description": "Swift packages as release packages. Off by default. Every directory under the root with a `Package.swift` is a release package named by its `Package(name: \"…\")` literal. The version comes from Git tags, and the release creates the tag."
|
|
460
464
|
},
|
|
465
|
+
"tagTarget": {
|
|
466
|
+
"type": "string",
|
|
467
|
+
"enum": [
|
|
468
|
+
"release-commit",
|
|
469
|
+
"source"
|
|
470
|
+
],
|
|
471
|
+
"description": "Which commit the release tags point at.\n\n- `\"release-commit\"` (default): the version commit the release creates.\n- `\"source\"`: the commit the release was planned from, already on the branch. The version commit records it in a `Release-Source:` trailer, so it survives the rebase `vis release ci release` does when the branch moved during the run (see `pushRetries`): commits landing mid-run stay in the next release's range. A tag's tree then still holds the previous manifest versions."
|
|
472
|
+
},
|
|
461
473
|
"updateInternalDependencies": {
|
|
462
474
|
"$ref": "#/$defs/UpdateInternalDependenciesMode",
|
|
463
475
|
"description": "Dep-propagation mode. Default: `\"out-of-range\"`."
|
|
464
476
|
},
|
|
477
|
+
"verifyLockfile": {
|
|
478
|
+
"type": "boolean",
|
|
479
|
+
"description": "After the version step regenerates the lockfile, check that a frozen install accepts it (`pnpm install --frozen-lockfile --lockfile-only`) and fail the release, before anything is committed or published, when it does not. pnpm only: `true` with another package manager is an error.\n\nDefault: on for pnpm."
|
|
480
|
+
},
|
|
465
481
|
"versionPr": {
|
|
466
482
|
"$ref": "#/$defs/VersionPrConfig",
|
|
467
483
|
"description": "Version-PR config."
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{VisReleaseError as m}from"./VisReleaseError-DZtgcKf8.js";import{b as c}from"../packem_chunks/context.js";import{p as f,a as w}from"./publish-missing-DwaM7zcX.js";import{a as u}from"./apply-DBU-Gu24.js";const b=async(a={})=>{const e=await c(a),t=await u(e,{dryRun:a.dryRun});return{changedFiles:t.changedFiles,deletedFiles:t.deletedFiles,plan:t.plan}},F=async(a={})=>{const e=await c(a),{resolveFormatter:t}=await import("../packem_chunks/resolveFormatter.js"),s=await t(e.config.changelog,e.cwd),r=new Date().toISOString().slice(0,10),n=[];for(const l of e.plan.releases){const o=e.depGraph.getPackage(l.name);if(!o)continue;const d=await s({changeFiles:l.changeFiles,date:r,release:l,target:"changelog"});n.push({content:d,file:`${o.dir}/CHANGELOG.md`,package:l.name})}return{projectChangelogs:n}},R=async(a={})=>{const e=await c(a),t={dryRun:a.dryRun,otp:a.otp,tag:a.tag};return a.missing?await f(e,{...t,projects:a.projects}):await w(e,t)},k=async(a={})=>{const e=await c(a);let t=!1,s;const r=async()=>{if(s)return s;t=!0;const n=await u(e,{dryRun:a.dryRun});return s={changedFiles:n.changedFiles,deletedFiles:n.deletedFiles,plan:n.plan},s};return{apply:r,discard:()=>{t=!0},plan:e.plan,[Symbol.asyncDispose]:async()=>{t||await r()}}},x=async a=>{const e=await c(a),{runSnapshot:t}=await import("../packem_chunks/snapshot.js"),s=await t({context:e,dryRun:a.dryRun,registry:a.registry,tag:a.tag});return{failed:s.failed,published:s.published,skipped:s.skipped,snapshotVersion:s.snapshotVersion,tag:s.tag}},P=async(a={})=>{const e=a.publishMissing&&!a.skipPublish?await f(await c(a),{dryRun:a.dryRun,projects:a.projects}):void 0;if(e&&e.failed.length>0)throw new m({code:"PUBLISH_FAILED",message:`Recovering unpublished versions failed, nothing new was versioned: ${e.failed.map(i=>`${i.name}: ${i.reason}`).join("; ")}`});const t=await c(a),s=await u(t,{dryRun:a.dryRun}),r={changedFiles:s.changedFiles,deletedFiles:s.deletedFiles,plan:s.plan},{resolveFormatter:n}=await import("../packem_chunks/resolveFormatter.js"),l=await n(t.config.changelog,t.cwd),o=new Date().toISOString().slice(0,10),d=[];for(const i of s.plan.releases){const h=t.depGraph.getPackage(i.name);if(!h)continue;const y=await l({changeFiles:i.changeFiles,date:o,release:i,target:"changelog"});d.push({content:y,file:`${h.dir}/CHANGELOG.md`,package:i.name})}const p={projectChangelogs:d};if(a.skipPublish)return{changelog:p,publish:{failed:[],published:[],skipped:[]},version:r};const g=await w(t,{dryRun:a.dryRun,otp:void 0,tag:void 0});return e&&(g.published.unshift(...e.published),g.skipped.unshift(...e.skipped)),{changelog:p,publish:g,version:r}};class D{constructor(e={}){this.config=e}config;releaseVersion(e={}){return b({...e,config:this.config})}releaseChangelog(e={}){return F({...e,config:this.config})}releasePublish(e={}){return R({...e,config:this.config})}releaseDraft(e={}){return k({...e,config:this.config})}releaseSnapshot(e){return x({...e,config:this.config})}}export{D as ReleaseClient,P as release,F as releaseChangelog,k as releaseDraft,R as releasePublish,x as releaseSnapshot,b as releaseVersion};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{createRequire as j}from"node:module";import{DEFAULT_CHANGES_DIR as M}from"../packem_chunks/DEFAULT_CLEAN_KEEP.js";import{VisReleaseError as D}from"./VisReleaseError-DZtgcKf8.js";import{a as G}from"./apply-release-plan-BZ_E8GXQ.js";import{createShellRunner as C}from"../packem_chunks/shell-runner.js";import{R as N}from"../packem_chunks/context.js";let S;const _=e=>(S??=j(import.meta.url))(e),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$=e=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[i,t]=P.versions.node.split(".").map(Number);if(i>22||i===22&&t>=3||i===20&&t>=16)return P.getBuiltinModule(e)}return _(e)},{writeFile:b,unlink:E}=$("node:fs/promises"),{resolve:A}=$("node:path"),T=e=>{const i=e.channel?.tag??e.branch??"main",{releases:t}=e.plan,d=t.length<=3?t.map(r=>`${r.name}@${r.newVersion}`).join(", "):`version ${t.length} packages`,m=t.map(r=>`- ${r.name}: ${r.oldVersion} → ${r.newVersion}`).join(`
|
|
2
|
-
`);return`release(${i}): ${d} [skip ci]
|
|
3
|
-
|
|
4
|
-
${m}`},H=async(e,i,t)=>{const d=await import("node:fs/promises"),{stageAndCommit:m}=await import("../packem_chunks/git.js"),r=C(),w=["pnpm-lock.yaml","package-lock.json","yarn.lock","bun.lock","bun.lockb"],l=await import("node:path"),o=[];for(const a of w)try{await d.access(l.join(e.cwd,a)),o.push(l.join(e.cwd,a))}catch{}const f=e.config.aggregateRelease===!0||typeof e.config.aggregateRelease=="object"&&e.config.aggregateRelease.enabled;let s;if(e.config.oneCommitPerPackage===!0&&!f&&e.plan.releases.length>0){const a=e.channel?.tag??e.branch??"main",n=i.writes.map(h=>h.path),g=new Set,{releases:c}=e.plan;for(let h=0;h<c.length;h+=1){const p=c[h],k=e.depGraph.getPackage(p.name),u=k?`${k.dir}${l.sep}`:void 0,y=u?n.filter(v=>v.startsWith(u)):[];for(const v of y)g.add(v);const V=h===c.length-1?[...n.filter(v=>!g.has(v)),...i.deletions,...o]:[],F=[...y,...V];F.length!==0&&(s=await m({cwd:e.cwd,runner:r},F,`release(${a}): ${p.name}@${p.newVersion} [skip ci]`,{author:e.config.gitUser}))}}else{const a=t??T(e),n=[...i.writes.map(g=>g.path),...i.deletions,...o];s=await m({cwd:e.cwd,runner:r},n,a,{author:e.config.gitUser})}return s},I=async(e,i)=>{const t=[],{applyExtraFilesForRelease:d}=await import("../packem_chunks/extra-files.js"),{applyVersionFilesForRelease:m}=await import("../packem_chunks/cargo-lock.js").then(a=>a.v),{cargoManifestPaths:r}=await import("../packem_chunks/cargo-lock.js").then(a=>a.g),w=await Promise.all(e.plan.releases.map(async a=>{const n=e.depGraph.getPackage(a.name);if(!n)return{warnings:[],writes:[]};const g=e.perPackageConfig.get(a.name)?.extraFiles??[],c=e.config.publish?.extraFiles??[],h=e.perPackageConfig.get(a.name)?.versionFiles??[],k=g.length>0||c.length>0?await d(e.cwd,n.dir,a.newVersion,a.name,c,g):{warnings:[],writes:[]},u=h.length>0?await m(n.dir,h,a.newVersion,a.name,new Map(k.writes.map(y=>[y.path,y.content]))):{writes:[]};return{warnings:k.warnings,writes:[...k.writes,...u.writes]}})),l=new Map,o=new Set;for(const a of w){for(const n of a.writes)l.set(n.path,n.content),o.add(n.path);t.push(...a.warnings)}const f=e.packages.filter(a=>a.ecosystem==="cargo"),s=e.plan.releases.flatMap(a=>{const n=e.depGraph.getPackage(a.name);if(!n||n.ecosystem!==void 0&&n.ecosystem!=="cargo")return[];const g=n.ecosystem==="cargo"?[n.manifestPath]:r(n.dir,e.perPackageConfig.get(a.name)??{});return g.length>0||n.ecosystem==="cargo"?[{ecosystem:n.ecosystem,manifestPaths:g,name:a.name,newVersion:a.newVersion}]:[]});if(s.length>0){const a=new Set(f.map(c=>c.manifestPath));f.length>0&&a.add(A(e.cwd,"Cargo.toml"));for(const c of e.packages)if(c.ecosystem===void 0)for(const h of r(c.dir,e.perPackageConfig.get(c.name)??{}))a.add(h);const{planCargoWorkspace:n}=await import("../packem_chunks/cargo-plan.js"),g=await n({crateManifests:f.map(c=>c.manifestPath),cwd:e.cwd,pending:l,releases:s,rewriteDependents:e.config.cargo?.discover===!0,scanManifests:[...a]});for(const c of g.touched)o.add(c);t.push(...g.warnings)}for(const a of N){const n=e.plan.releases.flatMap(c=>e.depGraph.getPackage(c.name)?.ecosystem===a.id?[{name:c.name,newVersion:c.newVersion}]:[]);if(n.length===0||a.plan===void 0)continue;const g=await a.plan({context:e,pending:l,projects:e.projectsByEcosystem?.get(a.id)??[],releases:n});for(const c of g.touched)o.add(c);t.push(...g.warnings)}for(const a of o)i.writes.push({content:l.get(a),path:a});t.length>0&&e.plan.warnings.push(...t)},q=async(e,i)=>{if(e.length===0)return;const{join:t}=await import("node:path");let d;try{const{createRequire:r}=await import("node:module"),{pathToFileURL:w}=await import("node:url"),l=r(t(i,"package.json"));d=await import(w(l.resolve("prettier")).href)}catch{return}const m=await import("node:fs/promises");for(const r of e)try{const w=await d.getFileInfo(r);if(w.ignored||!w.inferredParser)continue;const l=await m.readFile(r,"utf8"),o=await d.resolveConfig(r),f=await d.format(l,{...o,filepath:r});f!==l&&await m.writeFile(r,f)}catch{}},R=async(e,i,t)=>{if(!i||i.trim()==="")return;const d=C(),m=process.platform==="win32",r=m?"cmd":"sh",w=m?["/c",i]:["-c",i],l=await d.run(r,w,{cwd:e,silent:!1});if(l.exitCode!==0)throw new Error(`${t} failed (exit ${l.exitCode}): ${i}`)},L=async(e,i)=>{const{normaliseGroup:t}=await import("../release/types.js"),d=[...e.config.fixed??[],...e.config.linked??[]].map(r=>t(r)),{default:m}=await import("../packem_chunks/index.js");for(const[r,w]of Object.entries(i)){const l=Number.parseInt(r.replace(/^group-/,""),10),o=d[l];!o||!e.plan.releases.some(s=>o.packages.some(a=>s.name===a||m(a,s.name)))||await R(e.cwd,w,`groupPreVersionCommand[${r}]`)}},O=async(e,i,t,d={})=>{const{findConflictingPendingStages:m,readStagedRegistry:r,removePendingStages:w,writeStagedRegistry:l}=await import("../packem_chunks/staged-registry.js"),o=e.config.changesDir??M;let f=t??await r(e.cwd,o);if(f.pending.length===0)return;const s=new Map(e.plan.releases.map(p=>[p.name,p.newVersion])),a=[...s.keys()];let n=m(f,a).filter(p=>s.get(p.name)!==p.version);if(n.length===0)return;let g=[];if(!d.skipSelfHeal){const p=d.runner??C();g=(await Promise.all(n.map(async u=>{const y=await p.run("npm",["view",`${u.name}@${u.version}`,"dist.tarball","--silent"],{cwd:e.cwd,silent:!0});return y.exitCode===0&&y.stdout.trim().length>0?u.id:void 0}))).filter(u=>u!==void 0)}if(g.length>0){if(f=w(f,g),d.persistSelfHeal!==!1)try{await l(e.cwd,o,f)}catch{}if(n=m(f,a).filter(p=>s.get(p.name)!==p.version),n.length===0)return}const c=n.map(p=>` • ${p.name}@${p.version} — stage ${p.id} (${p.reason}, recorded ${p.stagedAt})`).join(`
|
|
5
|
-
`),h=i==="version"?"version":"publish";throw new D({code:"STAGE_PENDING",hint:"Resolve via `vis release stage approve <id>` / `--all` or `vis release stage reject <id>`, commit the updated staged.json, then retry.",message:`Refusing to ${h} — ${n.length} package(s) have a pending stage from a prior wave:
|
|
6
|
-
${c}`})},Q=async(e,i={})=>{if(e.plan.releases.length===0)return{changedFiles:[],deletedFiles:[],plan:e.plan};await O(e,"version",void 0,{persistSelfHeal:!1}),!i.dryRun&&e.config.preVersionCommand&&await R(e.cwd,e.config.preVersionCommand,"preVersionCommand"),!i.dryRun&&e.config.groupPreVersionCommands&&await L(e,e.config.groupPreVersionCommands);const{readFileSync:t}=await import("node:fs"),{resolveFormatter:d}=await import("../packem_chunks/resolveFormatter.js"),{resolveGroupChangelogRouting:m}=await import("../packem_chunks/workspace.js"),r=await d(e.config.changelog,e.cwd),w=new Date().toISOString().slice(0,10),l=m(e.config,e.packages,e.cwd),o=await G(e.plan,e.depGraph,{changelogPath:s=>l.get(s.name)??`${s.dir}/CHANGELOG.md`,internalDependencyRanges:e.config.internalDependencyRanges,readChangelog:s=>{try{return t(s,"utf8")}catch{return}},readManifest:s=>{try{return t(s,"utf8")}catch{return}},renderChangelogEntry:s=>r({changeFiles:s.changeFiles,date:w,release:s,target:"changelog"})});if(await I(e,o),i.dryRun)return{changedFiles:o.writes.map(s=>s.path),deletedFiles:o.deletions,plan:e.plan};await Promise.all([...o.writes.map(s=>b(s.path,s.content)),...o.deletions.map(async s=>{try{await E(s)}catch{}})]);try{await e.pm.installLockfileOnly({cwd:e.cwd,silent:!0})}catch{}if(!i.dryRun&&e.config.formatChangedFiles&&await q(o.writes.map(s=>s.path),e.cwd),e.config.plugins?.length){const{runApplyDraftHooks:s}=await import("../packem_chunks/defineReleasePlugin.js");await s({config:e.config,cwd:e.cwd},e.plan)}const f=i.commit?await H(e,o,i.commitMessage):void 0;if(!i.dryRun&&e.config.postVersionCommand&&await R(e.cwd,e.config.postVersionCommand,"postVersionCommand"),!i.dryRun&&e.preMode?.mode==="exit-pending"){const{deletePreMode:s,preModeFilePath:a}=await import("../packem_chunks/pre-mode.js"),n=e.config.changesDir??".vis/release";await s(e.cwd,n)&&e.plan.warnings.push(`Pre-mode exited: \`${a(e.cwd,n)}\` was deleted. Commit the deletion so the registry stays consistent across CI runs.`)}return{changedFiles:o.writes.map(s=>s.path),commitSha:f,deletedFiles:o.deletions,plan:e.plan}};export{Q as a,O as b,R as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as t}from"./registry-Mb5e6Tf4.js";const s=async(a,o)=>await t(a,o);export{s as l};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import{s as G}from"./index--eV4qIz5.js";import{c as M,d as D,D as W}from"../packem_chunks/version-resolver.js";import{createTag as L,pushTags as B,renderTagPattern as U,defaultTagFor as K}from"../packem_chunks/git.js";import{createShellRunner as O}from"../packem_chunks/shell-runner.js";import{DEFAULT_CHANGES_DIR as _}from"../packem_chunks/DEFAULT_CLEAN_KEEP.js";import{r as E,b as z}from"./apply-DBU-Gu24.js";import{parseCatalogs as J}from"../packem_chunks/catalog.js";import{c as Y}from"../packem_chunks/index3.js";import{a as q}from"../packem_chunks/context.js";import{escapeMarkdown as X}from"../packem_chunks/security.js";import{VisReleaseError as F}from"./VisReleaseError-DZtgcKf8.js";const Q=/\{(name|version|previousVersion|date|repo|contributors)\}/g,Z=(e,s)=>e.replaceAll(Q,(a,l)=>s[l]??""),x=(e,s={})=>{const a=new Set;for(const g of s.internalAuthors??[]){const d=g.trim().toLowerCase().replace(/^@/,"");d.length>0&&a.add(d)}const l=new Set,n=[];for(const g of e){const d=g.meta?.author;if(d)for(const o of d.split(",")){const i=o.trim();if(!i)continue;const c=i.replace(/^@/,"");if(c.length===0)continue;const r=c.toLowerCase();l.has(r)||a.has(r)||(l.add(r),n.push(X(i)))}}return n.length===0?"":n.map(g=>`- ${g}`).join(`
|
|
2
|
-
`)},ee=e=>e.length===0?"":`## Related releases
|
|
3
|
-
|
|
4
|
-
${e.map(a=>`- [${a.name}](${a.url})`).join(`
|
|
5
|
-
`)}`,se=(e,s,a)=>{if(!s||!s.header&&!s.footer)return e;const l=g=>Z(g,{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+$/,""),n=[];if(s.header){const g=l(s.header);g.length>0&&n.push(g)}if(n.push(e),s.footer){const g=l(s.footer);g.length>0&&n.push(g)}return n.join(`
|
|
8
|
-
|
|
9
|
-
`)},ae=e=>{if(!Array.isArray(e))return;const[s,a]=e;if(s!=="github"||typeof a!="object"||a===null)return;const{internalAuthors:l}=a;if(Array.isArray(l))return l.filter(n=>typeof n=="string")},ie=e=>(e.config.publish?.publishArgs??[]).includes("--provenance")&&e.pm.id!=="bun",re=async(e,s)=>{const{options:a,persistState:l,releases:n,result:g,state:d}=s,{removePendingStages:o,upsertPendingStages:i}=await import("../packem_chunks/staged-registry.js"),c=await e.pm.readCatalogYaml(e.cwd),r=J(c),u=e.depGraph.topologicalSort(n.map(p=>p.name)),f=new Map(n.map(p=>[p.name,p])),m=new Set,$=new Map;for(const p of e.plan.releases){const b=e.depGraph.getPackage(p.name);b&&$.set(p.name,{...b.manifest,version:p.newVersion})}const v={config:e.config,cwd:e.cwd},P=e.config.plugins?.length?await import("../packem_chunks/defineReleasePlugin.js"):void 0;for(const p of u){const b=f.get(p);if(!b){g.skipped.push({name:p,reason:"topo-sort returned a name not in the release plan (internal bug)"});continue}const w=e.depGraph.getPackage(p);if(!w)continue;const y=[...new Set(e.depGraph.getDependencies(p).filter(h=>h.kind!=="devDependencies"&&m.has(h.name)).map(h=>h.name))];if(y.length>0){g.skipped.push({name:p,reason:`dependency-failed: not published because ${y.join(", ")} failed to publish (publishing would orphan this package's dependency range)`}),m.add(p);continue}const t=e.perPackageConfig.get(p)??{},k=q(w,t),C=a.publishActionsOverride??Y(k),R=a.tag??e.channel?.tag;if(P){const h=await P.runWillPublishHooks(v,{dir:w.dir,name:p,oldVersion:b.oldVersion,version:b.newVersion});if(h.skip){g.skipped.push({name:p,reason:`plugin-skipped${h.by?` by "${h.by}"`:""}`}),m.add(p);continue}}const A=s.stagedRegistry.pending.find(h=>h.name===p&&h.version===b.newVersion);try{const h=await C.publish({catalogs:r,cleanPackageJsonConfig:e.config.publish?.cleanPackageJson,dryRun:a.dryRun,otp:a.otp,perPackageConfig:t,pkg:w,pm:e.pm,provenance:ie(e),registry:t.registry,release:b,resumeStageId:A?.id,tag:R,versionedManifestByName:$,workspaceConfig:e.config});if(h.published||h.alreadyPublished){const S=s.stagedRegistry.pending.filter(H=>H.name===p&&H.version===b.newVersion).map(H=>H.id);S.length>0&&(s.stagedRegistry=o(s.stagedRegistry,S))}if(h.published)g.published.push({name:p,stageId:h.stageId,tarball:h.tarball,version:b.newVersion}),d.published.push(`${p}@${b.newVersion}`),P&&await P.runAfterPublishHooks(v,{dir:w.dir,name:p,oldVersion:b.oldVersion,version:b.newVersion});else if(h.alreadyPublished)g.skipped.push({name:p,reason:"already-published"}),d.published.push(`${p}@${b.newVersion}`);else if(g.skipped.push({name:p,reason:h.output??"skipped"}),h.stageId){const S=(h.output??"").startsWith("stage-rejected")?"rejected":"timeout";s.stagedRegistry=i(s.stagedRegistry,[{id:h.stageId,name:p,reason:S,stagedAt:new Date().toISOString(),tag:R??"latest",version:b.newVersion}])}await l()}catch(h){g.failed.push({name:p,reason:h.message}),m.add(p)}}P&&await P.runAfterPublishAllHooks(v,{failed:g.failed.map(p=>({name:p.name,reason:p.reason})),published:g.published.map(p=>({name:p.name,version:p.version})),skipped:g.skipped.map(p=>({name:p.name,reason:p.reason}))})},te=async(e,s,a,l)=>{const{createRemoteClient:n,detectRemoteProvider:g}=await import("../packem_chunks/detect.js"),d=await g(e.cwd,a,e.config.provider),o=n(d,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}),i=await o.detectRepoSlug(e.cwd,a);if(!i)return;const c=typeof e.config.aggregateRelease=="object"?e.config.aggregateRelease:{enabled:e.config.aggregateRelease===!0},r=e.config.publish?.draftRelease===!0,u=e.config.publish?.discussionCategory,f=e.config.publish?.addReleases;if(c.enabled){const t=new Date().toISOString().slice(0,10),C=(c.title??"Release {date}").replaceAll("{date}",t),R=`release-${t}`,A=s.published.map(h=>`- \`${h.name}\` → ${h.version}`).join(`
|
|
10
|
-
`);try{const h=await o.createRelease(a,{body:A,cwd:e.cwd,discussionCategory:u,draft:r,repo:i,tag:R,title:C});if(h?.url)for(const S of s.published)S.url=h.url}catch{}return}const{defaultTagFor:m,renderTagPattern:$}=await import("../packem_chunks/git.js"),v=e.config.releaseTagPattern,P=e.channel?.tag,p=e.config.publish?.releaseAssets??{},b=new Date().toISOString().slice(0,10),w=ae(e.config.changelog),y=x(e.plan.consumedChangeFiles??[],{internalAuthors:w});for(const t of l.groups){const k=t.members.map(C=>`- \`${C}\` → ${s.published.find(R=>R.name===C)?.version??t.version}`).join(`
|
|
11
|
-
`);try{const C=await o.createRelease(a,{body:k,cwd:e.cwd,discussionCategory:u,draft:r,prerelease:t.version.includes("-"),repo:i,tag:t.tag,title:`${t.name} ${t.version}`});if(C?.url)for(const R of s.published)t.members.includes(R.name)&&(R.url=C.url)}catch(C){console.warn(`createRelease failed for group ${t.name} (tag ${t.tag}): ${C.message}`)}}for(const t of s.published){if(l.grouped.has(t.name))continue;const C=e.perPackageConfig.get(t.name)?.releaseTagPattern??v,R=C?$(C,{channel:P,name:t.name,version:t.version}):m(t.name,t.version),A=t.version.includes("-");let h=`Release of ${t.name}@${t.version}.`;if(t.stageId&&(h=`${h}
|
|
12
|
-
|
|
13
|
-
> ⏳ **Staged — not yet installable.** Approve via \`vis release stage approve ${t.stageId}\` or the npmjs.com web UI.`),p.stampHashes&&t.tarball&&(h=`${h}
|
|
14
|
-
|
|
15
|
-
### Tarball integrity
|
|
16
|
-
|
|
17
|
-
- size: \`${t.tarball.size}\` bytes
|
|
18
|
-
- sha256: \`${t.tarball.sha256}\`
|
|
19
|
-
- sha512: \`${t.tarball.sha512}\``),f!==void 0&&f!==!1)try{const j=R.lastIndexOf("@"),T=j>0?R.slice(0,j+1):"",N=await o.listRecentReleases(a,{cwd:e.cwd,excludeTag:R,limit:5,repo:i,tagPrefix:T}),V=ee(N);V&&(h=f==="top"?`${V}
|
|
20
|
-
|
|
21
|
-
${h}`:`${h}
|
|
22
|
-
|
|
23
|
-
${V}`)}catch{}const{releaseNoteTemplate:S}=e.config;if(S){const T=e.plan.releases.find(N=>N.name===t.name)?.oldVersion??"";h=se(h,S,{contributors:y,date:b,name:t.name,previousVersion:T,repo:i,version:t.version})}const H=[];p.uploadTarball&&t.tarball&&H.push(t.tarball.path);try{const j=await o.createRelease(a,{assets:H.length>0?H:void 0,body:h,cwd:e.cwd,discussionCategory:u,draft:r,prerelease:A,repo:i,tag:R,title:`${t.name} v${t.version}`});j?.url&&(t.url=j.url)}catch(j){console.warn(`createRelease failed for ${t.name}@${t.version} (tag ${R}): ${j.message}`)}}},ne=async(e,s,a)=>{const{changesDir:l,options:n,persistState:g,result:d,runner:o,state:i}=s,{writeStagedRegistry:c}=await import("../packem_chunks/staged-registry.js");if(!n.dryRun&&d.published.length>0&&d.tagsPushed){e.config.publish?.noRelease!==!0&&await te(e,d,o,a);try{const{walkSuccessfulRelease:r}=await import("../packem_chunks/success-walk.js"),{createRemoteClient:u,detectRemoteProvider:f}=await import("../packem_chunks/detect.js"),{resolveFormatter:m}=await import("../packem_chunks/resolveFormatter.js"),$=await f(e.cwd,o,e.config.provider),v=u($,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}),P=await v.detectRepoSlug(e.cwd,o),p=await m(e.config.changelog,e.cwd),{recordRecentlyWalked:b}=await import("../packem_chunks/staged-registry.js"),w=new Set([...i.walked??[],...(s.stagedRegistry.recentlyWalked??[]).map(t=>t.key)]),y={...d,published:d.published.filter(t=>!w.has(`${t.name}@${t.version}`))};if(y.published.length>0){const t=await r(e,y,o,{client:v,formatter:p,repo:P}),k=y.published.map(C=>`${C.name}@${C.version}`);i.walked=[...i.walked??[],...k],await g(),s.stagedRegistry=b(s.stagedRegistry,k),t.warnings.length>0&&e.plan.warnings.push(...t.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:u,detectRemoteProvider:f}=await import("../packem_chunks/detect.js"),m=await f(e.cwd,o,e.config.provider),v=await u(m,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,o);let P;try{const w=`${e.cwd}/package.json`,y=await import("node:fs/promises");P=JSON.parse(await y.readFile(w,"utf8")).name}catch{}const p=new Set([...i.notified??[],...(s.stagedRegistry.recentlyNotified??[]).map(w=>w.key)]),b=d.published.filter(w=>!p.has(`${w.name}@${w.version}`));if(b.length>0){const w=await r(e.config.notifications,{channel:e.channel?.tag,completedAt:new Date().toISOString(),...P===void 0?{}:{monorepoName:P},published:b.map(y=>({name:y.name,tag:e.channel?.tag,...y.url===void 0?{}:{url:y.url},version:y.version})),...v===void 0?{}:{repo:v},skipped:d.skipped.map(y=>({name:y.name,reason:y.reason}))},{warn:y=>e.plan.warnings.push(y)});if(w.succeeded.length>0){const y=b.map(k=>`${k.name}@${k.version}`);i.notified=[...i.notified??[],...y],await g();const{recordRecentlyNotified:t}=await import("../packem_chunks/staged-registry.js");s.stagedRegistry=t(s.stagedRegistry,y)}if(w.failed.length>0||w.succeeded.length>0){const y=w.succeeded.length+w.failed.length;if(w.failed.length>0){e.plan.warnings.push(`[notifications] dispatched ${w.succeeded.length}/${y} channels${w.succeeded.length>0?` (succeeded: ${w.succeeded.join(", ")})`:""}; ${w.failed.length} failed.`);for(const t of w.failed)e.plan.warnings.push(`[notifications:${t.id}] ${t.error}`)}}}}catch(r){e.plan.warnings.push(`notifications: dispatch failed: ${r.message}`)}if(!n.dryRun)try{const r=await c(e.cwd,l,s.stagedRegistry);if(r.changed){const{stageAndCommitFile:u}=await import("../packem_chunks/git.js");try{await u({cwd:e.cwd,runner:o},r.path,"chore(release): record cross-runner notify/walk dedupe [skip ci]",{author:e.config.gitUser,push:!n.noPush,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
|
-
`)}}},oe=async e=>{const{defaultTagFor:s,floatingMajorTagFor:a,renderTagPattern:l}=await import("../packem_chunks/git.js"),{resolveSyncTagGroups:n}=await import("../packem_chunks/group-tags.js"),g=e.plan.releases.filter(r=>e.depGraph.getPackage(r.name)?.manifest?.private!==!0).map(r=>({name:r.name,version:r.newVersion})),d=n(e.config,g),o=d.groups.map(r=>r.tag),i=[],c=!!e.channel?.prerelease||!!e.preMode;for(const{name:r,version:u}of g){if(d.grouped.has(r))continue;const f=e.perPackageConfig.get(r),m=f?.releaseTagPattern??e.config.releaseTagPattern;if(o.push(m?l(m,{channel:e.channel?.tag,name:r,version:u}):s(r,u)),e.config.floatingMajorTag===!0&&!c&&!m?.includes("{major}")&&f?.skipNpmPublish!==!0){const $=a(r,u);$!==void 0&&i.push($)}}return{created:o,updated:i}},ge=async(e,s,a)=>{if((await s.run("git",["remote","get-url","--push","origin"],{cwd:e.cwd,silent:!0})).exitCode!==0)return;const{getCurrentBranch:n,resolvePushCredentials:g,verifyPushAccess:d}=await import("../packem_chunks/git.js"),o={cwd:e.cwd,runner:s},i=await d(o);if(i!==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: ${i}`;const{createRemoteClient:c,detectRemoteProvider:r}=await import("../packem_chunks/detect.js");let u;try{u=await r(e.cwd,s,e.config.provider)}catch{return}if(u!=="github")return;const m=await c(u,{githubHost:e.config.githubHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,s);if(!m)return;const $=await g(o),v={...process.env};$!==void 0&&(v.GH_TOKEN=$.token),e.config.githubHost&&(v.GH_HOST=e.config.githubHost),e.config.httpProxy&&(v.HTTPS_PROXY=e.config.httpProxy,v.HTTP_PROXY=e.config.httpProxy);const{checkGithubPushRules:P}=await import("../packem_chunks/github-push-rules.js"),p=a.noTag?{created:[],updated:[]}:await oe(e),b=await P(s,{branch:await n(o),createdTags:p.created,cwd:e.cwd,env:v,repo:m,signedCommits:e.config.gitSignCommits===!0,updatedTags:p.updated});for(const w of b.warnings)process.stderr.write(`[vis release] Warning: ${w}
|
|
26
|
-
`);if(b.blocked.length>0)return`GitHub push rules would reject this release, nothing was published:
|
|
27
|
-
- ${b.blocked.join(`
|
|
28
|
-
- `)}
|
|
29
|
-
Grant the pushing token a bypass, adjust the ruleset, or pass --no-push / --no-tag.`},ce=async(e,s,a,l)=>{if(!a.dryRun&&e.channel?.mode==="version-pr"){const{createRemoteClient:n,detectRemoteProvider:g}=await import("../packem_chunks/detect.js");let d;try{const i=await g(e.cwd,s,e.config.provider);d=await n(i,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,s)}catch(i){return l.failed.push({name:"_preflight",reason:`Could not read the remote to check for an open release PR: ${i.message}`}),!0}const o=e.config.versionPr?.branch??"vis-release/version-packages";if(d)try{const i=await s.run("gh",["pr","list","--head",o,"--state","open","--json","number"],{cwd:e.cwd,silent:!0});if(i.exitCode===0&&i.stdout.trim()&&i.stdout.trim()!=="[]"){const c=JSON.parse(i.stdout);if(c[0])return l.failed.push({name:"_preflight",reason:`Open release PR #${c[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 E(e.cwd,e.config.prePublishCommand,"prePublishCommand")}catch(n){return l.failed.push({name:"_prePublishCommand",reason:n.message}),!0}if(!a.dryRun&&!a.noPush){let n;try{n=await ge(e,s,{noTag:a.noTag===!0})}catch(g){return l.failed.push({name:"_preflight",reason:`Could not verify the release pushes: ${g.message}`}),!0}if(n!==void 0)return l.failed.push({name:"_pushAccess",reason:n}),!0}return!1},le=async(e,s)=>{const{changesDir:a,options:l,runner:n}=s,{writeStagedRegistry:g}=await import("../packem_chunks/staged-registry.js");if(!l.dryRun){const d=s.priorRegistrySnapshot.pending.length,o=s.stagedRegistry.pending.length,i=await g(e.cwd,a,s.stagedRegistry);if(i.changed){const{stageAndCommitFile:c}=await import("../packem_chunks/git.js");let r;if(i.removed)r="chore(release): clear pending stage registry [skip ci]";else if(o>d){const u=o-d;r=`chore(release): record ${u} new pending stage${u===1?"":"s"} [skip ci]`}else if(o<d){const u=d-o;r=`chore(release): drain ${u} resolved stage${u===1?"":"s"} [skip ci]`}else r=`chore(release): update pending stage registry (${o} pending) [skip ci]`;try{await c({cwd:e.cwd,runner:n},i.path,r,{author:e.config.gitUser,push:!l.noPush,sign:e.config.gitSignCommits===!0})}catch(u){process.stderr.write(`[vis release] Warning: could not commit ${i.path}: ${u.message}
|
|
30
|
-
`)}}}},de=async(e,s)=>{const{options:a,result:l,runner:n}=s;if(!a.dryRun&&l.published.length>0&&e.config.workspaceChangelog!==!1){const g=e.config.workspaceChangelog,d=typeof g=="object"?g:void 0,o=typeof e.config.aggregateRelease=="object"?e.config.aggregateRelease.enabled:e.config.aggregateRelease===!0;if(d!==void 0||o)try{const{writeWorkspaceChangelogWave:i}=await import("../packem_chunks/workspace.js"),c=new Set(l.published.map(f=>f.name)),r=e.plan.releases.filter(f=>c.has(f.name)),u=await i({changelogConfig:e.config.changelog,cwd:e.cwd,workspaceChangelog:e.config.workspaceChangelog},r);if(u)try{const{stageAndCommitFile:f}=await import("../packem_chunks/git.js");await f({cwd:e.cwd,runner:n},u,"chore(release): record wave [skip ci]",{author:e.config.gitUser,push:!a.noPush,sign:e.config.gitSignCommits===!0})}catch(f){process.stderr.write(`[vis release] Warning: could not commit workspace CHANGELOG.md: ${f.message}
|
|
31
|
-
`)}}catch(i){process.stderr.write(`[vis release] Warning: could not write workspace CHANGELOG.md wave entry: ${i.message}
|
|
32
|
-
`)}}},I=async(e,s,a,l,n)=>{const{stageAndCommitFile:g}=await import("../packem_chunks/git.js"),{stateFilePath:d}=await import("../packem_chunks/state.js");try{const o=await g({cwd:e.cwd,runner:s},d(e.cwd,a,!0),`chore(release): ${l} publish lock [skip ci]`,{author:e.config.gitUser,push:!n.noPush,sign:e.config.gitSignCommits===!0});!n.noPush&&o.committed&&!o.pushed&&process.stderr.write(`[vis release] Warning: publish lock (${l}) 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 (${l}): ${o.message}
|
|
34
|
-
`)}},pe=async(e,s,a,l)=>{const{filterPlanByState:n,newState:g,readState:d,writeState:o}=await import("../packem_chunks/state.js"),{readStagedRegistry:i}=await import("../packem_chunks/staged-registry.js"),c=e.config.changesDir??_,r=e.config.publish?.lockInGit===!0;let u=a.resume||r?await d(e.cwd,c,r):void 0;u&&r&&(u.channel=e.channel?.tag);const f=async()=>{a.dryRun||!u||(await o(e.cwd,c,u,r),r&&await I(e,s,c,"progress",{noPush:a.noPush}))};let m=await i(e.cwd,c);await z(e,"publish",m,{runner:s}),m=await i(e.cwd,c);const $={...m,pending:[...m.pending]};let{releases:v}=e.plan;return u?v=n(v,u):(u=g(e.channel?.tag,e.plan.releases),a.dryRun||(await o(e.cwd,c,u,r),r&&await I(e,s,c,"open",{noPush:a.noPush}))),{changesDir:c,lockInGit:r,options:a,persistState:f,priorRegistrySnapshot:$,releases:v,result:l,runner:s,stagedRegistry:m,state:u}},ue=async(e,s,a)=>{const{changesDir:l,lockInGit:n,options:g,persistState:d,result:o,runner:i,state:c}=s,{clearState:r}=await import("../packem_chunks/state.js");if(!g.dryRun&&!g.noTag&&o.published.length>0){const{createOrUpdateFloatingTag:u,createTag:f,defaultTagFor:m,floatingMajorTagFor:$,pushTags:v,renderTagPattern:P}=await import("../packem_chunks/git.js"),p=e.config.releaseTagPattern,b=e.channel?.tag,w=e.config.floatingMajorTag===!0,y=!!e.channel?.prerelease||!!e.preMode;for(const{name:t,version:k}of o.published){if(a.grouped.has(t))continue;const R=e.perPackageConfig.get(t)?.releaseTagPattern??p,A=R?P(R,{channel:b,name:t,version:k}):m(t,k);try{await f({cwd:e.cwd,runner:i},A,`Release ${t}@${k}`,{signing:e.config.signing,skipRemoteCheck:e.firstRelease,target:g.tagTargets?.get(t)}),o.tags.push(A)}catch(T){e.firstRelease&&T instanceof F&&T.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: ${T.message}`})}const h=e.depGraph.getPackage(t),S=e.perPackageConfig.get(t),H=h?.manifest?.private===!0,j=S?.skipNpmPublish===!0;if(w&&!y&&!R?.includes("{major}")&&!H&&!j){const T=$(t,k);if(T!==void 0)try{await u({cwd:e.cwd,runner:i},T,{push:!g.noPush,signing:e.config.signing}),o.tags.push(T)}catch(N){o.skipped.push({name:T,reason:`floating-major-tag: ${N.message}`})}}}for(const t of a.groups)try{await f({cwd:e.cwd,runner:i},t.tag,`Release ${t.name} ${t.version}`,{signing:e.config.signing,skipRemoteCheck:e.firstRelease}),o.tags.push(t.tag)}catch(k){e.firstRelease&&k instanceof F&&k.code==="TAG_COLLISION"?o.skipped.push({name:t.tag,reason:"tag-creation: tag already exists (first-release — skipped)"}):o.failed.push({name:t.tag,reason:`tag-creation: ${k.message}`})}if(!g.noPush&&o.tags.length>0)try{await v({cwd:e.cwd,runner:i}),o.tagsPushed=!0}catch(t){o.tagsPushed=!1,o.failed.push({name:"_pushTags",reason:`git push --tags failed: ${t.message}. Retry with: git push --tags`})}c.tagged=[...o.tags],c.pushed=o.tagsPushed,await d(),o.failed.length===0&&!g.dryRun&&(await r(e.cwd,l,n),n&&await I(e,i,l,"close",{noPush:g.noPush}))}},he=async(e,s={})=>{const a={failed:[],published:[],skipped:[],tags:[],tagsPushed:!1},l=O();if(e.plan.releases.length===0||await ce(e,l,s,a))return a;const n=e.config.changesDir??_,{acquireLock:g,releaseLock:d}=await import("../packem_chunks/state.js");let o=!1;if(!s.dryRun)try{await g(e.cwd,n),o=!0}catch(i){return a.failed.push({name:"_lock",reason:i.message}),a}try{const i=await pe(e,l,s,a);await re(e,i);const{resolveSyncTagGroups:c}=await import("../packem_chunks/group-tags.js"),r=c(e.config,a.published);if(await ue(e,i,r),await le(e,i),await de(e,i),await ne(e,i,r),!s.dryRun&&e.config.postPublishCommand)try{await E(e.cwd,e.config.postPublishCommand,"postPublishCommand")}catch(u){a.failed.push({name:"_postPublishCommand",reason:u.message})}return a}finally{o&&await d(e.cwd,n)}},fe=(e,s)=>async(a,l,n)=>{const g=["view",`${a.name}@${l}`,"version"];n&&g.push("--registry",n);const d=await e.run("npm",g,{cwd:s,silent:!0});return d.exitCode===0?d.stdout.trim()!=="":/\bE404\b/.test(`${d.stdout}
|
|
35
|
-
${d.stderr}`)?!1:void 0},me=async(e,s,a)=>{const l=await e.run("git",["log","-1","--format=%H%x00%s",String.raw`-G"version"[[:space:]]*:`,"--",a],{cwd:s,silent:!0}),[n,g]=l.stdout.trim().split("\0");return l.exitCode===0&&n?{sha:n,subject:g??""}:void 0},we=async(e,s={})=>{const a=s.runner??O(),l=s.registryProbe??fe(a,e.cwd),n={missing:[],skipped:[]},g=e.config.versionPr?.title??"🚀 Versioned release",d=c=>c.startsWith(g)||W.some(r=>r.test(c)),{default:o}=await import("../packem_chunks/index.js"),i=s.projects??[];for(const c of e.packages){const r=e.perPackageConfig.get(c.name);if(c.ecosystem!==void 0||c.private||r?.skipNpmPublish===!0||!G.valid(c.version)||i.length>0&&!i.some(P=>P===c.name||o(P,c.name)))continue;const u=await D(c,"git-tag",e.depGraph,{cwd:e.cwd,perPackageConfig:r,pm:e.pm,runner:a,workspaceConfig:e.config});if(u.resolvedFrom!=="git-tag"||!G.gt(c.version,u.version))continue;const f=P=>{n.skipped.push({name:c.name,reason:`${c.version} is untagged but ${P}`})},m=await me(a,e.cwd,c.manifestPath);if(!m){f("the commit that set it could not be found");continue}if(!d(m.subject)){f(`it was set by ${m.sha.slice(0,7)} ("${m.subject}"), which is not a release commit`);continue}if((await a.run("git",["diff","--quiet",m.sha,"--",c.dir],{cwd:e.cwd,silent:!0})).exitCode!==0){f(`${c.dir} changed since ${m.sha.slice(0,7)}; the next release covers it`);continue}const v=await l(c,c.version,r?.registry);if(v===void 0){f("the registry could not confirm whether it is published");continue}n.missing.push({commit:m.sha,name:c.name,onRegistry:v,previousVersion:u.version,version:c.version})}return n},be=(e,s,a)=>{const l=e.perPackageConfig.get(s)?.releaseTagPattern??e.config.releaseTagPattern;return l?U(l,{channel:e.channel?.tag,name:s,version:a}):K(s,a)},ye=(e,s)=>{const a=G.diff(e,s);return a==="major"||a==="premajor"?"major":a==="minor"||a==="preminor"?"minor":"patch"},Ne=async(e,s={})=>{const a=O(),l=await we(e,{projects:s.projects,registryProbe:s.registryProbe,runner:a}),n={failed:[],missing:l.missing,published:[],skipped:[...l.skipped],tags:[],tagsPushed:!1};l.missing.length>0&&M();const g=l.missing.filter(i=>!i.onRegistry),d=l.missing.filter(i=>i.onRegistry);if(g.length>0){const i=g.map(r=>({changeFiles:[],isCascadeBump:!1,isDependencyBump:!1,isGroupBump:!1,name:r.name,newVersion:r.version,oldVersion:r.previousVersion,reasons:[],sources:[],type:ye(r.previousVersion,r.version)})),c=await he({...e,plan:{consumedChangeFiles:[],releases:i,warnings:[]}},{...s,tagTargets:new Map(g.map(r=>[r.name,r.commit]))});n.failed.push(...c.failed),n.published.push(...c.published),n.skipped.push(...c.skipped),n.tags.push(...c.tags),n.tagsPushed=c.tagsPushed}if(d.length===0||s.dryRun||s.noTag)return n;const o=[];for(const i of d){const c=be(e,i.name,i.version);try{await L({cwd:e.cwd,runner:a},c,`Release ${i.name}@${i.version}`,{signing:e.config.signing,target:i.commit}),o.push(c),n.skipped.push({name:i.name,reason:`already-published: tagged ${c}`})}catch(r){n.failed.push({name:c,reason:`tag-creation: ${r.message}`})}}if(n.tags.push(...o),o.length>0&&!s.noPush)try{await B({cwd:e.cwd,runner:a}),n.tagsPushed=!0}catch(i){n.tagsPushed=!1,n.failed.push({name:"_pushTags",reason:`git push --tags failed: ${i.message}. Retry with: git push --tags`})}return n};export{he as a,Ne as p};
|