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
package/esm-migration.md
ADDED
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
# #DOING ES Migration of imdone-core
|
|
2
|
+
<!--
|
|
3
|
+
order:-30
|
|
4
|
+
#esm-migration
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
- [ ] Fix deprecated packages
|
|
8
|
+
```text
|
|
9
|
+
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
|
|
10
|
+
npm warn deprecated lodash.pick@3.1.0: This package is deprecated. Use destructuring assignment syntax instead.
|
|
11
|
+
npm warn deprecated lodash.get@4.4.2: This package is deprecated. Use the optional chaining (?.) operator instead.
|
|
12
|
+
npm warn deprecated lodash.omit@4.5.0: This package is deprecated. Use destructuring assignment syntax instead.
|
|
13
|
+
npm warn deprecated lodash.isequal@4.5.0: This package is deprecated. Use require('node:util').isDeepStrictEqual instead.
|
|
14
|
+
npm warn deprecated lodash.clone@4.5.0: This package is deprecated. Use structuredClone instead.
|
|
15
|
+
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
|
|
16
|
+
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
[Chat](https://chatgpt.com/share/67d08118-c930-8005-84d1-c29e324ae3b9)
|
|
20
|
+
|
|
21
|
+
Converting `imdone-core` from CommonJS (CJS) to TypeScript (TS) with ECMAScript Modules (ESM, `.mjs`) involves several steps. Since `imdone-core` is currently using CJS, you'll need to:
|
|
22
|
+
|
|
23
|
+
1. **Update `package.json` to Use ESM**
|
|
24
|
+
2. **Rename Files and Update Imports/Exports**
|
|
25
|
+
3. **Update `tsconfig.json` for ESM**
|
|
26
|
+
4. **Migrate Dependencies and Adjust Configuration**
|
|
27
|
+
5. **Test and Validate the Migration**
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
### **1. Update `package.json`**
|
|
32
|
+
Modify your `package.json` to specify ESM:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"type": "module",
|
|
37
|
+
"main": "./dist/index.mjs",
|
|
38
|
+
"exports": {
|
|
39
|
+
"import": "./dist/index.mjs",
|
|
40
|
+
"require": "./dist/index.cjs"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsc"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
- `"type": "module"` tells Node.js that your project uses ESM.
|
|
49
|
+
- `"exports"` ensures compatibility with both ESM and CJS consumers.
|
|
50
|
+
|
|
51
|
+
If you still need CJS compatibility, you can compile dual builds (covered in Step 4).
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### **2. Rename Files and Update Imports/Exports**
|
|
56
|
+
- Convert `.js` files to `.ts`
|
|
57
|
+
- Rename entry points from `.js` to `.mjs`
|
|
58
|
+
- Change `require()` to `import`
|
|
59
|
+
|
|
60
|
+
**Before (CJS)**
|
|
61
|
+
```js
|
|
62
|
+
const fs = require('fs');
|
|
63
|
+
const helper = require('./helper');
|
|
64
|
+
module.exports = { myFunction };
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**After (ESM + TS)**
|
|
68
|
+
```ts
|
|
69
|
+
import fs from 'fs';
|
|
70
|
+
import * as helper from './helper.mjs';
|
|
71
|
+
export function myFunction() { ... }
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
For named exports:
|
|
75
|
+
```ts
|
|
76
|
+
export { myFunction, anotherFunction };
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
For default exports:
|
|
80
|
+
```ts
|
|
81
|
+
export default myFunction;
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
For dynamic imports (replacing `require()` where needed):
|
|
85
|
+
```ts
|
|
86
|
+
const module = await import('./someModule.mjs');
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
### **3. Update `tsconfig.json`**
|
|
92
|
+
Modify `tsconfig.json`:
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"compilerOptions": {
|
|
97
|
+
"module": "ESNext",
|
|
98
|
+
"moduleResolution": "Node",
|
|
99
|
+
"target": "ESNext",
|
|
100
|
+
"outDir": "./dist",
|
|
101
|
+
"rootDir": "./src",
|
|
102
|
+
"declaration": true,
|
|
103
|
+
"declarationDir": "./dist",
|
|
104
|
+
"esModuleInterop": true,
|
|
105
|
+
"skipLibCheck": true,
|
|
106
|
+
"forceConsistentCasingInFileNames": true
|
|
107
|
+
},
|
|
108
|
+
"include": ["src"],
|
|
109
|
+
"exclude": ["node_modules", "dist"]
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
### **4. Build and Output Dual CJS + ESM**
|
|
116
|
+
To support both module systems, update `package.json`:
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
"exports": {
|
|
120
|
+
"import": "./dist/index.mjs",
|
|
121
|
+
"require": "./dist/index.cjs"
|
|
122
|
+
},
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Modify `tsconfig.json` to build both formats:
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"compilerOptions": {
|
|
130
|
+
"module": "ESNext",
|
|
131
|
+
"outDir": "./dist/esm",
|
|
132
|
+
"declarationDir": "./dist/esm"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Then, create a `tsconfig.cjs.json`:
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"extends": "./tsconfig.json",
|
|
142
|
+
"compilerOptions": {
|
|
143
|
+
"module": "CommonJS",
|
|
144
|
+
"outDir": "./dist/cjs",
|
|
145
|
+
"declarationDir": "./dist/cjs"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Update `package.json` scripts:
|
|
151
|
+
|
|
152
|
+
```json
|
|
153
|
+
"scripts": {
|
|
154
|
+
"build": "tsc && tsc --project tsconfig.cjs.json"
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
### **5. Test the Migration**
|
|
161
|
+
- Run `npm run build`
|
|
162
|
+
- Check that `dist/index.mjs` and `dist/index.cjs` exist
|
|
163
|
+
- Test imports in both ESM and CJS:
|
|
164
|
+
|
|
165
|
+
**Test ESM**
|
|
166
|
+
```js
|
|
167
|
+
import { myFunction } from 'imdone-core';
|
|
168
|
+
myFunction();
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Test CJS**
|
|
172
|
+
```js
|
|
173
|
+
const { myFunction } = require('imdone-core');
|
|
174
|
+
myFunction();
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
lib
|
|
178
|
+
- [x] `├── ProjectContext.js`
|
|
179
|
+
- [ ] `├── adapters`
|
|
180
|
+
- [ ] `│ ├── __tests__`
|
|
181
|
+
- [x] `│ │ ├── date-time.spec.js`
|
|
182
|
+
- [x] `│ │ └── markdown.spec.js`
|
|
183
|
+
- [x] `│ ├── date-time.js`
|
|
184
|
+
- [x] `│ ├── file-gateway.js`
|
|
185
|
+
- [x] `│ ├── git-download.js`
|
|
186
|
+
- [x] `│ ├── markdown.js`
|
|
187
|
+
- [x] `│ ├── parsers`
|
|
188
|
+
- [x] `│ │ ├── DateLanguageParser.js`
|
|
189
|
+
- [x] `│ │ ├── __tests__`
|
|
190
|
+
- [x] `│ │ │ └── content-transformer.spec.js`
|
|
191
|
+
- [x] `│ │ ├── content-transformer.js`
|
|
192
|
+
- [x] `│ │ ├── file`
|
|
193
|
+
- [x] `│ │ │ ├── LocalFileParserFactory.js`
|
|
194
|
+
- [x] `│ │ │ ├── ReadStreamCodeParser.js`
|
|
195
|
+
- [x] `│ │ │ ├── ReadStreamMarkdownParser.js`
|
|
196
|
+
- [x] `│ │ │ ├── ReadStreamTaskParser.js`
|
|
197
|
+
- [x] `│ │ │ └── __tests__`
|
|
198
|
+
- [x] `│ │ │ ├── LocalFileParser.spec.js`
|
|
199
|
+
- [x] `│ │ │ ├── ReadStreamMarkdownParser.spec.js`
|
|
200
|
+
- [x] `│ │ │ ├── code-file.js`
|
|
201
|
+
- [x] `│ │ │ └── test-big-file.md`
|
|
202
|
+
- [x] `│ │ ├── function-parser.js`
|
|
203
|
+
- [x] `│ │ └── task`
|
|
204
|
+
- [x] `│ │ ├── CardContentParser.js`
|
|
205
|
+
- [x] `│ │ ├── CheckStyleTaskParser.js`
|
|
206
|
+
- [x] `│ │ ├── CodeStyleTaskParser.js`
|
|
207
|
+
- [x] `│ │ ├── HashStyleTaskParser.js`
|
|
208
|
+
- [x] `│ │ ├── MarkdownStyleTaskParser.js`
|
|
209
|
+
- [x] `│ │ ├── TaskParser.js`
|
|
210
|
+
- [x] `│ │ └── __tests__`
|
|
211
|
+
- [x] `│ │ └── CardContentParser.spec.js`
|
|
212
|
+
- [ ] `│ ├── readers`
|
|
213
|
+
- [ ] `│ │ └── FileSystemProjectReader.js`
|
|
214
|
+
- [x] `│ ├── storage`
|
|
215
|
+
- [x] `│ │ ├── config.js`
|
|
216
|
+
- [x] `│ │ └── tags.js`
|
|
217
|
+
- [x] `│ └── yaml.js`
|
|
218
|
+
- [x] `├── card.js`
|
|
219
|
+
- [x] `├── config.js`
|
|
220
|
+
- [x] `├── constants.js`
|
|
221
|
+
- [ ] `├── context`
|
|
222
|
+
- [x] `│ ├── ApplicationContext.js`
|
|
223
|
+
- [ ] `│ └── StreamingApplicationContext.js`
|
|
224
|
+
- [ ] `├── controlers`
|
|
225
|
+
- [x] `│ ├── SaveViewController.js`
|
|
226
|
+
- [x] `│ └── __tests__`
|
|
227
|
+
- [x] `│ ├── SaveViewController.spec.js`
|
|
228
|
+
- [x] `│ └── repos`
|
|
229
|
+
- [x] `│ └── test`
|
|
230
|
+
- [x] `│ └── readme.md`
|
|
231
|
+
- [x] `├── default-settings.js`
|
|
232
|
+
- [x] `├── domain`
|
|
233
|
+
- [x] `│ ├── entities`
|
|
234
|
+
- [x] `│ │ ├── FileProjectContext.js`
|
|
235
|
+
- [x] `│ │ └── View.js`
|
|
236
|
+
- [x] `│ └── usecases`
|
|
237
|
+
- [x] `│ ├── GetViewsUsecase.js`
|
|
238
|
+
- [x] `│ ├── OpenProjectUsecase.js`
|
|
239
|
+
- [x] `│ ├── SaveViewUsecase.js`
|
|
240
|
+
- [x] `│ └── __tests__`
|
|
241
|
+
- [x] `│ ├── GetViewsUsecase.spec.js`
|
|
242
|
+
- [x] `│ ├── OpenProjectUsecase.spec.js`
|
|
243
|
+
- [x] `│ └── SaveViewUsecase.spec.js`
|
|
244
|
+
- [x] `├── file.js`
|
|
245
|
+
- [x] `├── languages.js`
|
|
246
|
+
- [x] `├── list.js`
|
|
247
|
+
- [x] `├── migrate-config.js`
|
|
248
|
+
- [x] `├── mixins`
|
|
249
|
+
- [x] `│ ├── repo-fs-store.js`
|
|
250
|
+
- [x] `│ └── repo-watched-fs-store.js`
|
|
251
|
+
- [x] `├── plugins`
|
|
252
|
+
- [x] `│ ├── archive-plugin.js`
|
|
253
|
+
- [x] `│ ├── default-board-actions-plugin.js`
|
|
254
|
+
- [x] `│ ├── default-board-properties-plugin.js`
|
|
255
|
+
- [x] `│ ├── epic-plugin.js`
|
|
256
|
+
- [x] `│ ├── extension-plugin.js`
|
|
257
|
+
- [x] `│ ├── persist-tags-plugin.js`
|
|
258
|
+
- [x] `│ ├── plugin-manager.js`
|
|
259
|
+
- [x] `│ └── plugin-registry.js`
|
|
260
|
+
- [x] `├── project-factory.js`
|
|
261
|
+
- [x] `├── project.js`
|
|
262
|
+
- [x] `├── repository.js`
|
|
263
|
+
- [x] `├── task.js`
|
|
264
|
+
- [x] `├── tools.js`
|
|
265
|
+
- [x] `└── usecases`
|
|
266
|
+
- [x] ` ├── __tests__`
|
|
267
|
+
- [x] ` │ ├── get-project-tags.spec.js`
|
|
268
|
+
- [x] ` │ └── get-tasks-in-file.spec.js`
|
|
269
|
+
- [x] ` ├── get-imdone-url.js`
|
|
270
|
+
- [x] ` ├── get-project-tags.js`
|
|
271
|
+
- [x] ` └── get-tasks-in-file.js`
|
|
272
|
+
|
|
273
|
+
24 directories, 71 files
|
|
274
|
+
|
|
275
|
+
## Dependencies
|
|
276
|
+
lib/ProjectContext.js → lib/adapters/parsers/task/CardContentParser.js
|
|
277
|
+
lib/ProjectContext.js → lib/domain/entities/FileProjectContext.js
|
|
278
|
+
lib/adapters/__tests__/date-time.spec.js → lib/adapters/date-time.js
|
|
279
|
+
lib/adapters/__tests__/markdown.spec.js → lib/adapters/markdown.js
|
|
280
|
+
lib/adapters/markdown.js → path
|
|
281
|
+
lib/adapters/file-gateway.js → lib/tools.js
|
|
282
|
+
lib/adapters/file-gateway.js → fs
|
|
283
|
+
lib/adapters/file-gateway.js → path
|
|
284
|
+
lib/tools.js → crypto
|
|
285
|
+
lib/tools.js → path
|
|
286
|
+
lib/adapters/parsers/__tests__/content-transformer.spec.js → lib/adapters/parsers/content-transformer.js
|
|
287
|
+
lib/adapters/parsers/file/LocalFileParserFactory.js → lib/languages.js
|
|
288
|
+
lib/adapters/parsers/file/LocalFileParserFactory.js → lib/adapters/parsers/file/ReadStreamCodeParser.js
|
|
289
|
+
lib/adapters/parsers/file/LocalFileParserFactory.js → lib/adapters/parsers/file/ReadStreamMarkdownParser.js
|
|
290
|
+
lib/adapters/parsers/file/LocalFileParserFactory.js → fs
|
|
291
|
+
lib/adapters/parsers/file/LocalFileParserFactory.js → path
|
|
292
|
+
lib/adapters/parsers/file/ReadStreamCodeParser.js → lib/languages.js
|
|
293
|
+
lib/adapters/parsers/file/ReadStreamCodeParser.js → lib/adapters/parsers/task/CodeStyleTaskParser.js
|
|
294
|
+
lib/adapters/parsers/file/ReadStreamCodeParser.js → lib/adapters/parsers/file/ReadStreamTaskParser.js
|
|
295
|
+
lib/adapters/parsers/file/ReadStreamCodeParser.js → path
|
|
296
|
+
lib/adapters/parsers/file/ReadStreamCodeParser.js → stream
|
|
297
|
+
lib/adapters/parsers/task/CodeStyleTaskParser.js → lib/adapters/parsers/task/TaskParser.js
|
|
298
|
+
lib/adapters/parsers/file/ReadStreamTaskParser.js → readline
|
|
299
|
+
lib/adapters/parsers/file/ReadStreamMarkdownParser.js → lib/adapters/parsers/task/HashStyleTaskParser.js
|
|
300
|
+
lib/adapters/parsers/file/ReadStreamMarkdownParser.js → lib/adapters/parsers/task/MarkdownStyleTaskParser.js
|
|
301
|
+
lib/adapters/parsers/file/ReadStreamMarkdownParser.js → lib/adapters/parsers/file/ReadStreamTaskParser.js
|
|
302
|
+
lib/adapters/parsers/task/HashStyleTaskParser.js → lib/adapters/parsers/task/CardContentParser.js
|
|
303
|
+
lib/adapters/parsers/task/HashStyleTaskParser.js → lib/adapters/parsers/task/TaskParser.js
|
|
304
|
+
lib/adapters/parsers/task/MarkdownStyleTaskParser.js → lib/adapters/parsers/task/TaskParser.js
|
|
305
|
+
lib/adapters/parsers/file/__tests__/LocalFileParser.spec.js → lib/config.js
|
|
306
|
+
lib/adapters/parsers/file/__tests__/LocalFileParser.spec.js → lib/adapters/parsers/file/LocalFileParserFactory.js
|
|
307
|
+
lib/adapters/parsers/file/__tests__/LocalFileParser.spec.js → path
|
|
308
|
+
lib/config.js → lib/constants.js
|
|
309
|
+
lib/constants.js → path
|
|
310
|
+
lib/adapters/parsers/file/__tests__/ReadStreamMarkdownParser.spec.js → lib/config.js
|
|
311
|
+
lib/adapters/parsers/file/__tests__/ReadStreamMarkdownParser.spec.js → lib/adapters/parsers/file/ReadStreamMarkdownParser.js
|
|
312
|
+
lib/adapters/parsers/file/__tests__/ReadStreamMarkdownParser.spec.js → stream
|
|
313
|
+
lib/adapters/parsers/task/CheckStyleTaskParser.js → lib/adapters/parsers/task/TaskParser.js
|
|
314
|
+
lib/adapters/parsers/task/__tests__/CardContentParser.spec.js → lib/config.js
|
|
315
|
+
lib/adapters/parsers/task/__tests__/CardContentParser.spec.js → lib/constants.js
|
|
316
|
+
lib/adapters/parsers/task/__tests__/CardContentParser.spec.js → lib/adapters/parsers/task/CardContentParser.js
|
|
317
|
+
lib/adapters/readers/FileSystemProjectReader.js → lib/adapters/parsers/file/LocalFileParserFactory.js
|
|
318
|
+
lib/adapters/readers/FileSystemProjectReader.js → fs/promises
|
|
319
|
+
lib/adapters/readers/FileSystemProjectReader.js → path
|
|
320
|
+
lib/adapters/storage/config.js → lib/config.js
|
|
321
|
+
lib/adapters/storage/config.js → lib/constants.js
|
|
322
|
+
lib/adapters/storage/config.js → lib/adapters/file-gateway.js
|
|
323
|
+
lib/adapters/storage/config.js → lib/adapters/yaml.js
|
|
324
|
+
lib/adapters/storage/config.js → path
|
|
325
|
+
lib/adapters/storage/tags.js → lib/constants.js
|
|
326
|
+
lib/adapters/storage/tags.js → lib/adapters/file-gateway.js
|
|
327
|
+
lib/adapters/storage/tags.js → lib/adapters/yaml.js
|
|
328
|
+
lib/adapters/storage/tags.js → path
|
|
329
|
+
lib/card.js → lib/adapters/markdown.js
|
|
330
|
+
lib/card.js → lib/adapters/parsers/content-transformer.js
|
|
331
|
+
lib/card.js → lib/adapters/parsers/function-parser.js
|
|
332
|
+
lib/card.js → lib/task.js
|
|
333
|
+
lib/card.js → path
|
|
334
|
+
lib/task.js → lib/adapters/markdown.js
|
|
335
|
+
lib/task.js → lib/adapters/parsers/task/CardContentParser.js
|
|
336
|
+
lib/task.js → lib/tools.js
|
|
337
|
+
lib/task.js → util
|
|
338
|
+
lib/context/ApplicationContext.js → lib/config.js
|
|
339
|
+
lib/context/ApplicationContext.js → lib/plugins/plugin-registry.js
|
|
340
|
+
lib/plugins/plugin-registry.js → lib/adapters/markdown.js
|
|
341
|
+
lib/plugins/plugin-registry.js → https
|
|
342
|
+
lib/context/StreamingApplicationContext.js → lib/config.js
|
|
343
|
+
lib/controlers/SaveViewController.js → lib/context/ApplicationContext.js
|
|
344
|
+
lib/controlers/SaveViewController.js → lib/domain/usecases/SaveViewUsecase.js
|
|
345
|
+
lib/domain/usecases/SaveViewUsecase.js → lib/context/ApplicationContext.js
|
|
346
|
+
lib/domain/usecases/SaveViewUsecase.js → lib/domain/entities/View.js
|
|
347
|
+
lib/domain/usecases/SaveViewUsecase.js → lib/domain/usecases/GetViewsUsecase.js
|
|
348
|
+
lib/domain/usecases/SaveViewUsecase.js → crypto
|
|
349
|
+
lib/domain/usecases/GetViewsUsecase.js → lib/context/ApplicationContext.js
|
|
350
|
+
lib/domain/usecases/GetViewsUsecase.js → lib/list.js
|
|
351
|
+
lib/domain/usecases/GetViewsUsecase.js → lib/domain/entities/View.js
|
|
352
|
+
lib/controlers/__tests__/SaveViewController.spec.js → lib/domain/entities/View.js
|
|
353
|
+
lib/controlers/__tests__/SaveViewController.spec.js → lib/project-factory.js
|
|
354
|
+
lib/controlers/__tests__/SaveViewController.spec.js → lib/controlers/SaveViewController.js
|
|
355
|
+
lib/controlers/__tests__/SaveViewController.spec.js → path
|
|
356
|
+
lib/project-factory.js → lib/context/ApplicationContext.js
|
|
357
|
+
lib/project-factory.js → lib/mixins/repo-fs-store.js
|
|
358
|
+
lib/project-factory.js → lib/mixins/repo-watched-fs-store.js
|
|
359
|
+
lib/project-factory.js → lib/project.js
|
|
360
|
+
lib/project-factory.js → lib/ProjectContext.js
|
|
361
|
+
lib/project-factory.js → lib/repository.js
|
|
362
|
+
lib/mixins/repo-fs-store.js → lib/adapters/yaml.js
|
|
363
|
+
lib/mixins/repo-fs-store.js → lib/config.js
|
|
364
|
+
lib/mixins/repo-fs-store.js → lib/constants.js
|
|
365
|
+
lib/mixins/repo-fs-store.js → lib/file.js
|
|
366
|
+
lib/mixins/repo-fs-store.js → lib/languages.js
|
|
367
|
+
lib/mixins/repo-fs-store.js → lib/migrate-config.js
|
|
368
|
+
lib/mixins/repo-fs-store.js → lib/repository.js
|
|
369
|
+
lib/mixins/repo-fs-store.js → lib/tools.js
|
|
370
|
+
lib/mixins/repo-fs-store.js → fs
|
|
371
|
+
lib/mixins/repo-fs-store.js → path
|
|
372
|
+
lib/file.js → lib/adapters/date-time.js
|
|
373
|
+
lib/file.js → lib/adapters/parsers/task/CardContentParser.js
|
|
374
|
+
lib/file.js → lib/card.js
|
|
375
|
+
lib/file.js → lib/context/ApplicationContext.js
|
|
376
|
+
lib/file.js → lib/languages.js
|
|
377
|
+
lib/file.js → lib/task.js
|
|
378
|
+
lib/file.js → lib/tools.js
|
|
379
|
+
lib/file.js → crypto
|
|
380
|
+
lib/file.js → events
|
|
381
|
+
lib/file.js → path
|
|
382
|
+
lib/file.js → util
|
|
383
|
+
lib/migrate-config.js → lib/default-settings.js
|
|
384
|
+
lib/migrate-config.js → path
|
|
385
|
+
lib/default-settings.js → lib/adapters/yaml.js
|
|
386
|
+
lib/repository.js → lib/adapters/parsers/DateLanguageParser.js
|
|
387
|
+
lib/repository.js → lib/adapters/parsers/task/CardContentParser.js
|
|
388
|
+
lib/repository.js → lib/card.js
|
|
389
|
+
lib/repository.js → lib/config.js
|
|
390
|
+
lib/repository.js → lib/constants.js
|
|
391
|
+
lib/repository.js → lib/context/ApplicationContext.js
|
|
392
|
+
lib/repository.js → lib/file.js
|
|
393
|
+
lib/repository.js → lib/languages.js
|
|
394
|
+
lib/repository.js → lib/list.js
|
|
395
|
+
lib/repository.js → lib/task.js
|
|
396
|
+
lib/repository.js → lib/tools.js
|
|
397
|
+
lib/repository.js → events
|
|
398
|
+
lib/repository.js → path
|
|
399
|
+
lib/repository.js → util
|
|
400
|
+
lib/mixins/repo-watched-fs-store.js → lib/constants.js
|
|
401
|
+
lib/mixins/repo-watched-fs-store.js → lib/file.js
|
|
402
|
+
lib/mixins/repo-watched-fs-store.js → lib/mixins/repo-fs-store.js
|
|
403
|
+
lib/mixins/repo-watched-fs-store.js → fs
|
|
404
|
+
lib/project.js → lib/adapters/date-time.js
|
|
405
|
+
lib/project.js → lib/adapters/file-gateway.js
|
|
406
|
+
lib/project.js → lib/adapters/markdown.js
|
|
407
|
+
lib/project.js → lib/adapters/parsers/content-transformer.js
|
|
408
|
+
lib/project.js → lib/adapters/parsers/function-parser.js
|
|
409
|
+
lib/project.js → lib/card.js
|
|
410
|
+
lib/project.js → lib/constants.js
|
|
411
|
+
lib/project.js → lib/plugins/plugin-manager.js
|
|
412
|
+
lib/project.js → lib/repository.js
|
|
413
|
+
lib/project.js → lib/task.js
|
|
414
|
+
lib/project.js → child_process
|
|
415
|
+
lib/project.js → path
|
|
416
|
+
lib/plugins/plugin-manager.js → lib/adapters/file-gateway.js
|
|
417
|
+
lib/plugins/plugin-manager.js → lib/adapters/git-download.js
|
|
418
|
+
lib/plugins/plugin-manager.js → lib/context/ApplicationContext.js
|
|
419
|
+
lib/plugins/plugin-manager.js → events
|
|
420
|
+
lib/plugins/plugin-manager.js → path
|
|
421
|
+
lib/domain/usecases/OpenProjectUsecase.js → lib/context/ApplicationContext.js
|
|
422
|
+
lib/domain/usecases/__tests__/OpenProjectUsecase.spec.js → lib/context/ApplicationContext.js
|
|
423
|
+
lib/domain/usecases/__tests__/OpenProjectUsecase.spec.js → lib/domain/usecases/OpenProjectUsecase.js
|
|
424
|
+
lib/domain/usecases/__tests__/SaveViewUsecase.spec.js → lib/context/ApplicationContext.js
|
|
425
|
+
lib/domain/usecases/__tests__/SaveViewUsecase.spec.js → lib/domain/usecases/SaveViewUsecase.js
|
|
426
|
+
lib/plugins/archive-plugin.js → lib/adapters/parsers/task/CardContentParser.js
|
|
427
|
+
lib/plugins/archive-plugin.js → path
|
|
428
|
+
lib/plugins/default-board-properties-plugin.js → lib/adapters/date-time.js
|
|
429
|
+
lib/plugins/default-board-properties-plugin.js → path
|
|
430
|
+
lib/plugins/extension-plugin.js → fs
|
|
431
|
+
lib/plugins/extension-plugin.js → path
|
|
432
|
+
lib/plugins/persist-tags-plugin.js → lib/adapters/storage/tags.js
|
|
433
|
+
lib/usecases/__tests__/get-project-tags.spec.js → test/helper.js
|
|
434
|
+
lib/usecases/__tests__/get-project-tags.spec.js → lib/project-factory.js
|
|
435
|
+
lib/usecases/__tests__/get-project-tags.spec.js → lib/usecases/get-project-tags.js
|
|
436
|
+
lib/usecases/__tests__/get-project-tags.spec.js → path
|
|
437
|
+
test/helper.js → path
|
|
438
|
+
lib/usecases/get-project-tags.js → lib/adapters/storage/config.js
|
|
439
|
+
lib/usecases/get-project-tags.js → lib/adapters/storage/tags.js
|
|
440
|
+
lib/usecases/__tests__/get-tasks-in-file.spec.js → test/helper.js
|
|
441
|
+
lib/usecases/__tests__/get-tasks-in-file.spec.js → lib/usecases/get-tasks-in-file.js
|
|
442
|
+
lib/usecases/__tests__/get-tasks-in-file.spec.js → fs
|
|
443
|
+
lib/usecases/__tests__/get-tasks-in-file.spec.js → path
|
|
444
|
+
lib/usecases/get-tasks-in-file.js → lib/adapters/parsers/file/LocalFileParserFactory.js
|
|
445
|
+
lib/usecases/get-tasks-in-file.js → lib/adapters/storage/config.js
|
|
446
|
+
lib/usecases/get-tasks-in-file.js → stream
|
package/lib/ProjectContext.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { FileProjectContext } from './FileProjectContext.js'
|
|
2
|
+
import { isNumber, toNumber } from './adapters/parsers/task/CardContentParser.js'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export class ProjectContext extends FileProjectContext {
|
|
5
5
|
constructor(repo) {
|
|
6
6
|
super()
|
|
7
7
|
this.repo = repo
|
|
@@ -12,7 +12,7 @@ module.exports = class ProjectContext extends FileProjectContext {
|
|
|
12
12
|
if (config && config.keepEmptyPriority && order === undefined) return
|
|
13
13
|
const tasks =
|
|
14
14
|
list && this.repo.listExists(list) ? this.repo.getTasksInList(list) : []
|
|
15
|
-
return
|
|
15
|
+
return this.determineOrder(config, order, tasks)
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
get config() {
|
|
@@ -22,21 +22,22 @@ module.exports = class ProjectContext extends FileProjectContext {
|
|
|
22
22
|
toJSON() {
|
|
23
23
|
return null
|
|
24
24
|
}
|
|
25
|
-
}
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
determineOrder(config, order, tasks) {
|
|
27
|
+
if (isNumber(order)) return toNumber(order)
|
|
28
|
+
if (!config) return
|
|
29
|
+
if (config.keepEmptyPriority) return
|
|
30
|
+
if (tasks) {
|
|
31
|
+
if (tasks.length == 0) {
|
|
32
|
+
return 0
|
|
33
|
+
} else if (config.isAddNewCardsToTop()) {
|
|
34
|
+
return (isNumber(tasks[0].order) ? toNumber(tasks[0].order) : 0) - 10
|
|
35
|
+
} else {
|
|
36
|
+
const lastTask = tasks[tasks.length - 1]
|
|
37
|
+
return (lastTask && isNumber(lastTask.order) ? lastTask.order : 0) + 10
|
|
38
|
+
}
|
|
39
39
|
}
|
|
40
|
+
return 0
|
|
40
41
|
}
|
|
41
|
-
|
|
42
|
+
|
|
42
43
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import moment from "moment";
|
|
2
2
|
let innerNoDST = false;
|
|
3
3
|
|
|
4
|
-
function setNoDST(noDST) {
|
|
4
|
+
export function setNoDST(noDST) {
|
|
5
5
|
innerNoDST = noDST;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
function getIsoDateWithOffset (date) {
|
|
8
|
+
export function getIsoDateWithOffset (date) {
|
|
9
9
|
const momentDate = moment(date);
|
|
10
10
|
if (momentDate.isDST() && innerNoDST) {
|
|
11
11
|
const offset = momentDate.utcOffset();
|
|
@@ -13,8 +13,3 @@ function getIsoDateWithOffset (date) {
|
|
|
13
13
|
}
|
|
14
14
|
return momentDate.format();
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
module.exports = {
|
|
18
|
-
setNoDST,
|
|
19
|
-
getIsoDateWithOffset
|
|
20
|
-
}
|