imdone-core 2.0.19 → 2.0.21

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 CHANGED
@@ -1,3 +1,6 @@
1
+ ## 2.0.21
2
+ - Make sure all project properties are available after init
3
+
1
4
  ## 2.0.10
2
5
  - Use static `get pluginName()` method to get the plugin name
3
6
 
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
@@ -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.emi('watch.add', file)
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
@@ -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
 
@@ -878,6 +878,7 @@ export class WorkerProject extends Project {
878
878
  async refresh() {
879
879
  await this.repo.refresh()
880
880
  await this.pluginManager.reloadPlugins()
881
+ return await this.toImdoneJSON()
881
882
  }
882
883
 
883
884
  renderMarkdown(content, filePath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imdone-core",
3
- "version": "2.0.19",
3
+ "version": "2.0.21",
4
4
  "description": "imdone-core",
5
5
  "repository": {
6
6
  "type": "git",
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
  }
@@ -151,7 +151,25 @@ export class WorkerProject {
151
151
  version: any;
152
152
  }): Promise<void>;
153
153
  uninstallPlugin(name: any): Promise<void>;
154
- refresh(): Promise<void>;
154
+ refresh(): Promise<{
155
+ path: any;
156
+ config: any;
157
+ lists: any;
158
+ files: any;
159
+ totals: {};
160
+ totalCards: any;
161
+ tags: any[];
162
+ allMeta: any;
163
+ allContexts: any[];
164
+ allTags: any[];
165
+ filter: string;
166
+ defaultFilter: any;
167
+ actions: any[];
168
+ plugins: any[];
169
+ data: {};
170
+ dataKeys: string[];
171
+ queryProps: any[];
172
+ }>;
155
173
  renderMarkdown(content: any, filePath: any): any;
156
174
  extractWikilinkTopics(markdown: any): string[];
157
175
  }