imdone-core 2.0.16 → 2.0.17
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/project.js +5 -5
- package/package.json +1 -1
- package/types/project.d.ts +3 -3
- package/.env +0 -6
package/lib/project.js
CHANGED
|
@@ -528,7 +528,7 @@ export class WorkerProject extends Project {
|
|
|
528
528
|
|
|
529
529
|
const { isFile, isDirectory } = await fileGateway.preparePathForWriting(path)
|
|
530
530
|
|
|
531
|
-
if (!template) template = this.getNewCardTemplate(path, isFile)
|
|
531
|
+
if (!template) template = await this.getNewCardTemplate(path, isFile)
|
|
532
532
|
|
|
533
533
|
const boardData = await this.pluginManager.getBoardProperties();
|
|
534
534
|
template = format(template, boardData)
|
|
@@ -664,8 +664,8 @@ export class WorkerProject extends Project {
|
|
|
664
664
|
this.emit('project.filter', { filter })
|
|
665
665
|
}
|
|
666
666
|
|
|
667
|
-
getNewCardTemplate(file, isFile) {
|
|
668
|
-
const frontMatter = this.getNewCardFileFrontMatter(file, isFile)
|
|
667
|
+
async getNewCardTemplate(file, isFile) {
|
|
668
|
+
const frontMatter = await this.getNewCardFileFrontMatter(file, isFile)
|
|
669
669
|
const card = newCard(
|
|
670
670
|
{
|
|
671
671
|
frontMatter,
|
|
@@ -680,10 +680,10 @@ export class WorkerProject extends Project {
|
|
|
680
680
|
return card.formatContent(frontMatter.template).content
|
|
681
681
|
}
|
|
682
682
|
|
|
683
|
-
getNewCardFileFrontMatter(file, isFile) {
|
|
683
|
+
async getNewCardFileFrontMatter(file, isFile) {
|
|
684
684
|
let fileContent = ''
|
|
685
685
|
if (file && isFile) {
|
|
686
|
-
fileContent = fileGateway.
|
|
686
|
+
fileContent = await fileGateway.readFile(file, 'utf8')
|
|
687
687
|
} else if (JOURNAL_TYPE.NEW_FILE === this.config.journlType) {
|
|
688
688
|
fileContent = this.config.journalTemplate
|
|
689
689
|
}
|
package/package.json
CHANGED
package/types/project.d.ts
CHANGED
|
@@ -127,12 +127,12 @@ export class WorkerProject {
|
|
|
127
127
|
deleteTask(task: any): Promise<void>;
|
|
128
128
|
deleteTasks(tasks: any): Promise<void>;
|
|
129
129
|
setFilter(filter: any): void;
|
|
130
|
-
getNewCardTemplate(file: any, isFile: any): any
|
|
131
|
-
getNewCardFileFrontMatter(file: any, isFile: any): {
|
|
130
|
+
getNewCardTemplate(file: any, isFile: any): Promise<any>;
|
|
131
|
+
getNewCardFileFrontMatter(file: any, isFile: any): Promise<{
|
|
132
132
|
props: any;
|
|
133
133
|
computed: any;
|
|
134
134
|
template: any;
|
|
135
|
-
}
|
|
135
|
+
}>;
|
|
136
136
|
getNewCardsFile(opts?: {
|
|
137
137
|
relPath: boolean;
|
|
138
138
|
}): string;
|
package/.env
DELETED