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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@itcase/config

v1.7.13

Published

ITCase Config

Readme

ITCase Config

Набор готовых конфигураций для инструментов разработки, используемых в проектах ITCase. Этот пакет содержит стандартизированные настройки для commitlint, lint-staged, PostCSS, semantic-release и SVGR.

Установка

npm install --save-dev @itcase/config

Доступные конфигурации

Пакет предоставляет следующие конфигурации:

  • Commitlint — проверка формата сообщений коммитов

    • createCommitlintProjectConfig(SCOPES) — для разработки
    • createCommitlintReleaseConfig(SCOPES) — для релизных веток
    • commitlint/commitizenAdapter.js — адаптер Commitizen (type → scope → subScope → subject)
  • Smart commit — CLI smart-commit (Cursor Agent → preview → commit)

  • Husky — общие git-хуки в husky-hooks/

    • В git только .husky/config; обёртки и _run.sh создаёт itcase-config-husky-install при npm i
  • Lint-staged — запуск линтеров для измененных файлов

    • lintStaged — eslint, stylelint; tsc --noEmit, если в staged есть .ts/.tsx
    • lintStagedMonorepo — то же, но typecheck через npm run typecheck по workspaces
    • обе конфигурации блокируют коммит, если в package.json есть локальные зависимости file: / link:
  • PostCSS — обработка CSS

    • postcss/index.js — стандартная конфигурация
    • postcss/nextVite.js — для Next.js/Vite проектов
  • Semantic Release — автоматическое управление версиями

    • semantic-release/config.js — конфигурация
    • semantic-release/index.js — стандартная конфигурация
    • semantic-release/indexLerna.js — для Lerna монорепозиториев
    • semantic-release/indexVSMarketplace.js — для VS Code расширений
  • SVGR — преобразование SVG в React компоненты

    • svgr/index.js — реэкспорт
    • svgr/svgrConfigBase.js — общие plugins и svgo
    • svgr/svgrConfigWeb.js — веб
    • svgr/svgrConfigReactNative.js — React Native (native: true)
    • svgr/webpack.js — интеграция с Webpack

Подключение Lint-staged

В корне проекта lint-staged.config.mjs:

import { lintStaged } from '@itcase/config/lint-staged/index.js'

export default lintStaged

Для монорепозитория с npm run typecheck — lintStagedMonorepo.

Подключение Commitlint

  1. Установите зависимости в проекте:
npm install --save-dev @itcase/config @commitlint/cli @commitlint/config-conventional conventional-changelog-conventionalcommits
  1. Создайте в корне проекта файл commitlint.config.mjs:
import {
  createCommitlintProjectConfig,
  createCommitlintReleaseConfig,
} from '@itcase/config/commitlint/index.js'

const SCOPES = {
  auth: [],
  common: [],
  dashboard: [],
  logbook: ['events', 'filters'],
  map: ['layers', 'controls', 'markers'],
  report: ['monitoring', 'analytics', 'export', 'filters'],
  other: [],
}

export default process.env.RELEASE_BRANCH === 'true'
  ? createCommitlintReleaseConfig(SCOPES)
  : createCommitlintProjectConfig(SCOPES)
  1. Git-хуки подключаются из husky-hooks/ — см. раздел Подключение Husky ниже.

  2. (Опционально) Интерактивное оформление коммитов через Commitizen. Установите:

npm install --save-dev commitizen @commitlint/cz-commitlint

Добавьте файл .cz.json

{ "path": "@itcase/config/commitlint/commitizenAdapter.js" }

Smart commit

smart-commit — Cursor Agent (ask) планирует коммиты по SCOPES, печатает сообщения, спрашивает [y/N]. Перед коммитом ждёт и снимает устаревший .git/index.lock, если его никто не держит. Lockfile (package-lock.json и аналоги) всегда кладётся в тот же коммит, что и соседний package.json; при одном только bump deps агент не вызывается.

[random pixel animation]
Drafting commit messages… (12s)
Agent started (Composer)
Reading src/foo.ts

Commits:
  • feat(other): add smart-commit cli
  • docs(docs): document smart-commit usage

Create 2 commit(s)? [y/N]

Нужны Cursor Agent + логин (agent login / CURSOR_API_KEY) и commitlint.config.* с SCOPES.

В проекте с @itcase/config добавьте в package.json:

{
  "scripts": {
    "smart-commit": "smart-commit",
    "smart-commit:dry": "smart-commit --dry-run"
  }
}

Запуск:

npm run smart-commit:dry
npm run smart-commit
make smart-commit-dry   # если есть Makefile
make smart-commit

В самом @itcase/config (разработка пакета):

npm run smart-commit:dry
npm run smart-commit:yes
make smart-commit-dry

Если agent нет в PATH (command not found):

curl https://cursor.com/install -fsS | bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
agent --version
agent login

CLI ставится в ~/.local/bin. Логин в Cursor IDE этот CLI не авторизует.

Без браузера (CI): export CURSOR_API_KEY=… вместо agent login.

Обновление CLI: agent update.

Пока Agent думает, в терминале крутится pixel-анимация (случайно nyan cat, dancing banana или упячка) + статус (Ns), а под ними живой лог агента (log-update). Пока процесс агента жив, CLI его не убивает по таймауту. Принудительно: --cat / --banana / --upyachka. Для полного лога: npm run smart-commit -- --verbose --dry-run.

Важно: в npm есть одноимённый пакет smart-commit. Используйте npm run smart-commit из проекта с @itcase/config — bin берётся из node_modules. npx smart-commit без локальной установки может подтянуть чужой пакет; CLI перед запуском проверяет, что выполняется именно @itcase/config.

Подключение Semantic Release

Обычный пакет:

import { semanticReleasePackage } from '@itcase/config/semantic-release/index.js'

export default semanticReleasePackage

Монорепозиторий:

import { semanticReleaseMonorepo } from '@itcase/config/semantic-release/index.js'

export default semanticReleaseMonorepo

Заметки монорепозитория печатает conventional-changelog-writer 9 из этого пакета. Writer 8, который ставит semantic-release, для conventional-changelog-conventionalcommits 10 оставляет в CHANGELOG.md только заголовок версии. Отдельный overrides в репозитории не нужен. Уже опубликованный релиз сам не перепишется.

Подключение Husky

В git кладите только .husky/config. Обёртки хуков и _run.sh создаёт itcase-config-husky-install при npm i. Логика хуков живёт в @itcase/config/husky-hooks.

{
  "scripts": {
    "prepare": "husky && itcase-config-husky-install"
  }
}

Пока бинарь ещё не в установленной версии пакета:

{
  "scripts": {
    "prepare": "husky && node node_modules/@itcase/config/husky-hooks/install-launcher.js"
  }
}

В .gitignore:

.husky/*
!.husky/config

itcase-config-husky-install копирует _run.sh, создаёт обёртки и при отсутствии восстанавливает config из config.example. Свои полные хуки не перезаписывает. npm i --ignore-scripts файлы не создаст.

.husky/config:

PROTECTED_BRANCHES="master"
RELEASE_BRANCHES="master"

Образец: husky-hooks/config.example.