@fabiofiorita/porcelain 0.77.0 → 0.78.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 +1 -1
- package/package.json +1 -1
- package/server/src/cli/main.mjs +48 -2
- package/web/dist/assets/_-CSJHpFdT.js +1 -0
- package/web/dist/assets/_layerId-DODyO-4v.js +1 -0
- package/web/dist/assets/_paired-BQ0y29Xb.js +1 -0
- package/web/dist/assets/_paired-Bse7nsmg.js +1 -0
- package/web/dist/assets/_paired-CmZDjtRz.js +1 -0
- package/web/dist/assets/_paired-CrNFab02.js +1 -0
- package/web/dist/assets/_reviewId-CBVBAvNp.js +1 -0
- package/web/dist/assets/_revision-BMXAJq_Z.js +1 -0
- package/web/dist/assets/{_section-CJMMR6oZ.js → _section-DdvA8EEA.js} +1 -1
- package/web/dist/assets/_worktreeId-B27bXYEK.js +1 -0
- package/web/dist/assets/_worktreeId-Bse7nsmg.js +1 -0
- package/web/dist/assets/_worktreeId-C8Q6GcvL.js +1 -0
- package/web/dist/assets/_worktreeId-CmZDjtRz.js +1 -0
- package/web/dist/assets/access-E2mYEqnl.js +19 -0
- package/web/dist/assets/connected-workspace-8ch85vkt.js +1 -0
- package/web/dist/assets/desktop-actions-BPv0J8RL.js +1 -0
- package/web/dist/assets/{edit-file-oBFPJFcX.js → edit-file-Bcu9LCmp.js} +20 -20
- package/web/dist/assets/{file-editor--RrdNChU.js → file-editor-B_jE48tv.js} +11 -11
- package/web/dist/assets/index-BHlOFndd.js +10 -0
- package/web/dist/assets/index-Bg-CecA5.css +2 -0
- package/web/dist/assets/{lazyRouteComponent-B5-ihfdW.js → lazyRouteComponent-C0NLdQ95.js} +1 -1
- package/web/dist/assets/pair-Bse7nsmg.js +1 -0
- package/web/dist/assets/pair-CbpILDh2.js +1 -0
- package/web/dist/assets/review-route-CZyVDwAY.js +1 -0
- package/web/dist/assets/reviews-DCiXZMLG.js +1404 -0
- package/web/dist/assets/useMatch-CPSFM0JI.js +1 -0
- package/web/dist/assets/useRouterState-DtsAJKLm.js +1 -0
- package/web/dist/assets/workspace-error-DIuDMViV.js +1 -0
- package/web/dist/assets/workspace-pending-DgQgV-cu.js +1 -0
- package/web/dist/index.html +8 -8
- package/web/dist/assets/_-BTvJDc4N.js +0 -1
- package/web/dist/assets/_layerId-NWxUwyYM.js +0 -1
- package/web/dist/assets/_paired-Cd6bWv-d.js +0 -1
- package/web/dist/assets/_paired-Dhf6bO7a.js +0 -1
- package/web/dist/assets/_paired-LyVh2Ev9.js +0 -1
- package/web/dist/assets/_paired-z3_np6A6.js +0 -1
- package/web/dist/assets/_reviewId-DskS2QHc.js +0 -1
- package/web/dist/assets/_revision-DbkYDGJy.js +0 -1
- package/web/dist/assets/_worktreeId-CIrrQ4wO.js +0 -1
- package/web/dist/assets/_worktreeId-CMLa7jIe.js +0 -1
- package/web/dist/assets/_worktreeId-Dhf6bO7a.js +0 -1
- package/web/dist/assets/_worktreeId-LyVh2Ev9.js +0 -1
- package/web/dist/assets/access-Cc9LnHhZ.js +0 -19
- package/web/dist/assets/connected-workspace-BCSEyUOs.js +0 -1
- package/web/dist/assets/desktop-actions-BxLgt0EB.js +0 -1
- package/web/dist/assets/index-BXmzx3MO.js +0 -10
- package/web/dist/assets/index-Dz_rBtGK.css +0 -2
- package/web/dist/assets/pair-BC_fDEO8.js +0 -1
- package/web/dist/assets/pair-Dhf6bO7a.js +0 -1
- package/web/dist/assets/review-route-BHH1bYmh.js +0 -1
- package/web/dist/assets/reviews-URZ7SKqW.js +0 -1396
- package/web/dist/assets/useMatch-DLaUbB76.js +0 -1
- package/web/dist/assets/useRouterState-BxhFGwfy.js +0 -1
- package/web/dist/assets/workspace-error-CjLz95tb.js +0 -1
- package/web/dist/assets/workspace-pending-CSiUulq0.js +0 -1
package/README.md
CHANGED
package/package.json
CHANGED
package/server/src/cli/main.mjs
CHANGED
|
@@ -785,6 +785,7 @@ var githubPullRequestSchema = Schema32.Struct({
|
|
|
785
785
|
)
|
|
786
786
|
}),
|
|
787
787
|
body: Schema32.String,
|
|
788
|
+
bodyHTML: Schema32.optional(Schema32.String),
|
|
788
789
|
createdAt: Schema32.optional(Schema32.String),
|
|
789
790
|
baseRefName: Schema32.String,
|
|
790
791
|
headRefOid: Schema32.String,
|
|
@@ -3495,6 +3496,51 @@ function pickGitHubAccount(candidates, override) {
|
|
|
3495
3496
|
|
|
3496
3497
|
// packages/reviews/src/rules/pull-request.ts
|
|
3497
3498
|
import { DateTime as DateTime2, Option as Option13 } from "effect";
|
|
3499
|
+
|
|
3500
|
+
// packages/reviews/src/rules/github-description.ts
|
|
3501
|
+
var ATTACHMENT = "https://github\\.com/user-attachments/assets/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})";
|
|
3502
|
+
function githubDescription(body, html) {
|
|
3503
|
+
if (!html) return body;
|
|
3504
|
+
const images = /* @__PURE__ */ new Map();
|
|
3505
|
+
for (const tag of html.matchAll(/<img\b[^>]*>/gi)) {
|
|
3506
|
+
const source = /\ssrc\s*=\s*(["'])(.*?)\1/i.exec(tag[0])?.[2];
|
|
3507
|
+
if (!source) continue;
|
|
3508
|
+
const url = source.replaceAll("&", "&");
|
|
3509
|
+
const id = /^https:\/\/private-user-images\.githubusercontent\.com\/\d+\/\d+-([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.[a-z0-9]+(?:\?[^\s"'<>\\()]*)?$/i.exec(
|
|
3510
|
+
url
|
|
3511
|
+
)?.[1];
|
|
3512
|
+
if (id) images.set(id.toLowerCase(), url);
|
|
3513
|
+
}
|
|
3514
|
+
if (!images.size) return body;
|
|
3515
|
+
const markdownImage = new RegExp(
|
|
3516
|
+
`(!\\[[^\\]\\n]*\\]\\(<?)${ATTACHMENT}(?=>?[\\s)])`,
|
|
3517
|
+
"gi"
|
|
3518
|
+
);
|
|
3519
|
+
const htmlImage = /<img\b[^>]*>/gi;
|
|
3520
|
+
const htmlSource = new RegExp(
|
|
3521
|
+
`(\\ssrc\\s*=\\s*["'])${ATTACHMENT}(?=["'])`,
|
|
3522
|
+
"gi"
|
|
3523
|
+
);
|
|
3524
|
+
const replace = (source) => source.replace(
|
|
3525
|
+
markdownImage,
|
|
3526
|
+
(match, prefix, id) => images.has(id.toLowerCase()) ? `${prefix}${images.get(id.toLowerCase())}` : match
|
|
3527
|
+
).replace(
|
|
3528
|
+
htmlImage,
|
|
3529
|
+
(tag) => tag.replace(
|
|
3530
|
+
htmlSource,
|
|
3531
|
+
(match, prefix, id) => images.has(id.toLowerCase()) ? `${prefix}${images.get(id.toLowerCase())}` : match
|
|
3532
|
+
)
|
|
3533
|
+
);
|
|
3534
|
+
let result = "";
|
|
3535
|
+
let offset = 0;
|
|
3536
|
+
for (const code of body.matchAll(/(`+|~{3,})[\s\S]*?\1/g)) {
|
|
3537
|
+
result += replace(body.slice(offset, code.index)) + code[0];
|
|
3538
|
+
offset = code.index + code[0].length;
|
|
3539
|
+
}
|
|
3540
|
+
return result + replace(body.slice(offset));
|
|
3541
|
+
}
|
|
3542
|
+
|
|
3543
|
+
// packages/reviews/src/rules/pull-request.ts
|
|
3498
3544
|
function mapPullRequestSummary(raw) {
|
|
3499
3545
|
const rollup = raw.commits.nodes[0]?.commit.statusCheckRollup;
|
|
3500
3546
|
const state2 = raw.state === "OPEN" ? "open" : raw.state === "MERGED" ? "merged" : "closed";
|
|
@@ -3583,7 +3629,7 @@ function mapPullRequest(raw, reviewHead) {
|
|
|
3583
3629
|
);
|
|
3584
3630
|
return {
|
|
3585
3631
|
...mapPullRequestSummary(raw),
|
|
3586
|
-
description: raw.body,
|
|
3632
|
+
description: githubDescription(raw.body, raw.bodyHTML),
|
|
3587
3633
|
createdAt: raw.createdAt,
|
|
3588
3634
|
authorAvatarUrl: raw.author?.avatarUrl ?? void 0,
|
|
3589
3635
|
baseBranch: raw.baseRefName,
|
|
@@ -37737,7 +37783,7 @@ var CHECK_FIELDS = `commits(last: 1) { nodes { commit { statusCheckRollup { stat
|
|
|
37737
37783
|
} } } } }`;
|
|
37738
37784
|
var detailQuery = `query PullRequestRead($owner: String!, $repo: String!, $number: Int!) {
|
|
37739
37785
|
repository(owner: $owner, name: $repo) { pullRequest(number: $number) {
|
|
37740
|
-
${SUMMARY_FIELDS} ${CHECK_FIELDS} body createdAt baseRefName headRefOid mergeable
|
|
37786
|
+
${SUMMARY_FIELDS} ${CHECK_FIELDS} body createdAt baseRefName headRefOid mergeable bodyHTML
|
|
37741
37787
|
labels(first: 50) { nodes { name color } ${PAGE} }
|
|
37742
37788
|
comments(first: 50) { nodes { id author { login avatarUrl(size: 48) } createdAt body url } ${PAGE} }
|
|
37743
37789
|
reviews(first: 50) { nodes { id author { login avatarUrl(size: 48) } submittedAt createdAt body url state
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Tc as e,pc as t}from"./access-E2mYEqnl.js";import{t as n}from"./connected-workspace-8ch85vkt.js";var r=t(),i=e(),a=()=>{let e=(0,r.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,i.jsx)(n,{notice:`not-found`}),e[0]=t):t=e[0],t};export{a as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Tc as e,pc as t}from"./access-E2mYEqnl.js";import{t as n}from"./index-BHlOFndd.js";import{t as r}from"./review-route-CZyVDwAY.js";var i=t(),a=e();function o(){let e=(0,i.c)(7),t=n.useParams(),o,s;e[0]===t?(o=e[1],s=e[2]):({layerId:o,...s}=t,e[0]=t,e[1]=o,e[2]=s);let c=n.useSearch(),l;return e[3]!==o||e[4]!==s||e[5]!==c?(l=(0,a.jsx)(r,{...s,...c,decision:o}),e[3]=o,e[4]=s,e[5]=c,e[6]=l):l=e[6],l}export{o as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Tc as e,Xi as t,pc as n,qi as r,vc as i,wn as a}from"./access-E2mYEqnl.js";import{t as o}from"./useRouterState-DtsAJKLm.js";import{k as s}from"./reviews-DCiXZMLG.js";import"./edit-file-Bcu9LCmp.js";import{t as c}from"./connected-workspace-8ch85vkt.js";import{s as l}from"./index-BHlOFndd.js";var u=n(),d=e();function f(){let e=(0,u.c)(18),n=l.useSearch(),f,m;e[0]===n?(f=e[1],m=e[2]):({worktree:m,...f}=n,e[0]=n,e[1]=f,e[2]=m);let h;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(h={select:p},e[3]=h):h=e[3];let g=o(h),{connection:_}=a(),v=s(_),y;e[4]!==v||e[5]!==m?(y=m===void 0?t(v,r(v)?.id):t(v,m),e[4]=v,e[5]=m,e[6]=y):y=e[6];let b=y;if(b&&g){let t;e[7]!==b.projectId||e[8]!==b.worktree.id?(t={projectId:b.projectId,worktreeId:b.worktree.id},e[7]=b.projectId,e[8]=b.worktree.id,e[9]=t):t=e[9];let n;e[10]!==f||e[11]!==m?(n=m===void 0?{}:f,e[10]=f,e[11]=m,e[12]=n):n=e[12];let r;return e[13]!==t||e[14]!==n?(r=(0,d.jsx)(i,{to:`/$projectId/$worktreeId`,params:t,search:n,replace:!0}),e[13]=t,e[14]=n,e[15]=r):r=e[15],r}let x=m!==void 0&&g?`missing-worktree`:void 0,S;return e[16]===x?S=e[17]:(S=(0,d.jsx)(c,{notice:x}),e[16]=x,e[17]=S),S}function p(e){return e.status===`idle`&&e.location.pathname===`/`}export{f as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./workspace-error-DIuDMViV.js";var t=e;export{t as errorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./workspace-error-DIuDMViV.js";var t=e;export{t as errorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Tc as t,Tn as n,nl as r,pc as i,vc as a}from"./access-E2mYEqnl.js";import{t as o}from"./useRouterState-DtsAJKLm.js";import{M as s,_ as c,a as l,g as u,h as d}from"./reviews-DCiXZMLG.js";import{l as f}from"./index-BHlOFndd.js";import{t as p}from"./desktop-actions-BPv0J8RL.js";var m=e(r(),1),h=i(),g=t();function _(e){let t=(0,h.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,g.jsx)(s,{}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,g.jsxs)(g.Fragment,{children:[r,(0,g.jsx)(l,{children:n})]}),t[1]=n,t[2]=i),i}function v(e){let t=(0,h.c)(6),{children:r}=e,[i,a]=(0,m.useState)(!0),o=n(),s;t[0]===o?s=t[1]:(s=o&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(u,{connection:o}),(0,g.jsx)(c,{connection:o})]}),t[0]=o,t[1]=s);let l;return t[2]!==r||t[3]!==i||t[4]!==s?(l=(0,g.jsx)(_,{children:(0,g.jsxs)(d,{open:i,onOpenChange:a,children:[r,s]})}),t[2]=r,t[3]=i,t[4]=s,t[5]=l):l=t[5],l}function y(){let e=(0,h.c)(4),t=n(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={select:b},e[0]=r):r=e[0];let i=o(r),s;return e[1]!==t||e[2]!==i?(s=t?(0,g.jsxs)(v,{children:[(0,g.jsx)(f,{}),(0,g.jsx)(p,{connection:t,empty:i})]}):(0,g.jsx)(a,{to:`/pair`,replace:!0}),e[1]=t,e[2]=i,e[3]=s):s=e[3],s}function b(e){return e.location.pathname===`/`}export{y as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Tc as e,pc as t}from"./access-E2mYEqnl.js";import{i as n}from"./index-BHlOFndd.js";import{t as r}from"./review-route-CZyVDwAY.js";var i=t(),a=e();function o(){let e=(0,i.c)(3),t=n.useParams(),o=n.useSearch(),s;return e[0]!==t||e[1]!==o?(s=(0,a.jsx)(r,{...t,...o}),e[0]=t,e[1]=o,e[2]=s):s=e[2],s}export{o as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Tc as e,pc as t}from"./access-E2mYEqnl.js";import{n}from"./index-BHlOFndd.js";import{t as r}from"./review-route-CZyVDwAY.js";var i=t(),a=e();function o(){let e=(0,i.c)(3),t=n.useParams(),o=n.useSearch(),s;return e[0]!==t||e[1]!==o?(s=(0,a.jsx)(r,{...t,...o}),e[0]=t,e[1]=o,e[2]=s):s=e[2],s}export{o as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Tc as e,pc as t,wn as n}from"./access-E2mYEqnl.js";import{t as r}from"./useMatch-CPSFM0JI.js";import{c as i,k as a,u as o}from"./reviews-DCiXZMLG.js";import{n as s,t as c}from"./connected-workspace-8ch85vkt.js";import{a as l}from"./index-BHlOFndd.js";var u=t(),d=e();function f(){let e=(0,u.c)(5),{section:t}=l.useParams(),f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(f={from:`/_paired/settings/$section/$environmentId`,shouldThrow:!1},e[0]=f):f=e[0];let p=r(f),m=o.some(e=>e.id===t)&&(p===void 0||t===`computers`),{connection:h}=n(),{environment:g}=a(h);if(s(m?g.custom?`Settings · ${g.name}`:`Settings`:`Porcelain`),!m){let t;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,d.jsx)(c,{notice:`not-found`}),e[1]=t):t=e[1],t}let _=p?.params.environmentId,v;return e[2]!==t||e[3]!==_?(v=(0,d.jsx)(c,{settingsOpen:!0,children:(0,d.jsx)(i,{section:t,environmentId:_})}),e[2]=t,e[3]=_,e[4]=v):v=e[4],v}export{f as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{En as e,Tc as t,pc as n,vc as r}from"./access-E2mYEqnl.js";import"./reviews-DCiXZMLG.js";import"./edit-file-Bcu9LCmp.js";import"./connected-workspace-8ch85vkt.js";import"./workspace-pending-DgQgV-cu.js";import{r as i}from"./index-BHlOFndd.js";var a=n(),o=t();function s(){let t=(0,a.c)(9),{environmentId:n,projectId:s,worktreeId:c}=i.useParams(),l=i.useSearch();e(n);{let e;return t[0]!==l||t[1]!==c?(e=(0,o.jsx)(r,{to:`/`,search:{...l,worktree:c},replace:!0}),t[0]=l,t[1]=c,t[2]=e):e=t[2],e}}export{s as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./workspace-error-DIuDMViV.js";var t=e;export{t as errorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Tc as e,Xi as t,pc as n,vc as r,wn as i}from"./access-E2mYEqnl.js";import{k as a}from"./reviews-DCiXZMLG.js";import"./edit-file-Bcu9LCmp.js";import{t as o}from"./connected-workspace-8ch85vkt.js";import{o as s}from"./index-BHlOFndd.js";var c=n(),l=e();function u(){let e=(0,c.c)(10),{projectId:n,worktreeId:u}=s.useParams(),d=s.useSearch(),{connection:f}=i(),p=a(f),m;e[0]!==p||e[1]!==u?(m=t(p,u),e[0]=p,e[1]=u,e[2]=m):m=e[2];let h=m;if(h?.projectId!==n){let t;return e[3]!==d||e[4]!==u?(t=(0,l.jsx)(r,{to:`/`,search:{...d,worktree:u},replace:!0}),e[3]=d,e[4]=u,e[5]=t):t=e[5],t}let g;return e[6]!==p||e[7]!==d||e[8]!==h?(g=(0,l.jsx)(o,{review:{selection:h,search:d,inventory:p}}),e[6]=p,e[7]=d,e[8]=h,e[9]=g):g=e[9],g}export{u as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./workspace-error-DIuDMViV.js";var t=e;export{t as errorComponent};
|