Closed kndenisenko closed 1 year ago
Спасибо за отзыв!
Сейчас потестировал через nvm
под разными версиями ноды — проблем не обнаружил.
Добавил запуск тестов в CI на свежих версиях ноды (14/16/18) — тесты тоже проходят: ???
Что касается необходимости ставить глобально, то это не обязательно. При локальной установке запускать можно по полному пути из папке пакета в node_modules
либо воспользоваться симлинкой, которая создается в node_modules/.bin
. То есть полный вызов из папки проекта, где пакет установлен локально, будет выглядеть так: ./node_modules/.bin/css-to-bem-file-structure путь-к-файлу.css
.
Чтобы не указывать длинный путь каждый раз, я добавляю его в переменную окружения PATH
: https://github.com/tadatuta/dotfiles/blob/master/.bashrc#L116.
Проблему с псевдоклассами посмотрю в рамках https://github.com/tadatuta/bem-tools-create-by-css/issues/1
Cпасибо за создание пакета bem-tools-create-by-css. Он очень помогает при разбивке одного длинного css-файла на блоки по БЭМ. Но к сожалению, с пакетом нашлись проблемы, о них дальше. :)
Если коротко, то пакет css-to-bem-file-structure посоветовали во время обучения в яндекс.практикуме. Столкнулся с несколькими проблемами, которые мне показались багами. Пакет условно работает только при глобальной установке с флагом -g и только при установленной версии ноды 10.19.0 (npm 6.13.4). При смене версии ноды на 16.13.1 (npm 8.1.2) пакет уже не работает. С остальными версиями ноды не тестил. Ноды устанавливались и переключались с помощью Node Version Manager.
Тесты проходили в Ubuntu 20.04, установленной с помощью WSL 2 в Win 11
Пакет работает только при глобальной установке
При установленной ноде 10.19.0 и установке с помощью npm i css-to-bem-file-structure --save-dev и попытке запустить пакет через css-to-bem-file-structure path-to-styles.css получил следующую ошибку:
После установил пакет при помощи команды npm i -g css-to-bem-file-structure
Попробовал снова выполнить css-to-bem-file-structure path-to-styles.css получил предупреждение и папку blocks, с блоками. При этом всевдоклассы не были перемещены в файлы папки blocks:
Пакет не работает при смене версии ноды на 16.13.1
Ставлю ноду 16.13.1 через Node Version Manager, повторяю установку npm i -g css-to-bem-file-structure, запускаю css-to-bem-file-structure ./styles/style.css и получаю ошибку
Меняю ноду на 10.19.0 и снова всё работает, хоть и с предупреждением