@kitman-sh/software-engineering 0.13.1 → 0.13.2

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/dist/bundle.js CHANGED
@@ -21240,7 +21240,9 @@ class ReviewBaseUnpinned extends TaggedError3()("ReviewBaseUnpinned", {
21240
21240
  message: String5
21241
21241
  }) {
21242
21242
  }
21243
- var targetOf = (input, { base, head, branches }) => {
21243
+ var targetOf = (input, { base, head, branches, epic }) => {
21244
+ if (epic !== undefined)
21245
+ return `the epic's whole change \`git diff ${base}...${head}\` in your checkout: epic branch \`${epic.branch}\` against default branch \`${epic.defaultBranch}\`, as they stood when this review started. Fetch both from \`origin\` and diff exactly those commits, even if either branch has moved since.`;
21244
21246
  if (input.changeRequestId !== undefined && branches !== undefined) {
21245
21247
  const { source, target } = branches;
21246
21248
  const from = source === undefined ? "" : ` from source branch \`${source}\``;
@@ -21274,6 +21276,11 @@ var pinnedRange = (input) => gen2(function* () {
21274
21276
  branches: { source: status.sourceBranch, target: status.targetBranch }
21275
21277
  };
21276
21278
  }
21279
+ if ((input.base === undefined || input.head === undefined) && input.epic !== undefined) {
21280
+ const { branch, defaultBranch } = input.epic;
21281
+ const [base = "", head = ""] = yield* resolveRevisions("pin", [`origin/${defaultBranch}`, `origin/${branch}`]);
21282
+ return { base, head, epic: { branch, defaultBranch } };
21283
+ }
21277
21284
  if (input.base === undefined || input.head === undefined)
21278
21285
  return yield* new ReviewTargetMissing({ message: "Name a ChangeRequest, or both base and head revisions" });
21279
21286
  const [base = "", head = ""] = yield* resolveRevisions("pin", [input.base, input.head]);
@@ -31452,4 +31459,4 @@ var runKit = (config, identity, packages) => {
31452
31459
  runMain2(program.pipe(flatMap3((code) => sync2(() => process.exit(code)))));
31453
31460
  };
31454
31461
  // .kitman-build-entry.ts
31455
- runKit(kitman_config_default, { name: "@kitman-sh/software-engineering", version: "0.13.1" }, []);
31462
+ runKit(kitman_config_default, { name: "@kitman-sh/software-engineering", version: "0.13.2" }, []);
@@ -5522,7 +5522,7 @@
5522
5522
  "carried": [
5523
5523
  {
5524
5524
  "name": "@kitman-sh/software-engineering",
5525
- "version": "0.13.1",
5525
+ "version": "0.13.2",
5526
5526
  "setup": "2a237548a69b0cd53ec3be7f687cfa8c2128335b3a655d34e185f2abce6a3c37",
5527
5527
  "loops": [
5528
5528
  "build",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitman-sh/software-engineering",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "Everything for building software: Loops, their Agents, the skills they use and the Ponytail plugin.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -17,12 +17,12 @@
17
17
  "tsconfig.json"
18
18
  ],
19
19
  "dependencies": {
20
- "@kitman-sh/sdk": "0.13.1",
20
+ "@kitman-sh/sdk": "0.13.2",
21
21
  "effect": "^4.1.2"
22
22
  },
23
23
  "kitman": {
24
24
  "bundle": "dist/bundle.js",
25
- "digest": "c0910680f32e2e64d14232c8d9ae3c80534b25edfd56e963a84c1d1ca390660c",
25
+ "digest": "0eeaae283e9d1cc9ff244b6d02bd3a3ebe9c8fa6e266ed1377616658254efbe1",
26
26
  "protocolVersion": 5,
27
27
  "declarations": "dist/declarations.json",
28
28
  "setup": {
package/src/review.ts CHANGED
@@ -171,9 +171,14 @@ type Range = {
171
171
  readonly head: string
172
172
  /** A ChangeRequest's branches, which its reviewers are told so they need not look it up. */
173
173
  readonly branches?: { readonly source: string | undefined; readonly target: string }
174
+ /** The epic branch and default branch it diffs, when the review is of an epic's whole change. */
175
+ readonly epic?: { readonly branch: string; readonly defaultBranch: string }
174
176
  }
175
177
 
176
- const targetOf = (input: typeof Input.Type, { base, head, branches }: Range) => {
178
+ const targetOf = (input: typeof Input.Type, { base, head, branches, epic }: Range) => {
179
+ if (epic !== undefined)
180
+ return `the epic's whole change \`git diff ${base}...${head}\` in your checkout: epic branch \`${epic.branch}\` against default branch \`${epic.defaultBranch}\`, as they stood when this review started. Fetch both from \`origin\` and diff exactly those commits, even if either branch has moved since.`
181
+
177
182
  if (input.changeRequestId !== undefined && branches !== undefined) {
178
183
  const { source, target } = branches
179
184
  const from = source === undefined ? '' : ` from source branch \`${source}\``
@@ -200,7 +205,8 @@ const targetOf = (input: typeof Input.Type, { base, head, branches }: Range) =>
200
205
 
201
206
  /**
202
207
  * The commits the review diffs, read on a Runner when it starts: a ChangeRequest's head against its target branch,
203
- * else `base` against `head`. A branch that moves later does not move the diff.
208
+ * else `base` against `head`, else the epic branch against the default branch. A branch that moves later does not move
209
+ * the diff.
204
210
  */
205
211
  const pinnedRange = (input: typeof Input.Type) =>
206
212
  Effect.gen(function* () {
@@ -221,6 +227,13 @@ const pinnedRange = (input: typeof Input.Type) =>
221
227
  }
222
228
  }
223
229
 
230
+ if ((input.base === undefined || input.head === undefined) && input.epic !== undefined) {
231
+ const { branch, defaultBranch } = input.epic
232
+ const [base = '', head = ''] = yield* resolveRevisions('pin', [`origin/${defaultBranch}`, `origin/${branch}`])
233
+
234
+ return { base, head, epic: { branch, defaultBranch } }
235
+ }
236
+
224
237
  if (input.base === undefined || input.head === undefined)
225
238
  return yield* new ReviewTargetMissing({ message: 'Name a ChangeRequest, or both base and head revisions' })
226
239