From 451f0253b3cd97fbb8252b9dc6daaa46cb152798 Mon Sep 17 00:00:00 2001 From: Giacomo Ferretti Date: Wed, 23 Oct 2024 23:25:00 +0200 Subject: [PATCH] feat!: rewrite entire extension to TypeScript and add support for new GitHub API Fixes #4 and #5 --- .github/workflows/build.yml | 29 + .gitignore | 6 +- .vscode/settings.json | 10 + icons/icon.128.png | Bin 1754 -> 0 bytes icons/icon.16.png | Bin 354 -> 0 bytes icons/icon.32.png | Bin 507 -> 0 bytes icons/icon.48.png | Bin 874 -> 0 bytes icons/icon.64.png | Bin 792 -> 0 bytes js/main.js | 298 ---- pack.sh | 9 +- package.json | 31 + pnpm-lock.yaml | 1541 +++++++++++++++++ .../_locales}/en/messages.json | 0 public/icons/icon.128.png | Bin 0 -> 2199 bytes public/icons/icon.16.png | Bin 0 -> 388 bytes public/icons/icon.32.png | Bin 0 -> 596 bytes public/icons/icon.48.png | Bin 0 -> 1003 bytes public/icons/icon.64.png | Bin 0 -> 1053 bytes {icons => public/icons}/source.svg | 0 manifest.json => public/manifest.json | 6 +- src/constants.ts | 11 + src/content_script.ts | 41 + src/lib/forks.ts | 80 + src/lib/index.ts | 125 ++ src/lib/legacy-forks.ts | 57 + tsconfig.json | 15 + webpack/webpack.common.js | 43 + webpack/webpack.dev.js | 7 + webpack/webpack.prod.js | 6 + 29 files changed, 2007 insertions(+), 308 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .vscode/settings.json delete mode 100644 icons/icon.128.png delete mode 100644 icons/icon.16.png delete mode 100644 icons/icon.32.png delete mode 100644 icons/icon.48.png delete mode 100644 icons/icon.64.png delete mode 100644 js/main.js create mode 100644 package.json create mode 100644 pnpm-lock.yaml rename {_locales => public/_locales}/en/messages.json (100%) create mode 100644 public/icons/icon.128.png create mode 100644 public/icons/icon.16.png create mode 100644 public/icons/icon.32.png create mode 100644 public/icons/icon.48.png create mode 100644 public/icons/icon.64.png rename {icons => public/icons}/source.svg (100%) rename manifest.json => public/manifest.json (86%) create mode 100644 src/constants.ts create mode 100644 src/content_script.ts create mode 100644 src/lib/forks.ts create mode 100644 src/lib/index.ts create mode 100644 src/lib/legacy-forks.ts create mode 100644 tsconfig.json create mode 100644 webpack/webpack.common.js create mode 100644 webpack/webpack.dev.js create mode 100644 webpack/webpack.prod.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..4083d9d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,29 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: build + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build --if-present + # - run: npm test diff --git a/.gitignore b/.gitignore index 032b978..6e66c17 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ -.ignoreme -.build \ No newline at end of file +.old +.build +node_modules/ +dist/ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..1a793f5 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "json.schemas": [ + { + "fileMatch": [ + "/manifest.json" + ], + "url": "http://json.schemastore.org/chrome-manifest" + } + ] +} \ No newline at end of file diff --git a/icons/icon.128.png b/icons/icon.128.png deleted file mode 100644 index 24a47d87edb34a7b871faf517e9cd7e7a1c4a754..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1754 zcmZ`)c{JPE7yl-RrKN-#T8-+0w!~6R8T%gfi?)=CSQ2a1XlxZNCGn$#P}Gc3`#wrJ z(k41Vp%Zn&Ae7Ofn3Kjs$>cm9GS<>4#`1m&u}v&`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*2rSlRM@+Dj#0_|byOZ!Ou@_^3yAq}?>zTHhf@gQ5f7 z+^uUUb$>!r^M`EwZn?+pKC)Fbh=Un*1`sZ22#Q}F#!9P=pi^c{fq+4e4k%B$;|F%b(SC|E zMRt9u>{PwBiIJlG{J8RjQjV@;@cISaB4$dqZX~H_V@BmilGi$>+mMfV#GfmHAVf2# zR&2z_(~McRT+7LBS}Y#dyZkA|V^YhFHw1evYLbX)^C@OVi!nqC#brP#qyaf!gYTnW eIPanMprB-l zYeY$Kep*R+Vo@qXd3m{BW?pu2a$-TMUVc&f>~}U&Kt=C8T^vI!de>e&sK??caO~rK zKZ}`*EjCJjWD|PisB*|N#+IF5;Yh2o(EA6+LN~lq@rV&CJYtc2?eD}c1 zhHpp9LNq_LyzDX)UOe?z*eQj>bt+qgtJJsHZV6JZd0{W`gtK{L#O}l?OPb@BUOo7N zx9qx+PxOCwwGA@q>=j20^Ior7Zqd0S^$EM~@f~%qE#qc~$Q^BcfAf63rrD90n3#SI ygV|ndiuWG24omvq_FGN%fRvn4*zCA}#`9f+tkb_0W*-20ox#)9&t;ucLK6U>w2^oK diff --git a/icons/icon.32.png b/icons/icon.32.png deleted file mode 100644 index f7d9c972f897e16bc3f78fce907cc47f8398b75d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 507 zcmVn@O1)HST+9V=ah(E_tJ1rD3odH49C}@@7 zM`J!LZtpUNyUXrfHihJYA;YlmyhCno6POT=3!DKB;0JgHPJubgS^#E&Tc8&bH^7V~ zZ9pZWfggvKv;lP?*avdz)2}@kXdMG>z=sgzRV^=SO--$%YEGPXI;6?F$cuR2KvC4* zVg``fk}@x8Y6DJ)e~!nNv;i(~AJO2B_}3|o_74tlG|-@m_c%tXof^`tXK*%=Hf#wc z9g$}Y%;kmCi9Dq-KttpQnnPsNS)V5jO(a#~w^}F4X$Hsw*D1`eRF70-@$UFXpsiur zR%gqjFpr}mOe;y73|m6$Oa@5G8c?IZ12tfET;_Xtx7*!2fQ4sZ4!=6UCK#S-dXkzfM xCn-BXH^jUPY}+>X*#ItqPZbxy`nb&h7r*Ge&IT-{m9GE*002ovPDHLkV1f*}&~X3& diff --git a/icons/icon.48.png b/icons/icon.48.png deleted file mode 100644 index 43f1e24f0261ff929f8a502a128fdf46c86a7b75..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 874 zcmV-w1C{)VP);^WoZ#OfON!LTZFp$~Z_j&J4X6McBLQ5@e ziE_XQFb`}1tH1;>0Aw2AW`JA3C!e|D`xpjJHo&dXU7!e5BHA=?)Pj2q_!7h21a3DN zJNIH71ltmjHQ??AzG<@W*an{?e&p5m!hrqCfV+w1bQ%$0bHHO@94IO0iogL4Zl_>d z_L)zBS;6l!n*>zQSD+(sJ})@BuED(_*yRJ~I|SdeQLt?>jt(jPcR(S~9~W#6#_*!J z0AqpQ1>mhNH!gv7rLRtpPQm7H3@`2)H9$2<9d1Yygy(4<*ae&dCJ9f43mV)@g59Lg z-0k~N?~#u-2@D91;@Uir(%`0nMML&Yn*=hzjDeFL19qPq%d07D#FdKPQy*@+b7J=u$o(9+<4GE6Y4!CK7JEUtIw~VSP3&%U=xGC-|XP4>cMjl9jxS5*o)2b=}=QCrjw z1O3YNV|dTORh58cy#3Z^4A%awP&eUG?rw%77lkNMwGv2Ltpp+@ZL?i$y_>Ff;32R^ zcoka1D}vUKht1Xw-~;uG)_Y)kLNUf_82!roG@%$Hbpo%F>LySEj=ON|>L%_NSfjvx zzl|#AQb3<0-%j*~+7bRq?Vdgb{8FxY?ZUCEe_*H5U#50*RtA38v9Xe?1imZ%9MBc$ zcj3MJ4C;p?-%iwryzUSCO{xpm5{WcI8RR!?QEiU@u%KPU`%GFd_;uiXLNV6W6<~$v z;8%dliAATWEZ%--2JdrG!T&vo@~ diff --git a/icons/icon.64.png b/icons/icon.64.png deleted file mode 100644 index 6c208bd39fec3abee950f9acc3f8ee796dce7b0b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 792 zcmV+z1LypSP)k8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H10;Ner zK~#90?VHPP(?Ar4KX`{05>|+&yaNy<+5l@7=I|2GdOdRW$n4+HDu_AXYf38Z z{_L$4F+sjemLEZ_dc&Ta7XT0$} z$W>egz7ucoKL}L$tzuXhi81(LfbnTD0A3Sr@ULjVl~=J%z9N4BPH;EilcLW(94~mj z>voB`&>q}RDurVkh)tS+*al*gCLp$f*rW-Fpt)W1v(~c-yr;VAJ0dTwJH>6xO5=?D zbXX_2PQ86WMng9|rs&-EQaF9V8H4-S?*zRrjK04GVx2H+44+Y7Rg)8DpMp5`#2M;A z^%S{1A$R7}pzlZEw?VG-W5_QTMkIVsfb_;jb(-vfko(P%mngV6VRjJQwL|XF@UOuT zG~&p6Ol