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

github-harmonizer

v1.3.7

Published

Align repository settings, branch protection rules and repository collaborators across all your repositories.

Downloads

20

Readme

Align repository settings, branch protection rules and repository collaborators across all your repositories.

Prerequisites

  • you should have a Node.js installed on your machine;

    Tip: you may install NVM instead, as it gives you the ability to easily switch between the Node versions.

  • your GitHub personal access token;

    Note: you need to have it because Harmonizer is communicating with the GitHub REST API to perform the changes.

Installation

Install via cloning the repository

This is a preferred way, as you would be able to adjust the Harmonizer settings as per your needs in the .harmonizerrc.json file which is the part of this repo.

  • clone the repository;
  • from the root of the repo run:
    npm run setup
    It will install the package globally on your machine, so you would be able to call the harmonize command from any working directory;
  • set up your Harmonizer rules in the .harmonizerrc.json file;

Install via NPM package

You might want to use this way, if you want to use Harmonizer within your CI/CD pipeline and you don't want to clone the repo. This way you would have to create a .harmonizerrc.json configuration file in the working directory where the harmonize command will be called, otherwise the default .harmonizerrc.json configuration will be used.

The package is called github-harmonizer. You may find it on NPM.

  • install the Harmonizer globally on your machine:
    npm i -g github-harmonizer
  • in your working directory create a .harmonizerrc.json or .harmonizerrc.yaml file and set your Harmonizer rules, otherwise the default .harmonizerrc.json configuration will be used;

Usage

Run the following command and follow the instructions:

harmonize

You can also pass --auth=<github_personal_access_token> and --repo=<owner_name/repo_name> argument values along with harmonize if you want to omit them to be prompted by the Harmonizer CLI. You may also pass a --fetchRemoteConfig flag if you want the .harmonizerrc.json config file to be fetched from the root of the repo which you are harmonizing.

How Harmonizer works?

Harmonizer checks if the working directory, from where the harmonize command was called, has Harmonizer configuration file, it validates this configuration and prompts you for an access token and a repo name which you want to harmonize and applies that configuration to the repo. If the config file was not found, it picks the default one, which is .harmonizerrc.json.

Harmonizer uses a JSON Schema declared in the config.schema.json file. It provides a clear human- and machine- readable documentation for the Harmonizer. It is also used in order to annotate and validate its configuration. It also provides code suggestions and annotations within your IDE if you are using VS Code.

If you prefer to have your configuration in YAML, feel free to replace your .harmonizerrc.json config with a .harmonizerrc.yaml and hold your configuration there instead. The JSON Schema benefits above would also be working for you.

What Harmonizer does?

Harmonizer aligns these repository settings:

  • controls visibility of wiki, projects and issues tabs;
  • controls visibility of squash merge, merge commits and rebase merge buttons in the pull requests;
  • controls the automated delete branch on merge option;

Harmonizer manages repository collaborators:

  • adds teams and users to the repo as collaborators;
  • grants permissions to the collaborators or updates them;

Harmonizer sets protection rules for the default branch of the repository:

  • sets the amount of required PR approvals before merge;
  • controls whether to dismiss the stale pull request approvals when new commits are pushed or not;
  • controls whether to require review from Code Owners or not;
  • controls whether to require branches to be up to date before merging or not;
  • controls whether to disallow users with push access to delete the default branch or not;
  • controls whether to enable merge commits from being pushed to the default branch or not;
  • controls whether to enforce all configured restrictions above for administrators or not;
  • controls whether to disallow force pushes for all users with push access or not;
  • controls whether to disallow users with push access to delete the default branch or not;

Continuous Deployment

There is a github action that publishes the package to NPM on merge to main, so whenever you are pushing changes to this repo, make sure you bump up the version of the package via the "version" property in the package.json and package-lock.json according to the Semantic Versioning Specification.

TODO

  • cover functionality with tests;