Skip to content

Commit e47eda0

Browse files
committed
Unify review core across Bun and Pi
1 parent d5e0ff6 commit e47eda0

10 files changed

Lines changed: 1890 additions & 466 deletions

File tree

apps/pi-extension/index.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,18 +272,25 @@ export default function plannotator(pi: ExtensionAPI): void {
272272

273273
ctx.ui.notify("Opening code review UI...", "info");
274274

275-
const gitCtx = getGitContext();
276-
const { patch: rawPatch, label: gitRef } = runGitDiff("uncommitted", gitCtx.defaultBranch);
277-
278275
let server: ReviewServerResult;
279276
try {
277+
const gitCtx = await getGitContext();
278+
const {
279+
patch: rawPatch,
280+
label: gitRef,
281+
error,
282+
} = await runGitDiff("uncommitted", gitCtx.defaultBranch);
283+
280284
server = await startReviewServer({
281285
rawPatch,
282286
gitRef,
287+
error,
283288
origin: "pi",
284289
diffType: "uncommitted",
285290
gitContext: gitCtx,
286291
htmlContent: reviewHtmlContent,
292+
sharingEnabled: process.env.PLANNOTATOR_SHARE !== "disabled",
293+
shareBaseUrl: process.env.PLANNOTATOR_SHARE_URL || undefined,
287294
});
288295
} catch (err) {
289296
ctx.ui.notify(`Failed to start code review UI: ${getStartupErrorMessage(err)}`, "error");

apps/pi-extension/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@
2121
"files": [
2222
"index.ts",
2323
"server.ts",
24+
"review-core.ts",
2425
"utils.ts",
2526
"README.md",
2627
"plannotator.html",
2728
"review-editor.html",
2829
"feedback-templates.ts"
2930
],
3031
"scripts": {
31-
"build": "cp ../hook/dist/index.html plannotator.html && cp ../hook/dist/review.html review-editor.html && cp ../../packages/shared/feedback-templates.ts feedback-templates.ts",
32+
"build": "cp ../hook/dist/index.html plannotator.html && cp ../hook/dist/review.html review-editor.html && cp ../../packages/shared/feedback-templates.ts feedback-templates.ts && cp ../../packages/shared/review-core.ts review-core.ts",
3233
"prepublishOnly": "cd ../.. && bun run build:pi"
3334
},
3435
"peerDependencies": {

0 commit comments

Comments
 (0)