Skip to content

Commit

Permalink
feat: key is now optional field
Browse files Browse the repository at this point in the history
when not provided, will use a more general regex that looks for
2-4 letters followed by a dash and a number

  ([A-Za-z]{2,4}-[0-9]+)
  • Loading branch information
mcgrathg committed Apr 13, 2023
1 parent 56dee38 commit 2acddae
Show file tree
Hide file tree
Showing 14 changed files with 6,155 additions and 6,307 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,6 @@ dist/

# Generated documentation
docs/

.DS_Store
.vscode
9 changes: 9 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.babelrc
.editorconfig
.esdoc.json
.travis.yml
yarn.lock
node_modules/
src/
types/*
!types/index.d.ts
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at macklinu@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at dev@mcgrathg.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

Expand Down
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Development

Install [Yarn](https://yarnpkg.com/en/), and install the dependencies - `yarn install`.

Run the [Jest](https://facebook.github.io/jest/) test suite with `yarn test`.

This project uses [semantic-release](https://github.com/semantic-release/semantic-release) for automated NPM package publishing.

The main caveat: instead of running `git commit`, run `yarn commit` and follow the prompts to input a conventional changelog message via [commitizen](https://github.com/commitizen/cz-cli).

:heart:
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2017 Macklin Underdown
Copyright 2023 Greg McGrath

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
68 changes: 11 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,31 @@
# danger-plugin-jira-issue
# danger-plugin-jira-integration

[![Build Status](https://travis-ci.org/macklinu/danger-plugin-jira-issue.svg?branch=master)](https://travis-ci.org/macklinu/danger-plugin-jira-issue)
[![npm version](https://badge.fury.io/js/danger-plugin-jira-issue.svg)](https://badge.fury.io/js/danger-plugin-jira-issue)
[![Build Status](https://travis-ci.org/mcgrathg/danger-plugin-jira-integration.svg?branch=master)](https://travis-ci.org/mcgrathg/danger-plugin-jira-integration)
[![npm version](https://badge.fury.io/js/danger-plugin-jira-integration.svg)](https://badge.fury.io/js/danger-plugin-jira-integration)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

> [Danger](https://github.com/danger/danger-js) plugin to link JIRA issue in pull request
> [Danger](https://github.com/danger/danger-js) plugin to integrate your pull request with JIRA
## Usage

Install:

```sh
yarn add danger-plugin-jira-issue --dev
yarn add danger-plugin-jira-integration --dev
```

At a glance:

```js
// dangerfile.js
import jiraIssue from "danger-plugin-jira-issue";
import jiraIntegration from 'danger-plugin-jira-integration'

jiraIssue({
key: "JIRA",
url: "https://myjira.atlassian.net/browse",
emoji: ":paperclip:",
format(emoji, jiraUrls) {
// Optional Formatter
return "Some Custom Message";
},
location: "title" // Optional location, either 'title' or 'branch'
});
jiraIntegration()
```

With JIRA-123 in the PR title, Danger will comment with:

<table>
<thead>
<tr>
<th width="50"></th>
<th width="100%" data-danger-table="true">Messages</th>
</tr>
</thead>
<tbody><tr>
<td>:book:</td>
<td>:paperclip: <a href="https://myjira.atlassian.net/browse/JIRA-123">JIRA-123</a></td>
</tr>
</tbody>
</table>

<p align="right">
Generated by :no_entry_sign: <a href="http://github.com/danger/danger-js/">dangerJS</a>
</p>

If you work with multiple JIRA project boards, you can supply multiple project keys:

```js
jiraIssue({
key: ["ABC", "DEF"],
url: "https://myjira.atlassian.net/browse"
});
```

This plugin will recognize issues starting with those keys (e.g. `ABC-123` and `DEF-234`).

## Changelog

See the GitHub [release history](https://github.com/macklinu/danger-plugin-jira-issue/releases).

## Development

Install [Yarn](https://yarnpkg.com/en/), and install the dependencies - `yarn install`.

Run the [Jest](https://facebook.github.io/jest/) test suite with `yarn test`.
See the GitHub [release history](https://github.com/mcgrathg/danger-plugin-jira-integration/releases).

This project uses [semantic-release](https://github.com/semantic-release/semantic-release) for automated NPM package publishing.
## Contributing

:heart:
See [CONTRIBUTING.md](CONTRIBUTING.md).
114 changes: 64 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,74 +1,88 @@
{
"name": "danger-plugin-jira-issue",
"version": "0.0.0-development",
"description": "Danger plugin to link JIRA issue in pull request",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"precommit": "lint-staged",
"commitmsg": "validate-commit-msg",
"build": "tsc -p tsconfig.json",
"lint": "tslint 'src/**/*.ts'",
"test": "jest --env=node",
"prepublishOnly": "npm run build",
"semantic-release": "semantic-release",
"travis-deploy-once": "travis-deploy-once"
"name": "danger-plugin-jira-integration",
"description": "Danger plugin to integrate your pull request with JIRA",
"author": {
"name": "Greg McGrath",
"email": "dev@mcgrathg.com"
},
"repository": {
"type": "git",
"url": "https://github.com/macklinu/danger-plugin-jira-issue.git"
"url": "https://github.com/mcgrathg/danger-plugin-jira-integration.git"
},
"bugs": {
"url": "https://github.com/mcgrathg/danger-plugin-jira-integration/issues"
},
"homepage": "https://github.com/mcgrathg/danger-plugin-jira-integration#readme",
"keywords": [
"danger",
"danger-plugin",
"jira"
],
"author": "Macklin Underdown <macklinu@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/macklinu/danger-plugin-jira-issue/issues"
"version": "0.0.0-development",
"main": "dist/index.js",
"types": "types/index.d.ts",
"scripts": {
"precommit": "lint-staged",
"commit": "git-cz",
"commitmsg": "validate-commit-msg",
"build": "tsc",
"test": "jest",
"predocs": "rm -rf docs/",
"docs": "esdoc -c .esdoc.json",
"prepublish": "npm run build",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"prettier": "prettier",
"prettier-write": "npm run prettier -- --parser typescript --no-semi --trailing-comma es5 --write --print-width 120",
"prettier-project": "npm run prettier-write -- 'src/**/*.{ts,tsx}'",
"lint": "tslint \"src/**/*.ts\""
},
"homepage": "https://github.com/macklinu/danger-plugin-jira-issue#readme",
"license": "MIT",
"engines": {
"node": ">= 4.0.0"
"node": ">=4.0.0"
},
"devDependencies": {
"@types/jest": "^21.1.4",
"@types/node": "^8.0.6",
"husky": "^0.14.1",
"jest": "^21.2.1",
"lint-staged": "^4.0.0",
"prettier": "^1.14.3",
"semantic-release": "^15.9.17",
"travis-deploy-once": "^5.0.9",
"ts-jest": "^21.1.3",
"tslint": "^5.11.0",
"tslint-config-macklinu": "^1.0.0",
"typescript": "^3.1.1",
"validate-commit-msg": "^2.12.1"
"ts-jest": "^29.1.0",
"@types/jest": "^29.5.0",
"tslint": "^6.1.3",
"danger": "*",
"commitizen": "^2.9.6",
"cz-conventional-changelog": "^2.0.0",
"husky": "^8.0.3",
"jest": "^29.5.0",
"lint-staged": "^13.2.1",
"prettier": "^2.8.7",
"semantic-release": "^21.0.1",
"typescript": "^5.0.4",
"validate-commit-msg": "^2.14.0"
},
"optionalDependencies": {
"esdoc": "^1.1.0"
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"lint-staged": {
"*.@(ts|tsx)": [
"tslint --fix",
"npm run prettier-write --",
"git add"
]
},
"jest": {
"transform": {
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
"moduleFileExtensions": [
"ts",
"tsx",
"js"
]
},
"lint-staged": {
"*.ts": [
"tslint --fix",
"git add"
],
"*.json": [
"prettier --write",
"git add"
"transform": {
".(ts|tsx)": "ts-jest"
},
"testRegex": "(.test)\\.(ts|tsx)$",
"testPathIgnorePatterns": [
"\\.snap$",
"<rootDir>/node_modules/"
]
}
}
3 changes: 0 additions & 3 deletions src/ambient.d.ts

This file was deleted.

Loading

0 comments on commit 2acddae

Please sign in to comment.