github-stars-organizer 1.3.1 → 1.3.3
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/app/assets/{backups-DrK5WGqD.js → backups-DUiBIjYh.js} +1 -1
- package/dist/app/assets/{badge-Drt9JvOu.js → badge-CVyqIkfu.js} +1 -1
- package/dist/app/assets/button-srM_gVNp.js +14 -0
- package/dist/app/assets/{coerce-Cxjr6MIU.js → coerce-hGm-kFoB.js} +1 -1
- package/dist/app/assets/explore-DfJsTl1a.js +33 -0
- package/dist/app/assets/{history-CN5yGwhZ.js → history-BeQkAZPX.js} +1 -1
- package/dist/app/assets/index-CEpF9MZu.css +2 -0
- package/dist/app/assets/index-OngkfrWb.js +10 -0
- package/dist/app/assets/list._listId-BthjMh8l.js +2 -0
- package/dist/app/assets/{list._listId-DBB3l--n.js → list._listId-QMOV--8Q.js} +1 -1
- package/dist/app/assets/{local-backups-DLhiWDk4.js → local-backups-BlLTb6g5.js} +1 -1
- package/dist/app/assets/{local-sync-DiQe8mhd.js → local-sync-Cp5d59-N.js} +1 -1
- package/dist/app/assets/{registry-BKf8LDk2.js → registry-CDScSFs0.js} +2 -2
- package/dist/app/assets/{routes-BYr-dng4.js → routes-8llA2c3j.js} +2 -2
- package/dist/app/assets/{routes-DaKmAWCG.js → routes-CIYRvBg6.js} +2 -2
- package/dist/app/assets/{schemas-DVvZEnxp.js → schemas-CLMWt96T.js} +2 -2
- package/dist/app/assets/{star-BPue5Y4t.js → star-D-XjWe95.js} +1 -1
- package/dist/app/assets/{triangle-alert-BL8M65pd.js → triangle-alert-ILMBIuGB.js} +1 -1
- package/dist/app/index.html +9 -9
- package/dist/cli.js +12 -1
- package/package.json +1 -1
- package/dist/app/assets/button-r9cVFa0_.js +0 -14
- package/dist/app/assets/explore-Da5fm3tF.js +0 -33
- package/dist/app/assets/index-dVYqSW2P.css +0 -2
- package/dist/app/assets/index-mzNFlFJk.js +0 -10
- package/dist/app/assets/list._listId-CNuYrPaQ.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/list._listId-QMOV--8Q.js","assets/button-srM_gVNp.js","assets/sync-persistence-BJbWXISF.js","assets/registry-CDScSFs0.js","assets/schemas-CLMWt96T.js","assets/coerce-hGm-kFoB.js","assets/star-D-XjWe95.js","assets/badge-CVyqIkfu.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{G as e}from"./button-srM_gVNp.js";import{O as t,k as n,t as r}from"./coerce-hGm-kFoB.js";import{c as i,s as a}from"./schemas-CLMWt96T.js";var o=()=>e(()=>import(`./list._listId-QMOV--8Q.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),s=a({sort:i().optional(),group:i().optional(),search:i().optional(),page:r().optional(),language:i().optional(),archived:i().optional(),healthMin:r().optional(),healthMax:r().optional(),starsMin:r().optional(),starsMax:r().optional(),topics:i().optional(),freshness:i().optional()}),c=n(`/list/$listId`)({component:t(o,`component`),validateSearch:s});export{c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,R as t,V as n,it as r,
|
|
1
|
+
import{B as e,R as t,V as n,it as r,lt as i,ot as a,t as o,z as s}from"./button-srM_gVNp.js";import{n as c,r as l}from"./star-D-XjWe95.js";import{S as u}from"./coerce-hGm-kFoB.js";import{C as d,E as f,_ as p,a as m,c as h,d as g,f as _,g as ee,h as v,i as y,l as b,n as x,o as S,p as C,r as w,s as T,t as E,u as D}from"./registry-CDScSFs0.js";import{Pn as O}from"./schemas-CLMWt96T.js";import{t as k}from"./list._listId-BthjMh8l.js";var A=t(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),j=i(a()),M=r();function N(){let{listId:t}=k.useParams(),r=l(),i=k.useSearch(),{data:a}=c(e=>e.from({listCollection:s}).select(({listCollection:e})=>e)),{data:N}=c(t=>t.from({listItemCollection:e}).select(({listItemCollection:e})=>e)),{data:P}=c(e=>e.from({repoCollection:n}).select(({repoCollection:e})=>e)),[F,I]=(0,j.useState)(!1),[L,R]=(0,j.useState)(``),[z,B]=(0,j.useState)(``),[V,H]=(0,j.useState)(null),U=v(),W=(a??[]).find(e=>e.id===t),G=N??[],K=G.filter(e=>e.list_id===t),q=new Set(K.map(e=>e.repo_id)),J=(P??[]).filter(e=>q.has(e.id)),Y=(0,j.useMemo)(()=>{let e=new Map;for(let t of K)e.set(t.repo_id,t.id);return e},[K]),{registry:X,sortDefinitions:Z}=(0,j.useMemo)(()=>w(J),[J]),Q=(0,j.useMemo)(()=>g(i,X,x,E),[i,X]),te=(0,j.useCallback)(e=>{let n=_(e,X,x,E);r({to:`/list/$listId`,params:{listId:t},search:n,replace:!0})},[r,t,X]);if(!W)return(0,M.jsx)(`p`,{className:`p-8 text-muted-foreground`,children:`List not found`});function ne(){R(W.name),B(W.description??``),I(!0)}function re(){s.update(W.id,e=>{e.name=L,e.description=z||null,e.updated_at=new Date().toISOString()}),I(!1)}function ie(){window.confirm(`Delete "${W.name}" here and on GitHub? The repos stay starred.`)&&(s.delete(W.id),r({to:`/`}))}let $=e=>(0,M.jsxs)(p,{repo:e,children:[Y.get(e.id)&&(0,M.jsx)(p.RemoveFromList,{listItemId:Y.get(e.id)}),(0,M.jsx)(p.AddToList,{repo:e,lists:a??[],listItems:G}),(0,M.jsx)(p.Rate,{repo:e}),(0,M.jsx)(p.Separator,{}),(0,M.jsx)(p.OpenOnGithub,{url:e.url}),(0,M.jsx)(p.CopyUrl,{url:e.url}),(0,M.jsx)(p.Separator,{}),(0,M.jsx)(p.Unstar,{repo:e})]}),ae=T({selectable:!0,onPreview:e=>H(e),renderActions:$});return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[F?(0,M.jsxs)(`div`,{className:`mr-4 flex-1 space-y-2`,children:[(0,M.jsx)(u,{value:L,onChange:e=>R(e.target.value),className:`font-display text-2xl font-bold`,autoFocus:!0}),(0,M.jsx)(ee,{value:z,onChange:e=>B(e.target.value),placeholder:`Description`,className:`min-h-16 text-sm`}),(0,M.jsxs)(`div`,{className:`flex gap-2`,children:[(0,M.jsxs)(o,{size:`sm`,onClick:re,children:[(0,M.jsx)(f,{className:`mr-1 h-3 w-3`}),`Save`]}),(0,M.jsxs)(o,{size:`sm`,variant:`ghost`,onClick:()=>I(!1),children:[(0,M.jsx)(O,{className:`mr-1 h-3 w-3`}),`Cancel`]})]})]}):(0,M.jsxs)(`div`,{className:`min-w-0`,children:[(0,M.jsx)(`h1`,{className:`font-display text-2xl font-bold tracking-tight sm:text-3xl`,children:W.name}),W.description&&(0,M.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:W.description}),(0,M.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[J.length,` repos`]})]}),!F&&(0,M.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[(0,M.jsx)(o,{variant:`ghost`,size:`icon-lg`,"aria-label":`Edit list`,title:`Edit list`,onClick:ne,children:(0,M.jsx)(A,{})}),(0,M.jsx)(o,{variant:`ghost`,size:`icon-lg`,"aria-label":`Delete list`,title:`Delete list`,className:`text-destructive hover:text-destructive`,onClick:ie,children:(0,M.jsx)(d,{})})]})]}),(0,M.jsx)(D,{items:J,registry:X,sortDefinitions:Z,defaultSort:x,defaultGroupBy:E,viewState:Q,onViewStateChange:te,searchFields:y,children:(0,M.jsx)(b,{columns:ae,getRowId:e=>e.id,toolbar:(0,M.jsx)(h,{}),onRowClick:U?void 0:H,renderMobileRow:(e,t)=>(0,M.jsx)(m,{repo:e,state:t,actions:$(e)}),renderBulkActions:(e,n)=>(0,M.jsx)(S,{selectedRepos:e,lists:a??[],listItems:G,listId:t,clearSelection:n})})}),(0,M.jsx)(C,{repo:V,lists:a??[],listItems:G,open:V!==null,onOpenChange:e=>{e||H(null)}})]})}export{N as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as e,K as t,R as n,U as r,V as i,W as a,it as o,n as s,
|
|
1
|
+
import{H as e,K as t,R as n,U as r,V as i,W as a,it as o,n as s,ot as c,t as l}from"./button-srM_gVNp.js";import{Pn as u,a as d,at as f,c as p,d as m,g as h,i as g,it as _,n as v,o as y,r as b,rt as x,s as S,u as C,y as w}from"./schemas-CLMWt96T.js";import{t as T}from"./local-sync-Cp5d59-N.js";var E=n(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),D=n(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]);c();var O=o();function k({...e}){return(0,O.jsx)(m,{"data-slot":`dialog`,...e})}function A({...e}){return(0,O.jsx)(h,{"data-slot":`dialog-portal`,...e})}function j({className:e,...t}){return(0,O.jsx)(f,{"data-slot":`dialog-overlay`,className:s(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function M({className:e,children:t,showCloseButton:n=!0,...r}){return(0,O.jsxs)(A,{children:[(0,O.jsx)(j,{}),(0,O.jsxs)(w,{"data-slot":`dialog-content`,className:s(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,O.jsxs)(_,{"data-slot":`dialog-close`,render:(0,O.jsx)(l,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,O.jsx)(u,{}),(0,O.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function N({className:e,...t}){return(0,O.jsx)(`div`,{"data-slot":`dialog-header`,className:s(`flex flex-col gap-2`,e),...t})}function P({className:e,showCloseButton:t=!1,children:n,...r}){return(0,O.jsxs)(`div`,{"data-slot":`dialog-footer`,className:s(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,O.jsx)(_,{render:(0,O.jsx)(l,{variant:`outline`}),children:`Close`})]})}function F({className:e,...t}){return(0,O.jsx)(C,{"data-slot":`dialog-title`,className:s(`font-heading text-base leading-none font-medium`,e),...t})}function I({className:e,...t}){return(0,O.jsx)(x,{"data-slot":`dialog-description`,className:s(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}var L=`github-stars-organizer-backup`,R=S({githubId:y().int(),nodeId:p(),fullName:p()}),z=R.extend({starredAt:p()}),B=S({id:p(),name:p(),description:p().nullable(),isPrivate:g(),repos:b(R)}),V=S({repos:b(S({githubId:y().int(),notes:p().nullable(),usefulnessRating:y().int().min(1).max(5).nullable()})),tags:b(S({id:p(),name:p(),color:p()})),repoTags:b(S({githubId:y().int(),tagId:p()}))}),H=S({format:d(L),version:d(1),createdAt:p(),login:p(),reason:v([`launch`,`manual`,`before-restore`,`uploaded`]),stars:b(z),lists:b(B),local:V.optional()}),U=class extends Error{};function W(e){let t=H.safeParse(e);if(t.success)return t.data;let n=e;if(n?.format!==`github-stars-organizer-backup`)throw new U(`This file isn't a Stars Organizer backup.`);if(typeof n.version==`number`&&n.version>1)throw new U("This backup was made by a newer version. Update with `npx github-stars-organizer@latest`.");let r=t.error.issues[0];throw new U(`This backup is damaged (${r.path.join(`.`)}: ${r.message}).`)}S({local:V.optional()});function G(e){return e.restar.length+e.recreateLists.length+e.addToLists.length}function K({repos:e,tags:t,repo_tags:n}){let r=new Map(e.map(e=>[e.id,e.github_id]));return{repos:e.filter(e=>e.notes||e.usefulness_rating!==null).map(e=>({githubId:e.github_id,notes:e.notes||null,usefulnessRating:e.usefulness_rating})),tags:t.map(({id:e,name:t,color:n})=>({id:e,name:t,color:n})),repoTags:n.flatMap(e=>{let t=r.get(e.repo_id);return t===void 0?[]:[{githubId:t,tagId:e.tag_id}]})}}function q(e,t,n){let r=new Map(t.repos.map(e=>[e.github_id,e])),i=e.repos.flatMap(e=>{let t=r.get(e.githubId);if(!t)return[];let n={id:t.id};return!t.notes&&e.notes&&(n.notes=e.notes),t.usefulness_rating===null&&e.usefulnessRating!==null&&(n.usefulness_rating=e.usefulnessRating),Object.keys(n).length>1?[n]:[]}),a=new Map(t.tags.map(e=>[e.name.toLowerCase(),e.id])),o=[],s=new Map;for(let t of e.tags){let e=a.get(t.name.toLowerCase());if(e){s.set(t.id,e);continue}let r={id:n(),name:t.name,color:t.color};o.push(r),a.set(r.name.toLowerCase(),r.id),s.set(t.id,r.id)}let c=new Set(t.repo_tags.map(e=>`${e.repo_id}:${e.tag_id}`));return{repos:i,tags:o,repo_tags:e.repoTags.flatMap(e=>{let t=r.get(e.githubId),i=s.get(e.tagId);if(!t||!i)return[];let a=`${t.id}:${i}`;return c.has(a)?[]:(c.add(a),[{id:n(),repo_id:t.id,tag_id:i}])})}}async function J(){return await Promise.all([i.preload(),r.preload(),e.preload()]),{repos:i.toArray,tags:r.toArray,repo_tags:e.toArray}}async function Y(){return t.backUpNow({local:K(await J())})}async function X(e){let n=await t.readBackup(e.id),r=n.local?n:{...n,local:K(await J())},i=URL.createObjectURL(new Blob([JSON.stringify(r,null,2)],{type:`application/json`})),a=document.createElement(`a`);a.href=i,a.download=`stars-organizer-${n.login}-${e.id}.json`,a.click(),URL.revokeObjectURL(i)}async function Z(e){let n;try{n=JSON.parse(await e.text())}catch{throw Error(`${e.name} isn't a JSON file.`)}return t.uploadBackup(W(n))}async function Q(t){let n=q(t,await J(),()=>crypto.randomUUID());return await a(()=>{for(let e of n.repos)i.update(e.id,t=>{Object.assign(t,e)});n.tags.length&&r.insert(n.tags),n.repo_tags.length&&e.insert(n.repo_tags)}),{notesAndRatings:n.repos.length,tags:n.tags.length,tagLinks:n.repo_tags.length}}async function $(e){let n=await t.applyRestore({backupId:e.id});await T();let{local:r}=await t.readBackup(e.id);return{...n,local:r?await Q(r):null}}export{G as a,I as c,F as d,D as f,Z as i,P as l,X as n,k as o,E as p,$ as r,M as s,Y as t,N as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,H as t,K as n,U as r,V as i,W as a,z as o}from"./button-
|
|
1
|
+
import{B as e,H as t,K as n,U as r,V as i,W as a,z as o}from"./button-srM_gVNp.js";var s=[`github_id`,`node_id`,`name`,`full_name`,`owner`,`description`,`url`,`homepage`,`language`,`stars`,`forks`,`topics`,`starred_at`,`is_archived`,`pushed_at`,`created_at`];function c(e,t){return s.some(n=>e[n]!==t[n])}function l(e,t){return e.name!==t.name||e.description!==t.description||e.is_private!==t.is_private}function u(e,t,n){let r=new Map(e.map(e=>[e.github_id,e])),i=[],a=[],o=new Map;for(let e of t){let t=r.get(e.github_id);if(!t){let t=String(e.github_id);i.push({...e,id:t,notes:null,usefulness_rating:null,imported_at:n,health_score:null,health_data:null,health_refreshed_at:null}),o.set(e.github_id,t);continue}o.set(e.github_id,t.id),c(t,e)&&a.push({...t,...e})}return{insert:i,update:a,remove:e.filter(e=>!o.has(e.github_id)).map(e=>e.id),idByGithubId:o}}function d(e,t){let n=new Map(e.flatMap(e=>e.github_list_id?[[e.github_list_id,e]]:[])),r=[],i=[],a=new Map;for(let e of t){let t=n.get(e.id),o={id:t?.id??e.id,github_list_id:e.id,name:e.name,description:e.description,is_private:e.isPrivate,created_at:e.createdAt,updated_at:e.updatedAt};a.set(e.id,o.id),t?l(t,o)&&i.push(o):r.push(o)}return{insert:r,update:i,remove:e.filter(e=>e.github_list_id!==null&&!a.has(e.github_list_id)).map(e=>e.id),idByGithubId:a}}function f(e,t,n){let r=u(e.repos,t.repos,n),i=d(e.lists,t.lists),a=new Map;for(let e of t.lists){let t=i.idByGithubId.get(e.id);e.repos.forEach((n,i)=>{let o=r.idByGithubId.get(n.githubId);if(!o)return;let s=`${t}:${o}`;a.set(s,{id:s,list_id:t,repo_id:o,position:i,added_at:e.updatedAt})})}let o=new Set(i.idByGithubId.values()),s=new Set(i.remove),c=new Set(r.remove),l=new Set,f=[];for(let t of e.list_items){let e=`${t.list_id}:${t.repo_id}`;l.add(e);let n=s.has(t.list_id)||c.has(t.repo_id),r=o.has(t.list_id)&&!a.has(e);(n||r)&&f.push(t.id)}return{insert:{repos:r.insert,lists:i.insert,list_items:[...a].filter(([e])=>!l.has(e)).map(([,e])=>e)},update:{repos:r.update,lists:i.update},remove:{repos:r.remove,lists:i.remove,list_items:f,repo_tags:e.repo_tags.filter(e=>c.has(e.repo_id)).map(e=>e.id)}}}var p=[i,o,e,r,t];async function m(){return await Promise.all(p.map(e=>e.preload())),{repos:i.toArray,lists:o.toArray,list_items:e.toArray,repo_tags:t.toArray}}async function h(){let r=await n.importStars(),s=f(await m(),r,new Date().toISOString());return await a(()=>{s.remove.repo_tags.length&&t.delete(s.remove.repo_tags),s.remove.list_items.length&&e.delete(s.remove.list_items),s.remove.lists.length&&o.delete(s.remove.lists),s.remove.repos.length&&i.delete(s.remove.repos),s.insert.repos.length&&i.insert(s.insert.repos),s.insert.lists.length&&o.insert(s.insert.lists);for(let e of s.update.repos)i.update(e.id,t=>{Object.assign(t,e)});for(let e of s.update.lists)o.update(e.id,t=>{Object.assign(t,e)});s.insert.list_items.length&&e.insert(s.insert.list_items)}),{stars:r.repos.length,lists:r.lists.length}}var g=100;async function _(e,t){await i.preload();let r=i.toArray.filter(t=>t.node_id!==null&&(e===`all`||t.health_score===null)),o={scored:0,total:r.length};for(let e=0;e<r.length;e+=g){let s=r.slice(e,e+g),c=new Map(s.map(e=>[e.node_id,e.id])),{scores:l}=await n.scoreHealth({repos:s.map(e=>({node_id:e.node_id,stars:e.stars,health_refreshed_at:e.health_refreshed_at}))}),u=new Date().toISOString();await a(()=>{for(let e of l){let t=c.get(e.node_id);!t||!i.has(t)||i.update(t,t=>{t.health_score=e.score,t.health_data=e.data,t.health_refreshed_at=u,t.is_archived=e.is_archived,t.stars=e.stars})}}),o.scored+=l.length,t({...o})}return o}export{_ as n,h as t};
|