Skip to content

Instantly share code, notes, and snippets.

@endlessdev
Forked from christiangenco/migrateHeroicons.js
Created February 7, 2024 07:06
Show Gist options
  • Save endlessdev/78cb516299a476e58eaa8223c52e29a6 to your computer and use it in GitHub Desktop.
Save endlessdev/78cb516299a476e58eaa8223c52e29a6 to your computer and use it in GitHub Desktop.

Revisions

  1. @christiangenco christiangenco revised this gist Jan 24, 2023. 1 changed file with 3 additions and 4 deletions.
    7 changes: 3 additions & 4 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -16,9 +16,8 @@ Thanks to [@steveoh](https://github.com/steveoh) & [@ryanburns23](https://github
    curl https://gist.github.com/christiangenco/470a99f4823ee81f2b22bad83119f599/raw/migrateHeroicons.js | node | bash
    ```

    If you're running it on Linux you might have to replace `sed -i '' -e` by `sed -i` in the `gsub` function.
    It definitely works on macOS and *should* work on linux too. If not you might have to play with the syntax of `sed` (maybe by replacing `sed -i '' -e` with `sed -i` in the `gsub` function?).

    The script will avoid replacing strings in hidden folders (such as .git) but also `node_modules/` and the `migrateHeroicons.js` file if you download it.
    The script will avoid replacing strings in hidden folders and the `node_modules` folder.


    Happy with the script? Come say hi on Twitter [@KevinPicchi](https://twitter.com/KevinPicchi) / [@cgenco](https://twitter.com/cgenco)
    Happy with this script? Come say hi on Twitter [@KevinPicchi](https://twitter.com/KevinPicchi) / [@cgenco](https://twitter.com/cgenco)
  2. @christiangenco christiangenco revised this gist Jan 24, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions migrateHeroicons.js
    Original file line number Diff line number Diff line change
    @@ -40,7 +40,7 @@ if (fs.existsSync("yarn.lock")) {
    function gsub(from, to) {
    console.log(`echo "${from} => ${to}"`);
    console.log(
    `find . -type f -not -path '*/\.*' -path '*.${framework === "vue" ? "vue" : "js"}' -not -path './node_modules*' -not -path 'migrateHeroicons.js' -exec sed -i '' -e 's|${from}|${to}|g' {} +`
    `find -E . -type f -regex '.*\.(js|jsx|ts|tsx|vue)' -not -path '*/\.*' -not -path '*/node_modules/*' -not -path 'migrateHeroicons.js' -exec sed -i '' -e 's|${from}|${to}|g' {} +`
    );
    }

    @@ -162,7 +162,7 @@ const heroiconsV1toV2 = {
    UserRemoveIcon: "UserMinusIcon",
    ViewBoardsIcon: "ViewColumnsIcon",
    ViewGridAddIcon: "SquaresPlusIcon",
    ViewGridIcon: "Squares2x2Icon",
    ViewGridIcon: "Squares2X2Icon",
    ViewListIcon: "Bars4Icon",
    VolumeOffIcon: "SpeakerXMarkIcon",
    VolumeUpIcon: "SpeakerWaveIcon",
  3. @christiangenco christiangenco revised this gist Nov 22, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ Thanks to [@steveoh](https://github.com/steveoh) & [@ryanburns23](https://github
    # Run

    ```bash
    curl https://gist.github.com/christiangenco/470a99f4823ee81f2b22bad83119f599/raw/migrateHeroicons.js | bash
    curl https://gist.github.com/christiangenco/470a99f4823ee81f2b22bad83119f599/raw/migrateHeroicons.js | node | bash
    ```

    If you're running it on Linux you might have to replace `sed -i '' -e` by `sed -i` in the `gsub` function.
  4. @christiangenco christiangenco revised this gist Nov 18, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions migrateHeroicons.js
    Original file line number Diff line number Diff line change
    @@ -40,13 +40,13 @@ if (fs.existsSync("yarn.lock")) {
    function gsub(from, to) {
    console.log(`echo "${from} => ${to}"`);
    console.log(
    `find . -type f -not -path '*/\.*' -path '*.js' -not -path './node_modules*' -not -path 'migrateHeroicons.js' -exec sed -i '' -e 's|${from}|${to}|g' {} +`
    `find . -type f -not -path '*/\.*' -path '*.${framework === "vue" ? "vue" : "js"}' -not -path './node_modules*' -not -path 'migrateHeroicons.js' -exec sed -i '' -e 's|${from}|${to}|g' {} +`
    );
    }

    console.log(`echo "Upgrading import statements..."`);
    gsub(`@heroicons/${framework}/solid`, `@heroicons/${framework}/20/solid`);
    gsub(`@heroicons/${framework}/outline`, `@heroicons/${framework}/20/outline`);
    gsub(`@heroicons/${framework}/outline`, `@heroicons/${framework}/24/outline`);

    const heroiconsV1toV2 = {
    AdjustmentsIcon: "AdjustmentsVerticalIcon",
  5. @christiangenco christiangenco revised this gist Oct 28, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ Thanks to [@steveoh](https://github.com/steveoh) & [@ryanburns23](https://github
    # Run

    ```bash
    curl | bash
    curl https://gist.github.com/christiangenco/470a99f4823ee81f2b22bad83119f599/raw/migrateHeroicons.js | bash
    ```

    If you're running it on Linux you might have to replace `sed -i '' -e` by `sed -i` in the `gsub` function.
  6. @christiangenco christiangenco revised this gist Oct 28, 2022. 3 changed files with 195 additions and 252 deletions.
    117 changes: 0 additions & 117 deletions migrate.sh
    Original file line number Diff line number Diff line change
    @@ -1,117 +0,0 @@
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/AdjustmentsVerticalIcon/AdjustmentsVerticalIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ChatBubbleBottomCenterTextIcon/ChatBubbleBottomCenterTextIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArchiveBoxIcon/ArchiveBoxIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowDownCircleIcon/ArrowDownCircleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowLeftCircleIcon/ArrowLeftCircleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowRightCircleIcon/ArrowRightCircleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowUpCircleIcon/ArrowUpCircleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowLongDownIcon/ArrowLongDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowLongLeftIcon/ArrowLongLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowLongRightIcon/ArrowLongRightIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowLongUpIcon/ArrowLongUpIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowsPointingOutIcon/ArrowsPointingOutIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CheckBadgeIcon/CheckBadgeIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/NoSymbolIcon/NoSymbolIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/BookmarkSquareIcon/BookmarkSquareIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/BanknotesIcon/BanknotesIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ChartBarSquareIcon/ChartBarSquareIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ChatBubbleLeftRightIcon/ChatBubbleLeftRightIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ChatBubbleLeftEllipsisIcon/ChatBubbleLeftEllipsisIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ChatBubbleOvalLeftEllipsisIcon/ChatBubbleOvalLeftEllipsisIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CpuChipIcon/CpuCpuChipIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ClipboardDocumentCheckIcon/ClipboardDocumentCheckIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ClipboardDocumentIcon/ClipboardDocumentIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ClipboardDocumentListIcon/ClipboardDocumentListIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CloudArrowDownIcon/CloudArrowDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CloudArrowUpIcon/CloudArrowUpIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CodeBracketIcon/CodeBracketIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/RectangleStackIcon/RectangleStackIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SwatchIcon/SwatchIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CursorArrowRaysIcon/CursorArrowRaysIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CircleStackIcon/CircleStackIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ComputerDesktopIcon/ComputerDesktopIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DevicePhoneMobileIcon/DevicePhoneMobileIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentPlusIcon/DocumentPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentArrowDownIcon/DocumentArrowDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentMinusIcon/DocumentMinusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentChartBarIcon/DocumentChartBarIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentMagnifyingGlassIcon/DocumentMagnifyingGlassIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EllipsisHorizontalCircleIcon/EllipsisHorizontalCircleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EllipsisHorizontalIcon/EllipsisHorizontalIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EllipsisVerticalIcon/EllipsisVerticalIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowDownTrayIcon/ArrowDownTrayIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/Square2StackIcon/Square2StackIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FaceSmileIcon/FaceSmileIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FaceFrownIcon/FaceFrownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ExclamationIcon/ExclamationTriangleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowTopRightOnSquareIcon/ArrowTopRightOnSquareIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EyeSlashIcon/EyeSlashIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ForwardIcon/ForwardIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FunnelIcon/FunnelIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FolderPlusIcon/FolderPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FolderArrowDownTrayIcon/FolderArrowDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FolderMinusIcon/FolderMinusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/GlobeEuropeAfricaIcon/GlobeEuropeAfricaIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/HandRaisedIcon/HandRaisedIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/InboxArrowDownIcon/InboxArrowDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/BuildingLibraryIcon/BuildingBuildingLibraryIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/BoltIcon/BoltIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MapPinIcon/MapPinIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowLeftOnRectangleIcon/ArrowLeftOnRectangleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowRightOnRectangleIcon/ArrowRightOnRectangleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EnvelopeOpenIcon/EnvelopeOpenIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EnvelopeIcon/EnvelopeIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/Bars3CenterLeftIcon/Bars3CenterLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/Bars3BottomLeftIcon/Bars3BottomLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/Bars3BottomRightIcon/Bars3BottomRightIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/Bars2Icon/Bars2Icon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/Bars3Icon/Bars3Icon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MusicalNoteIcon/MusicalNoteIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/BuildingOfficeIcon/BuildingOfficeIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PencilSquareIcon/PencilSquareIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PhoneArrowDownLeftIcon/PhoneArrowDownLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PhoneXMarkIcon/PhoneXMarkIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PhoneArrowUpRightIcon/PhoneArrowUpRightIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PhotoIcon/PhotoIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PuzzlePieceIcon/PuzzlePieceIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/QrCodeIcon/QrCodeBracketIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ReceiptPercentIcon/ReceiptPercentIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowPathIcon/ArrowPathIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowUturnLeftIcon/ArrowUturnLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/BackwardIcon/BackwardIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowDownOnSquareStackIcon/ArrowDownOnSquareStackIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowDownOnSquareIcon/ArrowDownOnSquareIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MagnifyingGlassCircleIcon/MagnifyingGlassCircleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MagnifyingGlassIcon/MagnifyingGlassIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MegaphoneIcon/MegaphoneIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SignalSlashIcon/SignalSlashIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SignalIcon/SignalIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/LifebuoyIcon/LifebuoyIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowRightLeftIcon/ArrowRightLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowUpDownIcon/ArrowUpDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/TableCellsIcon/TableCellsIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/RectangleGroupIcon/RectangleGroupIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CommandLineIcon/CommandLineIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/HandThumbDownIcon/HandHandThumbDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/HandThumbUpIcon/HandHandThumbUpIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/LanguageIcon/LanguageIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowTrendingDownIcon/ArrowArrowTrendingDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowTrendingUpIcon/ArrowArrowTrendingUpIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowUpTrayIcon/ArrowUpTrayIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/UserPlusIcon/UserPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ViewColumnsIcon/ViewColumnsIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SquaresPlusIcon/SquaresPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/Squares2x2Icon/Squares2x2Icon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/Bars4Icon/Bars4Icon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SpeakerXMarkIcon/SpeakerXMarkIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SpeakerWaveIcon/SpeakerWaveIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/XMarkIcon/XMarkIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MagnifyingGlassPlusIcon/MagnifyingGlassPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MagnifyingGlassMinusIcon/MagnifyingGlassMinusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/BanIcon/NoSymbolIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CloudArrowDownTrayIcon/CloudArrowDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowsExpandIcon/ArrowsPointingOutIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArchiveIcon/ArchiveBoxIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SelectorIcon/ChevronUpDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ChatIcon/ChatBubbleOvalLeftEllipsisIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/AdjustmentsIcon/AdjustmentsVerticalIcon/g' {} +
    181 changes: 181 additions & 0 deletions migrateHeroicons.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,181 @@
    const fs = require("fs");

    if (!fs.existsSync("package.json")) {
    console.error(
    "Cannot find package.json. Please run this script in your project directory."
    );
    process.exit(1);
    }

    const package = fs.readFileSync("package.json", "utf8");

    let framework = null;

    if (package.includes("heroicons/react")) {
    console.error("Detected heroicons/react...");
    framework = "react";
    } else if (package.includes("heroicons/vue")) {
    console.error("Detected heroicons/vue...");
    framework = "vue";
    } else {
    console.error(
    "It doesn't look like you have either the heroicons/react or heroicons/vue libraries installed in this project."
    );
    process.exit(1);
    }

    if (fs.existsSync("yarn.lock")) {
    console.error("Detected yarn. Updating heroicons package to latest...");
    console.log(`yarn add @heroicons/${framework}@latest`);
    } else if (fs.existsSync("package-lock.json")) {
    console.error("Detected npm. Updating heroicons package to latest...");
    console.log(`npm install @heroicons/${framework}@latest`);
    } else {
    console.error(
    "Error: cannot find evidence of yarn or npm. Please run either 'npm install' or 'yarn install' before using this script."
    );
    process.exit(1);
    }

    function gsub(from, to) {
    console.log(`echo "${from} => ${to}"`);
    console.log(
    `find . -type f -not -path '*/\.*' -path '*.js' -not -path './node_modules*' -not -path 'migrateHeroicons.js' -exec sed -i '' -e 's|${from}|${to}|g' {} +`
    );
    }

    console.log(`echo "Upgrading import statements..."`);
    gsub(`@heroicons/${framework}/solid`, `@heroicons/${framework}/20/solid`);
    gsub(`@heroicons/${framework}/outline`, `@heroicons/${framework}/20/outline`);

    const heroiconsV1toV2 = {
    AdjustmentsIcon: "AdjustmentsVerticalIcon",
    AnnotationIcon: "ChatBubbleBottomCenterTextIcon",
    ArchiveIcon: "ArchiveBoxIcon",
    ArrowCircleDownIcon: "ArrowDownCircleIcon",
    ArrowCircleLeftIcon: "ArrowLeftCircleIcon",
    ArrowCircleRightIcon: "ArrowRightCircleIcon",
    ArrowCircleUpIcon: "ArrowUpCircleIcon",
    ArrowNarrowDownIcon: "ArrowLongDownIcon",
    ArrowNarrowLeftIcon: "ArrowLongLeftIcon",
    ArrowNarrowRightIcon: "ArrowLongRightIcon",
    ArrowNarrowUpIcon: "ArrowLongUpIcon",
    ArrowsExpandIcon: "ArrowsPointingOutIcon",
    ArrowSmDownIcon: "ArrowSmallDownIcon",
    ArrowSmLeftIcon: "ArrowSmallLeftIcon",
    ArrowSmRightIcon: "ArrowSmallRightIcon",
    ArrowSmUpIcon: "ArrowSmallUpIcon",
    BadgeCheckIcon: "CheckBadgeIcon",
    BanIcon: "NoSymbolIcon",
    BookmarkAltIcon: "BookmarkSquareIcon",
    CashIcon: "BanknotesIcon",
    ChartSquareBarIcon: "ChartBarSquareIcon",
    ChatAlt2Icon: "ChatBubbleLeftRightIcon",
    ChatAltIcon: "ChatBubbleLeftEllipsisIcon",
    ChatIcon: "ChatBubbleOvalLeftEllipsisIcon",
    ChipIcon: "CpuChipIcon",
    ClipboardCheckIcon: "ClipboardDocumentCheckIcon",
    ClipboardCopyIcon: "ClipboardDocumentIcon",
    ClipboardListIcon: "ClipboardDocumentListIcon",
    CloudDownloadIcon: "CloudArrowDownIcon",
    CloudUploadIcon: "CloudArrowUpIcon",
    CodeIcon: "CodeBracketIcon",
    CollectionIcon: "RectangleStackIcon",
    ColorSwatchIcon: "SwatchIcon",
    CursorClickIcon: "CursorArrowRaysIcon",
    DatabaseIcon: "CircleStackIcon",
    DesktopComputerIcon: "ComputerDesktopIcon",
    DeviceMobileIcon: "DevicePhoneMobileIcon",
    DocumentAddIcon: "DocumentPlusIcon",
    DocumentDownloadIcon: "DocumentArrowDownIcon",
    DocumentRemoveIcon: "DocumentMinusIcon",
    DocumentReportIcon: "DocumentChartBarIcon",
    DocumentSearchIcon: "DocumentMagnifyingGlassIcon",
    DotsCircleHorizontalIcon: "EllipsisHorizontalCircleIcon",
    DotsHorizontalIcon: "EllipsisHorizontalIcon",
    DotsVerticalIcon: "EllipsisVerticalIcon",
    DownloadIcon: "ArrowDownTrayIcon",
    DuplicateIcon: "Square2StackIcon",
    EmojiHappyIcon: "FaceSmileIcon",
    EmojiSadIcon: "FaceFrownIcon",
    ExclamationIcon: "ExclamationTriangleIcon",
    ExternalLinkIcon: "ArrowTopRightOnSquareIcon",
    EyeOffIcon: "EyeSlashIcon",
    FastForwardIcon: "ForwardIcon",
    FilterIcon: "FunnelIcon",
    FolderAddIcon: "FolderPlusIcon",
    FolderDownloadIcon: "FolderArrowDownIcon",
    FolderRemoveIcon: "FolderMinusIcon",
    GlobeIcon: "GlobeAmericasIcon",
    HandIcon: "HandRaisedIcon",
    InboxInIcon: "InboxArrowDownIcon",
    LibraryIcon: "BuildingLibraryIcon",
    LightningBoltIcon: "BoltIcon",
    LocationMarkerIcon: "MapPinIcon",
    LoginIcon: "ArrowLeftOnRectangleIcon",
    LogoutIcon: "ArrowRightOnRectangleIcon",
    MailIcon: "EnvelopeIcon",
    MailOpenIcon: "EnvelopeOpenIcon",
    MenuAlt1Icon: "Bars3CenterLeftIcon",
    MenuAlt2Icon: "Bars3BottomLeftIcon",
    MenuAlt3Icon: "Bars3BottomRightIcon",
    MenuAlt4Icon: "Bars2Icon",
    MenuIcon: "Bars3Icon",
    MinusSmIcon: "MinusSmallIcon",
    MusicNoteIcon: "MusicalNoteIcon",
    OfficeBuildingIcon: "BuildingOfficeIcon",
    PencilAltIcon: "PencilSquareIcon",
    PhoneIncomingIcon: "PhoneArrowDownLeftIcon",
    PhoneMissedCallIcon: "PhoneXMarkIcon",
    PhoneOutgoingIcon: "PhoneArrowUpRightIcon",
    PhotographIcon: "PhotoIcon",
    PlusSmIcon: "PlusSmallIcon",
    PuzzleIcon: "PuzzlePieceIcon",
    QrcodeIcon: "QrCodeIcon",
    ReceiptTaxIcon: "ReceiptPercentIcon",
    RefreshIcon: "ArrowPathIcon",
    ReplyIcon: "ArrowUturnLeftIcon",
    RewindIcon: "BackwardIcon",
    SaveAsIcon: "ArrowDownOnSquareStackIcon",
    SaveIcon: "ArrowDownOnSquareIcon",
    SearchCircleIcon: "MagnifyingGlassCircleIcon",
    SearchIcon: "MagnifyingGlassIcon",
    SelectorIcon: "ChevronUpDownIcon",
    SortAscendingIcon: "BarsArrowUpIcon",
    SortDescendingIcon: "BarsArrowDownIcon",
    SpeakerphoneIcon: "MegaphoneIcon",
    StatusOfflineIcon: "SignalSlashIcon",
    StatusOnlineIcon: "SignalIcon",
    SupportIcon: "LifebuoyIcon",
    SwitchHorizontalIcon: "ArrowsRightLeftIcon",
    SwitchVerticalIcon: "ArrowsUpDownIcon",
    TableIcon: "TableCellsIcon",
    TemplateIcon: "RectangleGroupIcon",
    TerminalIcon: "CommandLineIcon",
    ThumbDownIcon: "HandThumbDownIcon",
    ThumbUpIcon: "HandThumbUpIcon",
    TranslateIcon: "LanguageIcon",
    TrendingDownIcon: "ArrowTrendingDownIcon",
    TrendingUpIcon: "ArrowTrendingUpIcon",
    UploadIcon: "ArrowUpTrayIcon",
    UserAddIcon: "UserPlusIcon",
    UserRemoveIcon: "UserMinusIcon",
    ViewBoardsIcon: "ViewColumnsIcon",
    ViewGridAddIcon: "SquaresPlusIcon",
    ViewGridIcon: "Squares2x2Icon",
    ViewListIcon: "Bars4Icon",
    VolumeOffIcon: "SpeakerXMarkIcon",
    VolumeUpIcon: "SpeakerWaveIcon",
    XIcon: "XMarkIcon",
    ZoomInIcon: "MagnifyingGlassPlusIcon",
    ZoomOutIcon: "MagnifyingGlassMinusIcon",
    };

    console.log(`echo "Upgrading icon names..."`);
    Object.entries(heroiconsV1toV2).map(([from, to]) => {
    gsub(from, to);
    });

    console.log(
    `echo "Done. You can thank https://twitter.com/cgenco and https://twitter.com/KevinPicchi for saving you so much time :)"`
    );
    149 changes: 14 additions & 135 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,145 +1,24 @@
    # Heroicons v1 to v2 migration script

    The goal of this script is to simply replce all the old heroicons icon name by the new one. (v1 -> v2)
    The script is probably the less efficient piece of code I ever wrote but it does the job.
    Thanks to [@steveoh](https://github.com/steveoh) & [@ryanburns23](https://github.com/ryanburns23) for creating the initial list of changes in https://github.com/tailwindlabs/heroicons/issues/750
    This script:

    ----
    1. Upgrades your heroicons library to the latest version (detecting if you're using `heroicons/react` or `heroicons/vue` and `yarn` or `npm`)
    2. Upgrades your import statements (from `@heroicons/${framework}/{solid|outline}` to `@heroicons/${framework}/20/{solid|outline}`)
    3. Upgrades your icon names

    The `migrate.sh` is generated by the few lines bellow.
    If you're running on MacOS you don't have to make any changes but if you're running it on Linux you might have to replace `sed -i '' -e` by `sed -i`.
    The script will avoid replacing strings in hidden folders (such as .git) but also `node_modules/` anf the `migrate.js` file.
    Thanks to [@steveoh](https://github.com/steveoh) & [@ryanburns23](https://github.com/ryanburns23) for creating the initial list of changes in https://github.com/tailwindlabs/heroicons/issues/750 and to @PicchiKevin for the initial version of this script.

    ----

    ```Javascript
    const heroiconsV1toV2 = {
    AdjustmentsVerticalIcon: 'AdjustmentsVerticalIcon',
    ChatBubbleBottomCenterTextIcon: 'ChatBubbleBottomCenterTextIcon',
    ArchiveBoxIcon: 'ArchiveBoxIcon',
    ArrowDownCircleIcon: 'ArrowDownCircleIcon',
    ArrowLeftCircleIcon: 'ArrowLeftCircleIcon',
    ArrowRightCircleIcon: 'ArrowRightCircleIcon',
    ArrowUpCircleIcon: 'ArrowUpCircleIcon',
    ArrowLongDownIcon: 'ArrowLongDownIcon',
    ArrowLongLeftIcon: 'ArrowLongLeftIcon',
    ArrowLongRightIcon: 'ArrowLongRightIcon',
    ArrowLongUpIcon: 'ArrowLongUpIcon',
    ArrowsPointingOutIcon: 'ArrowsPointingOutIcon',
    CheckBadgeIcon: 'CheckBadgeIcon',
    NoSymbolIcon: 'NoSymbolIcon',
    BookmarkSquareIcon: 'BookmarkSquareIcon',
    BanknotesIcon: 'BanknotesIcon',
    ChartBarSquareIcon: 'ChartBarSquareIcon',
    ChatBubbleLeftRightIcon: 'ChatBubbleLeftRightIcon',
    ChatBubbleLeftEllipsisIcon: 'ChatBubbleLeftEllipsisIcon',
    ChatBubbleOvalLeftEllipsisIcon: 'ChatBubbleOvalLeftEllipsisIcon',
    CpuChipIcon: 'CpuCpuChipIcon',
    ClipboardDocumentCheckIcon: 'ClipboardDocumentCheckIcon',
    ClipboardDocumentIcon: 'ClipboardDocumentIcon',
    ClipboardDocumentListIcon: 'ClipboardDocumentListIcon',
    CloudArrowDownIcon: 'CloudArrowDownIcon',
    CloudArrowUpIcon: 'CloudArrowUpIcon',
    CodeBracketIcon: 'CodeBracketIcon',
    RectangleStackIcon: 'RectangleStackIcon',
    SwatchIcon: 'SwatchIcon',
    CursorArrowRaysIcon: 'CursorArrowRaysIcon',
    CircleStackIcon: 'CircleStackIcon',
    ComputerDesktopIcon: 'ComputerDesktopIcon',
    DevicePhoneMobileIcon: 'DevicePhoneMobileIcon',
    DocumentPlusIcon: 'DocumentPlusIcon',
    DocumentArrowDownIcon: 'DocumentArrowDownIcon',
    DocumentMinusIcon: 'DocumentMinusIcon',
    DocumentChartBarIcon: 'DocumentChartBarIcon',
    DocumentMagnifyingGlassIcon: 'DocumentMagnifyingGlassIcon',
    EllipsisHorizontalCircleIcon: 'EllipsisHorizontalCircleIcon',
    EllipsisHorizontalIcon: 'EllipsisHorizontalIcon',
    EllipsisVerticalIcon: 'EllipsisVerticalIcon',
    ArrowDownTrayIcon: 'ArrowDownTrayIcon',
    Square2StackIcon: 'Square2StackIcon',
    FaceSmileIcon: 'FaceSmileIcon',
    FaceFrownIcon: 'FaceFrownIcon',
    ExclamationIcon: 'ExclamationIcon',
    ArrowTopRightOnSquareIcon: 'ArrowTopRightOnSquareIcon',
    EyeSlashIcon: 'EyeSlashIcon',
    ForwardIcon: 'ForwardIcon',
    FunnelIcon: 'FunnelIcon',
    FolderPlusIcon: 'FolderPlusIcon',
    FolderArrowDownTrayIcon: 'FolderArrowDownIcon',
    FolderMinusIcon: 'FolderMinusIcon',
    GlobeEuropeAfricaIcon: 'GlobeEuropeAfricaIcon',
    HandRaisedIcon: 'HandRaisedIcon',
    InboxArrowDownIcon: 'InboxArrowDownIcon',
    BuildingLibraryIcon: 'BuildingBuildingLibraryIcon',
    BoltIcon: 'BoltIcon',
    MapPinIcon: 'MapPinIcon',
    ArrowLeftOnRectangleIcon: 'ArrowLeftOnRectangleIcon',
    ArrowRightOnRectangleIcon: 'ArrowRightOnRectangleIcon',
    EnvelopeOpenIcon: 'EnvelopeOpenIcon',
    EnvelopeIcon: 'EnvelopeIcon',
    Bars3CenterLeftIcon: 'Bars3CenterLeftIcon',
    Bars3BottomLeftIcon: 'Bars3BottomLeftIcon',
    Bars3BottomRightIcon: 'Bars3BottomRightIcon',
    Bars2Icon: 'Bars2Icon',
    Bars3Icon: 'Bars3Icon',
    MusicalNoteIcon: 'MusicalNoteIcon',
    BuildingOfficeIcon: 'BuildingOfficeIcon',
    PencilSquareIcon: 'PencilSquareIcon',
    PhoneArrowDownLeftIcon: 'PhoneArrowDownLeftIcon',
    PhoneXMarkIcon: 'PhoneXMarkIcon',
    PhoneArrowUpRightIcon: 'PhoneArrowUpRightIcon',
    PhotoIcon: 'PhotoIcon',
    PuzzlePieceIcon: 'PuzzlePieceIcon',
    QrCodeIcon: 'QrCodeBracketIcon',
    ReceiptPercentIcon: 'ReceiptPercentIcon',
    ArrowPathIcon: 'ArrowPathIcon',
    ArrowUturnLeftIcon: 'ArrowUturnLeftIcon',
    BackwardIcon: 'BackwardIcon',
    ArrowDownOnSquareStackIcon: 'ArrowDownOnSquareStackIcon',
    ArrowDownOnSquareIcon: 'ArrowDownOnSquareIcon',
    MagnifyingGlassCircleIcon: 'MagnifyingGlassCircleIcon',
    MagnifyingGlassIcon: 'MagnifyingGlassIcon',
    MegaphoneIcon: 'MegaphoneIcon',
    SignalSlashIcon: 'SignalSlashIcon',
    SignalIcon: 'SignalIcon',
    LifebuoyIcon: 'LifebuoyIcon',
    ArrowRightLeftIcon: 'ArrowRightLeftIcon',
    ArrowUpDownIcon: 'ArrowUpDownIcon',
    TableCellsIcon: 'TableCellsIcon',
    RectangleGroupIcon: 'RectangleGroupIcon',
    CommandLineIcon: 'CommandLineIcon',
    HandThumbDownIcon: 'HandHandThumbDownIcon',
    HandThumbUpIcon: 'HandHandThumbUpIcon',
    LanguageIcon: 'LanguageIcon',
    ArrowTrendingDownIcon: 'ArrowArrowTrendingDownIcon',
    ArrowTrendingUpIcon: 'ArrowArrowTrendingUpIcon',
    ArrowUpTrayIcon: 'ArrowUpTrayIcon',
    UserPlusIcon: 'UserPlusIcon',
    ViewColumnsIcon: 'ViewColumnsIcon',
    SquaresPlusIcon: 'SquaresPlusIcon',
    Squares2x2Icon: 'Squares2x2Icon',
    Bars4Icon: 'Bars4Icon',
    SpeakerXMarkIcon: 'SpeakerXMarkIcon',
    SpeakerWaveIcon: 'SpeakerWaveIcon',
    XMarkIcon: 'XMarkIcon',
    MagnifyingGlassPlusIcon: 'MagnifyingGlassPlusIcon',
    MagnifyingGlassMinusIcon: 'MagnifyingGlassMinusIcon',
    BanIcon: 'NoSymbolIcon',
    CloudArrowDownTrayIcon: 'CloudArrowDownIcon',
    ArrowsExpandIcon: 'ArrowsPointingOutIcon',
    ArchiveIcon: 'ArchiveBoxIcon',
    SelectorIcon: 'ChevronUpDownIcon',
    ChatIcon: 'ChatBubbleOvalLeftEllipsisIcon',
    AdjustmentsIcon: 'AdjustmentsVerticalIcon',
    ExclamationIcon: 'ExclamationTriangleIcon',

    };

    Object.entries(heroiconsV1toV2).map(element => {
    const [a, b] = element;
    console.log(`find . -type f -not -path '*/\.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/${a}/${b}/g' {} +`)
    });
    # Run

    ```bash
    curl | bash
    ```

    Happy with the script? Come say hi on Twitter [@KevinPicchi](https://twitter.com/KevinPicchi)
    If you're running it on Linux you might have to replace `sed -i '' -e` by `sed -i` in the `gsub` function.

    The script will avoid replacing strings in hidden folders (such as .git) but also `node_modules/` and the `migrateHeroicons.js` file if you download it.


    Happy with the script? Come say hi on Twitter [@KevinPicchi](https://twitter.com/KevinPicchi) / [@cgenco](https://twitter.com/cgenco)
  7. @PicchiKevin PicchiKevin revised this gist Sep 20, 2022. 2 changed files with 126 additions and 82 deletions.
    199 changes: 117 additions & 82 deletions migrate.sh
    Original file line number Diff line number Diff line change
    @@ -1,82 +1,117 @@
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ColorSwatchIcon/SwatchIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CursorClickIcon/CursorArrowRaysIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DatabaseIcon/CircleStackIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DesktopComputerIcon/ComputerDesktopIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DeviceMobileIcon/DevicePhoneMobileIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentAddIcon/DocumentPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentDownloadIcon/DocumentArrowDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentRemoveIcon/DocumentMinusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentReportIcon/DocumentChartBarIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentSearchIcon/DocumentMagnifyingGlassIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DotsCircleHorizontalIcon/EllipsisHorizontalCircleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DotsHorizontalIcon/EllipsisHorizontalIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DotsVerticalIcon/EllipsisVerticalIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DownloadIcon/ArrowDownTrayIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DuplicateIcon/Square2StackIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EmojiHappyIcon/FaceSmileIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EmojiSadIcon/FaceFrownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ExclamationIcon/ExclamationIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ExternalLinkIcon/ArrowTopRightOnSquareIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EyeOffIcon/EyeSlashIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FastForwardIcon/ForwardIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FilterIcon/FunnelIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FolderAddIcon/FolderPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FolderDownloadIcon/FolderArrowDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FolderRemoveIcon/FolderMinusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/GlobeIcon/GlobeEuropeAfricaIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/HandIcon/HandRaisedIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/InboxInIcon/InboxArrowDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/LibraryIcon/BuildingLibraryIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/LightningBoltIcon/BoltIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/LocationMarkerIcon/MapPinIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/LoginIcon/ArrowLeftOnRectangleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/LogoutIcon/ArrowRightOnRectangleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MailOpenIcon/EnvelopeOpenIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MailIcon/EnvelopeIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MenuAlt1Icon/Bars3CenterLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MenuAlt2Icon/Bars3BottomLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MenuAlt3Icon/Bars3BottomRightIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MenuAlt4Icon/Bars2Icon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MenuIcon/Bars3Icon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MusicNoteIcon/MusicalNoteIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/OfficeBuildingIcon/BuildingOfficeIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PencilAltIcon/PencilSquareIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PhoneIncomingIcon/PhoneArrowDownLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PhoneMissedCallIcon/PhoneXMarkIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PhoneOutgoingIcon/PhoneArrowUpRightIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PhotographIcon/PhotoIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PuzzleIcon/PuzzlePieceIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/QrcodeIcon/QrCodeIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ReceiptTaxIcon/ReceiptPercentIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/RefreshIcon/ArrowPathIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ReplyIcon/ArrowUturnLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/RewindIcon/BackwardIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SaveAsIcon/ArrowDownOnSquareStackIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SaveIcon/ArrowDownOnSquareIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SearchCircleIcon/MagnifyingGlassCircleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SearchIcon/MagnifyingGlassIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SpeakerphoneIcon/MegaphoneIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/StatusOfflineIcon/SignalSlashIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/StatusOnlineIcon/SignalIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SupportIcon/LifebuoyIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SwitchHorizontalIcon/ArrowRightLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SwitchVerticalIcon/ArrowUpDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/TableIcon/TableCellsIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/TemplateIcon/RectangleGroupIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/TerminalIcon/CommandLineIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ThumbDownIcon/HandThumbDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ThumbUpIcon/HandThumbUpIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/TranslateIcon/LanguageIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/TrendingDownIcon/ArrowTrendingDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/TrendingUpIcon/ArrowTrendingUpIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/UploadIcon/ArrowUpTrayIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/UserAddIcon/UserPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ViewBoardsIcon/ViewColumnsIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ViewGridAddIcon/SquaresPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ViewGridIcon/Squares2x2Icon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ViewListIcon/Bars4Icon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/VolumeOffIcon/SpeakerXMarkIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/VolumeUpIcon/SpeakerWaveIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/XIcon/XMarkIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ZoomInIcon/MagnifyingGlassPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ZoomOutIcon/MagnifyingGlassMinusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/AdjustmentsVerticalIcon/AdjustmentsVerticalIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ChatBubbleBottomCenterTextIcon/ChatBubbleBottomCenterTextIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArchiveBoxIcon/ArchiveBoxIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowDownCircleIcon/ArrowDownCircleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowLeftCircleIcon/ArrowLeftCircleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowRightCircleIcon/ArrowRightCircleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowUpCircleIcon/ArrowUpCircleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowLongDownIcon/ArrowLongDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowLongLeftIcon/ArrowLongLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowLongRightIcon/ArrowLongRightIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowLongUpIcon/ArrowLongUpIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowsPointingOutIcon/ArrowsPointingOutIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CheckBadgeIcon/CheckBadgeIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/NoSymbolIcon/NoSymbolIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/BookmarkSquareIcon/BookmarkSquareIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/BanknotesIcon/BanknotesIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ChartBarSquareIcon/ChartBarSquareIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ChatBubbleLeftRightIcon/ChatBubbleLeftRightIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ChatBubbleLeftEllipsisIcon/ChatBubbleLeftEllipsisIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ChatBubbleOvalLeftEllipsisIcon/ChatBubbleOvalLeftEllipsisIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CpuChipIcon/CpuCpuChipIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ClipboardDocumentCheckIcon/ClipboardDocumentCheckIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ClipboardDocumentIcon/ClipboardDocumentIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ClipboardDocumentListIcon/ClipboardDocumentListIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CloudArrowDownIcon/CloudArrowDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CloudArrowUpIcon/CloudArrowUpIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CodeBracketIcon/CodeBracketIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/RectangleStackIcon/RectangleStackIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SwatchIcon/SwatchIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CursorArrowRaysIcon/CursorArrowRaysIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CircleStackIcon/CircleStackIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ComputerDesktopIcon/ComputerDesktopIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DevicePhoneMobileIcon/DevicePhoneMobileIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentPlusIcon/DocumentPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentArrowDownIcon/DocumentArrowDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentMinusIcon/DocumentMinusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentChartBarIcon/DocumentChartBarIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentMagnifyingGlassIcon/DocumentMagnifyingGlassIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EllipsisHorizontalCircleIcon/EllipsisHorizontalCircleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EllipsisHorizontalIcon/EllipsisHorizontalIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EllipsisVerticalIcon/EllipsisVerticalIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowDownTrayIcon/ArrowDownTrayIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/Square2StackIcon/Square2StackIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FaceSmileIcon/FaceSmileIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FaceFrownIcon/FaceFrownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ExclamationIcon/ExclamationTriangleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowTopRightOnSquareIcon/ArrowTopRightOnSquareIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EyeSlashIcon/EyeSlashIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ForwardIcon/ForwardIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FunnelIcon/FunnelIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FolderPlusIcon/FolderPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FolderArrowDownTrayIcon/FolderArrowDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FolderMinusIcon/FolderMinusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/GlobeEuropeAfricaIcon/GlobeEuropeAfricaIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/HandRaisedIcon/HandRaisedIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/InboxArrowDownIcon/InboxArrowDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/BuildingLibraryIcon/BuildingBuildingLibraryIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/BoltIcon/BoltIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MapPinIcon/MapPinIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowLeftOnRectangleIcon/ArrowLeftOnRectangleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowRightOnRectangleIcon/ArrowRightOnRectangleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EnvelopeOpenIcon/EnvelopeOpenIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EnvelopeIcon/EnvelopeIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/Bars3CenterLeftIcon/Bars3CenterLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/Bars3BottomLeftIcon/Bars3BottomLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/Bars3BottomRightIcon/Bars3BottomRightIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/Bars2Icon/Bars2Icon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/Bars3Icon/Bars3Icon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MusicalNoteIcon/MusicalNoteIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/BuildingOfficeIcon/BuildingOfficeIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PencilSquareIcon/PencilSquareIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PhoneArrowDownLeftIcon/PhoneArrowDownLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PhoneXMarkIcon/PhoneXMarkIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PhoneArrowUpRightIcon/PhoneArrowUpRightIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PhotoIcon/PhotoIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PuzzlePieceIcon/PuzzlePieceIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/QrCodeIcon/QrCodeBracketIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ReceiptPercentIcon/ReceiptPercentIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowPathIcon/ArrowPathIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowUturnLeftIcon/ArrowUturnLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/BackwardIcon/BackwardIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowDownOnSquareStackIcon/ArrowDownOnSquareStackIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowDownOnSquareIcon/ArrowDownOnSquareIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MagnifyingGlassCircleIcon/MagnifyingGlassCircleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MagnifyingGlassIcon/MagnifyingGlassIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MegaphoneIcon/MegaphoneIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SignalSlashIcon/SignalSlashIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SignalIcon/SignalIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/LifebuoyIcon/LifebuoyIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowRightLeftIcon/ArrowRightLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowUpDownIcon/ArrowUpDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/TableCellsIcon/TableCellsIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/RectangleGroupIcon/RectangleGroupIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CommandLineIcon/CommandLineIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/HandThumbDownIcon/HandHandThumbDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/HandThumbUpIcon/HandHandThumbUpIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/LanguageIcon/LanguageIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowTrendingDownIcon/ArrowArrowTrendingDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowTrendingUpIcon/ArrowArrowTrendingUpIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowUpTrayIcon/ArrowUpTrayIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/UserPlusIcon/UserPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ViewColumnsIcon/ViewColumnsIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SquaresPlusIcon/SquaresPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/Squares2x2Icon/Squares2x2Icon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/Bars4Icon/Bars4Icon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SpeakerXMarkIcon/SpeakerXMarkIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SpeakerWaveIcon/SpeakerWaveIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/XMarkIcon/XMarkIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MagnifyingGlassPlusIcon/MagnifyingGlassPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MagnifyingGlassMinusIcon/MagnifyingGlassMinusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/BanIcon/NoSymbolIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CloudArrowDownTrayIcon/CloudArrowDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArrowsExpandIcon/ArrowsPointingOutIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ArchiveIcon/ArchiveBoxIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SelectorIcon/ChevronUpDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ChatIcon/ChatBubbleOvalLeftEllipsisIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/AdjustmentsIcon/AdjustmentsVerticalIcon/g' {} +
    9 changes: 9 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -124,6 +124,15 @@ const heroiconsV1toV2 = {
    XMarkIcon: 'XMarkIcon',
    MagnifyingGlassPlusIcon: 'MagnifyingGlassPlusIcon',
    MagnifyingGlassMinusIcon: 'MagnifyingGlassMinusIcon',
    BanIcon: 'NoSymbolIcon',
    CloudArrowDownTrayIcon: 'CloudArrowDownIcon',
    ArrowsExpandIcon: 'ArrowsPointingOutIcon',
    ArchiveIcon: 'ArchiveBoxIcon',
    SelectorIcon: 'ChevronUpDownIcon',
    ChatIcon: 'ChatBubbleOvalLeftEllipsisIcon',
    AdjustmentsIcon: 'AdjustmentsVerticalIcon',
    ExclamationIcon: 'ExclamationTriangleIcon',

    };

    Object.entries(heroiconsV1toV2).map(element => {
  8. @PicchiKevin PicchiKevin created this gist Aug 30, 2022.
    82 changes: 82 additions & 0 deletions migrate.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,82 @@
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ColorSwatchIcon/SwatchIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/CursorClickIcon/CursorArrowRaysIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DatabaseIcon/CircleStackIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DesktopComputerIcon/ComputerDesktopIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DeviceMobileIcon/DevicePhoneMobileIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentAddIcon/DocumentPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentDownloadIcon/DocumentArrowDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentRemoveIcon/DocumentMinusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentReportIcon/DocumentChartBarIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DocumentSearchIcon/DocumentMagnifyingGlassIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DotsCircleHorizontalIcon/EllipsisHorizontalCircleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DotsHorizontalIcon/EllipsisHorizontalIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DotsVerticalIcon/EllipsisVerticalIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DownloadIcon/ArrowDownTrayIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/DuplicateIcon/Square2StackIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EmojiHappyIcon/FaceSmileIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EmojiSadIcon/FaceFrownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ExclamationIcon/ExclamationIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ExternalLinkIcon/ArrowTopRightOnSquareIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/EyeOffIcon/EyeSlashIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FastForwardIcon/ForwardIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FilterIcon/FunnelIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FolderAddIcon/FolderPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FolderDownloadIcon/FolderArrowDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/FolderRemoveIcon/FolderMinusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/GlobeIcon/GlobeEuropeAfricaIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/HandIcon/HandRaisedIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/InboxInIcon/InboxArrowDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/LibraryIcon/BuildingLibraryIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/LightningBoltIcon/BoltIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/LocationMarkerIcon/MapPinIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/LoginIcon/ArrowLeftOnRectangleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/LogoutIcon/ArrowRightOnRectangleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MailOpenIcon/EnvelopeOpenIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MailIcon/EnvelopeIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MenuAlt1Icon/Bars3CenterLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MenuAlt2Icon/Bars3BottomLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MenuAlt3Icon/Bars3BottomRightIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MenuAlt4Icon/Bars2Icon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MenuIcon/Bars3Icon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/MusicNoteIcon/MusicalNoteIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/OfficeBuildingIcon/BuildingOfficeIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PencilAltIcon/PencilSquareIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PhoneIncomingIcon/PhoneArrowDownLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PhoneMissedCallIcon/PhoneXMarkIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PhoneOutgoingIcon/PhoneArrowUpRightIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PhotographIcon/PhotoIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/PuzzleIcon/PuzzlePieceIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/QrcodeIcon/QrCodeIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ReceiptTaxIcon/ReceiptPercentIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/RefreshIcon/ArrowPathIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ReplyIcon/ArrowUturnLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/RewindIcon/BackwardIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SaveAsIcon/ArrowDownOnSquareStackIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SaveIcon/ArrowDownOnSquareIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SearchCircleIcon/MagnifyingGlassCircleIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SearchIcon/MagnifyingGlassIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SpeakerphoneIcon/MegaphoneIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/StatusOfflineIcon/SignalSlashIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/StatusOnlineIcon/SignalIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SupportIcon/LifebuoyIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SwitchHorizontalIcon/ArrowRightLeftIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/SwitchVerticalIcon/ArrowUpDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/TableIcon/TableCellsIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/TemplateIcon/RectangleGroupIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/TerminalIcon/CommandLineIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ThumbDownIcon/HandThumbDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ThumbUpIcon/HandThumbUpIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/TranslateIcon/LanguageIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/TrendingDownIcon/ArrowTrendingDownIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/TrendingUpIcon/ArrowTrendingUpIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/UploadIcon/ArrowUpTrayIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/UserAddIcon/UserPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ViewBoardsIcon/ViewColumnsIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ViewGridAddIcon/SquaresPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ViewGridIcon/Squares2x2Icon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ViewListIcon/Bars4Icon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/VolumeOffIcon/SpeakerXMarkIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/VolumeUpIcon/SpeakerWaveIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/XIcon/XMarkIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ZoomInIcon/MagnifyingGlassPlusIcon/g' {} +
    find . -type f -not -path '*/.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/ZoomOutIcon/MagnifyingGlassMinusIcon/g' {} +
    136 changes: 136 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,136 @@
    # Heroicons v1 to v2 migration script

    The goal of this script is to simply replce all the old heroicons icon name by the new one. (v1 -> v2)
    The script is probably the less efficient piece of code I ever wrote but it does the job.
    Thanks to [@steveoh](https://github.com/steveoh) & [@ryanburns23](https://github.com/ryanburns23) for creating the initial list of changes in https://github.com/tailwindlabs/heroicons/issues/750

    ----

    The `migrate.sh` is generated by the few lines bellow.
    If you're running on MacOS you don't have to make any changes but if you're running it on Linux you might have to replace `sed -i '' -e` by `sed -i`.
    The script will avoid replacing strings in hidden folders (such as .git) but also `node_modules/` anf the `migrate.js` file.

    ----

    ```Javascript
    const heroiconsV1toV2 = {
    AdjustmentsVerticalIcon: 'AdjustmentsVerticalIcon',
    ChatBubbleBottomCenterTextIcon: 'ChatBubbleBottomCenterTextIcon',
    ArchiveBoxIcon: 'ArchiveBoxIcon',
    ArrowDownCircleIcon: 'ArrowDownCircleIcon',
    ArrowLeftCircleIcon: 'ArrowLeftCircleIcon',
    ArrowRightCircleIcon: 'ArrowRightCircleIcon',
    ArrowUpCircleIcon: 'ArrowUpCircleIcon',
    ArrowLongDownIcon: 'ArrowLongDownIcon',
    ArrowLongLeftIcon: 'ArrowLongLeftIcon',
    ArrowLongRightIcon: 'ArrowLongRightIcon',
    ArrowLongUpIcon: 'ArrowLongUpIcon',
    ArrowsPointingOutIcon: 'ArrowsPointingOutIcon',
    CheckBadgeIcon: 'CheckBadgeIcon',
    NoSymbolIcon: 'NoSymbolIcon',
    BookmarkSquareIcon: 'BookmarkSquareIcon',
    BanknotesIcon: 'BanknotesIcon',
    ChartBarSquareIcon: 'ChartBarSquareIcon',
    ChatBubbleLeftRightIcon: 'ChatBubbleLeftRightIcon',
    ChatBubbleLeftEllipsisIcon: 'ChatBubbleLeftEllipsisIcon',
    ChatBubbleOvalLeftEllipsisIcon: 'ChatBubbleOvalLeftEllipsisIcon',
    CpuChipIcon: 'CpuCpuChipIcon',
    ClipboardDocumentCheckIcon: 'ClipboardDocumentCheckIcon',
    ClipboardDocumentIcon: 'ClipboardDocumentIcon',
    ClipboardDocumentListIcon: 'ClipboardDocumentListIcon',
    CloudArrowDownIcon: 'CloudArrowDownIcon',
    CloudArrowUpIcon: 'CloudArrowUpIcon',
    CodeBracketIcon: 'CodeBracketIcon',
    RectangleStackIcon: 'RectangleStackIcon',
    SwatchIcon: 'SwatchIcon',
    CursorArrowRaysIcon: 'CursorArrowRaysIcon',
    CircleStackIcon: 'CircleStackIcon',
    ComputerDesktopIcon: 'ComputerDesktopIcon',
    DevicePhoneMobileIcon: 'DevicePhoneMobileIcon',
    DocumentPlusIcon: 'DocumentPlusIcon',
    DocumentArrowDownIcon: 'DocumentArrowDownIcon',
    DocumentMinusIcon: 'DocumentMinusIcon',
    DocumentChartBarIcon: 'DocumentChartBarIcon',
    DocumentMagnifyingGlassIcon: 'DocumentMagnifyingGlassIcon',
    EllipsisHorizontalCircleIcon: 'EllipsisHorizontalCircleIcon',
    EllipsisHorizontalIcon: 'EllipsisHorizontalIcon',
    EllipsisVerticalIcon: 'EllipsisVerticalIcon',
    ArrowDownTrayIcon: 'ArrowDownTrayIcon',
    Square2StackIcon: 'Square2StackIcon',
    FaceSmileIcon: 'FaceSmileIcon',
    FaceFrownIcon: 'FaceFrownIcon',
    ExclamationIcon: 'ExclamationIcon',
    ArrowTopRightOnSquareIcon: 'ArrowTopRightOnSquareIcon',
    EyeSlashIcon: 'EyeSlashIcon',
    ForwardIcon: 'ForwardIcon',
    FunnelIcon: 'FunnelIcon',
    FolderPlusIcon: 'FolderPlusIcon',
    FolderArrowDownTrayIcon: 'FolderArrowDownIcon',
    FolderMinusIcon: 'FolderMinusIcon',
    GlobeEuropeAfricaIcon: 'GlobeEuropeAfricaIcon',
    HandRaisedIcon: 'HandRaisedIcon',
    InboxArrowDownIcon: 'InboxArrowDownIcon',
    BuildingLibraryIcon: 'BuildingBuildingLibraryIcon',
    BoltIcon: 'BoltIcon',
    MapPinIcon: 'MapPinIcon',
    ArrowLeftOnRectangleIcon: 'ArrowLeftOnRectangleIcon',
    ArrowRightOnRectangleIcon: 'ArrowRightOnRectangleIcon',
    EnvelopeOpenIcon: 'EnvelopeOpenIcon',
    EnvelopeIcon: 'EnvelopeIcon',
    Bars3CenterLeftIcon: 'Bars3CenterLeftIcon',
    Bars3BottomLeftIcon: 'Bars3BottomLeftIcon',
    Bars3BottomRightIcon: 'Bars3BottomRightIcon',
    Bars2Icon: 'Bars2Icon',
    Bars3Icon: 'Bars3Icon',
    MusicalNoteIcon: 'MusicalNoteIcon',
    BuildingOfficeIcon: 'BuildingOfficeIcon',
    PencilSquareIcon: 'PencilSquareIcon',
    PhoneArrowDownLeftIcon: 'PhoneArrowDownLeftIcon',
    PhoneXMarkIcon: 'PhoneXMarkIcon',
    PhoneArrowUpRightIcon: 'PhoneArrowUpRightIcon',
    PhotoIcon: 'PhotoIcon',
    PuzzlePieceIcon: 'PuzzlePieceIcon',
    QrCodeIcon: 'QrCodeBracketIcon',
    ReceiptPercentIcon: 'ReceiptPercentIcon',
    ArrowPathIcon: 'ArrowPathIcon',
    ArrowUturnLeftIcon: 'ArrowUturnLeftIcon',
    BackwardIcon: 'BackwardIcon',
    ArrowDownOnSquareStackIcon: 'ArrowDownOnSquareStackIcon',
    ArrowDownOnSquareIcon: 'ArrowDownOnSquareIcon',
    MagnifyingGlassCircleIcon: 'MagnifyingGlassCircleIcon',
    MagnifyingGlassIcon: 'MagnifyingGlassIcon',
    MegaphoneIcon: 'MegaphoneIcon',
    SignalSlashIcon: 'SignalSlashIcon',
    SignalIcon: 'SignalIcon',
    LifebuoyIcon: 'LifebuoyIcon',
    ArrowRightLeftIcon: 'ArrowRightLeftIcon',
    ArrowUpDownIcon: 'ArrowUpDownIcon',
    TableCellsIcon: 'TableCellsIcon',
    RectangleGroupIcon: 'RectangleGroupIcon',
    CommandLineIcon: 'CommandLineIcon',
    HandThumbDownIcon: 'HandHandThumbDownIcon',
    HandThumbUpIcon: 'HandHandThumbUpIcon',
    LanguageIcon: 'LanguageIcon',
    ArrowTrendingDownIcon: 'ArrowArrowTrendingDownIcon',
    ArrowTrendingUpIcon: 'ArrowArrowTrendingUpIcon',
    ArrowUpTrayIcon: 'ArrowUpTrayIcon',
    UserPlusIcon: 'UserPlusIcon',
    ViewColumnsIcon: 'ViewColumnsIcon',
    SquaresPlusIcon: 'SquaresPlusIcon',
    Squares2x2Icon: 'Squares2x2Icon',
    Bars4Icon: 'Bars4Icon',
    SpeakerXMarkIcon: 'SpeakerXMarkIcon',
    SpeakerWaveIcon: 'SpeakerWaveIcon',
    XMarkIcon: 'XMarkIcon',
    MagnifyingGlassPlusIcon: 'MagnifyingGlassPlusIcon',
    MagnifyingGlassMinusIcon: 'MagnifyingGlassMinusIcon',
    };

    Object.entries(heroiconsV1toV2).map(element => {
    const [a, b] = element;
    console.log(`find . -type f -not -path '*/\.*' -path '*.js' -not -path './node_modules*' -not -path 'migrate.js' -exec sed -i '' -e 's/${a}/${b}/g' {} +`)
    });

    ```

    Happy with the script? Come say hi on Twitter [@KevinPicchi](https://twitter.com/KevinPicchi)