imdone-cli 0.1.5 → 0.1.7

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.
@@ -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,6 @@
1
+ // This module must export a function that returns an array of CardActions
2
+ // https://imdone.github.io/imdone-api/classes/plugin.Plugin.html#getcardactions
3
+ module.exports = function (task) {
4
+ const project = this.project
5
+ return []
6
+ }
@@ -1,4 +1,4 @@
1
- keepEmptyPriority: true
1
+ keepEmptyPriority: false
2
2
  code:
3
3
  include_lists:
4
4
  - TODO
@@ -16,69 +16,49 @@ code:
16
16
  lists:
17
17
  - name: NOTE
18
18
  hidden: false
19
- ignore: false
20
- id: 13huexl3bm725378z
19
+ id: jea6vnwm9pxtjls
21
20
  - name: Past Due Reminders
22
21
  hidden: true
23
22
  ignore: false
24
- id: 13huexl3bm7253790
25
23
  filter: 'remind = /./ and remind < "${now}" and list != DONE -remind'
24
+ id: jea6vnwm9pxtjlt
26
25
  - name: What's Due?
27
26
  hidden: true
28
27
  ignore: false
29
- id: 13huexl3bm7253791
30
28
  filter: 'dueDate < "${in 15 days}" AND list != DONE +dueDate +order'
29
+ id: jea6vnwm9pxtjlu
31
30
  - name: TODO
32
31
  hidden: false
33
- ignore: false
34
- id: 13huexl3bm7253792
32
+ id: jea6vnwm9pxtjlv
35
33
  - name: DOING
36
34
  hidden: false
37
- ignore: false
38
- id: 13huexl3bm7253793
35
+ id: jea6vnwm9pxtjlw
39
36
  - name: DONE
40
37
  hidden: false
41
38
  ignore: true
42
- id: 13huexl3bm7253794
39
+ id: jea6vnwm9pxtjlx
43
40
  - name: Recently Completed
44
- hidden: true
45
- ignore: false
46
- id: 13huexl3bm7253795
47
41
  filter: 'completedDate > "${14 days ago}" -completed'
42
+ hidden: false
43
+ id: jea6vnwm9pxtjly
48
44
  settings:
45
+ '0': object Object
49
46
  openIn: code
50
47
  openCodeIn: default
51
48
  journalType: New File
52
- journalPath: current-sprint
49
+ journalPath: backlog
53
50
  appendNewCardsTo: imdone-tasks.md
54
51
  newCardSyntax: HASHTAG
55
52
  replaceSpacesWith: '-'
56
- plugins:
57
- JiraPlugin:
58
- jql: >-
59
- Sprint in openSprints() or status = "In Progress"
60
- issueType: Story
61
- projectKeys:
62
- - key: SCRUM
63
- statuses:
64
- - jira: To Do
65
- list: TODO
66
- - jira: In Progress
67
- list: DOING
68
- - jira: Done
69
- list: DONE
70
- url: 'https://imdoneio.atlassian.net'
71
- defaultList: DOING
72
- defaultDirectory: current-sprint
73
- devMode: false
53
+ plugins: {}
74
54
  journalTemplate: null
75
55
  markdownOnly: false
76
- kudosProbability: 0.33
77
- name: "Test Project"
56
+ kudosProbability: 0.5
57
+ name: cli-package
78
58
  views: []
79
59
  cards:
80
60
  colors: []
81
- template: '${template_user_story}'
61
+ template: '${template_simple}'
82
62
  trackChanges: false
83
63
  metaNewLine: true
84
64
  addCompletedMeta: true
@@ -86,15 +66,15 @@ settings:
86
66
  doingList: DOING
87
67
  doneList: DONE
88
68
  tokenPrefix: '#'
89
- taskPrefix: '#'
69
+ taskPrefix: '##'
90
70
  tagPrefix: '#'
91
71
  metaSep: ':'
92
72
  orderMeta: true
93
- maxLines: 3
73
+ maxLines: 2
94
74
  addNewCardsToTop: true
95
75
  showTagsAndMeta: false
96
- addStartedMeta: false
76
+ addStartedMeta: true
97
77
  defaultList: TODO
78
+ computed: !<tag:yaml.org,2002:js/undefined> ''
98
79
  archiveCompleted: true
99
- archiveFolder: completed-stories
100
- dirty: 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
@@ -0,0 +1,8 @@
1
+ tags:
2
+ - 0.2.0
3
+ - devex
4
+ - feature
5
+ - premium
6
+ - release-0.1.1
7
+ - test
8
+ - urgent
@@ -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
@@ -0,0 +1,3 @@
1
+ .obsidian
2
+ .trash
3
+ .imdone/plugins
package/README.md CHANGED
@@ -1,7 +1,9 @@
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, update them, and push changes back to Jira seamlessly.
4
- This tool is designed to enhance your productivity by providing a simple and efficient way to manage your tasks without leaving your editor or terminal.
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
+ If you're looking for a more visual experience, check out the [Imdone Desktop App](https://imdone.io).
5
7
 
6
8
  ## Installation
7
9
 
@@ -15,6 +17,26 @@ npm install -g imdone-cli
15
17
  - A valid Imdone license
16
18
  - Jira account with API access
17
19
 
20
+ ## Getting Started
21
+
22
+ ### Purchase a license
23
+
24
+ To use Imdone CLI, you need a valid license. You can purchase a license from the [Imdone website](https://imdone.io/imdone-with-jira).
25
+
26
+ ### Install Imdone CLI
27
+
28
+ Use the command above to install the CLI globally.
29
+
30
+ ### Set up your project
31
+
32
+ Navigate to your project directory, create a backlog directory, cd to it and run `imdone init` to set up the integration with Jira.
33
+
34
+ ```bash
35
+ mkdir backlog
36
+ cd backlog
37
+ imdone init
38
+ ```
39
+
18
40
  ## Commands
19
41
 
20
42
  ### Initialize Jira Integration
@@ -82,25 +104,6 @@ imdone license --token eyJhbGciOiJSUzI...
82
104
  imdone license --show
83
105
  ```
84
106
 
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
107
  ## Troubleshooting
105
108
 
106
109
  ### Invalid License
@@ -126,6 +129,6 @@ If you're having trouble connecting to Jira, verify:
126
129
 
127
130
  ## Support
128
131
 
129
- If you encounter any issues or need assistance, please contact support@imdone.io
132
+ If you encounter any issues or need assistance, please visit [imdone.io](https://imdone.io) or contact support@imdone.io
130
133
 
131
134
 
package/dist/.env CHANGED
@@ -4,3 +4,4 @@
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
+ # IMDONE_LICENSE="<your imdone license>"