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

@takeshape/shape-tools

v1.0.0

Published

Tools primarily for working with Next.js based projects in build and CI environments using Vercel, Netlify and GitHub. Supports [penny](https://github.com/takeshape/penny).

Downloads

55

Readme

@takeshape/shape-tools

Tools primarily for working with Next.js based projects in build and CI environments using Vercel, Netlify and GitHub. Supports penny.

If you're looking for the full-featured TakeShape CLI, this isn't it! Head over here or run npm install @takeshape/cli

Installation

You should use this package installed in a project and then aliased via npm scripts, or in CI, but it's not intended for global use. You may run into issues if you do.

$ npm install @takeshape/shape-tools --save-dev

Requirements

This package expects the following variables to be defined in the environment:

  • SHAPE_API_URL OR NEXT_PUBLIC_TAKESHAPE_API_URL - An API URL for your TakeShape project.
  • SHAPE_API_KEY OR TAKESHAPE_API_KEY - A TakeShape API key that can read and write branches. Note, this should be private and not exposed to your users or saved in your repo.

Optional environment variables

  • SHAPE_LOG_LEVEL - info, debug, error
  • SHAPE_DEFAULT_BRANCH - Set an alternate default branch name. Otherwise master and main will both be checked.
  • SHAPE_GITHUB_TOKEN OR GITHUB_TOKEN - Provide a GitHub personal access token for accessing PR information from the GitHub API. Requires access to the repo you're working with and permissions sufficient to list PR issues.
  • SHAPE_ADMIN_URL - Provide an alternate admin url
  • NO_PROMPT_CREATE_BRANCH - Create an API branch, without prompting when the git post-checkout hook fires. By default this is 'false'.
  • NO_PROMPT_PROMOTE_BRANCH - Promote an API branch, without prompting when the git post-merge hook fires. By default this is 'false'.
  • NO_TTY_SHOULD_CREATE_BRANCH - A flag setting the create branch behavior in non-TTY environments, like the VSCode git tools. By default this is 'true'.
  • NO_TTY_SHOULD_PROMOTE_BRANCH - A flag setting the merge branch behavior in non-TTY environments. By default this is 'true'.

Usage

You can use the shape binary with the following commands:

  • shape get-branch-url - Get an API branch URL
  • shape post-checkout-hook - Run the git post-checkout hook branch creation prompt
  • shape post-merge-hook - Run the git post-merge hook branch promote prompt
  • shape create-branch - Create a branch using --name or repo lookup
  • shape delete-branch - Delete a branch using --name or repo lookup
  • shape promote-branch - Promote a branch using --name, repo lookup, or the --lookup-pr flag which will search GitHub for a PR that matches the sha. Also supports --lookup-pr which will attempt to find a branch from a merged PR on GitHub, and --nofail which will ensure a clean exit code.
  • shape prepare-env - Prepare various .env files using -example source files in the repo.

Some functions are also exported:

  • setProcessBranchUrl - Set a var on process.env with the branch URL. Defaults to NEXT_PUBLIC_BRANCH_TAKESHAPE_API_URL.

Releases

Run npm run release to tag the release. The release will be published when you publish the draft release on GitHub.