@visulima/vis 6.5.3 → 6.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +17 -2
- 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/handler40.js +1 -1
- package/dist/packem_chunks/handler46.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 +8 -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 +10 -10
- 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/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/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-Bg-9akuc.js → ReleaseClient-C2xIJ6LK.js} +1 -1
- package/dist/packem_shared/{advisories-CzYpfK5t.js → advisories-BldM-U4F.js} +1 -1
- package/dist/packem_shared/{affected-selection-BdLNvNcE.js → affected-selection-DxKQo2N5.js} +1 -1
- package/dist/packem_shared/{ai-analysis-DAZka8TK.js → ai-analysis-D1Y5a_SZ.js} +1 -1
- package/dist/packem_shared/{ai-cache-BdYWMXBs.js → ai-cache-CSmj5gA2.js} +1 -1
- package/dist/packem_shared/{ai-fix-WyWS6pLg.js → ai-fix-DVcnNQ0X.js} +1 -1
- package/dist/packem_shared/{bin-DeFLi46P.js → bin-Bw91EYm6.js} +1 -1
- package/dist/packem_shared/{build-scripts-Cxqumymu.js → build-scripts-ETlkUGzC.js} +1 -1
- package/dist/packem_shared/{dependency-scan-CFBQmGvr.js → dependency-scan-Dv1kJ-Sn.js} +1 -1
- package/dist/packem_shared/{detect-DBbY9ufF.js → detect-Bch1mcQe.js} +1 -1
- package/dist/packem_shared/{docker-MC4VH-op.js → docker-DPxeLIQl.js} +1 -1
- package/dist/packem_shared/{ecosystem-gate-D3QeNZpU.js → ecosystem-gate-IugL9cei.js} +1 -1
- package/dist/packem_shared/{env-B2G7w--D.js → env-D3wteXlq.js} +1 -1
- package/dist/packem_shared/{env-consistency-p-t6Gohk.js → env-consistency-1rRSdrFI.js} +1 -1
- package/dist/packem_shared/{failure-log-C5v0g1UG.js → failure-log-Dgp-P-SJ.js} +1 -1
- package/dist/packem_shared/glob-Cyk1H9ZL-D0MQr5DW.js +1 -0
- package/dist/packem_shared/{index-CnaYwWPH.js → index-BTwTRy_a.js} +1 -1
- package/dist/packem_shared/{index-uCBemJvQ.js → index-DojXARzs.js} +1 -1
- package/dist/packem_shared/{lifecycle-CI9atpzK.js → lifecycle-C6o0cmOT.js} +1 -1
- package/dist/packem_shared/{manifests-BqnHxiJw.js → manifests-CgiKqpP8.js} +1 -1
- package/dist/packem_shared/{min-release-age-CxUqkjTg.js → min-release-age-RVDHqGu5.js} +1 -1
- package/dist/packem_shared/{missing-package-json-DFyB93V7.js → missing-package-json-Cf7PavlK.js} +1 -1
- package/dist/packem_shared/{multi-eco-lockfiles-BZGGj6Fi.js → multi-eco-lockfiles-B3591j5D.js} +1 -1
- package/dist/packem_shared/{native-config-sync-B5PDu-SO.js → native-config-sync-BGLC8n86.js} +1 -1
- package/dist/packem_shared/{osv-Ddp0z-bz.js → osv-CI9eaGmG.js} +1 -1
- package/dist/packem_shared/{package-version-9yJPO26I.js → package-version-COyEFX59.js} +1 -1
- package/dist/packem_shared/{packument-CFahFBqP.js → packument-Dij7POVt.js} +1 -1
- package/dist/packem_shared/{project-name-filter-VxqvZKPm.js → project-name-filter-B7h62wuR.js} +1 -1
- package/dist/packem_shared/{provenance-BhiFbitj.js → provenance-BVFxzkUv.js} +1 -1
- package/dist/packem_shared/publish-missing-CZK1BpWt.js +38 -0
- package/dist/packem_shared/{registry-1z4qCjta.js → registry-CyYhBUaF.js} +41 -41
- package/dist/packem_shared/{registry-keys-klG8wS_f.js → registry-keys-BwWnVZtb.js} +1 -1
- package/dist/packem_shared/{renderToString-DR0zDUjh-3-n2BqOz.js → renderToString-DR0zDUjh-CQT5Ebrc.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-CpJczFGv.js → resolve-explicit-BshyrPRh.js} +1 -1
- package/dist/packem_shared/{run-Bwpi35uP.js → run-BvhcgfRq.js} +4 -4
- package/dist/packem_shared/{run-summary-utils-BL-RMEdt.js → run-summary-utils-RzgHeC8f.js} +1 -1
- package/dist/packem_shared/{runtime-check-CBsebG-M.js → runtime-check-CpBsIYcl.js} +1 -1
- package/dist/packem_shared/{s1ngularity-C6Ii80Le.js → s1ngularity-Bb56bc8v.js} +1 -1
- package/dist/packem_shared/{scaffold-files-BikhXmvZ.js → scaffold-files-sbf-Y1nQ.js} +1 -1
- package/dist/packem_shared/{scan-progress-IsWCbrjW.js → scan-progress-Blrj96LZ.js} +1 -1
- package/dist/packem_shared/{selectors-CphDx0OL.js → selectors-DmRRUQsG.js} +1 -1
- package/dist/packem_shared/{signatures-C4xf8cQc.js → signatures-DlGMQsHg.js} +1 -1
- package/dist/packem_shared/{spinner-DfeFPP3z.js → spinner-B30I9gQR.js} +1 -1
- package/dist/packem_shared/{table-GSeva_9X.js → table-ahQIE6tw.js} +1 -1
- package/dist/packem_shared/{tabs-aakFF28o.js → tabs-K9dH5Qdu.js} +1 -1
- package/dist/packem_shared/{toolchain-BbvTtdLc.js → toolchain-B7PrWDAi.js} +1 -1
- package/dist/packem_shared/{typosquats-Bq2GBIIs.js → typosquats-Dn2ahBS1.js} +1 -1
- package/dist/packem_shared/{use-measured-height-BH7aFaQg.js → use-measured-height-D5xfIDWl.js} +1 -1
- package/dist/packem_shared/{vis-update-app-Iqgng6iv.js → vis-update-app-CPpJkbSs.js} +1 -1
- package/dist/packem_shared/{vis-user-error-84uG5ZNC.js → vis-user-error-C3y9hGtw.js} +1 -1
- package/dist/packem_shared/{watch-loop-R_T4KYMz.js → watch-loop-DQ6KryuH.js} +1 -1
- package/dist/release/index.js +1 -1
- package/index.js +26 -26
- package/package.json +9 -9
- package/schemas/project.schema.json +9 -2
- package/schemas/vis-config.schema.json +11 -4
- package/schemas/vis-release-config.schema.json +2 -2
- package/dist/packem_shared/glob-Cyk1H9ZL-DAxMgZXi.js +0 -1
- package/dist/packem_shared/publish-missing-CMN5bbJ5.js +0 -35
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/vis",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0",
|
|
4
4
|
"description": "A monorepo dev toolkit — task runner, remote caching, security scanning, git hooks, and AI agent integrations — powered by @visulima/task-runner",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"build",
|
|
@@ -152,14 +152,14 @@
|
|
|
152
152
|
}
|
|
153
153
|
},
|
|
154
154
|
"optionalDependencies": {
|
|
155
|
-
"@visulima/vis-binding-darwin-arm64": "6.
|
|
156
|
-
"@visulima/vis-binding-darwin-x64": "6.
|
|
157
|
-
"@visulima/vis-binding-linux-arm64-gnu": "6.
|
|
158
|
-
"@visulima/vis-binding-linux-arm64-musl": "6.
|
|
159
|
-
"@visulima/vis-binding-linux-x64-gnu": "6.
|
|
160
|
-
"@visulima/vis-binding-linux-x64-musl": "6.
|
|
161
|
-
"@visulima/vis-binding-win32-arm64-msvc": "6.
|
|
162
|
-
"@visulima/vis-binding-win32-x64-msvc": "6.
|
|
155
|
+
"@visulima/vis-binding-darwin-arm64": "6.6.0",
|
|
156
|
+
"@visulima/vis-binding-darwin-x64": "6.6.0",
|
|
157
|
+
"@visulima/vis-binding-linux-arm64-gnu": "6.6.0",
|
|
158
|
+
"@visulima/vis-binding-linux-arm64-musl": "6.6.0",
|
|
159
|
+
"@visulima/vis-binding-linux-x64-gnu": "6.6.0",
|
|
160
|
+
"@visulima/vis-binding-linux-x64-musl": "6.6.0",
|
|
161
|
+
"@visulima/vis-binding-win32-arm64-msvc": "6.6.0",
|
|
162
|
+
"@visulima/vis-binding-win32-x64-msvc": "6.6.0"
|
|
163
163
|
},
|
|
164
164
|
"engines": {
|
|
165
165
|
"node": "^22.14.0 || >=24.10.0"
|
|
@@ -106,9 +106,16 @@
|
|
|
106
106
|
"targets": {
|
|
107
107
|
"type": "object",
|
|
108
108
|
"additionalProperties": {
|
|
109
|
-
"
|
|
109
|
+
"anyOf": [
|
|
110
|
+
{
|
|
111
|
+
"$ref": "#/$defs/VisTargetConfiguration"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"type": "null"
|
|
115
|
+
}
|
|
116
|
+
]
|
|
110
117
|
},
|
|
111
|
-
"description": "Vis-style target definitions (merged on top of package.json scripts)."
|
|
118
|
+
"description": "Vis-style target definitions (merged on top of package.json scripts). `null` removes a target the project would otherwise get from a `package.json` script, a workspace task default, or target inference — e.g. a root convenience script that only forwards to another project."
|
|
112
119
|
},
|
|
113
120
|
"$schema": {
|
|
114
121
|
"type": "string",
|
|
@@ -1994,7 +1994,7 @@
|
|
|
1994
1994
|
},
|
|
1995
1995
|
"staged": {
|
|
1996
1996
|
"$ref": "#/$defs/StagedConfig",
|
|
1997
|
-
"description": "Staged file patterns and commands (replaces lint-staged).\n\nAccepts all lint-staged config forms:\n- `string` or `string[]` commands\n- Sync/async functions returning `string | string[]`\n- `{ title, task }` objects for named side-effect tasks\n- `{ command, perPackage }` to run a command once per owning workspace package (cwd = that package dir), and `{ command, cwd }` to pin a command to a fixed directory\n- Mixed arrays of strings and functions\n- A top-level generate-task function"
|
|
1997
|
+
"description": "Staged file patterns and commands (replaces lint-staged).\n\nAccepts all lint-staged config forms:\n- `string` or `string[]` commands\n- Sync/async functions returning `string | string[]`\n- `{ title, task }` objects for named side-effect tasks\n- `{ command, perPackage }` to run a command once per owning workspace package (cwd = that package dir), and `{ command, cwd }` to pin a command to a fixed directory\n- `{ command, dependsOn: [\"^build\"] }` to build the owning packages' dependencies before any staged command starts\n- Mixed arrays of strings and functions\n- A top-level generate-task function"
|
|
1998
1998
|
},
|
|
1999
1999
|
"strictEnv": {
|
|
2000
2000
|
"type": "boolean",
|
|
@@ -4441,7 +4441,7 @@
|
|
|
4441
4441
|
},
|
|
4442
4442
|
"internalDependencyRanges": {
|
|
4443
4443
|
"$ref": "#/$defs/InternalDependencyRangesMode",
|
|
4444
|
-
"description": "How the version step updates a released package's specifiers for other workspace packages in the same wave. `updateInternalDependencies` decides which dependents cascade; this decides what gets written. Default: `\"rewrite\"`.\n\nUse `\"preserve-satisfying\"` for promotion-safe ranges such as `>=1.0.0-alpha.76
|
|
4444
|
+
"description": "How the version step updates a released package's specifiers for other workspace packages in the same wave. `updateInternalDependencies` decides which dependents cascade; this decides what gets written. Default: `\"rewrite\"`.\n\nUse `\"preserve-satisfying\"` for promotion-safe ranges such as `>=1.0.0-alpha.76 <2.0.0-0`, which `\"rewrite\"` turns into `>=<newVersion>` (ratcheted floor, no ceiling)."
|
|
4445
4445
|
},
|
|
4446
4446
|
"linked": {
|
|
4447
4447
|
"type": "array",
|
|
@@ -4868,7 +4868,7 @@
|
|
|
4868
4868
|
"rewrite",
|
|
4869
4869
|
"preserve-satisfying"
|
|
4870
4870
|
],
|
|
4871
|
-
"description": "What the version step writes into a released package's specifier for an internal dependency. `\"rewrite\"` sets every specifier to
|
|
4871
|
+
"description": "What the version step writes into a released package's specifier for an internal dependency. `\"rewrite\"` sets every specifier to `<operator><newVersion>`; `\"preserve-satisfying\"` leaves a range that still admits the new version untouched, raises the floor of an outgrown one (keeping its ceiling) and fails the release when the new version is past the ceiling."
|
|
4872
4872
|
},
|
|
4873
4873
|
"NotificationsConfig": {
|
|
4874
4874
|
"type": "object",
|
|
@@ -6838,6 +6838,13 @@
|
|
|
6838
6838
|
"cwd": {
|
|
6839
6839
|
"type": "string"
|
|
6840
6840
|
},
|
|
6841
|
+
"dependsOn": {
|
|
6842
|
+
"type": "array",
|
|
6843
|
+
"items": {
|
|
6844
|
+
"type": "string"
|
|
6845
|
+
},
|
|
6846
|
+
"description": "Dependency targets such as `\"^build\"`; only the `^` form is supported."
|
|
6847
|
+
},
|
|
6841
6848
|
"perPackage": {
|
|
6842
6849
|
"type": "boolean"
|
|
6843
6850
|
}
|
|
@@ -6846,7 +6853,7 @@
|
|
|
6846
6853
|
"command"
|
|
6847
6854
|
],
|
|
6848
6855
|
"additionalProperties": false,
|
|
6849
|
-
"description": "Object form of a command task. Unlike a bare command string it carries execution options:\n\n- `perPackage` runs the command once per workspace package that owns the matched files, with `cwd` set to that package's directory and file paths made relative to it. Use it for tools that resolve their config or plugins from the nearest `package.json` — e.g. eslint with a cwd-sensitive shareable config. Files that sit under no workspace package fall back to a single run from the workspace root.\n- `cwd` pins the command to a fixed directory (relative to the workspace root, or absolute) and passes the matched files as absolute paths so they resolve regardless of where the command runs. Ignored when `perPackage` is set — that derives the cwd per package instead.\n\nA command task is distinguished from {@link CustomTask } by carrying a `command` string and no `task` function."
|
|
6856
|
+
"description": "Object form of a command task. Unlike a bare command string it carries execution options:\n\n- `perPackage` runs the command once per workspace package that owns the matched files, with `cwd` set to that package's directory and file paths made relative to it. Use it for tools that resolve their config or plugins from the nearest `package.json` — e.g. eslint with a cwd-sensitive shareable config. Files that sit under no workspace package fall back to a single run from the workspace root.\n- `cwd` pins the command to a fixed directory (relative to the workspace root, or absolute) and passes the matched files as absolute paths so they resolve regardless of where the command runs. Ignored when `perPackage` is set — that derives the cwd per package instead.\n- `dependsOn: [\"^build\"]` runs `build` for the dependencies of every workspace package that owns a matched file, before any staged command starts. Type-aware linters read workspace imports from each dependency's built declarations, so an unbuilt dependency turns its types into `any`. Entries share one `vis run … --if-present` call per target, run before anything else: a build running beside another build, or beside a lint, would race a tool that cleans `dist/` on start.\n\nA command task is distinguished from {@link CustomTask } by carrying a `command` string and no `task` function."
|
|
6850
6857
|
}
|
|
6851
6858
|
}
|
|
6852
6859
|
}
|
|
@@ -295,7 +295,7 @@
|
|
|
295
295
|
},
|
|
296
296
|
"internalDependencyRanges": {
|
|
297
297
|
"$ref": "#/$defs/InternalDependencyRangesMode",
|
|
298
|
-
"description": "How the version step updates a released package's specifiers for other workspace packages in the same wave. `updateInternalDependencies` decides which dependents cascade; this decides what gets written. Default: `\"rewrite\"`.\n\nUse `\"preserve-satisfying\"` for promotion-safe ranges such as `>=1.0.0-alpha.76
|
|
298
|
+
"description": "How the version step updates a released package's specifiers for other workspace packages in the same wave. `updateInternalDependencies` decides which dependents cascade; this decides what gets written. Default: `\"rewrite\"`.\n\nUse `\"preserve-satisfying\"` for promotion-safe ranges such as `>=1.0.0-alpha.76 <2.0.0-0`, which `\"rewrite\"` turns into `>=<newVersion>` (ratcheted floor, no ceiling)."
|
|
299
299
|
},
|
|
300
300
|
"linked": {
|
|
301
301
|
"type": "array",
|
|
@@ -722,7 +722,7 @@
|
|
|
722
722
|
"rewrite",
|
|
723
723
|
"preserve-satisfying"
|
|
724
724
|
],
|
|
725
|
-
"description": "What the version step writes into a released package's specifier for an internal dependency. `\"rewrite\"` sets every specifier to
|
|
725
|
+
"description": "What the version step writes into a released package's specifier for an internal dependency. `\"rewrite\"` sets every specifier to `<operator><newVersion>`; `\"preserve-satisfying\"` leaves a range that still admits the new version untouched, raises the floor of an outgrown one (keeping its ceiling) and fails the release when the new version is past the ceiling."
|
|
726
726
|
},
|
|
727
727
|
"NotificationsConfig": {
|
|
728
728
|
"type": "object",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as t}from"./registry-1z4qCjta.js";const s=async(a,o)=>await t(a,o);export{s as l};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import{createRequire as U}from"node:module";import{s as I}from"./index--eV4qIz5.js";import{DEFAULT_CHANGES_DIR as E}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 G}from"../packem_chunks/shell-runner.js";import{r as W,b as te}from"./apply-C6qxfMqZ.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"),{resolve: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 d=n.trim().toLowerCase().replace(/^@/,"");d.length>0&&a.add(d)}const g=new Set,i=[];for(const n of e){const d=n.meta?.author;if(d)for(const o of d.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:d}=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(p=>p.name)),f=new Map(i.map(p=>[p.name,p])),m=new Set,R=new Map;for(const p of e.plan.releases){const y=e.depGraph.getPackage(p.name);y&&R.set(p.name,{...y.manifest,version:p.newVersion})}const P={config:e.config,cwd:e.cwd},k=e.config.plugins?.length?await import("../packem_chunks/defineReleasePlugin.js"):void 0;for(const p of l){const y=f.get(p);if(!y){n.skipped.push({name:p,reason:"topo-sort returned a name not in the release plan (internal bug)"});continue}const b=e.depGraph.getPackage(p);if(!b)continue;const v=[...new Set(e.depGraph.getDependencies(p).filter(h=>h.kind!=="devDependencies"&&m.has(h.name)).map(h=>h.name))];if(v.length>0){n.skipped.push({name:p,reason:`dependency-failed: not published because ${v.join(", ")} failed to publish (publishing would orphan this package's dependency range)`}),m.add(p);continue}const u=e.perPackageConfig.get(p)??{},C=Y(b,u),$=a.publishActionsOverride??oe(C),w=a.tag??e.channel?.tag;if(k){const h=await k.runWillPublishHooks(P,{dir:b.dir,name:p,oldVersion:y.oldVersion,version:y.newVersion});if(h.skip){n.skipped.push({name:p,reason:`plugin-skipped${h.by?` by "${h.by}"`:""}`}),m.add(p);continue}}const T=s.stagedRegistry.pending.find(h=>h.name===p&&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:R,workspaceConfig:e.config});if(h.published||h.alreadyPublished){const S=s.stagedRegistry.pending.filter(A=>A.name===p&&A.version===y.newVersion).map(A=>A.id);S.length>0&&(s.stagedRegistry=o(s.stagedRegistry,S))}if(h.published)n.published.push({name:p,stageId:h.stageId,tarball:h.tarball,version:y.newVersion}),d.published.push(`${p}@${y.newVersion}`),k&&await k.runAfterPublishHooks(P,{dir:b.dir,name:p,oldVersion:y.oldVersion,version:y.newVersion});else if(h.alreadyPublished)n.skipped.push({name:p,reason:"already-published"}),d.published.push(`${p}@${y.newVersion}`);else if(n.skipped.push({name:p,reason:h.output??"skipped"}),h.stageId){const S=(h.output??"").startsWith("stage-rejected")?"rejected":"timeout";s.stagedRegistry=c(s.stagedRegistry,[{id:h.stageId,name:p,reason:S,stagedAt:new Date().toISOString(),tag:w??"latest",version:y.newVersion}])}await g()}catch(h){n.failed.push({name:p,reason:h.message}),m.add(p)}}k&&await k.runAfterPublishAllHooks(P,{failed:n.failed.map(p=>({name:p.name,reason:p.reason})),published:n.published.map(p=>({name:p.name,version:p.version})),skipped:n.skipped.map(p=>({name:p.name,reason:p.reason}))})},we=async(e,s,a,g)=>{const{createRemoteClient:i,detectRemoteProvider:n}=await import("../packem_chunks/detect.js"),d=await n(e.cwd,a,e.config.provider),o=i(d,{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:R}=await import("../packem_chunks/git.js"),P=e.config.releaseTagPattern,k=e.channel?.tag,p=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=$?R($,{channel:k,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.`),p.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=[];p.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:d,runner:o,state:c}=s,{writeStagedRegistry:t}=await import("../packem_chunks/staged-registry.js");if(!i.dryRun&&d.published.length>0&&d.tagsPushed){e.config.publish?.noRelease!==!0&&await we(e,d,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"),R=await f(e.cwd,o,e.config.provider),P=l(R,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}),k=await P.detectRepoSlug(e.cwd,o),p=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={...d,published:d.published.filter(C=>!b.has(`${C.name}@${C.version}`))},u=v.published.length>0?await r(e,v,o,{client:P,formatter:p,repo:k}):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 k;try{const b=`${e.cwd}/package.json`,v=await import("node:fs/promises");k=JSON.parse(await v.readFile(b,"utf8")).name}catch{}const p=new Set([...c.notified??[],...(s.stagedRegistry.recentlyNotified??[]).map(b=>b.key)]),y=d.published.filter(b=>!p.has(`${b.name}@${b.version}`));if(y.length>0){const b=await r(e.config.notifications,{channel:e.channel?.tag,completedAt:new Date().toISOString(),...k===void 0?{}:{monorepoName:k},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:d.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})),d=i(e.config,n),o=d.groups.map(r=>r.tag),c=[],t=!!e.channel?.prerelease||!!e.preMode;for(const{name:r,version:l}of n){if(d.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 R=a(r,l);R!==void 0&&c.push(R)}}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:d}=await import("../packem_chunks/git.js"),o={cwd:e.cwd,runner:s},c=await d(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 R=await n(o),P={...process.env};R!==void 0&&(P.GH_TOKEN=R.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:k}=await import("../packem_chunks/github-push-rules.js"),p=a.noTag?{created:[],updated:[]}:await ye(e),y=await k(s,{branch:await i(o),createdTags:p.created,cwd:e.cwd,env:P,repo:m,signedCommits:e.config.gitSignCommits===!0,updatedTags:p.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 d;try{const c=await n(e.cwd,s,e.config.provider);d=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(d)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},Re=async(e,s)=>{const{changesDir:a,options:g,runner:i}=s,{writeStagedRegistry:n}=await import("../packem_chunks/staged-registry.js");if(!g.dryRun){const d=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>d){const l=o-d;r=`chore(release): record ${l} new pending stage${l===1?"":"s"} [skip ci]`}else if(o<d){const l=d-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
|
-
`)}}}},ke=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,d=typeof n=="object"?n:void 0,o=typeof e.config.aggregateRelease=="object"?e.config.aggregateRelease.enabled:e.config.aggregateRelease===!0;if(d!==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
|
-
`)}}},O=async(e,s,a,g,i)=>{const{stageAndCommitFile:n}=await import("../packem_chunks/git.js"),{stateFilePath:d}=await import("../packem_chunks/state.js");try{const o=await n({cwd:e.cwd,runner:s},d(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:d,writeState:o}=await import("../packem_chunks/state.js"),{readStagedRegistry:c}=await import("../packem_chunks/staged-registry.js"),t=e.config.changesDir??E,r=e.config.publish?.lockInGit===!0;let l=a.resume||r?await d(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 O(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 R={...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 O(e,s,t,"open",{noPush:a.noPush||a.noBranchPush}))),{changesDir:t,lockInGit:r,options:a,persistState:f,priorRegistrySnapshot:R,releases:P,result:g,runner:s,stagedRegistry:m,state:l}},Ce=async(e,s,a)=>{const{changesDir:g,lockInGit:i,options:n,persistState:d,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:R,pushTags:P,renderTagPattern:k,resolveReleaseSource:p}=await import("../packem_chunks/git.js");let y;try{y=n.defaultTagTarget??(e.config.tagTarget==="source"?await p({cwd:e.cwd,runner:c}):void 0)}catch(w){o.failed.push({name:"_tagTarget",reason:w.message}),await d();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?k(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 _=R(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 d(),o.failed.length===0&&!n.dryRun&&(await r(e.cwd,g,i),i&&await O(e,c,g,"close",{noPush:n.noPush||n.noBranchPush}))}},Te=async(e,s={})=>{const a={failed:[],published:[],skipped:[],tags:[],tagsPushed:!1},g=G();if(e.plan.releases.length===0||await Pe(e,g,s,a))return a;const i=e.config.changesDir??E,{acquireLock:n,releaseLock:d}=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 Re(e,c),await ke(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 d(e.cwd,i)}},Se=(e,s)=>async(a,g,i)=>{const n=["view",`${a.name}@${g}`,"version"];i&&n.push("--registry",i);const d=await e.run("npm",n,{cwd:s,silent:!0});return d.exitCode===0?d.stdout.trim()!=="":/\bE404\b/.test(`${d.stdout}
|
|
35
|
-
${d.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??G(),g=s.registryProbe??Se(a,e.cwd),i={missing:[],skipped:[],stranded:[]},n=e.config.versionPr?.title??"🚀 Versioned release",d=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||!I.valid(t.version)||c.length>0&&!c.some(p=>p===t.name||o(p,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"||!I.gt(t.version,l.version))continue;const f=p=>{i.skipped.push({name:t.name,reason:`${t.version} is untagged but ${p}`})},m=await Ae(a,e.cwd,t.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}const R=await g(t,t.version,r?.registry);if(R===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){R?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 k;try{k=await ae({cwd:e.cwd,runner:a},m.sha)??m.sha}catch(p){f(p.message);continue}i.missing.push({commit:m.sha,name:t.name,onRegistry:R,previousVersion:l.version,target:k,version:t.version})}return i},Ue=async(e,s)=>{const a=B(e.cwd,e.config.changesDir??E),g=G(),i=[];await z(a,{recursive:!0});for(const d of s){const o=B(a,`stranded-${encodeURIComponent(d.name)}-${d.version}.md`),c=`Release ${d.version}. Commit ${d.sha.slice(0,7)} set this version and it was never published, so it is released from HEAD.`;await J(o,X({bump:"patch",package:d.name,releaseAs:d.version},c)),i.push(o)}const n=await g.run("git",["add","--",...i],{cwd:e.cwd,silent:!0});if(n.exitCode!==0)throw new Error(`could not stage the stranded change files: ${n.stderr.trim()||`exit ${n.exitCode}`}`);return i},_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=I.diff(e,s);return a==="major"||a==="premajor"?"major":a==="minor"||a==="preminor"?"minor":"patch"},qe=async(e,s={})=>{const a=G(),g=await je(e,{projects:s.projects,registryProbe:s.registryProbe,runner:a});if(s.deferRecovery){for(const t of g.missing)g.skipped.push({name:t.name,reason:`${t.version} waits until the stranded versions of this release are published`});g.missing=[]}const 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),d=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(d.length===0||s.dryRun||s.noTag)return i;const o=[],c=[];for(const t of d){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};
|