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

@asnvrn/mg-common

v0.0.3

Published

Reusable Vue 3 components for MG projects

Readme

@asnvrn/mg-common

Переиспользуемые Vue 3 компоненты с общими стилями.

Установка

npm install @asnvrn/mg-common

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

Импорт компонентов

<template>
  <CategoryCard image="https://via.placeholder.com/300" title="Category 1" />
</template>

<script setup>
import { CategoryCard } from '@asnvrn/mg-common'
</script>

Глобальная регистрация компонентов

// main.ts или plugins/components.ts
import { components } from '@asnvrn/mg-common'

export default defineNuxtPlugin((nuxtApp) => {
  Object.entries(components).forEach(([name, component]) => {
    nuxtApp.vueApp.component(name, component)
  })
})

Импорт стилей

Общие стили (CSS Reset, утилиты, переменные)

// В app.vue или main.scss
@use '@asnvrn/mg-common/main.scss';

Стили компонентов

// В app.vue или main.scss  
@import '@asnvrn/mg-common/dist/style.css';

Полный импорт стилей

<!-- app.vue -->
<style lang="scss">
@use '@asnvrn/mg-common/main.scss';
@import '@asnvrn/mg-common/dist/style.css';
</style>

Структура стилей

Стили организованы в папке src/assets/scss/:

assets/
├── scss/
│   └── main.scss       # Основные стили пакета
└── svg/icons/          # SVG иконки

Что включено в общие стили

  • CSS Reset - обнуление стандартных стилей
  • CSS переменные - цветовая палитра, отступы, радиусы, тени
  • Утилитарные классы - .container, .text-center, .mb-md и т.д.
  • Базовые стили форм - .form-input, .form-label, .form-group
  • Базовые кнопки - .btn, .btn--primary, .btn--secondary
  • Адаптивные утилиты - .hidden-mobile, .hidden-desktop

Компоненты

  • CategoryCard - Карточка категории с изображением и заголовком

Структура компонентов

Компоненты организованы по функциональности в папке src/components/:

components/
└── market/             # Компоненты для маркетплейса
    └── category-card.vue

Иконки

Пакет включает папку с SVG иконками для использования с nuxt-svgo.

Быстрый старт

После установки пакета и настройки nuxt-svgo, иконки автоматически доступны как Vue компоненты:

<template>
  <AccountsIcon />
  <CardsIcon />
  <UsersIcon />
</template>

Доступные иконки

  • accounts, cards, cases, companies, events
  • news, orders, pages, payments, posts
  • promocodes, questions, settings, users, vendors

Импорт конкретной иконки

<template>
  <AccountsIcon />
</template>

<script setup lang="ts">
import AccountsIcon from '@asnvrn/mg-common/icons/accounts.svg'
</script>

Структура иконок

Иконки находятся в папке src/assets/svg/icons/ и доступны через экспорт ./icons.

Подробная документация по иконкам: ICONS.md

Разработка

# Сборка
npm run build

# Режим разработки с отслеживанием изменений
npm run dev

Добавление новых компонентов

  1. Создайте новый .vue файл в папке src/
  2. Экспортируйте его в src/index.ts
  3. Добавьте в объект components для глобальной регистрации
  4. Соберите пакет: npm run build