Skip to content

Commit

Permalink
feat: Created script to build android icons
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecoomber committed Oct 18, 2024
1 parent 6835652 commit 9c4d6bc
Show file tree
Hide file tree
Showing 9 changed files with 346 additions and 8 deletions.
218 changes: 212 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,8 @@
"bugs": {
"url": "https://github.com/zebratechnologies/zeta-icons/issues"
},
"homepage": "https://github.com/zebratechnologies/zeta-icons#readme"
}
"homepage": "https://github.com/zebratechnologies/zeta-icons#readme",
"dependencies": {
"cheerio": "^1.0.0"
}
}
6 changes: 6 additions & 0 deletions scripts/fetch-icons/fetchIcons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ import { clearDirectory } from "../utils/fileUtils.js";
import { generateHash } from "../utils/hash.js";
import { optimizeSVGs } from "../utils/optimizeSvgs.js";
import { saveSVGs } from "../utils/saveSvgs.js";
import { generateAndroidIcons } from "./generators/generateAndroidIcons.js";

export const iconsDir = "/icons";
export const tempDir = "/temp";
export const pngDir = "/png";
export const flutterDir = "/flutter";
export const webDir = "/web";
export const androidDir = "/android";

/**
* Main function to run icons action. For slightly more information, see {@link https://miro.com/app/board/uXjVKUMv1ME=/?share_link_id=952145602435 | Miro }
Expand All @@ -41,6 +43,7 @@ export default async function main(
const pngOutputDir = outputDir + pngDir;
const dartOutputDir = outputDir + flutterDir;
const tsOutputDir = outputDir + webDir;
const androidOutputDir = outputDir + androidDir;

const response = await getFigmaDocument(figmaFileId, figmaToken);
console.log("✅ - Fetched figma document");
Expand Down Expand Up @@ -83,6 +86,9 @@ export default async function main(
const generateFontResult = await generateFonts(tempOutputDir, "zeta-icons", dartOutputDir, tsOutputDir);
console.log("✅ - Generated fonts");

generateAndroidIcons(androidOutputDir, manifest);
console.log("✅ - Generated Android icons.");

generateDefinitionFiles(outputDir, generateFontResult, manifest);
console.log("✅ - Generated definition files.");

Expand Down
Loading

0 comments on commit 9c4d6bc

Please sign in to comment.