pulls.review 0.2.0 → 0.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/README.md +5 -0
- package/dist/client/assets/ActionButton-V4dY2wPS.js +1 -0
- package/dist/client/assets/ActionIconButton-4b5xelMn.js +1 -0
- package/dist/client/assets/ChatMessage-Ccffh_8Z.js +80 -0
- package/dist/client/assets/ChatWidget-BFjNWi3R.js +1 -0
- package/dist/client/assets/DisplayFileIcon-DIcJdZir.js +151 -0
- package/dist/client/assets/GithubAvatar-DGJrpCsX.js +1 -0
- package/dist/client/assets/LandingHero-CS9lP7Qs.js +1 -0
- package/dist/client/assets/LocalAgentSettings-C4AeYCZ0.js +1 -0
- package/dist/client/assets/ModelPicker-CDTiUMZ3.js +3 -0
- package/dist/client/assets/SelectViewport-DF4P4Akh.js +1 -0
- package/dist/client/assets/_repo_-DtGh1V5_.js +22 -0
- package/dist/client/assets/analyze-CTcNbJBk.js +1 -0
- package/dist/client/assets/andromeeda-vGVdxbeo.js +1 -0
- package/dist/client/assets/anthropic-messages-Btz8sjqp.js +41 -0
- package/dist/client/assets/aurora-x-CDeNXAV0.js +1 -0
- package/dist/client/assets/ayu-dark-DluEY0Gj.js +1 -0
- package/dist/client/assets/ayu-light-C3h-C4tm.js +1 -0
- package/dist/client/assets/ayu-mirage-Bqwy1Gya.js +1 -0
- package/dist/client/assets/browser-agent-rpc-BXhoSh1z-DrvKG05N.js +1 -0
- package/dist/client/assets/c-BNQJhXlP.js +1 -0
- package/dist/client/assets/catppuccin-frappe-C9Q5zVZY.js +1 -0
- package/dist/client/assets/catppuccin-latte-CtsyrtPq.js +1 -0
- package/dist/client/assets/catppuccin-macchiato-R8nAf1vR.js +1 -0
- package/dist/client/assets/catppuccin-mocha-DjuaAJKi.js +1 -0
- package/dist/client/assets/clojure-DqKBuwfJ.js +1 -0
- package/dist/client/assets/core-messages-CsAgH4H9.js +1 -0
- package/dist/client/assets/cpp-7GgD5o7L.js +1 -0
- package/dist/client/assets/csharp-oqKa8noW.js +1 -0
- package/dist/client/assets/css-DlBQoFxe.js +1 -0
- package/dist/client/assets/dark-plus-Cs2F2srj.js +1 -0
- package/dist/client/assets/de-DQCc3irO.js +1 -0
- package/dist/client/assets/diagnostics-CrG4-M7r.js +1 -0
- package/dist/client/assets/diff-Bq6jHPox.js +37 -0
- package/dist/client/assets/diff-BsZcYqbE.js +1 -0
- package/dist/client/assets/diff-woXpYk--.js +1 -0
- package/dist/client/assets/diffs-store-CzecLzBW.js +1431 -0
- package/dist/client/assets/docker-IyjqRm3v.js +1 -0
- package/dist/client/assets/dracula-BHWKrbxM.js +1 -0
- package/dist/client/assets/dracula-soft-5eyTD99u.js +1 -0
- package/dist/client/assets/elixir-D3n0XgqJ.js +1 -0
- package/dist/client/assets/en-CBwAorrh.js +1 -0
- package/dist/client/assets/error-CJ3RHG07.js +1 -0
- package/dist/client/assets/es-hetdr90_.js +1 -0
- package/dist/client/assets/everforest-dark-sB-x3p7T.js +1 -0
- package/dist/client/assets/everforest-light-Df2xbC6M.js +1 -0
- package/dist/client/assets/floating-ui.dom-CfpSQvPs.js +1 -0
- package/dist/client/assets/fr-Cayf6fbk.js +1 -0
- package/dist/client/assets/github-dark-C-LZuMrd.js +1 -0
- package/dist/client/assets/github-dark-default-DXG-b-1a.js +1 -0
- package/dist/client/assets/github-dark-dimmed-Bx1FflLF.js +1 -0
- package/dist/client/assets/github-dark-high-contrast-B_tTalzw.js +1 -0
- package/dist/client/assets/github-light-EUqPIrTm.js +1 -0
- package/dist/client/assets/github-light-default-BXViO-2h.js +1 -0
- package/dist/client/assets/github-light-high-contrast-B68TUdTA.js +1 -0
- package/dist/client/assets/go-rLFTqkRN.js +1 -0
- package/dist/client/assets/graphql-ki1Ij_uk.js +1 -0
- package/dist/client/assets/groovy-CacY0gHj.js +1 -0
- package/dist/client/assets/gruvbox-dark-hard-C820rvS2.js +1 -0
- package/dist/client/assets/gruvbox-dark-medium-BPjhmG05.js +1 -0
- package/dist/client/assets/gruvbox-dark-soft-MrdJrrXF.js +1 -0
- package/dist/client/assets/gruvbox-light-hard-BC_s9l72.js +1 -0
- package/dist/client/assets/gruvbox-light-medium-BAWPOn9u.js +1 -0
- package/dist/client/assets/gruvbox-light-soft-BSMLrYjP.js +1 -0
- package/dist/client/assets/haskell-D8IpX4py.js +1 -0
- package/dist/client/assets/horizon-CE9ld1lL.js +1 -0
- package/dist/client/assets/horizon-bright-DSNQnXHK.js +1 -0
- package/dist/client/assets/houston-CsvMBhTu.js +1 -0
- package/dist/client/assets/html-BC8aFsRK.js +1 -0
- package/dist/client/assets/i18n-CgsK6PK3.js +2 -0
- package/dist/client/assets/id-lw2zLhUO.js +1 -0
- package/dist/client/assets/index-DP4XBqUv.js +2 -0
- package/dist/client/assets/index-DSHKSKKf.css +1 -0
- package/dist/client/assets/ini-B5eOa1yu.js +1 -0
- package/dist/client/assets/install-DKy8VRs5.js +4 -0
- package/dist/client/assets/it-BfFzmCsC.js +1 -0
- package/dist/client/assets/ja-DxaV4C1r.js +1 -0
- package/dist/client/assets/java-D7h0NA_A.js +1 -0
- package/dist/client/assets/javascript-DcMHgNcu.js +1 -0
- package/dist/client/assets/json-qhed-kSA.js +1 -0
- package/dist/client/assets/jsonc-CYpm1nAK.js +1 -0
- package/dist/client/assets/jsx-BUUYi3qs.js +1 -0
- package/dist/client/assets/kanagawa-dragon-Bozd7klA.js +1 -0
- package/dist/client/assets/kanagawa-lotus-BmuOG9ZW.js +1 -0
- package/dist/client/assets/kanagawa-wave-BML5mF2J.js +1 -0
- package/dist/client/assets/ko-D93r2P2k.js +1 -0
- package/dist/client/assets/kotlin-DhhofPvG.js +1 -0
- package/dist/client/assets/laserwave-C_8bwKvT.js +1 -0
- package/dist/client/assets/less-DVTAwKKz.js +1 -0
- package/dist/client/assets/light-plus-DVQuIRkW.js +1 -0
- package/dist/client/assets/llm-XBWohzAo.js +87 -0
- package/dist/client/assets/llm-store-7CdL0d74.js +1 -0
- package/dist/client/assets/local-agents-BQLn-Ppw.js +1 -0
- package/dist/client/assets/locales-SpkpwNqX.js +1 -0
- package/dist/client/assets/lua-DCW0Dwo5.js +1 -0
- package/dist/client/assets/make-Dixweg8N.js +1 -0
- package/dist/client/assets/markdown-BYOwaDjH.js +1 -0
- package/dist/client/assets/material-theme-Bm3Qr25_.js +1 -0
- package/dist/client/assets/material-theme-darker-2IIEA8gg.js +1 -0
- package/dist/client/assets/material-theme-lighter-uhdI0v04.js +1 -0
- package/dist/client/assets/material-theme-ocean-CHQ94UKr.js +1 -0
- package/dist/client/assets/material-theme-palenight-B5W6OYN7.js +1 -0
- package/dist/client/assets/mdx-DQZ5AkYe.js +1 -0
- package/dist/client/assets/min-dark-BSWPekZh.js +1 -0
- package/dist/client/assets/min-light-DDpmG2fV.js +1 -0
- package/dist/client/assets/models-D651LTTp.js +8 -0
- package/dist/client/assets/monokai-B_bV9PQ9.js +1 -0
- package/dist/client/assets/nanoid-Cya-tyvy.js +1 -0
- package/dist/client/assets/nginx-C4fSytnP.js +1 -0
- package/dist/client/assets/night-owl-DhmEMT88.js +1 -0
- package/dist/client/assets/night-owl-light-eJ-hLW7d.js +1 -0
- package/dist/client/assets/node.browser-C0q8i5sA.js +1 -0
- package/dist/client/assets/node.browser-DFtqp6Hr.js +1 -0
- package/dist/client/assets/nord-Cb4Vim4T.js +1 -0
- package/dist/client/assets/objective-c-D1A_Heim.js +1 -0
- package/dist/client/assets/objective-cpp-BsSzOQcm.js +1 -0
- package/dist/client/assets/one-dark-pro-CLwyXe_n.js +1 -0
- package/dist/client/assets/one-light-D7Lr4KcI.js +1 -0
- package/dist/client/assets/openai-completions-DvmbMyzl.js +21 -0
- package/dist/client/assets/pages-Tf2MYsp8.js +1 -0
- package/dist/client/assets/pages-local-iBHcLWBK.js +1 -0
- package/dist/client/assets/pages-web-Bmq8l7JI.js +21 -0
- package/dist/client/assets/patch-parser-k3Vbbmi0.js +5 -0
- package/dist/client/assets/perl-C8GHouAq.js +1 -0
- package/dist/client/assets/php-BahmaYs0.js +1 -0
- package/dist/client/assets/pierre-dark-CpLgRqie.js +1 -0
- package/dist/client/assets/pierre-dark-protanopia-deuteranopia-B35FxJx-.js +1 -0
- package/dist/client/assets/pierre-dark-soft-kZQmAZld.js +1 -0
- package/dist/client/assets/pierre-dark-tritanopia-CpjhbsIL.js +1 -0
- package/dist/client/assets/pierre-dark-vibrant-CpQYzh95.js +1 -0
- package/dist/client/assets/pierre-light-CoaEpmwp.js +1 -0
- package/dist/client/assets/pierre-light-protanopia-deuteranopia-0fSaH845.js +1 -0
- package/dist/client/assets/pierre-light-soft-lWLdNTOI.js +1 -0
- package/dist/client/assets/pierre-light-tritanopia-CEbqgOJL.js +1 -0
- package/dist/client/assets/pierre-light-vibrant-D80Fkn33.js +1 -0
- package/dist/client/assets/plastic-DQwYfKfQ.js +1 -0
- package/dist/client/assets/poimandres-DRFjx7u4.js +1 -0
- package/dist/client/assets/portalTarget-DQg8GgWm.js +1 -0
- package/dist/client/assets/preload-helper-BaNbYf_w.js +1 -0
- package/dist/client/assets/proto-DB4EqR-F.js +1 -0
- package/dist/client/assets/pt-BR-Isafy_5V.js +1 -0
- package/dist/client/assets/python-gzcpVVnB.js +1 -0
- package/dist/client/assets/r-C5FwQflr.js +1 -0
- package/dist/client/assets/red-DX1BQOs8.js +1 -0
- package/dist/client/assets/rolldown-runtime-Dd_uD5pT.js +1 -0
- package/dist/client/assets/rose-pine-aMsaMD1D.js +1 -0
- package/dist/client/assets/rose-pine-dawn-8PwUyIlP.js +1 -0
- package/dist/client/assets/rose-pine-moon-DO-qXg-I.js +1 -0
- package/dist/client/assets/rpc-backends-CLzNPIWN.js +1 -0
- package/dist/client/assets/ru-Bx9Wj7Aa.js +1 -0
- package/dist/client/assets/ruby-CfFGiaYl.js +1 -0
- package/dist/client/assets/runtime-dom.esm-bundler-Du_ZCcVN.js +2 -0
- package/dist/client/assets/rust-Cfkwpbl8.js +1 -0
- package/dist/client/assets/scala-BiFt_7mu.js +1 -0
- package/dist/client/assets/scss-C-_0yqZd.js +1 -0
- package/dist/client/assets/shellscript-CLZ0U2zV.js +1 -0
- package/dist/client/assets/shiki-wasm-noop-Gxv9UHE7.js +1 -0
- package/dist/client/assets/slack-dark-DnToyrRv.js +1 -0
- package/dist/client/assets/slack-ochin-B2OO5cIa.js +1 -0
- package/dist/client/assets/snazzy-light-4G7pJPwS.js +1 -0
- package/dist/client/assets/solarized-dark-UdsmMDCL.js +1 -0
- package/dist/client/assets/solarized-light-C1IUL_tW.js +1 -0
- package/dist/client/assets/source-Dk1PNoY7.js +2 -0
- package/dist/client/assets/sql-BsFa4tDR.js +1 -0
- package/dist/client/assets/swift-CyEgAFGc.js +1 -0
- package/dist/client/assets/sync-interval-oKvsW-lT.js +1 -0
- package/dist/client/assets/synthwave-84-nFMaYfgc.js +1 -0
- package/dist/client/assets/terraform-DswuEJGm.js +1 -0
- package/dist/client/assets/time-ago-Bdao9Hh1.js +1 -0
- package/dist/client/assets/tokyo-night-oM2G3aXe.js +1 -0
- package/dist/client/assets/toml-CcmNWLt0.js +1 -0
- package/dist/client/assets/transform-messages-Cg_2u7I2.js +3 -0
- package/dist/client/assets/tsx-DvWhG4dC.js +1 -0
- package/dist/client/assets/typescript-BTGs5etX.js +1 -0
- package/dist/client/assets/upload-CFwsDMhO.js +1 -0
- package/dist/client/assets/uploadSession-BUj4FNau.js +1 -0
- package/dist/client/assets/useDocumentTitle-ByFCALbG.js +92 -0
- package/dist/client/assets/useNonce-CwUrgryd.js +1 -0
- package/dist/client/assets/vesper-DdrHHSXu.js +1 -0
- package/dist/client/assets/vitesse-black-fwtXNY1n.js +1 -0
- package/dist/client/assets/vitesse-dark-BZCL-v6S.js +1 -0
- package/dist/client/assets/vitesse-light-VbXTXTou.js +1 -0
- package/dist/client/assets/vue-BbYmdtmv.js +1 -0
- package/dist/client/assets/vue-html-BXjKVtKk.js +1 -0
- package/dist/client/assets/vue-i18n-CGHHpbTP.js +5 -0
- package/dist/client/assets/xml-BsprbK0m.js +1 -0
- package/dist/client/assets/yaml-rwi0_p6S.js +1 -0
- package/dist/client/assets/zh-CN-CgGEKuLF.js +1 -0
- package/dist/client/assets/zh-TW-DzNR26_1.js +1 -0
- package/dist/client/favicon.svg +1 -0
- package/dist/client/index.html +45 -0
- package/dist/client/og-dark.png +0 -0
- package/dist/client/og.png +0 -0
- package/dist/client/robots.txt +2 -0
- package/dist/devframe-D66W-pHy.mjs +1002 -0
- package/dist/devframe.mjs +2 -0
- package/dist/index.mjs +110 -0
- package/package.json +7 -3
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { t as devframe_default } from "./devframe-D66W-pHy.mjs";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import process from "node:process";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { parseArgs } from "node:util";
|
|
6
|
+
import { createDevServer } from "devframe/adapters/dev";
|
|
7
|
+
import { H3 } from "h3";
|
|
8
|
+
import { isLocalBranch, parseTarget, readCurrentBranch, resolveDefaultBranch } from "@pulls.review/core/local";
|
|
9
|
+
import { parseGithubUrl } from "@pulls.review/core/github";
|
|
10
|
+
//#region src/page.ts
|
|
11
|
+
/** The site's `/gh/...` routes, which the `PR_LOCAL` build serves too. */
|
|
12
|
+
function githubPage(location) {
|
|
13
|
+
const repo = `/gh/${location.owner}/${location.repo}`;
|
|
14
|
+
switch (location.kind) {
|
|
15
|
+
case "github-pr": return `${repo}/${location.number}`;
|
|
16
|
+
case "github-compare": return `${repo}/compare/${location.base}...${location.head}`;
|
|
17
|
+
case "github-commit": return `${repo}/commit/${location.sha}`;
|
|
18
|
+
case "github-repo": return repo;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/** The page an argument opens (see the app's local routes). */
|
|
22
|
+
async function pageFor(cwd, arg, worktree) {
|
|
23
|
+
if (worktree) return "/worktree";
|
|
24
|
+
if (!arg) {
|
|
25
|
+
const [current, defaultBranch] = await Promise.all([readCurrentBranch(cwd), resolveDefaultBranch(cwd)]);
|
|
26
|
+
return current && defaultBranch && current !== defaultBranch.name ? `/branch/${current}` : "/";
|
|
27
|
+
}
|
|
28
|
+
const github = parseGithubUrl(arg);
|
|
29
|
+
if (github) return githubPage(github);
|
|
30
|
+
if (parseTarget(arg).kind === "range") return `/compare/${arg}`;
|
|
31
|
+
return await isLocalBranch(cwd, arg) ? `/branch/${arg}` : `/commit/${arg}`;
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/index.ts
|
|
35
|
+
const HELP = `Usage: pulls.review [target] [options]
|
|
36
|
+
|
|
37
|
+
Reviews local git changes - or any GitHub pull request - in the browser, grouped
|
|
38
|
+
and summarized. Run it inside a git repository. The target only picks the page
|
|
39
|
+
that opens; any other can be picked from the browser.
|
|
40
|
+
|
|
41
|
+
Target (git revision syntax):
|
|
42
|
+
(none) the current branch against the default branch, or the ref picker
|
|
43
|
+
when the default branch itself is checked out
|
|
44
|
+
<branch> what a branch adds since it forked from the default branch
|
|
45
|
+
<rev> one commit against its parent
|
|
46
|
+
A...B what B adds since it forked from A
|
|
47
|
+
A..B the tree diff between two revisions
|
|
48
|
+
|
|
49
|
+
Target (GitHub):
|
|
50
|
+
owner/repo#123, or a github.com pull request, compare, commit or repo URL.
|
|
51
|
+
Uses the GitHub token from GITHUB_TOKEN, else from \`gh auth token\`.
|
|
52
|
+
|
|
53
|
+
AI analysis uses a key from Settings, or a coding agent installed here (Claude
|
|
54
|
+
Code, OpenCode) when "Local agent" is the provider in Settings.
|
|
55
|
+
|
|
56
|
+
Options:
|
|
57
|
+
--worktree open the uncommitted changes against HEAD
|
|
58
|
+
--port <port> port to listen on
|
|
59
|
+
--no-open do not open the browser
|
|
60
|
+
-h, --help
|
|
61
|
+
|
|
62
|
+
To analyze a GitHub pull request from CI, use @pulls.review/actions.
|
|
63
|
+
`;
|
|
64
|
+
/**
|
|
65
|
+
* devframe's SPA fallback skips any path that looks like a file, and refs do: `main...feat`
|
|
66
|
+
* ends in `.feat`, `v1.2` in `.2`. Pages whose path carries a ref (local ones, and GitHub
|
|
67
|
+
* compares under `/gh/`) get the SPA's `index.html` here, before devframe's static handler sees them.
|
|
68
|
+
*/
|
|
69
|
+
function createAppWithRefRoutes() {
|
|
70
|
+
const app = new H3();
|
|
71
|
+
const index = fileURLToPath(new URL("./client/index.html", import.meta.url));
|
|
72
|
+
app.use(async (event, next) => {
|
|
73
|
+
if (!/^\/(?:compare|branch|commit|gh)\//.test(event.url.pathname) || !event.req.headers.get("accept")?.includes("text/html")) return next();
|
|
74
|
+
return new Response(await readFile(index, "utf8"), { headers: { "Content-Type": "text/html; charset=utf-8" } });
|
|
75
|
+
});
|
|
76
|
+
return app;
|
|
77
|
+
}
|
|
78
|
+
async function main() {
|
|
79
|
+
const { values: flags, positionals } = parseArgs({
|
|
80
|
+
options: {
|
|
81
|
+
"worktree": { type: "boolean" },
|
|
82
|
+
"port": { type: "string" },
|
|
83
|
+
"no-open": { type: "boolean" },
|
|
84
|
+
"help": {
|
|
85
|
+
type: "boolean",
|
|
86
|
+
short: "h"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
allowPositionals: true
|
|
90
|
+
});
|
|
91
|
+
if (flags.help) {
|
|
92
|
+
process.stdout.write(HELP);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const page = encodeURI(await pageFor(process.cwd(), positionals[0], !!flags.worktree));
|
|
96
|
+
await createDevServer(devframe_default, {
|
|
97
|
+
app: createAppWithRefRoutes(),
|
|
98
|
+
port: flags.port ? Number(flags.port) : void 0,
|
|
99
|
+
openBrowser: flags["no-open"] ? false : page,
|
|
100
|
+
onReady: ({ origin }) => {
|
|
101
|
+
process.stdout.write(`pulls.review is serving ${origin}${page}\n`);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
main().catch((error) => {
|
|
106
|
+
console.error(error instanceof Error ? error.message : error);
|
|
107
|
+
process.exitCode = 1;
|
|
108
|
+
});
|
|
109
|
+
//#endregion
|
|
110
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pulls.review",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"description": "Review local git changes - the working tree, a commit or any range - grouped and summarized in the browser.",
|
|
6
6
|
"author": "Anthony Fu <hi@antfu.me>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -34,13 +34,17 @@
|
|
|
34
34
|
"node": ">=20"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@pulls.review/core": "^0.
|
|
37
|
+
"@pulls.review/core": "^0.3.0",
|
|
38
38
|
"devframe": "^1.2.0",
|
|
39
39
|
"h3": "^2.0.1-rc.32",
|
|
40
|
-
"unstorage": "^1.17.5"
|
|
40
|
+
"unstorage": "^1.17.5",
|
|
41
|
+
"valibot": "^1.5.0"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
44
|
+
"@earendil-works/pi-agent-core": "^0.87.1",
|
|
45
|
+
"@earendil-works/pi-ai": "^0.87.1",
|
|
43
46
|
"@types/node": "^26.6.4",
|
|
47
|
+
"@valibot/to-json-schema": "^1.8.0",
|
|
44
48
|
"tsdown": "^0.23.0",
|
|
45
49
|
"typescript": "^6.0.3",
|
|
46
50
|
"vitest": "^5.0.3"
|