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

@sergey.akkuratov/gh-pub

v1.0.0

Published

CLI приложение для публикации проекта на GithHub Pages

Downloads

6

Readme

Check, Build and Publish npm package Contributors Issues

Содержание

О проекте

Приложение gh-pub предназанчено для публикации ваших статических файлов (frontend-приложений) на GitHub Pages. Оно использует базовые команды Git для коммита и отправки файлов на определённую ветку удаленного репозитория.

Требования

Для корректной работы прриложения вам потребуется:

  1. Настроенный репозиторий GitHub: В репозитории должны быть настроены Pages на определённую ветку репощитория.

    github

    Подробности можно узнать здесь.

  2. Установленый и настроенный Git для выполнения операций.

    В вашем окружении должна быть доступна команда git и при выполнении операций с репозиторием Git не должен запрашивать дополнительных данных (например, логин или пароль).

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

Приложение gh-pub может работать в двух режимах: Wizard и используя аргументы командой строки.

  1. Запуск в режиме Wizard:

    В данном режме gh-pub будет задавать пользователю ворпросы для настройки запуска. После получения всех необходимых настроеу будет запущен деплой данных на gitHub Pages.

    Запуск:

    npx @sergey.akkuratov/gh-pub

    Демонстрация:

    wizard

  2. Запуск с использованием аргументов командой строки:

    В данном режиме gh-pub ожидает, что все необхдимы настройки будут переданы в виде аргументов командой строки. На данный момет в gh-pub есть только один обязательный аргумет: --repository (-r)

    Запуск:

    npx @sergey.akkuratov/gh-pub -r <url to GitHub repository>

    Демонстрация:

    options

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

    Usage: gh-pub [options]
    
    CLI to publish files to GitHub Pages.
    
    Options:
    -V, --version           output the version number
    -r, --repository <url>  set URL of GitHub Git repository in https://github.com/<your profile>/<your repository>.git
                            format
    -b, --branch <name>     set branch name of repository to deploy (default: "gh-pages")
    -d, --deploy <dir>      set dir with files to deploy (default: "./")
    -e, --exec <command>    exec some comand before deploy
    -s, --silence           switch off info messages (default: false)
    -h, --help              display help for command

Ошибки

При возникновении каких-либо ошибок gh-pub сообщит об этом фразой:

Something went wrong, deploy haven't done:

После неё выведется текст ошибки:

error

В данном случае мы попытались опудликовать файлы, которые уже и так содержатся в GitHub Pages без каких-либо изменений.

Структура проекта

  • github
    • workflows - настройки для GitHub Actions
  • .husky - настройки для подготовки файлов согласно правилам линта перед коммитом
  • images - скриншоты и .gif файлы для файла README.md
  • src - исходный код проекта
    • gh-pub.ts - точка входа в приложения, выбор режима запуска
    • gitApi.ts - запуск git команд для публикации файлов
    • wizard.ts - реализации системы вопрос-ответ для настройки запуска