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 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.readFileSync(file, 'utf8')
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imdone-core",
3
- "version": "2.0.16",
3
+ "version": "2.0.17",
4
4
  "description": "imdone-core",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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
@@ -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>"