From deee9347994ce6d0da2b7bd97e979160bf24abf4 Mon Sep 17 00:00:00 2001 From: Jonathan Cammisuli Date: Fri, 28 Apr 2023 11:05:04 -0400 Subject: [PATCH] fix(core): include more binary extensions (#16639) --- .../devkit/src/utils/binary-extensions.ts | 290 +++++++++++++++--- 1 file changed, 254 insertions(+), 36 deletions(-) diff --git a/packages/devkit/src/utils/binary-extensions.ts b/packages/devkit/src/utils/binary-extensions.ts index 54a6c2247da78..03b3267d7e6fa 100644 --- a/packages/devkit/src/utils/binary-extensions.ts +++ b/packages/devkit/src/utils/binary-extensions.ts @@ -1,50 +1,268 @@ import { extname } from 'path'; const binaryExtensions = new Set([ - // // Image types originally from https://github.com/sindresorhus/image-type/blob/5541b6a/index.js - '.jpg', - '.jpeg', - '.png', - '.gif', - '.webp', - '.flif', - '.cr2', - '.tif', + // types originally from https://github.com/sindresorhus/binary-extensions/blob/40e44b510d87a63dcf42300bc8fbcb105f45a61c/binary-extensions.json + '.3dm', + '.3ds', + '.3g2', + '.3gp', + '.7z', + '.a', + '.aac', + '.adp', + '.ai', + '.aif', + '.aiff', + '.alz', + '.ape', + '.apk', + '.appimage', + '.ar', + '.arj', + '.asf', + '.au', + '.avi', + '.bak', + '.baml', + '.bh', + '.bin', + '.bk', '.bmp', - '.jxr', - '.psd', - '.ico', - '.bpg', - '.jp2', - '.jpm', - '.jpx', - '.heic', + '.btif', + '.bz2', + '.bzip2', + '.cab', + '.caf', + '.cgm', + '.class', + '.cmx', + '.cpio', + '.cr2', '.cur', - '.avif', + '.dat', '.dcm', - - // Compressed files - '.tgz', + '.deb', + '.dex', + '.djvu', + '.dll', + '.dmg', + '.dng', + '.doc', + '.docm', + '.docx', + '.dot', + '.dotm', + '.dra', + '.DS_Store', + '.dsk', + '.dts', + '.dtshd', + '.dvb', + '.dwg', + '.dxf', + '.ecelp4800', + '.ecelp7470', + '.ecelp9600', + '.egg', + '.eol', + '.eot', + '.epub', + '.exe', + '.f4v', + '.fbs', + '.fh', + '.fla', + '.flac', + '.flatpak', + '.fli', + '.flv', + '.fpx', + '.fst', + '.fvt', + '.g3', + '.gh', + '.gif', + '.graffle', '.gz', - '.zip', - - // Documents - '.pdf', - - // Java files + '.gzip', + '.h261', + '.h263', + '.h264', + '.icns', + '.ico', + '.ief', + '.img', + '.ipa', + '.iso', '.jar', - '.keystore', - - // Font files - '.ttf', + '.jpeg', + '.jpg', + '.jpgv', + '.jpm', + '.jxr', + '.key', + '.ktx', + '.lha', + '.lib', + '.lvp', + '.lz', + '.lzh', + '.lzma', + '.lzo', + '.m3u', + '.m4a', + '.m4v', + '.mar', + '.mdi', + '.mht', + '.mid', + '.midi', + '.mj2', + '.mka', + '.mkv', + '.mmr', + '.mng', + '.mobi', + '.mov', + '.movie', + '.mp3', + '.mp4', + '.mp4a', + '.mpeg', + '.mpg', + '.mpga', + '.msi', + '.mxu', + '.nef', + '.npx', + '.numbers', + '.nupkg', + '.o', + '.odp', + '.ods', + '.odt', + '.oga', + '.ogg', + '.ogv', '.otf', - '.woff', - '.woff2', - '.eot', - - // Misc files + '.ott', + '.pages', + '.pbm', + '.pcx', + '.pdb', + '.pdf', + '.pea', + '.pgm', + '.pic', + '.png', + '.pnm', + '.pot', + '.potm', + '.potx', + '.ppa', + '.ppam', + '.ppm', + '.pps', + '.ppsm', + '.ppsx', + '.ppt', + '.pptm', + '.pptx', + '.psd', '.pxd', '.pxz', + '.pya', + '.pyc', + '.pyo', + '.pyv', + '.qt', + '.rar', + '.ras', + '.raw', + '.resources', + '.rgb', + '.rip', + '.rlc', + '.rmf', + '.rmvb', + '.rpm', + '.rtf', + '.rz', + '.s3m', + '.s7z', + '.scpt', + '.sgi', + '.shar', + '.snap', + '.sil', + '.sketch', + '.slk', + '.smv', + '.snk', + '.so', + '.stl', + '.suo', + '.sub', + '.swf', + '.tar', + '.tbz', + '.tbz2', + '.tga', + '.tgz', + '.thmx', + '.tif', + '.tiff', + '.tlz', + '.ttc', + '.ttf', + '.txz', + '.udf', + '.uvh', + '.uvi', + '.uvm', + '.uvp', + '.uvs', + '.uvu', + '.viv', + '.vob', + '.war', + '.wav', + '.wax', + '.wbmp', + '.wdp', + '.weba', + '.webm', + '.webp', + '.whl', + '.wim', + '.wm', + '.wma', + '.wmv', + '.wmx', + '.woff', + '.woff2', + '.wrm', + '.wvx', + '.xbm', + '.xif', + '.xla', + '.xlam', + '.xls', + '.xlsb', + '.xlsm', + '.xlsx', + '.xlt', + '.xltm', + '.xltx', + '.xm', + '.xmind', + '.xpi', + '.xpm', + '.xwd', + '.xz', + '.z', + '.zip', + '.zipx', ]); export function isBinaryPath(path: string): boolean {