imdone-cli 0.1.7 → 0.2.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imdone-cli",
3
- "version": "0.1.7",
3
+ "version": "0.2.1",
4
4
  "author": "Jesse Piascik",
5
5
  "description": "An imdone cli that automates your jira updates with markdown files.",
6
6
  "license": "Proprietary",
@@ -13,6 +13,12 @@
13
13
  "imdone": "dist/index.min.cjs",
14
14
  "imdone-debug": "dist/index.cjs"
15
15
  },
16
+ "files": [
17
+ "dist",
18
+ "docs",
19
+ "LICENSE",
20
+ "README.md"
21
+ ],
16
22
  "scripts": {
17
23
  "prepublishOnly": "npm --prefix ../ install && npm --prefix ../ run build && npm i && npm test && npm run build",
18
24
  "link": "npm link ../../imdone-core-2 ../../imdone-api",
package/.env DELETED
@@ -1,6 +0,0 @@
1
-
2
- # Jira environment variables
3
-
4
- # JIRA_AUTH_BASIC=true # Set to false to use Bearer token auth.
5
- # JIRA_USERNAME="<your jira username>" # e.g. your email address. Not needed if using Bearer token auth.
6
- # JIRA_TOKEN="<your personal access token>"
@@ -1,18 +0,0 @@
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
- }
@@ -1,6 +0,0 @@
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,80 +0,0 @@
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
@@ -1,116 +0,0 @@
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
- }
@@ -1,12 +0,0 @@
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
- }
package/.imdone/style.css DELETED
File without changes
package/.imdone/tags.yml DELETED
@@ -1,8 +0,0 @@
1
- tags:
2
- - 0.2.0
3
- - devex
4
- - feature
5
- - premium
6
- - release-0.1.1
7
- - test
8
- - urgent
@@ -1,21 +0,0 @@
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 DELETED
@@ -1,3 +0,0 @@
1
- .obsidian
2
- .trash
3
- .imdone/plugins