1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Bundle tray icons in repo (#5362)

This commit is contained in:
Sebastian Malton 2022-05-11 10:26:43 -04:00 committed by GitHub
parent d2abd582bc
commit d99cc5a015
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 9 additions and 14 deletions

1
.gitignore vendored
View File

@ -8,7 +8,6 @@ locales/**/**.js
lens.log
static/build
static/types
build/tray/
binaries/client/
binaries/server/
src/extensions/*/*.js

View File

@ -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

View File

@ -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);

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

View File

@ -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",