From 565470926faad60e6e70b3eaa1dcc646de6c408b Mon Sep 17 00:00:00 2001 From: jmfrancois Date: Thu, 12 Oct 2023 11:55:02 +0200 Subject: [PATCH] fix: build icons --- packages/icons/package.json | 1 + packages/icons/scripts/typescript.js | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/icons/package.json b/packages/icons/package.json index 83272a85bd6..277472dd3f4 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -54,6 +54,7 @@ "css-loader": "^4.3.0", "mini-css-extract-plugin": "^2.7.6", "mkdirp": "^1.0.4", + "prettier": "^3.0.3", "react": "^17.0.2", "react-use": "^17.4.0", "string-replace-loader": "^2.3.0", diff --git a/packages/icons/scripts/typescript.js b/packages/icons/scripts/typescript.js index 9d0a8ce3d38..d4c6911d5af 100644 --- a/packages/icons/scripts/typescript.js +++ b/packages/icons/scripts/typescript.js @@ -23,9 +23,8 @@ fs.readdirSync(iconSrcFolder) }); }); -fs.writeFileSync( - path.join(srcFolder, 'typeUtils.ts'), - prettier.format( +prettier + .format( ` export declare type IconName = ${icons} @@ -56,5 +55,7 @@ export declare type Icon = { }; `, { singleQuote: true, parser: 'typescript' }, - ), -); + ) + .then(data => { + fs.writeFileSync(path.join(srcFolder, 'typeUtils.ts'), data); + });