@releasekit/notes 0.31.1 → 0.32.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.
@@ -114,6 +114,9 @@ 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
+ ),
117
120
  mainPackage: z.string().optional().describe("Package to use for version determination"),
118
121
  updateInternalDependencies: z.enum(["major", "minor", "patch", "no-internal-update"]).default("minor").describe("How to bump internal dependencies"),
119
122
  skip: z.array(z.string()).optional().describe("Packages to exclude from versioning"),
@@ -435,6 +438,26 @@ var StandingPrConfigSchema = z.object({
435
438
  ),
436
439
  minPackages: z.number().int().positive().optional().describe(
437
440
  "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."
441
+ ),
442
+ authorization: z.object({
443
+ requiredPermission: z.enum(["admin", "maintain", "write"]).default("admin").describe(
444
+ "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."
445
+ ),
446
+ allowedActors: z.array(
447
+ // A GitHub username (e.g. `octocat`) or a team as `@org/team-slug`. The `@…/…` form needs
448
+ // the slash — `@octocat` is neither a username nor a team and would silently match nobody,
449
+ // so reject it at config-load time. Round-trips into the JSON Schema as `pattern`.
450
+ z.string().regex(/^(?:[A-Za-z0-9-]+|@[A-Za-z0-9-]+\/[A-Za-z0-9._-]+)$/, {
451
+ message: 'allowedActors entries must be a GitHub username (e.g. "octocat") or a team as "@org/team-slug" (note the slash).'
452
+ })
453
+ ).optional().describe(
454
+ '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.'
455
+ ),
456
+ enforceMergeAuthor: z.boolean().default(true).describe(
457
+ "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."
458
+ )
459
+ }).optional().describe(
460
+ "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
461
  )
439
462
  });
440
463
  var CIConfigSchema = z.object({
@@ -814,6 +837,7 @@ function forgeErrorStatus(error2) {
814
837
  }
815
838
  return void 0;
816
839
  }
840
+ var REPO_PERMISSIONS = ["admin", "maintain", "write", "triage", "read", "none"];
817
841
  var MAX_RELEASE_PAGES = 3;
818
842
  function labelNames(labels) {
819
843
  return (labels ?? []).map((label) => typeof label === "string" ? label : label.name ?? "");
@@ -884,6 +908,26 @@ var GitHubForge = class {
884
908
  async mergePullRequest(prNumber, method) {
885
909
  await this.octokit.rest.pulls.merge({ ...this.base, pull_number: prNumber, merge_method: method });
886
910
  }
911
+ async getActorPermission(username) {
912
+ try {
913
+ const { data } = await this.octokit.rest.repos.getCollaboratorPermissionLevel({ ...this.base, username });
914
+ const role = data.role_name;
915
+ if (role && REPO_PERMISSIONS.includes(role)) return role;
916
+ return data.permission ?? "none";
917
+ } catch (error2) {
918
+ if (forgeErrorStatus(error2) === 404) return "none";
919
+ throw error2;
920
+ }
921
+ }
922
+ async isTeamMember(org, teamSlug, username) {
923
+ try {
924
+ const { data } = await this.octokit.rest.teams.getMembershipForUserInOrg({ org, team_slug: teamSlug, username });
925
+ return data.state === "active";
926
+ } catch (error2) {
927
+ if (forgeErrorStatus(error2) === 404) return false;
928
+ throw error2;
929
+ }
930
+ }
887
931
  async findComment(prNumber, marker) {
888
932
  const iterator = this.octokit.paginate.iterator(this.octokit.rest.issues.listComments, {
889
933
  ...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-4ZP32TPZ.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-4ZP32TPZ.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.0",
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"