imdone-cli 0.1.6 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +2 -0
- package/.imdone/actions/board.js +18 -0
- package/.imdone/actions/card.js +6 -0
- package/.imdone/config.yml +80 -0
- package/.imdone/properties/board.js +116 -0
- package/.imdone/properties/card.js +12 -0
- package/.imdone/style.css +0 -0
- package/.imdone/tags.yml +8 -0
- package/.imdone/templates/user_story.md +21 -0
- package/.imdoneignore +3 -0
- package/README.md +26 -22
- package/dist/.env +1 -0
- package/dist/README.md +61 -0
- package/dist/index.cjs +103064 -0
- package/dist/index.min.cjs +152 -152
- package/dist/index.min.cjs.map +4 -4
- package/docs/images/imdone-with-jira.excalidraw +56585 -0
- package/docs/images/imdone-with-jira.png +0 -0
- package/docs/images/imdone-with-jira.svg +5 -0
- package/package.json +4 -4
package/.env
CHANGED
@@ -4,3 +4,5 @@
|
|
4
4
|
# JIRA_AUTH_BASIC=true # Set to false to use Bearer token auth.
|
5
5
|
# JIRA_USERNAME="<your jira username>" # e.g. your email address. Not needed if using Bearer token auth.
|
6
6
|
# JIRA_TOKEN="<your personal access token>"
|
7
|
+
|
8
|
+
IMDONE_LICENSE="eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiSmVzc2UgUGlhc2NpayIsImVtYWlsIjoiamVzc2VAaW1kb25lLmlvIiwib3JnIjoiSW5ub2J1aWx0IFNvZnR3YXJlLCBMTEMiLCJwbGFuIjoicHJlbWl1bSIsImlhdCI6MTc0NDczNjA1MSwiZXhwIjoxNzQ3MzI4MDUxfQ.QRQ6_qvKAS3oTCVJLYRRzpjThxLI-_Gw7SqeJUYZBE41jPQHDwR0wfGdXsltZ5MUqu0CVizfORt4FStyHBjJAOenQ7TSg32u_F__qADDv32fh-Ja4x1pK7EdUTulDUHq5qskwhrTIBXgGEkD6Gn8YUYD26-CZY-Hp4-kw9edraDJkwANxHhEYdSLtUCgoW9U-ZPBZHvEFQ761ykWl0nqTj75DeoiVIInfNGtQWI8Z29VgXMUavCNoIxJQONPHA_370wgJVdbcnpRKnwJ1HAISLRUSHyXwTNnokOxbN9BKMgvHqLVXqwa_gwu7obpVFp0wjie9i2bE4h5mkAvOEY09A"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
const path = require('path')
|
2
|
+
|
3
|
+
// This module must export a function that returns an array of BoardActions
|
4
|
+
// https://imdone.github.io/imdone-api/classes/plugin.Plugin.html#getboardactions
|
5
|
+
module.exports = function () {
|
6
|
+
const project = this.project
|
7
|
+
return [
|
8
|
+
{
|
9
|
+
title: "Open in vscode", // This is what displays in the main menu
|
10
|
+
keys: ['alt+o'], // This is the keyboard shortcut
|
11
|
+
icon: "code", // This is the font awesome icon that displays in the main menu
|
12
|
+
action (task) {
|
13
|
+
const url = `vscode://file/${path.join(project.path, task.path)}:${task.line}`
|
14
|
+
project.openUrl(url)
|
15
|
+
}
|
16
|
+
}
|
17
|
+
]
|
18
|
+
}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
keepEmptyPriority: false
|
2
|
+
code:
|
3
|
+
include_lists:
|
4
|
+
- TODO
|
5
|
+
- DOING
|
6
|
+
- DONE
|
7
|
+
- PLANNING
|
8
|
+
- FIXME
|
9
|
+
- ARCHIVE
|
10
|
+
- HACK
|
11
|
+
- CHANGED
|
12
|
+
- XXX
|
13
|
+
- IDEA
|
14
|
+
- NOTE
|
15
|
+
- REVIEW
|
16
|
+
lists:
|
17
|
+
- name: NOTE
|
18
|
+
hidden: false
|
19
|
+
id: jea6vnwm9pxtjls
|
20
|
+
- name: Past Due Reminders
|
21
|
+
hidden: true
|
22
|
+
ignore: false
|
23
|
+
filter: 'remind = /./ and remind < "${now}" and list != DONE -remind'
|
24
|
+
id: jea6vnwm9pxtjlt
|
25
|
+
- name: What's Due?
|
26
|
+
hidden: true
|
27
|
+
ignore: false
|
28
|
+
filter: 'dueDate < "${in 15 days}" AND list != DONE +dueDate +order'
|
29
|
+
id: jea6vnwm9pxtjlu
|
30
|
+
- name: TODO
|
31
|
+
hidden: false
|
32
|
+
id: jea6vnwm9pxtjlv
|
33
|
+
- name: DOING
|
34
|
+
hidden: false
|
35
|
+
id: jea6vnwm9pxtjlw
|
36
|
+
- name: DONE
|
37
|
+
hidden: false
|
38
|
+
ignore: true
|
39
|
+
id: jea6vnwm9pxtjlx
|
40
|
+
- name: Recently Completed
|
41
|
+
filter: 'completedDate > "${14 days ago}" -completed'
|
42
|
+
hidden: false
|
43
|
+
id: jea6vnwm9pxtjly
|
44
|
+
settings:
|
45
|
+
'0': object Object
|
46
|
+
openIn: code
|
47
|
+
openCodeIn: default
|
48
|
+
journalType: New File
|
49
|
+
journalPath: backlog
|
50
|
+
appendNewCardsTo: imdone-tasks.md
|
51
|
+
newCardSyntax: HASHTAG
|
52
|
+
replaceSpacesWith: '-'
|
53
|
+
plugins: {}
|
54
|
+
journalTemplate: null
|
55
|
+
markdownOnly: false
|
56
|
+
kudosProbability: 0.5
|
57
|
+
name: cli-package
|
58
|
+
views: []
|
59
|
+
cards:
|
60
|
+
colors: []
|
61
|
+
template: '${template_simple}'
|
62
|
+
trackChanges: false
|
63
|
+
metaNewLine: true
|
64
|
+
addCompletedMeta: true
|
65
|
+
addCheckBoxTasks: false
|
66
|
+
doingList: DOING
|
67
|
+
doneList: DONE
|
68
|
+
tokenPrefix: '#'
|
69
|
+
taskPrefix: '##'
|
70
|
+
tagPrefix: '#'
|
71
|
+
metaSep: ':'
|
72
|
+
orderMeta: true
|
73
|
+
maxLines: 2
|
74
|
+
addNewCardsToTop: true
|
75
|
+
showTagsAndMeta: false
|
76
|
+
addStartedMeta: true
|
77
|
+
defaultList: TODO
|
78
|
+
computed: !<tag:yaml.org,2002:js/undefined> ''
|
79
|
+
archiveCompleted: true
|
80
|
+
archiveFolder: backlog/archive
|
@@ -0,0 +1,116 @@
|
|
1
|
+
const icons = {
|
2
|
+
filter: `<span class="icon is-small fa-xs"><svg aria-hidden="true" focusable="false" data-prefix="fa" data-icon="search" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-search fa-w-16"><path fill="currentColor" d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z" class=""></path></svg></span><span data-v-fd981bec="" class="icon is-small fa-xs"><svg aria-hidden="true" focusable="false" data-prefix="fa" data-icon="chevron-down" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="svg-inline--fa fa-chevron-down fa-w-14"><path fill="currentColor" d="M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z" class=""></path></svg></span>`
|
3
|
+
,openFile: `<span class="icon is-medium"><svg version="1.1" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" class="octicon octicon-link"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></span>`
|
4
|
+
,kebab: `<span class="icon is-medium"><svg version="1.1" width="3" height="16" viewBox="0 0 3 16" aria-hidden="true" class="octicon octicon-kebab-vertical"><path data-v-5bf4cb66="" fill-rule="evenodd" d="M0 2.5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0zm0 5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0zM1.5 14a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"></path></svg></span>`
|
5
|
+
,clone: `<span class="icon copy-button is-medium" style=""><svg aria-hidden="true" focusable="false" data-prefix="fa" data-icon="clone" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-clone fa-w-16 fa-lg"><path fill="currentColor" d="M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z" class=""></path></svg></span>`
|
6
|
+
,editCard: `<span class="icon is-medium"><svg version="1.1" width="14" height="16" viewBox="0 0 14 16" aria-hidden="true" class="octicon octicon-pencil"><path fill-rule="evenodd" d="M0 12v3h3l8-8-3-3-8 8zm3 2H1v-2h1v1h1v1zm10.3-9.3L12 6 9 3l1.3-1.3a.996.996 0 0 1 1.41 0l1.59 1.59c.39.39.39 1.02 0 1.41z"></path></svg></span>`
|
7
|
+
}
|
8
|
+
|
9
|
+
const EMOJI = {
|
10
|
+
BAD: ':rotating_light:',
|
11
|
+
GREAT: ':rocket:',
|
12
|
+
SLEEP: ':sleeping:',
|
13
|
+
GOOD: ':2nd_place_medal:',
|
14
|
+
CHART: '<span style="font-size: 1.5em;">:chart:</span>'
|
15
|
+
}
|
16
|
+
|
17
|
+
// This module must export a function that returns an object with properties that will be used to render the card
|
18
|
+
// https://imdone.github.io/imdone-api/classes/plugin.Plugin.html#getboardproperties
|
19
|
+
module.exports = function () {
|
20
|
+
const project = this.project
|
21
|
+
|
22
|
+
const emoji = {
|
23
|
+
due: dueEmoji(project.totals),
|
24
|
+
recent: recentEmoji(project.totals),
|
25
|
+
wip: wipEmoji(project.totals),
|
26
|
+
chart: EMOJI.CHART
|
27
|
+
}
|
28
|
+
|
29
|
+
// These are the properties that are available to use in your cards
|
30
|
+
// Use ${property_name} to permanently insert the value of the property
|
31
|
+
// Use {{property_name}} to insert the value of the property at runtime
|
32
|
+
return {
|
33
|
+
cardTotal: cardTotal(project.totals),
|
34
|
+
allTopics: project.allTopics, // This is an array of all the topics in the project
|
35
|
+
topicTable: getTopicTable(project), // This is a markdown table with the count of tasks for each topic/list intersection
|
36
|
+
emoji,
|
37
|
+
icons
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
function cardTotal(totals) {
|
42
|
+
let count = 0
|
43
|
+
Object.keys(totals).forEach((list) => {
|
44
|
+
count += totals[list]
|
45
|
+
})
|
46
|
+
return count
|
47
|
+
}
|
48
|
+
|
49
|
+
function formatEmoji(emoji) {
|
50
|
+
return `<span style="font-size: 1.5em;">${emoji}</span>`
|
51
|
+
}
|
52
|
+
|
53
|
+
function dueEmoji(totals) {
|
54
|
+
const due = totals["What's Due?"]
|
55
|
+
let emoji = EMOJI.GOOD
|
56
|
+
if (due >= 3) {
|
57
|
+
emoji = EMOJI.BAD
|
58
|
+
} else if (due === 0) {
|
59
|
+
emoji = EMOJI.GREAT
|
60
|
+
}
|
61
|
+
return formatEmoji(emoji)
|
62
|
+
}
|
63
|
+
|
64
|
+
function recentEmoji(totals) {
|
65
|
+
const recentlyCompleted = totals['Recently Completed']
|
66
|
+
let emoji = EMOJI.GOOD
|
67
|
+
if (recentlyCompleted >= 3) {
|
68
|
+
emoji = EMOJI.GREAT
|
69
|
+
} else if (recentlyCompleted === 0) {
|
70
|
+
emoji = EMOJI.BAD
|
71
|
+
}
|
72
|
+
return formatEmoji(emoji)
|
73
|
+
}
|
74
|
+
|
75
|
+
function wipEmoji(totals) {
|
76
|
+
const doing = totals['DOING']
|
77
|
+
let emoji = EMOJI.GOOD
|
78
|
+
if (doing >= 3) {
|
79
|
+
emoji = EMOJI.BAD
|
80
|
+
} else if (doing === 0) {
|
81
|
+
emoji = EMOJI.SLEEP
|
82
|
+
} else if (doing === 1) {
|
83
|
+
emoji = EMOJI.GREAT
|
84
|
+
}
|
85
|
+
return formatEmoji(emoji)
|
86
|
+
}
|
87
|
+
|
88
|
+
function getTopicTable(project) {
|
89
|
+
const lists = project.allLists.filter(list => !list.filter)
|
90
|
+
const topicTable = project.allTopics.map((topic) => {
|
91
|
+
return {
|
92
|
+
name: topic,
|
93
|
+
lists: [
|
94
|
+
...lists.map((list) => {
|
95
|
+
return {
|
96
|
+
name: list.name,
|
97
|
+
count: list.tasks.filter((task) => task.topics.includes(topic)).length
|
98
|
+
}
|
99
|
+
})
|
100
|
+
]
|
101
|
+
}
|
102
|
+
});
|
103
|
+
|
104
|
+
//convert topic table into a markdown table with topic name on the left and list names on the top and the count for each topic/list intersection
|
105
|
+
const table = `
|
106
|
+
| Topic | ${lists.map((list) => list.name).join(' | ')} |
|
107
|
+
| --- | ${lists.map(() => ' --- ').join(' | ')} |
|
108
|
+
${topicTable.map((topic) => {
|
109
|
+
const topicLink = `imdone://${project.path}?filter=topics="${encodeURIComponent(topic.name)}"`;
|
110
|
+
return `| [[${topic.name}]] | ${topic.lists.map((list) => `[${list.count}](${topicLink})`).join(' | ')} |`;
|
111
|
+
}).join('\n')}
|
112
|
+
`;
|
113
|
+
|
114
|
+
console.log(table);
|
115
|
+
return table
|
116
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
// This module must export a function that returns an object with properties that will be available in your cards
|
2
|
+
// https://imdone.github.io/imdone-api/classes/plugin.Plugin.html#getcardproperties
|
3
|
+
module.exports = function ({ line, source }) {
|
4
|
+
// const project = this.project
|
5
|
+
|
6
|
+
// These are the properties that are available to use in your cards
|
7
|
+
// Use ${property_name} to permanently insert the value of the property
|
8
|
+
// Use {{property_name}} to insert the value of the property at runtime
|
9
|
+
return {
|
10
|
+
sourceLink: `[${source.path}:${line}](./${source.path}:${line})`,
|
11
|
+
}
|
12
|
+
}
|
File without changes
|
package/.imdone/tags.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
## Description
|
3
|
+
|
4
|
+
[Description goes here]
|
5
|
+
|
6
|
+
## Acceptance Criteria
|
7
|
+
|
8
|
+
1. [Acceptance criteria goes here]
|
9
|
+
|
10
|
+
## Tasks
|
11
|
+
|
12
|
+
- [ ] Task 1
|
13
|
+
- [ ] Task 2
|
14
|
+
- [ ] Task 3
|
15
|
+
|
16
|
+
<!--
|
17
|
+
created:${timestamp}
|
18
|
+
due in 2 weeks.
|
19
|
+
remind in 1 day.
|
20
|
+
#user-story
|
21
|
+
-->
|
package/.imdoneignore
ADDED
package/README.md
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
# Imdone CLI
|
2
2
|
|
3
|
-
Imdone CLI is a command-line tool that integrates with Jira to manage your tasks and issues directly from markdown files and your terminal. It allows you to pull issues from Jira,
|
4
|
-
This tool is designed to
|
3
|
+
Imdone CLI is a command-line tool that integrates with Jira to manage your tasks and issues directly from markdown files and your terminal. It allows you to pull issues from Jira, edit them as markdown files, and push changes back to Jira.
|
4
|
+
This tool is designed to serve as a bridge between your local development environment and Jira, making it easier and more efficient to manage tasks without switching contexts.
|
5
|
+
|
6
|
+
## How it works
|
7
|
+

|
5
8
|
|
6
9
|
## Installation
|
7
10
|
|
@@ -15,6 +18,26 @@ npm install -g imdone-cli
|
|
15
18
|
- A valid Imdone license
|
16
19
|
- Jira account with API access
|
17
20
|
|
21
|
+
## Getting Started
|
22
|
+
|
23
|
+
### Purchase a license
|
24
|
+
|
25
|
+
To use Imdone CLI, you need a valid license. You can purchase a license from the [Imdone website](https://imdone.io/imdone-with-jira).
|
26
|
+
|
27
|
+
### Install Imdone CLI
|
28
|
+
|
29
|
+
Use the command above to install the CLI globally.
|
30
|
+
|
31
|
+
### Set up your project
|
32
|
+
|
33
|
+
Navigate to your project directory, create a backlog directory, cd to it and run `imdone init` to set up the integration with Jira.
|
34
|
+
|
35
|
+
```bash
|
36
|
+
mkdir backlog
|
37
|
+
cd backlog
|
38
|
+
imdone init
|
39
|
+
```
|
40
|
+
|
18
41
|
## Commands
|
19
42
|
|
20
43
|
### Initialize Jira Integration
|
@@ -82,25 +105,6 @@ imdone license --token eyJhbGciOiJSUzI...
|
|
82
105
|
imdone license --show
|
83
106
|
```
|
84
107
|
|
85
|
-
## Project Structure
|
86
|
-
|
87
|
-
When initializing a project, Imdone CLI will:
|
88
|
-
|
89
|
-
1. Check if you're in a git repository
|
90
|
-
2. Create or update the .env file for storing credentials
|
91
|
-
3. Add necessary entries to .gitignore
|
92
|
-
4. Set up the Imdone project configuration
|
93
|
-
|
94
|
-
## Environment Variables
|
95
|
-
|
96
|
-
The following environment variables are used by Imdone CLI:
|
97
|
-
|
98
|
-
- `JIRA_USERNAME`: Your Jira username/email
|
99
|
-
- `JIRA_TOKEN`: Your Jira API token
|
100
|
-
- `IMDONE_LICENSE`: Your Imdone license token
|
101
|
-
|
102
|
-
These are typically stored in a `.env` file in your project root.
|
103
|
-
|
104
108
|
## Troubleshooting
|
105
109
|
|
106
110
|
### Invalid License
|
@@ -126,6 +130,6 @@ If you're having trouble connecting to Jira, verify:
|
|
126
130
|
|
127
131
|
## Support
|
128
132
|
|
129
|
-
If you encounter any issues or need assistance, please contact support@imdone.io
|
133
|
+
If you encounter any issues or need assistance, please visit [imdone.io](https://imdone.io) or contact support@imdone.io
|
130
134
|
|
131
135
|
|
package/dist/.env
CHANGED
package/dist/README.md
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
# imdone-jira Backlog
|
2
|
+
|
3
|
+
## Getting started
|
4
|
+
|
5
|
+
### Clone this repo into your project's backlog directory
|
6
|
+
|
7
|
+
From your project root:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
git clone <repository-url> backlog
|
11
|
+
cd backlog
|
12
|
+
```
|
13
|
+
|
14
|
+
### Create your own tracking branch
|
15
|
+
|
16
|
+
Create a branch for your work. This should stay local. (e.g. `your-name-work`)
|
17
|
+
|
18
|
+
```bash
|
19
|
+
git checkout -b <your-branch-name>
|
20
|
+
```
|
21
|
+
|
22
|
+
### Install imdone-cli
|
23
|
+
|
24
|
+
```bash
|
25
|
+
npm install -g imdone-cli
|
26
|
+
```
|
27
|
+
|
28
|
+
### Set up your environment
|
29
|
+
|
30
|
+
Copy the environment template file:
|
31
|
+
|
32
|
+
```bash
|
33
|
+
cp .env.temp .env
|
34
|
+
```
|
35
|
+
|
36
|
+
### Add your Jira credentials to your `.env` file
|
37
|
+
|
38
|
+
**JIRA_USERNAME** is the email on your Jira profile
|
39
|
+
|
40
|
+
**JIRA_TOKEN** Create a Jira personal access token in your Jira account settings
|
41
|
+
|
42
|
+
### Working with Jira and imdone
|
43
|
+
|
44
|
+
Run `imdone pull` from the backlog folder to get the latest content from Jira stories in the current sprint
|
45
|
+
|
46
|
+
Now you can see the current sprint stories in the `backlog/current-sprint` folder
|
47
|
+
|
48
|
+
Workflow for making changes to backlog items:
|
49
|
+
|
50
|
+
1. Run `imdone pull` to get the latest changes from Jira
|
51
|
+
2. Make your story updates in the local files
|
52
|
+
3. Run `imdone push` to push your changes to Jira
|
53
|
+
|
54
|
+
**What happens during push/pull:**
|
55
|
+
|
56
|
+
1. Your local changes are stashed
|
57
|
+
2. Latest changes are pulled from Jira
|
58
|
+
3. Changes are committed to your local branch
|
59
|
+
4. Your stashed changes are applied on top of the latest changes
|
60
|
+
5. Your updates are pushed to Jira
|
61
|
+
6. All changes are committed to your local branch
|