Skip to content

Instantly share code, notes, and snippets.

@Falieson
Created June 9, 2018 01:56
Show Gist options
  • Save Falieson/fb65627948e3e64d2e4c94b5a09b047f to your computer and use it in GitHub Desktop.
Save Falieson/fb65627948e3e64d2e4c94b5a09b047f to your computer and use it in GitHub Desktop.
S2. F05. standard-version (ARTICLE: JS/TS-Module Utilities (Part 2/4))
// package-scripts.js, partial
const git = {
tags: {
push: 'git push --follow-tags origin master',
deleteAllLocally: "git tag -d `git tag | grep -E '.'`",
}
}
const release = {
test: 'standard-version --dry-run',
noverify: 'standard-version --no-verify',
init: 'standard-version --first-release', // 1.0.0
default: 'standard-version', // 1.0.1
pre: 'standard-version --prerelease', // 1.0.1-0
alpha: 'standard-version --prerelease alpha', // 1.0.1-alpha.0
beta: 'standard-version --prerelease beta', // 1.0.1-beta.0
patch: 'standard-version --release-as patch', // 1.0.2
minor: 'standard-version --release-as minor', // 1.1.0
major: 'standard-version --release-as major', // 2.0.0
}
const publish = {
default: series.nps('publish.npm', 'publish.git'),
npm: 'npm publish --tag next',
git: git.tags.push,
}
const scripts = {
build,
commit,
default: start.default,
git,
publish,
release,
scrub,
start,
test: 'echo "Error: no test specified" && exit 1',
}
const shortcuts = {
p: {
default: 'nps build start.build',
description: 'Build the code and run the build.',
},
// FIXME: w/ a prompt. We don't want to run this accidentally!
// https://stackoverflow.com/q/50770212/604950
// r: {
// default: 'nps build release publish',
// description: 'Build the code, bump the version, and update git/npm.',
// },
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment