()
| 194 | } |
| 195 | |
| 196 | async function optimizeAndMergeDotcomIcons() { |
| 197 | const sourceFolderPath = join(DOTCOM_FOLDER_PATH, 'client', 'assets', 'icons', 'icon') |
| 198 | const mergedIconName = '0_merged_tla.svg' |
| 199 | |
| 200 | // this is how `svgo` starts each one of our optimized icon SVGs. if they don't all start with this, |
| 201 | // we can't merge them as it means they're of different size and are using different fill rules. |
| 202 | const mergedIconHeader = |
| 203 | '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" fill="none">' |
| 204 | |
| 205 | // Get a list of all icons |
| 206 | const icons = readdirSync(sourceFolderPath).filter((icon) => /icon-.*\.svg$/.test(icon)) |
| 207 | |
| 208 | const optimizedSvgs = optimizeAndMergeSvgs( |
| 209 | icons, |
| 210 | sourceFolderPath, |
| 211 | mergedIconName, |
| 212 | mergedIconHeader |
| 213 | ) |
| 214 | |
| 215 | const mergedIconPath = join(DOTCOM_FOLDER_PATH, 'client', 'src', 'assets') |
| 216 | |
| 217 | for (const { fileName, data } of optimizedSvgs) { |
| 218 | if (fileName.includes(mergedIconName)) { |
| 219 | await writeStringFile(join(mergedIconPath, fileName), data) |
| 220 | } else { |
| 221 | await writeStringFile(join(sourceFolderPath, fileName), data) |
| 222 | } |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | // 2. EMBED-ICONS |
| 227 | async function copyEmbedIcons() { |
no test coverage detected
searching dependent graphs…