imdone-core 1.37.0 → 1.38.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/lib/card.js +8 -7
- package/lib/default-settings.js +1 -0
- package/lib/file.js +1 -0
- package/lib/project-factory.js +8 -0
- package/package.json +1 -1
package/lib/card.js
CHANGED
|
@@ -117,6 +117,7 @@ module.exports = function newCard(task, _project, dontParse) {
|
|
|
117
117
|
return {
|
|
118
118
|
..._pick(
|
|
119
119
|
this,
|
|
120
|
+
...['beforeText',
|
|
120
121
|
'rawTask',
|
|
121
122
|
'id',
|
|
122
123
|
'text',
|
|
@@ -141,7 +142,7 @@ module.exports = function newCard(task, _project, dontParse) {
|
|
|
141
142
|
'projectPath',
|
|
142
143
|
'relPath',
|
|
143
144
|
'fullPath',
|
|
144
|
-
'totals'
|
|
145
|
+
'totals'].sort()
|
|
145
146
|
),
|
|
146
147
|
}
|
|
147
148
|
}
|
|
@@ -149,11 +150,11 @@ module.exports = function newCard(task, _project, dontParse) {
|
|
|
149
150
|
initData() {
|
|
150
151
|
const props = { ...this.props, content: CONTENT_TOKEN }
|
|
151
152
|
const computed = { ...this.computed }
|
|
152
|
-
const
|
|
153
|
+
const defaultData = this.defaultData
|
|
153
154
|
try {
|
|
154
155
|
for (let [key, value] of Object.entries(computed)) {
|
|
155
156
|
let computedValue = value.toString()
|
|
156
|
-
const computedProps = { ...props, ...computed, ...
|
|
157
|
+
const computedProps = { ...props, ...computed, ...defaultData }
|
|
157
158
|
if (_isFunction(value) && !_isEmpty(props)) {
|
|
158
159
|
try {
|
|
159
160
|
// Call the computed function for a value
|
|
@@ -182,13 +183,13 @@ module.exports = function newCard(task, _project, dontParse) {
|
|
|
182
183
|
}
|
|
183
184
|
|
|
184
185
|
const pluginData = pluginManager
|
|
185
|
-
? { ...pluginManager.getCardProperties(
|
|
186
|
-
:
|
|
186
|
+
? { ...pluginManager.getCardProperties(defaultData) }
|
|
187
|
+
: {}
|
|
187
188
|
const data = {
|
|
189
|
+
...defaultData,
|
|
188
190
|
...pluginData,
|
|
189
191
|
...props,
|
|
190
|
-
...computed
|
|
191
|
-
...cardData,
|
|
192
|
+
...computed
|
|
192
193
|
}
|
|
193
194
|
|
|
194
195
|
this.data = { ...data }
|
package/lib/default-settings.js
CHANGED
package/lib/file.js
CHANGED
|
@@ -698,6 +698,7 @@ File.prototype.modifyTask = function (task, config, noEmit) {
|
|
|
698
698
|
if (this.getContent().trim() === newContent.trim()) return
|
|
699
699
|
this.setContent(newContent)
|
|
700
700
|
this.setModified(true)
|
|
701
|
+
task.lastLine = task.line + description.length
|
|
701
702
|
if (!noEmit) {
|
|
702
703
|
this.emit('task.modified', task)
|
|
703
704
|
this.emit('file.modified', this)
|
package/lib/project-factory.js
CHANGED
|
@@ -5,8 +5,16 @@ const ProjectContext = require('./ProjectContext')
|
|
|
5
5
|
const Project = require('./project')
|
|
6
6
|
const context = require('./context/ApplicationContext')
|
|
7
7
|
|
|
8
|
+
function createWatchedFSProject({path, config, repo = watchedFsStore(new Repository(path, config))}) {
|
|
9
|
+
context().repo = repo
|
|
10
|
+
context().projectContext = new ProjectContext(repo)
|
|
11
|
+
context().project = new Project(repo)
|
|
12
|
+
return context().project
|
|
13
|
+
}
|
|
14
|
+
|
|
8
15
|
module.exports = {
|
|
9
16
|
createWatchedFileSystemProject: function(path) {
|
|
17
|
+
if (typeof path === 'object' && path.confg) return createWatchedFSProject(path)
|
|
10
18
|
const repo = watchedFsStore(new Repository(path))
|
|
11
19
|
context().repo = repo
|
|
12
20
|
context().projectContext = new ProjectContext(repo)
|