@visulima/vis 6.1.5 → 6.3.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 +17 -0
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/cargo-lock.js +5 -5
- package/dist/packem_chunks/cargo-plan.js +3 -3
- package/dist/packem_chunks/catalog2.js +1 -1
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +13 -13
- package/dist/packem_chunks/composer-projects.js +2 -2
- package/dist/packem_chunks/context.js +4 -4
- package/dist/packem_chunks/detect.js +4 -4
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/git.js +2 -2
- package/dist/packem_chunks/go-plan.js +1 -1
- package/dist/packem_chunks/go-projects.js +1 -1
- package/dist/packem_chunks/group-tags.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler11.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/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +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/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler32.js +1 -1
- package/dist/packem_chunks/handler33.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/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 +3 -3
- 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/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/index3.js +26 -26
- 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/loader.js +1 -1
- package/dist/packem_chunks/print-config.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/python-projects.js +1 -1
- package/dist/packem_chunks/snapshot.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/success-walk.js +16 -6
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_chunks/version-resolver.js +8 -3
- package/dist/packem_chunks/workspace.js +1 -1
- package/dist/packem_shared/ReleaseClient-DXlaCQuQ.js +1 -0
- package/dist/packem_shared/{advisories-DKKfTGBl.js → advisories-DvmoRKco.js} +1 -1
- package/dist/packem_shared/{affected-selection-CzPnzgK2.js → affected-selection-BCYW97-p.js} +1 -1
- package/dist/packem_shared/{ai-analysis-QUvfu94K.js → ai-analysis-C7JT_zkS.js} +1 -1
- package/dist/packem_shared/{ai-cache-CQUDV1EF.js → ai-cache-B-3KMpa9.js} +1 -1
- package/dist/packem_shared/{ai-fix-DPwn2Zc4.js → ai-fix-PRDGLhGn.js} +1 -1
- package/dist/packem_shared/{apply-DoeQAAGm.js → apply-DBU-Gu24.js} +4 -4
- package/dist/packem_shared/apply-release-plan-BZ_E8GXQ.js +15 -0
- package/dist/packem_shared/{bin-BM8R-TJp.js → bin-Bi_j0gXS.js} +1 -1
- package/dist/packem_shared/{build-scripts-DAp1QejK.js → build-scripts-Bc8dOvdA.js} +1 -1
- package/dist/packem_shared/{dependency-scan-B8VKY4W0.js → dependency-scan-YbYZyLNf.js} +1 -1
- package/dist/packem_shared/{detect-DqBM0nZP.js → detect-clCqXvt_.js} +1 -1
- package/dist/packem_shared/{docker-SnUx-jA5.js → docker-hegwl1I6.js} +1 -1
- package/dist/packem_shared/{ecosystem-gate-Dn0x-inS.js → ecosystem-gate-C9GmY9oJ.js} +1 -1
- package/dist/packem_shared/{env-BD9mHyEq.js → env-DDmZsWBr.js} +1 -1
- package/dist/packem_shared/{env-consistency-Ll1xt4ID.js → env-consistency-Bn8a_NXB.js} +1 -1
- package/dist/packem_shared/{failure-log-Cuv9ckji.js → failure-log-D-YtsYF3.js} +1 -1
- package/dist/packem_shared/glob-Cyk1H9ZL-BjuiUjNv.js +1 -0
- package/dist/packem_shared/{index-B4AjSxHU.js → index--eV4qIz5.js} +1 -1
- package/dist/packem_shared/{index-C1v90Tlz.js → index-BRrpyvTT.js} +1 -1
- package/dist/packem_shared/{index-1xNuA32d.js → index-C297jo7X.js} +1 -1
- package/dist/packem_shared/{lifecycle-CaK2mtZn.js → lifecycle-BBEFEzfq.js} +1 -1
- package/dist/packem_shared/{manifests-uqarmRyk.js → manifests-Caf3hlIO.js} +1 -1
- package/dist/packem_shared/{min-release-age-frC0puNG.js → min-release-age-BysoCN79.js} +1 -1
- package/dist/packem_shared/{missing-package-json-CYMst_h7.js → missing-package-json-Cvjhtrwa.js} +1 -1
- package/dist/packem_shared/{multi-eco-lockfiles-wekgb6TI.js → multi-eco-lockfiles-g-vAXRj7.js} +1 -1
- package/dist/packem_shared/{native-config-sync-DDfXlAoK.js → native-config-sync-Bm9PtGpG.js} +1 -1
- package/dist/packem_shared/{osv-xTKWbQES.js → osv-9k7R7LU3.js} +1 -1
- package/dist/packem_shared/{package-version-tdRt9BO3.js → package-version-CNjr03oy.js} +1 -1
- package/dist/packem_shared/{packument-C1NPjVdg.js → packument-D_qCUp6X.js} +1 -1
- package/dist/packem_shared/{pm-runner-Dboj-wZG.js → pm-runner-BXRi4ZM9.js} +1 -1
- package/dist/packem_shared/{project-name-filter-BaNT9PF1.js → project-name-filter-D7cvTZtS.js} +1 -1
- package/dist/packem_shared/{provenance-hPmg4D9e.js → provenance-DSeGe6vU.js} +1 -1
- package/dist/packem_shared/publish-missing-DwaM7zcX.js +35 -0
- package/dist/packem_shared/{registry-DaY1tH69.js → registry-Mb5e6Tf4.js} +1 -1
- package/dist/packem_shared/{registry-keys-B1b-MFP6.js → registry-keys-CQxcAR-Z.js} +1 -1
- package/dist/packem_shared/{renderToString-DR0zDUjh-BzIHLV02.js → renderToString-DR0zDUjh-DPXtZSQK.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-C-Qc73VZ.js → resolve-explicit-YbCvwu7l.js} +1 -1
- package/dist/packem_shared/run-QPhRQBU4.js +6 -0
- package/dist/packem_shared/{run-summary-utils-Bz0Fq3q3.js → run-summary-utils-B0K6xaLZ.js} +1 -1
- package/dist/packem_shared/{runtime-check-7pGe-ptt.js → runtime-check-DDPs78Zv.js} +1 -1
- package/dist/packem_shared/{s1ngularity-CeSYloWQ.js → s1ngularity-CCkRFMDX.js} +1 -1
- package/dist/packem_shared/{scaffold-files-BZRkrVnT.js → scaffold-files-Xt6zE44I.js} +1 -1
- package/dist/packem_shared/{scan-progress-Bxr5DqWu.js → scan-progress-BbxXKvTV.js} +1 -1
- package/dist/packem_shared/{selectors-uGh3j_Ce.js → selectors-CwKjRLHo.js} +1 -1
- package/dist/packem_shared/{signatures-DjjdqqtW.js → signatures-DDD9Iaer.js} +1 -1
- package/dist/packem_shared/{spinner-BI-NQvQX.js → spinner-BItORXCk.js} +1 -1
- package/dist/packem_shared/{table-Byv6YfYO.js → table-DsmWzLWy.js} +1 -1
- package/dist/packem_shared/{tabs-CNN1Z6U6.js → tabs-D61j1uvE.js} +1 -1
- package/dist/packem_shared/{toolchain-B0ic303K.js → toolchain-Z0l12EQs.js} +1 -1
- package/dist/packem_shared/{typosquats-Dx_QW5sl.js → typosquats-Da4w5sjI.js} +1 -1
- package/dist/packem_shared/{use-measured-height-B0D6tnv2.js → use-measured-height-UU40gqT7.js} +1 -1
- package/dist/packem_shared/{vis-update-app-DjbXm1SN.js → vis-update-app-Bin63opa.js} +1 -1
- package/dist/packem_shared/{vis-user-error-DlzyKBvZ.js → vis-user-error-wkTUvlyX.js} +1 -1
- package/dist/packem_shared/{watch-loop-CfNKnvsq.js → watch-loop-CGBVtTBl.js} +1 -1
- package/dist/release/index.d.ts +16 -3
- package/dist/release/index.js +1 -1
- package/dist/release/types.d.ts +36 -7
- package/index.js +26 -26
- package/package.json +9 -9
- package/schemas/vis-config.schema.json +15 -3
- package/schemas/vis-release-config.schema.json +15 -3
- package/dist/packem_shared/ReleaseClient-CRuCHDsT.js +0 -1
- package/dist/packem_shared/apply-release-plan-BalHtK-g.js +0 -15
- package/dist/packem_shared/glob-Cyk1H9ZL-COU9A0Hc.js +0 -1
- package/dist/packem_shared/publish-DkgvB2Lk.js +0 -34
- package/dist/packem_shared/run-DD9lvuPN.js +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/vis",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.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.3.0",
|
|
156
|
+
"@visulima/vis-binding-darwin-x64": "6.3.0",
|
|
157
|
+
"@visulima/vis-binding-linux-arm64-gnu": "6.3.0",
|
|
158
|
+
"@visulima/vis-binding-linux-arm64-musl": "6.3.0",
|
|
159
|
+
"@visulima/vis-binding-linux-x64-gnu": "6.3.0",
|
|
160
|
+
"@visulima/vis-binding-linux-x64-musl": "6.3.0",
|
|
161
|
+
"@visulima/vis-binding-win32-arm64-msvc": "6.3.0",
|
|
162
|
+
"@visulima/vis-binding-win32-x64-msvc": "6.3.0"
|
|
163
163
|
},
|
|
164
164
|
"engines": {
|
|
165
165
|
"node": "^22.14.0 || >=24.10.0"
|
|
@@ -4439,6 +4439,10 @@
|
|
|
4439
4439
|
},
|
|
4440
4440
|
"description": "Globs that override `ignore` and `private` exclusion."
|
|
4441
4441
|
},
|
|
4442
|
+
"internalDependencyRanges": {
|
|
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 <2.0.0-0`, which `\"rewrite\"` turns into `>=<newVersion>` (ratcheted floor, no ceiling)."
|
|
4445
|
+
},
|
|
4442
4446
|
"linked": {
|
|
4443
4447
|
"type": "array",
|
|
4444
4448
|
"items": {
|
|
@@ -4842,6 +4846,14 @@
|
|
|
4842
4846
|
],
|
|
4843
4847
|
"additionalProperties": false
|
|
4844
4848
|
},
|
|
4849
|
+
"InternalDependencyRangesMode": {
|
|
4850
|
+
"type": "string",
|
|
4851
|
+
"enum": [
|
|
4852
|
+
"rewrite",
|
|
4853
|
+
"preserve-satisfying"
|
|
4854
|
+
],
|
|
4855
|
+
"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."
|
|
4856
|
+
},
|
|
4845
4857
|
"NotificationsConfig": {
|
|
4846
4858
|
"type": "object",
|
|
4847
4859
|
"properties": {
|
|
@@ -5612,7 +5624,7 @@
|
|
|
5612
5624
|
"properties": {
|
|
5613
5625
|
"commentBody": {
|
|
5614
5626
|
"type": "string",
|
|
5615
|
-
"description": "Comment body template posted on every referenced PR / issue. Tokens: - `{
|
|
5627
|
+
"description": "Comment body template posted on every referenced PR / issue. Tokens: - `{releases}` — every package + version the ref shipped in, with release and npm links, grouped per channel and accumulated across waves. A channel listing more than 10 packages collapses into a `<details>` block. - `{version}` — the version of the first package in this wave - `{name}` — the name of the first package in this wave - `{tag}` — this wave's channel tag (dist-tag), e.g. `latest` - `{url}` — the first package's forge release URL when available\n\nDefault: `\":tada: This has been released :tada:\\n\\n{releases}\"`."
|
|
5616
5628
|
},
|
|
5617
5629
|
"enabled": {
|
|
5618
5630
|
"type": "boolean",
|
|
@@ -5627,11 +5639,11 @@
|
|
|
5627
5639
|
},
|
|
5628
5640
|
"skipPrerelease": {
|
|
5629
5641
|
"type": "boolean",
|
|
5630
|
-
"description": "Skip the walk entirely on prerelease channels — the typical \"don't notify users their PR shipped in a beta\" guardrail. Default `true`."
|
|
5642
|
+
"description": "Skip the walk entirely on prerelease channels — the typical \"don't notify users their PR shipped in a beta\" guardrail. Default `true`. A monorepo that releases from a prerelease line (`1.0.0-alpha.*`) must set `false`, or no comment is ever posted."
|
|
5631
5643
|
}
|
|
5632
5644
|
},
|
|
5633
5645
|
"additionalProperties": false,
|
|
5634
|
-
"description": "Post-release notification walk — semantic-release parity.\n\n**Default OFF.** Set `release.successWalk: {}` to opt in with defaults. Leaving `successWalk` undefined in the workspace config is the explicit \"don't touch third-party PRs\" stance — sticky comments and the `released` label are an irreversible side effect on every PR mentioned in a changelog body, so we never apply them implicitly.\n\nWhen opted in, after a successful publish wave vis walks every PR / issue referenced in the rendered changelog entries and: 1. Posts (or upserts)
|
|
5646
|
+
"description": "Post-release notification walk — semantic-release parity.\n\n**Default OFF.** Set `release.successWalk: {}` to opt in with defaults. Leaving `successWalk` undefined in the workspace config is the explicit \"don't touch third-party PRs\" stance — sticky comments and the `released` label are an irreversible side effect on every PR mentioned in a changelog body, so we never apply them implicitly.\n\nWhen opted in, after a successful publish wave vis walks every PR / issue referenced in the rendered changelog entries and: 1. Posts (or upserts) one sticky comment listing every package + version the ref shipped in. The list accumulates per channel (dist-tag): a PR shipped on `alpha` and later on `latest` shows both, and re-running a wave changes nothing. 2. Adds the configured labels (default `[\"released\"]`).\n\nOn GitLab, `#N` is an issue and `!N` a merge request; each gets the note and labels on its own object. On GitHub the token needs `issues: write` and `pull-requests: write`.\n\nFailure to walk a single ref is non-fatal — the publish itself already succeeded; we don't want a forge API blip rolling that back."
|
|
5635
5647
|
},
|
|
5636
5648
|
"UpdateInternalDependenciesMode": {
|
|
5637
5649
|
"type": "string",
|
|
@@ -293,6 +293,10 @@
|
|
|
293
293
|
},
|
|
294
294
|
"description": "Globs that override `ignore` and `private` exclusion."
|
|
295
295
|
},
|
|
296
|
+
"internalDependencyRanges": {
|
|
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 <2.0.0-0`, which `\"rewrite\"` turns into `>=<newVersion>` (ratcheted floor, no ceiling)."
|
|
299
|
+
},
|
|
296
300
|
"linked": {
|
|
297
301
|
"type": "array",
|
|
298
302
|
"items": {
|
|
@@ -696,6 +700,14 @@
|
|
|
696
700
|
],
|
|
697
701
|
"additionalProperties": false
|
|
698
702
|
},
|
|
703
|
+
"InternalDependencyRangesMode": {
|
|
704
|
+
"type": "string",
|
|
705
|
+
"enum": [
|
|
706
|
+
"rewrite",
|
|
707
|
+
"preserve-satisfying"
|
|
708
|
+
],
|
|
709
|
+
"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."
|
|
710
|
+
},
|
|
699
711
|
"NotificationsConfig": {
|
|
700
712
|
"type": "object",
|
|
701
713
|
"properties": {
|
|
@@ -1466,7 +1478,7 @@
|
|
|
1466
1478
|
"properties": {
|
|
1467
1479
|
"commentBody": {
|
|
1468
1480
|
"type": "string",
|
|
1469
|
-
"description": "Comment body template posted on every referenced PR / issue. Tokens: - `{
|
|
1481
|
+
"description": "Comment body template posted on every referenced PR / issue. Tokens: - `{releases}` — every package + version the ref shipped in, with release and npm links, grouped per channel and accumulated across waves. A channel listing more than 10 packages collapses into a `<details>` block. - `{version}` — the version of the first package in this wave - `{name}` — the name of the first package in this wave - `{tag}` — this wave's channel tag (dist-tag), e.g. `latest` - `{url}` — the first package's forge release URL when available\n\nDefault: `\":tada: This has been released :tada:\\n\\n{releases}\"`."
|
|
1470
1482
|
},
|
|
1471
1483
|
"enabled": {
|
|
1472
1484
|
"type": "boolean",
|
|
@@ -1481,11 +1493,11 @@
|
|
|
1481
1493
|
},
|
|
1482
1494
|
"skipPrerelease": {
|
|
1483
1495
|
"type": "boolean",
|
|
1484
|
-
"description": "Skip the walk entirely on prerelease channels — the typical \"don't notify users their PR shipped in a beta\" guardrail. Default `true`."
|
|
1496
|
+
"description": "Skip the walk entirely on prerelease channels — the typical \"don't notify users their PR shipped in a beta\" guardrail. Default `true`. A monorepo that releases from a prerelease line (`1.0.0-alpha.*`) must set `false`, or no comment is ever posted."
|
|
1485
1497
|
}
|
|
1486
1498
|
},
|
|
1487
1499
|
"additionalProperties": false,
|
|
1488
|
-
"description": "Post-release notification walk — semantic-release parity.\n\n**Default OFF.** Set `release.successWalk: {}` to opt in with defaults. Leaving `successWalk` undefined in the workspace config is the explicit \"don't touch third-party PRs\" stance — sticky comments and the `released` label are an irreversible side effect on every PR mentioned in a changelog body, so we never apply them implicitly.\n\nWhen opted in, after a successful publish wave vis walks every PR / issue referenced in the rendered changelog entries and: 1. Posts (or upserts)
|
|
1500
|
+
"description": "Post-release notification walk — semantic-release parity.\n\n**Default OFF.** Set `release.successWalk: {}` to opt in with defaults. Leaving `successWalk` undefined in the workspace config is the explicit \"don't touch third-party PRs\" stance — sticky comments and the `released` label are an irreversible side effect on every PR mentioned in a changelog body, so we never apply them implicitly.\n\nWhen opted in, after a successful publish wave vis walks every PR / issue referenced in the rendered changelog entries and: 1. Posts (or upserts) one sticky comment listing every package + version the ref shipped in. The list accumulates per channel (dist-tag): a PR shipped on `alpha` and later on `latest` shows both, and re-running a wave changes nothing. 2. Adds the configured labels (default `[\"released\"]`).\n\nOn GitLab, `#N` is an issue and `!N` a merge request; each gets the note and labels on its own object. On GitHub the token needs `issues: write` and `pull-requests: write`.\n\nFailure to walk a single ref is non-fatal — the publish itself already succeeded; we don't want a forge API blip rolling that back."
|
|
1489
1501
|
},
|
|
1490
1502
|
"UpdateInternalDependenciesMode": {
|
|
1491
1503
|
"type": "string",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as i}from"../packem_chunks/context.js";import{a as d}from"./apply-DoeQAAGm.js";import{p as u}from"./publish-DkgvB2Lk.js";const y=async(t={})=>{const e=await i(t),a=await d(e,{dryRun:t.dryRun});return{changedFiles:a.changedFiles,deletedFiles:a.deletedFiles,plan:a.plan}},w=async(t={})=>{const e=await i(t),{resolveFormatter:a}=await import("../packem_chunks/resolveFormatter.js"),n=await a(e.config.changelog,e.cwd),r=new Date().toISOString().slice(0,10),s=[];for(const c of e.plan.releases){const l=e.depGraph.getPackage(c.name);if(!l)continue;const o=await n({changeFiles:c.changeFiles,date:r,release:c,target:"changelog"});s.push({content:o,file:`${l.dir}/CHANGELOG.md`,package:c.name})}return{projectChangelogs:s}},m=async(t={})=>{const e=await i(t);return await u(e,{dryRun:t.dryRun,otp:t.otp,tag:t.tag})},F=async(t={})=>{const e=await i(t);let a=!1,n;const r=async()=>{if(n)return n;a=!0;const s=await d(e,{dryRun:t.dryRun});return n={changedFiles:s.changedFiles,deletedFiles:s.deletedFiles,plan:s.plan},n};return{apply:r,discard:()=>{a=!0},plan:e.plan,[Symbol.asyncDispose]:async()=>{a||await r()}}},R=async t=>{const e=await i(t),{runSnapshot:a}=await import("../packem_chunks/snapshot.js"),n=await a({context:e,dryRun:t.dryRun,registry:t.registry,tag:t.tag});return{failed:n.failed,published:n.published,skipped:n.skipped,snapshotVersion:n.snapshotVersion,tag:n.tag}},C=async(t={})=>{const e=await i(t),a=await d(e,{dryRun:t.dryRun}),n={changedFiles:a.changedFiles,deletedFiles:a.deletedFiles,plan:a.plan},{resolveFormatter:r}=await import("../packem_chunks/resolveFormatter.js"),s=await r(e.config.changelog,e.cwd),c=new Date().toISOString().slice(0,10),l=[];for(const g of a.plan.releases){const p=e.depGraph.getPackage(g.name);if(!p)continue;const f=await s({changeFiles:g.changeFiles,date:c,release:g,target:"changelog"});l.push({content:f,file:`${p.dir}/CHANGELOG.md`,package:g.name})}const o={projectChangelogs:l};if(t.skipPublish)return{changelog:o,publish:{failed:[],published:[],skipped:[]},version:n};const h=await u(e,{dryRun:t.dryRun,otp:void 0,tag:void 0});return{changelog:o,publish:h,version:n}};class S{constructor(e={}){this.config=e}config;releaseVersion(e={}){return y({...e,config:this.config})}releaseChangelog(e={}){return w({...e,config:this.config})}releasePublish(e={}){return m({...e,config:this.config})}releaseDraft(e={}){return F({...e,config:this.config})}releaseSnapshot(e){return R({...e,config:this.config})}}export{S as ReleaseClient,C as release,w as releaseChangelog,F as releaseDraft,m as releasePublish,R as releaseSnapshot,y as releaseVersion};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const m=["dependencies","devDependencies","peerDependencies","optionalDependencies"],$=(e,s)=>{if(e.startsWith("catalog:")||e==="*"||e==="workspace:*"||e==="workspace:^"||e==="workspace:~")return e;if(e.startsWith("workspace:")){const n=e.slice(10);return`workspace:${g(n)}${s}`}if(e.startsWith("npm:")){const n=e.lastIndexOf("@");if(n<=4)return e;const i=e.slice(4,n),r=e.slice(n+1),a=g(r);return`npm:${i}@${a}${s}`}return`${g(e)}${s}`},w=/^([\^~=]|>=?|<=?)/,g=e=>{const s=w.exec(e);return s?s[1]??"^":"^"},W=async(e,s,t={})=>{const n=t.serializeManifest??C,i=t.changelogPath??x,r=t.renderChangelogEntry??M,a=new Map(e.releases.map(o=>[o.name,o.newVersion])),p=await Promise.all(e.releases.map(async o=>{const c=s.getPackage(o.name);if(!c)return;const h=y(c.manifest,o.newVersion,a),d=t.readManifest?.(c.manifestPath),u=i(c);return{changelogEntry:await r(o),changelogPath:u,manifestWrite:c.ecosystem===void 0?{content:n(h,d),path:c.manifestPath}:void 0}})),f=[],l=new Map;for(const o of p){if(!o)continue;o.manifestWrite&&f.push(o.manifestWrite);const c=l.get(o.changelogPath);c?c.push(o.changelogEntry):l.set(o.changelogPath,[o.changelogEntry])}for(const[o,c]of l){const h=c.join(`
|
|
2
|
-
|
|
3
|
-
`),d=t.readChangelog?.(o);f.push({content:k(h,d),path:o})}return{deletions:e.consumedChangeFiles.map(o=>o.path),writes:f}},y=(e,s,t)=>{const n={...e,version:s};for(const i of m){const r=e[i];if(!r||typeof r!="object")continue;const a={...r};let p=!1;for(const[f,l]of Object.entries(r)){const o=t.get(f);if(o===void 0)continue;const c=$(l,o);c!==l&&(a[f]=c,p=!0)}p&&(n[i]=a)}return n},E=/^# .+/,P=/^## /m,k=(e,s)=>{const t=e.trim();if(!s||s.trim()==="")return`# Changelog
|
|
4
|
-
|
|
5
|
-
${t}
|
|
6
|
-
`;const n=s.split(/\r?\n/);if(n[0]&&E.test(n[0])){let i=1;for(;i<n.length&&!(n[i]??"").startsWith("## ");)i+=1;const r=n.slice(0,i),a=n.slice(i);return r.length>0&&r[r.length-1]!==""&&r.push(""),[...r,t,"",...a].join(`
|
|
7
|
-
`).replaceAll(/\n{3,}/g,`
|
|
8
|
-
|
|
9
|
-
`)}return P.test(s)?`${t}
|
|
10
|
-
|
|
11
|
-
${s.trimStart()}`:`${t}
|
|
12
|
-
|
|
13
|
-
${s.trimStart()}`},C=(e,s)=>{const t=D(s);return`${JSON.stringify(e,null,t)}
|
|
14
|
-
`},D=e=>{if(!e)return 4;const s=/\n(\s+)"/.exec(e);if(!s)return 4;const t=(s[1]??"").length;return t===2||t===4?t:4},x=e=>`${e.dir}/CHANGELOG.md`,M=e=>{const s=new Date().toISOString().slice(0,10),t=[`## ${e.newVersion}`,`<sub>${s}</sub>`,""];if(e.isCascadeBump||e.isGroupBump)for(const n of e.sources)t.push(`- Version bump from ${n.name}@${n.newVersion}`);else if(e.isDependencyBump&&e.changeFiles.length===0)for(const n of e.sources)n.newVersion===""?t.push(`- Removed dependency ${n.name}`):t.push(`- Updated dependency ${n.name}@${n.newVersion}`);else for(const n of e.changeFiles)for(const i of n.body.split(/\r?\n/)){if(i.trim()===""){t.push("");continue}t.push(i.startsWith("-")||i.startsWith("*")?i:`- ${i}`)}return t.join(`
|
|
15
|
-
`)};export{W as a,k as p,$ as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as t}from"./registry-DaY1tH69.js";const s=async(a,o)=>await t(a,o);export{s as l};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import{DEFAULT_CHANGES_DIR as V}from"../packem_chunks/DEFAULT_CLEAN_KEEP.js";import{createShellRunner as F}from"../packem_chunks/shell-runner.js";import{r as _,b as W}from"./apply-DoeQAAGm.js";import{parseCatalogs as D}from"../packem_chunks/catalog.js";import{c as E}from"../packem_chunks/index3.js";import{r as M}from"../packem_chunks/context.js";import{escapeMarkdown as L}from"../packem_chunks/security.js";import{VisReleaseError as O}from"./VisReleaseError-DZtgcKf8.js";const B=/\{(name|version|previousVersion|date|repo|contributors)\}/g,U=(e,s)=>e.replaceAll(B,(i,g)=>s[g]??""),K=(e,s={})=>{const i=new Set;for(const o of s.internalAuthors??[]){const u=o.trim().toLowerCase().replace(/^@/,"");u.length>0&&i.add(u)}const g=new Set,c=[];for(const o of e){const u=o.meta?.author;if(u)for(const r of u.split(",")){const t=r.trim();if(!t)continue;const h=t.replace(/^@/,"");if(h.length===0)continue;const n=h.toLowerCase();g.has(n)||i.has(n)||(g.add(n),c.push(L(t)))}}return c.length===0?"":c.map(o=>`- ${o}`).join(`
|
|
2
|
-
`)},J=e=>e.length===0?"":`## Related releases
|
|
3
|
-
|
|
4
|
-
${e.map(i=>`- [${i.name}](${i.url})`).join(`
|
|
5
|
-
`)}`,Y=(e,s,i)=>{if(!s||!s.header&&!s.footer)return e;const g=o=>U(o,{contributors:i.contributors??"",date:i.date,name:i.name,previousVersion:i.previousVersion,repo:i.repo,version:i.version}).replaceAll(/\n{3,}/g,`
|
|
6
|
-
|
|
7
|
-
`).replace(/\s+$/,""),c=[];if(s.header){const o=g(s.header);o.length>0&&c.push(o)}if(c.push(e),s.footer){const o=g(s.footer);o.length>0&&c.push(o)}return c.join(`
|
|
8
|
-
|
|
9
|
-
`)},z=e=>{if(!Array.isArray(e))return;const[s,i]=e;if(s!=="github"||typeof i!="object"||i===null)return;const{internalAuthors:g}=i;if(Array.isArray(g))return g.filter(c=>typeof c=="string")},q=e=>(e.config.publish?.publishArgs??[]).includes("--provenance")&&e.pm.id!=="bun",X=async(e,s)=>{const{options:i,persistState:g,releases:c,result:o,state:u}=s,{removePendingStages:r,upsertPendingStages:t}=await import("../packem_chunks/staged-registry.js"),h=await e.pm.readCatalogYaml(e.cwd),n=D(h),d=e.depGraph.topologicalSort(c.map(l=>l.name)),w=new Map(c.map(l=>[l.name,l])),b=new Set,C=new Map;for(const l of e.plan.releases){const m=e.depGraph.getPackage(l.name);m&&C.set(l.name,{...m.manifest,version:l.newVersion})}const P={config:e.config,cwd:e.cwd},R=e.config.plugins?.length?await import("../packem_chunks/defineReleasePlugin.js"):void 0;for(const l of d){const m=w.get(l);if(!m){o.skipped.push({name:l,reason:"topo-sort returned a name not in the release plan (internal bug)"});continue}const f=e.depGraph.getPackage(l);if(!f)continue;const y=[...new Set(e.depGraph.getDependencies(l).filter(p=>p.kind!=="devDependencies"&&b.has(p.name)).map(p=>p.name))];if(y.length>0){o.skipped.push({name:l,reason:`dependency-failed: not published because ${y.join(", ")} failed to publish (publishing would orphan this package's dependency range)`}),b.add(l);continue}const a=e.perPackageConfig.get(l)??{},v=M(f,a),$=i.publishActionsOverride??E(v),k=i.tag??e.channel?.tag;if(R){const p=await R.runWillPublishHooks(P,{dir:f.dir,name:l,oldVersion:m.oldVersion,version:m.newVersion});if(p.skip){o.skipped.push({name:l,reason:`plugin-skipped${p.by?` by "${p.by}"`:""}`}),b.add(l);continue}}const A=s.stagedRegistry.pending.find(p=>p.name===l&&p.version===m.newVersion);try{const p=await $.publish({catalogs:n,cleanPackageJsonConfig:e.config.publish?.cleanPackageJson,dryRun:i.dryRun,otp:i.otp,perPackageConfig:a,pkg:f,pm:e.pm,provenance:q(e),registry:a.registry,release:m,resumeStageId:A?.id,tag:k,versionedManifestByName:C,workspaceConfig:e.config});if(p.published||p.alreadyPublished){const T=s.stagedRegistry.pending.filter(H=>H.name===l&&H.version===m.newVersion).map(H=>H.id);T.length>0&&(s.stagedRegistry=r(s.stagedRegistry,T))}if(p.published)o.published.push({name:l,stageId:p.stageId,tarball:p.tarball,version:m.newVersion}),u.published.push(`${l}@${m.newVersion}`),R&&await R.runAfterPublishHooks(P,{dir:f.dir,name:l,oldVersion:m.oldVersion,version:m.newVersion});else if(p.alreadyPublished)o.skipped.push({name:l,reason:"already-published"}),u.published.push(`${l}@${m.newVersion}`);else if(o.skipped.push({name:l,reason:p.output??"skipped"}),p.stageId){const T=(p.output??"").startsWith("stage-rejected")?"rejected":"timeout";s.stagedRegistry=t(s.stagedRegistry,[{id:p.stageId,name:l,reason:T,stagedAt:new Date().toISOString(),tag:k??"latest",version:m.newVersion}])}await g()}catch(p){o.failed.push({name:l,reason:p.message}),b.add(l)}}R&&await R.runAfterPublishAllHooks(P,{failed:o.failed.map(l=>({name:l.name,reason:l.reason})),published:o.published.map(l=>({name:l.name,version:l.version})),skipped:o.skipped.map(l=>({name:l.name,reason:l.reason}))})},Q=async(e,s,i,g)=>{const{createRemoteClient:c,detectRemoteProvider:o}=await import("../packem_chunks/detect.js"),u=await o(e.cwd,i,e.config.provider),r=c(u,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}),t=await r.detectRepoSlug(e.cwd,i);if(!t)return;const h=typeof e.config.aggregateRelease=="object"?e.config.aggregateRelease:{enabled:e.config.aggregateRelease===!0},n=e.config.publish?.draftRelease===!0,d=e.config.publish?.discussionCategory,w=e.config.publish?.addReleases;if(h.enabled){const a=new Date().toISOString().slice(0,10),$=(h.title??"Release {date}").replaceAll("{date}",a),k=`release-${a}`,A=s.published.map(p=>`- \`${p.name}\` → ${p.version}`).join(`
|
|
10
|
-
`);try{const p=await r.createRelease(i,{body:A,cwd:e.cwd,discussionCategory:d,draft:n,repo:t,tag:k,title:$});if(p?.url)for(const T of s.published)T.url=p.url}catch{}return}const{defaultTagFor:b,renderTagPattern:C}=await import("../packem_chunks/git.js"),P=e.config.releaseTagPattern,R=e.channel?.tag,l=e.config.publish?.releaseAssets??{},m=new Date().toISOString().slice(0,10),f=z(e.config.changelog),y=K(e.plan.consumedChangeFiles??[],{internalAuthors:f});for(const a of g.groups){const v=a.members.map($=>`- \`${$}\` → ${s.published.find(k=>k.name===$)?.version??a.version}`).join(`
|
|
11
|
-
`);try{const $=await r.createRelease(i,{body:v,cwd:e.cwd,discussionCategory:d,draft:n,prerelease:a.version.includes("-"),repo:t,tag:a.tag,title:`${a.name} ${a.version}`});if($?.url)for(const k of s.published)a.members.includes(k.name)&&(k.url=$.url)}catch($){console.warn(`createRelease failed for group ${a.name} (tag ${a.tag}): ${$.message}`)}}for(const a of s.published){if(g.grouped.has(a.name))continue;const $=e.perPackageConfig.get(a.name)?.releaseTagPattern??P,k=$?C($,{channel:R,name:a.name,version:a.version}):b(a.name,a.version),A=a.version.includes("-");let p=`Release of ${a.name}@${a.version}.`;if(a.stageId&&(p=`${p}
|
|
12
|
-
|
|
13
|
-
> ⏳ **Staged — not yet installable.** Approve via \`vis release stage approve ${a.stageId}\` or the npmjs.com web UI.`),l.stampHashes&&a.tarball&&(p=`${p}
|
|
14
|
-
|
|
15
|
-
### Tarball integrity
|
|
16
|
-
|
|
17
|
-
- size: \`${a.tarball.size}\` bytes
|
|
18
|
-
- sha256: \`${a.tarball.sha256}\`
|
|
19
|
-
- sha512: \`${a.tarball.sha512}\``),w!==void 0&&w!==!1)try{const N=k.lastIndexOf("@"),S=N>0?k.slice(0,N+1):"",j=await r.listRecentReleases(i,{cwd:e.cwd,excludeTag:k,limit:5,repo:t,tagPrefix:S}),I=J(j);I&&(p=w==="top"?`${I}
|
|
20
|
-
|
|
21
|
-
${p}`:`${p}
|
|
22
|
-
|
|
23
|
-
${I}`)}catch{}const{releaseNoteTemplate:T}=e.config;if(T){const S=e.plan.releases.find(j=>j.name===a.name)?.oldVersion??"";p=Y(p,T,{contributors:y,date:m,name:a.name,previousVersion:S,repo:t,version:a.version})}const H=[];l.uploadTarball&&a.tarball&&H.push(a.tarball.path);try{const N=await r.createRelease(i,{assets:H.length>0?H:void 0,body:p,cwd:e.cwd,discussionCategory:d,draft:n,prerelease:A,repo:t,tag:k,title:`${a.name} v${a.version}`});N?.url&&(a.url=N.url)}catch(N){console.warn(`createRelease failed for ${a.name}@${a.version} (tag ${k}): ${N.message}`)}}},Z=async(e,s,i)=>{const{changesDir:g,options:c,persistState:o,result:u,runner:r,state:t}=s,{writeStagedRegistry:h}=await import("../packem_chunks/staged-registry.js");if(!c.dryRun&&u.published.length>0&&u.tagsPushed){e.config.publish?.noRelease!==!0&&await Q(e,u,r,i);try{const{walkSuccessfulRelease:n}=await import("../packem_chunks/success-walk.js"),{createRemoteClient:d,detectRemoteProvider:w}=await import("../packem_chunks/detect.js"),{resolveFormatter:b}=await import("../packem_chunks/resolveFormatter.js"),C=await w(e.cwd,r,e.config.provider),P=d(C,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}),R=await P.detectRepoSlug(e.cwd,r),l=await b(e.config.changelog,e.cwd),{recordRecentlyWalked:m}=await import("../packem_chunks/staged-registry.js"),f=new Set([...t.walked??[],...(s.stagedRegistry.recentlyWalked??[]).map(a=>a.key)]),y={...u,published:u.published.filter(a=>!f.has(`${a.name}@${a.version}`))};if(y.published.length>0){const a=await n(e,y,r,{client:P,formatter:l,repo:R}),v=y.published.map($=>`${$.name}@${$.version}`);t.walked=[...t.walked??[],...v],await o(),s.stagedRegistry=m(s.stagedRegistry,v),a.warnings.length>0&&e.plan.warnings.push(...a.warnings)}}catch(n){e.plan.warnings.push(`successWalk: could not run post-release walk: ${n.message}`)}if(e.config.notifications)try{const{dispatchNotifications:n}=await import("../packem_chunks/interface.js"),{createRemoteClient:d,detectRemoteProvider:w}=await import("../packem_chunks/detect.js"),b=await w(e.cwd,r,e.config.provider),P=await d(b,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,r);let R;try{const f=`${e.cwd}/package.json`,y=await import("node:fs/promises");R=JSON.parse(await y.readFile(f,"utf8")).name}catch{}const l=new Set([...t.notified??[],...(s.stagedRegistry.recentlyNotified??[]).map(f=>f.key)]),m=u.published.filter(f=>!l.has(`${f.name}@${f.version}`));if(m.length>0){const f=await n(e.config.notifications,{channel:e.channel?.tag,completedAt:new Date().toISOString(),...R===void 0?{}:{monorepoName:R},published:m.map(y=>({name:y.name,tag:e.channel?.tag,...y.url===void 0?{}:{url:y.url},version:y.version})),...P===void 0?{}:{repo:P},skipped:u.skipped.map(y=>({name:y.name,reason:y.reason}))},{warn:y=>e.plan.warnings.push(y)});if(f.succeeded.length>0){const y=m.map(v=>`${v.name}@${v.version}`);t.notified=[...t.notified??[],...y],await o();const{recordRecentlyNotified:a}=await import("../packem_chunks/staged-registry.js");s.stagedRegistry=a(s.stagedRegistry,y)}if(f.failed.length>0||f.succeeded.length>0){const y=f.succeeded.length+f.failed.length;if(f.failed.length>0){e.plan.warnings.push(`[notifications] dispatched ${f.succeeded.length}/${y} channels${f.succeeded.length>0?` (succeeded: ${f.succeeded.join(", ")})`:""}; ${f.failed.length} failed.`);for(const a of f.failed)e.plan.warnings.push(`[notifications:${a.id}] ${a.error}`)}}}}catch(n){e.plan.warnings.push(`notifications: dispatch failed: ${n.message}`)}if(!c.dryRun)try{const n=await h(e.cwd,g,s.stagedRegistry);if(n.changed){const{stageAndCommitFile:d}=await import("../packem_chunks/git.js");try{await d({cwd:e.cwd,runner:r},n.path,"chore(release): record cross-runner notify/walk dedupe [skip ci]",{author:e.config.gitUser,push:!c.noPush,sign:e.config.gitSignCommits===!0})}catch(w){process.stderr.write(`[vis release] Warning: could not commit ${n.path} (notify/walk dedupe): ${w.message}
|
|
24
|
-
`)}}}catch(n){process.stderr.write(`[vis release] Warning: could not update cross-runner dedupe registry: ${n.message}
|
|
25
|
-
`)}}},x=async e=>{const{defaultTagFor:s,floatingMajorTagFor:i,renderTagPattern:g}=await import("../packem_chunks/git.js"),{resolveSyncTagGroups:c}=await import("../packem_chunks/group-tags.js"),o=e.plan.releases.filter(n=>e.depGraph.getPackage(n.name)?.manifest?.private!==!0).map(n=>({name:n.name,version:n.newVersion})),u=c(e.config,o),r=u.groups.map(n=>n.tag),t=[],h=!!e.channel?.prerelease||!!e.preMode;for(const{name:n,version:d}of o){if(u.grouped.has(n))continue;const w=e.perPackageConfig.get(n),b=w?.releaseTagPattern??e.config.releaseTagPattern;if(r.push(b?g(b,{channel:e.channel?.tag,name:n,version:d}):s(n,d)),e.config.floatingMajorTag===!0&&!h&&!b?.includes("{major}")&&w?.skipNpmPublish!==!0){const C=i(n,d);C!==void 0&&t.push(C)}}return{created:r,updated:t}},ee=async(e,s,i)=>{if((await s.run("git",["remote","get-url","--push","origin"],{cwd:e.cwd,silent:!0})).exitCode!==0)return;const{getCurrentBranch:c,resolvePushCredentials:o,verifyPushAccess:u}=await import("../packem_chunks/git.js"),r={cwd:e.cwd,runner:s},t=await u(r);if(t!==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: ${t}`;const{createRemoteClient:h,detectRemoteProvider:n}=await import("../packem_chunks/detect.js");let d;try{d=await n(e.cwd,s,e.config.provider)}catch{return}if(d!=="github")return;const b=await h(d,{githubHost:e.config.githubHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,s);if(!b)return;const C=await o(r),P={...process.env};C!==void 0&&(P.GH_TOKEN=C.token),e.config.githubHost&&(P.GH_HOST=e.config.githubHost),e.config.httpProxy&&(P.HTTPS_PROXY=e.config.httpProxy,P.HTTP_PROXY=e.config.httpProxy);const{checkGithubPushRules:R}=await import("../packem_chunks/github-push-rules.js"),l=i.noTag?{created:[],updated:[]}:await x(e),m=await R(s,{branch:await c(r),createdTags:l.created,cwd:e.cwd,env:P,repo:b,signedCommits:e.config.gitSignCommits===!0,updatedTags:l.updated});for(const f of m.warnings)process.stderr.write(`[vis release] Warning: ${f}
|
|
26
|
-
`);if(m.blocked.length>0)return`GitHub push rules would reject this release, nothing was published:
|
|
27
|
-
- ${m.blocked.join(`
|
|
28
|
-
- `)}
|
|
29
|
-
Grant the pushing token a bypass, adjust the ruleset, or pass --no-push / --no-tag.`},ae=async(e,s,i,g)=>{if(!i.dryRun&&e.channel?.mode==="version-pr"){const{createRemoteClient:c,detectRemoteProvider:o}=await import("../packem_chunks/detect.js");let u;try{const t=await o(e.cwd,s,e.config.provider);u=await c(t,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,s)}catch(t){return g.failed.push({name:"_preflight",reason:`Could not read the remote to check for an open release PR: ${t.message}`}),!0}const r=e.config.versionPr?.branch??"vis-release/version-packages";if(u)try{const t=await s.run("gh",["pr","list","--head",r,"--state","open","--json","number"],{cwd:e.cwd,silent:!0});if(t.exitCode===0&&t.stdout.trim()&&t.stdout.trim()!=="[]"){const h=JSON.parse(t.stdout);if(h[0])return g.failed.push({name:"_preflight",reason:`Open release PR #${h[0].number} exists. Merge or close it before publishing locally. (Override: --no-push then \`git push --tags\` manually.)`}),!0}}catch{}}if(!i.dryRun&&e.config.prePublishCommand)try{await _(e.cwd,e.config.prePublishCommand,"prePublishCommand")}catch(c){return g.failed.push({name:"_prePublishCommand",reason:c.message}),!0}if(!i.dryRun&&!i.noPush){let c;try{c=await ee(e,s,{noTag:i.noTag===!0})}catch(o){return g.failed.push({name:"_preflight",reason:`Could not verify the release pushes: ${o.message}`}),!0}if(c!==void 0)return g.failed.push({name:"_pushAccess",reason:c}),!0}return!1},se=async(e,s)=>{const{changesDir:i,options:g,runner:c}=s,{writeStagedRegistry:o}=await import("../packem_chunks/staged-registry.js");if(!g.dryRun){const u=s.priorRegistrySnapshot.pending.length,r=s.stagedRegistry.pending.length,t=await o(e.cwd,i,s.stagedRegistry);if(t.changed){const{stageAndCommitFile:h}=await import("../packem_chunks/git.js");let n;if(t.removed)n="chore(release): clear pending stage registry [skip ci]";else if(r>u){const d=r-u;n=`chore(release): record ${d} new pending stage${d===1?"":"s"} [skip ci]`}else if(r<u){const d=u-r;n=`chore(release): drain ${d} resolved stage${d===1?"":"s"} [skip ci]`}else n=`chore(release): update pending stage registry (${r} pending) [skip ci]`;try{await h({cwd:e.cwd,runner:c},t.path,n,{author:e.config.gitUser,push:!g.noPush,sign:e.config.gitSignCommits===!0})}catch(d){process.stderr.write(`[vis release] Warning: could not commit ${t.path}: ${d.message}
|
|
30
|
-
`)}}}},ie=async(e,s)=>{const{options:i,result:g,runner:c}=s;if(!i.dryRun&&g.published.length>0&&e.config.workspaceChangelog!==!1){const o=e.config.workspaceChangelog,u=typeof o=="object"?o:void 0,r=typeof e.config.aggregateRelease=="object"?e.config.aggregateRelease.enabled:e.config.aggregateRelease===!0;if(u!==void 0||r)try{const{writeWorkspaceChangelogWave:t}=await import("../packem_chunks/workspace.js"),h=new Set(g.published.map(w=>w.name)),n=e.plan.releases.filter(w=>h.has(w.name)),d=await t({changelogConfig:e.config.changelog,cwd:e.cwd,workspaceChangelog:e.config.workspaceChangelog},n);if(d)try{const{stageAndCommitFile:w}=await import("../packem_chunks/git.js");await w({cwd:e.cwd,runner:c},d,"chore(release): record wave [skip ci]",{author:e.config.gitUser,push:!i.noPush,sign:e.config.gitSignCommits===!0})}catch(w){process.stderr.write(`[vis release] Warning: could not commit workspace CHANGELOG.md: ${w.message}
|
|
31
|
-
`)}}catch(t){process.stderr.write(`[vis release] Warning: could not write workspace CHANGELOG.md wave entry: ${t.message}
|
|
32
|
-
`)}}},G=async(e,s,i,g,c)=>{const{stageAndCommitFile:o}=await import("../packem_chunks/git.js"),{stateFilePath:u}=await import("../packem_chunks/state.js");try{const r=await o({cwd:e.cwd,runner:s},u(e.cwd,i,!0),`chore(release): ${g} publish lock [skip ci]`,{author:e.config.gitUser,push:!c.noPush,sign:e.config.gitSignCommits===!0});!c.noPush&&r.committed&&!r.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(r){process.stderr.write(`[vis release] Warning: could not commit publish lock (${g}): ${r.message}
|
|
34
|
-
`)}},re=async(e,s,i,g)=>{const{filterPlanByState:c,newState:o,readState:u,writeState:r}=await import("../packem_chunks/state.js"),{readStagedRegistry:t}=await import("../packem_chunks/staged-registry.js"),h=e.config.changesDir??V,n=e.config.publish?.lockInGit===!0;let d=i.resume||n?await u(e.cwd,h,n):void 0;d&&n&&(d.channel=e.channel?.tag);const w=async()=>{i.dryRun||!d||(await r(e.cwd,h,d,n),n&&await G(e,s,h,"progress",{noPush:i.noPush}))};let b=await t(e.cwd,h);await W(e,"publish",b,{runner:s}),b=await t(e.cwd,h);const C={...b,pending:[...b.pending]};let{releases:P}=e.plan;return d?P=c(P,d):(d=o(e.channel?.tag,e.plan.releases),i.dryRun||(await r(e.cwd,h,d,n),n&&await G(e,s,h,"open",{noPush:i.noPush}))),{changesDir:h,lockInGit:n,options:i,persistState:w,priorRegistrySnapshot:C,releases:P,result:g,runner:s,stagedRegistry:b,state:d}},te=async(e,s,i)=>{const{changesDir:g,lockInGit:c,options:o,persistState:u,result:r,runner:t,state:h}=s,{clearState:n}=await import("../packem_chunks/state.js");if(!o.dryRun&&!o.noTag&&r.published.length>0){const{createOrUpdateFloatingTag:d,createTag:w,defaultTagFor:b,floatingMajorTagFor:C,pushTags:P,renderTagPattern:R}=await import("../packem_chunks/git.js"),l=e.config.releaseTagPattern,m=e.channel?.tag,f=e.config.floatingMajorTag===!0,y=!!e.channel?.prerelease||!!e.preMode;for(const{name:a,version:v}of r.published){if(i.grouped.has(a))continue;const k=e.perPackageConfig.get(a)?.releaseTagPattern??l,A=k?R(k,{channel:m,name:a,version:v}):b(a,v);try{await w({cwd:e.cwd,runner:t},A,`Release ${a}@${v}`,{signing:e.config.signing,skipRemoteCheck:e.firstRelease}),r.tags.push(A)}catch(S){e.firstRelease&&S instanceof O&&S.code==="TAG_COLLISION"?r.skipped.push({name:A,reason:"tag-creation: tag already exists (first-release — skipped)"}):r.failed.push({name:A,reason:`tag-creation: ${S.message}`})}const p=e.depGraph.getPackage(a),T=e.perPackageConfig.get(a),H=p?.manifest?.private===!0,N=T?.skipNpmPublish===!0;if(f&&!y&&!k?.includes("{major}")&&!H&&!N){const S=C(a,v);if(S!==void 0)try{await d({cwd:e.cwd,runner:t},S,{push:!o.noPush,signing:e.config.signing}),r.tags.push(S)}catch(j){r.skipped.push({name:S,reason:`floating-major-tag: ${j.message}`})}}}for(const a of i.groups)try{await w({cwd:e.cwd,runner:t},a.tag,`Release ${a.name} ${a.version}`,{signing:e.config.signing,skipRemoteCheck:e.firstRelease}),r.tags.push(a.tag)}catch(v){e.firstRelease&&v instanceof O&&v.code==="TAG_COLLISION"?r.skipped.push({name:a.tag,reason:"tag-creation: tag already exists (first-release — skipped)"}):r.failed.push({name:a.tag,reason:`tag-creation: ${v.message}`})}if(!o.noPush&&r.tags.length>0)try{await P({cwd:e.cwd,runner:t}),r.tagsPushed=!0}catch(a){r.tagsPushed=!1,r.failed.push({name:"_pushTags",reason:`git push --tags failed: ${a.message}. Retry with: git push --tags`})}h.tagged=[...r.tags],h.pushed=r.tagsPushed,await u(),r.failed.length===0&&!o.dryRun&&(await n(e.cwd,g,c),c&&await G(e,t,g,"close",{noPush:o.noPush}))}},he=async(e,s={})=>{const i={failed:[],published:[],skipped:[],tags:[],tagsPushed:!1},g=F();if(e.plan.releases.length===0||await ae(e,g,s,i))return i;const c=e.config.changesDir??V,{acquireLock:o,releaseLock:u}=await import("../packem_chunks/state.js");let r=!1;if(!s.dryRun)try{await o(e.cwd,c),r=!0}catch(t){return i.failed.push({name:"_lock",reason:t.message}),i}try{const t=await re(e,g,s,i);await X(e,t);const{resolveSyncTagGroups:h}=await import("../packem_chunks/group-tags.js"),n=h(e.config,i.published);if(await te(e,t,n),await se(e,t),await ie(e,t),await Z(e,t,n),!s.dryRun&&e.config.postPublishCommand)try{await _(e.cwd,e.config.postPublishCommand,"postPublishCommand")}catch(d){i.failed.push({name:"_postPublishCommand",reason:d.message})}return i}finally{r&&await u(e.cwd,c)}};export{he as p};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{createRequire as re}from"node:module";import{DEFAULT_CHANGES_DIR as oe}from"../packem_chunks/DEFAULT_CLEAN_KEEP.js";import{maxBump as ae}from"../release/types.js";import{f as ce}from"../packem_chunks/context.js";import{r as le}from"./slug-OBHcH7wV.js";import{resolveLastReleaseRef as fe}from"../packem_chunks/version-resolver.js";let ne;const se=r=>(ne??=re(import.meta.url))(r),A=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ie=r=>{if(typeof A<"u"&&A.versions&&A.versions.node){const[e,t]=A.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return A.getBuiltinModule(r)}return se(r)},{join:O}=ie("node:path"),q=/(?!.*)/;function he(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function I(r){return r.map(e=>typeof e=="string"?he(e.trim()):e.source).filter(Boolean).join("|")}function ue(r,e){if(!r)return q;const t=I(r);return e?e(t):new RegExp(`^(?:\\*\\s+)?(${t}):\\s*(.*)`,"i")}function de(r,e){if(!r)return q;const t=e?"g":"gi";return new RegExp(`(?:.*?)??\\s*([\\w-\\.\\/]*?)??(${I(r)})([\\w-]+)(?=\\s|$|[,;.)\\]])`,t)}function G(r,e=""){if(!r)return/()(.+)/gi;const t=I(r),n=`(?<!\\w)(?:${t})(?!\\w)`;return new RegExp(`(?<!\\w)(${t})${e}(?:\\s+(.*?))(?=${n}|$)`,"gi")}function me(r){const e=r?`|\\s+(?:${I(r)})`:"";return new RegExp(`^(?:BREAKING CHANGE|[\\w-]+)(?::\\s+${e}).+`,"i")}function ge(r={}){const e=ue(r.noteKeywords,r.notesPattern),t=de(r.issuePrefixes,r.issuePrefixesCaseSensitive),n=G(r.referenceActions),s=G(r.referenceActions,":?"),o=me(r.issuePrefixes);return{notes:e,referenceParts:t,references:n,footerReferences:s,footerToken:o,mentions:/@([\w-]+)/g,url:/\b(?:https?):\/\/(?:www\.)?([-a-zA-Z0-9@:%_+.~#?&//=])+\b/}}const pe="------------------------ >8 ------------------------";function S(r){const e=r.match(/[^\r\n]/);if(typeof e?.index!="number")return"";const t=e.index;let n=r.length-1;for(;r[n]==="\r"||r[n]===`
|
|
2
|
-
`;)n--;return r.substring(t,n+1)}function $(r,e){return r?`${r}
|
|
3
|
-
${e||""}`:e||""}function xe(r){return r?e=>!e.startsWith(r):()=>!0}function we(r,e){const t=r.indexOf(`${e} ${pe}`);return t===-1?r:r.slice(0,t)}function D(r){return!r.match(/^\s*gpg:/)}function N(r,e,t){const{groups:n}=e;for(let s=0,o=t.length,i;s<o;s++)i=t[s],r[i]=(n?n[i]:e[s+1])||null;return r}const be={noteKeywords:["BREAKING CHANGE","BREAKING-CHANGE"],issuePrefixes:["#"],referenceActions:["close","closes","closed","fix","fixes","fixed","resolve","resolves","resolved"],headerPattern:/^(\w*)(?:\(([\w$@.\-*/ ]*)\))?: (.*)$/,headerCorrespondence:["type","scope","subject"],revertPattern:/^Revert\s"([\s\S]*)"\s*This reverts commit (\w*)\.?/,revertCorrespondence:["header","hash"],fieldPattern:/^-(?=.*\w)(.*?)-$/};function K(r={}){return{merge:null,revert:null,header:null,body:null,footer:null,notes:[],mentions:[],references:[],...r}}class Re{options;regexes;lines=[];lineIndex=0;commit=K();constructor(e={}){this.options={...be,...e},this.regexes=ge(this.options)}currentLine(){return this.lines[this.lineIndex]}nextLine(){return this.lines[this.lineIndex++]}isLineAvailable(){return this.lineIndex<this.lines.length}parseReference(e,t){const{regexes:n}=this;if(n.url.test(e))return null;const s=n.referenceParts.exec(e);if(!s)return null;let[o,i=null,c,u]=s,f=null;if(i){const g=i.indexOf("/");g!==-1&&(f=i.slice(0,g),i=i.slice(g+1))}return{raw:o,action:t,owner:f,repository:i,prefix:c,issue:u}}parseReferences(e,t=!1){const{regexes:n}=this,s=t?n.footerReferences:n.references,o=e.match(s)?s:/()(.+)/gi,i=[];let c,u,f,g;for(;c=o.exec(e),!!c;)for(u=c[1]||null,f=c[2]||"";g=this.parseReference(f,u),!!g;)i.push(g);return i}skipEmptyLines(){let e=this.currentLine();for(;e!==void 0&&!e.trim();)this.nextLine(),e=this.currentLine()}parseMerge(){const{commit:e,options:t}=this,n=t.mergeCorrespondence||[],s=this.currentLine(),o=s&&t.mergePattern?s.match(t.mergePattern):null;return o?(this.nextLine(),e.merge=o[0]||null,N(e,o,n),!0):!1}parseHeader(e){e&&this.skipEmptyLines();const{commit:t,options:n}=this,s=n.headerCorrespondence||[],o=t.header??this.nextLine();let i=null;o&&(n.breakingHeaderPattern&&(i=o.match(n.breakingHeaderPattern)),!i&&n.headerPattern&&(i=o.match(n.headerPattern))),o&&(t.header=o),i&&N(t,i,s)}parseMeta(){const{options:e,commit:t}=this;if(!e.fieldPattern||!this.isLineAvailable())return!1;let n,s=null,o=!1;for(;this.isLineAvailable();){if(n=this.currentLine().match(e.fieldPattern),n){s=n[1]||null,this.nextLine();continue}if(s)o=!0,t[s]=$(t[s],this.currentLine()),this.nextLine();else break}return o}parseNotes(){const{regexes:e,commit:t}=this;if(!this.isLineAvailable())return!1;const n=this.currentLine().match(e.notes);let s;if(n){const o={title:n[1],text:n[2]};for(t.notes.push(o),t.footer=$(t.footer,this.currentLine()),this.nextLine();this.isLineAvailable();){if(this.parseMeta()||this.parseNotes())return!0;if(s=e.footerToken.test(this.currentLine()),t.references.push(...this.parseReferences(this.currentLine(),s)),s||(o.text=$(o.text,this.currentLine())),t.footer=$(t.footer,this.currentLine()),this.nextLine(),s)break}return!0}return!1}parseBodyAndFooter(e){const{commit:t,regexes:n}=this;if(!this.isLineAvailable())return e;const s=n.footerToken.test(this.currentLine()),o=!s&&e;return t.references.push(...this.parseReferences(this.currentLine(),s)),o?t.body=$(t.body,this.currentLine()):t.footer=$(t.footer,this.currentLine()),this.nextLine(),o}parseBreakingHeader(){const{commit:e,options:t}=this;if(!t.breakingHeaderPattern||e.notes.length||!e.header)return;const n=e.header.match(t.breakingHeaderPattern);n&&e.notes.push({title:"BREAKING CHANGE",text:n[3]})}parseMentions(e){const{commit:t,regexes:n}=this;let s;for(;s=n.mentions.exec(e),!!s;)t.mentions.push(s[1])}parseRevert(e){const{commit:t,options:n}=this,s=n.revertCorrespondence||[],o=n.revertPattern?e.match(n.revertPattern):null;o&&(t.revert=N({},o,s))}cleanupCommit(){const{commit:e}=this;e.body&&=S(e.body),e.footer&&=S(e.footer),e.notes.forEach(n=>{n.text=S(n.text)});const t=new Set;e.references=e.references.filter(n=>{const s=`${n.action} ${n.raw}`.toLocaleLowerCase(),o=!t.has(s);return o&&t.add(s),o})}parse(e){if(!e.trim())throw new TypeError("Expected a raw commit");const{commentChar:t}=this.options,n=xe(t),s=S(e).split(/\r?\n/),o=t?we(s,t).filter(f=>n(f)&&D(f)):s.filter(f=>D(f)),i=K();this.lines=o,this.lineIndex=0,this.commit=i;const c=this.parseMerge();this.parseHeader(c),i.header&&(i.references=this.parseReferences(i.header));let u=!0;for(;this.isLineAvailable();)this.parseMeta(),this.parseNotes()&&(u=!1),this.parseBodyAndFooter(u)||(u=!1);return this.parseBreakingHeader(),this.parseMentions(e),this.parseRevert(e),this.cleanupCommit(),i}}const W={build:"patch",chore:"patch",ci:"patch",docs:"patch",feat:"minor",fix:"patch",perf:"patch",refactor:"patch",style:"patch",test:"patch"},Ee=new Re({breakingHeaderPattern:/^(\w*)(?:\(([^()]*)\))?!: (.*)$/,headerPattern:/^(\w*)(?:\(([^()]*)\))?!?: (.*)$/}),ve=/^Revert\s+"(.+)"\s*$/,ye=/This reverts commit\s+([0-9a-f]{7,40})/i,U=/^(?:[\p{Emoji_Presentation}\p{Extended_Pictographic}]|:\w+:)\s+/u,V=(r,e)=>{const t=r.replace(U,""),n=Ee.parse(`${t}
|
|
4
|
-
|
|
5
|
-
${e}`);return{breaking:n.notes.some(o=>/BREAKING/i.test(o.title)),scope:n.scope??void 0,type:n.type??void 0}},Le=/^(\w+(?:\([^()]*\))?): /,ke=r=>{const e=U.exec(r)?.[0]??"";return e+r.slice(e.length).replace(Le,"$1!: ")},$e=(r,e,t)=>{let n,s=!1;if(t.type==="revert"){s=!0;const c=r.indexOf(":");c!==-1&&(n=r.slice(c+1).trim())}else{const c=ve.exec(r.trim());c&&(s=!0,n=c[1]?.trim())}let o;const i=ye.exec(e);return i&&(o=i[1]?.toLowerCase()),{isRevert:s,targetSha:o,targetSubject:n}},Ce=(r,e=new Set,t)=>{const n=r.map(a=>{const h=V(a.subject,a.body),{isRevert:l,targetSha:x,targetSubject:d}=$e(a.subject,a.body,h);return{...a,cancelled:!1,parsed:h,revert:l,revertSubject:d,revertTargetSha:x}}),s=n.toReversed(),o=12,i=new Map;for(const a of s)if(i.set(a.hash,a),a.hash.length>=7){const h=Math.min(a.hash.length-1,o);for(let l=7;l<=h;l+=1){const x=a.hash.slice(0,l);if(i.has(x)){const d=i.get(x);d!==null&&d!==a&&i.set(x,null)}else i.set(x,a)}}const c=(a,h)=>{if(a.revertTargetSha){const l=a.revertTargetSha.toLowerCase();let d=i.get(l)??void 0;if(d||(d=s.find(P=>P.hash.startsWith(l))),d&&d!==a)return d}if(a.revertSubject)for(let l=h.length-1;l>=0;l-=1){const x=h[l];if(x.subject===a.revertSubject)return x}},u=64,f=a=>{let h=a;for(let l=0;l<u;l+=1){if(!h.revert)return h;const x=h.cancelledBy;let d;if(x&&(d=i.get(x)??void 0,d||(d=i.get(x.slice(0,7))??void 0)),!d||d===h)return h;h=d}},g=[],p=[];for(const a of s){if(a.revert){const h=c(a,p);if(h){if(e.has(h.hash)){p.push(a);continue}const l=f(h);if(l===void 0){g.push(`Revert chain at ${a.hash} exceeded depth limit (${u}) — skipping cancellation`),p.push(a);continue}if(e.has(l.hash)){p.push(a);continue}l.cancelled=!l.cancelled,l.cancelledBy=l.cancelled?a.hash:void 0,a.cancelled=!0,a.cancelledBy=h.hash}}p.push(a)}const v=n.filter(a=>!a.cancelled&&!a.revert&&!a.subject?.startsWith("Merge ")),C=v.filter(a=>!a.parsed.type);if(v.length>0&&C.length/v.length>.5){const a=t??"<from>..HEAD";g.push(`${C.length}/${v.length} commits in ${a} have no conventional-commits prefix. Consider enabling commit-message linting.`)}return{commits:n,warnings:g}},_e=[/^chore\(release\)!?:/i,/^chore\([^\n)]{0,64}\)!?:[ \t]{0,8}release[ \t]/i,/^chore!?:[ \t]{0,8}release[ \t]/i,/^release(?:\([^\n)]{0,64}\))?!?:/i],z=(r={})=>{const e=r.ignoreReleaseCommits===!1?[]:[..._e],t=r.ignoreCommitPattern,n=t===void 0?[]:typeof t=="string"?[t]:t;for(const s of n)if(!(typeof s!="string"||s.trim()===""))try{e.push(new RegExp(s))}catch(o){r.onInvalidPattern?.(s,o)}return e},Ae=512,X=(r,e)=>{if(e.length===0)return!1;const t=r.slice(0,Ae);return e.some(n=>(n.lastIndex=0,n.test(t)))},Pe=r=>{const e=[],t=r.indexOf(`
|
|
6
|
-
`);t!==-1&&e.push(t);const n=String.raw`\n\n`;let s=r.indexOf(n);for(;s!==-1;){if(/^\s{0,8}#/.test(r.slice(s+n.length))){e.push(s);break}s=r.indexOf(n,s+1)}return(e.length>0?r.slice(0,Math.min(...e)):r).trim()},Se=async r=>{const{config:e,cwd:t,packages:n,perPackageConfig:s,runner:o}=r,i=[],c=[];if(r.from)return{notes:i,ref:r.from,warnings:c};if(r.sinceLastRelease){const p=await fe({cwd:t,packages:n,perPackageConfig:s,runner:o,workspaceConfig:e});if(p.kind==="tag"&&p.ref)return i.push(`--since-last-release: ${p.reason}.`),{notes:i,ref:p.ref,warnings:c};if(p.kind==="root-commit"&&p.ref)return r.allowFullHistory!==!0?{error:`--since-last-release: ${p.reason}. Refusing to walk it: every package touched anywhere in that history would be bumped (major, for any breaking-change marker in it) and, on the auto-publish path, published. Pass --allow-full-history if this really is a first release, or pin the start of the range explicitly.`,notes:i,warnings:c}:(c.push(`--since-last-release: ${p.reason}. Walking it because --allow-full-history was passed.`),{notes:i,ref:p.ref,warnings:c});c.push(`--since-last-release: ${p.reason}. Falling back to the merge-base with baseBranch.`)}const u=e.baseBranch??"main",f=await o.run("git",["merge-base",`origin/${u}`,"HEAD"],{cwd:t,silent:!0});if(f.exitCode===0&&f.stdout.trim())return{notes:i,ref:f.stdout.trim(),warnings:c};const g=await o.run("git",["merge-base",u,"HEAD"],{cwd:t,silent:!0});return{notes:i,ref:g.exitCode===0&&g.stdout.trim()?g.stdout.trim():"HEAD~10",warnings:c}},He=async r=>{const{config:e,cwd:t,fs:n,packages:s,runner:o}=r,i=await Se(r),c=[...i.notes],u=[...i.warnings];if(i.error!==void 0||i.ref===void 0)return{error:i.error??"Could not resolve the start of the commit range.",ignoredCommits:0,notes:c,status:"failed",warnings:u};const f=i.ref,g=new Map;for(const m of s){const w=(m.dir.startsWith(t)?m.dir.slice(t.length):m.dir).replaceAll("\\","/").replace(/^\/+/,"");g.set(w,m.name)}const p=m=>{for(const[E,w]of g)if(m.startsWith(`${E}/`)||m===`${E}/package.json`)return w},v=Math.random().toString(16).slice(2,10),C=`@@VIS_RELEASE_COMMIT_${v}@@`,a=`@@VIS_RELEASE_FILES_${v}@@`,h=await o.run("git",["log",`${f}..HEAD`,`--pretty=format:${C}%n%H%n%s%n%b%n${a}`,"--name-only"],{cwd:t,silent:!0});if(h.exitCode!==0)return{error:`git log failed: ${h.stderr}`,fromRef:f,ignoredCommits:0,notes:c,status:"failed",warnings:u};const l=new Map,x=[],d=[],P=h.stdout.split(C).map(m=>m.trim()).filter(Boolean);for(const m of P){const[E,w=""]=m.split(a).toReversed(),k=w.split(`
|
|
7
|
-
`),y=k[0]?.trim()??"",L=Pe(k[1]??""),M=k.slice(2).join(`
|
|
8
|
-
`).trim(),b=(E??"").split(`
|
|
9
|
-
`).map(R=>R.trim()).filter(Boolean);y&&d.push({body:M,files:b,hash:y,subject:L})}const j=z({ignoreReleaseCommits:e.ignoreReleaseCommits}),J=z({ignoreCommitPattern:e.ignoreCommitPattern,ignoreReleaseCommits:!1,onInvalidPattern:(m,E)=>{u.push(`Ignoring invalid release.ignoreCommitPattern entry ${JSON.stringify(m)}: ${E.message}`)}}),B=d.filter(m=>!X(m.subject,j)&&!(X(m.subject,J)&&!V(m.subject,m.body).breaking)),_=d.length-B.length;_>0&&c.push(`Skipped ${_} release/ignored commit(s) in ${f}..HEAD.`);const{commits:Y,warnings:Z}=Ce(B,void 0,`${f}..HEAD`);u.push(...Z);for(const{cancelled:m,files:E,parsed:w,subject:k}of Y){if(m)continue;let y="patch";w.breaking?y="major":w.type&&W[w.type]&&(y=W[w.type]??"patch");const L=new Set,M=(w.scope??"").split(",").map(b=>b.trim()).filter(Boolean);for(const b of M)for(const R of s)(R.name===b||R.name.endsWith(`/${b}`))&&L.add(R.name);if(L.size===0)for(const b of E){const R=p(b);R&&L.add(R)}for(const b of L){const R=l.get(b);l.set(b,R?ae(R,y):y)}L.size>0&&x.push(`- ${w.breaking?ke(k):k}`)}if(l.size===0)return c.push("No commits affected workspace packages — nothing to generate."),{bumps:l,fromRef:f,ignoredCommits:_,notes:c,status:"no-changes",warnings:u};const Q={bumps:Object.fromEntries(l)},ee=x.length>0?x.join(`
|
|
10
|
-
`):"Auto-generated change file.",T=ce(Q,ee);if(r.dryRun)return{bumps:l,content:T,fromRef:f,ignoredCommits:_,notes:c,status:"dry-run",warnings:u};const H=e.changesDir??oe,te=(r.name??le()).replaceAll(/[^a-z0-9-]/gi,"-"),F=O(t,H,`${te}.md`);return await n.mkdir(O(t,H),{recursive:!0}),await n.writeFile(F,T),{bumps:l,content:T,createdFile:F,fromRef:f,ignoredCommits:_,notes:c,status:"written",warnings:u}};export{He as r};
|