0.1.12 • Published 4 years ago

@farmisen/branch-name v0.1.12

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

branch-name

A cli tool to generate well formatted pr names from your favorite issue trackers. So far Jira, Clubhouse and Gitlab are supported.

Installation

$ yarn global add @farmisen/branch-name

Usage

branch-name [options]

  Options:

    -p, --project  project defined in the config file
    -i, --id       issue identifier
    -c, --config   Config file location (default to $HOME/.branch-name)
    -h, --help     Output usage information
    -d, --doc      Output full documentation

Examples

~/P/f/branch-name > branch-name --project coffee-bot --id 17382 
farmisen/ch17382/fix-filter-cleanup-cron-table

~/P/f/branch-name > branch-name --project simu --id SIMU-1659
SIMU-1659_performance_remove_unused_filters

~/P/f/branch-name > --project clemet --id 80
clem_80-retire_the_log_drawer


~/P/f/branch-name > cat ~/.branch-name                                               
var config = {
    projects: [
        {
            slug: "coffee-bot",
            server: "clubhouse",
            serverConfig: {
                token: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            },
            
            formatter: (id, title) => `farmisen/ch${id}/${title}`
        },
        {
            slug: "simu",
            server: "jira",
            serverConfig: {
                host: "xxxxxxxxxxxx.atlassian.net",
                username: "xxxxxxx@xxxxxxxxxx.xxx",
                token: "xxxxxxxxxxxxxxxxxxxxxxxx",
            },
            formatter: (id, title) => `${id}_${title}`,
            separator: "_"
        },
        {
            slug: "clemet",
            server: "gitlab",
            serverConfig: {
                host: "xxxxxxxxxxxx.xxxxxxxxx.xxx",
                token: "xxxxxxxxxxxxxxxxxxxxxxxx",
                projectId: 5,
            },
            formatter: (id, title) => `clem_${id}-${title}`,
            separator: "_"
        }
    ]
};
exports.default=config

Documentation

Config file

The config file is a javascript file exporting a config object as default export:

var config = {...}
exports.default = config;

Config object fields

nametypeinfo
projectslist(project)list of project objects

Project object fields

nametypeinfo
slugstringproject slug used with the --project option
server"clubhouse" | "jira | gitlab"type of issues tracking server
serverConfigobjectserver config object
formatter(id:string, title:string) => stringan optional branch name formatter
sanitizer(title:string) => stringan optional issue name sanitizer
separatorstringan optional word separator (default to "-")

Server config object fields

Jira:
nametypeinfo
hosturljira server host
usernamestringjira username
tokenstringjira personal auth token
Clubhouse:
nametypeinfo
tokenstringclubhouse personal auth token
Gitlab:
nametypeinfo
hosturlgitlab server host
tokenstringgitlab personal auth token

Publishing

$ yarn clean
$ yarn build
$ npx webpack
$ npm publish --access public 

Copyright & License

Copyright (c) 2020 Fabrice Armisen.

Distributed under the MIT License (see LICENSE).

0.1.11

4 years ago

0.1.12

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.4

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago