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

heracudo

v1.2.3

Published

Heracudo - Heroku Review Apps Custom Domain

Downloads

24

Readme

Heracudo

Heroku review applications custom domain hooks.

Special heroku review application hooks which make usage of fancy custom review application domain possible.

Heroku Review Apps + Cloudflare + Github Pull Requests

Installation

  1. npm i heracudo --save Must be installed in dependencies, not devDependencies, in order not to be pruned after Heroku installation process.

  2. Edit your app.json:

      {
        "scripts": {
          "postdeploy": "hrcd-postdeploy",
          "pr-predestroy": "hrcd-predestroy"
        }
      }

    2.1 Optionally edit your package.json. Used to mark links as pending or ready when Heroku review application is rebuilding after Github pull request receives new commits. Add this hooks in scripts which works best for you, when application started rebuilding, and before starting the application.

      {
        "scripts": {
          "postinstall": "hrcd-markpending",
          "postbuild": "hrcd-markready"
        }
      }
  3. Add environment variables for Heroku review applications. Either in pipeline settings, or app.json:

    Required:

    • HOSTNAME | HRCD_HOSTNAME Comma separated hostname list which are used as a base for review application domain variations.
      • Review application domain for domain.tld will be {number}.domain.tld
      • Review application domain for subdomain.domain.tld will be {number}-subdomain.domain.tld
    • HEROKU_TOKEN | HRCD_HEROKU_TOKEN Heroku API access token.
    • CLOUDFLARE_ZONE_ID | HRCD_CLOUDFLARE_ZONE_ID Cloudflare domain zone ID.
    • CLOUDFLARE_TOKEN | HRCD_CLOUDFLARE_TOKEN Cloudflare API access token.
    • GITHUB_TOKEN | HRCD_GITHUB_TOKEN Github API access token.
    • GITHUB_REPOSITORY | HRCD_GITHUB_REPOSITORY Github repository name in format username/repository_name.

    Optional:

    • HRCD_GITHUB_LINK_MARKER A string which will be added before of review app link in Github pull request description. Defaults to ## Preview:
    • HRCD_GITHUB_LINK_PENDING A string which will be added after of review app link in Github pull request description when application is building. Defaults to
    • HRCD_GITHUB_LINK_READY A string which is added in front of review app link in Github pull request description when application is ready. Defaults to 🚀

Hooks

  • hrcd-postdeploy Triggered only once when review application is created. Adds domain to Heroku review application, creates respective CNAME in Cloudflare, adds newly created Review application link on top of Github pull request description.
  • hrcd-markpending (Optional) Triggered every time (whenever defined in npm scripts) to mark Heroku review application link in Github pull request description as "pending"
  • hrcd-markready (Optional) Triggered every time (whenever defined in npm scripts) to mark Heroku review application link in Github pull request description as "ready"
  • hrcd-predestroy Triggered only once when review application is going to be destroyed. Removes domains from Heroku review application, deletes CNAMEs in Cloudflare, removes Review application link on top of Github pull request description.