From 6fc1ba84f600f082d5ee2be8bdfcf49f84153455 Mon Sep 17 00:00:00 2001 From: Daniel Sil Date: Thu, 8 Aug 2024 13:17:51 +0200 Subject: [PATCH] chore: optimize email icons generator Sometimes we need to generate PNG from icons and add them to images.kiwi. The script to generate them was optimized and now generates the whole directory to be copied and pasted there. --- .../config/{generatePngIcons.mts => generateEmailIcons.mts} | 6 ++++++ packages/orbit-components/package.json | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) rename packages/orbit-components/config/{generatePngIcons.mts => generateEmailIcons.mts} (92%) diff --git a/packages/orbit-components/config/generatePngIcons.mts b/packages/orbit-components/config/generateEmailIcons.mts similarity index 92% rename from packages/orbit-components/config/generatePngIcons.mts rename to packages/orbit-components/config/generateEmailIcons.mts index 01696864f7..5ed08ee87e 100644 --- a/packages/orbit-components/config/generatePngIcons.mts +++ b/packages/orbit-components/config/generateEmailIcons.mts @@ -88,6 +88,12 @@ function generatePath(targetDir: string) { }); await Promise.all(promises); + + // Copy svg files to the destination + await fs.copyFile("./orbit-svgs.zip", `${DIR}/orbit-svgs.zip`); + + // Copy font files to the destination + await fs.copyFile("./orbit-icons-font.zip", `${DIR}/orbit-icons-font.zip`); } catch (error) { console.error(error); } diff --git a/packages/orbit-components/package.json b/packages/orbit-components/package.json index a535d99328..9a2e1aa36b 100644 --- a/packages/orbit-components/package.json +++ b/packages/orbit-components/package.json @@ -23,7 +23,9 @@ "fetch:icons": "node --loader ts-node/esm config/fetchIcons.mts", "check:icons": "node --loader ts-node/esm config/checkIconsCli.mts", "check:types": "tsc --p tsconfig.json", - "build:iconsPng": "node --loader ts-node/esm config/generatePngIcons.mts", + "build:icons": "node --loader ts-node/esm config/build/buildIcons.mts", + "build:iconsFont": "node --loader ts-node/esm config/createSVGFont.mts", + "build:emailIcons": "yarn build:icons && yarn build:iconsFont && node --loader ts-node/esm config/generateEmailIcons.mts", "build:storybook": "node --loader ts-node/esm config/build/buildIcons.mts && storybook build -c .storybook -o .out", "eslint:check": "eslint . --report-unused-disable-directives", "test-ct": "playwright test -c playwright-ct.config.ts",