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

@feugene/astro-granularity

v0.4.0

Published

Astro integration for @feugene/granularity — flash-free theme, styles, auto-import resolver and i18n blocks in one line.

Readme

@feugene/astro-granularity

English · Русский

Интеграция Astro для дизайн-системы @feugene/granularity.

Одна строка в astro.config.mjs — и библиотека подключена: тема ставится до первой отрисовки, строки компонентов приезжают внутри HTML, регистрируется авто-импорт, а неверно собранное окружение роняет сборку сообщением, которое называет починку, вместо того чтобы молча отдать бесцветную страницу.

Требуется Astro 7.

Что она делает

Четыре отдельные вещи, каждая выключается флагом. Интеграция, которую нельзя частично отключить, становится препятствием на первом же проекте, не совпавшем с её допущениями.

| | Что | Выключить | |------------------------|-------------------------------------------------------------------------------------------------------------------|----------------------------| | Тема без мигания | Синхронный инлайн-скрипт в <head> разрешает тему так же, как useTheme ядра, и переживает клиентскую навигацию | injectThemeScript: false | | Строки в HTML | Middleware сообщает язык маршрута до рендера и кладёт снимок переводов в <head> | i18n.ssrStrings: false | | Авто-импорт | Регистрирует резолвер unplugin-vue-components: <GrButton> в .vue не требует импорта | resolver: false | | Проверка окружения | Роняет сборку, если нет @astrojs/vue или пресета UnoCSS, называя точную строку-починку | strict: false |

Чужой конфиг она не правит. Нет granular-preset в uno.config.ts или @astrojs/vue в integrations — будет внятная ошибка, а не тихая подстановка: конфиг, который читается одним, а собирается другим, ищут днями.

Установка

@floating-ui/dom — обязательный peer ядра: без него сборка падает на первом же компоненте со всплывающей панелью.

# yarn
yarn add -D @feugene/astro-granularity @astrojs/vue @floating-ui/dom
# npm
npm i -D @feugene/astro-granularity @astrojs/vue @floating-ui/dom
# pnpm
pnpm add -D @feugene/astro-granularity @astrojs/vue @floating-ui/dom

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

// astro.config.mjs
import vue from '@astrojs/vue'
import granularity from '@feugene/astro-granularity'
import {defineConfig} from 'astro/config'
import UnoCSS from 'unocss/astro'

export default defineConfig({
    integrations: [
        vue({appEntrypoint: '@feugene/astro-granularity/app'}),
        UnoCSS({injectReset: true}),
        granularity({i18n: {locales: ['en', 'ru']}}),
    ],
    i18n: {
        defaultLocale: 'en',
        locales: ['en', 'ru'],
        routing: {prefixDefaultLocale: false},
    },
})
// uno.config.ts
import granularityProvider from '@feugene/granularity/granular-provider/node'
import {granularContent, presetGranularNode} from '@feugene/unocss-preset-granular/node'
import {defineConfig, presetMini} from 'unocss'

const options = {
    providers: [granularityProvider],
    components: [{provider: '@feugene/granularity', names: ['GrButton', 'GrCard']}],
    themes: {names: ['light', 'dark']},
    layer: 'granular',
}

const content = granularContent(options)

export default defineConfig({
    content: {
        ...content,
        // Свои исходники — с диска. Без этой строки утилиты, встречающиеся только
        // внутри острова `client:only`, в CSS не попадают вовсе — см. docs/islands.ru.md.
        filesystem: [...(content.filesystem ?? []), 'src/**/*.{vue,astro,ts}'],
    },
    presets: [presetMini(), presetGranularNode(options)],
})

Оба вызова получают один и тот же объект настроек: первый задаёт, что сканировать, второй — что эмитить. Разъедутся — компоненты приедут без стилей.

Документация

| | | |---------------------------------------------|------------------------------------------------------------------| | Рецепты | Шесть способов подключения — от двух компонентов до серверного рендеринга | | Тема | Контракт из трёх точек, свой переключатель, клиентская навигация | | Строки | Как переводы попадают в HTML, режимы снимка, свой i18n-рантайм | | Острова | Директивы гидратации, оверлеи, client:only, общее состояние | | Справочник | Все опции, экспорты, подпути и peer-диапазоны | | Диагностика | Симптом → причина → починка |

Пример

В example/ — рабочее приложение на этой интеграции: панель состояния сервисов, три раздела на трёх языках, 22 страницы. Шапка и подвал островами; на каждой странице по одному острову, отрисованному на сервере, и одному клиентскому.

Lighthouse даёт 100 по доступности, лучшим практикам и SEO и 99–100 по производительности. Числа, условия замера и то, чем они достигнуты, — в example/README.md.

Лицензия

См. LICENSE.