imdone-core 2.0.20 → 2.0.22
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/CHANGELOG.md +3 -0
- package/lib/adapters/storage/config.js +1 -1
- package/lib/adapters/storage/tags.js +1 -1
- package/lib/card.js +1 -1
- package/lib/config.js +15 -0
- package/lib/file.js +1 -1
- package/lib/mixins/repo-watched-fs-store.js +1 -1
- package/lib/project.js +4 -4
- package/lib/repository.js +2 -2
- package/package.json +1 -1
- package/types/config.d.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -33,7 +33,7 @@ export async function loadYamlConfig(filePath) {
|
|
|
33
33
|
if (configLike.watcher) delete configLike.watcher
|
|
34
34
|
|
|
35
35
|
} catch (e) {
|
|
36
|
-
logger.
|
|
36
|
+
logger.warn(`Error parsing config file: ${filePath}`)
|
|
37
37
|
}
|
|
38
38
|
return configLike
|
|
39
39
|
}
|
package/lib/card.js
CHANGED
package/lib/config.js
CHANGED
|
@@ -251,6 +251,10 @@ export class Config {
|
|
|
251
251
|
return this?.cards?.archiveCompleted ?? false
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
+
set archiveCompleted(archive) {
|
|
255
|
+
this.settings.cards.archiveCompleted = archive
|
|
256
|
+
}
|
|
257
|
+
|
|
254
258
|
get tokenPrefix() {
|
|
255
259
|
return this?.cards?.tokenPrefix ?? '#'
|
|
256
260
|
}
|
|
@@ -259,6 +263,17 @@ export class Config {
|
|
|
259
263
|
return this.getDoneList()
|
|
260
264
|
}
|
|
261
265
|
|
|
266
|
+
get metaSep() {
|
|
267
|
+
return this?.cards?.metaSep ?? COLON
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
set metaSep(value) {
|
|
271
|
+
if (!META_SEPS.includes(value)) {
|
|
272
|
+
throw new Error(`Invalid meta separator: ${value}`)
|
|
273
|
+
}
|
|
274
|
+
this.settings.cards.metaSep = value
|
|
275
|
+
}
|
|
276
|
+
|
|
262
277
|
getMetaSep() {
|
|
263
278
|
const metaSep = this?.cards?.metaSep ?? COLON
|
|
264
279
|
return META_SEPS.includes(metaSep) ? metaSep : COLON
|
package/lib/file.js
CHANGED
|
@@ -1339,7 +1339,7 @@ export class File extends Emitter {
|
|
|
1339
1339
|
return data
|
|
1340
1340
|
}
|
|
1341
1341
|
} catch (err) {
|
|
1342
|
-
logger.
|
|
1342
|
+
logger.warn(`Error processing front-matter in:${this.path}`, err)
|
|
1343
1343
|
}
|
|
1344
1344
|
return {}
|
|
1345
1345
|
}
|
|
@@ -190,7 +190,7 @@ export function watchedFileSystemStoreMixin(repo, fs = realFs) {
|
|
|
190
190
|
}
|
|
191
191
|
log('Reading file: ' + path)
|
|
192
192
|
file = await repo.readFile(file)
|
|
193
|
-
repo.
|
|
193
|
+
repo.emit('watch.add', file)
|
|
194
194
|
repo.emitFileUpdate(file)
|
|
195
195
|
})
|
|
196
196
|
.on('change', async function (path, stat) {
|
package/lib/project.js
CHANGED
|
@@ -28,7 +28,7 @@ function calculateTotals(lists = []) {
|
|
|
28
28
|
try {
|
|
29
29
|
totals[list.name] = list.tasks.length
|
|
30
30
|
} catch (e) {
|
|
31
|
-
logger.
|
|
31
|
+
logger.warn('Error calculating list totals:', e)
|
|
32
32
|
}
|
|
33
33
|
})
|
|
34
34
|
return totals
|
|
@@ -172,7 +172,7 @@ export class WorkerProject extends Project {
|
|
|
172
172
|
logger.log('Error on starting dev mode', err)
|
|
173
173
|
throw new Error('Error on starting dev mode', { cause: err })
|
|
174
174
|
}
|
|
175
|
-
|
|
175
|
+
await this.toImdoneJSON()
|
|
176
176
|
return files
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -810,7 +810,7 @@ export class WorkerProject extends Project {
|
|
|
810
810
|
const func = new Function(`return ${actionFunction}`)()
|
|
811
811
|
func.apply(actionThis)
|
|
812
812
|
} catch (e) {
|
|
813
|
-
logger.
|
|
813
|
+
logger.warn(e)
|
|
814
814
|
logger.log('action:', actionFunction)
|
|
815
815
|
logger.log('this:', actionThis)
|
|
816
816
|
}
|
|
@@ -851,7 +851,7 @@ export class WorkerProject extends Project {
|
|
|
851
851
|
try {
|
|
852
852
|
actionFunction.apply(actionThis)
|
|
853
853
|
} catch (err) {
|
|
854
|
-
logger.
|
|
854
|
+
logger.warn(err)
|
|
855
855
|
logger.log('action:', actionFunction)
|
|
856
856
|
logger.log('this:', actionThis)
|
|
857
857
|
}
|
package/lib/repository.js
CHANGED
|
@@ -641,7 +641,7 @@ export class Repository extends Emitter {
|
|
|
641
641
|
include = File.isMarkdown(relPath)
|
|
642
642
|
}
|
|
643
643
|
} catch (e) {
|
|
644
|
-
logger.
|
|
644
|
+
logger.warn(
|
|
645
645
|
`Failed to check ignore status for dir: [${relPath}] in: [${this.path}]. It will be included.`,
|
|
646
646
|
e
|
|
647
647
|
)
|
|
@@ -1328,7 +1328,7 @@ export class Repository extends Emitter {
|
|
|
1328
1328
|
try {
|
|
1329
1329
|
beforeModifyContent = file.getContent()
|
|
1330
1330
|
} catch (e) {
|
|
1331
|
-
logger.
|
|
1331
|
+
logger.warn(`Can't get file for task: {text:'${task.text}', path:'${task.source.path}', line:${task.line}}`)
|
|
1332
1332
|
throw e
|
|
1333
1333
|
}
|
|
1334
1334
|
|
package/package.json
CHANGED
package/types/config.d.ts
CHANGED
|
@@ -58,8 +58,11 @@ export class Config {
|
|
|
58
58
|
get orderMeta(): any;
|
|
59
59
|
get maxLines(): any;
|
|
60
60
|
get archiveFolder(): any;
|
|
61
|
+
set archiveCompleted(archive: any);
|
|
61
62
|
get archiveCompleted(): any;
|
|
62
63
|
get tokenPrefix(): any;
|
|
63
64
|
get doneList(): any;
|
|
65
|
+
set metaSep(value: any);
|
|
66
|
+
get metaSep(): any;
|
|
64
67
|
getMetaSep(): any;
|
|
65
68
|
}
|