@releasekit/notes 0.31.1 → 0.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -114,6 +114,12 @@ var VersionConfigSchema = z.object({
114
114
  "Named version groups. Each group binds a set of package patterns to a fixed, linked, or independent sync mode. fixed: any releasable change in any member releases ALL members at the shared group version (bump(max(member baselines))). linked: only members with releasable changes release, but every releasing member shares the same computed version. independent: only members with releasable changes release, each on its own commit-driven version line (no shared version), but the set is atomic \u2014 targeting any member pulls in the whole group. Packages not matched by any group version independently. A package may belong to at most one group. Set version.sync to false when using groups."
115
115
  ),
116
116
  packages: z.array(z.string()).default([]).describe("Packages to include in versioning"),
117
+ sharedPackages: z.array(z.string()).optional().describe(
118
+ 'Foundational packages whose changes belong in every package\u2019s changelog. A commit touching only a shared package (exact name or glob) is classified as repo-level and surfaced under "Project-wide changes" rather than attributed to that one package. Default: none \u2014 no package is treated as shared unless declared.'
119
+ ),
120
+ sharedChangelogFloor: z.enum(["union", "sinceLastRelease"]).default("union").describe(
121
+ `How the "Project-wide changes" block is bounded in package-specific-tag mode. "union" (default): repo-level commits accrue from the union of the releasing packages' ranges, floored by the OLDEST unreleased baseline \u2014 so a genuinely-global commit recurs in every release until the oldest-baselined package is released past it. "sinceLastRelease": floor the block by the single nearest tag reachable across the repo, so global commits already shown by the most recent release don't recur (recommended for per-package-tag monorepos). No effect in sync mode, where one shared tag already consumes repo-level commits on each release.`
122
+ ),
117
123
  mainPackage: z.string().optional().describe("Package to use for version determination"),
118
124
  updateInternalDependencies: z.enum(["major", "minor", "patch", "no-internal-update"]).default("minor").describe("How to bump internal dependencies"),
119
125
  skip: z.array(z.string()).optional().describe("Packages to exclude from versioning"),
@@ -124,6 +130,9 @@ var VersionConfigSchema = z.object({
124
130
  mismatchStrategy: z.enum(["error", "warn", "ignore", "prefer-package", "prefer-git"]).default("warn").describe("How to handle version mismatches"),
125
131
  versionPrefix: z.string().default("").describe("Prefix for version tags"),
126
132
  prereleaseIdentifier: z.string().optional().describe("Identifier for prerelease versions (e.g., 'alpha', 'beta')"),
133
+ allowFirstBump: z.boolean().default(false).describe(
134
+ 'Acknowledge applying a bump on a first release with an already-stable manifest. On a first release (no prior tag), `--stable --bump <type>` applies the bump (e.g. 1.0.0 \u2192 2.0.0) rather than graduating, which can silently overshoot the staged first version. By default this is flagged per `mismatchStrategy` (warn, or abort under "error"); set true (or pass --allow-first-bump) to apply the bump silently \u2014 legitimate when importing a package with prior external version history.'
135
+ ),
127
136
  strictReachable: z.boolean().default(false).describe("Only use reachable tags"),
128
137
  zeroMajor: z.enum(["spec", "strict"]).default("spec").describe(
129
138
  "Pre-1.0 handling of commit-inferred breaking changes. 'spec' (default): bump the 0.x minor (0.24.0 \u2192 0.25.0), per semver \xA74. 'strict': bump the next major (\u2192 1.0.0). Inferred path only \u2014 explicit overrides (--bump major, bump:major) always graduate to 1.0.0."
@@ -435,6 +444,26 @@ var StandingPrConfigSchema = z.object({
435
444
  ),
436
445
  minPackages: z.number().int().positive().optional().describe(
437
446
  "Minimum number of packages with releasable changes required to create or maintain the standing PR. Below this threshold the PR is closed and no new PR is opened."
447
+ ),
448
+ authorization: z.object({
449
+ requiredPermission: z.enum(["admin", "maintain", "write"]).default("admin").describe(
450
+ "Minimum repository permission an actor needs to steer the standing PR \u2014 tick/untick selection checkboxes, apply release labels, and (with branch protection) merge. Default: admin."
451
+ ),
452
+ allowedActors: z.array(
453
+ // A GitHub username (e.g. `octocat`) or a team as `@org/team-slug`. The `@…/…` form needs
454
+ // the slash — `@octocat` is neither a username nor a team and would silently match nobody,
455
+ // so reject it at config-load time. Round-trips into the JSON Schema as `pattern`.
456
+ z.string().regex(/^(?:[A-Za-z0-9-]+|@[A-Za-z0-9-]+\/[A-Za-z0-9._-]+)$/, {
457
+ message: 'allowedActors entries must be a GitHub username (e.g. "octocat") or a team as "@org/team-slug" (note the slash).'
458
+ })
459
+ ).optional().describe(
460
+ 'Extra actors authorized regardless of permission level: GitHub usernames, or "@org/team-slug" to authorize a whole team. Team-membership checks need a token with read:org scope (a PAT or GitHub App), not the default GITHUB_TOKEN; without it, team entries fail closed \u2014 the 403 is surfaced as a warning and the actor is not authorized.'
461
+ ),
462
+ enforceMergeAuthor: z.boolean().default(true).describe(
463
+ "Refuse to publish the standing PR when the actor who merged it is not authorized (defense-in-depth behind a branch-protection ruleset, which is the primary merge gate). Set false to rely on branch protection alone."
464
+ )
465
+ }).optional().describe(
466
+ "Restrict who can steer the standing PR \u2014 its selection checkboxes, release labels, and merge. Omit to allow anyone with the GitHub permission GitHub itself requires for each action (today\u2019s behavior)."
438
467
  )
439
468
  });
440
469
  var CIConfigSchema = z.object({
@@ -814,6 +843,7 @@ function forgeErrorStatus(error2) {
814
843
  }
815
844
  return void 0;
816
845
  }
846
+ var REPO_PERMISSIONS = ["admin", "maintain", "write", "triage", "read", "none"];
817
847
  var MAX_RELEASE_PAGES = 3;
818
848
  function labelNames(labels) {
819
849
  return (labels ?? []).map((label) => typeof label === "string" ? label : label.name ?? "");
@@ -884,6 +914,26 @@ var GitHubForge = class {
884
914
  async mergePullRequest(prNumber, method) {
885
915
  await this.octokit.rest.pulls.merge({ ...this.base, pull_number: prNumber, merge_method: method });
886
916
  }
917
+ async getActorPermission(username) {
918
+ try {
919
+ const { data } = await this.octokit.rest.repos.getCollaboratorPermissionLevel({ ...this.base, username });
920
+ const role = data.role_name;
921
+ if (role && REPO_PERMISSIONS.includes(role)) return role;
922
+ return data.permission ?? "none";
923
+ } catch (error2) {
924
+ if (forgeErrorStatus(error2) === 404) return "none";
925
+ throw error2;
926
+ }
927
+ }
928
+ async isTeamMember(org, teamSlug, username) {
929
+ try {
930
+ const { data } = await this.octokit.rest.teams.getMembershipForUserInOrg({ org, team_slug: teamSlug, username });
931
+ return data.state === "active";
932
+ } catch (error2) {
933
+ if (forgeErrorStatus(error2) === 404) return false;
934
+ throw error2;
935
+ }
936
+ }
887
937
  async findComment(prNumber, marker) {
888
938
  const iterator = this.octokit.paginate.iterator(this.octokit.rest.issues.listComments, {
889
939
  ...this.base,
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createNotesCommand
4
- } from "./chunk-HN4CXPIU.js";
4
+ } from "./chunk-DDZPVGJJ.js";
5
5
  import {
6
6
  readPackageVersion
7
7
  } from "./chunk-IC4SXXRM.js";
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  runPipeline,
19
19
  saveAuth,
20
20
  versionOutputToChangelogInput
21
- } from "./chunk-HN4CXPIU.js";
21
+ } from "./chunk-DDZPVGJJ.js";
22
22
  import {
23
23
  aggregateToRoot,
24
24
  detectMonorepo,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@releasekit/notes",
3
- "version": "0.31.1",
3
+ "version": "0.32.1",
4
4
  "description": "Release notes and changelog generation with LLM-powered enhancement and flexible templating",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -47,7 +47,7 @@
47
47
  "access": "public"
48
48
  },
49
49
  "dependencies": {
50
- "@anthropic-ai/sdk": "^0.104.1",
50
+ "@anthropic-ai/sdk": "^0.105.0",
51
51
  "@octokit/rest": "^22.0.1",
52
52
  "chalk": "^5.6.2",
53
53
  "commander": "^14.0.3",
@@ -56,22 +56,22 @@
56
56
  "jsonc-parser": "^3.3.1",
57
57
  "liquidjs": "^10.27.0",
58
58
  "minimatch": "^10.0.0",
59
- "openai": "^6.42.0",
60
- "smol-toml": "^1.6.1",
59
+ "openai": "^6.44.0",
60
+ "smol-toml": "^1.7.0",
61
61
  "yaml": "^2.9.0",
62
62
  "zod": "^4.4.3"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@biomejs/biome": "^2.5.0",
66
66
  "@types/ejs": "^3.1.5",
67
- "@types/node": "^22.19.21",
67
+ "@types/node": "^22.20.0",
68
68
  "@vitest/coverage-v8": "^4.1.9",
69
69
  "tsup": "^8.5.1",
70
70
  "typescript": "^5.9.3",
71
71
  "vitest": "^4.1.9",
72
- "@releasekit/core": "0.0.0",
72
+ "@releasekit/config": "0.0.0",
73
73
  "@releasekit/forge": "0.0.0",
74
- "@releasekit/config": "0.0.0"
74
+ "@releasekit/core": "0.0.0"
75
75
  },
76
76
  "engines": {
77
77
  "node": ">=22"