Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@getyourguide/npm-publish

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@getyourguide/npm-publish

Module to publish npm modules

  • 1.0.2
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

GetYourGuide - npm publish

CLI tool to handle publishing new modules to npm detecting the version type from the commit message, generating the tags and pushing to github.

Features

  • Allow to define increment (patch, minor, major) based on commit message.
  • Allow to create beta versions based on the message.
  • Increate automatically version in package.json creating a tag and push to your repo.
  • Define in which branchs do you want to publish and in which ones to omit it.

Workflow

  • Push commits to a publish branch default: master using any of the wildcards as part of your message [minor] ... [mayor] ... and the library will generate a version for you. If it doesn't detect any wildcard, it will do a patch.
  • Pushing commits to no-publish branches will omit the version generation.
  • If you're in any branch and you would like to generate a beta version, just commit with [beta] ...

Getting Started

npm install --save-dev @getyourguide/npm-publish

Usage with drone

  1. Create a npm script in your package.json
{
  "scripts": {
    "npm-publish": "npm-publish"
  }
}
  1. Add a step in drone to publish your module
publish-package:
  image: node:12-buster
  commands:
    - npm run npm-publish -- -b "${DRONE_BRANCH}" -m '${DRONE_COMMIT_MESSAGE/"/}'

CLI Params

Run with --help to get a full list of params

npm-publish --help

Options:                                   
  --help                                                    
  --branch, -b        branch name                                         [required]
  --message, -m       commit message                                      [required]
  --publish-branches  branches where it should publish   [array] [default: "master"]
  --wildcard-minor    wildcard to identify a minor commit       [default: "[minor]"]
  --wildcard-major    wildcard to identify a major commit       [default: "[major]"]
  --wildcard-beta     wildcard to identify a beta commit         [default: "[beta]"]
  --git-email         git email to create the comit.   [default: "local git config"]
  --git-name          git name to create the commit.   [default: "local git config"]
  --commit-message    commit message. Use %s to specify the version
                                    [default: "[auto-publish] version %s [ci skip]"]

Add config in package.json

You can also specify the params in your package.json. Add a section npm-publish

{
  "npm-publish": {
    "publish-branches": ["master", "develop"],
    "wildcard-minor": "[custom-minor]",
    "wildcard-major": "[custom-major]",
    "...": "..."
  }
}

Keywords

FAQs

Package last updated on 12 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc