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

better-pr

v2.0.1

Published

Pull Request Templates are great but it sucks to have to go in and replace place holder content in the page UI. This projects goal is to write console command that opens up a new pull request after prompting user to complete some dynamic content.

Downloads

15

Readme

Better PR

npm version

Pull Request Templates are great but it sucks to have to go in and replace place holder content in the page UI.

This project is a CLI command you can use to generate questions to fill dynamic content regions of your pull request template.

Installation

To use install globally with yarn (, npx etc...):

yarn global add better-pr

the just run better-pr in your GitHub based project. better-pr

By default better-pr will fall back to a local pull_request_template.md or .github/pull_request_template.md but you can pass a arguemet to the temmplate file as well for example: better-pr src/TEMPLATE.md

Usage

Better PR uses handlebars templating from within markdown files to create logical dynamic updates to your pull request temmplate files (see documentation for handlebars templating at: handlebarsjs.com)

In your project for example you could have a pull_request_template.md like the following: pull_request_template.md The pull request template can be as intricate as you would like or as basic as a normal pull request template without dynamic fields.

# Pull Request for Your Project!

{{#if animal}}
    {{animal}} will be replaced with your animal everywhere {{animal}} is
{{^}}
    this content is only here if you didnt supply an animmal - whoops
{{/if}}

.better-pr file is necessary to provide context to the dynamic content you would like placed within your template. Using the example pull_request_template.md above your config will look sommething like this:

// options {}
module.exports = { 
    variables: [
        // inquirer driven messages/prompts 
        // for user to answer and fill 
        // variable values in template
        {
            type: 'list',
            name: 'animal',
            message: 'What type of animal is it?',
            choices: [
                { name: 'dog', value: 'dog' },
                { name: 'cat', value: 'cat' },
                { name: 'bird', value: 'bird' }
            ]
        }
    ]
}

Options

variables

Variables are an array of inquirer questions with name labels that will be replaced in your template file. (see documentation from inquirer for advanced formats)

target

Target branch defaults to master but can be oveerriden to development etc.

{
    target: 'development',
    ...
}

labels

  • labels are value objects with a match param that will lookup values in branch name to default check labels

TODO

  • [ ] Plugin system to automatically pull other values (e.g. Jira Tickets based on regex in PR name?)