diff --git a/.github/workflows/auto-update-icons.yml b/.github/workflows/auto-update-icons.yml index edd1183c86ac6..0ea684b6ea313 100644 --- a/.github/workflows/auto-update-icons.yml +++ b/.github/workflows/auto-update-icons.yml @@ -16,7 +16,9 @@ jobs: npx nx build icons npx ts-node ./scripts/generate-used-icons.ts npx eslint ./projects/cdk/constants/used-icons.ts --fix + npx eslint ./projects/demo/used-icons.ts --fix npx prettier ./projects/cdk/constants/used-icons.ts --write + npx prettier ./projects/demo/used-icons.ts --write - uses: taiga-family/ci/actions/auto/push@v1.33.3 with: message: icons have changed diff --git a/projects/demo/used-icons.ts b/projects/demo/used-icons.ts new file mode 100644 index 0000000000000..d072418929ff0 --- /dev/null +++ b/projects/demo/used-icons.ts @@ -0,0 +1,141 @@ +/** + * @description: + * AUTOGENERATED + * + * Array of icons used in taiga-ui components + */ +export const TUI_USED_ICONS = [ + `tuiIconCheck`, + `tuiIconAlertCircleLarge`, + `tuiIconButton`, + `tuiIconVolumeXLarge`, + `tuiIconMicOffLarge`, + `tuiIconPhoneForwardedLarge`, + `tuiIconClose`, + `tuiIconSearchLarge`, + `tuiIconCalendarLarge`, + `tuiIconVisaMono`, + `tuiIconMastercardMono`, + `tuiIconMailLarge`, + `tuiIconPieChartLarge`, + `tuiIconPrinterLarge`, + `tuiIconLoginLarge`, + `tuiIconStarLarge`, + `tuiIconBellLarge`, + `tuiIconFlagLarge`, + `tuiIconImageLarge`, + `tuiIconThumbsUpLarge`, + `tuiIconThumbsDownLarge`, + `tuiIconAlignJustifyLarge`, + `tuiIconUserLarge`, + `tuiIconSettingsLarge`, + `tuiIconMenuLarge`, + `tuiIconUser`, + `tuiIconHelpCircle`, + `tuiIconCheckCircleLarge`, + `tuiIconSettings`, + `tuiIconMoreHorizontal`, + `tuiIconArrowRight`, + `tuiIconEyeOff`, + `tuiIconHeartLarge`, + `tuiIconSearch`, + `tuiIconChevronLeftLarge`, + `tuiIconChevronRightLarge`, + `tuiIconCreditCardLarge`, + `tuiIconMoreVertical`, + `tuiIconChevronDownLarge`, + `tuiIconVisa`, + `tuiIconMaestro`, + `tuiIconMir`, + `tuiIconPlus`, + `tuiIconChevronDown`, + `tuiIconTrash`, + `tuiIconMessageSquareLarge`, + `tuiIconHelpCircleLarge`, + `tuiIconChevronRight`, + `tuiIconSortDown`, + `tuiIconArrowUpRightLarge`, + `tuiIconChevronUp`, + `tuiIconFileLarge`, + `tuiIconDropletLarge`, + `tuiIconUploadCloudLarge`, + `tuiIconClockLarge`, + `tuiIconEdit2Large`, + `tuiIconLockLarge`, + `tuiIconUnlockLarge`, + `tuiIconEye`, + `tuiIconVolumeX`, + `tuiIconVolume`, + `tuiIconCheckCircle`, + `tuiIconXCircle`, + `tuiIconMapPinLarge`, + `tuiIconMapPin`, + `tuiIconDownload`, + `tuiIconEyeOffLarge`, + `tuiIconEyeLarge`, + `tuiIconEdit2`, + `tuiIconVideoLarge`, + `tuiIconArrowUp`, + `tuiIconHeart`, + `tuiIconStar`, + `tuiIconPlusCircleLarge`, + `tuiIconMastercard`, + `tuiIconMusicLarge`, + `tuiIconMinus`, + `tuiIconPhoneLarge`, + `tuiIconMoreHorizontalLarge`, + `tuiIconCodeLarge`, + `tuiIconTerminalLarge`, + `tuiIconHrLarge`, + `tuiIconHomeLarge`, + `tuiIconCreditCard`, + `tuiIconPhone`, + `tuiIconAlertCircle`, + `tuiIconDragLarge`, + `tuiIconChevronLeft`, + `tuiIconCameraLarge`, + `tuiIconFolderLarge`, + `tuiIconCopy`, + `tuiIconFolder`, + `tuiIconPlayLarge`, + `tuiIconPauseLarge`, + `tuiIconBox`, + `tuiIconLock`, + `tuiIconUsers`, + `tuiIconCloseLarge`, + `tuiIconFrownLarge`, + `tuiIconMehLarge`, + `tuiIconSmileLarge`, + `tuiIconThumbsUp`, + `tuiIconThumbsDown`, + `tuiIconDeleteLarge`, + `tuiIconElectron`, + `tuiIconElectronMono`, + `tuiIconCirrus`, + `tuiIconMaestroMono`, + `tuiIconMirMono`, + `tuiIconUnionPay`, + `tuiIconJCB`, + `tuiIconPayPal`, + `tuiIconAmex`, + `tuiIconDinersClub`, + `tuiIconDiscover`, + `tuiIconHumo`, + `tuiIconRuPay`, + `tuiIconUzcard`, + `tuiIconVerve`, + `tuiIconApplePay`, + `tuiIconGooglePay`, + `tuiIconSamsungPay`, + `tuiIconWorldPay`, + `tuiIconAliPay`, + `tuiIconAmazonPay`, + `tuiIconAndroidPay`, + `tuiIconRedo`, + `tuiIconRefresh`, + `tuiIconRefreshLarge`, + `tuiIconSortUp`, + `tuiIconUndo`, + `tuiIconPaperclipLarge`, + `tuiIconTrashLarge`, +]; diff --git a/scripts/generate-used-icons.ts b/scripts/generate-used-icons.ts index 628c33bd7b703..9415ac2c1e98e 100644 --- a/scripts/generate-used-icons.ts +++ b/scripts/generate-used-icons.ts @@ -2,6 +2,11 @@ import {readdirSync, readFileSync, statSync, writeFileSync} from 'fs'; import {basename, join} from 'path'; (function main(): void { + generateProjectsUsedIcons(); + generateDemoUsedIcons(); +})(); + +function generateProjectsUsedIcons(): void { const rootDirectory = process.env.ROOT_FOLDER || `./projects`; const excludedFolders = [ `demo`, @@ -18,15 +23,31 @@ import {basename, join} from 'path'; const excludedNames = [`tuiIconButton`]; generateUsedIcons(rootDirectory, {excludedFolders, excludedNames, excludedFiles}); -})(); +} + +function generateDemoUsedIcons(): void { + const rootDirectory = process.env.ROOT_DEMO_FOLDER || `./projects/demo`; + const excludedFiles = [`used-icons.ts`]; + + generateUsedIcons(rootDirectory, { + excludedFiles, + writeTo: `./projects/demo/used-icons.ts`, + }); +} function generateUsedIcons( rootDirectory: string, { - excludedFolders, - excludedNames, - excludedFiles, - }: {excludedFiles: string[]; excludedFolders: string[]; excludedNames: string[]}, + excludedFolders = [], + excludedNames = [], + excludedFiles = [], + writeTo = `./projects/cdk/constants/used-icons.ts`, + }: { + excludedFiles?: string[]; + excludedFolders?: string[]; + excludedNames?: string[]; + writeTo?: string; + }, ): void { const tuiIconNames = findTuiIconNames(rootDirectory, { excludedFolders, @@ -35,7 +56,7 @@ function generateUsedIcons( }); writeFileSync( - `./projects/cdk/constants/used-icons.ts`, + writeTo, `/** * @description: * AUTOGENERATED