@takeshape/shape-tools v1.0.0
@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-devRequirements
This package expects the following variables to be defined in the environment:
SHAPE_API_URLORNEXT_PUBLIC_TAKESHAPE_API_URL- An API URL for your TakeShape project.SHAPE_API_KEYORTAKESHAPE_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,errorSHAPE_DEFAULT_BRANCH- Set an alternate default branch name. Otherwisemasterandmainwill both be checked.SHAPE_GITHUB_TOKENORGITHUB_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 urlNO_PROMPT_CREATE_BRANCH- Create an API branch, without prompting when the gitpost-checkouthook fires. By default this is'false'.NO_PROMPT_PROMOTE_BRANCH- Promote an API branch, without prompting when the gitpost-mergehook 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 URLshape post-checkout-hook- Run the gitpost-checkouthook branch creation promptshape post-merge-hook- Run the gitpost-mergehook branch promote promptshape create-branch- Create a branch using--nameor repo lookupshape delete-branch- Delete a branch using--nameor repo lookupshape promote-branch- Promote a branch using--name, repo lookup, or the--lookup-prflag which will search GitHub for a PR that matches the sha. Also supports--lookup-prwhich will attempt to find a branch from a merged PR on GitHub, and--nofailwhich will ensure a clean exit code.shape prepare-env- Prepare various.envfiles using-examplesource files in the repo.
Some functions are also exported:
setProcessBranchUrl- Set a var onprocess.envwith the branch URL. Defaults toNEXT_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.
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago