imdone-core 1.54.10 → 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.
- package/.dependency-cruiser.cjs +412 -0
- package/.github/workflows/ci.yml +2 -2
- package/.imdoneignore +2 -1
- package/README.md +2 -2
- package/_index.md +7 -0
- package/build.js +57 -0
- package/esm-migration.md +446 -0
- package/lib/FileProjectContext.js +13 -0
- package/lib/ProjectContext.js +19 -18
- package/lib/adapters/date-time.js +3 -8
- package/lib/adapters/environment.js +3 -0
- package/lib/adapters/file-gateway.js +133 -106
- package/lib/adapters/git-download.js +36 -16
- package/lib/adapters/index.js +9 -0
- package/lib/adapters/logger.js +136 -0
- package/lib/adapters/markdown.js +31 -19
- package/lib/adapters/parsers/DateLanguageParser.js +11 -9
- package/lib/adapters/parsers/content-transformer.js +35 -30
- package/lib/adapters/parsers/file/LocalFileParserFactory.js +8 -9
- package/lib/adapters/parsers/file/ReadStreamCodeParser.js +8 -8
- package/lib/adapters/parsers/file/ReadStreamMarkdownParser.js +4 -4
- package/lib/adapters/parsers/file/ReadStreamTaskParser.js +5 -3
- package/lib/adapters/parsers/file/index.js +4 -0
- package/lib/adapters/parsers/function-parser.js +1 -5
- package/lib/adapters/parsers/index.js +5 -0
- package/lib/adapters/parsers/task/CardContentParser.js +23 -32
- package/lib/adapters/parsers/task/CheckStyleTaskParser.js +2 -2
- package/lib/adapters/parsers/task/CodeStyleTaskParser.js +2 -2
- package/lib/adapters/parsers/task/HashStyleTaskParser.js +3 -3
- package/lib/adapters/parsers/task/MarkdownStyleTaskParser.js +2 -2
- package/lib/adapters/parsers/task/TaskParser.js +1 -1
- package/lib/adapters/parsers/task/index.js +6 -0
- package/lib/adapters/storage/config.js +15 -20
- package/lib/adapters/storage/index.js +2 -0
- package/lib/adapters/storage/tags.js +11 -12
- package/lib/adapters/yaml.js +8 -5
- package/lib/card.js +25 -26
- package/lib/checksum.js +22 -0
- package/lib/cli.js +114 -0
- package/lib/config.js +106 -71
- package/lib/constants.js +21 -50
- package/lib/context/ApplicationContext.js +7 -4
- package/lib/context/index.js +1 -0
- package/lib/default-settings.js +3 -3
- package/lib/domain/entities/View.js +4 -11
- package/lib/domain/entities/index.js +1 -0
- package/lib/domain/index.js +2 -0
- package/lib/domain/usecases/GetViewsUsecase.js +6 -12
- package/lib/domain/usecases/SaveViewUsecase.js +8 -14
- package/lib/domain/usecases/index.js +2 -0
- package/lib/file.js +1158 -1162
- package/lib/get-tasks-to-modify.js +117 -0
- package/lib/index.js +23 -0
- package/lib/languages.js +4 -5
- package/lib/list.js +46 -95
- package/lib/migrate-config.js +5 -5
- package/lib/mixins/index.js +2 -0
- package/lib/mixins/repo-fs-store.js +224 -289
- package/lib/mixins/repo-watched-fs-store.js +158 -147
- package/lib/plugins/archive-plugin.js +10 -8
- package/lib/plugins/default-board-actions-plugin.js +2 -2
- package/lib/plugins/default-board-properties-plugin.js +7 -7
- package/lib/plugins/default-plugins.js +7 -0
- package/lib/plugins/epic-plugin.js +6 -5
- package/lib/plugins/extension-plugin.js +24 -17
- package/lib/plugins/index.js +9 -0
- package/lib/plugins/persist-tags-plugin.js +4 -3
- package/lib/plugins/plugin-manager.js +89 -52
- package/lib/plugins/plugin-registry.js +12 -16
- package/lib/project-factory.js +21 -24
- package/lib/project.js +97 -144
- package/lib/repository.js +1323 -1555
- package/lib/task.js +562 -580
- package/lib/tools.js +39 -113
- package/lib/usecases/actions.js +32 -0
- package/lib/usecases/get-project-tags.js +3 -12
- package/lib/usecases/get-tasks-in-file.js +4 -7
- package/lib/usecases/index.js +4 -0
- package/package.json +44 -66
- package/scripts/delete-markdown-indexes.js +87 -0
- package/scripts/generate-index.js +35 -0
- package/{index-markdown.js → scripts/index-markdown.js} +7 -7
- package/tsconfig.json +15 -0
- package/types/FileProjectContext.d.ts +4 -0
- package/types/ProjectContext.d.ts +9 -0
- package/types/adapters/date-time.d.ts +2 -0
- package/types/adapters/environment.d.ts +1 -0
- package/types/adapters/file-gateway.d.ts +51 -0
- package/types/adapters/git-download.d.ts +1 -0
- package/types/adapters/index.d.ts +9 -0
- package/types/adapters/logger.d.ts +24 -0
- package/types/adapters/markdown.d.ts +13 -0
- package/types/adapters/parsers/DateLanguageParser.d.ts +1 -0
- package/types/adapters/parsers/content-transformer.d.ts +10 -0
- package/types/adapters/parsers/file/LocalFileParserFactory.d.ts +5 -0
- package/types/adapters/parsers/file/ReadStreamCodeParser.d.ts +13 -0
- package/types/adapters/parsers/file/ReadStreamMarkdownParser.d.ts +7 -0
- package/types/adapters/parsers/file/ReadStreamTaskParser.d.ts +19 -0
- package/types/adapters/parsers/file/index.d.ts +4 -0
- package/types/adapters/parsers/function-parser.d.ts +1 -0
- package/types/adapters/parsers/index.d.ts +5 -0
- package/types/adapters/parsers/task/CardContentParser.d.ts +45 -0
- package/types/adapters/parsers/task/CheckStyleTaskParser.d.ts +12 -0
- package/types/adapters/parsers/task/CodeStyleTaskParser.d.ts +14 -0
- package/types/adapters/parsers/task/HashStyleTaskParser.d.ts +13 -0
- package/types/adapters/parsers/task/MarkdownStyleTaskParser.d.ts +14 -0
- package/types/adapters/parsers/task/TaskParser.d.ts +7 -0
- package/types/adapters/parsers/task/index.d.ts +6 -0
- package/types/adapters/storage/config.d.ts +6 -0
- package/types/adapters/storage/index.d.ts +2 -0
- package/types/adapters/storage/tags.d.ts +3 -0
- package/types/adapters/yaml.d.ts +2 -0
- package/types/card.d.ts +166 -0
- package/types/checksum.d.ts +8 -0
- package/types/config.d.ts +61 -0
- package/types/constants.d.ts +46 -0
- package/types/context/ApplicationContext.d.ts +24 -0
- package/types/context/index.d.ts +1 -0
- package/types/default-settings.d.ts +2 -0
- package/types/domain/entities/FileProjectContext.d.ts +5 -0
- package/types/domain/entities/View.d.ts +17 -0
- package/types/domain/entities/index.d.ts +1 -0
- package/types/domain/index.d.ts +2 -0
- package/types/domain/usecases/GetViewsUsecase.d.ts +4 -0
- package/types/domain/usecases/SaveViewUsecase.d.ts +8 -0
- package/types/domain/usecases/index.d.ts +2 -0
- package/types/file.d.ts +344 -0
- package/types/get-tasks-to-modify.d.ts +3 -0
- package/types/index.d.ts +23 -0
- package/types/languages.d.ts +649 -0
- package/types/list.d.ts +30 -0
- package/types/migrate-config.d.ts +1 -0
- package/types/mixins/index.d.ts +2 -0
- package/types/mixins/repo-fs-store.d.ts +2 -0
- package/types/mixins/repo-watched-fs-store.d.ts +2 -0
- package/types/plugins/archive-plugin.d.ts +8 -0
- package/types/plugins/default-board-actions-plugin.d.ts +9 -0
- package/types/plugins/default-board-properties-plugin.d.ts +16 -0
- package/types/plugins/default-plugins.d.ts +6 -0
- package/types/plugins/epic-plugin.d.ts +19 -0
- package/types/plugins/extension-plugin.d.ts +15 -0
- package/types/plugins/index.d.ts +9 -0
- package/types/plugins/persist-tags-plugin.d.ts +4 -0
- package/types/plugins/plugin-manager.d.ts +68 -0
- package/types/plugins/plugin-registry.d.ts +1 -0
- package/types/project-factory.d.ts +14 -0
- package/types/project.d.ts +158 -0
- package/types/repository.d.ts +996 -0
- package/types/task.d.ts +202 -0
- package/types/tools.d.ts +29 -0
- package/types/usecases/actions.d.ts +7 -0
- package/types/usecases/get-imdone-url.d.ts +1 -0
- package/types/usecases/get-project-tags.d.ts +1 -0
- package/types/usecases/get-tasks-in-file.d.ts +4 -0
- package/types/usecases/index.d.ts +4 -0
- package/vitest.config.js +13 -0
- package/cli.js +0 -74
- package/index.js +0 -1
- package/lib/adapters/readers/FileSystemProjectReader.js +0 -45
- package/lib/context/StreamingApplicationContext.js +0 -31
- package/lib/controlers/SaveViewController.js +0 -10
- package/lib/domain/entities/FileProjectContext.js +0 -10
- package/lib/domain/usecases/OpenProjectUsecase.js +0 -13
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { Config } from '../config.js'
|
|
2
|
+
import { getAvailablePlugins } from '../plugins/plugin-registry.js';
|
|
2
3
|
|
|
3
4
|
class ApplicationContext {
|
|
4
5
|
constructor({
|
|
@@ -14,7 +15,7 @@ class ApplicationContext {
|
|
|
14
15
|
this.projectReader = projectReader;
|
|
15
16
|
this.projectPresenter = projectPresenter;
|
|
16
17
|
this.innerConfig = Config.newDefaultConfig()
|
|
17
|
-
this.pluginRegistry =
|
|
18
|
+
this.pluginRegistry = { getAvailablePlugins }
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
set config(config) {
|
|
@@ -23,10 +24,12 @@ class ApplicationContext {
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
get config() {
|
|
26
|
-
return
|
|
27
|
+
return this.repo?.config ?? this.innerConfig
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
}
|
|
30
31
|
const context = new ApplicationContext({})
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
export function appContext() {
|
|
34
|
+
return context
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ApplicationContext.js';
|
package/lib/default-settings.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { loadYAML } from './adapters/yaml.js'
|
|
2
2
|
|
|
3
|
-
const defaultSettingsString = `openIn: default #override
|
|
3
|
+
export const defaultSettingsString = `openIn: default #override
|
|
4
4
|
openCodeIn: default #override
|
|
5
5
|
journalType: New File
|
|
6
6
|
journalPath: imdone-tasks #override
|
|
@@ -34,4 +34,4 @@ cards:
|
|
|
34
34
|
journalTemplate: #override
|
|
35
35
|
markdownOnly: false #override
|
|
36
36
|
`
|
|
37
|
-
|
|
37
|
+
export const defaultSettings = loadYAML(defaultSettingsString)
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const DEFAULT_VIEW_NAME = "Default View"
|
|
3
|
-
|
|
4
|
-
class View {
|
|
1
|
+
export class View {
|
|
5
2
|
id
|
|
6
3
|
name
|
|
7
4
|
lists
|
|
@@ -17,14 +14,10 @@ class View {
|
|
|
17
14
|
this.#modifiable = modifiable
|
|
18
15
|
}
|
|
19
16
|
|
|
17
|
+
static DEFAULT_VIEW_ID = "default"
|
|
18
|
+
static DEFAULT_VIEW_NAME = "Default View"
|
|
19
|
+
|
|
20
20
|
get isModifiable () {
|
|
21
21
|
return this.#modifiable
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
View.DEFAULT_VIEW_ID = DEFAULT_VIEW_ID
|
|
26
|
-
View.DEFAULT_VIEW_NAME = DEFAULT_VIEW_NAME
|
|
27
|
-
|
|
28
|
-
module.exports = {
|
|
29
|
-
View
|
|
30
|
-
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './View.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { appContext as context } from '../../context/ApplicationContext.js'
|
|
2
|
+
import { View } from '../entities/View.js'
|
|
3
|
+
import { List } from '../../list.js'
|
|
4
4
|
|
|
5
|
-
function getView(_id) {
|
|
5
|
+
export function getView(_id) {
|
|
6
6
|
return getViews().find(view => view.id === _id)
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
function getDefaultView() {
|
|
9
|
+
export function getDefaultView() {
|
|
10
10
|
const lists = getConfig().lists.map(list => {
|
|
11
11
|
list = new List(list)
|
|
12
12
|
delete list.tasks
|
|
@@ -25,7 +25,7 @@ function syncLists(currentLists, overrideLists) {
|
|
|
25
25
|
})
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function getViews() {
|
|
28
|
+
export function getViews() {
|
|
29
29
|
const defaultView = getDefaultView()
|
|
30
30
|
const customViews = context().repo.config.views.map(
|
|
31
31
|
({name, id, filter, lists, modifiable = true}) => new View ({
|
|
@@ -42,9 +42,3 @@ function getViews() {
|
|
|
42
42
|
function getConfig() {
|
|
43
43
|
return context().repo.config
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
module.exports = {
|
|
47
|
-
getDefaultView,
|
|
48
|
-
getView,
|
|
49
|
-
getViews
|
|
50
|
-
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { randomUUID} from 'node:crypto'
|
|
2
|
+
import { appContext as context } from '../../context/ApplicationContext.js'
|
|
3
|
+
import { getView } from './GetViewsUsecase.js'
|
|
4
|
+
import { View } from '../entities/View.js'
|
|
5
5
|
|
|
6
|
-
async function saveView({id, name, lists, filter}) {
|
|
6
|
+
export async function saveView({id, name, lists, filter}) {
|
|
7
7
|
let view = getView(id)
|
|
8
8
|
|
|
9
9
|
if (!view) {
|
|
10
|
-
view = {id:
|
|
10
|
+
view = {id: randomUUID(), name, lists, filter}
|
|
11
11
|
context().repo.config.views.push(view)
|
|
12
12
|
} else if (view.id === View.DEFAULT_VIEW_ID) {
|
|
13
13
|
return
|
|
@@ -30,7 +30,7 @@ async function saveConfig() {
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
async function removeDefaultViewFilter() {
|
|
33
|
+
export async function removeDefaultViewFilter() {
|
|
34
34
|
const project = context().project
|
|
35
35
|
if (project.defaultFilter) {
|
|
36
36
|
project.setFilter(project.defaultFilter)
|
|
@@ -40,7 +40,7 @@ async function removeDefaultViewFilter() {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
async function setDefaultViewFilter(filter = context().project.filter) {
|
|
43
|
+
export async function setDefaultViewFilter(filter = context().project.filter) {
|
|
44
44
|
const project = context().project
|
|
45
45
|
if (filter) {
|
|
46
46
|
project.defaultFilter = filter
|
|
@@ -49,9 +49,3 @@ async function setDefaultViewFilter(filter = context().project.filter) {
|
|
|
49
49
|
await saveConfig()
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
module.exports = {
|
|
54
|
-
removeDefaultViewFilter,
|
|
55
|
-
setDefaultViewFilter,
|
|
56
|
-
saveView
|
|
57
|
-
}
|