imdone-core 2.0.0 → 2.0.1

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.
Files changed (160) hide show
  1. package/.dependency-cruiser.cjs +412 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
  3. package/.github/workflows/ci.yml +24 -0
  4. package/.imdoneignore +13 -0
  5. package/.mocharc.json +10 -0
  6. package/.prettierrc +6 -0
  7. package/CHANGELOG.md +160 -0
  8. package/_index.md +7 -0
  9. package/_navbar.md +1 -0
  10. package/build.js +57 -0
  11. package/esm-migration.md +446 -0
  12. package/index.html +184 -0
  13. package/lib/FileProjectContext.js +13 -0
  14. package/lib/ProjectContext.js +43 -0
  15. package/lib/adapters/date-time.js +15 -0
  16. package/lib/adapters/environment.js +3 -0
  17. package/lib/adapters/file-gateway.js +154 -0
  18. package/lib/adapters/git-download.js +55 -0
  19. package/lib/adapters/index.js +9 -0
  20. package/lib/adapters/logger.js +136 -0
  21. package/lib/adapters/markdown.js +180 -0
  22. package/lib/adapters/parsers/DateLanguageParser.js +12 -0
  23. package/lib/adapters/parsers/content-transformer.js +116 -0
  24. package/lib/adapters/parsers/file/LocalFileParserFactory.js +36 -0
  25. package/lib/adapters/parsers/file/ReadStreamCodeParser.js +126 -0
  26. package/lib/adapters/parsers/file/ReadStreamMarkdownParser.js +17 -0
  27. package/lib/adapters/parsers/file/ReadStreamTaskParser.js +106 -0
  28. package/lib/adapters/parsers/file/index.js +4 -0
  29. package/lib/adapters/parsers/function-parser.js +25 -0
  30. package/lib/adapters/parsers/index.js +5 -0
  31. package/lib/adapters/parsers/task/CardContentParser.js +367 -0
  32. package/lib/adapters/parsers/task/CheckStyleTaskParser.js +28 -0
  33. package/lib/adapters/parsers/task/CodeStyleTaskParser.js +24 -0
  34. package/lib/adapters/parsers/task/HashStyleTaskParser.js +27 -0
  35. package/lib/adapters/parsers/task/MarkdownStyleTaskParser.js +24 -0
  36. package/lib/adapters/parsers/task/TaskParser.js +38 -0
  37. package/lib/adapters/parsers/task/index.js +6 -0
  38. package/lib/adapters/storage/config.js +44 -0
  39. package/lib/adapters/storage/index.js +2 -0
  40. package/lib/adapters/storage/tags.js +29 -0
  41. package/lib/adapters/yaml.js +9 -0
  42. package/lib/card.js +299 -0
  43. package/lib/checksum.js +22 -0
  44. package/lib/config.js +249 -0
  45. package/lib/constants.js +68 -0
  46. package/lib/context/ApplicationContext.js +35 -0
  47. package/lib/context/index.js +1 -0
  48. package/lib/default-settings.js +37 -0
  49. package/lib/domain/entities/View.js +23 -0
  50. package/lib/domain/entities/index.js +1 -0
  51. package/lib/domain/index.js +2 -0
  52. package/lib/domain/usecases/GetViewsUsecase.js +44 -0
  53. package/lib/domain/usecases/SaveViewUsecase.js +51 -0
  54. package/lib/domain/usecases/index.js +2 -0
  55. package/lib/file.js +1391 -0
  56. package/lib/get-tasks-to-modify.js +117 -0
  57. package/lib/languages.js +113 -0
  58. package/lib/list.js +56 -0
  59. package/lib/migrate-config.js +165 -0
  60. package/lib/mixins/index.js +2 -0
  61. package/lib/mixins/repo-fs-store.js +359 -0
  62. package/lib/mixins/repo-watched-fs-store.js +206 -0
  63. package/lib/plugins/archive-plugin.js +72 -0
  64. package/lib/plugins/default-board-actions-plugin.js +56 -0
  65. package/lib/plugins/default-board-properties-plugin.js +101 -0
  66. package/lib/plugins/default-plugins.js +7 -0
  67. package/lib/plugins/epic-plugin.js +177 -0
  68. package/lib/plugins/extension-plugin.js +94 -0
  69. package/lib/plugins/index.js +9 -0
  70. package/lib/plugins/persist-tags-plugin.js +14 -0
  71. package/lib/plugins/plugin-manager.js +458 -0
  72. package/lib/plugins/plugin-registry.js +57 -0
  73. package/lib/project-factory.js +42 -0
  74. package/lib/project.js +864 -0
  75. package/lib/repository.js +1514 -0
  76. package/lib/task.js +780 -0
  77. package/lib/tools.js +176 -0
  78. package/lib/usecases/actions.js +32 -0
  79. package/lib/usecases/get-imdone-url.js +6 -0
  80. package/lib/usecases/get-project-tags.js +7 -0
  81. package/lib/usecases/get-tasks-in-file.js +26 -0
  82. package/lib/usecases/index.js +4 -0
  83. package/package.json +2 -6
  84. package/scripts/delete-markdown-indexes.js +87 -0
  85. package/scripts/generate-index.js +35 -0
  86. package/scripts/index-markdown.js +55 -0
  87. package/tsconfig.json +15 -0
  88. package/types/FileProjectContext.d.ts +4 -0
  89. package/types/ProjectContext.d.ts +9 -0
  90. package/types/adapters/date-time.d.ts +2 -0
  91. package/types/adapters/environment.d.ts +1 -0
  92. package/types/adapters/file-gateway.d.ts +51 -0
  93. package/types/adapters/git-download.d.ts +1 -0
  94. package/types/adapters/index.d.ts +9 -0
  95. package/types/adapters/logger.d.ts +24 -0
  96. package/types/adapters/markdown.d.ts +13 -0
  97. package/types/adapters/parsers/DateLanguageParser.d.ts +1 -0
  98. package/types/adapters/parsers/content-transformer.d.ts +10 -0
  99. package/types/adapters/parsers/file/LocalFileParserFactory.d.ts +5 -0
  100. package/types/adapters/parsers/file/ReadStreamCodeParser.d.ts +13 -0
  101. package/types/adapters/parsers/file/ReadStreamMarkdownParser.d.ts +7 -0
  102. package/types/adapters/parsers/file/ReadStreamTaskParser.d.ts +19 -0
  103. package/types/adapters/parsers/file/index.d.ts +4 -0
  104. package/types/adapters/parsers/function-parser.d.ts +1 -0
  105. package/types/adapters/parsers/index.d.ts +5 -0
  106. package/types/adapters/parsers/task/CardContentParser.d.ts +45 -0
  107. package/types/adapters/parsers/task/CheckStyleTaskParser.d.ts +12 -0
  108. package/types/adapters/parsers/task/CodeStyleTaskParser.d.ts +14 -0
  109. package/types/adapters/parsers/task/HashStyleTaskParser.d.ts +13 -0
  110. package/types/adapters/parsers/task/MarkdownStyleTaskParser.d.ts +14 -0
  111. package/types/adapters/parsers/task/TaskParser.d.ts +7 -0
  112. package/types/adapters/parsers/task/index.d.ts +6 -0
  113. package/types/adapters/storage/config.d.ts +6 -0
  114. package/types/adapters/storage/index.d.ts +2 -0
  115. package/types/adapters/storage/tags.d.ts +3 -0
  116. package/types/adapters/yaml.d.ts +2 -0
  117. package/types/card.d.ts +166 -0
  118. package/types/checksum.d.ts +8 -0
  119. package/types/config.d.ts +61 -0
  120. package/types/constants.d.ts +46 -0
  121. package/types/context/ApplicationContext.d.ts +24 -0
  122. package/types/context/index.d.ts +1 -0
  123. package/types/default-settings.d.ts +2 -0
  124. package/types/domain/entities/FileProjectContext.d.ts +5 -0
  125. package/types/domain/entities/View.d.ts +17 -0
  126. package/types/domain/entities/index.d.ts +1 -0
  127. package/types/domain/index.d.ts +2 -0
  128. package/types/domain/usecases/GetViewsUsecase.d.ts +4 -0
  129. package/types/domain/usecases/SaveViewUsecase.d.ts +8 -0
  130. package/types/domain/usecases/index.d.ts +2 -0
  131. package/types/file.d.ts +344 -0
  132. package/types/get-tasks-to-modify.d.ts +3 -0
  133. package/types/index.d.ts +23 -0
  134. package/types/languages.d.ts +649 -0
  135. package/types/list.d.ts +30 -0
  136. package/types/migrate-config.d.ts +1 -0
  137. package/types/mixins/index.d.ts +2 -0
  138. package/types/mixins/repo-fs-store.d.ts +2 -0
  139. package/types/mixins/repo-watched-fs-store.d.ts +2 -0
  140. package/types/plugins/archive-plugin.d.ts +8 -0
  141. package/types/plugins/default-board-actions-plugin.d.ts +9 -0
  142. package/types/plugins/default-board-properties-plugin.d.ts +16 -0
  143. package/types/plugins/default-plugins.d.ts +6 -0
  144. package/types/plugins/epic-plugin.d.ts +19 -0
  145. package/types/plugins/extension-plugin.d.ts +15 -0
  146. package/types/plugins/index.d.ts +9 -0
  147. package/types/plugins/persist-tags-plugin.d.ts +4 -0
  148. package/types/plugins/plugin-manager.d.ts +68 -0
  149. package/types/plugins/plugin-registry.d.ts +1 -0
  150. package/types/project-factory.d.ts +14 -0
  151. package/types/project.d.ts +158 -0
  152. package/types/repository.d.ts +996 -0
  153. package/types/task.d.ts +202 -0
  154. package/types/tools.d.ts +29 -0
  155. package/types/usecases/actions.d.ts +7 -0
  156. package/types/usecases/get-imdone-url.d.ts +1 -0
  157. package/types/usecases/get-project-tags.d.ts +1 -0
  158. package/types/usecases/get-tasks-in-file.d.ts +4 -0
  159. package/types/usecases/index.d.ts +4 -0
  160. package/vitest.config.js +13 -0
@@ -0,0 +1,6 @@
1
+ export * as ArchivePlugin from "./archive-plugin.js";
2
+ export * as DefaultBoardActionsPlugin from "./default-board-actions-plugin.js";
3
+ export * as DefaultBoardPropertiesPlugin from "./default-board-properties-plugin.js";
4
+ export * as EpicPlugin from "./epic-plugin.js";
5
+ export * as PersistTagsPlugin from "./persist-tags-plugin.js";
6
+ export * as ExtensionPlugin from "./extension-plugin.js";
@@ -0,0 +1,19 @@
1
+ export default class EpicPlugin {
2
+ constructor(project: any);
3
+ epics: {};
4
+ onBeforeBoardUpdate(): Promise<void>;
5
+ onBoardUpdate(lists: any): void;
6
+ onTaskUpdate(task: any): void;
7
+ initEpic(name: any): void;
8
+ addEpic(name: any, task: any): void;
9
+ addEpicItem(name: any, task: any): void;
10
+ get epicNames(): string[];
11
+ getEpic(name: any): any;
12
+ getEpicItems(name: any): any;
13
+ getEpicItemsInList(name: any, list: any): any;
14
+ getEpicLists(name: any): string[];
15
+ isListHidden(name: any, lists: any): any;
16
+ isListIgnored(name: any, lists: any): any;
17
+ updateCardMD(lists: any): void;
18
+ getTaskListMD(lists: any, epicFilter: any, epicUrl: any, epicId: any): string;
19
+ }
@@ -0,0 +1,15 @@
1
+ export default class ExtensionPlugin {
2
+ constructor(project: any);
3
+ configDir: string;
4
+ init(): Promise<void>;
5
+ cardActionsFunction: any;
6
+ boardActionsFunction: any;
7
+ cardPropertiesFunction: any;
8
+ boardPropertiesFunction: any;
9
+ getCardProperties(task: any): any;
10
+ getBoardProperties(): Promise<any>;
11
+ getCardActions(task: any): any;
12
+ getBoardActions(): any;
13
+ getConfigPath(relativePath: any): string;
14
+ loadExtensionModule(_default: any, ...path: any[]): Promise<any>;
15
+ }
@@ -0,0 +1,9 @@
1
+ export * from "./archive-plugin.js";
2
+ export * from "./default-board-actions-plugin.js";
3
+ export * from "./default-board-properties-plugin.js";
4
+ export * from "./default-plugins.js";
5
+ export * from "./epic-plugin.js";
6
+ export * from "./extension-plugin.js";
7
+ export * from "./persist-tags-plugin.js";
8
+ export * from "./plugin-manager.js";
9
+ export * from "./plugin-registry.js";
@@ -0,0 +1,4 @@
1
+ export default class PersistTagsPlugin {
2
+ constructor(project: any);
3
+ onBoardUpdate(): Promise<void>;
4
+ }
@@ -0,0 +1,68 @@
1
+ export class PluginManager extends Emitter<[never]> {
2
+ constructor(project: any);
3
+ project: any;
4
+ defaultPlugins: (typeof PersistTagsPlugin | typeof DefaultBoardPropertiesPlugin | typeof DefaultBoardActionsPlugin | typeof ArchivePlugin | typeof EpicPlugin | typeof ExtensionPlugin)[];
5
+ pluginsMap: {};
6
+ pluginPath: string;
7
+ onDevChange(): Promise<void>;
8
+ startDevMode(): Promise<void>;
9
+ watcher: any;
10
+ stopDevMode(): void;
11
+ initDevMode(): void;
12
+ reloadPlugins(): Promise<void>;
13
+ uninstallPlugin(pluginName: any): Promise<any>;
14
+ installPlugin({ name, version }: {
15
+ name: any;
16
+ version: any;
17
+ }): Promise<void>;
18
+ loadPlugins(): Promise<void>;
19
+ loadInstalledPlugins(): Promise<void>;
20
+ loadPluginsNotInstalled(): Promise<void>;
21
+ loadPlugin(path: any): Promise<any>;
22
+ getPackageInfo(path: any): {} | undefined;
23
+ createPlugin(pluginClass: any, path?: undefined): Promise<any>;
24
+ destroyPlugins(): void;
25
+ isPlugin(pluginClass: any): boolean;
26
+ eachPlugin(cb: any): void;
27
+ eachPluginAsync(cb: any): Promise<void>;
28
+ getPlugins(): any[];
29
+ disablePlugin(name: any): void;
30
+ getPluginName(pluginInstance: any): string | undefined;
31
+ getPluginInstance(name: any): any;
32
+ getPlugin(name: any): any;
33
+ getPluginSettings(name: any): any;
34
+ pluginError(method: any, pluginInstance: any, error: any): void;
35
+ onBoardUpdate(lists: any): Promise<any>;
36
+ onBeforeBoardUpdate(): Promise<void>;
37
+ onTaskUpdate(task: any): void;
38
+ onTaskFound(task: any): Promise<void>;
39
+ onBeforeAddTask({ path, list, content, tags, contexts, meta, useCardTemplate }: {
40
+ path: any;
41
+ list: any;
42
+ content: any;
43
+ tags: any;
44
+ contexts: any;
45
+ meta: any;
46
+ useCardTemplate: any;
47
+ }): Promise<{
48
+ path: any;
49
+ content: any;
50
+ tags: any;
51
+ contexts: any;
52
+ meta: any;
53
+ }>;
54
+ onAfterDeleteTask(task: any): Promise<void>;
55
+ getCardProperties(props: any): {};
56
+ getBoardProperties(): Promise<{}>;
57
+ getCardActions(task: any): any[];
58
+ getBoardActions(): any[];
59
+ performCardAction(action: any, task: any): any;
60
+ performBoardAction(action: any, task: any): Promise<any>;
61
+ }
62
+ import Emitter from 'events';
63
+ import PersistTagsPlugin from './persist-tags-plugin.js';
64
+ import DefaultBoardPropertiesPlugin from './default-board-properties-plugin.js';
65
+ import DefaultBoardActionsPlugin from './default-board-actions-plugin.js';
66
+ import ArchivePlugin from './archive-plugin.js';
67
+ import EpicPlugin from './epic-plugin.js';
68
+ import ExtensionPlugin from './extension-plugin.js';
@@ -0,0 +1 @@
1
+ export function getAvailablePlugins(): Promise<any>;
@@ -0,0 +1,14 @@
1
+ export function createFileSystemProject({ path, config, repo, loadInstalledPlugins, loadPluginsNotInstalled }: {
2
+ path: any;
3
+ config: any;
4
+ repo?: any;
5
+ loadInstalledPlugins: any;
6
+ loadPluginsNotInstalled: any;
7
+ }): any;
8
+ export function createWatchedFileSystemProject({ path, config, repo, loadInstalledPlugins, loadPluginsNotInstalled }: {
9
+ path: any;
10
+ config: any;
11
+ repo?: any;
12
+ loadInstalledPlugins: any;
13
+ loadPluginsNotInstalled: any;
14
+ }): any;
@@ -0,0 +1,158 @@
1
+ export class WorkerProject extends Project {
2
+ constructor(repo: any);
3
+ repo: any;
4
+ innerFilter: string;
5
+ fileGateway: typeof fileGateway;
6
+ _updatedAt: Date | undefined;
7
+ data: {};
8
+ dataKeys: any[];
9
+ pluginManager: PluginManager;
10
+ get configDir(): string;
11
+ get allTopics(): any[];
12
+ get allTags(): any[];
13
+ get allContexts(): any[];
14
+ get allMeta(): any;
15
+ get lists(): any;
16
+ get allLists(): any;
17
+ get filteredCards(): any[];
18
+ get isoDateWithOffset(): string;
19
+ get updatedAt(): Date | undefined;
20
+ get files(): any;
21
+ get config(): any;
22
+ set defaultFilter(filter: any);
23
+ get defaultFilter(): any;
24
+ get totals(): {};
25
+ get path(): any;
26
+ get name(): any;
27
+ get doneList(): any;
28
+ get boardActions(): any[];
29
+ set filter(filter: string);
30
+ get filter(): string;
31
+ init(): Promise<any>;
32
+ initIndexes(allLists: any): void;
33
+ toJSON(): {
34
+ path: any;
35
+ };
36
+ getListsForImdoneJSON(): {
37
+ allLists: any;
38
+ totals: {};
39
+ };
40
+ getInitializedCards(allLists: any, totals: any): any;
41
+ toImdoneJSON(): Promise<{
42
+ path: any;
43
+ config: any;
44
+ lists: any;
45
+ files: any;
46
+ totals: {};
47
+ totalCards: any;
48
+ tags: any[];
49
+ allMeta: any;
50
+ allContexts: any[];
51
+ allTags: any[];
52
+ filter: string;
53
+ defaultFilter: any;
54
+ actions: any[];
55
+ plugins: any[];
56
+ data: {};
57
+ dataKeys: string[];
58
+ queryProps: any[];
59
+ }>;
60
+ dataKays: string[] | undefined;
61
+ getRequestedLists(cards: any): any;
62
+ emit(): void;
63
+ emitUpdate(): void;
64
+ destroy(): Promise<void>;
65
+ getDataKeys(data: any): string[];
66
+ removeList(list: any): void;
67
+ getLists(opts: any): any;
68
+ getTaskQueryProps(props: any): any[];
69
+ getQueryProps(cards: any): any[];
70
+ getTags(cards?: any[]): any[];
71
+ getDefaultFilteredCards(): any[];
72
+ getAllCards(filter: any): any[];
73
+ getCards(filter: any, cards?: any[]): any[];
74
+ filterCards(cards: any, filter: any): any[];
75
+ hideLists: any[] | undefined;
76
+ addMetadata(task: any, key: any, value: any): Promise<any>;
77
+ removeMetadata(task: any, key: any, value: any): Promise<any>;
78
+ addTag(task: any, tag: any): Promise<any>;
79
+ removeTag(task: any, tag: any): Promise<any>;
80
+ moveTask(task: any, newList: any, newPos: any): Promise<any>;
81
+ getFile(filePath: any): any;
82
+ getFileForTask(task: any): any;
83
+ rollBackFileForTask(task: any): any;
84
+ updateCardContent(task: any, content: any): Promise<any>;
85
+ snackBar({ message, type, duration }: {
86
+ message: any;
87
+ type: any;
88
+ duration: any;
89
+ }): Promise<void>;
90
+ toast({ message, type, duration }: {
91
+ message: any;
92
+ type: any;
93
+ duration: any;
94
+ }): Promise<void>;
95
+ filterLists(filter: any, lists?: any): any;
96
+ copyToClipboard(text: any, message: any): Promise<void>;
97
+ openUrl(url: any): Promise<void>;
98
+ openPath(path: any): Promise<void>;
99
+ newCard({ list, path, template, title, comments, emit }: {
100
+ list: any;
101
+ path: any;
102
+ template: any;
103
+ title: any;
104
+ comments: any;
105
+ emit?: boolean | undefined;
106
+ }): Promise<{
107
+ list: any;
108
+ path: any;
109
+ relativePath: string;
110
+ template: any;
111
+ isDirectory: any;
112
+ }>;
113
+ addCardToFile(opts: any): Promise<any>;
114
+ addTaskToFile({ path, list, content, tags, contexts, meta, useCardTemplate }: {
115
+ path: any;
116
+ list?: any;
117
+ content: any;
118
+ tags?: never[] | undefined;
119
+ contexts?: never[] | undefined;
120
+ meta?: never[] | undefined;
121
+ useCardTemplate?: boolean | undefined;
122
+ }): Promise<any>;
123
+ addMetaToContent(meta: any, content: any): any;
124
+ addContextsToContent(contexts: any, content: any): any;
125
+ addTagsToContent(tags: any, content: any): any;
126
+ deleteTask(task: any): Promise<void>;
127
+ deleteTasks(tasks: any): Promise<void>;
128
+ getNewCardTemplate(file: any, isFile: any): any;
129
+ getNewCardFileFrontMatter(file: any, isFile: any): {
130
+ props: any;
131
+ computed: any;
132
+ template: any;
133
+ };
134
+ getNewCardsFile(opts?: {
135
+ relPath: boolean;
136
+ }): string;
137
+ appendNewCardsTo(title: any): string | undefined;
138
+ sanitizeFileName(fileName: any): any;
139
+ getJournalFile(): {
140
+ filePath: string;
141
+ fullFilePath: string;
142
+ };
143
+ getFullPath(...path: any[]): string;
144
+ performCardAction(action: any, task: any): any;
145
+ performBoardAction(action: any, task: any): Promise<any>;
146
+ exec(cmd: any): Promise<any>;
147
+ installPlugin({ name, version }: {
148
+ name: any;
149
+ version: any;
150
+ }): Promise<void>;
151
+ uninstallPlugin(name: any): Promise<any>;
152
+ refresh(): Promise<void>;
153
+ renderMarkdown(content: any, filePath: any): any;
154
+ extractWikilinkTopics(markdown: any): string[];
155
+ }
156
+ import { Project } from 'imdone-api/lib/project.js';
157
+ import * as fileGateway from './adapters/file-gateway.js';
158
+ import { PluginManager } from './plugins/plugin-manager.js';