From d99cc5a0158131dc6b290875bb6248bc8bb1b154 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Wed, 11 May 2022 10:26:43 -0400 Subject: [PATCH] Bundle tray icons in repo (#5362) --- .gitignore | 1 - Makefile | 8 ++------ build/generate-tray-icons.ts | 12 ++++++------ build/tray/trayIconDarkTemplate.png | Bin 0 -> 392 bytes build/tray/trayIconDarkTemplate@2x.png | Bin 0 -> 724 bytes build/tray/trayIconTemplate.png | Bin 0 -> 397 bytes build/tray/trayIconTemplate@2x.png | Bin 0 -> 717 bytes package.json | 2 +- 8 files changed, 9 insertions(+), 14 deletions(-) create mode 100644 build/tray/trayIconDarkTemplate.png create mode 100644 build/tray/trayIconDarkTemplate@2x.png create mode 100644 build/tray/trayIconTemplate.png create mode 100644 build/tray/trayIconTemplate@2x.png diff --git a/.gitignore b/.gitignore index 4c9c3c8165..d018f3b251 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ locales/**/**.js lens.log static/build static/types -build/tray/ binaries/client/ binaries/server/ src/extensions/*/*.js diff --git a/Makefile b/Makefile index 1199ee381d..6db96fbc2b 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ compile-dev: node_modules ci-validate-dev: binaries/client build-extensions compile-dev .PHONY: dev -dev: binaries/client build/tray/trayIconTemplate.png build-extensions +dev: binaries/client build-extensions rm -rf static/build/ yarn dev @@ -53,7 +53,7 @@ integration: build yarn integration .PHONY: build -build: node_modules binaries/client build/tray/trayIconTemplate.png +build: node_modules binaries/client yarn run npm:fix-build-version $(MAKE) build-extensions -B yarn run compile @@ -70,9 +70,6 @@ $(extension_node_modules): node_modules $(extension_dists): src/extensions/npm/extensions/dist $(extension_node_modules) cd $(@:/dist=) && ../../node_modules/.bin/npm run build -build/tray/trayIconTemplate.png: node_modules - yarn ts-node ./build/generate-tray-icons.ts - .PHONY: clean-old-extensions clean-old-extensions: find ./extensions -mindepth 1 -maxdepth 1 -type d '!' -exec test -e '{}/package.json' \; -exec rm -rf {} \; @@ -129,7 +126,6 @@ clean: clean-npm clean-extensions rm -rf binaries/client rm -rf dist rm -rf static/build - rm -rf build/tray rm -rf node_modules rm -rf site rm -rf docs/extensions/api diff --git a/build/generate-tray-icons.ts b/build/generate-tray-icons.ts index c09ab6320d..a7ab3bd48b 100644 --- a/build/generate-tray-icons.ts +++ b/build/generate-tray-icons.ts @@ -28,23 +28,23 @@ console.log("Generating tray icon pngs"); ensureDirSync(outputFolder); -Promise.allSettled([ - sharp(Buffer.from(darkTemplate)) +Promise.all([ + sharp(Buffer.from(lightTemplate)) .resize({ width: size, height: size }) .png() .toFile(path.join(outputFolder, "trayIconDarkTemplate.png")), - sharp(Buffer.from(darkTemplate)) + sharp(Buffer.from(lightTemplate)) .resize({ width: size*2, height: size*2 }) .png() .toFile(path.join(outputFolder, "trayIconDarkTemplate@2x.png")), - sharp(Buffer.from(lightTemplate)) + sharp(Buffer.from(darkTemplate)) .resize({ width: size, height: size }) .png() .toFile(path.join(outputFolder, "trayIconTemplate.png")), - sharp(Buffer.from(lightTemplate)) + sharp(Buffer.from(darkTemplate)) .resize({ width: size*2, height: size*2 }) .png() .toFile(path.join(outputFolder, "trayIconTemplate@2x.png")), ]) - .then(console.log) + .then((resolutions) => console.log(`Generated ${resolutions.length} images`)) .catch(console.error); diff --git a/build/tray/trayIconDarkTemplate.png b/build/tray/trayIconDarkTemplate.png new file mode 100644 index 0000000000000000000000000000000000000000..63f2eb18953367d8687dcef3a423acadc3af84a1 GIT binary patch literal 392 zcmV;30eAk1P)AzhWG*I&3>$yqT~{Az$i|DW#HHDePAw4o&qj`3h?5R-+^i1J}LUF9ADtf92>x< z3)}+Mh;f=HSAlOc4($E_JOUFy2e=K+4N%T(+8#$h9awRHI0@_rXF<-rq<}Us8w~j> zXrm=ZD{x!~1!jPcByLBJCEzeP|5H{w)|TuZ4LQp;kZ4dH8)OgY+L{Nh)oT7iyI@sX zVbk5U;&uCO`~E7xQ<8jV1bcP1HzU@?2&F|&qp2X;ioT+83emkZPD~Pvgd+h-NI5=@ mu|o=vgCuNH)|wkdD*OZ5PQbBv-z^jX00008; z93OyYwHY?+Z-BkE2Jga;BWlwQ{0Qt{1nRtjm+NmG@X!(b2~bj-sT|&fD+yo_=+*me zjs$incejH(5(~Zy_zAoK>UC{0$Kf@jkf->tFDrO`>cI8u`g-77z>&P`P0A_bhe)kwgw^#53V{B5OutY_?oc> zckrVtatJ&0et*QzwC7>mFx~UMk?qZ#1ct0}D{!KQ>zFhm^>N5J@6)x-+T23uvC%1r2(}B#;_^|b#E>3DYbVvNdssspawxXGKPt4H!A0p zS(m2P@K*u?pvM{f8L-MRhE1A*Wk%0KWrE5CFycsHrm z$vK8SmP2j_-Y8hmap+*lyKYy`QT{>k$_20|H75@1db56v#2|9)NfrYZ#<70=+^UXY zqmjUp^l@(sPYNa^Md!LcolMKpdS#54vOA<-RF&$uB=8$9u2*7XTH;p#0000Y<(@P1&z_n2f66wDS^U5f58)7lxUGTjFoN?&(cg)AwY?0?W1*I~ zh`GY6!gnfg3y*o(&GQAW(T@&J3x0wDIqiDoO-!Tx_CQ~-R`Br%{%jP84Se&_jtXt8 z%AaQ7xKQ9L?i+b45tzhA!Ru3QXImSM0yAGS}R#wc4uwVYkPsVuee! zbFBD#eg{TnQTbN`e3otesonieVjYwy9rO&EMqU{zAES*v@cpz4Z(zPLO>y; r3ivM>`;Nk&Sx7jf9BYng7ghKI;f#FQ*R~j600000NkvXXu0mjfDiN#W literal 0 HcmV?d00001 diff --git a/build/tray/trayIconTemplate@2x.png b/build/tray/trayIconTemplate@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..553a8ec373fdc3b82c797bf91c69a242ab811f06 GIT binary patch literal 717 zcmV;;0y6!HP)D;c6yXJM`EYPXnn;Z^o zmF#whY+sDL1NaHN0UEV;v%=u5AVXd{pKDhcd1Ef%PH2Ax@U6g*z4dCzbSK1%rEGJN z1Kl}6%kj40S@MR?>uf17k>G%>Q+e`vz(|4M6`eOJrNXbsiq54(@=QMq+$n4<5&Q+L z|0BZQV1J+X76E5~b9JocvN46;3U41PHRk}2fTt-r?Zv&wmF44ds#utZzy|o8z%AlA%>!Q>6;ZQJ{mH2SlVefOOFy_3r8%_r-JKjZX z4TTC16N1OOWK|Gapc-~Z>{#H>DzfhRBuLwV3I}>Zug%K)@x(Dm0c^ZcHLQZ{P*!2I7IeRrHm)}00000NkvXXu0mjfFXT%W literal 0 HcmV?d00001 diff --git a/package.json b/package.json index 783e58b23b..15c875dbb1 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "dist": "yarn run compile && electron-builder --publish onTag", "dist:dir": "yarn run dist --dir -c.compression=store -c.mac.identity=null", "download:binaries": "yarn run ts-node build/download_binaries.ts", - "build:tray-icons": "yarn run ts-node build/build_tray_icon.ts", + "build:tray-icons": "yarn run ts-node build/generate-tray-icons.ts", "build:theme-vars": "yarn run ts-node build/build_theme_vars.ts", "lint": "PROD=true yarn run eslint --ext js,ts,tsx --max-warnings=0 .", "lint:fix": "yarn run lint --fix",