npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@alfalab/core-components-codemod

v2.6.1

Published

Codemod tools for code transforms

Downloads

20

Readme

Тулзы для модификации кода

Использование

  1. Установить к себе на проект:
$ yarn add --dev @alfalab/core-components-codemod
  1. Запустить нужные трансформеры:

Какой-то один трансформер:

$ npx @alfalab/core-components-codemod --transformers=button-xs --glob='src/**/*.tsx'

Можно сразу несколько трансформеров:

$ npx @alfalab/core-components-codemod --transformers=button-xs,button-views --glob='src/**/*.tsx'

Сейчас замена компонентов доступна только для кода, написанного на typescript. Если кому-то нужно мигрировать с js - дайте знать, докрутим.

Список доступных трансформеров

| Название | Описание | |-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | paragraph | Меняет компонент Paragraph из arui-feather на актульный компонент из core-components | | label | Меняет компонент Label из arui-feather на актульный компонент из core-components | | heading | Меняет компонент Heading из arui-feather на актульный компонент из core-components | | button-xs | Изменяет размер кнопки с xs на xxs | | button-views | Меняет вид кнопки с view filled на secondary, outlined на tertiary, transparent на secondary, primary на accent | | replace-color-vars | Заменяет цветовые токены при переходе на core-components v27 и выше: | | | --color-light-border-secondary-inverted: --color-light-border-underline | | | --color-light-border-tertiary-inverted: --color-light-border-underline-inverted | | | --color-light-graphic-neutral: --color-light-graphic-quaternary | | | --color-light-bg-neutral: --color-light-bg-quaternary | | | --color-dark-graphic-neutral: --color-dark-graphic-quaternary | | | --color-dark-bg-neutral: --color-dark-bg-quaternary | | | --color-static-bg-neutral-light: --color-static-bg-quaternary-light | | | --color-static-bg-neutral-dark: --color-static-bg-quaternary-dark | | delete-dist | Удаляет '/dist' в импортах отдельных пакетов. Может принимать дополнительный аргумент командной строки --packages, в котором указывается список компонентов, импорты которых нужно обработать, например (--packages="modal,button") | | button-breakpoint-768 | Добавляет свойство breakpoint со значением 768 к респонсивной кнопке | | button-views-45 | Меняет вид кнопки с view tertiary на outlined, link на transparent, ghost на text |

42 мажорный релиз

Для запуска всех трансформеров можно воспользоваться командой

npx @alfalab/core-components-codemod --transformers=42-autocomplete,42-button,42-calendar,42-calendar-input,42-checkbox-group,42-code-input,42-confirmation,42-date-range-input,42-date-time-input,42-filter-tag,42-form-control,42-input,42-modal,42-picker-button,42-plate,42-radio-group,42-select,42-side-panel,42-system-message,42-tabs,42-tag,42-toast,42-toast-plate,42-tooltip --glob='src/**/*.tsx'

Разработка

Под капотом - jscodeshift.

Запуск тестов

$ yarn test:codemod

or

$ npx jest packages/codemod/src --config=jest.codemod.config.js